@classytic/ledger-bd 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ import { AccountType } from "@classytic/ledger";
2
+
3
+ //#region src/reporting/nbr-schedule/types.d.ts
4
+ /**
5
+ * NBR canonical schedule box codes — see README.md for what these are and
6
+ * the verification status of the underlying IT-11GHA schedule.
7
+ */
8
+ /** Income Statement leaf boxes (mappable to individual accounts). */
9
+ type IncomeStatementBox = '47' | '48' | '52' | '53' | '53A' | '54' | '54A' | '55' | '55A' | '57' | '57A' | '58' | '59';
10
+ /** Income Statement computed totals — never assign an account directly here. */
11
+ type IncomeStatementTotal = '49' | '50' | '51' | '56' | '60';
12
+ /** Balance Sheet leaf boxes. */
13
+ type BalanceSheetBox = '61A' | '61B' | '61C' | '61D' | '61E' | '62A' | '62B' | '62C' | '62D' | '62E' | '64A' | '64B' | '64C' | '65A' | '65B' | '65C' | '65D' | '66A' | '66B' | '66C' | '66D';
14
+ /** Balance Sheet computed totals. */
15
+ type BalanceSheetTotal = '61' | '62' | '63' | '64' | '65' | '66' | '67';
16
+ type NbrScheduleBox = IncomeStatementBox | BalanceSheetBox | '50';
17
+ interface ScheduleLineItem {
18
+ box: NbrScheduleBox | IncomeStatementTotal | BalanceSheetTotal;
19
+ label: string;
20
+ /** true if this box is a computed sum of other boxes — never assign an account directly to it. */
21
+ isTotal: boolean;
22
+ /** For totals: which boxes it sums. */
23
+ sumsOf?: readonly string[];
24
+ }
25
+ interface NbrScheduleMappingResult {
26
+ box: NbrScheduleBox;
27
+ /** How confident this mapping is — see mapping.ts for the rule that fired. */
28
+ confidence: 'explicit' | 'range-default' | 'group-fallback';
29
+ }
30
+ //#endregion
31
+ //#region src/reporting/nbr-schedule/schedule-it11gha.d.ts
32
+ declare const IT11GHA_SCHEDULE: readonly ScheduleLineItem[];
33
+ declare function getScheduleLineItem(box: string): ScheduleLineItem | undefined;
34
+ //#endregion
35
+ //#region src/reporting/nbr-schedule/mapping.d.ts
36
+ declare function resolveScheduleBox(account: AccountType): NbrScheduleMappingResult | null;
37
+ //#endregion
38
+ //#region src/reporting/nbr-schedule/report.d.ts
39
+ interface TrialBalanceRow {
40
+ accountCode: string;
41
+ /** Signed balance in the caller's own unit convention (paisa or major taka). */
42
+ balance: number;
43
+ }
44
+ interface NbrScheduleReportRow {
45
+ box: NbrScheduleBox;
46
+ label: string;
47
+ total: number;
48
+ accountCount: number;
49
+ }
50
+ /**
51
+ * Aggregates a trial balance into the IT-11GHA schedule. Rows for account
52
+ * codes not found in `accountTypes`, or whose account maps to no box (e.g.
53
+ * tax expense — computed after Box 60, see mapping.ts), are excluded from
54
+ * totals; use `getUnmappedAccounts` to audit for gaps.
55
+ */
56
+ declare function buildNbrScheduleReport(trialBalance: readonly TrialBalanceRow[], accountTypes: readonly AccountType[]): NbrScheduleReportRow[];
57
+ /**
58
+ * Coverage audit: which accounts in a chart resolve to NO schedule box.
59
+ * Deliberately unmapped codes (tax expense, per mapping.ts) are excluded —
60
+ * pass `includeIntentional: true` to see them anyway.
61
+ */
62
+ declare function getUnmappedAccounts(accountTypes: readonly AccountType[], options?: {
63
+ includeIntentional?: boolean;
64
+ }): AccountType[];
65
+ //#endregion
66
+ export { IT11GHA_SCHEDULE, type NbrScheduleBox, type NbrScheduleMappingResult, type NbrScheduleReportRow, type ScheduleLineItem, type TrialBalanceRow, buildNbrScheduleReport, getScheduleLineItem, getUnmappedAccounts, resolveScheduleBox };