@diy-accounting-uk/diya-gl 1.2.60 → 1.2.61

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.
@@ -1793,6 +1793,32 @@
1793
1793
  "scorecard": "101608 passed, 0 warnings, 0 failed"
1794
1794
  }
1795
1795
  }
1796
+ },
1797
+ {
1798
+ "tag": "diya-gl-v1.2.60",
1799
+ "date": "2026-10-27",
1800
+ "formatVersion": "diya-gl/1",
1801
+ "engineVersion": "1.2.60+602620de",
1802
+ "taxDataHash": "51bdff60e993",
1803
+ "reconciledCommit": "54e8731a91279975e61b1a232fbb67fda89515f0",
1804
+ "templates": {
1805
+ "bst": {
1806
+ "hash": "0d003e10e00c",
1807
+ "scorecard": "812 passed, 0 warnings, 0 failed"
1808
+ },
1809
+ "taxi": {
1810
+ "hash": "1ff69654d64d",
1811
+ "scorecard": "700 passed, 0 warnings, 0 failed"
1812
+ },
1813
+ "se": {
1814
+ "hash": "064605ae76ed",
1815
+ "scorecard": "8015 passed, 0 warnings, 0 failed"
1816
+ },
1817
+ "ltd": {
1818
+ "hash": "a65ab09cf35c",
1819
+ "scorecard": "101608 passed, 0 warnings, 0 failed"
1820
+ }
1821
+ }
1796
1822
  }
1797
1823
  ]
1798
1824
  }
@@ -19,6 +19,7 @@ import { readIxbrl, IxbrlError } from "./ixbrl-reader.js";
19
19
  export { IxbrlError };
20
20
 
21
21
  const MATURITY = "MaturitiesOrExpirationPeriodsDimension";
22
+ const CURRENT_INSTRUMENT = "FinancialInstrumentCurrentNon-currentDimension";
22
23
  const EQUITY_CLASS = "EquityClassesDimension";
23
24
  const PPE_CLASS = "PropertyPlantEquipmentClassesDimension";
24
25
 
@@ -91,7 +92,31 @@ export const MAPPING_TABLE = [
91
92
  note: "WithinOneYear; posts as a trade creditor, which the balance sheet shows within one year",
92
93
  },
93
94
  { concept: "AccruedLiabilitiesNotExpressedWithinCreditorsSubtotal", figure: "otherCreditors", account: "2100", note: "WithinOneYear" },
94
- { concept: "TaxationSocialSecurityPayable", figure: "otherCreditors", account: "2100", note: "WithinOneYear" },
95
+ { concept: "TaxationSocialSecurityPayable", figure: "taxationSocialSecurity", account: "2100", note: "WithinOneYear" },
96
+ {
97
+ concept: "AccruedLiabilities",
98
+ dimension: CURRENT_INSTRUMENT,
99
+ member: "CurrentFinancialInstruments",
100
+ figure: "accruals",
101
+ account: "2100",
102
+ note: "on a context that also carries WithinOneYear",
103
+ },
104
+ {
105
+ concept: "BankBorrowingsOverdrafts",
106
+ dimension: MATURITY,
107
+ member: "WithinOneYear",
108
+ figure: "bankLoansOverdrafts",
109
+ account: "2100",
110
+ note: "with or without the WithinOneYear member",
111
+ },
112
+ {
113
+ concept: "BankBorrowingsOverdrafts",
114
+ dimension: MATURITY,
115
+ member: "AfterOneYear",
116
+ figure: "bankLoansAfterOneYear",
117
+ account: "2600",
118
+ note: "a part of creditorsAfterOneYear, which states it",
119
+ },
95
120
  {
96
121
  concept: "Creditors",
97
122
  dimension: MATURITY,
@@ -321,7 +346,8 @@ function balanceSheetAt(set, endDay, notes, label) {
321
346
  set.instant("CalledUpShareCapitalNotPaidNotExpressedAsCurrentAsset", endDay),
322
347
  ]);
323
348
  const provisions = set.instant("ProvisionsForLiabilitiesBalanceSheetSubtotal", endDay);
324
- const afterOneYear = set.instant("Creditors", endDay, { [MATURITY]: "AfterOneYear" });
349
+ const bankLoansAfterOneYear = set.instant("BankBorrowingsOverdrafts", endDay, { [MATURITY]: "AfterOneYear" });
350
+ const afterOneYear = set.instant("Creditors", endDay, { [MATURITY]: "AfterOneYear" }) ?? bankLoansAfterOneYear;
325
351
  if (provisions) notes.push(`${label}: provisions for liabilities of ${provisions} are added to creditors after more than one year.`);
326
352
 
327
353
  const equityClasses = set.find("Equity", null, (fact) => fact.period.instant === endDay && Object.keys(fact.dimensions).length === 1);
