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
/
Views
/
Baseline
/
View File Name :
_RemittanceTab.cshtml
@model RER_Project.DataAccess.ViewModels.MemberDetailView @using RER_Project.BusinessLayer.BusinessService @using RER_Project.Core.Helpers @{ var meta = AppUserService.GetCurrent(); } <form id="CreateRemittance"> <input type="hidden" id="RemittanceId" name="Id" /> <div class="row"> <div class="form-group col-md-6"> <strong style="font-size:14px"><u>Total Income From Remittance :</u> MVR. </strong> <span style="font-size:16px" id="TotalFamilyIncome"></span> </div> <br /> </div> <div class="row"> <div class="form-group col-md-3"> <label><strong>Productive Investment </strong> </label> <div class="inputWithIcon"> <input type="text" class="curr form-control required currencyFormatter" onkeypress="return isNumberKey(this,event)" maxlength="12" name="ProductiveInvestment" id="ProductiveInvestment"> <span><strong>MVR</strong></span> </div> @* <input type="text" onkeypress="return isNumberKey(this,event)" maxlength="8" class=" form-control required" id="ProductiveInvestment" name="ProductiveInvestment" />*@ </div> <div class="form-group col-md-3"> <label><strong>Expenses Consumption</strong> </label> <div class="inputWithIcon"> <input type="text" class="curr form-control required currencyFormatter" onkeypress="return isNumberKey(this,event)" maxlength="12" name="ExpensesConsumption" id="ExpensesConsumption"> <span><strong>MVR</strong></span> </div> @*<input type="text" onkeypress="return isNumberKey(this,event)" maxlength="8" class=" form-control required" id="ExpensesConsumption" name="ExpensesConsumption" />*@ </div> <div class="form-group col-md-3"> <label><strong>Loan Payment</strong> </label> <div class="inputWithIcon"> <input type="text" class="curr form-control required currencyFormatter" onkeypress="return isNumberKey(this,event)" maxlength="12" name="LoanPayment" id="LoanPayment"> <span><strong>MVR</strong></span> </div> @* <input type="text" onkeypress="return isNumberKey(this,event)" maxlength="8" class=" form-control required" id="LoanPayment" name="LoanPayment" />*@ </div> <div class="form-group col-md-3"> <label><strong>Assets Purchase</strong> </label> <div class="inputWithIcon"> <input type="text" class="curr form-control required currencyFormatter" onkeypress="return isNumberKey(this,event)" maxlength="12" name="AssetsPurchase" id="AssetsPurchase"> <span><strong>MVR</strong></span> </div> @* <input type="text" onkeypress="return isNumberKey(this,event)" maxlength="8" class=" form-control required" id="AssetsPurchase" name="AssetsPurchase" />*@ </div> <div class="form-group col-md-3"> <label><strong>Remittance Saving</strong> </label> <div class="inputWithIcon"> <input type="text" class="curr form-control required currencyFormatter" onkeypress="return isNumberKey(this,event)" maxlength="12" disabled name="RemittanceSaving" id="RemittanceSaving"> <span><strong>MVR</strong></span> </div> @*<input type="text" onkeypress="return isNumberKey(this,event)" maxlength="8" class=" form-control required" id="RemittanceSaving" name="Saving" />*@ </div> <div class="col-md-3" style="padding-top:4px"> <br /> <div> @if (Model.IsActive) { if (meta.RoleId == (int)EnumRoleHelper.Roles.Admin || meta.RoleId == (int)EnumRoleHelper.Roles.MnE || meta.RoleId == (int)EnumRoleHelper.Roles.MnEOfficer) { <input type="button" value="Save" class="btn btn-primary" id="SubmitRemittance" /> } } <a href="/group-members?groupId=@Model.GroupId" class="btn btn-default"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> Back</a> </div> </div> </div> <div class="row"> <div class="form-group col-lg-12"> <div class="pull-left"> <a class="btn btn-primary btnPrevious"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> Previous</a> <a class="btn btn-primary btnNext">Next <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></a> </div> </div> </div> </form> <script type="text/javascript"> function loadRemittance() { const ajax = request(); function request() { const url = '/baseline/remittance/member/' + @Model.Id; return window.getAjaxRequest(url, "Get", @Model.Id); } ajax.done(function (response) { $('#RemittanceId').val(response.Id); $('#ProductiveInvestment').val(getNumberWithComma(response.ProductiveInvestment||0)); $('#ExpensesConsumption').val(getNumberWithComma(response.ExpensesConsumption||0)); $('#LoanPayment').val(getNumberWithComma(response.LoanPayment||0)); $('#AssetsPurchase').val(getNumberWithComma(response.AssetsPurchase||0)); $('#RemittanceSaving').val(getNumberWithComma(response.Saving||0)); }); ajax.fail(function (xhr) { ShowMessage("error", xhr.responseText); }); } $("#SubmitRemittance").off("click").on("click", function () { function request(model) { const url = "/baseline/remittance/create"; const data = JSON.stringify(model); return window.getAjaxRequest(url, "POST", data); } const form = $("#CreateRemittance"); $.validator.unobtrusive.parse(form); if (!form.valid()) { return false; }; if (!window.confirmAction()) { return; }; WorkForce.loader.show(); var allFormData = window.serializeForm(form); var productionInvestment = removeCommaFromString($('#ProductiveInvestment').val()); var expenseConsumption = removeCommaFromString($('#ExpensesConsumption').val()); var loanPayment = removeCommaFromString($('#LoanPayment').val()); var assetPurchase = removeCommaFromString($('#AssetsPurchase').val()); var saving = removeCommaFromString($('#RemittanceSaving').val()); var totalIncome = removeCommaFromString(document.getElementById("TotalFamilyIncome").outerText); var enteredData = productionInvestment + expenseConsumption + loanPayment + assetPurchase + saving; debugger; if (totalIncome < enteredData) { ShowMessage("error", `Total Income must be equal to sum of investment ,expenseconsumption,loanpayment,asset,saving}`); WorkForce.loader.hide(); return; } function getModel() { return (getBaseLineRemittance()); } function getBaseLineRemittance() { var remittanceData = {}; remittanceData.Id = $('#RemittanceId').val(); remittanceData.BaselineId = $('#baselineId').val(); remittanceData.GroupId = '@Model.GroupId'; remittanceData.MemberId = '@Model.Id'; remittanceData.DistrictId = '@Model.DistrictId'; remittanceData.ProductiveInvestment = productionInvestment; remittanceData.ExpensesConsumption = expenseConsumption; remittanceData.LoanPayment = loanPayment; remittanceData.AssetsPurchase = assetPurchase; remittanceData.Saving = saving; return remittanceData; } const model = getModel(); const ajax = request(model); ajax.done(function (response) { debugger; WorkForce.loader.hide(); // window.scrollTo(0, 0); showNotification("success"); // showAllTabs(response); }); function showAllTabs(response) { $('#myTab li:nth-child(2)').show(); $('#myTab li:nth-child(3)').show(); $('#myTab li:nth-child(4)').show(); $('#myTab li:nth-child(5)').show(); document.getElementById('baselineId').value = response; } ajax.fail(function (xhr) { WorkForce.loader.hide(); debugger; ShowMessage("error", xhr.responseText); }); }) 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) { var result = parseFloat(value.replace(/,/g, '')); if (isNaN(result)) { return 0; } else { return result; } } $("#ProductiveInvestment").bind("change paste keyup", function () { var productionInvestments = removeCommaFromString($("#ProductiveInvestment").val()); var expenseConsumption = removeCommaFromString($("#ExpensesConsumption").val()); var loanPayment = removeCommaFromString($("#LoanPayment").val()); var assetsPurchase = removeCommaFromString($("#AssetsPurchase").val()); var remittanceSaving = removeCommaFromString($("#RemittanceSaving").val()); var totalFamilyIncome = removeCommaFromString(document.getElementById("TotalFamilyIncome").outerText); var finalRemittanceSaving = totalFamilyIncome - productionInvestments - expenseConsumption - loanPayment - assetsPurchase; if (finalRemittanceSaving < 0) { ShowMessage("error", `Remittance Saving cannot be less than Zero}`); $("#RemittanceSaving").val(''); } else { $('#RemittanceSaving').val(getNumberWithComma(finalRemittanceSaving)); } }); $("#ExpensesConsumption").bind("change paste keyup", function () { var productionInvestments = removeCommaFromString($("#ProductiveInvestment").val()); var expenseConsumption = removeCommaFromString($("#ExpensesConsumption").val()); var loanPayment = removeCommaFromString($("#LoanPayment").val()); var assetsPurchase = removeCommaFromString($("#AssetsPurchase").val()); var remittanceSaving = removeCommaFromString($("#RemittanceSaving").val()); var totalFamilyIncome = removeCommaFromString(document.getElementById("TotalFamilyIncome").outerText); var finalRemittanceSaving = totalFamilyIncome - productionInvestments - expenseConsumption - loanPayment - assetsPurchase; if (finalRemittanceSaving < 0) { ShowMessage("error", `Remittance Saving cannot be less than Zero}`); $("#RemittanceSaving").val(''); } else { $('#RemittanceSaving').val(getNumberWithComma(finalRemittanceSaving)); } }); $("#LoanPayment").bind("change paste keyup", function () { var productionInvestments = removeCommaFromString($("#ProductiveInvestment").val()); var expenseConsumption = removeCommaFromString($("#ExpensesConsumption").val()); var loanPayment = removeCommaFromString($("#LoanPayment").val()); var assetsPurchase = removeCommaFromString($("#AssetsPurchase").val()); var remittanceSaving = removeCommaFromString($("#RemittanceSaving").val()); var totalFamilyIncome = removeCommaFromString(document.getElementById("TotalFamilyIncome").outerText); var finalRemittanceSaving = totalFamilyIncome - productionInvestments - expenseConsumption - loanPayment - assetsPurchase; if (finalRemittanceSaving < 0) { ShowMessage("error", `Remittance Saving cannot be less than Zero}`); $("#RemittanceSaving").val(''); } else { $('#RemittanceSaving').val(getNumberWithComma(finalRemittanceSaving)); } }); $("#AssetsPurchase").bind("change paste keyup", function () { var productionInvestments = removeCommaFromString($("#ProductiveInvestment").val()); var expenseConsumption = removeCommaFromString($("#ExpensesConsumption").val()); var loanPayment = removeCommaFromString($("#LoanPayment").val()); var assetsPurchase = removeCommaFromString($("#AssetsPurchase").val()); var remittanceSaving = removeCommaFromString($("#RemittanceSaving").val()); var totalFamilyIncome = removeCommaFromString(document.getElementById("TotalFamilyIncome").outerText); var finalRemittanceSaving = totalFamilyIncome - productionInvestments - expenseConsumption - loanPayment - assetsPurchase; if (finalRemittanceSaving < 0) { ShowMessage("error", `Remittance Saving cannot be less than Zero}`); $("#RemittanceSaving").val(''); } else { $('#RemittanceSaving').val(getNumberWithComma(finalRemittanceSaving)); } }); </script>