Merge pull request #2692 from alberto-art3ch/WEB-332/advance-accounting-rule-can-be-set-for-each-writeoff-reason
WEB-332: Advanced accounting rule can be set for each writeoff reason
This commit is contained in:
@@ -189,10 +189,7 @@ export class TransactionsTabComponent implements OnInit {
|
||||
|
||||
if (hideAccrual || hideReversed) {
|
||||
transactions = this.transactionsData.filter((t: LoanTransaction) => {
|
||||
return (
|
||||
!(hideReversed && t.manuallyReversed) &&
|
||||
!(hideAccrual && (t.type.accrual || t.type.capitalizedIncomeAmortization))
|
||||
);
|
||||
return !(hideReversed && t.manuallyReversed) && !(hideAccrual && this.isAccrualKindOf(t.type));
|
||||
});
|
||||
}
|
||||
this.dataSource = new MatTableDataSource(transactions);
|
||||
@@ -243,10 +240,12 @@ export class TransactionsTabComponent implements OnInit {
|
||||
* REAMORTIZE:30
|
||||
* INTEREST REFUND:33
|
||||
* CAPITALIZED INCOME:35
|
||||
* CAPITALIZED_INCOME_AMORTIZATION:36
|
||||
* CAPITALIZED INCOME ADJUSTMENT:37
|
||||
* CONTRACT_TERMINATION:38
|
||||
* BUY_DOWN_FEE:40
|
||||
* BUY_DOWN_FEE_ADJUSTMENT:41
|
||||
* BUY_DOWN_FEE_AMORTIZATION:42
|
||||
*/
|
||||
showTransaction(transactionsData: LoanTransaction): boolean {
|
||||
return [
|
||||
@@ -266,10 +265,12 @@ export class TransactionsTabComponent implements OnInit {
|
||||
32,
|
||||
33,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
40,
|
||||
41
|
||||
41,
|
||||
42
|
||||
].includes(transactionsData.type.id);
|
||||
}
|
||||
|
||||
@@ -293,7 +294,7 @@ export class TransactionsTabComponent implements OnInit {
|
||||
if (transaction.transactionRelations && transaction.transactionRelations.length > 0) {
|
||||
return 'linked';
|
||||
}
|
||||
if (this.isAccrual(transaction.type) || this.isCapitalizedIncomeAmortization(transaction.type)) {
|
||||
if (this.isAccrualKindOf(transaction.type)) {
|
||||
return 'accrual';
|
||||
}
|
||||
if (this.isChargeOff(transaction.type)) {
|
||||
@@ -427,6 +428,21 @@ export class TransactionsTabComponent implements OnInit {
|
||||
return transactionType.capitalizedIncome || transactionType.code === 'loanTransactionType.capitalizedIncome';
|
||||
}
|
||||
|
||||
private isBuyDownFeeAmortization(transactionType: LoanTransactionType): boolean {
|
||||
return (
|
||||
transactionType.buyDownFeeAmortizationAdjustment ||
|
||||
transactionType.code === 'loanTransactionType.buyDownFeeAmortizationAdjustment'
|
||||
);
|
||||
}
|
||||
|
||||
private isAccrualKindOf(transactionType: LoanTransactionType): boolean {
|
||||
return (
|
||||
this.isAccrual(transactionType) ||
|
||||
this.isCapitalizedIncomeAmortization(transactionType) ||
|
||||
this.isBuyDownFeeAmortization(transactionType)
|
||||
);
|
||||
}
|
||||
|
||||
private isCapitalizedIncomeAmortization(transactionType: LoanTransactionType): boolean {
|
||||
return (
|
||||
transactionType.capitalizedIncomeAmortization ||
|
||||
|
||||
@@ -39,4 +39,5 @@ export interface LoanTransactionType {
|
||||
contractTermination: boolean;
|
||||
buyDownFee: boolean;
|
||||
buyDownFeeAdjustment: boolean;
|
||||
buyDownFeeAmortizationAdjustment: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user