New GL mapping parameters at the loan product level for Charge-off (#1685)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-02-14 10:31:44 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 60304735e1
commit 83457a3606
7 changed files with 132 additions and 20 deletions
@@ -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': '',
@@ -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)
@@ -144,6 +144,42 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Income from ChargeOff Interest</mat-label>
<mat-select formControlName="incomeFromChargeOffInterestAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from ChargeOff Interest is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Income from ChargeOff Fees</mat-label>
<mat-select formControlName="incomeFromChargeOffFeesAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from ChargeOff Fees is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Income from ChargeOff Penalty</mat-label>
<mat-select formControlName="incomeFromChargeOffPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from ChargeOff Penalty is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Expenses</h4>
@@ -161,7 +197,7 @@
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Goodwill credit</mat-label>
<mat-label>Expenses from Goodwill Credit</mat-label>
<mat-select formControlName="goodwillCreditAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
@@ -172,6 +208,30 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>ChargeOff Expense</mat-label>
<mat-select formControlName="chargeOffExpenseAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option>
</mat-select>
<mat-error>
ChargeOff Expense is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>ChargeOff Fraud Expense</mat-label>
<mat-select formControlName="chargeOffFraudExpenseAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option>
</mat-select>
<mat-error>
ChargeOff Fraud Expense is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Liabilities</h4>
@@ -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) {
@@ -629,6 +629,12 @@
<span fxFlex="60%">{{ loanProduct.incomeFromPenaltyAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">Income from Recovery Repayments:</span>
<span fxFlex="60%">{{ loanProduct.incomeFromRecoveryAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">Income from ChargeOff Interest:</span>
<span fxFlex="60%">{{ loanProduct.incomeFromChargeOffInterestAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">Income from ChargeOff Fees:</span>
<span fxFlex="60%">{{ loanProduct.incomeFromChargeOffFeesAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">Income from ChargeOff Penalty:</span>
<span fxFlex="60%">{{ loanProduct.incomeFromChargeOffPenaltyAccountId | find:loanProductsTemplate.accountingMappingOptions.incomeAccountOptions:'id':'name' }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Expenses</h4>
@@ -636,8 +642,12 @@
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Losses written off:</span>
<span fxFlex="60%">{{ loanProduct.writeOffAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">Goodwill credit:</span>
<span fxFlex="40%">Expenses from Goodwill Credit:</span>
<span fxFlex="60%">{{ loanProduct.goodwillCreditAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">ChargeOff Expense:</span>
<span fxFlex="60%">{{ loanProduct.chargeOffExpenseAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }}</span>
<span fxFlex="40%">ChargeOff Fraud Expense:</span>
<span fxFlex="60%">{{ loanProduct.chargeOffFraudExpenseAccountId | find:loanProductsTemplate.accountingMappingOptions.expenseAccountOptions:'id':'name' }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Liabilities</h4>
@@ -652,7 +652,7 @@
<span fxFlex="60%">({{loanProduct.accountingMappings.receivableInterestAccount.glCode}}) {{
loanProduct.accountingMappings.receivableInterestAccount.name }}</span>
<span fxFlex="40%">Fees Receivable:</span>
<span fxFlex="60%">({{loanProduct.accountingMappings.receivableInterestAccount.glCode}}) {{
<span fxFlex="60%">({{loanProduct.accountingMappings.receivableFeeAccount.glCode}}) {{
loanProduct.accountingMappings.receivableInterestAccount.name }}</span>
<span fxFlex="40%">Penalties Receivable:</span>
<span fxFlex="60%">({{loanProduct.accountingMappings.receivablePenaltyAccount.glCode}}) {{
@@ -678,6 +678,18 @@
<span fxFlex="40%">Income from Recovery Repayments:</span>
<span fxFlex="60%">({{loanProduct.accountingMappings.incomeFromRecoveryAccount.glCode}}) {{
loanProduct.accountingMappings.incomeFromRecoveryAccount.name }}</span>
<span *ngIf="loanProduct.accountingMappings.incomeFromChargeOffInterestAccount" fxFlex="40%">Income from ChargeOff Interest:</span>
<span *ngIf="loanProduct.accountingMappings.incomeFromChargeOffInterestAccount" fxFlex="60%">
({{loanProduct.accountingMappings.incomeFromChargeOffInterestAccount.glCode}}) {{
loanProduct.accountingMappings.incomeFromChargeOffInterestAccount.name }}</span>
<span fxFlex="40%" *ngIf="loanProduct.accountingMappings.incomeFromChargeOffFeesAccount">Income from ChargeOff Fees:</span>
<span fxFlex="60%" *ngIf="loanProduct.accountingMappings.incomeFromChargeOffFeesAccount">
({{loanProduct.accountingMappings.incomeFromChargeOffFeesAccount.glCode}}) {{
loanProduct.accountingMappings.incomeFromChargeOffFeesAccount.name }}</span>
<span fxFlex="40%" *ngIf="loanProduct.accountingMappings.incomeFromChargeOffPenaltyAccount">Income from ChargeOff Penalty:</span>
<span fxFlex="60%" *ngIf="loanProduct.accountingMappings.incomeFromChargeOffPenaltyAccount">
({{loanProduct.accountingMappings.incomeFromChargeOffPenaltyAccount.glCode}}) {{
loanProduct.accountingMappings.incomeFromChargeOffPenaltyAccount.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Expenses</h4>
@@ -686,9 +698,17 @@
<span fxFlex="40%">Losses written off:</span>
<span fxFlex="60%">({{loanProduct.accountingMappings.writeOffAccount.glCode}}) {{
loanProduct.accountingMappings.writeOffAccount.name }}</span>
<span fxFlex="40%">Goodwill credit:</span>
<span fxFlex="40%">Expenses from Goodwill Credit:</span>
<span fxFlex="60%">({{loanProduct.accountingMappings.goodwillCreditAccount.glCode}}) {{
loanProduct.accountingMappings.goodwillCreditAccount.name }}</span>
<span *ngIf="loanProduct.accountingMappings.chargeOffExpenseAccount" fxFlex="40%">ChargeOff Expense:</span>
<span *ngIf="loanProduct.accountingMappings.chargeOffExpenseAccount" fxFlex="60%">
({{loanProduct.accountingMappings.chargeOffExpenseAccount.glCode}}) {{
loanProduct.accountingMappings.chargeOffExpenseAccount.name }}</span>
<span *ngIf="loanProduct.accountingMappings.chargeOffFraudExpenseAccount" fxFlex="40%">ChargeOff Fraud Expense:</span>
<span *ngIf="loanProduct.accountingMappings.chargeOffFraudExpenseAccount" fxFlex="60%">
({{loanProduct.accountingMappings.chargeOffFraudExpenseAccount.glCode}}) {{
loanProduct.accountingMappings.chargeOffFraudExpenseAccount.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Liabilities</h4>
@@ -10,3 +10,9 @@
font-weight: 300;
color: $status-approved;
}
.mat-h4 {
margin-top: 10px !important;
font-weight: 200;
color: $status-approved;
}