noxctl 0.1.0 → 0.3.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.
Files changed (155) hide show
  1. package/README.md +279 -29
  2. package/dist/auth.d.ts +15 -7
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +128 -22
  5. package/dist/auth.js.map +1 -1
  6. package/dist/cli.d.ts +2 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1640 -70
  9. package/dist/cli.js.map +1 -1
  10. package/dist/completions.d.ts +13 -0
  11. package/dist/completions.d.ts.map +1 -0
  12. package/dist/completions.js +150 -0
  13. package/dist/completions.js.map +1 -0
  14. package/dist/config-paths.d.ts +2 -0
  15. package/dist/config-paths.d.ts.map +1 -0
  16. package/dist/config-paths.js +7 -0
  17. package/dist/config-paths.js.map +1 -0
  18. package/dist/credentials-store.d.ts +13 -3
  19. package/dist/credentials-store.d.ts.map +1 -1
  20. package/dist/credentials-store.js +197 -62
  21. package/dist/credentials-store.js.map +1 -1
  22. package/dist/date-periods.d.ts +14 -0
  23. package/dist/date-periods.d.ts.map +1 -0
  24. package/dist/date-periods.js +103 -0
  25. package/dist/date-periods.js.map +1 -0
  26. package/dist/formatter.d.ts +11 -2
  27. package/dist/formatter.d.ts.map +1 -1
  28. package/dist/formatter.js +27 -4
  29. package/dist/formatter.js.map +1 -1
  30. package/dist/fortnox-client.d.ts +1 -0
  31. package/dist/fortnox-client.d.ts.map +1 -1
  32. package/dist/fortnox-client.js +28 -5
  33. package/dist/fortnox-client.js.map +1 -1
  34. package/dist/index.d.ts +15 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +92 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/keychain-target.d.ts +32 -0
  39. package/dist/keychain-target.d.ts.map +1 -0
  40. package/dist/keychain-target.js +349 -0
  41. package/dist/keychain-target.js.map +1 -0
  42. package/dist/operations/analytics.d.ts +84 -0
  43. package/dist/operations/analytics.d.ts.map +1 -0
  44. package/dist/operations/analytics.js +154 -0
  45. package/dist/operations/analytics.js.map +1 -0
  46. package/dist/operations/contracts.d.ts +23 -0
  47. package/dist/operations/contracts.d.ts.map +1 -0
  48. package/dist/operations/contracts.js +52 -0
  49. package/dist/operations/contracts.js.map +1 -0
  50. package/dist/operations/costcenters.d.ts +20 -0
  51. package/dist/operations/costcenters.d.ts.map +1 -0
  52. package/dist/operations/costcenters.js +38 -0
  53. package/dist/operations/costcenters.js.map +1 -0
  54. package/dist/operations/customers.d.ts.map +1 -1
  55. package/dist/operations/customers.js +12 -2
  56. package/dist/operations/customers.js.map +1 -1
  57. package/dist/operations/financial-years.d.ts +16 -0
  58. package/dist/operations/financial-years.d.ts.map +1 -0
  59. package/dist/operations/financial-years.js +32 -0
  60. package/dist/operations/financial-years.js.map +1 -0
  61. package/dist/operations/invoice-payments.d.ts +21 -0
  62. package/dist/operations/invoice-payments.d.ts.map +1 -0
  63. package/dist/operations/invoice-payments.js +40 -0
  64. package/dist/operations/invoice-payments.js.map +1 -0
  65. package/dist/operations/offers.d.ts +25 -0
  66. package/dist/operations/offers.d.ts.map +1 -0
  67. package/dist/operations/offers.js +48 -0
  68. package/dist/operations/offers.js.map +1 -0
  69. package/dist/operations/orders.d.ts +24 -0
  70. package/dist/operations/orders.d.ts.map +1 -0
  71. package/dist/operations/orders.js +44 -0
  72. package/dist/operations/orders.js.map +1 -0
  73. package/dist/operations/pricelists.d.ts +36 -0
  74. package/dist/operations/pricelists.d.ts.map +1 -0
  75. package/dist/operations/pricelists.js +52 -0
  76. package/dist/operations/pricelists.js.map +1 -0
  77. package/dist/operations/projects.d.ts +19 -0
  78. package/dist/operations/projects.d.ts.map +1 -0
  79. package/dist/operations/projects.js +33 -0
  80. package/dist/operations/projects.js.map +1 -0
  81. package/dist/operations/supplier-invoice-payments.d.ts +20 -0
  82. package/dist/operations/supplier-invoice-payments.d.ts.map +1 -0
  83. package/dist/operations/supplier-invoice-payments.js +34 -0
  84. package/dist/operations/supplier-invoice-payments.js.map +1 -0
  85. package/dist/operations/taxreductions.d.ts +19 -0
  86. package/dist/operations/taxreductions.d.ts.map +1 -0
  87. package/dist/operations/taxreductions.js +28 -0
  88. package/dist/operations/taxreductions.js.map +1 -0
  89. package/dist/operations/vouchers.d.ts +15 -0
  90. package/dist/operations/vouchers.d.ts.map +1 -1
  91. package/dist/operations/vouchers.js +97 -0
  92. package/dist/operations/vouchers.js.map +1 -1
  93. package/dist/profile-name.d.ts +9 -0
  94. package/dist/profile-name.d.ts.map +1 -0
  95. package/dist/profile-name.js +58 -0
  96. package/dist/profile-name.js.map +1 -0
  97. package/dist/profiles.d.ts +55 -0
  98. package/dist/profiles.d.ts.map +1 -0
  99. package/dist/profiles.js +210 -0
  100. package/dist/profiles.js.map +1 -0
  101. package/dist/tools/analytics.d.ts +3 -0
  102. package/dist/tools/analytics.d.ts.map +1 -0
  103. package/dist/tools/analytics.js +52 -0
  104. package/dist/tools/analytics.js.map +1 -0
  105. package/dist/tools/bookkeeping.d.ts.map +1 -1
  106. package/dist/tools/bookkeeping.js +38 -2
  107. package/dist/tools/bookkeeping.js.map +1 -1
  108. package/dist/tools/contracts.d.ts +3 -0
  109. package/dist/tools/contracts.d.ts.map +1 -0
  110. package/dist/tools/contracts.js +136 -0
  111. package/dist/tools/contracts.js.map +1 -0
  112. package/dist/tools/costcenters.d.ts +3 -0
  113. package/dist/tools/costcenters.d.ts.map +1 -0
  114. package/dist/tools/costcenters.js +79 -0
  115. package/dist/tools/costcenters.js.map +1 -0
  116. package/dist/tools/financial-years.d.ts +3 -0
  117. package/dist/tools/financial-years.d.ts.map +1 -0
  118. package/dist/tools/financial-years.js +33 -0
  119. package/dist/tools/financial-years.js.map +1 -0
  120. package/dist/tools/invoice-payments.d.ts +3 -0
  121. package/dist/tools/invoice-payments.d.ts.map +1 -0
  122. package/dist/tools/invoice-payments.js +60 -0
  123. package/dist/tools/invoice-payments.js.map +1 -0
  124. package/dist/tools/offers.d.ts +3 -0
  125. package/dist/tools/offers.d.ts.map +1 -0
  126. package/dist/tools/offers.js +130 -0
  127. package/dist/tools/offers.js.map +1 -0
  128. package/dist/tools/orders.d.ts +3 -0
  129. package/dist/tools/orders.d.ts.map +1 -0
  130. package/dist/tools/orders.js +114 -0
  131. package/dist/tools/orders.js.map +1 -0
  132. package/dist/tools/pricelists.d.ts +3 -0
  133. package/dist/tools/pricelists.d.ts.map +1 -0
  134. package/dist/tools/pricelists.js +104 -0
  135. package/dist/tools/pricelists.js.map +1 -0
  136. package/dist/tools/projects.d.ts +3 -0
  137. package/dist/tools/projects.d.ts.map +1 -0
  138. package/dist/tools/projects.js +80 -0
  139. package/dist/tools/projects.js.map +1 -0
  140. package/dist/tools/status.d.ts.map +1 -1
  141. package/dist/tools/status.js +6 -1
  142. package/dist/tools/status.js.map +1 -1
  143. package/dist/tools/supplier-invoice-payments.d.ts +3 -0
  144. package/dist/tools/supplier-invoice-payments.d.ts.map +1 -0
  145. package/dist/tools/supplier-invoice-payments.js +60 -0
  146. package/dist/tools/supplier-invoice-payments.js.map +1 -0
  147. package/dist/tools/taxreductions.d.ts +3 -0
  148. package/dist/tools/taxreductions.d.ts.map +1 -0
  149. package/dist/tools/taxreductions.js +51 -0
  150. package/dist/tools/taxreductions.js.map +1 -0
  151. package/dist/views.d.ts +28 -0
  152. package/dist/views.d.ts.map +1 -1
  153. package/dist/views.js +234 -0
  154. package/dist/views.js.map +1 -1
  155. package/package.json +1 -1
