Savings and Deposit products using Accrual periodic accounting

This commit is contained in:
Jose Alberto Hernandez
2024-02-26 22:42:27 -06:00
parent e2c6562656
commit d6dec3dc8d
48 changed files with 1320 additions and 932 deletions
@@ -0,0 +1,59 @@
<div fxLayout="row wrap" fxLayout.lt-md="column">
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Type:</span>
<span fxFlex="60%">{{ accountingRule.value }}</span>
</div>
<div fxFlexFill *ngIf="isCashOrAccrualAccounting()" fxLayout="row wrap" fxLayout.lt-md="column">
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Assets' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Saving reference'"
[glAccount]="accountingMappings.savingsReferenceAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Overdraft portfolio'" *ngIf="accountingMappings.overdraftPortfolioControl"
[glAccount]="accountingMappings.overdraftPortfolioControl" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Fees Receivable'" *ngIf="isAccrualAccounting()"
[glAccount]="accountingMappings.feeReceivableAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Penalties Receivable'" *ngIf="isAccrualAccounting()"
[glAccount]="accountingMappings.penaltyReceivableAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Liabilities' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Saving control'"
[glAccount]="accountingMappings.savingsControlAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Savings transfers in suspense'"
[glAccount]="accountingMappings.transfersInSuspenseAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Interest Payable'" *ngIf="isAccrualAccounting()"
[glAccount]="accountingMappings.interestPayableAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Escheat liability'"
*ngIf="accountingMappings.escheatLiabilityAccount" [glAccount]="accountingMappings.escheatLiabilityAccount"
[withTitle]="'40%'">
</mifosx-gl-account-display>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Income' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from fees'"
[glAccount]="accountingMappings.incomeFromFeeAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from penalties'"
[glAccount]="accountingMappings.incomeFromPenaltyAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Income from Interest'" *ngIf="accountingMappings.incomeFromInterest"
[glAccount]="accountingMappings.incomeFromInterest" [withTitle]="'40%'">
</mifosx-gl-account-display>
<h4 fxFlexFill class="mat-h4">{{'labels.heading.Expenses' | translate}}</h4>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Interest on savings'"
[glAccount]="accountingMappings.interestOnSavingsAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
<mifosx-gl-account-display fxFlex="100%" [accountTitle]="'Write-off'" *ngIf="accountingMappings.writeOffAccount"
[glAccount]="accountingMappings.writeOffAccount" [withTitle]="'40%'">
</mifosx-gl-account-display>
</div>
</div>
@@ -0,0 +1,59 @@
@import "assets/styles/colours";
.container {
padding: 1%;
margin: 1%;
width: 100%;
}
table {
width: 100%;
tr.incentives-row {
height: 0;
> td {
padding: 0;
}
.incentives {
overflow: hidden;
}
.mat-card {
border-radius: 0;
> h4 {
font-weight: 500;
margin: 0.5em 0 0;
}
}
}
}
.mat-h4 {
margin-top: 10px !important;
font-weight: 200;
color: $status-approved;
}
.mat-elevation-z1 {
margin: 1em 0 1.5em 0;
}
h2, h3, h4 {
margin: 0;
font-weight: 500;
}
span {
margin: 0.5em 0;
}
mat-divider {
margin: 0 0 0.5em 0;
}
.margin-t {
margin-top: 1em;
}
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewSavingsAccountingDetailsComponent } from './view-savings-accounting-details.component';
describe('ViewSavingsAccountingDetailsComponent', () => {
let component: ViewSavingsAccountingDetailsComponent;
let fixture: ComponentFixture<ViewSavingsAccountingDetailsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ViewSavingsAccountingDetailsComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(ViewSavingsAccountingDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,28 @@
import { Component, Input, OnInit } from '@angular/core';
import { Accounting } from 'app/core/utils/accounting';
import { OptionData } from 'app/shared/models/option-data.model';
@Component({
selector: 'mifosx-view-savings-accounting-details',
templateUrl: './view-savings-accounting-details.component.html',
styleUrls: ['./view-savings-accounting-details.component.scss']
})
export class ViewSavingsAccountingDetailsComponent implements OnInit {
@Input() accountingRule: OptionData;
@Input() accountingMappings: any[] = [];
constructor(private accounting: Accounting) { }
ngOnInit(): void {
}
isCashOrAccrualAccounting(): boolean {
return this.accounting.isCashOrAccrualAccounting(this.accountingRule);
}
isAccrualAccounting(): boolean {
return this.accounting.isAccrualAccounting(this.accountingRule);
}
}
+5 -2
View File
@@ -45,6 +45,7 @@ import { TransactionPaymentDetailComponent } from './transaction-payment-detail/
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';
import { ViewSavingsAccountingDetailsComponent } from './accounting/view-savings-accounting-details/view-savings-accounting-details.component';
/**
* Shared Module
@@ -96,7 +97,8 @@ import { GlAccountDisplayComponent } from './accounting/gl-account-display/gl-ac
TransactionPaymentDetailComponent,
StepperButtonsComponent,
GlAccountSelectorComponent,
GlAccountDisplayComponent
GlAccountDisplayComponent,
ViewSavingsAccountingDetailsComponent
],
exports: [
FileUploadComponent,
@@ -126,7 +128,8 @@ import { GlAccountDisplayComponent } from './accounting/gl-account-display/gl-ac
TransactionPaymentDetailComponent,
StepperButtonsComponent,
GlAccountSelectorComponent,
GlAccountDisplayComponent
GlAccountDisplayComponent,
ViewSavingsAccountingDetailsComponent,
]
})
export class SharedModule { }