Fix charge payment method edition (#1738)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-04-13 14:41:07 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent bf700cc100
commit 30c1085b45
3 changed files with 3 additions and 4 deletions
@@ -65,7 +65,7 @@ export class ApproveLoanComponent implements OnInit {
*/ */
setApproveLoanForm() { setApproveLoanForm() {
this.approveLoanForm = this.formBuilder.group({ this.approveLoanForm = this.formBuilder.group({
'approvedOnDate': [this.loanData.approvalDate && new Date(this.loanData.approvalDate), Validators.required], 'approvedOnDate': [this.settingsService.businessDate, Validators.required],
'expectedDisbursementDate': [''], 'expectedDisbursementDate': [''],
'approvedLoanAmount': [this.loanData.approvalAmount, Validators.required], 'approvedLoanAmount': [this.loanData.approvalAmount, Validators.required],
'note': [''] 'note': ['']
@@ -54,7 +54,7 @@ export class DisburseComponent implements OnInit {
* and initialize with the required values * and initialize with the required values
*/ */
ngOnInit() { ngOnInit() {
this.maxDate = this.settingsService.businessDate; this.maxDate = this.settingsService.maxFutureDate;
this.createDisbursementLoanForm(); this.createDisbursementLoanForm();
this.setDisbursementLoanDetails(); this.setDisbursementLoanDetails();
} }
@@ -149,8 +149,7 @@ export class EditChargeComponent implements OnInit {
submit() { submit() {
const charges = this.chargeForm.getRawValue(); const charges = this.chargeForm.getRawValue();
charges.locale = this.settingsService.language.code; charges.locale = this.settingsService.language.code;
charges.chargePaymentMode = this.chargeData.chargePaymentMode.id; if (charges.taxGroupId.value === '') {
if(charges.taxGroupId.value===''){
delete charges.taxGroupId; delete charges.taxGroupId;
} }
this.productsService.updateCharge(this.chargeData.id.toString(), charges) this.productsService.updateCharge(this.chargeData.id.toString(), charges)