@diy-accounting-uk/diya-gl 1.2.33 → 1.2.34

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.
@@ -1091,6 +1091,32 @@
1091
1091
  "scorecard": "101605 passed, 0 warnings, 0 failed"
1092
1092
  }
1093
1093
  }
1094
+ },
1095
+ {
1096
+ "tag": "diya-gl-v1.2.33",
1097
+ "date": "2026-09-24",
1098
+ "formatVersion": "diya-gl/1",
1099
+ "engineVersion": "1.2.33+92a3639b",
1100
+ "taxDataHash": "3221a7c2f39c",
1101
+ "reconciledCommit": "54e8731a91279975e61b1a232fbb67fda89515f0",
1102
+ "templates": {
1103
+ "bst": {
1104
+ "hash": "0d003e10e00c",
1105
+ "scorecard": "812 passed, 0 warnings, 0 failed"
1106
+ },
1107
+ "taxi": {
1108
+ "hash": "1ff69654d64d",
1109
+ "scorecard": "686 passed, 0 warnings, 0 failed"
1110
+ },
1111
+ "se": {
1112
+ "hash": "064605ae76ed",
1113
+ "scorecard": "7982 passed, 0 warnings, 0 failed"
1114
+ },
1115
+ "ltd": {
1116
+ "hash": "caa14632083b",
1117
+ "scorecard": "101605 passed, 0 warnings, 0 failed"
1118
+ }
1119
+ }
1094
1120
  }
1095
1121
  ]
1096
1122
  }
@@ -35,6 +35,10 @@ import {
35
35
  payeTaxMonthDates,
36
36
  PAYROLL_WEEKS_PER_MONTH,
37
37
  PAYSLIP_PRINT_CELLS,
38
+ PAYSLIP_PRINT_DEFAULT_BLOCK_ROW,
39
+ PAYSLIP_PRINT_DEFAULT_HEADING,
40
+ PAYSLIP_PRINT_DEFAULT_PERIOD,
41
+ PAYSLIP_PRINT_DEFAULT_TAB,
38
42
  PAYSLIP_PRINT_FIRST_PAYROLL_NUMBER,
39
43
  PAYSLIP_PRINT_MONTHLY_HEADING,
40
44
  PAYSLIP_PRINT_PERIOD_CELLS,
@@ -798,7 +802,18 @@ function computeLtd(book, lines, taxData, scenario) {
798
802
  T2: directorPayroll[tab].employerNI,
799
803
  });
800
804
  }
801
- results[`Payslips.xlsx!${PAYSLIP_PRINT_SHEET}`] = buildPayslipsPrintPage(PAYSLIP_PRINT_PERIOD, tabs, payrollEntries);
805
+ // The writer only points F3 and F4 at a real month when the book has
806
+ // payroll to print (app/products/ltd.js's cellWrites), so a book with none
807
+ // leaves the sheet's own shipped default in place rather than the period
808
+ // this function otherwise asks for.
809
+ results[`Payslips.xlsx!${PAYSLIP_PRINT_SHEET}`] = scenario.payroll
810
+ ? buildPayslipsPrintPage(PAYSLIP_PRINT_PERIOD, tabs, payrollEntries)
811
+ : {
812
+ [PAYSLIP_PRINT_CELLS.tab]: PAYSLIP_PRINT_DEFAULT_TAB,
813
+ [PAYSLIP_PRINT_CELLS.blockRow]: PAYSLIP_PRINT_DEFAULT_BLOCK_ROW,
814
+ [PAYSLIP_PRINT_CELLS.heading]: PAYSLIP_PRINT_DEFAULT_HEADING,
815
+ [PAYSLIP_PRINT_CELLS.periodNumber]: PAYSLIP_PRINT_DEFAULT_PERIOD,
816
+ };
802
817
 
803
818
  const companySecretary = buildCompanySecretary(scenario);
804
819
  Object.assign(results, companySecretary);
@@ -233,3 +233,13 @@ export const PAYSLIP_PRINT_TO_DATE_CELLS = { G16: "grossPay", H16: "incomeTax",
233
233
  // for a period other than the sheet's own default of 1 -- a join stuck on the
234
234
  // default prints the wrong period with every other check still green.
235
235
  export const PAYSLIP_PRINT_PERIOD = 2;
236
+
237
+ // The sheet's own shipped default, before any writer's join ever points F3
238
+ // and F4 at a real month: weekly payslips, period 1. app/products/ltd.js's
239
+ // cellWrites only writes F3 and F4 when the book has payroll to point them
240
+ // at, so a book with none leaves the sheet exactly there, and H3, H4 and L7
241
+ // stay what that default resolves to -- verified against the template.
242
+ export const PAYSLIP_PRINT_DEFAULT_TAB = "Apr";
243
+ export const PAYSLIP_PRINT_DEFAULT_BLOCK_ROW = 8;
244
+ export const PAYSLIP_PRINT_DEFAULT_HEADING = "WEEKLY PAYROLL";
245
+ export const PAYSLIP_PRINT_DEFAULT_PERIOD = 1;
@@ -142,8 +142,19 @@ export async function loadTaxDataForBook(book, options = {}) {
142
142
  * templates to read, which year's data to apply, what the package is called,
143
143
  * and which cells to write. Reading it all up front is what stops a book with
144
144
  * a missing field producing a half-written package.
145
+ *
146
+ * Exported so a reconciler can derive the same cell writes, scenario and tax
147
+ * data a package was written with, from the book alone, without a second
148
+ * mapping from book to cells living beside this one.
149
+ *
150
+ * @param {Object} book - parsed book.toml
151
+ * @param {Array} lines - parsed lines.jsonl entries
152
+ * @param {Object} [options]
153
+ * @param {Object} [options.resources] - resource loader; defaults to reading app/
154
+ * @param {string} [options.taxYearName] - override the tax year the book's dates imply
155
+ * @param {Object} [options.taxData] - already-parsed tax data, skipping the load
145
156
  */
146
- async function resolveInputs(book, lines, options) {
157
+ export async function resolveInputs(book, lines, options = {}) {
147
158
  const resources = options.resources || nodeResourceLoader();
148
159
 
149
160
  const product = productOf(book);
@@ -12,7 +12,7 @@
12
12
 
13
13
  export const PROVENANCE_DATA = {
14
14
  formatVersion: "diya-gl/1",
15
- engineVersion: "1.2.33+92a3639b",
15
+ engineVersion: "1.2.34+1c127a54",
16
16
  taxDataHash: "3221a7c2f39c",
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.33",
3
+ "version": "1.2.34",
4
4
  "type": "module",
5
5
  "description": "Recalculate, read and write DIYA-GL books from the command line",
6
6
  "license": "Apache-2.0",