@@ -0,0 +1,80 @@
1
+ import { z } from 'zod';
2
+ import { listProjects, getProject, createProject, updateProject } from '../operations/projects.js';
3
+ import { projectListColumns, projectDetailColumns } from '../views.js';
4
+ import { detailResponse, dryRunResponse, listResponse, requireConfirmation, } from '../tool-output.js';
5
+ export function registerProjectTools(server) {
6
+ server.tool('fortnox_list_projects', 'Lista projekt i Fortnox. Returnerar: ProjectNumber, Description, Status, StartDate, EndDate.', {
7
+ page: z.number().optional().describe('Sidnummer (default 1)'),
8
+ limit: z.number().optional().describe('Antal per sida (default 100, max 500)'),
9
+ all: z.boolean().optional().describe('Hämta alla sidor (ignorerar page/limit)'),
10
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
11
+ }, async ({ page, limit, all, includeRaw }) => {
12
+ const data = await listProjects({ page, limit, all });
13
+ return listResponse(data.Projects ?? [], projectListColumns, data, data.MetaInformation, includeRaw);
14
+ });
15
+ server.tool('fortnox_get_project', 'Hämta ett enskilt projekt från Fortnox. Returnerar: ProjectNumber, Description, Status, StartDate, EndDate, ContactPerson, Comments.', {
16
+ projectNumber: z.string().describe('Projektnummer'),
17
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
18
+ }, async ({ projectNumber, includeRaw }) => {
19
+ const data = await getProject(projectNumber);
20
+ return detailResponse(data, projectDetailColumns, data, includeRaw);
21
+ });
22
+ server.tool('fortnox_create_project', 'Skapa ett nytt projekt i Fortnox', {
23
+ Description: z.string().describe('Projektbeskrivning'),
24
+ ProjectNumber: z
25
+ .string()
26
+ .optional()
27
+ .describe('Projektnummer (genereras automatiskt om det utelämnas)'),
28
+ Status: z
29
+ .enum(['ONGOING', 'COMPLETED'])
30
+ .optional()
31
+ .describe('Status (ONGOING eller COMPLETED)'),
32
+ StartDate: z.string().optional().describe('Startdatum (YYYY-MM-DD)'),
33
+ EndDate: z.string().optional().describe('Slutdatum (YYYY-MM-DD)'),
34
+ ContactPerson: z.string().optional().describe('Kontaktperson'),
35
+ ProjectLeader: z.string().optional().describe('Projektledare'),
36
+ Comments: z.string().optional().describe('Kommentarer'),
37
+ confirm: z.boolean().optional().describe('Bekräfta att projektet ska skapas'),
38
+ dryRun: z
39
+ .boolean()
40
+ .optional()
41
+ .describe('Visa vad som skulle skickas utan att skapa projektet'),
42
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
43
+ }, async ({ confirm, dryRun, includeRaw, ...params }) => {
44
+ if (dryRun) {
45
+ return dryRunResponse(`create project "${params.Description}"`, { Project: params });
46
+ }
47
+ if (!confirm)
48
+ requireConfirmation(`create project "${params.Description}"`);
49
+ const data = await createProject(params);
50
+ return detailResponse(data, projectDetailColumns, data, includeRaw);
51
+ });
52
+ server.tool('fortnox_update_project', 'Uppdatera ett befintligt projekt i Fortnox', {
53
+ projectNumber: z.string().describe('Projektnummer att uppdatera'),
54
+ Description: z.string().optional().describe('Projektbeskrivning'),
55
+ Status: z
56
+ .enum(['ONGOING', 'COMPLETED'])
57
+ .optional()
58
+ .describe('Status (ONGOING eller COMPLETED)'),
59
+ StartDate: z.string().optional().describe('Startdatum (YYYY-MM-DD)'),
60
+ EndDate: z.string().optional().describe('Slutdatum (YYYY-MM-DD)'),
61
+ ContactPerson: z.string().optional().describe('Kontaktperson'),
62
+ ProjectLeader: z.string().optional().describe('Projektledare'),
63
+ Comments: z.string().optional().describe('Kommentarer'),
64
+ confirm: z.boolean().optional().describe('Bekräfta att projektet ska uppdateras'),
65
+ dryRun: z
66
+ .boolean()
67
+ .optional()
68
+ .describe('Visa vad som skulle skickas utan att uppdatera projektet'),
69
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
70
+ }, async ({ projectNumber, confirm, dryRun, includeRaw, ...fields }) => {
71
+ if (dryRun) {
72
+ return dryRunResponse(`update project ${projectNumber}`, { Project: fields });
73
+ }
74
+ if (!confirm)
75
+ requireConfirmation(`update project ${projectNumber}`);
76
+ const data = await updateProject(projectNumber, fields);
77
+ return detailResponse(data, projectDetailColumns, data, includeRaw);
78
+ });
79
+ }
80
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,oB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AAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC9D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;QACvD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACjF,MAAM,EAAE,CAAC;aACN,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAC9E,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE;QAClE,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,cAAc,CAAC,kBAAkB,aAAa,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,IAAI,CAAC,OAAO;YAAE,mBAAmB,CAAC,kBAAkB,aAAa,EAAE,CAAC,CAAC;QAErE,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACxD,OAAO,cAAc,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACtE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAuH3D"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8H3D"}
@@ -79,6 +79,8 @@ export function registerStatusTools(server) {
79
79
  bookkeeping: 'vouchers?limit=1',
80
80
  companyinformation: 'companyinformation',
81
81
  settings: 'settings/company',
82
+ inbox: 'inbox',
83
+ connectfile: 'voucherfileconnections?limit=1',
82
84
  };
