This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from markvanveen/develop
Financial Condition Report
- Loading branch information
Showing
16 changed files
with
294 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
src/app/accounting/financialCondition/financial-condition.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<!-- | ||
Copyright 2017 The Mifos Initiative. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
<fims-layout-card-over title="{{'Financial condition' | translate}}" [navigateBackTo]="['../']"> | ||
<div layout="row"> | ||
<table td-data-table *ngIf="financialCondition$ | async as financialCondition"> | ||
<ng-container *ngIf="assets$ | async as assets"> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<b translate>Assets</b> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell></td> | ||
</tr> | ||
<tr td-data-table-row *ngFor="let entry of assets.financialConditionEntries"> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
{{entry.description}} | ||
</td> | ||
<td td-data-table-cell> | ||
{{entry.value | displayFimsFinancialNumber}} | ||
</td> | ||
</tr> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<i translate>Subtotal</i> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
<i class="double-underline"> | ||
{{assets.subtotal | displayFimsFinancialNumber}} | ||
</i> | ||
</td> | ||
</tr> | ||
<tr td-data-table-row></tr> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<b translate>Total Assets</b> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
<b class="double-underline"> | ||
{{financialCondition.totalAssets | displayFimsFinancialNumber}} | ||
</b> | ||
</td> | ||
</tr> | ||
<tr td-data-table-row></tr> | ||
</ng-container> | ||
<ng-container *ngIf="equities$ | async as equities"> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<b translate>Equities</b> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell></td> | ||
</tr> | ||
<tr td-data-table-row *ngFor="let entry of equities.financialConditionEntries"> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
{{entry.description}} | ||
</td> | ||
<td td-data-table-cell> | ||
{{entry.value | displayFimsFinancialNumber}} | ||
</td> | ||
</tr> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<i translate>Subtotal</i> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
<i class="double-underline"> | ||
{{equities.subtotal | displayFimsFinancialNumber}} | ||
</i> | ||
</td> | ||
</tr> | ||
<tr td-data-table-row></tr> | ||
</ng-container> | ||
<ng-container *ngIf="liabilities$ | async as liabilities"> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<b translate>Liabilities</b> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell></td> | ||
</tr> | ||
<tr td-data-table-row *ngFor="let entry of liabilities.financialConditionEntries"> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
{{entry.description}} | ||
</td> | ||
<td td-data-table-cell> | ||
{{entry.value | displayFimsFinancialNumber}} | ||
</td> | ||
</tr> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<i translate>Subtotal</i> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
<i class="double-underline"> | ||
{{liabilities.subtotal | displayFimsFinancialNumber}} | ||
</i> | ||
</td> | ||
</tr> | ||
<tr td-data-table-row></tr> | ||
<tr td-data-table-row> | ||
<td td-data-table-cell> | ||
<b translate>Total Equities and Liabilities</b> | ||
</td> | ||
<td td-data-table-cell></td> | ||
<td td-data-table-cell> | ||
<b class="double-underline"> | ||
{{financialCondition.totalEquitiesAndLiabilities | displayFimsFinancialNumber}} | ||
</b> | ||
</td> | ||
</tr> | ||
</ng-container> | ||
</table> | ||
</div> | ||
</fims-layout-card-over> |
3 changes: 3 additions & 0 deletions
3
src/app/accounting/financialCondition/financial-condition.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.double-underline { | ||
border-bottom: 3px double; | ||
} |
54 changes: 54 additions & 0 deletions
54
src/app/accounting/financialCondition/financial-condition.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Copyright 2017 The Mifos Initiative. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import {Component} from '@angular/core'; | ||
import {AccountingService} from '../../services/accounting/accounting.service'; | ||
import {FinancialCondition} from '../../services/accounting/domain/financial-condition.model'; | ||
import {Observable} from 'rxjs/Observable'; | ||
import {FinancialConditionSection} from '../../services/accounting/domain/financial-condition-section.model'; | ||
|
||
@Component({ | ||
templateUrl: './financial-condition.component.html', | ||
styleUrls: ['./financial-condition.component.scss'] | ||
}) | ||
export class FinancialConditionComponent { | ||
|
||
financialCondition$: Observable<FinancialCondition>; | ||
|
||
assets$: Observable<FinancialConditionSection>; | ||
|
||
equities$: Observable<FinancialConditionSection>; | ||
|
||
liabilities$: Observable<FinancialConditionSection>; | ||
|
||
constructor(private accountingService: AccountingService) { | ||
this.financialCondition$ = accountingService.getFinancialCondition().share(); | ||
|
||
this.assets$ = this.financialCondition$ | ||
.map(statement => statement.financialConditionSections | ||
.find(section => section.type === 'ASSET') | ||
); | ||
|
||
this.equities$ = this.financialCondition$ | ||
.map(statement => statement.financialConditionSections | ||
.find(section => section.type === 'EQUITY') | ||
); | ||
|
||
this.liabilities$ = this.financialCondition$ | ||
.map(statement => statement.financialConditionSections | ||
.find(section => section.type === 'LIABILITY') | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/app/services/accounting/domain/financial-condition-entry.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright 2017 The Mifos Initiative. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
export interface FinancialConditionEntry { | ||
description: string; | ||
value: string; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/app/services/accounting/domain/financial-condition-section.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright 2017 The Mifos Initiative. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import {FinancialConditionEntry} from './financial-condition-entry.model'; | ||
|
||
export type Type = 'ASSET' | 'EQUITY' | 'LIABILITY'; | ||
|
||
export interface FinancialConditionSection { | ||
type: Type; | ||
description: string; | ||
financialConditionEntries: FinancialConditionEntry[]; | ||
subtotal: string; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/app/services/accounting/domain/financial-condition.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright 2017 The Mifos Initiative. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import {FinancialConditionSection} from './financial-condition-section.model'; | ||
|
||
export interface FinancialCondition { | ||
date: string; | ||
financialConditionSections: FinancialConditionSection[]; | ||
totalAssets: string; | ||
totalEquitiesAndLiabilities: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.