Use of filter in the GL Account dropdown menus

This commit is contained in:
Jose Alberto Hernandez
2024-01-10 15:02:06 +01:00
committed by Adam Saghy
parent 6edb262028
commit 53d8436875
47 changed files with 807 additions and 626 deletions
@@ -169,7 +169,7 @@ const routes: Routes = [
{
path: 'migrate-opening-balances',
component: MigrateOpeningBalancesComponent,
data: { title: 'Migrate Opening Balances', breadcrumb: 'Migrate Opening Balances' },
data: { title: 'Migrate Opening Balances', breadcrumb: 'Migrate Opening Balances' },
resolve: {
offices: OfficesResolver,
currencies: CurrenciesResolver
@@ -52,14 +52,13 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Parent" | translate}}</mat-label>
<mat-select formControlName="parentId">
<mat-option *ngFor="let parent of parentData" [value]="parent.id">
({{ parent.glCode }}) {{ parent.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="glAccountForm.controls.parentId"
[glAccountList]="parentData"
[required]="false"
[inputLabel]="'Parent'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="28%">
<mat-label>{{"labels.inputs.Tag" | translate}}</mat-label>
@@ -114,4 +113,4 @@
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{"labels.buttons.Next" |
translate}}</button>
</div>
</ng-template>
</ng-template>
@@ -11,6 +11,7 @@ import { ConfigurationWizardService } from '../../../configuration-wizard/config
/** Custom Dialog Component */
import { ContinueSetupDialogComponent } from '../../../configuration-wizard/continue-setup-dialog/continue-setup-dialog.component';
import { GLAccount } from 'app/shared/models/general.model';
/**
* Create gl account component.
@@ -31,7 +32,7 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
/** Account usage data. */
accountUsageData: any;
/** Parent data. */
parentData: any;
parentData: GLAccount[] = [];
/** Tag data. */
tagData: any;
/** Account type id. (for creation of sub-ledger account) */
@@ -48,14 +48,13 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Parent" | translate}}</mat-label>
<mat-select formControlName="parentId">
<mat-option *ngFor="let parent of parentData" [value]="parent.id">
({{ parent.glCode }}) {{ parent.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="glAccountForm.controls.parentId"
[glAccountList]="parentData"
[required]="false"
[inputLabel]="'Parent'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="28%">
<mat-label>{{"labels.inputs.Tag" | translate}}</mat-label>
@@ -59,7 +59,7 @@
<div fxFlex="50%" *ngIf="glAccount.parent">
<a class="tab-link" [routerLink]="['/accounting/chart-of-accounts/gl-accounts/view/' + glAccount.parent.id]">
({{ glAccount.parent.glCode }}) {{ glAccount.parent.name }}
<mifosx-gl-account-display [glAccount]="glAccount.parent"></mifosx-gl-account-display>
</a>
</div>
@@ -37,17 +37,13 @@
<div fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column" [formGroupName]="i">
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Affected GL Entry (Debit)" | translate}}</mat-label>
<mat-select required formControlName="glAccountId">
<mat-option *ngFor="let affectedGLEntryDebit of glAccountData" [value]="affectedGLEntryDebit.id">
{{ affectedGLEntryDebit.name + ' (' + affectedGLEntryDebit.glCode + ')' }}
</mat-option>
</mat-select>
<mat-error *ngIf="debits.at(i).controls.glAccountId.hasError('required')">
{{"labels.inputs.Affected GL Entry (Debit)" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="debits.at(i).controls.glAccountId"
[glAccountList]="glAccountData"
[required]="true"
[inputLabel]="'Affected GL Entry (Debit)'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="43%">
<mat-label>{{"labels.inputs.Debit Amount" | translate}}</mat-label>
@@ -75,17 +71,13 @@
<div fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column" [formGroupName]="i">
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Affected GL Entry (Credit)" | translate}}</mat-label>
<mat-select required formControlName="glAccountId">
<mat-option *ngFor="let affectedGLEntryCredit of glAccountData" [value]="affectedGLEntryCredit.id">
{{ affectedGLEntryCredit.name + ' (' + affectedGLEntryCredit.glCode + ')' }}
</mat-option>
</mat-select>
<mat-error *ngIf="credits.at(i).controls.glAccountId.hasError('required')">
{{"labels.inputs.Affected GL Entry (Credit)" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="credits.at(i).controls.glAccountId"
[glAccountList]="glAccountData"
[required]="true"
[inputLabel]="'Affected GL Entry (Credit)'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="43%">
<mat-label>{{"labels.inputs.Credit Amount"|translate}}</mat-label>
@@ -20,17 +20,13 @@
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>{{"labels.inputs.Account"|translate}}</mat-label>
<mat-select required formControlName="glAccountId">
<mat-option *ngFor="let glAccount of glAccountData" [value]="glAccount.id">
{{ glAccount.name + ' (' + glAccount.glCode + ')' }}
</mat-option>
</mat-select>
<mat-error *ngIf="financialActivityMappingForm.controls.glAccountId.hasError('required')">
{{"labels.inputs.Account"|translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector
[inputFormControl]="financialActivityMappingForm.controls.glAccountId"
[glAccountList]="glAccountData"
[required]="true"
[inputLabel]="'Account'"
>
</mifosx-gl-account-selector>
</div>
@@ -5,6 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
/** Custom Services */
import { AccountingService } from '../../accounting.service';
import { GLAccount } from 'app/shared/models/general.model';
/**
* Create financial activity mapping component.
@@ -21,7 +22,7 @@ export class CreateFinancialActivityMappingComponent implements OnInit {
/** GL Account options. */
glAccountOptions: any;
/** GL Account data. */
glAccountData: any;
glAccountData: GLAccount[] = [];
/** Financial activity data. */
financialActivityData: any;
@@ -17,15 +17,13 @@
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{"labels.inputs.Account"|translate}}</mat-label>
<mat-select required formControlName="glAccountId">
<mat-option *ngFor="let glAccount of glAccountData" [value]="glAccount.id">
{{ glAccount.name + ' (' + glAccount.glCode + ')' }}
</mat-option>
</mat-select>
</mat-form-field>
<mifosx-gl-account-selector
[inputFormControl]="financialActivityMappingForm.controls.glAccountId"
[glAccountList]="glAccountData"
[required]="true"
[inputLabel]="'Account'"
>
</mifosx-gl-account-selector>
</div>
</mat-card-content>
@@ -5,6 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
/** Custom Services */
import { AccountingService } from '../../accounting.service';
import { GLAccount } from 'app/shared/models/general.model';
/**
* Edit financial activity mapping component.
@@ -21,7 +22,7 @@ export class EditFinancialActivityMappingComponent implements OnInit {
/** GL Account options. */
glAccountOptions: any;
/** GL Account data. */
glAccountData: any;
glAccountData: GLAccount[] = [];
/** Financial activity data. */
financialActivityData: any;
/** Financial activity account ID. */
@@ -25,13 +25,11 @@
{{ financialActivityAccount?.financialActivityData.name }}
</div>
<div fxFlex="50%" class="header">
{{"labels.inputs.Account Name" | translate}}
</div>
<div fxFlex="50%">
{{ financialActivityAccount?.glAccountData.name }}
</div>
<mifosx-gl-account-display fxFlex="100%"
[glAccount]="financialActivityAccount?.glAccountData"
[accountTitle]="'Account Name'"
>
</mifosx-gl-account-display>
</div>
@@ -5,10 +5,13 @@
<input matInput [formControl]="officeName" [matAutocomplete]="officeNameAutocomplete">
</mat-form-field>
<mat-form-field fxFlex="31%">
<mat-label>{{"labels.inputs.GL Account Name or Code" | translate}}</mat-label>
<input matInput [formControl]="glAccount" [matAutocomplete]="glAccountAutocomplete">
</mat-form-field>
<mifosx-gl-account-selector fxFlex="31%"
[inputFormControl]="glAccount"
[glAccountList]="glAccountData"
[required]="true"
[inputLabel]="'GL Account Name or Code'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="31%">
<mat-label>{{'labels.inputs.Filter' | translate}}</mat-label>
@@ -62,13 +65,6 @@
</mat-option>
</mat-autocomplete>
<mat-autocomplete autoActiveFirstOption #glAccountAutocomplete="matAutocomplete" [displayWith]="displayGLAccount">
<mat-option *ngFor="let glAccount of filteredGLAccountData | async" [value]="{ id: glAccount.id, name: glAccount.name, glCode: glAccount.glCode }">
{{ glAccount.name + ' (' + glAccount.glCode + ')' }}
</mat-option>
</mat-autocomplete>
<div class="mat-elevation-z8 container">
<table mat-table [dataSource]="dataSource" matSort>
@@ -170,7 +170,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit {
this.glAccount.valueChanges
.pipe(
map(value => value.id ? value.id : ''),
map(value => value ? value : ''),
debounceTime(500),
distinctUntilChanged(),
tap((filterValue) => {
@@ -269,15 +269,6 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit {
return office ? office.name : undefined;
}
/**
* Displays gl account name in form control input.
* @param {any} glAccount Gl Account data.
* @returns {string} Gl Account name if valid otherwise undefined.
*/
displayGLAccount(glAccount?: any): string | undefined {
return glAccount ? glAccount.name + ' (' + glAccount.glCode + ')' : undefined;
}
/**
* Sets filtered offices for autocomplete.
*/
@@ -70,9 +70,7 @@ export class RejectClientTransferComponent implements OnInit {
rejectClientTransferFormData.transferDate = this.dateUtils.formatDate(prevTransferDate, dateFormat);
}
const data = {
...rejectClientTransferFormData,
dateFormat,
locale
...rejectClientTransferFormData
};
this.clientsService.executeClientCommand(this.clientId, 'rejectTransfer', data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
@@ -73,9 +73,7 @@ export class UndoClientTransferComponent implements OnInit {
undoClientTransferFormData.transferDate = this.dateUtils.formatDate(prevTransferDate, dateFormat);
}
const data = {
...undoClientTransferFormData,
dateFormat,
locale
...undoClientTransferFormData
};
this.clientsService.executeClientCommand(this.clientId, 'withdrawTransfer', data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
@@ -32,7 +32,7 @@
<mat-card-title fxLayout="row wrap" class="content">
<h3 fxFlex="95%">
<i class="fa fa-stop" [ngClass]="clientViewData.status.code|statusLookup"
[matTooltip]="clientViewData.status.value"></i>
matTooltip="{{'labels.status.' + clientViewData.status.value | translate}}"></i>
<b>{{"labels.inputs.Client Name" | translate}} :</b><mifosx-entity-name entityName="{{clientViewData.displayName}}"></mifosx-entity-name>
</h3>
<div fxFlex="5%">
@@ -82,7 +82,7 @@
<div fxFlex="4%">
<button mat-icon-button [matMenuTriggerFor]="accountMenu" aria-label="Loan account actions"
yPosition="below">
yPosition="below" *ngIf="buttonConfig.singleButtons.length > 0">
<mat-icon matListIcon class="actions-menu">
<fa-icon icon="bars" size="sm"></fa-icon>
</mat-icon>
@@ -723,93 +723,78 @@
<h4 fxFlexFill class="mat-h4">Assets / Liabilities</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">Fund source:</span>
<span fxFlex="53%">({{accountingMappings.fundSourceAccount.glCode}}) {{
accountingMappings.fundSourceAccount.name }}</span>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Fund source'" [glAccount]="accountingMappings.fundSourceAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
</div>
<h4 fxFlexFill class="mat-h4">Assets</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">Loan portfolio:</span>
<span fxFlex="53%">({{accountingMappings.loanPortfolioAccount.glCode}}) {{
accountingMappings.loanPortfolioAccount.name }}</span>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Loan portfolio'" [glAccount]="accountingMappings.loanPortfolioAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<div fxFlexFill *ngIf="loanProduct.accountingRule.id === 3 || loanProduct.accountingRule.id === 4"
fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">Interest Receivable:</span>
<span fxFlex="53%">({{accountingMappings.receivableInterestAccount.glCode}}) {{
accountingMappings.receivableInterestAccount.name }}</span>
<span fxFlex="47%">Fees Receivable:</span>
<span fxFlex="53%">({{accountingMappings.receivableFeeAccount.glCode}}) {{
accountingMappings.receivableInterestAccount.name }}</span>
<span fxFlex="47%">Penalties Receivable:</span>
<span fxFlex="53%">({{accountingMappings.receivablePenaltyAccount.glCode}}) {{
accountingMappings.receivablePenaltyAccount.name }}</span>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Interest Receivable'" [glAccount]="accountingMappings.receivableInterestAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Fees Receivable'" [glAccount]="accountingMappings.receivableFeeAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Penalties Receivable'" [glAccount]="accountingMappings.receivablePenaltyAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
</div>
<span fxFlex="47%">Transfer in suspense:</span>
<span fxFlex="53%">({{accountingMappings.transfersInSuspenseAccount.glCode}}) {{
accountingMappings.transfersInSuspenseAccount.name }}</span>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Transfer in suspense'" [glAccount]="accountingMappings.transfersInSuspenseAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
</div>
<h4 fxFlexFill class="mat-h4">Income</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Income from Interest'" [glAccount]="accountingMappings.interestOnLoanAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Income from fees'" [glAccount]="accountingMappings.incomeFromFeeAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Income from penalties'" [glAccount]="accountingMappings.incomeFromPenaltyAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Income from Recovery Repayments'" [glAccount]="accountingMappings.incomeFromRecoveryAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" *ngIf="accountingMappings.incomeFromChargeOffInterestAccount"
[accountTitle]="'Income from ChargeOff Interest'" [glAccount]="accountingMappings.incomeFromChargeOffInterestAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" *ngIf="accountingMappings.incomeFromChargeOffFeesAccount"
[accountTitle]="'Income from ChargeOff Fees'" [glAccount]="accountingMappings.incomeFromChargeOffFeesAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" *ngIf="accountingMappings.incomeFromChargeOffPenaltyAccount"
[accountTitle]="'Income from ChargeOff Penalty'" [glAccount]="accountingMappings.incomeFromChargeOffPenaltyAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Expenses' | translate}}</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">Income from Interest:</span>
<span fxFlex="53%">({{accountingMappings.interestOnLoanAccount.glCode}}) {{
accountingMappings.interestOnLoanAccount.name }}</span>
<span fxFlex="47%">Income from fees:</span>
<span fxFlex="53%">({{accountingMappings.incomeFromFeeAccount.glCode}}) {{
accountingMappings.incomeFromFeeAccount.name }}</span>
<span fxFlex="47%">Income from penalties:</span>
<span fxFlex="53%">({{accountingMappings.incomeFromPenaltyAccount.glCode}}) {{
accountingMappings.incomeFromPenaltyAccount.name }}</span>
<span fxFlex="47%">Income from Recovery Repayments:</span>
<span fxFlex="53%">({{accountingMappings.incomeFromRecoveryAccount.glCode}}) {{
accountingMappings.incomeFromRecoveryAccount.name }}</span>
<span *ngIf="accountingMappings.incomeFromChargeOffInterestAccount" fxFlex="47%">Income from ChargeOff
Interest:</span>
<span *ngIf="accountingMappings.incomeFromChargeOffInterestAccount" fxFlex="53%">
({{accountingMappings.incomeFromChargeOffInterestAccount.glCode}}) {{
accountingMappings.incomeFromChargeOffInterestAccount.name }}</span>
<span fxFlex="47%" *ngIf="accountingMappings.incomeFromChargeOffFeesAccount">Income from ChargeOff
Fees:</span>
<span fxFlex="53%" *ngIf="accountingMappings.incomeFromChargeOffFeesAccount">
({{accountingMappings.incomeFromChargeOffFeesAccount.glCode}}) {{
accountingMappings.incomeFromChargeOffFeesAccount.name }}</span>
<span fxFlex="47%" *ngIf="accountingMappings.incomeFromChargeOffPenaltyAccount">Income from ChargeOff
Penalty:</span>
<span fxFlex="53%" *ngIf="accountingMappings.incomeFromChargeOffPenaltyAccount">
({{accountingMappings.incomeFromChargeOffPenaltyAccount.glCode}}) {{
accountingMappings.incomeFromChargeOffPenaltyAccount.name }}</span>
</div>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Losses written off'" [glAccount]="accountingMappings.writeOffAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Expenses from Goodwill Credit'" [glAccount]="accountingMappings.goodwillCreditAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" *ngIf="accountingMappings.chargeOffExpenseAccount"
[accountTitle]="'ChargeOff Expense'" [glAccount]="accountingMappings.chargeOffExpenseAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" *ngIf="accountingMappings.chargeOffFraudExpenseAccount"
[accountTitle]="'ChargeOff Fraud Expense'" [glAccount]="accountingMappings.chargeOffFraudExpenseAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<h4 fxFlexFill class="mat-h4">Expenses</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">Losses written off:</span>
<span fxFlex="53%">({{accountingMappings.writeOffAccount.glCode}}) {{
accountingMappings.writeOffAccount.name }}</span>
<span fxFlex="47%">Expenses from Goodwill Credit:</span>
<span fxFlex="53%">({{accountingMappings.goodwillCreditAccount.glCode}}) {{
accountingMappings.goodwillCreditAccount.name }}</span>
<span *ngIf="accountingMappings.chargeOffExpenseAccount" fxFlex="47%">ChargeOff Expense:</span>
<span *ngIf="accountingMappings.chargeOffExpenseAccount" fxFlex="53%">
({{accountingMappings.chargeOffExpenseAccount.glCode}}) {{
accountingMappings.chargeOffExpenseAccount.name }}</span>
<span *ngIf="accountingMappings.chargeOffFraudExpenseAccount" fxFlex="47%">ChargeOff Fraud
Expense:</span>
<span *ngIf="accountingMappings.chargeOffFraudExpenseAccount" fxFlex="53%">
({{accountingMappings.chargeOffFraudExpenseAccount.glCode}}) {{
accountingMappings.chargeOffFraudExpenseAccount.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Liabilities</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">Over payment liability:</span>
<span fxFlex="53%">({{accountingMappings.overpaymentLiabilityAccount.glCode}}) {{
accountingMappings.overpaymentLiabilityAccount.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%"
[accountTitle]="'Over payment liability'" [glAccount]="accountingMappings.overpaymentLiabilityAccount" [withTitle]="'47%'">
</mifosx-gl-account-display>
<div
*ngIf="isAdvancedAccountingEnabled()"
@@ -12,277 +12,193 @@
<div *ngIf="loanProductAccountingForm.value.accountingRule >= 2 && loanProductAccountingForm.value.accountingRule <= 4" fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<h4 fxFlex="98%" class="mat-h4">Assets / Liability</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Assets' | translate}} / {{'labels.heading.Liability' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Fund source</mat-label>
<mat-select formControlName="fundSourceAccountId" required>
<mat-option *ngFor="let assetAndLiabilityAccount of assetAndLiabilityAccountData" [value]="assetAndLiabilityAccount.id">
({{ assetAndLiabilityAccount.glCode }}) {{ assetAndLiabilityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Fund source is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.fundSourceAccountId"
[glAccountList]="assetAndLiabilityAccountData"
[required]="true"
[inputLabel]="'Fund source'"
>
</mifosx-gl-account-selector>
<h4 fxFlex="98%" class="mat-h4">Assets</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Loan portfolio</mat-label>
<mat-select formControlName="loanPortfolioAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Loan portfolio is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.loanPortfolioAccountId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Loan portfolio'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.transfersInSuspenseAccountId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Transfer in suspense'"
>
</mifosx-gl-account-selector>
<div *ngIf="loanProductAccountingForm.value.accountingRule === 3 || loanProductAccountingForm.value.accountingRule === 4" fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Interest Receivable</mat-label>
<mat-select formControlName="receivableInterestAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Interest Receivable is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.receivableInterestAccountId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Interest Receivable'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Fees Receivable</mat-label>
<mat-select formControlName="receivableFeeAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Fees Receivable is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.receivableFeeAccountId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Fees Receivable'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Penalties Receivable</mat-label>
<mat-select formControlName="receivablePenaltyAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Penalties Receivable is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.receivablePenaltyAccountId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Penalties Receivable'"
>
</mifosx-gl-account-selector>
</div>
<mat-form-field fxFlex="48%">
<mat-label>Transfer in suspense</mat-label>
<mat-select formControlName="transfersInSuspenseAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Transfer in suspense is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.interestOnLoanAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from Interest'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromFeeAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from fees'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromPenaltyAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from penalties'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromRecoveryAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from Recovery Repayments'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromChargeOffInterestAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from ChargeOff Interest'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromChargeOffFeesAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from ChargeOff Fees'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromChargeOffPenaltyAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from ChargeOff Penalty'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromGoodwillCreditInterestAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from Goodwill Credit Interest'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromGoodwillCreditFeesAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from Goodwill Credit Fees'"
>
</mifosx-gl-account-selector>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.incomeFromGoodwillCreditPenaltyAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from Goodwill Credit Penalty'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Income</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Expenses' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Income from Interest</mat-label>
<mat-select formControlName="interestOnLoanAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from Interest is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.writeOffAccountId"
[glAccountList]="expenseAccountData"
[required]="true"
[inputLabel]="'Losses written off'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from fees is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.goodwillCreditAccountId"
[glAccountList]="expenseAccountData"
[required]="true"
[inputLabel]="'Expenses from Goodwill Credit'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Income from penalties</mat-label>
<mat-select formControlName="incomeFromPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from penalties is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.chargeOffExpenseAccountId"
[glAccountList]="expenseAccountData"
[required]="true"
[inputLabel]="'ChargeOff Expense'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Income from Recovery Repayments</mat-label>
<mat-select formControlName="incomeFromRecoveryAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from Recovery Repayments is <strong>required</strong>
</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-form-field fxFlex="48%">
<mat-label>Income from Goodwill Credit Interest</mat-label>
<mat-select formControlName="incomeFromGoodwillCreditInterestAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from Goodwill Credit Interest is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Income from Goodwill Credit Fees</mat-label>
<mat-select formControlName="incomeFromGoodwillCreditFeesAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from Goodwill Credit Fees is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Income from Goodwill Credit Penalty</mat-label>
<mat-select formControlName="incomeFromGoodwillCreditPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from Goodwill Credit Penalty is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.chargeOffFraudExpenseAccountId"
[glAccountList]="expenseAccountData"
[required]="true"
[inputLabel]="'ChargeOff Fraud Expense'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Expenses</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Losses written off</mat-label>
<mat-select formControlName="writeOffAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Losses written off is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<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 }}
</mat-option>
</mat-select>
<mat-error>
Goodwill credit is <strong>required</strong>
</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>
<mat-form-field fxFlex="48%">
<mat-label>Over payment liability</mat-label>
<mat-select formControlName="overpaymentLiabilityAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Over payment liability is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="loanProductAccountingForm.controls.overpaymentLiabilityAccountId"
[glAccountList]="liabilityAccountData"
[required]="true"
[inputLabel]="'Over payment liability'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
@@ -12,139 +12,99 @@
<div *ngIf="savingProductAccountingForm.value.accountingRule === 2" fxFlexFill fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<h4 fxFlex="98%" class="mat-h4">Assets</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Saving reference</mat-label>
<mat-select formControlName="savingsReferenceAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Saving reference is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.savingsReferenceAccountId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Saving reference'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Overdraft portfolio</mat-label>
<mat-select formControlName="overdraftPortfolioControlId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Overdraft portfolio is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.overdraftPortfolioControlId"
[glAccountList]="assetAccountData"
[required]="true"
[inputLabel]="'Overdraft portfolio'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Liabilities</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Saving control</mat-label>
<mat-select formControlName="savingsControlAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Saving control is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.savingsControlAccountId"
[glAccountList]="liabilityAccountData"
[required]="true"
[inputLabel]="'Saving control'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Savings transfers in suspense</mat-label>
<mat-select formControlName="transfersInSuspenseAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Savings transfers in suspense is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.transfersInSuspenseAccountId"
[glAccountList]="liabilityAccountData"
[required]="true"
[inputLabel]="'Savings transfers in suspense'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%" *ngIf="isDormancyTrackingActive.value">
<mat-label>Escheat liability</mat-label>
<mat-select formControlName="escheatLiabilityId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Escheat liability is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%" *ngIf="isDormancyTrackingActive.value"
[inputFormControl]="savingProductAccountingForm.controls.escheatLiabilityId"
[glAccountList]="liabilityAccountData"
[required]="true"
[inputLabel]="'Escheat liability'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Expenses</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Expenses' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Interest on savings</mat-label>
<mat-select formControlName="interestOnSavingsAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Interest on savings is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.interestOnSavingsAccountId"
[glAccountList]="expenseAccountData"
[required]="true"
[inputLabel]="'Interest on savings'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Write-off</mat-label>
<mat-select formControlName="writeOffAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Write-off is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.writeOffAccountId"
[glAccountList]="expenseAccountData"
[required]="true"
[inputLabel]="'Write-off'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="98%" class="mat-h4">Income</h4>
<h4 fxFlex="98%" class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<mat-form-field fxFlex="48%">
<mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from fees Repayments is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.incomeFromFeeAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from fees'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Income from penalties</mat-label>
<mat-select formControlName="incomeFromPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Income from penalties is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.incomeFromPenaltyAccountId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Income from penalties'"
>
</mifosx-gl-account-selector>
<mat-form-field fxFlex="48%">
<mat-label>Overdraft Interest Income</mat-label>
<mat-select formControlName="incomeFromInterestId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option>
</mat-select>
<mat-error>
Overdraft Interest Income is <strong>required</strong>
</mat-error>
</mat-form-field>
<mifosx-gl-account-selector fxFlex="48%"
[inputFormControl]="savingProductAccountingForm.controls.incomeFromInterestId"
[glAccountList]="incomeAccountData"
[required]="true"
[inputLabel]="'Overdraft Interest Income'"
>
</mifosx-gl-account-selector>
<mat-divider fxFlex="98%"></mat-divider>
@@ -208,57 +208,44 @@
<div fxFlexFill *ngIf="savingProduct.accountingRule.id === 2" fxLayout="row wrap" fxLayout.lt-md="column">
<h4 fxFlexFill class="mat-h4">Assets</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Saving reference'"
[glAccount]="savingProduct.accountingMappings.savingsReferenceAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Overdraft portfolio'"
[glAccount]="savingProduct.accountingMappings.overdraftPortfolioControl" [withTitle]="'40%'">
</mifosx-gl-account-display>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Saving reference:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.savingsReferenceAccount.glCode }}) {{
savingProduct.accountingMappings.savingsReferenceAccount.name }}</span>
<span fxFlex="40%">Overdraft portfolio:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.overdraftPortfolioControl.glCode }}) {{
savingProduct.accountingMappings.overdraftPortfolioControl.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from fees'"
[glAccount]="savingProduct.accountingMappings.incomeFromFeeAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from penalties'"
[glAccount]="savingProduct.accountingMappings.incomeFromPenaltyAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from penalties'"
[glAccount]="savingProduct.accountingMappings.incomeFromInterest" [withTitle]="'40%'">
</mifosx-gl-account-display>
<h4 fxFlexFill class="mat-h4">Liabilities</h4>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Expenses' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Interest on savings'"
[glAccount]="savingProduct.accountingMappings.interestOnSavingsAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Write-off'"
[glAccount]="savingProduct.accountingMappings.writeOffAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Saving control:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.savingsControlAccount.glCode }}) {{
savingProduct.accountingMappings.savingsControlAccount.name }}</span>
<span fxFlex="40%">Savings transfers in suspense:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.transfersInSuspenseAccount.glCode }}) {{
savingProduct.accountingMappings.transfersInSuspenseAccount.name }}</span>
<div fxFlexFill *ngIf="savingProduct.isDormancyTrackingActive">
<span fxFlex="40%">Escheat liability:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.escheatLiabilityAccount.glCode }}) {{
savingProduct.accountingMappings.escheatLiabilityAccount.name }}</span>
</div>
</div>
<h4 fxFlexFill class="mat-h4">Expenses</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Interest on savings:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.interestOnSavingsAccount.glCode }}) {{
savingProduct.accountingMappings.interestOnSavingsAccount.name }}</span>
<span fxFlex="40%">Write-off:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.writeOffAccount.glCode }}) {{
savingProduct.accountingMappings.writeOffAccount.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">Income</h4>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Income from fees:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.incomeFromFeeAccount.glCode }}) {{
savingProduct.accountingMappings.incomeFromFeeAccount.name }}</span>
<span fxFlex="40%">Income from penalties:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.incomeFromPenaltyAccount.glCode }}) {{
savingProduct.accountingMappings.incomeFromPenaltyAccount.name }}</span>
<span fxFlex="40%">Overdraft Interest Income:</span>
<span fxFlex="60%">({{ savingProduct.accountingMappings.incomeFromInterest.glCode }}) {{
savingProduct.accountingMappings.incomeFromInterest.name }}</span>
</div>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Saving control'"
[glAccount]="savingProduct.accountingMappings.savingsControlAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Savings transfers in suspense'"
[glAccount]="savingProduct.accountingMappings.transfersInSuspenseAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Escheat liability'"
*ngIf="savingProduct.accountingMappings.escheatLiabilityAccount"
[glAccount]="savingProduct.accountingMappings.escheatLiabilityAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<div
*ngIf="savingProduct.paymentChannelToFundSourceMappings?.length || savingProduct.feeToIncomeAccountMappings?.length || savingProduct.penaltyToIncomeAccountMappings?.length"
@@ -0,0 +1,13 @@
<span *ngIf="accountTitle">
<div fxFlex="{{withTitle}}" class="header">
{{'labels.inputs.' + accountTitle | translate}}
</div>
<div fxFlex="{{withAccount}}">
{{glAccountValue()}}
</div>
</span>
<div fxFlex="100%" *ngIf="!accountTitle">
{{glAccountValue()}}
</div>
@@ -0,0 +1,8 @@
div {
margin: 0.3rem 0;
word-wrap: break-word;
&.header {
font-weight: 500;
}
}
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { GlAccountDisplayComponent } from './gl-account-display.component';
describe('GlAccountDisplayComponent', () => {
let component: GlAccountDisplayComponent;
let fixture: ComponentFixture<GlAccountDisplayComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ GlAccountDisplayComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(GlAccountDisplayComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,28 @@
import { Component, Input, OnInit } from '@angular/core';
import { GLAccount } from 'app/shared/models/general.model';
@Component({
selector: 'mifosx-gl-account-display',
templateUrl: './gl-account-display.component.html',
styleUrls: ['./gl-account-display.component.scss']
})
export class GlAccountDisplayComponent implements OnInit {
@Input() glAccount: GLAccount | null = null;
@Input() accountTitle: string | null = null;
@Input() withTitle = '50%';
@Input() withAccount = '50%';
constructor() { }
ngOnInit(): void {
}
glAccountValue(): string {
if (this.glAccount) {
return '(' + this.glAccount.glCode + ') ' + (this.glAccount.nameDecorated ? this.glAccount.nameDecorated : this.glAccount.name);
}
return '';
}
}
@@ -0,0 +1,31 @@
<mat-form-field fxFlex="100%" *ngIf="required">
<mat-label>{{'labels.inputs.' + inputLabel | translate}}</mat-label>
<mat-select required [formControl]="inputFormControl">
<mat-option>
<ngx-mat-select-search [formControl]="filterFormCtrl"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let glAccount of glAccountData | async" [value]="glAccount.id">
{{ '(' + glAccount.glCode + ') ' + glAccount.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="inputFormControl.hasError('required')">
{{"labels.inputs.Account"| translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="100%" *ngIf="!required">
<mat-label>{{'labels.inputs.' + inputLabel | translate}}</mat-label>
<mat-select [formControl]="inputFormControl">
<mat-option>
<ngx-mat-select-search [formControl]="filterFormCtrl"
placeholderLabel="{{placeHolderLabel}}"
noEntriesFoundLabel="{{noEntriesFoundLabel}}">
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let glAccount of glAccountData | async" [value]="glAccount.id">
{{ '(' + glAccount.glCode + ') ' + glAccount.name }}
</mat-option>
</mat-select>
</mat-form-field>
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { GlAccountSelectorComponent } from './gl-account-selector.component';
describe('GlAccountSelectorComponent', () => {
let component: GlAccountSelectorComponent;
let fixture: ComponentFixture<GlAccountSelectorComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ GlAccountSelectorComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(GlAccountSelectorComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,71 @@
import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { UntypedFormControl } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { GLAccount } from 'app/shared/models/general.model';
import { ReplaySubject, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'mifosx-gl-account-selector',
templateUrl: './gl-account-selector.component.html',
styleUrls: ['./gl-account-selector.component.scss']
})
export class GlAccountSelectorComponent implements OnInit, OnChanges, OnDestroy {
@Input() inputFormControl: UntypedFormControl;
@Input() glAccountList: GLAccount[] = [];
@Input() required = false;
@Input() inputLabel = '';
/** GL Account data. */
protected glAccountData: ReplaySubject<GLAccount[]> = new ReplaySubject<GLAccount[]>(1);
/** control for the filter select */
protected filterFormCtrl: UntypedFormControl = new UntypedFormControl('');
/** Subject that emits when the component has been destroyed. */
protected _onDestroy = new Subject<void>();
placeHolderLabel = '';
noEntriesFoundLabel = '';
constructor(private translateService: TranslateService) { }
ngOnInit(): void {
// listen for search field value changes
this.filterFormCtrl.valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.searchGLAccount();
});
this.placeHolderLabel = this.translateService.instant('labels.inputs.Filter');
this.noEntriesFoundLabel = this.translateService.instant('labels.text.No data found');
}
ngOnChanges(changes: SimpleChanges): void {
if (this.glAccountList) {
this.glAccountData.next(this.glAccountList.slice());
}
}
ngOnDestroy(): void {
this._onDestroy.next();
this._onDestroy.complete();
}
searchGLAccount(): void {
if (this.glAccountList) {
const search: string = this.filterFormCtrl.value.toLowerCase();
if (!search) {
this.glAccountData.next(this.glAccountList.slice());
} else {
this.glAccountData.next(this.glAccountList.filter((option: GLAccount) => {
return option.name.toLowerCase().indexOf(search) >= 0 || option.glCode.toLowerCase().indexOf(search) >= 0;
}));
}
}
}
}
+2
View File
@@ -32,6 +32,7 @@ import {
faDollarSign,
faEdit,
faEnvelope,
faExchange,
faExclamationCircle,
faExclamationTriangle,
faEye,
@@ -154,6 +155,7 @@ export class IconsModule {
faDollarSign,
faEdit,
faEnvelope,
faExchange,
faExclamationCircle,
faExclamationTriangle,
faEye,
+2
View File
@@ -38,6 +38,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatTreeModule } from '@angular/material/tree';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
/**
* Material Module
@@ -71,6 +72,7 @@ import { MatTreeModule } from '@angular/material/tree';
MatProgressSpinnerModule,
MatRadioModule,
MatSelectModule,
NgxMatSelectSearchModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
+1
View File
@@ -15,6 +15,7 @@ export interface GLAccount {
name: string;
glCode: string;
description: string;
nameDecorated?: string;
disabled: boolean;
manualEntriesAllowed: boolean;
type: OptionData;
+8 -2
View File
@@ -43,6 +43,8 @@ import { AccountNumberComponent } from './account-number/account-number.componen
import { EntityNameComponent } from './entity-name/entity-name.component';
import { TransactionPaymentDetailComponent } from './transaction-payment-detail/transaction-payment-detail.component';
import { StepperButtonsComponent } from './steppers/stepper-buttons/stepper-buttons.component';
import { GlAccountSelectorComponent } from './accounting/gl-account-selector/gl-account-selector.component';
import { GlAccountDisplayComponent } from './accounting/gl-account-display/gl-account-display.component';
/**
* Shared Module
@@ -92,7 +94,9 @@ import { StepperButtonsComponent } from './steppers/stepper-buttons/stepper-butt
AccountNumberComponent,
EntityNameComponent,
TransactionPaymentDetailComponent,
StepperButtonsComponent
StepperButtonsComponent,
GlAccountSelectorComponent,
GlAccountDisplayComponent
],
exports: [
FileUploadComponent,
@@ -120,7 +124,9 @@ import { StepperButtonsComponent } from './steppers/stepper-buttons/stepper-butt
SvgIconComponent,
EntityNameComponent,
TransactionPaymentDetailComponent,
StepperButtonsComponent
StepperButtonsComponent,
GlAccountSelectorComponent,
GlAccountDisplayComponent
]
})
export class SharedModule { }