83
85
  const required = SCOPES.split(' ');
84
86
  const missing = [];
@@ -90,7 +92,10 @@ export function registerStatusTools(server) {
90
92
  await fortnoxRequest(endpoint);
91
93
  }
92
94
  catch (err) {
93
- if (err instanceof FortnoxApiError && err.statusCode === 403) {
95
+ // Missing scope = 403, or a 400 whose message names the scope
96
+ // (archive/inbox family). Other errors aren't scope problems.
97
+ if (err instanceof FortnoxApiError &&
98
+ (err.statusCode === 403 || /scope/i.test(err.fortnoxMessage ?? ''))) {
94
99
  missing.push(scope);
95
100
  }
96
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,MAAM,CAAC,IAAI,CACT,gBAAgB,EAChB,uHAAuH,EACvH,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,EAAE,GAAG,IAAI,CAAC;QAEd,SAAS,IAAI,CAAC,KAAa,EAAE,MAAe;YAC1C,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,IAAI,CAAC,KAAa,EAAE,MAAe;YAC1C,EAAE,GAAG,KAAK,CAAC;YACX,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,MAAM,C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CAAC,IAAI,CAAC,IAAI,CAAC,2DAA2D,CAC1F,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;QAC9D,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerSupplierInvoicePaymentTools(server: McpServer): void;
3
+ //# sourceMappingURL=supplier-invoice-payments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supplier-invoice-payments.d.ts","sourceRoot":"","sources":["../../src/tools/supplier-invoice-payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsBpE,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmF3E"}
@@ -0,0 +1,60 @@
1
+ import { z } from 'zod';
2
+ import { listSupplierInvoicePayments, getSupplierInvoicePayment, createSupplierInvoicePayment, deleteSupplierInvoicePayment, } from '../operations/supplier-invoice-payments.js';
3
+ import { supplierInvoicePaymentListColumns, supplierInvoicePaymentDetailColumns, } from '../views.js';
4
+ import { confirmationResponse, detailResponse, dryRunResponse, listResponse, requireConfirmation, } from '../tool-output.js';
5
+ const PaymentNumberSchema = z.string().regex(/^\d+$/, 'Payment number must be numeric');
6
+ export function registerSupplierInvoicePaymentTools(server) {
7
+ server.tool('fortnox_list_supplier_invoice_payments', 'Lista utbetalningar (leverantörsfakturor) i Fortnox. Returnerar: Number, InvoiceNumber, PaymentDate, Amount.', {
8
+ invoiceNumber: z.string().optional().describe('Filtrera på fakturanummer'),
9
+ page: z.number().optional().describe('Sidnummer'),
10
+ limit: z.number().optional().describe('Antal per sida'),
11
+ all: z.boolean().optional().describe('Hämta alla sidor'),
12
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
13
+ }, async ({ includeRaw, ...params }) => {
14
+ const data = await listSupplierInvoicePayments(params);
15
+ return listResponse(data.SupplierInvoicePayments ?? [], supplierInvoicePaymentListColumns, data, data.MetaInformation, includeRaw);
16
+ });
17
+ server.tool('fortnox_get_supplier_invoice_payment', 'Hämta en enskild leverantörsbetalning. Returnerar: Number, InvoiceNumber, PaymentDate, Amount, Currency, Source.', {
18
+ paymentNumber: PaymentNumberSchema.describe('Betalningsnummer'),
19
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
20
+ }, async ({ paymentNumber, includeRaw }) => {
21
+ const payment = await getSupplierInvoicePayment(paymentNumber);
22
+ return detailResponse(payment, supplierInvoicePaymentDetailColumns, payment, includeRaw);
23
+ });
24
+ server.tool('fortnox_create_supplier_invoice_payment', 'Registrera en utbetalning mot en leverantörsfaktura i Fortnox', {
25
+ InvoiceNumber: z.string().describe('Leverantörsfakturanummer'),
26
+ Amount: z.number().describe('Belopp'),
27
+ PaymentDate: z.string().describe('Betalningsdatum (YYYY-MM-DD)'),
28
+ Source: z.string().optional().describe('Betalningskälla'),
29
+ confirm: z.boolean().optional().describe('Bekräfta att betalningen ska registreras'),
30
+ dryRun: z
31
+ .boolean()
32
+ .optional()
33
+ .describe('Visa vad som skulle skickas utan att registrera betalningen'),
34
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
35
+ }, async ({ confirm, dryRun, includeRaw, ...params }) => {
36
+ if (dryRun) {
37
+ return dryRunResponse(`register payment for supplier invoice ${params.InvoiceNumber}`, {
38
+ SupplierInvoicePayment: params,
39
+ });
40
+ }
41
+ if (!confirm)
42
+ requireConfirmation(`register payment for supplier invoice ${params.InvoiceNumber}`);
43
+ const payment = await createSupplierInvoicePayment(params);
44
+ return detailResponse(payment, supplierInvoicePaymentDetailColumns, payment, includeRaw);
45
+ });
46
+ server.tool('fortnox_delete_supplier_invoice_payment', 'Ta bort en leverantörsbetalning i Fortnox', {
47
+ paymentNumber: PaymentNumberSchema.describe('Betalningsnummer att ta bort'),
48
+ confirm: z.boolean().optional().describe('Bekräfta att betalningen ska tas bort'),
49
+ dryRun: z.boolean().optional().describe('Visa åtgärden utan att ta bort betalningen'),
50
+ }, async ({ paymentNumber, confirm, dryRun }) => {
51
+ if (dryRun) {
52
+ return dryRunResponse(`delete supplier invoice payment ${paymentNumber}`);
53
+ }
54
+ if (!confirm)
55
+ requireConfirmation(`delete supplier invoice payment ${paymentNumber}`);
56
+ await deleteSupplierInvoicePayment(paymentNumber);
57
+ return confirmationResponse(`Leverantörsbetalning ${paymentNumber} borttagen.`, {});
58
+ });
59
+ }
60
+ //# sourceMappingURL=supplier-invoice-payments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supplier-invoice-payments.js","sourceRoot":"","sources":["../../src/tools/supplier-invoice-payments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;AAExF,MAAM,UAAU,mCAAmC,CAAC,MAAiB;IACnE,MAAM,CAAC,IAAI,CACT,wCAAwC,EACxC,8GAA8G,EAC9G;QACE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B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E,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACjF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACtF,EACD,KAAK,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC3C,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,cAAc,CAAC,mCAAmC,aAAa,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,CAAC,OAAO;YAAE,mBAAmB,CAAC,mCAAmC,aAAa,EAAE,CAAC,CAAC;QAEtF,MAAM,4BAA4B,CAAC,aAAa,CAAC,CAAC;QAClD,OAAO,oBAAoB,CAAC,wBAAwB,aAAa,aAAa,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerTaxReductionTools(server: McpServer): void;
3
+ //# sourceMappingURL=taxreductions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxreductions.d.ts","sourceRoot":"","sources":["../../src/tools/taxreductions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAepE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0EjE"}
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ import { listTaxReductions, getTaxReduction, createTaxReduction, } from '../operations/taxreductions.js';
3
+ import { taxReductionListColumns, taxReductionDetailColumns } from '../views.js';
4
+ import { detailResponse, dryRunResponse, listResponse, requireConfirmation, } from '../tool-output.js';
5
+ export function registerTaxReductionTools(server) {
6
+ server.tool('fortnox_list_taxreductions', 'Lista skattereduktioner (ROT/RUT) i Fortnox. Returnerar: Id, CustomerName, TypeOfReduction, ReferenceNumber, AskedAmount, ApprovedAmount.', {
7
+ filter: z
8
+ .string()
9
+ .optional()
10
+ .describe('Filtrera efter dokumenttyp (t.ex. invoices, offers, orders)'),
11
+ page: z.number().optional().describe('Sidnummer (default 1)'),
12
+ limit: z.number().optional().describe('Antal per sida (default 100, max 500)'),
13
+ all: z.boolean().optional().describe('Hämta alla sidor (ignorerar page/limit)'),
14
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
15
+ }, async ({ filter, page, limit, all, includeRaw }) => {
16
+ const data = await listTaxReductions({ filter, page, limit, all });
17
+ return listResponse(data.TaxReductions ?? [], taxReductionListColumns, data, data.MetaInformation, includeRaw);
18
+ });
19
+ server.tool('fortnox_get_taxreduction', 'Hämta en enskild skattereduktion (ROT/RUT) från Fortnox. Returnerar: Id, CustomerName, TypeOfReduction, ReferenceNumber, AskedAmount, ApprovedAmount, PropertyDesignation.', {
20
+ id: z.number().describe('Skattereduktions-ID'),
21
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
22
+ }, async ({ id, includeRaw }) => {
23
+ const data = await getTaxReduction(id);
24
+ return detailResponse(data, taxReductionDetailColumns, data, includeRaw);
25
+ });
26
+ server.tool('fortnox_create_taxreduction', 'Skapa en ny skattereduktion (ROT/RUT) i Fortnox kopplad till en faktura', {
27
+ ReferenceNumber: z.string().describe('Referensnummer (t.ex. fakturanummer)'),
28
+ ReferenceDocumentType: z
29
+ .enum(['INVOICE', 'OFFER', 'ORDER'])
30
+ .describe('Typ av referensdokument'),
31
+ TypeOfReduction: z.enum(['rot', 'rut']).describe('Typ av reduktion (rot eller rut)'),
32
+ CustomerName: z.string().describe('Kundens namn'),
33
+ AskedAmount: z.number().describe('Begärt belopp i ören'),
34
+ PropertyDesignation: z.string().optional().describe('Fastighetsbeteckning (krävs för ROT)'),
35
+ confirm: z.boolean().optional().describe('Bekräfta att skattereduktionen ska skapas'),
36
+ dryRun: z
37
+ .boolean()
38
+ .optional()
39
+ .describe('Visa vad som skulle skickas utan att skapa skattereduktionen'),
40
+ includeRaw: z.boolean().optional().describe('Inkludera rå JSON från Fortnox'),
41
+ }, async ({ confirm, dryRun, includeRaw, ...params }) => {
42
+ if (dryRun) {
43
+ return dryRunResponse(`create ${params.TypeOfReduction.toUpperCase()} tax reduction for ref ${params.ReferenceNumber}`, { TaxReduction: params });
44
+ }
45
+ if (!confirm)
46
+ requireConfirmation(`create ${params.TypeOfReduction.toUpperCase()} tax reduction for ref ${params.ReferenceNumber}`);
47
+ const data = await createTaxReduction(params);
48
+ return detailResponse(data, taxReductionDetailColumns, data, includeRaw);
49
+ });
50
+ }
51
+ //# sourceMappingURL=taxreductions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxreductions.js","sourceRoot":"","sources":["../../src/tools/taxreductions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,IAAI,CACT,4BAA4B,EAC5B,2IAA2I,EAC3I;QACE,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;QAC1E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAC7D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QAC9E,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC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export declare const supplierDetailColumns: Column[];
14
14
  export declare const supplierInvoiceListColumns: Column[];
15
15
  export declare const supplierInvoiceDetailColumns: Column[];
16
16
  export declare const supplierInvoiceConfirmColumns: Column[];
17
+ export declare const invoicePaymentListColumns: Column[];
18
+ export declare const invoicePaymentDetailColumns: Column[];
19
+ export declare const supplierInvoicePaymentListColumns: Column[];
20
+ export declare const supplierInvoicePaymentDetailColumns: Column[];
21
+ export declare const offerListColumns: Column[];
22
+ export declare const offerDetailColumns: Column[];
23
+ export declare const offerConfirmColumns: Column[];
24
+ export declare const orderListColumns: Column[];
25
+ export declare const orderDetailColumns: Column[];
26
+ export declare const orderConfirmColumns: Column[];
27
+ export declare const projectListColumns: Column[];
28
+ export declare const projectDetailColumns: Column[];
29
+ export declare const costCenterListColumns: Column[];
30
+ export declare const costCenterDetailColumns: Column[];
31
+ export declare const taxReductionListColumns: Column[];
32
+ export declare const taxReductionDetailColumns: Column[];
33
+ export declare const priceListListColumns: Column[];
34
+ export declare const priceListDetailColumns: Column[];
35
+ export declare const priceListColumns: Column[];
36
+ export declare const priceDetailColumns: Column[];
17
37
  export declare const accountListColumns: Column[];
18
38
  export declare const companyDetailColumns: Column[];
39
+ export declare const financialYearListColumns: Column[];
40
+ export declare const financialYearDetailColumns: Column[];
41
+ export declare const lockedPeriodDetailColumns: Column[];
42
+ export declare const contractListColumns: Column[];
43
+ export declare const contractDetailColumns: Column[];
44
+ export declare const topCustomerColumns: Column[];
45
+ export declare const monthlyRevenueColumns: Column[];
46
+ export declare const voucherAttachmentColumns: Column[];
19
47
  //# sourceMappingURL=views.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAO7C,eAAO,MAAM,kBAAkB,EAAE,MAAM,EAOtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAaxC,CAAC;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yBAAyB,EAAE,MAAM,EAS7C,CAAC;AAKF,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAKxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAK1C,CAAC;AAKF,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAMpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,EAMtC,CAAC;AAKF,eAAO,MAAM,kBAAkB,EAAE,MAAM,EAItC,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,MAAM,EASxC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAM5C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAA6B,CAAC;AAE7E,eAAO,MAAM,yBAAyB,EAAE,MAAM,EAE7C,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,MAAM,EAQvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAgBzC,CAAC;AAIF,eAAO,MAAM,kBAAkB,EAAE,MAAM,EAKtC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAIzC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAI5C,CAAC"}
package/dist/views.js CHANGED
@@ -144,6 +144,183 @@ export const supplierInvoiceConfirmColumns = [
144
144
  { key: 'Total', header: 'Total', width: 20, format: currency },
145
145
  { key: 'Booked', header: 'Booked', width: 5 },
146
146
  ];
147
+ // --- Invoice payment views (target ≤80 cols) ---
148
+ // 8 + 2 + 10 + 2 + 10 + 2 + 12 + 2 + 10 + 2 + 10 = 70
149
+ export const invoicePaymentListColumns = [
150
+ { key: 'Number', header: '#', width: 8, align: 'right' },
151
+ { key: 'InvoiceNumber', header: 'Invoice #', width: 10, align: 'right' },
152
+ { key: 'PaymentDate', header: 'Date', width: 10 },
153
+ { key: 'Amount', header: 'Amount', width: 12, align: 'right', format: currency },
154
+ { key: 'Currency', header: 'Currency', width: 10 },
155
+ { key: 'Source', header: 'Source', width: 10 },
156
+ ];
157
+ export const invoicePaymentDetailColumns = [
158
+ { key: 'Number', header: 'Payment #', width: 20 },
159
+ { key: 'InvoiceNumber', header: 'Invoice #', width: 20 },
160
+ { key: 'PaymentDate', header: 'Payment Date', width: 10 },
161
+ { key: 'Amount', header: 'Amount', width: 20, format: currency },
162
+ { key: 'AmountCurrency', header: 'Amount (Currency)', width: 20, format: currency },
163
+ { key: 'Currency', header: 'Currency', width: 5 },
164
+ { key: 'Source', header: 'Source', width: 20 },
165
+ ];
166
+ // --- Supplier invoice payment views (target ≤80 cols) ---
167
+ export const supplierInvoicePaymentListColumns = [
168
+ { key: 'Number', header: '#', width: 8, align: 'right' },
169
+ { key: 'InvoiceNumber', header: 'Invoice #', width: 10, align: 'right' },
170
+ { key: 'PaymentDate', header: 'Date', width: 10 },
171
+ { key: 'Amount', header: 'Amount', width: 12, align: 'right', format: currency },
172
+ { key: 'Currency', header: 'Currency', width: 10 },
173
+ { key: 'Source', header: 'Source', width: 10 },
174
+ ];
175
+ export const supplierInvoicePaymentDetailColumns = [
176
+ { key: 'Number', header: 'Payment #', width: 20 },
177
+ { key: 'InvoiceNumber', header: 'Invoice #', width: 20 },
178
+ { key: 'PaymentDate', header: 'Payment Date', width: 10 },
179
+ { key: 'Amount', header: 'Amount', width: 20, format: currency },
180
+ { key: 'AmountCurrency', header: 'Amount (Currency)', width: 20, format: currency },
181
+ { key: 'Currency', header: 'Currency', width: 5 },
182
+ { key: 'Source', header: 'Source', width: 20 },
183
+ ];
184
+ // --- Offer views (target ≤80 cols) ---
185
+ // 7 + 2 + 20 + 2 + 10 + 2 + 10 + 2 + 10 + 2 + 10 = 77
186
+ export const offerListColumns = [
187
+ { key: 'DocumentNumber', header: 'Doc #', width: 7, align: 'right' },
188
+ { key: 'CustomerName', header: 'Customer', width: 20 },
189
+ { key: 'OfferDate', header: 'Date', width: 10 },
190
+ { key: 'ExpireDate', header: 'Expires', width: 10 },
191
+ { key: 'Total', header: 'Total', width: 10, align: 'right', format: currency },
192
+ { key: 'Sent', header: 'Sent', width: 10 },
193
+ ];
194
+ export const offerDetailColumns = [
195
+ { key: 'DocumentNumber', header: 'Document #', width: 20 },
196
+ { key: 'CustomerNumber', header: 'Customer #', width: 20 },
197
+ { key: 'CustomerName', header: 'Customer', width: 40 },
198
+ { key: 'OfferDate', header: 'Offer Date', width: 10 },
199
+ { key: 'ExpireDate', header: 'Expire Date', width: 10 },
200
+ { key: 'Total', header: 'Total', width: 20, format: currency },
201
+ { key: 'Currency', header: 'Currency', width: 5 },
202
+ { key: 'Sent', header: 'Sent', width: 5 },
203
+ { key: 'Cancelled', header: 'Cancelled', width: 5 },
204
+ { key: 'OurReference', header: 'Our Reference', width: 30 },
205
+ { key: 'YourReference', header: 'Your Reference', width: 30 },
206
+ ];
207
+ export const offerConfirmColumns = [
208
+ { key: 'DocumentNumber', header: 'Document #', width: 20 },
209
+ { key: 'CustomerNumber', header: 'Customer #', width: 20 },
210
+ { key: 'Total', header: 'Total', width: 20, format: currency },
211
+ { key: 'Sent', header: 'Sent', width: 5 },
212
+ ];
213
+ // --- Order views (target ≤80 cols) ---
214
+ // 7 + 2 + 20 + 2 + 10 + 2 + 10 + 2 + 10 + 2 + 10 = 77
215
+ export const orderListColumns = [
216
+ { key: 'DocumentNumber', header: 'Doc #', width: 7, align: 'right' },
217
+ { key: 'CustomerName', header: 'Customer', width: 20 },
218
+ { key: 'OrderDate', header: 'Date', width: 10 },
219
+ { key: 'DeliveryDate', header: 'Delivery', width: 10 },
220
+ { key: 'Total', header: 'Total', width: 10, align: 'right', format: currency },
221
+ { key: 'Sent', header: 'Sent', width: 10 },
222
+ ];
223
+ export const orderDetailColumns = [
224
+ { key: 'DocumentNumber', header: 'Document #', width: 20 },
225
+ { key: 'CustomerNumber', header: 'Customer #', width: 20 },
226
+ { key: 'CustomerName', header: 'Customer', width: 40 },
227
+ { key: 'OrderDate', header: 'Order Date', width: 10 },
228
+ { key: 'DeliveryDate', header: 'Delivery Date', width: 10 },
229
+ { key: 'Total', header: 'Total', width: 20, format: currency },
230
+ { key: 'Currency', header: 'Currency', width: 5 },
231
+ { key: 'Sent', header: 'Sent', width: 5 },
232
+ { key: 'Cancelled', header: 'Cancelled', width: 5 },
233
+ { key: 'OurReference', header: 'Our Reference', width: 30 },
234
+ { key: 'YourReference', header: 'Your Reference', width: 30 },
235
+ ];
236
+ export const orderConfirmColumns = [
237
+ { key: 'DocumentNumber', header: 'Document #', width: 20 },
238
+ { key: 'CustomerNumber', header: 'Customer #', width: 20 },
239
+ { key: 'Total', header: 'Total', width: 20, format: currency },
240
+ { key: 'Sent', header: 'Sent', width: 5 },
241
+ ];
242
+ // --- Project views (target ≤80 cols) ---
243
+ // 10 + 2 + 30 + 2 + 10 + 2 + 10 + 2 + 10 = 78
244
+ export const projectListColumns = [
245
+ { key: 'ProjectNumber', header: 'Proj #', width: 10, align: 'right' },
246
+ { key: 'Description', header: 'Description', width: 30 },
247
+ { key: 'Status', header: 'Status', width: 10 },
248
+ { key: 'StartDate', header: 'Start', width: 10 },
249
+ { key: 'EndDate', header: 'End', width: 10 },
250
+ ];
251
+ export const projectDetailColumns = [
252
+ { key: 'ProjectNumber', header: 'Project #', width: 20 },
253
+ { key: 'Description', header: 'Description', width: 40 },
254
+ { key: 'Status', header: 'Status', width: 10 },
255
+ { key: 'StartDate', header: 'Start Date', width: 10 },
256
+ { key: 'EndDate', header: 'End Date', width: 10 },
257
+ { key: 'ContactPerson', header: 'Contact', width: 30 },
258
+ { key: 'ProjectLeader', header: 'Leader', width: 30 },
259
+ { key: 'Comments', header: 'Comments', width: 40 },
260
+ ];
261
+ // --- Cost Center views (target ≤80 cols) ---
262
+ // 10 + 2 + 40 + 2 + 10 = 64
263
+ export const costCenterListColumns = [
264
+ { key: 'Code', header: 'Code', width: 10 },
265
+ { key: 'Description', header: 'Description', width: 40 },
266
+ { key: 'Active', header: 'Active', width: 10 },
267
+ ];
268
+ export const costCenterDetailColumns = [
269
+ { key: 'Code', header: 'Code', width: 20 },
270
+ { key: 'Description', header: 'Description', width: 40 },
271
+ { key: 'Active', header: 'Active', width: 5 },
272
+ { key: 'Note', header: 'Note', width: 40 },
273
+ ];
274
+ // --- Tax Reduction views (target ≤80 cols) ---
275
+ // 6 + 2 + 20 + 2 + 5 + 2 + 10 + 2 + 12 + 2 + 12 = 75
276
+ export const taxReductionListColumns = [
277
+ { key: 'Id', header: 'ID', width: 6, align: 'right' },
278
+ { key: 'CustomerName', header: 'Customer', width: 20 },
279
+ { key: 'TypeOfReduction', header: 'Type', width: 5 },
280
+ { key: 'ReferenceNumber', header: 'Ref #', width: 10 },
281
+ { key: 'AskedAmount', header: 'Asked', width: 12, align: 'right', format: currency },
282
+ { key: 'ApprovedAmount', header: 'Approved', width: 12, align: 'right', format: currency },
283
+ ];
284
+ export const taxReductionDetailColumns = [
285
+ { key: 'Id', header: 'ID', width: 10 },
286
+ { key: 'CustomerName', header: 'Customer', width: 40 },
287
+ { key: 'TypeOfReduction', header: 'Type', width: 5 },
288
+ { key: 'ReferenceNumber', header: 'Reference #', width: 20 },
289
+ { key: 'ReferenceDocumentType', header: 'Doc Type', width: 10 },
290
+ { key: 'AskedAmount', header: 'Asked Amount', width: 20, format: currency },
291
+ { key: 'ApprovedAmount', header: 'Approved Amount', width: 20, format: currency },
292
+ { key: 'PropertyDesignation', header: 'Property', width: 30 },
293
+ ];
294
+ // --- Price List views (target ≤80 cols) ---
295
+ // 10 + 2 + 30 + 2 + 20 + 2 + 10 = 76
296
+ export const priceListListColumns = [
297
+ { key: 'Code', header: 'Code', width: 10 },
298
+ { key: 'Description', header: 'Description', width: 30 },
299
+ { key: 'Comments', header: 'Comments', width: 20 },
300
+ { key: 'PreSelected', header: 'Default', width: 10 },
301
+ ];
302
+ export const priceListDetailColumns = [
303
+ { key: 'Code', header: 'Code', width: 20 },
304
+ { key: 'Description', header: 'Description', width: 40 },
305
+ { key: 'Comments', header: 'Comments', width: 40 },
306
+ { key: 'PreSelected', header: 'Pre-selected', width: 5 },
307
+ ];
308
+ // --- Price views (target ≤80 cols) ---
309
+ // 12 + 2 + 10 + 2 + 12 + 2 + 12 + 2 + 10 = 64
310
+ export const priceListColumns = [
311
+ { key: 'ArticleNumber', header: 'Article #', width: 12 },
312
+ { key: 'PriceList', header: 'List', width: 10 },
313
+ { key: 'Price', header: 'Price', width: 12, align: 'right', format: currency },
314
+ { key: 'FromQuantity', header: 'From Qty', width: 12, align: 'right' },
315
+ { key: 'Percent', header: 'Discount %', width: 10, align: 'right' },
316
+ ];
317
+ export const priceDetailColumns = [
318
+ { key: 'ArticleNumber', header: 'Article #', width: 20 },
319
+ { key: 'PriceList', header: 'Price List', width: 20 },
320
+ { key: 'Price', header: 'Price', width: 20, format: currency },
321
+ { key: 'FromQuantity', header: 'From Quantity', width: 20 },
322
+ { key: 'Percent', header: 'Discount %', width: 10 },
323
+ ];
147
324
  // --- Account views (target ≤80 cols) ---
148
325
  // 8 + 2 + 50 + 2 + 6 = 68
149
326
  export const accountListColumns = [
@@ -162,4 +339,61 @@ export const companyDetailColumns = [
162
339
  { key: 'Email', header: 'Email', width: 40 },
163
340
  { key: 'DatabaseNumber', header: 'Database #', width: 10 },
164
341
  ];
342
+ // --- Financial year views ---
343
+ export const financialYearListColumns = [
344
+ { key: 'Id', header: 'Id', width: 4, align: 'right' },
345
+ { key: 'FromDate', header: 'From', width: 10 },
346
+ { key: 'ToDate', header: 'To', width: 10 },
347
+ { key: 'AccountingMethod', header: 'Method', width: 8 },
348
+ { key: 'AccountChartType', header: 'Account Chart', width: 30 },
349
+ ];
350
+ export const financialYearDetailColumns = financialYearListColumns;
351
+ export const lockedPeriodDetailColumns = [
352
+ { key: 'EndDate', header: 'Locked Through', width: 10 },
353
+ ];
354
+ // --- Contract views ---
355
+ export const contractListColumns = [
356
+ { key: 'DocumentNumber', header: 'Doc #', width: 7, align: 'right' },
357
+ { key: 'CustomerName', header: 'Customer', width: 20 },
358
+ { key: 'PeriodStart', header: 'Start', width: 10 },
359
+ { key: 'PeriodEnd', header: 'End', width: 10 },
360
+ { key: 'InvoiceInterval', header: 'Interval', width: 8, align: 'right' },
361
+ { key: 'Continuous', header: 'Cont.', width: 5 },
362
+ { key: 'Total', header: 'Total', width: 10, align: 'right', format: currency },
363
+ ];
364
+ export const contractDetailColumns = [
365
+ { key: 'DocumentNumber', header: 'Document #', width: 10 },
366
+ { key: 'CustomerNumber', header: 'Customer #', width: 10 },
367
+ { key: 'CustomerName', header: 'Customer', width: 30 },
368
+ { key: 'Active', header: 'Active', width: 5 },
369
+ { key: 'Continuous', header: 'Continuous', width: 5 },
370
+ { key: 'ContractDate', header: 'Contract Date', width: 10 },
371
+ { key: 'ContractLength', header: 'Length (months)', width: 6, align: 'right' },
372
+ { key: 'PeriodStart', header: 'Period Start', width: 10 },
373
+ { key: 'PeriodEnd', header: 'Period End', width: 10 },
374
+ { key: 'InvoiceInterval', header: 'Invoice Interval', width: 6, align: 'right' },
375
+ { key: 'InvoicesRemaining', header: 'Invoices Remaining', width: 6, align: 'right' },
376
+ { key: 'LastInvoiceDate', header: 'Last Invoice', width: 10 },
377
+ { key: 'Total', header: 'Total', width: 12, align: 'right', format: currency },
378
+ { key: 'TotalVAT', header: 'VAT', width: 12, align: 'right', format: currency },
379
+ { key: 'Comments', header: 'Comments', width: 40 },
380
+ ];
381
+ // --- Analytics views ---
382
+ export const topCustomerColumns = [
383
+ { key: 'CustomerNumber', header: 'Cust #', width: 8, align: 'right' },
384
+ { key: 'CustomerName', header: 'Customer', width: 30 },
385
+ { key: 'total', header: 'Invoiced', width: 14, align: 'right', format: currency },
386
+ { key: 'invoiceCount', header: 'Invoices', width: 8, align: 'right' },
387
+ ];
388
+ export const monthlyRevenueColumns = [
389
+ { key: 'month', header: 'Month', width: 7 },
390
+ { key: 'total', header: 'Invoiced', width: 14, align: 'right', format: currency },
391
+ { key: 'invoiceCount', header: 'Invoices', width: 8, align: 'right' },
392
+ ];
393
+ // --- Voucher file attachment views ---
394
+ export const voucherAttachmentColumns = [
395
+ { key: 'fileName', header: 'File', width: 40 },
396
+ { key: 'fileId', header: 'File ID', width: 36 },
397
+ { key: 'voucherYear', header: 'Year', width: 5, align: 'right' },
398
+ ];
165
399
  //# sourceMappingURL=views.js.map