fix register problems
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class MonthlyInstallment
|
||||
{
|
||||
/// <summary>
|
||||
/// مبلغ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstallmentAmountStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstalmentDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شمارنده قسط
|
||||
/// </summary>
|
||||
public string InstallmentCounter{ get; set; }
|
||||
}
|
||||
@@ -23,28 +23,54 @@ public class ReviewAndPaymentViewModel
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double WithoutTaxPaymentDouble { get; set; }
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string WithoutTaxPaymentStr { get; set; }
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double TotalPaymentDouble { get; set; }
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string TotalPaymentStr { get; set; }
|
||||
public string OneTimeTotalPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyTotalPaymentStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// Double
|
||||
@@ -83,4 +109,9 @@ public class ReviewAndPaymentViewModel
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست اقساط ماهیانه
|
||||
/// </summary>
|
||||
public List<MonthlyInstallment> MonthlyInstallments { get; set; }
|
||||
}
|
||||
@@ -367,7 +367,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime")
|
||||
{
|
||||
{
|
||||
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
@@ -409,32 +410,92 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
if (paymentModel == "OneTime")//تخفیف 10 درصدی درصورت پرداخت یکجا
|
||||
{
|
||||
//پرداخت یکجا
|
||||
#region OneTimePaymentResult
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.WithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.WithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
//پرداخت ماهیانه
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.TotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
else
|
||||
{
|
||||
//مبلغ بدون مالیات
|
||||
result.WithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.WithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
//مبلغ بدون مالیات
|
||||
result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.TotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
var startDate = (DateTime.Now).ToFarsi();
|
||||
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
if (periodModel == "1")
|
||||
{
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "قسط شماره یک",
|
||||
InstalmentDate = startDate
|
||||
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
}
|
||||
else
|
||||
{
|
||||
int instalmentCount = Convert.ToInt32(periodModel);
|
||||
var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
for (int i = 1; i <= instalmentCount; i++)
|
||||
{
|
||||
if (i > 1)
|
||||
{
|
||||
var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
startDate = currentMonthStart.FindeEndOfMonth();
|
||||
findEndOfMonth = startDate;
|
||||
}
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
InstallmentCounter = i switch
|
||||
{
|
||||
1 => "قسط شماره یک",
|
||||
2 => "قسط شماره دو",
|
||||
3 => "قسط شماره سه",
|
||||
4 => "قسط شماره چهار",
|
||||
5 => "قسط شماره پنج",
|
||||
6 => "قسط شماره شش",
|
||||
7 => "قسط شماره هفت",
|
||||
8 => "قسط شماره هشت",
|
||||
9 => "قسط شماره نه",
|
||||
10 => "قسط شماره ده",
|
||||
11 => "قسط شماره یازده",
|
||||
12 => "قسط شماره دوازده",
|
||||
_ => "قسط شماره دوازده",
|
||||
},
|
||||
InstalmentDate = startDate
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
</div>
|
||||
|
||||
<div id="step4" class="step m-auto">
|
||||
<div class="container" id="step-form4">
|
||||
<div class="container-fluid" id="step-form4">
|
||||
<partial name="_Partials/_Step4" />
|
||||
</div>
|
||||
<div class="stepBtnHolder4">
|
||||
@@ -256,7 +256,7 @@
|
||||
|
||||
|
||||
<div id="step5" class="step m-auto">
|
||||
<div class="container" id="step-form5">
|
||||
<div class="container-fluid" id="step-form5">
|
||||
<partial name="_Partials/_Step5" />
|
||||
</div>
|
||||
<div class="w-100">
|
||||
|
||||
@@ -73,9 +73,20 @@ namespace ServiceHost.Pages.register
|
||||
{
|
||||
data = result,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCreateOrUpdatePeriodTemp(List<WorkshopTempViewModel> command,long contractingPartyTempId)
|
||||
{
|
||||
var result = await _temporaryClientRegistrationApplication.CreateOrUpdateWorkshopTemp(command, contractingPartyTempId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> OnPostCreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax)
|
||||
{
|
||||
var result = await _temporaryClientRegistrationApplication.CreateOrUpdateInstitutionContractTemp(contractingPartyTempId, periodModel, paymentModel, totalPayment, valueAddedTax);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<div class="row p-0">
|
||||
<div class="text-center mb-5">
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 621.6 721.91" style="width: 150px;">
|
||||
<svg id="logoSvg" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 621.6 721.91">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
|
||||
<div class="row p-0 step4Container">
|
||||
<div class="cardHeight p-0">
|
||||
<div class="cardContainer" id="cardSelected">
|
||||
<div class="cardContainer p-0" id="cardSelected">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-100 p-0">
|
||||
<div style="display: flex; gap: 15px; margin: auto 20px 0 0;">
|
||||
<div class="w-100 p-0" id="footerTap">
|
||||
<div style="display: flex; margin: auto 20px 0 0;">
|
||||
<button type="button" class="btnStep4Tab active" id="priceStatic">
|
||||
پرداخت یکجا
|
||||
</button>
|
||||
<button type="button" class="btnStep4Tab disable" id="priceStep">
|
||||
<button type="button" class="btnStep4Tab" id="priceStep">
|
||||
پرداخت مرحله ای
|
||||
</button>
|
||||
</div>
|
||||
@@ -23,16 +23,16 @@
|
||||
<div class="footerStep4Container">
|
||||
<div class="titleFooter">مدت قرارداد</div>
|
||||
<div class="radioBtnFooterContainer">
|
||||
<input type="radio" id="oneMonth" value="1" name="radMonth" class="radioOption" disabled="disabled">
|
||||
<label for="oneMonth" class="radioLabelListOption disable">1 ماهه</label>
|
||||
<input type="radio" id="oneMonth" value="oneMonth" name="radMonth" class="radioOption" />
|
||||
<label for="oneMonth" class="radioLabelListOption">1 ماهه</label>
|
||||
|
||||
<input type="radio" id="threeMonth" value="3" name="radMonth" class="radioOption" disabled="disabled">
|
||||
<label for="threeMonth" class="radioLabelListOption disable">3 ماهه</label>
|
||||
<input type="radio" id="threeMonth" value="threeMonth" name="radMonth" class="radioOption" />
|
||||
<label for="threeMonth" class="radioLabelListOption">3 ماهه</label>
|
||||
|
||||
<input type="radio" id="sixMonth" value="6" name="radMonth" class="radioOption" disabled="disabled">
|
||||
<label for="sixMonth" class="radioLabelListOption disable">6 ماهه</label>
|
||||
<input type="radio" id="sixMonth" value="sixMonth" name="radMonth" class="radioOption" />
|
||||
<label for="sixMonth" class="radioLabelListOption">6 ماهه</label>
|
||||
|
||||
<input type="radio" id="twelveMonth" value="12" name="radMonth" class="radioOption" checked="checked">
|
||||
<input type="radio" id="twelveMonth" value="twelveMonth" name="radMonth" class="radioOption" checked="checked" />
|
||||
<label for="twelveMonth" class="radioLabelListOption">12 ماهه</label>
|
||||
</div>
|
||||
|
||||
@@ -40,48 +40,48 @@
|
||||
<div class="infoPricesContainer" id="priceStepContainer" style="display: none">
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">سررسید : اول</div>
|
||||
<div class="col-4 text-start">1404/01/30</div>
|
||||
<div class="col-4 text-end">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
<div class="col-4 text-start">-</div>
|
||||
<div class="col-4 text-end">- ریال</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">سررسید : دوم</div>
|
||||
<div class="col-4 text-start">1404/01/30</div>
|
||||
<div class="col-4 text-end">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
<div class="col-4 text-start">-</div>
|
||||
<div class="col-4 text-end">- ریال</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">سررسید : سوم</div>
|
||||
<div class="col-4 text-start">1404/01/30</div>
|
||||
<div class="col-4 text-end">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
<div class="col-4 text-start">-</div>
|
||||
<div class="col-4 text-end">- ریال</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">سررسید : چهارم</div>
|
||||
<div class="col-4 text-start">1404/01/30</div>
|
||||
<div class="col-4 text-end">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
<div class="col-4 text-start">-</div>
|
||||
<div class="col-4 text-end">- ریال</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">سررسید : پنجم</div>
|
||||
<div class="col-4 text-start">1404/01/30</div>
|
||||
<div class="col-4 text-end">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
<div class="col-4 text-start">-</div>
|
||||
<div class="col-4 text-end">- ریال</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">سررسید : ششم</div>
|
||||
<div class="col-4 text-start">1404/01/30</div>
|
||||
<div class="col-4 text-end">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
<div class="col-4 text-start">-</div>
|
||||
<div class="col-4 text-end">- ریال</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="lineRegisterStep4 px-2"></div>
|
||||
<div class="my-3">
|
||||
<div class="d-flex align-items-center justify-content-between px-4">
|
||||
<div class="d-flex align-items-center justify-content-between px-1 px-lg-4">
|
||||
<div class="titlePriceStep4">مجموع مبالغ:</div>
|
||||
<div class="totalPriceStep4" id="sumOfWorkshopsPaymentPayment">-</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between px-4">
|
||||
<div class="d-flex align-items-center justify-content-between px-1 px-lg-4">
|
||||
<div class="titlePriceStep4">ارزش افزوده:</div>
|
||||
<div class="totalPriceStep4" id="valueAddedTaxSt">-</div>
|
||||
<input type="hidden" id="valueAddedTaxDoubleInput" />
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between mt-1 px-4">
|
||||
<div class="d-flex align-items-center justify-content-between mt-1 px-1 px-lg-4">
|
||||
<div class="titlePriceStep4">مبلغ قابل پرداخت:</div>
|
||||
<div class="totalPriceStep4" id="totalPaymentStr">-</div>
|
||||
<input type="hidden" id="totalPaymentDoubleInput" />
|
||||
@@ -96,6 +96,7 @@
|
||||
var receivedCodeFromServerUrl = `@Url.Page("./Index", "ReceivedCodeFromServer")`;
|
||||
var totalPaymentAndWorkshopListUrl = `@Url.Page("./Index", "TotalPaymentAndWorkshopList")`;
|
||||
var createOrUpdateInstitutionContractTemp = `@Url.Page("./Index", "CreateOrUpdateInstitutionContractTemp")`;
|
||||
var CreateOrUpdatePeriodTemp = `@Url.Page("./Index", "CreateOrUpdatePeriodTemp")`;
|
||||
</script>
|
||||
|
||||
<script src="~/assetsclient/pages/Register/js/_Partials/_Step4.js?ver=@clientVersion"></script>
|
||||
@@ -28,21 +28,21 @@
|
||||
</div>
|
||||
|
||||
<div class="lineRegisterStep5 px-2"></div>
|
||||
<div class="w-100 px-2 my-3">
|
||||
@* <div class="d-flex align-items-center justify-content-between my-4 px-4">
|
||||
<div class="w-100 my-3">
|
||||
@* <div class="d-flex align-items-center justify-content-between my-4 px-1 px-lg-4">
|
||||
<div class="titlePriceStep5">مبلغ قابل پرداخت:</div>
|
||||
<div class="totalPriceStep5">۲۵,۰۰۰,۰۰۰ ریال</div>
|
||||
</div> *@
|
||||
|
||||
<div class="d-flex align-items-center justify-content-between px-4">
|
||||
<div class="d-flex align-items-center justify-content-between px-1 px-lg-4">
|
||||
<div class="titlePriceStep5">مجموع مبالغ:</div>
|
||||
<div class="totalPriceStep5" id="sumOfWorkshopsPaymentPaymentStep5">-</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between px-4">
|
||||
<div class="d-flex align-items-center justify-content-between px-1 px-lg-4">
|
||||
<div class="titlePriceStep5">ارزش افزوده:</div>
|
||||
<div class="totalPriceStep5" id="valueAddedTaxStStep5">-</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between mt-1 px-4">
|
||||
<div class="d-flex align-items-center justify-content-between mt-1 px-1 px-lg-4">
|
||||
<div class="titlePriceStep5">مبلغ قابل پرداخت:</div>
|
||||
<div class="totalPriceStep5" id="totalPaymentStrStep5">-</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
.registerTitleSteps {
|
||||
body {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.registerTitleSteps {
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
color: #22A8A8;
|
||||
@@ -160,7 +165,9 @@
|
||||
color: #A3E635;
|
||||
}
|
||||
|
||||
|
||||
#logoSvg {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
|
||||
.customRegisterForm {
|
||||
@@ -315,6 +322,10 @@
|
||||
font-size: 13px !important;
|
||||
width: 122px !important;
|
||||
}
|
||||
|
||||
#logoSvg {
|
||||
width: 130px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:992px) {
|
||||
@@ -337,6 +348,15 @@
|
||||
.progressSteps.currentStep {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
body {
|
||||
height: auto;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#logoSvg {
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
|
||||
.main {
|
||||
max-height: 480px;
|
||||
height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
.cardHeight {
|
||||
height: 500px;
|
||||
height: 50%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
@@ -180,6 +180,9 @@
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
height: 120px;
|
||||
overflow: auto;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.infoPricesContainer .item {
|
||||
@@ -229,9 +232,9 @@
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.cardHeight {
|
||||
/*.cardHeight {
|
||||
height: 260px;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@media (max-width:992px) {
|
||||
@@ -245,8 +248,12 @@
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.cardHeight {
|
||||
/*.cardHeight {
|
||||
height: 48vh;
|
||||
}*/
|
||||
|
||||
.checkLabelListOption {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
.descriptionContainerStep5 {
|
||||
overflow-y: auto;
|
||||
height: 66vh;
|
||||
height: 60vh;
|
||||
}
|
||||
|
||||
.titleDescStep5 {
|
||||
|
||||
@@ -71,7 +71,7 @@ async function checkInputsStep1() {
|
||||
birthDate: birthdate,
|
||||
nationalCode: nationalCode
|
||||
};
|
||||
console.log(commandStep1);
|
||||
|
||||
var btnDisable = $('#btnGetUidInfo').addClass('disable');
|
||||
var loading = $('#btnGetUidInfo .loading').show();
|
||||
|
||||
@@ -87,13 +87,15 @@ async function checkInputsStep1() {
|
||||
btnDisable.removeClass('disable');
|
||||
loading.hide();
|
||||
|
||||
// console.log(response.data);
|
||||
|
||||
// ************ Infos for Step 2 ************
|
||||
$('#contractPartyId').val(response.data.id);
|
||||
$('#firstName').val(response.data.fName);
|
||||
$('#lastName').val(response.data.lName);
|
||||
$('#birthdayDate').val(response.data.dateOfBirthFa);
|
||||
$('#fatherName').val(response.data.fatherName);
|
||||
$('#nationalNumber').val(response.data.nationalCode);
|
||||
$('#nationalNumber').val(response.data.idNumber);
|
||||
globalPhone = response.data.phone;
|
||||
|
||||
// The State and City
|
||||
|
||||
@@ -11,9 +11,17 @@ $(document).ready(function () {
|
||||
$(".select2Option").select2({
|
||||
language: "fa",
|
||||
dir: "rtl"
|
||||
});
|
||||
});
|
||||
|
||||
autoScroll();
|
||||
});
|
||||
|
||||
function autoScroll() {
|
||||
$('.main').animate({
|
||||
scrollTop: $('.accordion').height()
|
||||
}, 2500);
|
||||
}
|
||||
|
||||
$(document).on('input', '.operations-btns input[type="text"]', function() {
|
||||
let $input = $(this);
|
||||
let nameSpan = $input.closest(".accordion-item").find('.workshopListItem .workshopNameSpan');
|
||||
@@ -169,7 +177,9 @@ function addNewWorkshop() {
|
||||
|
||||
// Expand only the new one
|
||||
$newOperationsBtns.slideDown(300);
|
||||
$newOpenBtn.addClass('expanded');
|
||||
$newOpenBtn.addClass('expanded');
|
||||
|
||||
autoScroll();
|
||||
}
|
||||
|
||||
$(document).on("click", ".btnRemove", function () {
|
||||
@@ -250,9 +260,9 @@ function createOrUpdateCommand() {
|
||||
return;
|
||||
}
|
||||
|
||||
let existingAmount = sumAmountArray.find(w => w.workshopDataId === dataId);
|
||||
let existingAmount = sumAmountArray.find(w => w.workshopDataId === dataId);
|
||||
|
||||
let existingWorkshop = command.workshops.find(w => w.workshopId === workshopID);
|
||||
let existingWorkshop = command.workshops.find(w => w.workshopId === dataId);
|
||||
|
||||
if (existingWorkshop) {
|
||||
existingWorkshop.CountPerson = personnelCount;
|
||||
@@ -334,7 +344,7 @@ async function checkInputsStep3() {
|
||||
}
|
||||
|
||||
|
||||
await loadSpecifiedWorkshop();
|
||||
await loadSpecifiedWorkshop(createOrUpdate);
|
||||
|
||||
|
||||
try {
|
||||
@@ -421,16 +431,14 @@ $(document).on('change', '.operations-btns select, .btnRadioContainer .radioOpti
|
||||
CountPerson: personnelCount,
|
||||
...selectedOptions
|
||||
};
|
||||
|
||||
ajax.get(institutionPlanForWorkshopUrl, newWorkshopGetAmountCommand, false)
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
|
||||
ajax.get(institutionPlanForWorkshopUrl, newWorkshopGetAmountCommand, false)
|
||||
.then(response => {
|
||||
const amountStr = response.data.onlineAndInPersonSumAmountStr + ' ریال';
|
||||
const amountDouble = response.data.onlineAndInPersonSumAmountDouble || 0;
|
||||
|
||||
let existingSumAmount = sumAmountArray.find(w => w.workshopDataId === dataId);
|
||||
if (existingSumAmount) {
|
||||
existingSumAmount.amountStr = amountStr;
|
||||
existingSumAmount.amount = amountDouble;
|
||||
} else {
|
||||
let newSumAmount = {
|
||||
@@ -440,6 +448,7 @@ $(document).on('change', '.operations-btns select, .btnRadioContainer .radioOpti
|
||||
};
|
||||
sumAmountArray.push(newSumAmount);
|
||||
}
|
||||
|
||||
sumNumberOfAmount();
|
||||
$(`#totalPayment_${dataId}`).text(amountStr);
|
||||
$(`#totalPay_${dataId}`).text(amountStr);
|
||||
@@ -464,7 +473,12 @@ function formatNumber(number) {
|
||||
}
|
||||
|
||||
function loadWorkshopData(id) {
|
||||
var html = ``;
|
||||
var html = ``;
|
||||
command = {
|
||||
workshops: []
|
||||
};
|
||||
sumAmountArray = [];
|
||||
|
||||
ajax.get(getWorkshopTempUrl, { contractingPartyId: id }, true)
|
||||
.then(response => {
|
||||
if (response.data.length > 0) {
|
||||
@@ -558,7 +572,7 @@ function loadWorkshopData(id) {
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
var itemOfWorkshops = {
|
||||
Id: item.id,
|
||||
workshopId: item.id,
|
||||
@@ -687,6 +701,11 @@ function loadWorkshopData(id) {
|
||||
$(`#numberPersonnel_new_0`).val("25").trigger('change');
|
||||
}
|
||||
|
||||
// console.log(command.workshops);
|
||||
// console.log(sumAmountArray);
|
||||
sumNumberOfAmount();
|
||||
});
|
||||
|
||||
autoScroll();
|
||||
});
|
||||
|
||||
}
|
||||
@@ -1,26 +1,36 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
$('input[name="radMonth"]').on('change', function () {
|
||||
totalPaymentAndWorkshopList();
|
||||
});
|
||||
|
||||
$('input[name="radMonth"]:checked').trigger('change');
|
||||
});
|
||||
|
||||
async function loadSpecifiedWorkshop() {
|
||||
function autoScrollStep4() {
|
||||
$('.cardHeight').animate({
|
||||
scrollTop: $('.cardHeight').height()
|
||||
}, 100);
|
||||
}
|
||||
|
||||
async function loadSpecifiedWorkshop(data) {
|
||||
var html = '';
|
||||
|
||||
if (command.workshops.length > 0) {
|
||||
command.workshops.forEach(function(item) {
|
||||
if (data.workshops.length > 0) {
|
||||
data.workshops.forEach(function(item) {
|
||||
html += `<div class="cardGrid">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div class="titleWpName">نام کارگاه : <span>${item.WorkshopName}</span></div>
|
||||
<div class="titleWpPrice">ریال ${item.WorkshopServicesAmountStr}</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
</div>
|
||||
|
||||
<div class="d-block d-md-flex mt-3">
|
||||
<div class="btnCheckContainer w-100">
|
||||
<div>
|
||||
<input type="checkbox" id="oneDis" value="1" name="checkDo" class="checkOption" ${
|
||||
item.ContractAndCheckout ? "checked" : ''} disabled="disabled">
|
||||
<input type="checkbox" id="oneDis" value="1" name="checkDo" class="checkOption" ${item.ContractAndCheckout ? "checked" : ''} disabled="disabled">
|
||||
<label for="oneDis" class="checkLabelListOption">
|
||||
<span>قراداد و تصفیه حساب</span>
|
||||
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -31,8 +41,7 @@ async function loadSpecifiedWorkshop() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" id="twoDis" value="2" name="checkDo" class="checkOption" ${
|
||||
item.Insurance ? "checked" : ''} disabled="disabled">
|
||||
<input type="checkbox" id="twoDis" value="2" name="checkDo" class="checkOption" ${item.Insurance ? "checked" : ''} disabled="disabled">
|
||||
<label for="twoDis" class="checkLabelListOption">
|
||||
<span>ارسال لیست بیمه</span>
|
||||
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -42,8 +51,7 @@ async function loadSpecifiedWorkshop() {
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="threeDis" value="3" name="checkDo" class="checkOption" ${
|
||||
item.RollCall ? "checked" : ''} disabled="disabled">
|
||||
<input type="checkbox" id="threeDis" value="3" name="checkDo" class="checkOption" ${item.RollCall ? "checked" : ''} disabled="disabled">
|
||||
<label for="threeDis" class="checkLabelListOption">
|
||||
<span>ساعت حضور و غیاب</span>
|
||||
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -53,8 +61,7 @@ async function loadSpecifiedWorkshop() {
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="fourDis" value="4" name="checkDo" class="checkOption" ${
|
||||
item.CustomizeCheckout ? "checked" : ''} disabled="disabled">
|
||||
<input type="checkbox" id="fourDis" value="4" name="checkDo" class="checkOption" ${item.CustomizeCheckout ? "checked" : ''} disabled="disabled">
|
||||
<label for="fourDis" class="checkLabelListOption">
|
||||
<span>فیش حقوقی غیررسمی</span>
|
||||
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -69,22 +76,71 @@ async function loadSpecifiedWorkshop() {
|
||||
});
|
||||
|
||||
$('#cardSelected').html(html);
|
||||
|
||||
autoScrollStep4();
|
||||
}
|
||||
}
|
||||
|
||||
async function totalPaymentAndWorkshopList() {
|
||||
ajax.get(totalPaymentAndWorkshopListUrl, { contractingPartyTempId: parseInt($('#contractPartyId').val()) || 0 })
|
||||
var selectedRadMonth = $('input[name="radMonth"]:checked').val();
|
||||
var months = 12;
|
||||
|
||||
switch (selectedRadMonth) {
|
||||
case 'oneMonth':
|
||||
months = 1;
|
||||
break;
|
||||
case 'threeMonth':
|
||||
months = 3;
|
||||
break;
|
||||
case 'sixMonth':
|
||||
months = 6;
|
||||
break;
|
||||
case 'twelveMonth':
|
||||
months = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
var hasPriceStatic = $('#priceStatic').hasClass('active');
|
||||
|
||||
|
||||
ajax.get(totalPaymentAndWorkshopListUrl, { contractingPartyTempId: parseInt($('#contractPartyId').val()) || 0, periodModel: months })
|
||||
.then(response => {
|
||||
$(`#sumOfWorkshopsPaymentPayment`).text(response.data.withoutTaxPaymentStr + " ریال");
|
||||
if (hasPriceStatic) {
|
||||
$(`#sumOfWorkshopsPaymentPayment`).text(response.data.oneTimeWithoutTaxPaymentStr + " ریال");
|
||||
$(`#totalPaymentStr`).text(response.data.oneTimeTotalPaymentStr + " ریال");
|
||||
|
||||
} else {
|
||||
$(`#sumOfWorkshopsPaymentPayment`).text(response.data.monthlyWithoutTaxPaymentStr + " ریال");
|
||||
$(`#totalPaymentStr`).text(response.data.monthlyTotalPaymentStr + " ریال");
|
||||
}
|
||||
$(`#valueAddedTaxSt`).text(response.data.valueAddedTaxSt + " ریال");
|
||||
$(`#totalPaymentStr`).text(response.data.totalPaymentStr + " ریال");
|
||||
|
||||
$(`#sumOfWorkshopsPaymentPaymentStep5`).text(response.data.withoutTaxPaymentStr + " ریال");
|
||||
$(`#valueAddedTaxStStep5`).text(response.data.valueAddedTaxSt + " ریال");
|
||||
$(`#totalPaymentStrStep5`).text(response.data.totalPaymentStr + " ریال");
|
||||
if (hasPriceStatic) {
|
||||
$(`#sumOfWorkshopsPaymentPaymentStep5`).text(response.data.oneTimeWithoutTaxPaymentStr + " ریال");
|
||||
$(`#totalPaymentStrStep5`).text(response.data.oneTimeTotalPaymentStr + " ریال");
|
||||
|
||||
$(`#totalPaymentDoubleInput`).val(response.data.totalPaymentDouble);
|
||||
} else {
|
||||
$(`#sumOfWorkshopsPaymentPaymentStep5`).text(response.data.monthlyWithoutTaxPaymentStr + " ریال");
|
||||
$(`#totalPaymentStrStep5`).text(response.data.monthlyTotalPaymentStr + " ریال");
|
||||
}
|
||||
$(`#valueAddedTaxStStep5`).text(response.data.valueAddedTaxSt + " ریال");
|
||||
|
||||
$(`#totalPaymentDoubleInput`).val(hasPriceStatic ? response.data.oneTimeTotalPaymentDouble : response.data.monthlyTotalPaymentDouble);
|
||||
$(`#valueAddedTaxDoubleInput`).val(response.data.valueAddedTaxDouble);
|
||||
|
||||
$('#priceStepContainer').html('');
|
||||
if (response.data.monthlyInstallments) {
|
||||
response.data.monthlyInstallments?.forEach(function (item) {
|
||||
var html = `
|
||||
<div class="item">
|
||||
<div class="col-4 text-start">${item.installmentCounter}</div>
|
||||
<div class="col-4 text-start">${item.instalmentDate}</div>
|
||||
<div class="col-4 text-end">${item.installmentAmountStr} ریال</div>
|
||||
</div>
|
||||
`;
|
||||
$('#priceStepContainer').append(html);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -94,12 +150,32 @@ async function checkInputsStep4() {
|
||||
let btnDisable = $('.stepNext').addClass('disable');
|
||||
let loading = $('.stepNext .loading').show();
|
||||
|
||||
var selectedRadMonth = $('input[name="radMonth"]:checked').val();
|
||||
var months = 12;
|
||||
|
||||
switch (selectedRadMonth) {
|
||||
case 'oneMonth':
|
||||
months = 1;
|
||||
break;
|
||||
case 'threeMonth':
|
||||
months = 3;
|
||||
break;
|
||||
case 'sixMonth':
|
||||
months = 6;
|
||||
break;
|
||||
case 'twelveMonth':
|
||||
months = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
var priceMethod = $('#priceStatic').hasClass('active') ? "OneTime" : "Monthly";
|
||||
|
||||
try {
|
||||
const response = await ajax.post(createOrUpdateInstitutionContractTemp,
|
||||
{
|
||||
contractingPartyTempId: parseInt($('#contractPartyId').val()) || 0,
|
||||
periodModel: "12",
|
||||
paymentModel: "OneTime",
|
||||
periodModel: months,
|
||||
paymentModel: priceMethod,
|
||||
totalPayment: Number($('#totalPaymentDoubleInput').val()),
|
||||
valueAddedTax: Number($('#valueAddedTaxDoubleInput').val())
|
||||
}, true);
|
||||
@@ -140,10 +216,27 @@ $('#priceStatic').on('click', function () {
|
||||
$('#priceStepContainer').hide();
|
||||
$('#priceStep').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
if ($(this).hasClass("active")) {
|
||||
$(".cardHeight").css("height", "50%");
|
||||
} else {
|
||||
$(".cardHeight").css("height", "39%");
|
||||
}
|
||||
|
||||
totalPaymentAndWorkshopList();
|
||||
});
|
||||
|
||||
$('#priceStep').on('click', function () {
|
||||
$('#priceStepContainer').fadeIn();
|
||||
$('#priceStatic').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
});
|
||||
|
||||
if ($(this).hasClass("active")) {
|
||||
$(".cardHeight").css("height", "39%");
|
||||
} else {
|
||||
$(".cardHeight").css("height", "50%");
|
||||
}
|
||||
|
||||
totalPaymentAndWorkshopList();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user