diff --git a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts index b5a152f9d..2cf571d70 100644 --- a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts @@ -64,7 +64,7 @@ export class DisburseComponent implements OnInit { */ createDisbursementLoanForm() { this.disbursementLoanForm = this.formBuilder.group({ - 'actualDisbursementDate': [new Date(), Validators.required], + 'actualDisbursementDate': [this.settingsService.businessDate, Validators.required], 'transactionAmount': ['', Validators.required], 'externalId': '', 'paymentTypeId': '', diff --git a/src/app/products/charges/edit-charge/edit-charge.component.ts b/src/app/products/charges/edit-charge/edit-charge.component.ts index d1f05f5e8..300927a6f 100644 --- a/src/app/products/charges/edit-charge/edit-charge.component.ts +++ b/src/app/products/charges/edit-charge/edit-charge.component.ts @@ -125,7 +125,7 @@ export class EditChargeComponent implements OnInit { if (this.chargeData.taxGroup) { this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id, disabled: true }, Validators.required)); } else { - this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '?', disabled: true })); + this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '', disabled: true })); } } @@ -147,7 +147,7 @@ export class EditChargeComponent implements OnInit { * Submits Edit Charge form. */ submit() { - const charges = this.chargeForm.value; + const charges = this.chargeForm.getRawValue(); charges.locale = this.settingsService.language.code; charges.chargePaymentMode = this.chargeData.chargePaymentMode.id; this.productsService.updateCharge(this.chargeData.id.toString(), charges) diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html index 378929474..862176bdf 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html @@ -144,6 +144,42 @@ + + Income from ChargeOff Interest + + + ({{ incomeAccount.glCode }}) {{ incomeAccount.name }} + + + + Income from ChargeOff Interest is required + + + + + Income from ChargeOff Fees + + + ({{ incomeAccount.glCode }}) {{ incomeAccount.name }} + + + + Income from ChargeOff Fees is required + + + + + Income from ChargeOff Penalty + + + ({{ incomeAccount.glCode }}) {{ incomeAccount.name }} + + + + Income from ChargeOff Penalty is required + + +

Expenses

@@ -161,7 +197,7 @@ - Goodwill credit + Expenses from Goodwill Credit ({{ expenseAccount.glCode }}) {{ expenseAccount.name }} @@ -172,6 +208,30 @@ + + ChargeOff Expense + + + ({{ expenseAccount.glCode }}) {{ expenseAccount.name }} + + + + ChargeOff Expense is required + + + + + ChargeOff Fraud Expense + + + ({{ expenseAccount.glCode }}) {{ expenseAccount.name }} + + + + ChargeOff Fraud Expense is required + + +

Liabilities

diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts index 55a1fbcf1..89a20fb74 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts @@ -55,27 +55,33 @@ export class LoanProductAccountingStepComponent implements OnInit { 'accountingRule': this.loanProductsTemplate.accountingRule.id }); + const accountingMappings = this.loanProductsTemplate.accountingMappings; switch (this.loanProductsTemplate.accountingRule.id) { case 3: case 4: this.loanProductAccountingForm.patchValue({ - 'receivableInterestAccountId': this.loanProductsTemplate.accountingMappings.receivableInterestAccount.id, - 'receivableFeeAccountId': this.loanProductsTemplate.accountingMappings.receivableFeeAccount.id, - 'receivablePenaltyAccountId': this.loanProductsTemplate.accountingMappings.receivablePenaltyAccount.id, + 'receivableInterestAccountId': accountingMappings.receivableInterestAccount.id, + 'receivableFeeAccountId': accountingMappings.receivableFeeAccount.id, + 'receivablePenaltyAccountId': accountingMappings.receivablePenaltyAccount.id, }); /* falls through */ case 2: this.loanProductAccountingForm.patchValue({ - 'fundSourceAccountId': this.loanProductsTemplate.accountingMappings.fundSourceAccount.id, - 'loanPortfolioAccountId': this.loanProductsTemplate.accountingMappings.loanPortfolioAccount.id, - 'transfersInSuspenseAccountId': this.loanProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, - 'interestOnLoanAccountId': this.loanProductsTemplate.accountingMappings.interestOnLoanAccount.id, - 'incomeFromFeeAccountId': this.loanProductsTemplate.accountingMappings.incomeFromFeeAccount.id, - 'incomeFromPenaltyAccountId': this.loanProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, - 'incomeFromRecoveryAccountId': this.loanProductsTemplate.accountingMappings.incomeFromRecoveryAccount.id, - 'writeOffAccountId': this.loanProductsTemplate.accountingMappings.writeOffAccount.id, - 'goodwillCreditAccountId': this.loanProductsTemplate.accountingMappings.goodwillCreditAccount.id, - 'overpaymentLiabilityAccountId': this.loanProductsTemplate.accountingMappings.overpaymentLiabilityAccount.id, + 'fundSourceAccountId': accountingMappings.fundSourceAccount.id, + 'loanPortfolioAccountId': accountingMappings.loanPortfolioAccount.id, + 'transfersInSuspenseAccountId': accountingMappings.transfersInSuspenseAccount.id, + 'interestOnLoanAccountId': accountingMappings.interestOnLoanAccount.id, + 'incomeFromFeeAccountId': accountingMappings.incomeFromFeeAccount.id, + 'incomeFromPenaltyAccountId': accountingMappings.incomeFromPenaltyAccount.id, + 'incomeFromRecoveryAccountId': accountingMappings.incomeFromRecoveryAccount.id, + 'writeOffAccountId': accountingMappings.writeOffAccount.id, + 'goodwillCreditAccountId': accountingMappings.goodwillCreditAccount.id, + 'overpaymentLiabilityAccountId': accountingMappings.overpaymentLiabilityAccount.id, + 'chargeOffFraudExpenseAccountId': accountingMappings.chargeOffFraudExpenseAccount ? accountingMappings.chargeOffFraudExpenseAccount.id : '', + 'chargeOffExpenseAccountId': accountingMappings.chargeOffExpenseAccount ? accountingMappings.chargeOffExpenseAccount.id : '', + 'incomeFromChargeOffPenaltyAccountId': accountingMappings.incomeFromChargeOffPenaltyAccount ? accountingMappings.incomeFromChargeOffPenaltyAccount.id : '', + 'incomeFromChargeOffFeesAccountId': accountingMappings.incomeFromChargeOffFeesAccount ? accountingMappings.incomeFromChargeOffFeesAccount.id : '', + 'incomeFromChargeOffInterestAccountId': accountingMappings.incomeFromChargeOffInterestAccount ? accountingMappings.incomeFromChargeOffInterestAccount.id : '', 'advancedAccountingRules': (this.loanProductsTemplate.paymentChannelToFundSourceMappings || this.loanProductsTemplate.feeToIncomeAccountMappings || this.loanProductsTemplate.penaltyToIncomeAccountMappings) ? true : false }); @@ -112,6 +118,11 @@ export class LoanProductAccountingStepComponent implements OnInit { this.loanProductAccountingForm.addControl('goodwillCreditAccountId', new FormControl('', Validators.required)); this.loanProductAccountingForm.addControl('overpaymentLiabilityAccountId', new FormControl('', Validators.required)); this.loanProductAccountingForm.addControl('advancedAccountingRules', new FormControl(false)); + this.loanProductAccountingForm.addControl('chargeOffFraudExpenseAccountId', new FormControl('', Validators.required)); + this.loanProductAccountingForm.addControl('chargeOffExpenseAccountId', new FormControl('', Validators.required)); + this.loanProductAccountingForm.addControl('incomeFromChargeOffPenaltyAccountId', new FormControl('', Validators.required)); + this.loanProductAccountingForm.addControl('incomeFromChargeOffFeesAccountId', new FormControl('', Validators.required)); + this.loanProductAccountingForm.addControl('incomeFromChargeOffInterestAccountId', new FormControl('', Validators.required)); this.loanProductAccountingForm.get('advancedAccountingRules').valueChanges .subscribe((advancedAccountingRules: boolean) => { @@ -137,6 +148,11 @@ export class LoanProductAccountingStepComponent implements OnInit { this.loanProductAccountingForm.removeControl('goodwillCreditAccountId'); this.loanProductAccountingForm.removeControl('overpaymentLiabilityAccountId'); this.loanProductAccountingForm.removeControl('advancedAccountingRules'); + this.loanProductAccountingForm.removeControl('chargeOffExpenseAccountId'); + this.loanProductAccountingForm.removeControl('chargeOffFraudExpenseAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromChargeOffPenaltyAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromChargeOffFeesAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromChargeOffInterestAccountId'); } if (accountingRule === 3 || accountingRule === 4) { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html index fbbbe7097..4816c9475 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.html @@ -629,6 +629,12 @@ {{ loanProduct.incomeFromPenaltyAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }} Income from Recovery Repayments: {{ loanProduct.incomeFromRecoveryAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }} + Income from ChargeOff Interest: + {{ loanProduct.incomeFromChargeOffInterestAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }} + Income from ChargeOff Fees: + {{ loanProduct.incomeFromChargeOffFeesAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }} + Income from ChargeOff Penalty: + {{ loanProduct.incomeFromChargeOffPenaltyAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}

Expenses

@@ -636,8 +642,12 @@
Losses written off: {{ loanProduct.writeOffAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }} - Goodwill credit: + Expenses from Goodwill Credit: {{ loanProduct.goodwillCreditAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }} + ChargeOff Expense: + {{ loanProduct.chargeOffExpenseAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }} + ChargeOff Fraud Expense: + {{ loanProduct.chargeOffFraudExpenseAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }}

Liabilities

diff --git a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html index dc64b58b2..d044620f6 100644 --- a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html +++ b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html @@ -652,7 +652,7 @@ ({{loanProduct.accountingMappings.receivableInterestAccount.glCode}}) {{ loanProduct.accountingMappings.receivableInterestAccount.name }} Fees Receivable: - ({{loanProduct.accountingMappings.receivableInterestAccount.glCode}}) {{ + ({{loanProduct.accountingMappings.receivableFeeAccount.glCode}}) {{ loanProduct.accountingMappings.receivableInterestAccount.name }} Penalties Receivable: ({{loanProduct.accountingMappings.receivablePenaltyAccount.glCode}}) {{ @@ -678,6 +678,18 @@ Income from Recovery Repayments: ({{loanProduct.accountingMappings.incomeFromRecoveryAccount.glCode}}) {{ loanProduct.accountingMappings.incomeFromRecoveryAccount.name }} + Income from ChargeOff Interest: + + ({{loanProduct.accountingMappings.incomeFromChargeOffInterestAccount.glCode}}) {{ + loanProduct.accountingMappings.incomeFromChargeOffInterestAccount.name }} + Income from ChargeOff Fees: + + ({{loanProduct.accountingMappings.incomeFromChargeOffFeesAccount.glCode}}) {{ + loanProduct.accountingMappings.incomeFromChargeOffFeesAccount.name }} + Income from ChargeOff Penalty: + + ({{loanProduct.accountingMappings.incomeFromChargeOffPenaltyAccount.glCode}}) {{ + loanProduct.accountingMappings.incomeFromChargeOffPenaltyAccount.name }}

Expenses

@@ -686,9 +698,17 @@ Losses written off: ({{loanProduct.accountingMappings.writeOffAccount.glCode}}) {{ loanProduct.accountingMappings.writeOffAccount.name }} - Goodwill credit: + Expenses from Goodwill Credit: ({{loanProduct.accountingMappings.goodwillCreditAccount.glCode}}) {{ loanProduct.accountingMappings.goodwillCreditAccount.name }} + ChargeOff Expense: + + ({{loanProduct.accountingMappings.chargeOffExpenseAccount.glCode}}) {{ + loanProduct.accountingMappings.chargeOffExpenseAccount.name }} + ChargeOff Fraud Expense: + + ({{loanProduct.accountingMappings.chargeOffFraudExpenseAccount.glCode}}) {{ + loanProduct.accountingMappings.chargeOffFraudExpenseAccount.name }}

Liabilities

diff --git a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.scss b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.scss index 8f6633e58..6df3c71cc 100644 --- a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.scss +++ b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.scss @@ -10,3 +10,9 @@ font-weight: 300; color: $status-approved; } + +.mat-h4 { + margin-top: 10px !important; + font-weight: 200; + color: $status-approved; +}