brewman/overlord/src/app/cash-flow/cash-flow.ts
tanshu a4b9fb7408 Works:
Balance sheet
 Ledger
 Cash Flow

along with urls
Balance sheet schema does not enforce multiple_of for amounts as multiple_of borks on random figures
2020-05-14 11:26:28 +05:30

37 lines
1.1 KiB
TypeScript

export class CashFlowItem {
name: string;
url: [];
amount: number;
constructor(name: string) {
this.name = name;
}
}
export class CashFlow {
startDate: string;
finishDate: string;
body?: { operating: CashFlowItem[], investing: CashFlowItem[], financing: CashFlowItem[], details: CashFlowItem[] };
footer?: CashFlowItem[];
static Data(value): CashFlowItem[] {
const d: CashFlowItem[] = [];
if (value.body.operating && value.body.operating.length) {
d.push(new CashFlowItem('Cash flows from Operating activities'));
d.push(...value.body.operating);
}
if (value.body.investing && value.body.investing.length) {
d.push(new CashFlowItem('Cash flows from Investing activities'));
d.push(...value.body.investing);
}
if (value.body.financing && value.body.financing.length) {
d.push(new CashFlowItem('Cash flows from Financing activities'));
d.push(...value.body.financing);
}
if (value.body.details && value.body.details.length) {
d.push(...value.body.details);
}
return d;
}
}