combined and ordered accountingMappingOptions
This commit is contained in:
committed by
Adam Saghy
parent
355ba78311
commit
d8a279fc51
+1
-1
@@ -175,7 +175,7 @@
|
|||||||
<ng-container matColumnDef="fundSourceAccountId">
|
<ng-container matColumnDef="fundSourceAccountId">
|
||||||
<th mat-header-cell *matHeaderCellDef> Fund Source </th>
|
<th mat-header-cell *matHeaderCellDef> Fund Source </th>
|
||||||
<td mat-cell *matCellDef="let paymentFundSource">
|
<td mat-cell *matCellDef="let paymentFundSource">
|
||||||
{{ paymentFundSource.fundSourceAccountId | find:assetAccountData:'id':'name' }}
|
{{ paymentFundSource.fundSourceAccountId | find:combinedAccountData:'id':'name' }}
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
+20
-2
@@ -30,6 +30,7 @@ export class SavingProductAccountingStepComponent implements OnInit {
|
|||||||
expenseAccountData: any;
|
expenseAccountData: any;
|
||||||
liabilityAccountData: any;
|
liabilityAccountData: any;
|
||||||
incomeAndLiabilityAccountData: any;
|
incomeAndLiabilityAccountData: any;
|
||||||
|
combinedAccountData: any[];
|
||||||
|
|
||||||
paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions'];
|
paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions'];
|
||||||
feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions'];
|
feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions'];
|
||||||
@@ -48,6 +49,23 @@ export class SavingProductAccountingStepComponent implements OnInit {
|
|||||||
this.incomeAccountData = this.savingProductsTemplate.accountingMappingOptions.incomeAccountOptions || [];
|
this.incomeAccountData = this.savingProductsTemplate.accountingMappingOptions.incomeAccountOptions || [];
|
||||||
this.expenseAccountData = this.savingProductsTemplate.accountingMappingOptions.expenseAccountOptions || [];
|
this.expenseAccountData = this.savingProductsTemplate.accountingMappingOptions.expenseAccountOptions || [];
|
||||||
this.liabilityAccountData = this.savingProductsTemplate.accountingMappingOptions.liabilityAccountOptions || [];
|
this.liabilityAccountData = this.savingProductsTemplate.accountingMappingOptions.liabilityAccountOptions || [];
|
||||||
|
this.combinedAccountData = [
|
||||||
|
...this.assetAccountData,
|
||||||
|
...this.incomeAccountData,
|
||||||
|
...this.expenseAccountData,
|
||||||
|
...this.liabilityAccountData
|
||||||
|
];
|
||||||
|
this.combinedAccountData.sort((a, b) => {
|
||||||
|
const valueA = a.name.toLowerCase();
|
||||||
|
const valueB = b.name.toLowerCase();
|
||||||
|
if (valueA < valueB) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (valueA > valueB) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
this.savingProductAccountingForm.patchValue({
|
this.savingProductAccountingForm.patchValue({
|
||||||
'accountingRule': this.savingProductsTemplate.accountingRule.id
|
'accountingRule': this.savingProductsTemplate.accountingRule.id
|
||||||
@@ -218,8 +236,8 @@ export class SavingProductAccountingStepComponent implements OnInit {
|
|||||||
new SelectBase({
|
new SelectBase({
|
||||||
controlName: 'fundSourceAccountId',
|
controlName: 'fundSourceAccountId',
|
||||||
label: 'Fund Source',
|
label: 'Fund Source',
|
||||||
value: values ? values.fundSourceAccountId : this.assetAccountData[0].id,
|
value: values ? values.fundSourceAccountId : this.combinedAccountData[0].id,
|
||||||
options: { label: 'name', value: 'id', data: this.assetAccountData },
|
options: { label: 'name', value: 'id', data: this.combinedAccountData },
|
||||||
required: true,
|
required: true,
|
||||||
order: 2
|
order: 2
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user