@classytic/ledger-bd 0.6.1 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -1,353 +1,385 @@
1
- # Changelog
2
-
3
- Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4
- adhering to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
-
6
- ## [0.6.0] — 2026-07-11
7
-
8
- ### Added — PPE / fixed-asset codes for the assets module
9
-
10
- Named constants in `BD_ACCOUNT_CODES` (`src/accounts/codes.ts`) for the
11
- PPE ledger accounts used by `@classytic/assets`:
12
-
13
- - **Asset categories** (with NBR straight-line depreciation rates from
14
- SRO No.120-Law/Income Tax/2025): `PPE_BUILDING` 1315 (10%),
15
- `PPE_FACTORY_BUILDING` 1314 (20%), `PPE_MACHINERY` 1322 (20%),
16
- `PPE_FURNITURE` 1335 (10%), `PPE_VEHICLE` 1337 (20%),
17
- `PPE_OFFICE_EQUIPMENT` 1333 (20%), `PPE_COMPUTER` 1334 (30%),
18
- `PPE_MEDICAL_EQUIPMENT` 1347 (20%).
19
- - **`ACCUMULATED_DEPRECIATION_PPE`** 1359 contra-asset for all PPE
20
- categories.
21
- - **Depreciation expense codes** `DEPRECIATION_BUILDING` 6601 through
22
- `DEPRECIATION_MEDICAL_EQUIPMENT` 6608 one per PPE category, so
23
- the depreciation journal entry can split by asset class.
24
- - **`LOSS_ON_ASSET_DISPOSAL`** 6810 disposal below book value.
25
-
26
- These codes are already part of the BFRS chart of accounts shipped in
27
- earlier versions; this release adds the named `BD_ACCOUNT_CODES` keys so
28
- the assets engine can resolve them symbolically without hardcoding strings.
29
-
30
- ## [0.5.0] - 2026-07-06
31
-
32
- Seven opt-in vertical extensions plus an NBR canonical reporting-code
33
- layer — the "become a standard for BD accountants" pass. Research-grounded
34
- (4-5 Jul 2026 web research across NBR/BMDC/DGHS/MRA/NGOAB/Bangladesh Bank
35
- sources), with confidence flags per account — see each vertical's README.
36
-
37
- ### Added — vertical extensions (`src/verticals/`, subpath `./verticals`)
38
-
39
- New, opt-in, additive-only (core chart files untouched); apply with
40
- `applyVerticals(BD_ACCOUNT_TYPES, [...names])`:
41
-
42
- - **`school`** (10 accounts) development/session/hostel/transport fee
43
- revenue, board-exam pass-through liability, two statutory teacher-fund
44
- payables (Retirement Benefit Board + Welfare Trust — genuinely distinct
45
- bodies), scholarship-waiver contra-revenue. Deliberately does NOT model
46
- MPO as a ledger account — since the Jan 2025 EFT rollout the government
47
- salary portion never touches the institution's own bank account.
48
- - **`agro`** (12 accounts) crop/jute/aquaculture WIP and inventory stages,
49
- cold-storage receivable + sourced ~3.82% spoilage allowance, pledged-
50
- produce financing under the Secured Transactions (Movable Property) Act
51
- 2023 (NOT "warehouse receipt financing" no such standalone BB scheme
52
- could be confirmed), direct-cash agro-subsidy income.
53
- - **`real-estate`** (4 accounts) contract asset/unbilled revenue distinct
54
- from retention receivable, landowner joint-venture unit-share payable,
55
- contractor mobilization-advance-received, guarantee margin deposit. Flags
56
- as explicitly open: no actual BD-listed developer's revenue-recognition
57
- policy could be located.
58
- - **`ngo-microfinance`** (13 accounts) loan portfolio by product,
59
- interest-in-suspense, PKSF per-tranche borrowing/fees (mirrors PKSF's own
60
- audited "Schedule of Service Charge Receivables"), member savings
61
- (compulsory/voluntary), NGOAB-mandated project-restricted bank account
62
- and fund.
63
- - **`restaurant`** (6 accounts) — service-charge payable/revenue (no BD
64
- Labour Act mandate for staff distribution could be verified — modeled as
65
- a policy choice, not compliance), cross-border franchise royalty payable
66
- (20% WHT), aggregator-commission contra-revenue (confirmed net-settlement
67
- via actual foodpanda invoice samples), beverage inventory.
68
- - **`rmg-enhancement`** (5 accounts) — corrects two misconceptions from an
69
- earlier draft: FDBP is bank bill-discounting/financing, NOT a "~0.6%
70
- incentive"; UD (Utilization Declaration) is a compliance filing with no
71
- cash event, NOT a subsidy trigger. Adds the genuine gap — a cash-incentive
72
- receivable for the real, sourced 180-day+ realization-to-disbursement lag.
73
- - **`hospital-enhancement`** (3 accounts) — consultant/doctor fee payable
74
- (legitimate collect-and-remit model) and patient admission deposit.
75
- Deliberately does NOT ship a "diagnostic referral commission" account —
76
- real and material (20-50% of test cost, well-documented) but explicitly
77
- prohibited under BMDC's Code of Professional Conduct §4.3.1; building
78
- dedicated tooling for it would mean designing software to facilitate a
79
- documented ethics violation.
80
-
81
- ### Added NBR canonical schedule (`src/reporting/nbr-schedule/`, subpath `./reporting/nbr-schedule`)
82
-
83
- A fixed numeric reporting taxonomyconfirmed via research that no such
84
- crosswalk exists anywhere in Bangladesh's legal lineage (Companies Act 1994
85
- Schedule XI, like India's Schedule III and the UK's Schedule 4, uses
86
- positional letter/Roman/Arabic outline labels, never a persistent numeric
87
- code the same role Canada's GIFI plays there has no BD equivalent to
88
- adopt). Built against the closest real analog: NBR's IT-11GHA company tax
89
- return, whose Part IV carries a fixed, currently-filed, numbered Balance
90
- Sheet/P&L box schema (47-67) — hence the name.
91
-
92
- - `resolveScheduleBox(account)` classifies ANY `AccountType`, core chart
93
- or vertical extension, onto a box. Covers the entire chart, not just new
94
- accounts, per explicit design requirement.
95
- - `buildNbrScheduleReport(trialBalance, accountTypes)`aggregates a trial
96
- balance into the schedule.
97
- - `getUnmappedAccounts(accountTypes)` coverage audit; the test suite
98
- asserts zero unmapped accounts (excluding tax expense, which is computed
99
- after Box 60 and has no box among 47-59) across the core chart AND all
100
- seven verticals combined.
101
- - Explicitly flagged as this package's own interpretive judgment, not a
102
- government-published crosswalk see `src/reporting/nbr-schedule/README.md`
103
- for what's gazette/circular-verified vs. inferred.
104
-
105
- ### Fixed mapping refinements found via a full-chart audit
106
-
107
- The initial mapping passed all narrow spot-check tests, but dumping the
108
- resolved box for all 757 accounts and reviewing it end-to-end (not just the
109
- handful of codes the first test pass happened to touch) surfaced 4 real
110
- misclassifications, now fixed and covered by dedicated regression tests:
111
-
112
- - Bonds/Debentures/Sukuk (2322/2323) were falling into the generic 65B
113
- "long-term borrowings" bucket; the schedule has a dedicated 65A "Bonds/
114
- Debentures" box that nothing was ever routed to.
115
- - Current Portion of Long-Term Debt (2200) landed in 66D "other" instead of
116
- 66A "short-term borrowings" it's literally the current-year slice of
117
- actual borrowings.
118
- - L/C Margin Liability (2205) was swept into 66C "provisions" alongside
119
- warranty/returns/legal-claims accruals, but it's a real bank-held deposit,
120
- not an estimate.
121
- - A blanket rule routing every account tagged `parentCode: 'Other Expenses'`
122
- into box 57 (Financial expenses) incorrectly caught 7 non-financial
123
- one-off losses (loss on sale of assets, penalties, demurrage, theft,
124
- natural disaster, crop loss 6810-6817) that share that parentCode with
125
- genuine interest/FX-cost accounts in the core chart, but belong in 55
126
- (Other operating expenses). Replaced with pure numeric-range classification
127
- for the whole Income Statement-Expense category.
128
-
129
- ### Tests
130
-
131
- 68 passing (43 existing + 25 new: 6 vertical code-collision/composition
132
- tests, 19 NBR canonical schedule mapping/coverage/report tests, including
133
- 4 regression tests for the audit findings above).
134
-
135
- ## [0.4.0] - 2026-07-02
136
-
137
- Tax-layer sync with `@classytic/bd-tax` 0.3.0 the code table, the Mushak
138
- 9.1 template, and the chart now cover the same law the calculator does.
139
-
140
- ### Added tax codes
141
-
142
- - **Trading-stage VAT codes**: `BD-VAT-4.5`, `BD-VAT-2.4`, `BD-VAT-2`,
143
- `BD-VAT-1.5` (no input credit; report on the new template lines 20–23).
144
- - **`BD-TOT-FIXED`** the FY2026-27 fixed-amount turnover-tax model
145
- (rate 0; post the assessed amount). `BD-TOT-4` stays for historical
146
- postings, renamed "(historical)".
147
- - **`BD-AT-IMP`** advance VAT at customs (7.5% commercial / 2%
148
- manufacturer), `recoverable`, reporting on line 24.
149
- - **VDS codes** (`BD-VDS-15/10/7.5/5/2`) — percent of service value per
150
- the VDS Rules 2025 service table, all reporting on line 25.
151
- - **New TDS codes**: `BD-TDS-PROF-IND` (15%), `BD-TDS-INT-IND` (10%),
152
- `BD-TDS-DIV-IND` (10%), `BD-TDS-TECH` (10%), `BD-TDS-TRANSPORT` (2%,
153
- FY2026-27), `BD-TDS-EXP` (1%, s.123).
154
-
155
- ### Fixed TDS code rates (Income Tax Act 2023)
156
-
157
- The table still carried ITO-1984-era rates that contradicted bd-tax's
158
- matrix: `BD-TDS-PROF` 10% **7.5%** (entities; s.90), `BD-TDS-RENT`
159
- 5% **10%** (s.109), `BD-TDS-INT` 10% → **20%** (companies; s.102),
160
- `BD-TDS-DIV` 10% → **20%** (companies; s.117), `BD-TDS-ADV` 4% → **3%**.
161
- 2135 TDS sub-account rates/descriptions updated to match, plus new
162
- `2135.TDS.TECH` and `2135.TDS.TRANSPORT` accounts.
163
-
164
- ### Added receivable-side tax accounts (`TAX_RECEIVABLE_ACCOUNTS`)
165
-
166
- `1151.AIT.IMPORT`, `1151.AIT.OTHER`, `1152.TDS.SUFFERED`,
167
- `1153.VDS.SUFFERED`, `1153.AT.IMPORT` the withholding-SUFFERED side.
168
- Matters from 1 Jul 2026: the Finance Act 2026 withdrew minimum-tax
169
- treatment, so TDS/AIT suffered is a true adjustable asset, not an expense.
170
-
171
- ### Changed — Mushak 9.1 template
172
-
173
- Lines **20–23** (trading-stage outputs, summed into line 9), **24** (AT
174
- credit on imports) and **25** (VDS increasing adjustment) appended; line
175
- 17 now computes `12 + 13 + 16 + 25 24`. Existing line numbers are
176
- untouched and the old math is preserved when the new lines are absent.
177
- Line 6 re-described for the fixed TOT model.
178
-
179
- ### Gazette verification (3 Jul 2026)
180
-
181
- `BD-TDS-ADV` corrected 3% **5%** (ITA 2023 s.92 — media advertising
182
- bills; media buying agents route via `BD-TDS-COMM`), with the matching
183
- `2135.TDS.ADV` account update. All other 0.4.0 rates confirmed against
184
- the verification pass (see `@classytic/bd-tax`
185
- `research/FY2026-27/06-gazette-verification.md`).
186
-
187
- ### Build
188
-
189
- - tsdown **^0.22.3**, aligned with `@classytic/arc`'s pattern:
190
- `skipNodeModulesBundle: true` + `neverBundle: [/^@classytic\//]`
191
- (a bundled second `@classytic/ledger` copy would break
192
- `defineCountryPack` identity), explicit `target: node22`.
193
- - Peer unchanged and verified: `@classytic/ledger >= 0.12.0` is the sole
194
- runtime import (`defineCountryPack`); everything else is type-only.
195
-
196
- ### Peers / dev stack (pre-publish refresh)
197
-
198
- - Peer: `@classytic/ledger >= 0.15.0` (was >= 0.12.0) — validated against
199
- the PUBLISHED 0.15.0 (43/43 on a clean registry install). Dev stack
200
- refreshed to published lines: ledger ^0.15.0, repo-core ^0.7.0,
201
- primitives ^0.9.1, mongokit ^3.17.0 (resolves 3.18).
202
-
203
- ### Tests
204
-
205
- 43 passing (15 existing + 28 new code/template/account pins).
206
-
207
- ## [0.3.2] - 2026-07-02
208
-
209
- ### Added
210
-
211
- Four VAT-collected tax sub-accounts under 2132 matching `@classytic/bd-tax`
212
- 0.2.0's new Third-Schedule trading-stage rate codes:
213
-
214
- - `2132.VAT4.5.COLLECTED` real estate >1,600 sqft
215
- - `2132.VAT2.4.COLLECTED` medicine trading stage (pharmacies)
216
- - `2132.VAT2.COLLECTED` petroleum trading / real estate ≤1,600 sqft
217
- - `2132.VAT1.5.COLLECTED` — wholesale trading stage
218
-
219
- `2132.TOT4.COLLECTED` description updated for the FY2026-27 fixed-amount
220
- turnover-tax model (post assessed fixed amounts to the same head).
221
-
222
- ## [0.2.3]
223
-
224
- ### Added
225
-
226
- **Expanded `BD_ACCOUNT_CODES`** to expose 25 more codes that were
227
- already seeded in `BD_ACCOUNT_TYPES` (since 0.1.0–0.2.2) but missing
228
- from the typed map. Hosts that previously hand-coded these as string
229
- literals in posting contracts can now reference them through the
230
- canonical export. The chart itself is unchangedonly the typed
231
- exports grew.
232
-
233
- #### Cash & Receivables
234
- - **`BANK_CHARGES: '6328'`** — gateway processing fees, mobile-money
235
- merchant deductions, ad-hoc bank charges.
236
- - **`CHARGEBACK_RECEIVABLE: '1159'`** — card-network dispute holding.
237
-
238
- #### Liabilities
239
- - **`COMMISSION_PAYABLE: '2122'`** — accrued sales/agent commission.
240
- - **`REVERSE_LOGISTICS_PAYABLE: '2162'`** — return-handling accrual.
241
- - **`CUSTOMER_ADVANCE: '2191'`** — IFRS 15 contract liability.
242
-
243
- #### Revenue / Other Income
244
- - **`TRANSPORT_REVENUE: '4147'`** line-item delivery charge billed to customer.
245
- - **`COURIER_REVENUE: '4159'`** — in-house courier service revenue.
246
- - **`BAD_DEBT_RECOVERY: '4310'`** recovery of previously written-off debt.
247
-
248
- #### COGS / Landed Cost
249
- - **`IMPORT_LANDED_COST: '5116'`** capitalized duty + freight + insurance.
250
- - **`CARRIAGE_INWARD: '5117'`** — domestic inbound freight (capitalized).
251
- - **`PACKAGING_PRODUCTION: '5317'`** production-time primary packaging.
252
- - **`CUSTOMS_DUTY: '5505'`** NBR import duty (when not capitalized).
253
- - **`CF_AGENT_COMMISSION: '5507'`** — clearing/forwarding agent fee.
254
-
255
- #### Operating Expenses
256
- - **`POSTAGE_ADMIN: '6302'`** — admin postage (NOT customer delivery).
257
- - **`SALES_COMMISSION: '6403'`** — internal commercial team commission.
258
- - **`FREIGHT_OUTWARD: '6405'`** outbound delivery cost (domestic).
259
- - **`SHIPPING_LOGISTICS_EXPORT: '6406'`** DHL / FedEx weight-priced export.
260
- - **`PACKAGING_DISPATCH: '6407'`** outbound packaging consumables.
261
- - **`MARKETPLACE_COMMISSION: '6422'`** Daraz / Chaldal / Pickaboo cut.
262
- - **`COURIER_COD_COMMISSION: '6423'`** Pathao / RedX / Steadfast COD cut.
263
- - **`LOGISTICS_HUB_RENT: '6426'`** — sortation-hub / depot rent.
264
- - **`COURIER_DRIVER_BONUS: '6428'`** — variable courier performance pay.
265
- - **`BAD_DEBT_WRITTEN_OFF: '6702'`** — unrecoverable A/R / shortfall.
266
- - **`MARKETPLACE_ADS: '6823'`** — platform-specific ad-engine fees.
267
- - **`MARKETPLACE_COMPLIANCE_FEE: '6824'`** recurring seller-platform fees.
268
-
269
- Together these cover the typical 3PL / DHL-style export / marketplace-
270
- aggregator accounting flows. The full chart still has ~120 more accounts
271
- (industry-specific: RMG, pharma, agro-processing, telecom, etc.) — reach
272
- for those via `BD_ACCOUNT_TYPES` directly when an industry-specific
273
- posting needs them; bring them into `BD_ACCOUNT_CODES` when a host-
274
- agnostic posting contract starts referencing them.
275
-
276
- ## [0.2.2]
277
-
278
- ### Added
279
-
280
- **`BD_ACCOUNT_CODES` map** canonical export of domain-meaningful keys
281
- to 4-digit chart codes (e.g. `BD_ACCOUNT_CODES.AR === '1141'`). Hosts
282
- build their posting contracts against this map instead of hand-coding
283
- chart-code literals. The map covers the codes most posting layers
284
- reference (cash/AR/AP/inventory/COGS/revenue/tax/clearings) and is
285
- typed with `BDAccountCode` and `BDAccountKey` helpers.
286
-
287
- Hosts that need different default mappings (e.g. a manufacturer
288
- defaulting `MERCHANDISE FINISHED_GOODS`) layer their own thin alias
289
- module on topthe chart is the same; the host's "default inventory
290
- account" is policy. See `BDAccountCode` for the typed key list.
291
-
292
- **Two clearing-account codes** in the liability section (2125 / 2126),
293
- matching SAP / Oracle / ERPNext placement (clearings have credit-natural
294
- balances, so they belong in 2xxx, not 1xxx):
295
-
296
- - **`2125`Goods Received / Invoice Received (GR/IR)** — accrued
297
- liability for physical goods receipt pending vendor invoice. Decouples
298
- physical receipt from financial posting:
299
- - Receipt: `Dr Inventory / Cr 2125`
300
- - Vendor bill: `Dr 2125 / Cr AP`
301
- - Period-end balance = receipts pending invoice (accrual reportable
302
- on the balance sheet). Cleared on 3-way match (PO receipt
303
- invoice).
304
-
305
- - **`2126` Transfer Cost Clearing (Inter-Branch)** accrued liability
306
- for inter-branch transit costs capitalized into receiver inventory per
307
- IAS 2:
308
- - Receive leg: `Dr 1164 (goods + transit) / Cr 1179 (goods) / Cr 2126 (transit)`
309
- - Host clears against actual freight invoice: `Dr 2126 / Cr AP`
310
-
311
- Both codes slot into the previously-empty 2125–2126 gap in the chart
312
- (between 2124 Freight & Shipping Payable and 2131 Income Tax Payable),
313
- so no existing seeded codes shift.
314
-
315
- ### Migration
316
-
317
- Pure additive change. Run `seedAccounts()` once after upgrade to pick up
318
- the two new codes — `accountRepository.seedAccounts()` is idempotent and
319
- will not modify pre-existing accounts.
320
-
321
- ## [0.2.1]
322
-
323
- ### Added
324
-
325
- - Chart of accounts: new expense code **`6423 Courier COD Commission`**
326
- under `SELLING_DISTRIBUTION`. Captures commission deductions from
327
- cash-on-delivery collections by BD courier partners (Pathao, RedX,
328
- Steadfast, Sundarban).
329
-
330
- ### Fixed
331
-
332
- - Packaging hygiene — added `README.md` and `CHANGELOG.md` to the `files`
333
- array, added `repository` / `bugs` / `homepage` / `publishConfig.access`
334
- to `package.json`, expanded `.gitignore` to cover `.env`, `.env.*`,
335
- `/.claude`, `.mcp.json`, and the other standard safety patterns.
336
-
337
- ## [0.2.0]
338
-
339
- Initial public release. Bangladesh country pack for `@classytic/ledger`.
340
-
341
- ### Ships
342
-
343
- - **BFRS chart of accounts** full post-0.8 tree (assets 1xxx, liabilities
344
- 2xxx, equity 3xxx, revenue 4xxx, cost-of-sales 5xxx, expenses 6xxx).
345
- - **NBR VAT / TDS tax codes** — standard 15% VAT + supplementary-duty
346
- brackets + withholding rates per §52/§53 tables.
347
- - **Mushak 9.1 monthly return** scaffolding.
348
- - **Default journal templates** — sales, purchase, VDS, TDS, cash, bank.
349
-
350
- ### Peer
351
-
352
- - `@classytic/ledger >= 0.7.0` — ledger 0.7 introduced the
353
- `journalTemplates` contract this pack relies on.
1
+ # Changelog
2
+
3
+ ## 0.7.0 — 2026-07-17
4
+
5
+ ### Added — BD posting-recipe pack (`@classytic/ledger-bd/posting-recipes`)
6
+
7
+ - **29 typed posting recipes** migrating be-prod's 18 hand-written posting
8
+ contracts onto `@classytic/ledger/posting-rules` (design:
9
+ ledger `docs/posting-rules-design.md`): purchases family (purchase,
10
+ goods-receipt, vendor-bill + payment + reversal + supplier-return,
11
+ import-clearance), sales + COD lifecycle (sales transaction with
12
+ source-derived journal type, daily POS summary, refund, COD
13
+ placement/settlement/cancellation, restocking fee), inventory + transfer
14
+ (4-type stock adjustment, COGS + reversal, transfer dispatch/receive +
15
+ hand-written reversals the originals carry distinct labels, so kernel
16
+ `reversalOf` would not be faithful — landed-cost capitalization +
17
+ reversal with regex clearing groups), and misc (gateway settlement,
18
+ customer invoice with VDS receivable + receipt, vendor credit / customer
19
+ debit notes with exported fintech validators, go-live opening balances).
20
+ - **`BdPostingResolvers`** — the injected jurisdiction ports (rate/regime
21
+ input-VAT account, VDS withholding, customs import stack with its
22
+ documented balance invariant). Recipes never import a host.
23
+ - **`BD_REQUIRED_POSTING_SLOTS`** every chart alias any recipe touches,
24
+ for fail-loud registry validation at boot.
25
+ - **Golden-draft suite** (27 tests) — every expectation hand-transcribed
26
+ from the ORIGINAL contract source with file:line citations (never derived
27
+ from running the recipes), pinning real BD GL codes: the migration gate.
28
+ - Fidelity notes preserved in-code: vendor-bill reversal credits INVENTORY
29
+ (not GR/IR); COD cancellation keys on orderId (placement keys on
30
+ transactionId); claimable-VAT computed in amounts so foreign-currency
31
+ proportional splits stay byte-identical.
32
+ - Peer floor: `@classytic/ledger >= 0.17.0` (posting-rules kernel).
33
+
34
+
35
+ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
36
+ adhering to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
37
+
38
+ ## [0.6.0] — 2026-07-11
39
+
40
+ ### Added — PPE / fixed-asset codes for the assets module
41
+
42
+ Named constants in `BD_ACCOUNT_CODES` (`src/accounts/codes.ts`) for the
43
+ PPE ledger accounts used by `@classytic/assets`:
44
+
45
+ - **Asset categories** (with NBR straight-line depreciation rates from
46
+ SRO No.120-Law/Income Tax/2025): `PPE_BUILDING` 1315 (10%),
47
+ `PPE_FACTORY_BUILDING` 1314 (20%), `PPE_MACHINERY` 1322 (20%),
48
+ `PPE_FURNITURE` 1335 (10%), `PPE_VEHICLE` 1337 (20%),
49
+ `PPE_OFFICE_EQUIPMENT` 1333 (20%), `PPE_COMPUTER` 1334 (30%),
50
+ `PPE_MEDICAL_EQUIPMENT` 1347 (20%).
51
+ - **`ACCUMULATED_DEPRECIATION_PPE`** 1359contra-asset for all PPE
52
+ categories.
53
+ - **Depreciation expense codes** `DEPRECIATION_BUILDING` 6601 through
54
+ `DEPRECIATION_MEDICAL_EQUIPMENT` 6608 one per PPE category, so
55
+ the depreciation journal entry can split by asset class.
56
+ - **`LOSS_ON_ASSET_DISPOSAL`** 6810 disposal below book value.
57
+
58
+ These codes are already part of the BFRS chart of accounts shipped in
59
+ earlier versions; this release adds the named `BD_ACCOUNT_CODES` keys so
60
+ the assets engine can resolve them symbolically without hardcoding strings.
61
+
62
+ ## [0.5.0] - 2026-07-06
63
+
64
+ Seven opt-in vertical extensions plus an NBR canonical reporting-code
65
+ layer the "become a standard for BD accountants" pass. Research-grounded
66
+ (4-5 Jul 2026 web research across NBR/BMDC/DGHS/MRA/NGOAB/Bangladesh Bank
67
+ sources), with confidence flags per account — see each vertical's README.
68
+
69
+ ### Added vertical extensions (`src/verticals/`, subpath `./verticals`)
70
+
71
+ New, opt-in, additive-only (core chart files untouched); apply with
72
+ `applyVerticals(BD_ACCOUNT_TYPES, [...names])`:
73
+
74
+ - **`school`** (10 accounts) development/session/hostel/transport fee
75
+ revenue, board-exam pass-through liability, two statutory teacher-fund
76
+ payables (Retirement Benefit Board + Welfare Trust genuinely distinct
77
+ bodies), scholarship-waiver contra-revenue. Deliberately does NOT model
78
+ MPO as a ledger account since the Jan 2025 EFT rollout the government
79
+ salary portion never touches the institution's own bank account.
80
+ - **`agro`** (12 accounts) — crop/jute/aquaculture WIP and inventory stages,
81
+ cold-storage receivable + sourced ~3.82% spoilage allowance, pledged-
82
+ produce financing under the Secured Transactions (Movable Property) Act
83
+ 2023 (NOT "warehouse receipt financing"no such standalone BB scheme
84
+ could be confirmed), direct-cash agro-subsidy income.
85
+ - **`real-estate`** (4 accounts) contract asset/unbilled revenue distinct
86
+ from retention receivable, landowner joint-venture unit-share payable,
87
+ contractor mobilization-advance-received, guarantee margin deposit. Flags
88
+ as explicitly open: no actual BD-listed developer's revenue-recognition
89
+ policy could be located.
90
+ - **`ngo-microfinance`** (13 accounts) — loan portfolio by product,
91
+ interest-in-suspense, PKSF per-tranche borrowing/fees (mirrors PKSF's own
92
+ audited "Schedule of Service Charge Receivables"), member savings
93
+ (compulsory/voluntary), NGOAB-mandated project-restricted bank account
94
+ and fund.
95
+ - **`restaurant`** (6 accounts) — service-charge payable/revenue (no BD
96
+ Labour Act mandate for staff distribution could be verified — modeled as
97
+ a policy choice, not compliance), cross-border franchise royalty payable
98
+ (20% WHT), aggregator-commission contra-revenue (confirmed net-settlement
99
+ via actual foodpanda invoice samples), beverage inventory.
100
+ - **`rmg-enhancement`** (5 accounts) — corrects two misconceptions from an
101
+ earlier draft: FDBP is bank bill-discounting/financing, NOT a "~0.6%
102
+ incentive"; UD (Utilization Declaration) is a compliance filing with no
103
+ cash event, NOT a subsidy trigger. Adds the genuine gap — a cash-incentive
104
+ receivable for the real, sourced 180-day+ realization-to-disbursement lag.
105
+ - **`hospital-enhancement`** (3 accounts) consultant/doctor fee payable
106
+ (legitimate collect-and-remit model) and patient admission deposit.
107
+ Deliberately does NOT ship a "diagnostic referral commission" account
108
+ real and material (20-50% of test cost, well-documented) but explicitly
109
+ prohibited under BMDC's Code of Professional Conduct §4.3.1; building
110
+ dedicated tooling for it would mean designing software to facilitate a
111
+ documented ethics violation.
112
+
113
+ ### Added NBR canonical schedule (`src/reporting/nbr-schedule/`, subpath `./reporting/nbr-schedule`)
114
+
115
+ A fixed numeric reporting taxonomy confirmed via research that no such
116
+ crosswalk exists anywhere in Bangladesh's legal lineage (Companies Act 1994
117
+ Schedule XI, like India's Schedule III and the UK's Schedule 4, uses
118
+ positional letter/Roman/Arabic outline labels, never a persistent numeric
119
+ code the same role Canada's GIFI plays there has no BD equivalent to
120
+ adopt). Built against the closest real analog: NBR's IT-11GHA company tax
121
+ return, whose Part IV carries a fixed, currently-filed, numbered Balance
122
+ Sheet/P&L box schema (47-67) hence the name.
123
+
124
+ - `resolveScheduleBox(account)`classifies ANY `AccountType`, core chart
125
+ or vertical extension, onto a box. Covers the entire chart, not just new
126
+ accounts, per explicit design requirement.
127
+ - `buildNbrScheduleReport(trialBalance, accountTypes)` aggregates a trial
128
+ balance into the schedule.
129
+ - `getUnmappedAccounts(accountTypes)` — coverage audit; the test suite
130
+ asserts zero unmapped accounts (excluding tax expense, which is computed
131
+ after Box 60 and has no box among 47-59) across the core chart AND all
132
+ seven verticals combined.
133
+ - Explicitly flagged as this package's own interpretive judgment, not a
134
+ government-published crosswalk — see `src/reporting/nbr-schedule/README.md`
135
+ for what's gazette/circular-verified vs. inferred.
136
+
137
+ ### Fixed mapping refinements found via a full-chart audit
138
+
139
+ The initial mapping passed all narrow spot-check tests, but dumping the
140
+ resolved box for all 757 accounts and reviewing it end-to-end (not just the
141
+ handful of codes the first test pass happened to touch) surfaced 4 real
142
+ misclassifications, now fixed and covered by dedicated regression tests:
143
+
144
+ - Bonds/Debentures/Sukuk (2322/2323) were falling into the generic 65B
145
+ "long-term borrowings" bucket; the schedule has a dedicated 65A "Bonds/
146
+ Debentures" box that nothing was ever routed to.
147
+ - Current Portion of Long-Term Debt (2200) landed in 66D "other" instead of
148
+ 66A "short-term borrowings" it's literally the current-year slice of
149
+ actual borrowings.
150
+ - L/C Margin Liability (2205) was swept into 66C "provisions" alongside
151
+ warranty/returns/legal-claims accruals, but it's a real bank-held deposit,
152
+ not an estimate.
153
+ - A blanket rule routing every account tagged `parentCode: 'Other Expenses'`
154
+ into box 57 (Financial expenses) incorrectly caught 7 non-financial
155
+ one-off losses (loss on sale of assets, penalties, demurrage, theft,
156
+ natural disaster, crop loss — 6810-6817) that share that parentCode with
157
+ genuine interest/FX-cost accounts in the core chart, but belong in 55
158
+ (Other operating expenses). Replaced with pure numeric-range classification
159
+ for the whole Income Statement-Expense category.
160
+
161
+ ### Tests
162
+
163
+ 68 passing (43 existing + 25 new: 6 vertical code-collision/composition
164
+ tests, 19 NBR canonical schedule mapping/coverage/report tests, including
165
+ 4 regression tests for the audit findings above).
166
+
167
+ ## [0.4.0] - 2026-07-02
168
+
169
+ Tax-layer sync with `@classytic/bd-tax` 0.3.0 the code table, the Mushak
170
+ 9.1 template, and the chart now cover the same law the calculator does.
171
+
172
+ ### Added — tax codes
173
+
174
+ - **Trading-stage VAT codes**: `BD-VAT-4.5`, `BD-VAT-2.4`, `BD-VAT-2`,
175
+ `BD-VAT-1.5` (no input credit; report on the new template lines 20–23).
176
+ - **`BD-TOT-FIXED`** the FY2026-27 fixed-amount turnover-tax model
177
+ (rate 0; post the assessed amount). `BD-TOT-4` stays for historical
178
+ postings, renamed "(historical)".
179
+ - **`BD-AT-IMP`** advance VAT at customs (7.5% commercial / 2%
180
+ manufacturer), `recoverable`, reporting on line 24.
181
+ - **VDS codes** (`BD-VDS-15/10/7.5/5/2`) percent of service value per
182
+ the VDS Rules 2025 service table, all reporting on line 25.
183
+ - **New TDS codes**: `BD-TDS-PROF-IND` (15%), `BD-TDS-INT-IND` (10%),
184
+ `BD-TDS-DIV-IND` (10%), `BD-TDS-TECH` (10%), `BD-TDS-TRANSPORT` (2%,
185
+ FY2026-27), `BD-TDS-EXP` (1%, s.123).
186
+
187
+ ### Fixed — TDS code rates (Income Tax Act 2023)
188
+
189
+ The table still carried ITO-1984-era rates that contradicted bd-tax's
190
+ matrix: `BD-TDS-PROF` 10% **7.5%** (entities; s.90), `BD-TDS-RENT`
191
+ 5% **10%** (s.109), `BD-TDS-INT` 10% **20%** (companies; s.102),
192
+ `BD-TDS-DIV` 10% → **20%** (companies; s.117), `BD-TDS-ADV` 4% → **3%**.
193
+ 2135 TDS sub-account rates/descriptions updated to match, plus new
194
+ `2135.TDS.TECH` and `2135.TDS.TRANSPORT` accounts.
195
+
196
+ ### Added receivable-side tax accounts (`TAX_RECEIVABLE_ACCOUNTS`)
197
+
198
+ `1151.AIT.IMPORT`, `1151.AIT.OTHER`, `1152.TDS.SUFFERED`,
199
+ `1153.VDS.SUFFERED`, `1153.AT.IMPORT` the withholding-SUFFERED side.
200
+ Matters from 1 Jul 2026: the Finance Act 2026 withdrew minimum-tax
201
+ treatment, so TDS/AIT suffered is a true adjustable asset, not an expense.
202
+
203
+ ### Changed — Mushak 9.1 template
204
+
205
+ Lines **20–23** (trading-stage outputs, summed into line 9), **24** (AT
206
+ credit on imports) and **25** (VDS increasing adjustment) appended; line
207
+ 17 now computes `12 + 13 + 16 + 25 − 24`. Existing line numbers are
208
+ untouched and the old math is preserved when the new lines are absent.
209
+ Line 6 re-described for the fixed TOT model.
210
+
211
+ ### Gazette verification (3 Jul 2026)
212
+
213
+ `BD-TDS-ADV` corrected 3% → **5%** (ITA 2023 s.92 — media advertising
214
+ bills; media buying agents route via `BD-TDS-COMM`), with the matching
215
+ `2135.TDS.ADV` account update. All other 0.4.0 rates confirmed against
216
+ the verification pass (see `@classytic/bd-tax`
217
+ `research/FY2026-27/06-gazette-verification.md`).
218
+
219
+ ### Build
220
+
221
+ - tsdown → **^0.22.3**, aligned with `@classytic/arc`'s pattern:
222
+ `skipNodeModulesBundle: true` + `neverBundle: [/^@classytic\//]`
223
+ (a bundled second `@classytic/ledger` copy would break
224
+ `defineCountryPack` identity), explicit `target: node22`.
225
+ - Peer unchanged and verified: `@classytic/ledger >= 0.12.0` is the sole
226
+ runtime import (`defineCountryPack`); everything else is type-only.
227
+
228
+ ### Peers / dev stack (pre-publish refresh)
229
+
230
+ - Peer: `@classytic/ledger >= 0.15.0` (was >= 0.12.0) validated against
231
+ the PUBLISHED 0.15.0 (43/43 on a clean registry install). Dev stack
232
+ refreshed to published lines: ledger ^0.15.0, repo-core ^0.7.0,
233
+ primitives ^0.9.1, mongokit ^3.17.0 (resolves 3.18).
234
+
235
+ ### Tests
236
+
237
+ 43 passing (15 existing + 28 new code/template/account pins).
238
+
239
+ ## [0.3.2] - 2026-07-02
240
+
241
+ ### Added
242
+
243
+ Four VAT-collected tax sub-accounts under 2132 matching `@classytic/bd-tax`
244
+ 0.2.0's new Third-Schedule trading-stage rate codes:
245
+
246
+ - `2132.VAT4.5.COLLECTED`real estate >1,600 sqft
247
+ - `2132.VAT2.4.COLLECTED` — medicine trading stage (pharmacies)
248
+ - `2132.VAT2.COLLECTED` — petroleum trading / real estate ≤1,600 sqft
249
+ - `2132.VAT1.5.COLLECTED`wholesale trading stage
250
+
251
+ `2132.TOT4.COLLECTED` description updated for the FY2026-27 fixed-amount
252
+ turnover-tax model (post assessed fixed amounts to the same head).
253
+
254
+ ## [0.2.3]
255
+
256
+ ### Added
257
+
258
+ **Expanded `BD_ACCOUNT_CODES`** to expose 25 more codes that were
259
+ already seeded in `BD_ACCOUNT_TYPES` (since 0.1.0–0.2.2) but missing
260
+ from the typed map. Hosts that previously hand-coded these as string
261
+ literals in posting contracts can now reference them through the
262
+ canonical export. The chart itself is unchanged only the typed
263
+ exports grew.
264
+
265
+ #### Cash & Receivables
266
+ - **`BANK_CHARGES: '6328'`** — gateway processing fees, mobile-money
267
+ merchant deductions, ad-hoc bank charges.
268
+ - **`CHARGEBACK_RECEIVABLE: '1159'`** — card-network dispute holding.
269
+
270
+ #### Liabilities
271
+ - **`COMMISSION_PAYABLE: '2122'`** accrued sales/agent commission.
272
+ - **`REVERSE_LOGISTICS_PAYABLE: '2162'`** return-handling accrual.
273
+ - **`CUSTOMER_ADVANCE: '2191'`** IFRS 15 contract liability.
274
+
275
+ #### Revenue / Other Income
276
+ - **`TRANSPORT_REVENUE: '4147'`** — line-item delivery charge billed to customer.
277
+ - **`COURIER_REVENUE: '4159'`** — in-house courier service revenue.
278
+ - **`BAD_DEBT_RECOVERY: '4310'`** — recovery of previously written-off debt.
279
+
280
+ #### COGS / Landed Cost
281
+ - **`IMPORT_LANDED_COST: '5116'`** capitalized duty + freight + insurance.
282
+ - **`CARRIAGE_INWARD: '5117'`** domestic inbound freight (capitalized).
283
+ - **`PACKAGING_PRODUCTION: '5317'`** production-time primary packaging.
284
+ - **`CUSTOMS_DUTY: '5505'`** — NBR import duty (when not capitalized).
285
+ - **`CF_AGENT_COMMISSION: '5507'`** clearing/forwarding agent fee.
286
+
287
+ #### Operating Expenses
288
+ - **`POSTAGE_ADMIN: '6302'`** admin postage (NOT customer delivery).
289
+ - **`SALES_COMMISSION: '6403'`**internal commercial team commission.
290
+ - **`FREIGHT_OUTWARD: '6405'`** outbound delivery cost (domestic).
291
+ - **`SHIPPING_LOGISTICS_EXPORT: '6406'`** — DHL / FedEx weight-priced export.
292
+ - **`PACKAGING_DISPATCH: '6407'`** outbound packaging consumables.
293
+ - **`MARKETPLACE_COMMISSION: '6422'`** Daraz / Chaldal / Pickaboo cut.
294
+ - **`COURIER_COD_COMMISSION: '6423'`** Pathao / RedX / Steadfast COD cut.
295
+ - **`LOGISTICS_HUB_RENT: '6426'`** — sortation-hub / depot rent.
296
+ - **`COURIER_DRIVER_BONUS: '6428'`** variable courier performance pay.
297
+ - **`BAD_DEBT_WRITTEN_OFF: '6702'`** unrecoverable A/R / shortfall.
298
+ - **`MARKETPLACE_ADS: '6823'`** platform-specific ad-engine fees.
299
+ - **`MARKETPLACE_COMPLIANCE_FEE: '6824'`** recurring seller-platform fees.
300
+
301
+ Together these cover the typical 3PL / DHL-style export / marketplace-
302
+ aggregator accounting flows. The full chart still has ~120 more accounts
303
+ (industry-specific: RMG, pharma, agro-processing, telecom, etc.) — reach
304
+ for those via `BD_ACCOUNT_TYPES` directly when an industry-specific
305
+ posting needs them; bring them into `BD_ACCOUNT_CODES` when a host-
306
+ agnostic posting contract starts referencing them.
307
+
308
+ ## [0.2.2]
309
+
310
+ ### Added
311
+
312
+ **`BD_ACCOUNT_CODES` map** canonical export of domain-meaningful keys
313
+ to 4-digit chart codes (e.g. `BD_ACCOUNT_CODES.AR === '1141'`). Hosts
314
+ build their posting contracts against this map instead of hand-coding
315
+ chart-code literals. The map covers the codes most posting layers
316
+ reference (cash/AR/AP/inventory/COGS/revenue/tax/clearings) and is
317
+ typed with `BDAccountCode` and `BDAccountKey` helpers.
318
+
319
+ Hosts that need different default mappings (e.g. a manufacturer
320
+ defaulting `MERCHANDISE → FINISHED_GOODS`) layer their own thin alias
321
+ module on top — the chart is the same; the host's "default inventory
322
+ account" is policy. See `BDAccountCode` for the typed key list.
323
+
324
+ **Two clearing-account codes** in the liability section (2125 / 2126),
325
+ matching SAP / Oracle / ERPNext placement (clearings have credit-natural
326
+ balances, so they belong in 2xxx, not 1xxx):
327
+
328
+ - **`2125` — Goods Received / Invoice Received (GR/IR)** — accrued
329
+ liability for physical goods receipt pending vendor invoice. Decouples
330
+ physical receipt from financial posting:
331
+ - Receipt: `Dr Inventory / Cr 2125`
332
+ - Vendor bill: `Dr 2125 / Cr AP`
333
+ - Period-end balance = receipts pending invoice (accrual reportable
334
+ on the balance sheet). Cleared on 3-way match (PO ↔ receipt ↔
335
+ invoice).
336
+
337
+ - **`2126` — Transfer Cost Clearing (Inter-Branch)** — accrued liability
338
+ for inter-branch transit costs capitalized into receiver inventory per
339
+ IAS 2:
340
+ - Receive leg: `Dr 1164 (goods + transit) / Cr 1179 (goods) / Cr 2126 (transit)`
341
+ - Host clears against actual freight invoice: `Dr 2126 / Cr AP`
342
+
343
+ Both codes slot into the previously-empty 2125–2126 gap in the chart
344
+ (between 2124 Freight & Shipping Payable and 2131 Income Tax Payable),
345
+ so no existing seeded codes shift.
346
+
347
+ ### Migration
348
+
349
+ Pure additive change. Run `seedAccounts()` once after upgrade to pick up
350
+ the two new codes — `accountRepository.seedAccounts()` is idempotent and
351
+ will not modify pre-existing accounts.
352
+
353
+ ## [0.2.1]
354
+
355
+ ### Added
356
+
357
+ - Chart of accounts: new expense code **`6423 — Courier COD Commission`**
358
+ under `SELLING_DISTRIBUTION`. Captures commission deductions from
359
+ cash-on-delivery collections by BD courier partners (Pathao, RedX,
360
+ Steadfast, Sundarban).
361
+
362
+ ### Fixed
363
+
364
+ - Packaging hygiene — added `README.md` and `CHANGELOG.md` to the `files`
365
+ array, added `repository` / `bugs` / `homepage` / `publishConfig.access`
366
+ to `package.json`, expanded `.gitignore` to cover `.env`, `.env.*`,
367
+ `/.claude`, `.mcp.json`, and the other standard safety patterns.
368
+
369
+ ## [0.2.0]
370
+
371
+ Initial public release. Bangladesh country pack for `@classytic/ledger`.
372
+
373
+ ### Ships
374
+
375
+ - **BFRS chart of accounts** — full post-0.8 tree (assets 1xxx, liabilities
376
+ 2xxx, equity 3xxx, revenue 4xxx, cost-of-sales 5xxx, expenses 6xxx).
377
+ - **NBR VAT / TDS tax codes** — standard 15% VAT + supplementary-duty
378
+ brackets + withholding rates per §52/§53 tables.
379
+ - **Mushak 9.1 monthly return** scaffolding.
380
+ - **Default journal templates** — sales, purchase, VDS, TDS, cash, bank.
381
+
382
+ ### Peer
383
+
384
+ - `@classytic/ledger >= 0.7.0` — ledger 0.7 introduced the
385
+ `journalTemplates` contract this pack relies on.