@@ -354,8 +380,14 @@ function balanceSheetAt(set, endDay, notes, label) {
354
380
  otherCreditors: sumDefined([
355
381
  set.maturity("OtherCreditors", endDay, ["WithinOneYear", null]),
356
382
  set.maturity("AccruedLiabilitiesNotExpressedWithinCreditorsSubtotal", endDay, ["WithinOneYear", null]),
357
- set.maturity("TaxationSocialSecurityPayable", endDay, ["WithinOneYear", null]),
358
383
  ]),
384
+ taxationSocialSecurity: set.maturity("TaxationSocialSecurityPayable", endDay, ["WithinOneYear", null]),
385
+ accruals: set.instant("AccruedLiabilities", endDay, {
386
+ [CURRENT_INSTRUMENT]: "CurrentFinancialInstruments",
387
+ [MATURITY]: "WithinOneYear",
388
+ }),
389
+ bankLoansOverdrafts: set.maturity("BankBorrowingsOverdrafts", endDay, ["WithinOneYear", null]),
390
+ bankLoansAfterOneYear,
359
391
  creditorsWithinOneYear: set.instant("Creditors", endDay, { [MATURITY]: "WithinOneYear" }),
360
392
  creditorsAfterOneYear: sumDefined([afterOneYear, provisions]),
361
393
  provisions,
@@ -544,10 +576,13 @@ function problem(message) {
544
576
  return new IxbrlError(message);
545
577
  }
546
578
 
579
+ // The lines that add up to the creditors falling due within one year.
580
+ const WITHIN_LINES = ["bankLoansOverdrafts", "tradeCreditors", "corporationTax", "taxationSocialSecurity", "otherCreditors", "accruals"];
581
+
547
582
  function checkBalance(year, label) {
548
583
  const s = year;
549
584
  const current = s.currentAssets ?? sumOf([s.stocks, s.debtors, s.cashAtBank].map((v) => v ?? 0));
550
- const within = s.creditorsWithinOneYear ?? sumOf([s.tradeCreditors, s.corporationTax, s.otherCreditors].map((v) => v ?? 0));
585
+ const within = s.creditorsWithinOneYear ?? sumOf(WITHIN_LINES.map((line) => s[line] ?? 0));
551
586
  const net = (s.fixedAssets ?? 0) + current - within - (s.creditorsAfterOneYear ?? 0);
552
587
  const equity = s.capitalAndReserves ?? s.netAssets;
553
588
  if (s.netCurrentAssets !== undefined && !close(current - within, s.netCurrentAssets)) {
@@ -587,7 +622,7 @@ function checkTotals(year, label, regime) {
587
622
  if (over || under)
588
623
  throw problem(`The ${label} current assets of ${s.currentAssets} differ from the lines under it, which add up to ${lines}.`);
589
624
  }
590
- const creditors = sumDefined([s.tradeCreditors, s.corporationTax, s.otherCreditors]);
625
+ const creditors = sumDefined(WITHIN_LINES.map((line) => s[line]));
591
626
  if (s.creditorsWithinOneYear !== undefined && creditors !== undefined) {
592
627
  const over = creditors - s.creditorsWithinOneYear > WITHIN;
593
628
  const under = s.creditorsWithinOneYear - creditors > WITHIN && regime === "small";
@@ -70,7 +70,13 @@ function sheetOf(balanceSheet) {
70
70
  const stocks = n(balanceSheet.stocks);
71
71
  const debtors = n(balanceSheet.debtors);
72
72
  const currentAssets = balanceSheet.currentAssets ?? stocks + debtors + n(balanceSheet.cashAtBank);
73
- const lineCreditors = n(balanceSheet.tradeCreditors) + n(balanceSheet.corporationTax) + n(balanceSheet.otherCreditors);
73
+ const lineCreditors =
74
+ n(balanceSheet.bankLoansOverdrafts) +
75
+ n(balanceSheet.tradeCreditors) +
76
+ n(balanceSheet.corporationTax) +
77
+ n(balanceSheet.taxationSocialSecurity) +
78
+ n(balanceSheet.otherCreditors) +
79
+ n(balanceSheet.accruals);
74
80
  const within = balanceSheet.creditorsWithinOneYear ?? lineCreditors;
75
81
  const corporationTax = n(balanceSheet.corporationTax);
76
82
  const calledUp = n(balanceSheet.calledUpShareCapital);
@@ -12,7 +12,7 @@
12
12
 
13
13
  export const PROVENANCE_DATA = {
14
14
  formatVersion: "diya-gl/1",
15
- engineVersion: "1.2.60+602620de",
15
+ engineVersion: "1.2.61+f657819b",
16
16
  taxDataHash: "51bdff60e993",
17
17
  reconciledCommit: "54e8731a91279975e61b1a232fbb67fda89515f0",
18
18
  templates: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diy-accounting-uk/diya-gl",
3
- "version": "1.2.60",
3
+ "version": "1.2.61",
4
4
  "type": "module",
5
5
  "description": "Recalculate, read and write DIYA-GL books from the command line",
6
6
  "license": "Apache-2.0",