@harbortouch/skytab-analytics-report-utils 0.5.2 → 0.6.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/dist/index.js CHANGED
@@ -1,177 +1,912 @@
1
- // src/report.ts
2
- var Report = {
3
- TICKET_LIVE: "ticket-live",
4
- TICKET_ANALYTICS: "ticket-analytics",
5
- SALES_SUMMARY: "sales-summary",
6
- PRODUCT_MIX: "product-mix",
7
- MODIFIER_MIX: "modifier-mix",
8
- ITEM_TAX: "item-tax",
9
- EMPLOYEE_TIMECARD: "employee-timecard",
10
- EMPLOYEE_TIP: "employee-tip",
11
- SALES_BY_ITEM: "sales-by-item"
12
- };
13
-
14
- // src/columns/index.ts
15
- var COLUMN_REGISTRY = {
16
- fifteenMinInterval: {
17
- titleKey: "common.report-col.fifteen-min-interval",
18
- shortTitleKey: "common.report-col.fifteen-min-interval.short",
19
- infoTextKey: "common.report-col.fifteen-min-interval.info"
20
- },
21
- adjustedTips: {
22
- titleKey: "common.report-col.adjusted-tips",
23
- shortTitleKey: "common.report-col.adjusted-tips.short",
24
- infoTextKey: "common.report-col.adjusted-tips.info"
1
+ // src/reports/salesSummary.ts
2
+ var FIRST_COLUMN_WIDTH = 240;
3
+ var FIELDS = {
4
+ groupById: { type: "number" },
5
+ groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
6
+ salesAmountNet: { type: "money", columnKey: "netSales" },
7
+ salesVarLW: { type: "money", columnKey: "salesVarLw" },
8
+ salesVarLY: { type: "money", columnKey: "salesVarLy" },
9
+ salesVarLWPct: {
10
+ type: "percent",
11
+ columnKey: "salesVarLwPct",
12
+ footerCalculation: {
13
+ type: "percentChange",
14
+ numeratorField: "salesAmountNet",
15
+ denominatorField: "salesAmountNetLastWeek"
16
+ }
25
17
  },
26
- advantageProgram: {
27
- titleKey: "common.report-col.advantage-program",
28
- shortTitleKey: "common.report-col.advantage-program.short",
29
- infoTextKey: "common.report-col.advantage-program.info"
18
+ salesVarLYPct: {
19
+ type: "percent",
20
+ columnKey: "salesVarLyPct",
21
+ footerCalculation: {
22
+ type: "percentChange",
23
+ numeratorField: "salesAmountNet",
24
+ denominatorField: "salesAmountNetLastYear"
25
+ }
30
26
  },
31
- amex: {
32
- titleKey: "common.report-col.amex",
33
- shortTitleKey: "common.report-col.amex.short",
34
- infoTextKey: "common.report-col.amex.info"
27
+ salesAmountNetLastWeek: { type: "money" },
28
+ salesAmountNetLastYear: { type: "money" },
29
+ salesAmountGross: { type: "money" },
30
+ salesAmountGrossLastWeek: { type: "money" },
31
+ salesAmountGrossLastYear: { type: "money" },
32
+ ticketsCount: { type: "number" },
33
+ ticketsCountLastWeek: { type: "number" },
34
+ ticketsCountLastYear: { type: "number" },
35
+ guestsCount: { type: "number", columnKey: "guestCount" },
36
+ guestsVarLW: { type: "number", columnKey: "guestsVarLw" },
37
+ guestsVarLY: { type: "number", columnKey: "guestsVarLy" },
38
+ guestsVarLWPct: {
39
+ type: "percent",
40
+ columnKey: "guestsVarLwPct",
41
+ footerCalculation: {
42
+ type: "percentChange",
43
+ numeratorField: "guestsCount",
44
+ denominatorField: "guestsCountLastWeek"
45
+ }
35
46
  },
36
- amexReturns: {
37
- titleKey: "common.report-col.amex-returns",
38
- shortTitleKey: "common.report-col.amex-returns.short",
39
- infoTextKey: "common.report-col.amex-returns.info"
47
+ guestsVarLYPct: {
48
+ type: "percent",
49
+ columnKey: "guestsVarLyPct",
50
+ footerCalculation: {
51
+ type: "percentChange",
52
+ numeratorField: "guestsCount",
53
+ denominatorField: "guestsCountLastYear"
54
+ }
40
55
  },
41
- attachRate: {
42
- titleKey: "common.report-col.attach-rate",
43
- shortTitleKey: "common.report-col.attach-rate.short",
44
- infoTextKey: "common.report-col.attach-rate.info"
56
+ guestsCountLastWeek: { type: "number" },
57
+ guestsCountLastYear: { type: "number" },
58
+ salesPerGuestTY: {
59
+ type: "money",
60
+ columnKey: "salesPerGuest",
61
+ footerCalculation: {
62
+ type: "average",
63
+ numeratorField: "salesAmountNet",
64
+ denominatorField: "guestsCount"
65
+ }
45
66
  },
46
- autoGratuity: {
47
- titleKey: "common.report-col.auto-gratuity",
48
- shortTitleKey: "common.report-col.auto-gratuity.short",
49
- infoTextKey: "common.report-col.auto-gratuity.info"
67
+ salesPerGuestLW: {
68
+ type: "money",
69
+ columnKey: "salesPerGuestLw",
70
+ footerCalculation: {
71
+ type: "average",
72
+ numeratorField: "salesAmountNetLastWeek",
73
+ denominatorField: "guestsCountLastWeek"
74
+ }
50
75
  },
51
- averageGrossPrice: {
52
- titleKey: "common.report-col.average-gross-price",
53
- shortTitleKey: "common.report-col.average-gross-price.short",
54
- infoTextKey: "common.report-col.average-gross-price.info"
76
+ salesPerGuestLY: {
77
+ type: "money",
78
+ columnKey: "salesPerGuestLy",
79
+ footerCalculation: {
80
+ type: "average",
81
+ numeratorField: "salesAmountNetLastYear",
82
+ denominatorField: "guestsCountLastYear"
83
+ }
84
+ }
85
+ };
86
+ var COLUMN_GROUPS = [
87
+ {
88
+ id: "sales",
89
+ headerTranslationKey: "table.groups.sales",
90
+ baseFields: ["salesAmountNet"],
91
+ lastWeekFields: ["salesVarLW", "salesVarLWPct"],
92
+ lastYearFields: ["salesVarLY", "salesVarLYPct"]
55
93
  },
56
- bankFees: {
57
- titleKey: "common.report-col.bank-fees",
58
- shortTitleKey: "common.report-col.bank-fees.short",
59
- infoTextKey: "common.report-col.bank-fees.info"
94
+ {
95
+ id: "guests",
96
+ headerTranslationKey: "table.groups.guests",
97
+ baseFields: ["guestsCount"],
98
+ lastWeekFields: ["guestsVarLW", "guestsVarLWPct"],
99
+ lastYearFields: ["guestsVarLY", "guestsVarLYPct"]
60
100
  },
61
- batchAmount: {
62
- titleKey: "common.report-col.batch-amount",
63
- shortTitleKey: "common.report-col.batch-amount.short",
64
- infoTextKey: "common.report-col.batch-amount.info"
101
+ {
102
+ id: "salesPerGuest",
103
+ headerTranslationKey: "table.groups.sales-per-guest",
104
+ baseFields: ["salesPerGuestTY"],
105
+ lastWeekFields: ["salesPerGuestLW"],
106
+ lastYearFields: ["salesPerGuestLY"]
107
+ }
108
+ ];
109
+ var SALES_SUMMARY_AVAILABLE_COLUMNS = [
110
+ "salesAmountNet",
111
+ "salesVarLW",
112
+ "salesVarLWPct",
113
+ "salesVarLY",
114
+ "salesVarLYPct",
115
+ "guestsCount",
116
+ "guestsVarLW",
117
+ "guestsVarLWPct",
118
+ "guestsVarLY",
119
+ "guestsVarLYPct",
120
+ "salesPerGuestTY",
121
+ "salesPerGuestLW",
122
+ "salesPerGuestLY"
123
+ ];
124
+ var SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS = [
125
+ "salesAmountNet",
126
+ "guestsCount",
127
+ "salesPerGuestTY"
128
+ ];
129
+ var salesSummaryConfig = {
130
+ fields: FIELDS,
131
+ availableColumns: SALES_SUMMARY_AVAILABLE_COLUMNS,
132
+ defaultVisibleColumns: SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS,
133
+ columnGroups: COLUMN_GROUPS
134
+ };
135
+
136
+ // src/reports/ticketSummary.ts
137
+ var FIELDS2 = {
138
+ ticketId: { type: "string" },
139
+ locationId: { type: "number" },
140
+ orderName: { type: "string" },
141
+ revenueCenterName: { type: "string", columnKey: "revenueCenter" },
142
+ daypartName: { type: "string", columnKey: "daypart" },
143
+ inclusiveTaxesAmount: {
144
+ type: "money",
145
+ columnKey: "inclusiveTax",
146
+ footerCalculation: { type: "sum" }
65
147
  },
66
- batchDate: {
67
- titleKey: "common.report-col.batch-date",
68
- shortTitleKey: "common.report-col.batch-date.short",
69
- infoTextKey: "common.report-col.batch-date.info"
148
+ locationName: { type: "string", size: 240, columnKey: "locationName" },
149
+ orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "none" } },
150
+ businessDate: { type: "date", columnKey: "date" },
151
+ ticketOpenedAt: { type: "time", columnKey: "ticketOpen" },
152
+ ticketClosedAt: { type: "time", columnKey: "ticketClosed" },
153
+ ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false },
154
+ ticketSubtotal: {
155
+ type: "money",
156
+ columnKey: "subtotal",
157
+ footerCalculation: { type: "sum" }
70
158
  },
71
- batchNumber: {
72
- titleKey: "common.report-col.batch-number",
73
- shortTitleKey: "common.report-col.batch-number.short",
74
- infoTextKey: "common.report-col.batch-number.info"
159
+ discountsAmount: {
160
+ type: "money",
161
+ columnKey: "discountAmount",
162
+ footerCalculation: { type: "sum" }
75
163
  },
76
- clockInTime: {
77
- titleKey: "common.report-col.clock-in-time",
78
- shortTitleKey: "common.report-col.clock-in-time.short",
79
- infoTextKey: "common.report-col.clock-in-time.info"
164
+ surchargesAmount: {
165
+ type: "money",
166
+ columnKey: "ticketFee",
167
+ footerCalculation: { type: "sum" }
80
168
  },
81
- clockOutTime: {
82
- titleKey: "common.report-col.clock-out-time",
83
- shortTitleKey: "common.report-col.clock-out-time.short",
84
- infoTextKey: "common.report-col.clock-out-time.info"
169
+ taxesAmount: {
170
+ type: "money",
171
+ columnKey: "taxCollected",
172
+ footerCalculation: { type: "sum" }
85
173
  },
86
- country: {
87
- titleKey: "common.report-col.country",
88
- shortTitleKey: "common.report-col.country.short",
89
- infoTextKey: "common.report-col.country.info"
174
+ ticketGrandTotal: {
175
+ type: "money",
176
+ columnKey: "grandTotal",
177
+ footerCalculation: { type: "sum" }
90
178
  },
91
- customerName: {
92
- titleKey: "common.report-col.customer-name",
93
- shortTitleKey: "common.report-col.customer-name.short",
94
- infoTextKey: "common.report-col.customer-name.info"
179
+ gratuitiesAmount: {
180
+ type: "money",
181
+ columnKey: "autoGratuity",
182
+ footerCalculation: { type: "sum" }
95
183
  },
96
- date: {
97
- titleKey: "common.report-col.date",
98
- shortTitleKey: "common.report-col.date.short",
99
- infoTextKey: "common.report-col.date.info"
184
+ tipAmount: {
185
+ type: "money",
186
+ columnKey: "tips",
187
+ footerCalculation: { type: "sum" }
100
188
  },
101
- dateClose: {
102
- titleKey: "common.report-col.date-close",
103
- shortTitleKey: "common.report-col.date-close.short",
104
- infoTextKey: "common.report-col.date-close.info"
105
- },
106
- daypart: {
107
- titleKey: "common.report-col.daypart",
108
- shortTitleKey: "common.report-col.daypart.short",
109
- infoTextKey: "common.report-col.daypart.info"
110
- },
111
- debit: {
112
- titleKey: "common.report-col.debit",
113
- shortTitleKey: "common.report-col.debit.short",
114
- infoTextKey: "common.report-col.debit.info"
115
- },
116
- debitReturns: {
117
- titleKey: "common.report-col.debit-returns",
118
- shortTitleKey: "common.report-col.debit-returns.short",
119
- infoTextKey: "common.report-col.debit-returns.info"
120
- },
121
- declaredTips: {
122
- titleKey: "common.report-col.declared-tips",
123
- shortTitleKey: "common.report-col.declared-tips.short",
124
- infoTextKey: "common.report-col.declared-tips.info"
125
- },
126
- department: {
127
- titleKey: "common.report-col.department",
128
- shortTitleKey: "common.report-col.department.short",
129
- infoTextKey: "common.report-col.department.info"
189
+ paymentsAmount: {
190
+ type: "money",
191
+ columnKey: "totalCollected",
192
+ footerCalculation: { type: "sum" }
130
193
  },
131
- depositCurrency: {
132
- titleKey: "common.report-col.deposit-currency",
133
- shortTitleKey: "common.report-col.deposit-currency.short",
134
- infoTextKey: "common.report-col.deposit-currency.info"
194
+ paymentTypeName: { type: "string", columnKey: "paymentType" },
195
+ guestsCount: {
196
+ type: "number",
197
+ columnKey: "guestCount",
198
+ footerCalculation: { type: "sum" }
135
199
  },
136
- depositDate: {
137
- titleKey: "common.report-col.deposit-date",
138
- shortTitleKey: "common.report-col.deposit-date.short",
139
- infoTextKey: "common.report-col.deposit-date.info"
200
+ employeeName: { type: "string", columnKey: "employeeName" },
201
+ orderTypeName: { type: "string", columnKey: "orderType" }
202
+ };
203
+ var TICKET_SUMMARY_AVAILABLE_COLUMNS = [
204
+ "locationName",
205
+ "orderNumber",
206
+ "businessDate",
207
+ "ticketOpenedAt",
208
+ "ticketClosedAt",
209
+ "ticketTime",
210
+ "ticketSubtotal",
211
+ "discountsAmount",
212
+ "surchargesAmount",
213
+ "taxesAmount",
214
+ "ticketGrandTotal",
215
+ "gratuitiesAmount",
216
+ "tipAmount",
217
+ "paymentsAmount",
218
+ "paymentTypeName",
219
+ "guestsCount",
220
+ "employeeName",
221
+ "orderTypeName"
222
+ ];
223
+ var TICKET_SUMMARY_DEFAULT_VISIBLE_COLUMNS = TICKET_SUMMARY_AVAILABLE_COLUMNS;
224
+ var ticketSummaryConfig = {
225
+ fields: FIELDS2,
226
+ availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
227
+ defaultVisibleColumns: TICKET_SUMMARY_DEFAULT_VISIBLE_COLUMNS
228
+ };
229
+
230
+ // src/reports/ticketLive.ts
231
+ var FIELDS3 = {
232
+ locationName: { type: "string", columnKey: "locationName" },
233
+ orderNumber: {
234
+ type: "number",
235
+ columnKey: "ticketNumber",
236
+ footerCalculation: { type: "none" }
140
237
  },
141
- discountAmount: {
142
- titleKey: "common.report-col.discount-amount",
143
- shortTitleKey: "common.report-col.discount-amount.short",
144
- infoTextKey: "common.report-col.discount-amount.info"
238
+ dateOpen: { type: "string", columnKey: "date" },
239
+ timeOpen: { type: "string", columnKey: "ticketOpen" },
240
+ dateClose: { type: "string", columnKey: "dateClose" },
241
+ timeClose: { type: "string", columnKey: "ticketClosed" },
242
+ durationMinutes: { type: "number", columnKey: "timeOpenMins" },
243
+ subtotal: { type: "money", columnKey: "subtotal" },
244
+ discountTotal: { type: "money", columnKey: "discountAmount" },
245
+ surchargeTotal: { type: "money", columnKey: "ticketFee" },
246
+ taxTotal: { type: "money", columnKey: "taxCollected" },
247
+ grandTotal: { type: "money", columnKey: "grandTotal" },
248
+ gratuityTotal: { type: "money", columnKey: "autoGratuity" },
249
+ totalTips: { type: "money", columnKey: "totalTips" },
250
+ paymentsReceived: { type: "money", columnKey: "totalCollected" },
251
+ paymentTypeName: { type: "string", columnKey: "paymentType" },
252
+ guestCount: {
253
+ type: "number",
254
+ columnKey: "guestCount",
255
+ footerCalculation: { type: "sum" }
145
256
  },
146
- discountCount: {
147
- titleKey: "common.report-col.discount-count",
148
- shortTitleKey: "common.report-col.discount-count.short",
149
- infoTextKey: "common.report-col.discount-count.info"
257
+ customerName: { type: "string", columnKey: "customerName" },
258
+ employeeName: { type: "string", columnKey: "employeeName" },
259
+ orderType: { type: "string", columnKey: "orderType" }
260
+ };
261
+ var TICKET_LIVE_AVAILABLE_COLUMNS = [
262
+ "locationName",
263
+ "orderNumber",
264
+ "dateOpen",
265
+ "timeOpen",
266
+ "timeClose",
267
+ "durationMinutes",
268
+ "subtotal",
269
+ "discountTotal",
270
+ "surchargeTotal",
271
+ "taxTotal",
272
+ "grandTotal",
273
+ "gratuityTotal",
274
+ "totalTips",
275
+ "paymentsReceived",
276
+ "paymentTypeName",
277
+ "guestCount",
278
+ "employeeName",
279
+ "orderType"
280
+ ];
281
+ var TICKET_LIVE_DEFAULT_VISIBLE_COLUMNS = TICKET_LIVE_AVAILABLE_COLUMNS;
282
+ var ticketLiveConfig = {
283
+ fields: FIELDS3,
284
+ availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
285
+ defaultVisibleColumns: TICKET_LIVE_DEFAULT_VISIBLE_COLUMNS
286
+ };
287
+
288
+ // src/reports/productMix.ts
289
+ var FIRST_COLUMN_WIDTH2 = 240;
290
+ var FIELDS4 = {
291
+ groupById: { type: "string" },
292
+ groupByName: { type: "string", size: FIRST_COLUMN_WIDTH2 },
293
+ salesAmountGross: { type: "money", columnKey: "grossSales" },
294
+ discountsAmount: { type: "money", columnKey: "discountAmount" },
295
+ inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
296
+ salesAmountNet: { type: "money", columnKey: "netSales" },
297
+ itemsQuantity: { type: "fixedNumber", columnKey: "quantity" },
298
+ avgPrice: {
299
+ type: "fixedNumber",
300
+ columnKey: "averageGrossPrice",
301
+ footerCalculation: {
302
+ type: "average",
303
+ numeratorField: "salesAmountGross",
304
+ denominatorField: "itemsQuantity"
305
+ }
150
306
  },
151
- discover: {
152
- titleKey: "common.report-col.discover",
153
- shortTitleKey: "common.report-col.discover.short",
154
- infoTextKey: "common.report-col.discover.info"
307
+ salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
308
+ };
309
+ var PRODUCT_MIX_AVAILABLE_COLUMNS = [
310
+ "salesAmountGross",
311
+ "discountsAmount",
312
+ "inclusiveTaxesAmount",
313
+ "salesAmountNet",
314
+ "itemsQuantity",
315
+ "avgPrice",
316
+ "salesMixPct"
317
+ ];
318
+ var PRODUCT_MIX_DEFAULT_VISIBLE_COLUMNS = PRODUCT_MIX_AVAILABLE_COLUMNS;
319
+ var PRODUCT_MIX_CHART_FIELDS = [
320
+ "salesAmountGross",
321
+ "itemsQuantity",
322
+ "avgPrice",
323
+ "discountsAmount",
324
+ "inclusiveTaxesAmount",
325
+ "salesAmountNet",
326
+ "salesMixPct"
327
+ ];
328
+ var productMixConfig = {
329
+ fields: FIELDS4,
330
+ availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
331
+ defaultVisibleColumns: PRODUCT_MIX_DEFAULT_VISIBLE_COLUMNS
332
+ };
333
+
334
+ // src/reports/modifierMix.ts
335
+ var FIRST_COLUMN_WIDTH3 = 240;
336
+ var FIELDS5 = {
337
+ groupById: { type: "string", filteringAvailable: false },
338
+ groupByName: { type: "string", size: FIRST_COLUMN_WIDTH3, filteringAvailable: false },
339
+ groupById2: { type: "string", filteringAvailable: false },
340
+ groupByName2: { type: "string", size: FIRST_COLUMN_WIDTH3, filteringAvailable: false },
341
+ modifiersSales: { type: "money", columnKey: "totalModifierSales" },
342
+ modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
343
+ itemsQuantity: {
344
+ type: "number",
345
+ columnKey: "quantity",
346
+ filteringAvailable: false
155
347
  },
156
- discoverReturns: {
157
- titleKey: "common.report-col.discover-returns",
158
- shortTitleKey: "common.report-col.discover-returns.short",
159
- infoTextKey: "common.report-col.discover-returns.info"
348
+ avgGross: {
349
+ type: "money",
350
+ columnKey: "averageGrossPrice",
351
+ footerCalculation: {
352
+ type: "average",
353
+ numeratorField: "modifiersSales",
354
+ denominatorField: "modifiersQuantity"
355
+ }
160
356
  },
161
- ebt: {
162
- titleKey: "common.report-col.ebt",
163
- shortTitleKey: "common.report-col.ebt.short",
164
- infoTextKey: "common.report-col.ebt.info"
357
+ attachRate: {
358
+ type: "percent",
359
+ columnKey: "attachRate",
360
+ footerCalculation: {
361
+ type: "average",
362
+ numeratorField: "modifiersQuantity",
363
+ denominatorField: "itemsQuantity"
364
+ }
165
365
  },
166
- ebtReturns: {
167
- titleKey: "common.report-col.ebt-returns",
168
- shortTitleKey: "common.report-col.ebt-returns.short",
169
- infoTextKey: "common.report-col.ebt-returns.info"
366
+ modifiersSalesComp: { type: "money", filteringAvailable: false },
367
+ modifiersQuantityComp: { type: "number", filteringAvailable: false },
368
+ itemsQuantityComp: { type: "number", filteringAvailable: false },
369
+ attachRateComp: { type: "percent", filteringAvailable: false },
370
+ modifiersSalesVar: { type: "money", filteringAvailable: false },
371
+ modifiersSalesVarPct: {
372
+ type: "percent",
373
+ filteringAvailable: false,
374
+ footerCalculation: {
375
+ type: "percentChange",
376
+ numeratorField: "modifiersSales",
377
+ denominatorField: "modifiersSalesComp"
378
+ }
170
379
  },
171
- employeeId: {
172
- titleKey: "common.report-col.employee-id",
173
- shortTitleKey: "common.report-col.employee-id.short",
174
- infoTextKey: "common.report-col.employee-id.info"
380
+ modifiersQuantityVar: { type: "number", filteringAvailable: false },
381
+ modifiersQuantityVarPct: {
382
+ type: "percent",
383
+ filteringAvailable: false,
384
+ footerCalculation: {
385
+ type: "percentChange",
386
+ numeratorField: "modifiersQuantity",
387
+ denominatorField: "modifiersQuantityComp"
388
+ }
389
+ },
390
+ attachRateVar: { type: "percent", filteringAvailable: false },
391
+ attachRateVarPct: {
392
+ type: "percent",
393
+ filteringAvailable: false,
394
+ footerCalculation: {
395
+ type: "percentChange",
396
+ numeratorField: "attachRate",
397
+ denominatorField: "attachRateComp"
398
+ }
399
+ }
400
+ };
401
+ var MODIFIER_MIX_AVAILABLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
402
+ var MODIFIER_MIX_DEFAULT_VISIBLE_COLUMNS = MODIFIER_MIX_AVAILABLE_COLUMNS;
403
+ var modifierMixConfig = {
404
+ fields: FIELDS5,
405
+ availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
406
+ defaultVisibleColumns: MODIFIER_MIX_DEFAULT_VISIBLE_COLUMNS
407
+ };
408
+
409
+ // src/reports/itemTax.ts
410
+ var FIELDS6 = {
411
+ locationId: { type: "number", filteringAvailable: false },
412
+ taxIsFlat: { type: "boolean", filteringAvailable: false },
413
+ merchantId: { type: "string", columnKey: "locationMid", filteringAvailable: false },
414
+ locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
415
+ locationCity: { type: "string", columnKey: "locationCity", filteringAvailable: false },
416
+ locationState: { type: "string", columnKey: "locationState", filteringAvailable: false },
417
+ itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
418
+ itemPrice: { type: "money", columnKey: "itemPrice" },
419
+ departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
420
+ revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
421
+ orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
422
+ taxName: { type: "string", columnKey: "taxName", filteringAvailable: false },
423
+ taxValue: { type: "money", columnKey: "taxableSales" },
424
+ taxRate: { type: "number", columnKey: "taxRate" },
425
+ recordsCount: { type: "number", columnKey: "quantity" },
426
+ taxableSales: { type: "money", columnKey: "taxableSales" },
427
+ totalCollected: { type: "money", columnKey: "totalCollected" },
428
+ itemTax: { type: "money", columnKey: "taxCollected" },
429
+ taxCollected: { type: "money", columnKey: "taxCollected" }
430
+ };
431
+ var ITEM_TAX_AVAILABLE_COLUMNS = [
432
+ "merchantId",
433
+ "locationName",
434
+ "locationCity",
435
+ "locationState",
436
+ "itemName",
437
+ "departmentName",
438
+ "revenueClassName",
439
+ "orderTypeName",
440
+ "recordsCount",
441
+ "itemPrice",
442
+ "taxName",
443
+ "taxRate",
444
+ "taxableSales",
445
+ "taxCollected"
446
+ ];
447
+ var ITEM_TAX_DEFAULT_VISIBLE_COLUMNS = ITEM_TAX_AVAILABLE_COLUMNS;
448
+ var itemTaxConfig = {
449
+ fields: FIELDS6,
450
+ availableColumns: ITEM_TAX_AVAILABLE_COLUMNS,
451
+ defaultVisibleColumns: ITEM_TAX_DEFAULT_VISIBLE_COLUMNS
452
+ };
453
+
454
+ // src/reports/dailySales.ts
455
+ var FIRST_COLUMN_WIDTH4 = 240;
456
+ var FIELDS7 = {
457
+ groupById: { type: "string" },
458
+ groupByName: { type: "string", size: FIRST_COLUMN_WIDTH4 },
459
+ itemsQuantity: { type: "number", columnKey: "quantity" },
460
+ salesAmountGross: { type: "money", columnKey: "grossSales" },
461
+ discountsAmount: { type: "money", columnKey: "discountAmount" },
462
+ inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
463
+ salesAmountNet: { type: "money", columnKey: "netSales" },
464
+ salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
465
+ avgPrice: {
466
+ type: "fixedNumber",
467
+ columnKey: "averageGrossPrice",
468
+ footerCalculation: {
469
+ type: "average",
470
+ numeratorField: "salesAmountGross",
471
+ denominatorField: "itemsQuantity"
472
+ }
473
+ },
474
+ ticketsCount: { type: "number", columnKey: "tickets" },
475
+ guestsCount: { type: "number", columnKey: "guests" },
476
+ ticketAverage: {
477
+ type: "money",
478
+ columnKey: "ticketAverage",
479
+ footerCalculation: {
480
+ type: "average",
481
+ numeratorField: "salesAmountNet",
482
+ denominatorField: "ticketsCount"
483
+ }
484
+ },
485
+ guestAverage: {
486
+ type: "money",
487
+ columnKey: "guestAverage",
488
+ footerCalculation: {
489
+ type: "average",
490
+ numeratorField: "salesAmountNet",
491
+ denominatorField: "guestsCount"
492
+ }
493
+ },
494
+ ticketAvg: {
495
+ type: "money",
496
+ columnKey: "ticketAverage",
497
+ footerCalculation: {
498
+ type: "average",
499
+ numeratorField: "salesAmountNet",
500
+ denominatorField: "ticketsCount"
501
+ }
502
+ },
503
+ guestAvg: {
504
+ type: "money",
505
+ columnKey: "guestAverage",
506
+ footerCalculation: {
507
+ type: "average",
508
+ numeratorField: "salesAmountNet",
509
+ denominatorField: "guestsCount"
510
+ }
511
+ }
512
+ };
513
+ var DAILY_SALES_AVAILABLE_COLUMNS = [
514
+ "itemsQuantity",
515
+ "salesAmountGross",
516
+ "discountsAmount",
517
+ "inclusiveTaxesAmount",
518
+ "salesAmountNet",
519
+ "salesMixPct"
520
+ ];
521
+ var DAILY_SALES_BY_GROUP_AVAILABLE_COLUMNS = [
522
+ "ticketsCount",
523
+ "guestsCount",
524
+ "ticketAverage",
525
+ "guestAverage",
526
+ "salesAmountNet"
527
+ ];
528
+ var DAILY_SALES_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_AVAILABLE_COLUMNS;
529
+ var dailySalesConfig = {
530
+ fields: FIELDS7,
531
+ availableColumns: DAILY_SALES_AVAILABLE_COLUMNS,
532
+ defaultVisibleColumns: DAILY_SALES_DEFAULT_VISIBLE_COLUMNS
533
+ };
534
+ var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
535
+ "ticketsCount",
536
+ "guestsCount",
537
+ "ticketAvg",
538
+ "guestAvg",
539
+ "salesAmountNet"
540
+ ];
541
+ var dailySalesTrendsConfig = {
542
+ fields: FIELDS7,
543
+ availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
544
+ defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS
545
+ };
546
+
547
+ // src/reports/dailySalesPayments.ts
548
+ var FIRST_COLUMN_WIDTH5 = 240;
549
+ var FIELDS8 = {
550
+ paymentTypeName: { type: "string", size: FIRST_COLUMN_WIDTH5 },
551
+ paymentsCount: { type: "number", columnKey: "paymentsCount", footerCalculation: { type: "sum" } },
552
+ paymentsAmount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } },
553
+ tipsAmount: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
554
+ totalSales: { type: "money", columnKey: "paymentsTotal", footerCalculation: { type: "sum" } }
555
+ };
556
+ var DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS = [
557
+ "paymentsCount",
558
+ "paymentsAmount",
559
+ "tipsAmount",
560
+ "totalSales"
561
+ ];
562
+ var DAILY_SALES_PAYMENTS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS;
563
+ var dailySalesPaymentsConfig = {
564
+ fields: FIELDS8,
565
+ availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
566
+ defaultVisibleColumns: DAILY_SALES_PAYMENTS_DEFAULT_VISIBLE_COLUMNS
567
+ };
568
+
569
+ // src/reports/dailySalesDiscounts.ts
570
+ var FIRST_COLUMN_WIDTH6 = 240;
571
+ var FIELDS9 = {
572
+ discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH6 },
573
+ discountsCount: { type: "number", columnKey: "discountCount", footerCalculation: { type: "sum" } },
574
+ discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
575
+ };
576
+ var DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS = [
577
+ "discountsCount",
578
+ "discountsAmount"
579
+ ];
580
+ var DAILY_SALES_DISCOUNTS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS;
581
+ var dailySalesDiscountsConfig = {
582
+ fields: FIELDS9,
583
+ availableColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
584
+ defaultVisibleColumns: DAILY_SALES_DISCOUNTS_DEFAULT_VISIBLE_COLUMNS
585
+ };
586
+
587
+ // src/reports/employeeTimecard.ts
588
+ var FIRST_COLUMN_WIDTH7 = 240;
589
+ var EMPLOYEE_NAME_WIDTH = 220;
590
+ var STATUS_WIDTH = 140;
591
+ var LOOKUP_WIDTH = 160;
592
+ var PAYROLL_WIDTH = 160;
593
+ var JOB_WIDTH = 200;
594
+ var FIELDS10 = {
595
+ locationId: {
596
+ type: "number",
597
+ enableSorting: false,
598
+ filteringAvailable: false
599
+ },
600
+ locationName: {
601
+ type: "string",
602
+ size: FIRST_COLUMN_WIDTH7,
603
+ columnKey: "locationName"
604
+ },
605
+ businessDate: {
606
+ type: "date",
607
+ columnKey: "date"
608
+ },
609
+ employeeName: {
610
+ type: "string",
611
+ size: EMPLOYEE_NAME_WIDTH,
612
+ columnKey: "employeeName"
613
+ },
614
+ isActive: {
615
+ type: "string",
616
+ size: STATUS_WIDTH,
617
+ columnKey: "status",
618
+ enableSorting: false,
619
+ filteringAvailable: false
620
+ },
621
+ lookup: {
622
+ type: "string",
623
+ size: LOOKUP_WIDTH,
624
+ columnKey: "employeeId"
625
+ },
626
+ payrollCode: {
627
+ type: "string",
628
+ size: PAYROLL_WIDTH,
629
+ columnKey: "payrollId"
630
+ },
631
+ jobName: {
632
+ type: "string",
633
+ size: JOB_WIDTH,
634
+ columnKey: "employeeJob"
635
+ },
636
+ isBreak: {
637
+ type: "string",
638
+ enableSorting: false,
639
+ filteringAvailable: false
640
+ },
641
+ startTime: {
642
+ type: "string",
643
+ columnKey: "clockInTime"
644
+ },
645
+ endTime: {
646
+ type: "string",
647
+ columnKey: "clockOutTime"
648
+ },
649
+ shiftHours: {
650
+ type: "fixedNumber",
651
+ columnKey: "shiftDurationHrs",
652
+ filteringAvailable: false
653
+ }
654
+ };
655
+ var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
656
+ "locationName",
657
+ "businessDate",
658
+ "employeeName",
659
+ "isActive",
660
+ "lookup",
661
+ "payrollCode",
662
+ "jobName",
663
+ "startTime",
664
+ "endTime",
665
+ "shiftHours"
666
+ ];
667
+ var EMPLOYEE_TIMECARD_DEFAULT_VISIBLE_COLUMNS = EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS;
668
+ var employeeTimecardConfig = {
669
+ fields: FIELDS10,
670
+ availableColumns: EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS,
671
+ defaultVisibleColumns: EMPLOYEE_TIMECARD_DEFAULT_VISIBLE_COLUMNS,
672
+ columnGroups: []
673
+ // No column groups for this report
674
+ };
675
+
676
+ // src/reports/salesByItemDetail.ts
677
+ var FIELDS11 = {
678
+ businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
679
+ ticketClosedAt: { type: "string", columnKey: "ticketClosed", filteringAvailable: false },
680
+ hourId: { type: "number", columnKey: "hour", filteringAvailable: false },
681
+ daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
682
+ locationId: { type: "number", columnKey: "locationId", filteringAvailable: false },
683
+ locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
684
+ departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
685
+ itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
686
+ revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
687
+ revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
688
+ salesAmountGross: { type: "money", columnKey: "grossSales" },
689
+ itemsQuantity: { type: "number", columnKey: "quantity" },
690
+ transactionId: { type: "string", columnKey: "ticketNumber", filteringAvailable: false },
691
+ guestsCount: { type: "number", columnKey: "guestCount" },
692
+ employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
693
+ orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
694
+ salesType: { type: "string", columnKey: "salePaymentType", filteringAvailable: false },
695
+ itemPrice: { type: "money", columnKey: "itemPrice" }
696
+ };
697
+ var SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS = [
698
+ "businessDate",
699
+ "ticketClosedAt",
700
+ "hourId",
701
+ "daypartName",
702
+ "locationId",
703
+ "locationName",
704
+ "departmentName",
705
+ "itemName",
706
+ "revenueCenterName",
707
+ "revenueClassName",
708
+ "salesAmountGross",
709
+ "itemsQuantity",
710
+ "transactionId",
711
+ "guestsCount",
712
+ "employeeName",
713
+ "orderTypeName",
714
+ "salesType",
715
+ "itemPrice"
716
+ ];
717
+ var SALES_BY_ITEM_DETAIL_DEFAULT_VISIBLE_COLUMNS = SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS;
718
+ var salesByItemDetailConfig = {
719
+ fields: FIELDS11,
720
+ availableColumns: SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS,
721
+ defaultVisibleColumns: SALES_BY_ITEM_DETAIL_DEFAULT_VISIBLE_COLUMNS
722
+ };
723
+
724
+ // src/report.ts
725
+ var Report = {
726
+ TICKET_LIVE: "ticket-live",
727
+ TICKET_ANALYTICS: "ticket-analytics",
728
+ SALES_SUMMARY: "sales-summary",
729
+ PRODUCT_MIX: "product-mix",
730
+ MODIFIER_MIX: "modifier-mix",
731
+ ITEM_TAX: "item-tax",
732
+ EMPLOYEE_TIMECARD: "employee-timecard",
733
+ EMPLOYEE_TIP: "employee-tip",
734
+ SALES_BY_ITEM: "sales-by-item"
735
+ };
736
+ var REPORT_CONFIG_MAP = {
737
+ "sales-summary": salesSummaryConfig,
738
+ "ticket-analytics": ticketSummaryConfig,
739
+ "ticket-live": ticketLiveConfig,
740
+ "product-mix": productMixConfig,
741
+ "modifier-mix": modifierMixConfig,
742
+ "item-tax": itemTaxConfig,
743
+ "employee-timecard": employeeTimecardConfig,
744
+ "employee-tip": null,
745
+ "sales-by-item": salesByItemDetailConfig
746
+ };
747
+ var getReportConfig = (reportType) => REPORT_CONFIG_MAP[reportType];
748
+
749
+ // src/columns/index.ts
750
+ var COLUMN_REGISTRY = {
751
+ fifteenMinInterval: {
752
+ titleKey: "common.report-col.fifteen-min-interval",
753
+ shortTitleKey: "common.report-col.fifteen-min-interval.short",
754
+ infoTextKey: "common.report-col.fifteen-min-interval.info"
755
+ },
756
+ adjustedTips: {
757
+ titleKey: "common.report-col.adjusted-tips",
758
+ shortTitleKey: "common.report-col.adjusted-tips.short",
759
+ infoTextKey: "common.report-col.adjusted-tips.info"
760
+ },
761
+ advantageProgram: {
762
+ titleKey: "common.report-col.advantage-program",
763
+ shortTitleKey: "common.report-col.advantage-program.short",
764
+ infoTextKey: "common.report-col.advantage-program.info"
765
+ },
766
+ amex: {
767
+ titleKey: "common.report-col.amex",
768
+ shortTitleKey: "common.report-col.amex.short",
769
+ infoTextKey: "common.report-col.amex.info"
770
+ },
771
+ amexReturns: {
772
+ titleKey: "common.report-col.amex-returns",
773
+ shortTitleKey: "common.report-col.amex-returns.short",
774
+ infoTextKey: "common.report-col.amex-returns.info"
775
+ },
776
+ attachRate: {
777
+ titleKey: "common.report-col.attach-rate",
778
+ shortTitleKey: "common.report-col.attach-rate.short",
779
+ infoTextKey: "common.report-col.attach-rate.info"
780
+ },
781
+ autoGratuity: {
782
+ titleKey: "common.report-col.auto-gratuity",
783
+ shortTitleKey: "common.report-col.auto-gratuity.short",
784
+ infoTextKey: "common.report-col.auto-gratuity.info"
785
+ },
786
+ averageGrossPrice: {
787
+ titleKey: "common.report-col.average-gross-price",
788
+ shortTitleKey: "common.report-col.average-gross-price.short",
789
+ infoTextKey: "common.report-col.average-gross-price.info"
790
+ },
791
+ bankFees: {
792
+ titleKey: "common.report-col.bank-fees",
793
+ shortTitleKey: "common.report-col.bank-fees.short",
794
+ infoTextKey: "common.report-col.bank-fees.info"
795
+ },
796
+ batchAmount: {
797
+ titleKey: "common.report-col.batch-amount",
798
+ shortTitleKey: "common.report-col.batch-amount.short",
799
+ infoTextKey: "common.report-col.batch-amount.info"
800
+ },
801
+ batchDate: {
802
+ titleKey: "common.report-col.batch-date",
803
+ shortTitleKey: "common.report-col.batch-date.short",
804
+ infoTextKey: "common.report-col.batch-date.info"
805
+ },
806
+ batchNumber: {
807
+ titleKey: "common.report-col.batch-number",
808
+ shortTitleKey: "common.report-col.batch-number.short",
809
+ infoTextKey: "common.report-col.batch-number.info"
810
+ },
811
+ clockInTime: {
812
+ titleKey: "common.report-col.clock-in-time",
813
+ shortTitleKey: "common.report-col.clock-in-time.short",
814
+ infoTextKey: "common.report-col.clock-in-time.info"
815
+ },
816
+ clockOutTime: {
817
+ titleKey: "common.report-col.clock-out-time",
818
+ shortTitleKey: "common.report-col.clock-out-time.short",
819
+ infoTextKey: "common.report-col.clock-out-time.info"
820
+ },
821
+ country: {
822
+ titleKey: "common.report-col.country",
823
+ shortTitleKey: "common.report-col.country.short",
824
+ infoTextKey: "common.report-col.country.info"
825
+ },
826
+ customerName: {
827
+ titleKey: "common.report-col.customer-name",
828
+ shortTitleKey: "common.report-col.customer-name.short",
829
+ infoTextKey: "common.report-col.customer-name.info"
830
+ },
831
+ date: {
832
+ titleKey: "common.report-col.date",
833
+ shortTitleKey: "common.report-col.date.short",
834
+ infoTextKey: "common.report-col.date.info"
835
+ },
836
+ dateClose: {
837
+ titleKey: "common.report-col.date-close",
838
+ shortTitleKey: "common.report-col.date-close.short",
839
+ infoTextKey: "common.report-col.date-close.info"
840
+ },
841
+ daypart: {
842
+ titleKey: "common.report-col.daypart",
843
+ shortTitleKey: "common.report-col.daypart.short",
844
+ infoTextKey: "common.report-col.daypart.info"
845
+ },
846
+ debit: {
847
+ titleKey: "common.report-col.debit",
848
+ shortTitleKey: "common.report-col.debit.short",
849
+ infoTextKey: "common.report-col.debit.info"
850
+ },
851
+ debitReturns: {
852
+ titleKey: "common.report-col.debit-returns",
853
+ shortTitleKey: "common.report-col.debit-returns.short",
854
+ infoTextKey: "common.report-col.debit-returns.info"
855
+ },
856
+ declaredTips: {
857
+ titleKey: "common.report-col.declared-tips",
858
+ shortTitleKey: "common.report-col.declared-tips.short",
859
+ infoTextKey: "common.report-col.declared-tips.info"
860
+ },
861
+ department: {
862
+ titleKey: "common.report-col.department",
863
+ shortTitleKey: "common.report-col.department.short",
864
+ infoTextKey: "common.report-col.department.info"
865
+ },
866
+ depositCurrency: {
867
+ titleKey: "common.report-col.deposit-currency",
868
+ shortTitleKey: "common.report-col.deposit-currency.short",
869
+ infoTextKey: "common.report-col.deposit-currency.info"
870
+ },
871
+ depositDate: {
872
+ titleKey: "common.report-col.deposit-date",
873
+ shortTitleKey: "common.report-col.deposit-date.short",
874
+ infoTextKey: "common.report-col.deposit-date.info"
875
+ },
876
+ discountAmount: {
877
+ titleKey: "common.report-col.discount-amount",
878
+ shortTitleKey: "common.report-col.discount-amount.short",
879
+ infoTextKey: "common.report-col.discount-amount.info"
880
+ },
881
+ discountCount: {
882
+ titleKey: "common.report-col.discount-count",
883
+ shortTitleKey: "common.report-col.discount-count.short",
884
+ infoTextKey: "common.report-col.discount-count.info"
885
+ },
886
+ discover: {
887
+ titleKey: "common.report-col.discover",
888
+ shortTitleKey: "common.report-col.discover.short",
889
+ infoTextKey: "common.report-col.discover.info"
890
+ },
891
+ discoverReturns: {
892
+ titleKey: "common.report-col.discover-returns",
893
+ shortTitleKey: "common.report-col.discover-returns.short",
894
+ infoTextKey: "common.report-col.discover-returns.info"
895
+ },
896
+ ebt: {
897
+ titleKey: "common.report-col.ebt",
898
+ shortTitleKey: "common.report-col.ebt.short",
899
+ infoTextKey: "common.report-col.ebt.info"
900
+ },
901
+ ebtReturns: {
902
+ titleKey: "common.report-col.ebt-returns",
903
+ shortTitleKey: "common.report-col.ebt-returns.short",
904
+ infoTextKey: "common.report-col.ebt-returns.info"
905
+ },
906
+ employeeId: {
907
+ titleKey: "common.report-col.employee-id",
908
+ shortTitleKey: "common.report-col.employee-id.short",
909
+ infoTextKey: "common.report-col.employee-id.info"
175
910
  },
176
911
  employeeJob: {
177
912
  titleKey: "common.report-col.employee-job",
@@ -448,879 +1183,293 @@ var COLUMN_REGISTRY = {
448
1183
  shortTitleKey: "common.report-col.shift-duration-hrs.short",
449
1184
  infoTextKey: "common.report-col.shift-duration-hrs.info"
450
1185
  },
451
- salePaymentType: {
452
- titleKey: "common.report-col.sale-payment-type",
453
- shortTitleKey: "common.report-col.sale-payment-type.short",
454
- infoTextKey: "common.report-col.sale-payment-type.info"
455
- },
456
- status: {
457
- titleKey: "common.report-col.status",
458
- shortTitleKey: "common.report-col.status.short",
459
- infoTextKey: "common.report-col.status.info"
460
- },
461
- subtotal: {
462
- titleKey: "common.report-col.subtotal",
463
- shortTitleKey: "common.report-col.subtotal.short",
464
- infoTextKey: "common.report-col.subtotal.info"
465
- },
466
- taxCollected: {
467
- titleKey: "common.report-col.tax-collected",
468
- shortTitleKey: "common.report-col.tax-collected.short",
469
- infoTextKey: "common.report-col.tax-collected.info"
470
- },
471
- taxName: {
472
- titleKey: "common.report-col.tax-name",
473
- shortTitleKey: "common.report-col.tax-name.short",
474
- infoTextKey: "common.report-col.tax-name.info"
475
- },
476
- taxRate: {
477
- titleKey: "common.report-col.tax-rate",
478
- shortTitleKey: "common.report-col.tax-rate.short",
479
- infoTextKey: "common.report-col.tax-rate.info"
480
- },
481
- taxableSales: {
482
- titleKey: "common.report-col.taxable-sales",
483
- shortTitleKey: "common.report-col.taxable-sales.short",
484
- infoTextKey: "common.report-col.taxable-sales.info"
485
- },
486
- ticketClosed: {
487
- titleKey: "common.report-col.ticket-closed",
488
- shortTitleKey: "common.report-col.ticket-closed.short",
489
- infoTextKey: "common.report-col.ticket-closed.info"
490
- },
491
- ticketFee: {
492
- titleKey: "common.report-col.ticket-fee",
493
- shortTitleKey: "common.report-col.ticket-fee.short",
494
- infoTextKey: "common.report-col.ticket-fee.info"
495
- },
496
- ticketNumber: {
497
- titleKey: "common.report-col.ticket-number",
498
- shortTitleKey: "common.report-col.ticket-number.short",
499
- infoTextKey: "common.report-col.ticket-number.info"
500
- },
501
- ticketOpen: {
502
- titleKey: "common.report-col.ticket-open",
503
- shortTitleKey: "common.report-col.ticket-open.short",
504
- infoTextKey: "common.report-col.ticket-open.info"
505
- },
506
- ticketTotal: {
507
- titleKey: "common.report-col.ticket-total",
508
- shortTitleKey: "common.report-col.ticket-total.short",
509
- infoTextKey: "common.report-col.ticket-total.info"
510
- },
511
- timeOpenMins: {
512
- titleKey: "common.report-col.time-open-mins",
513
- shortTitleKey: "common.report-col.time-open-mins.short",
514
- infoTextKey: "common.report-col.time-open-mins.info"
515
- },
516
- tipPct: {
517
- titleKey: "common.report-col.tip-pct",
518
- shortTitleKey: "common.report-col.tip-pct.short",
519
- infoTextKey: "common.report-col.tip-pct.info"
520
- },
521
- tipReduction: {
522
- titleKey: "common.report-col.tip-reduction",
523
- shortTitleKey: "common.report-col.tip-reduction.short",
524
- infoTextKey: "common.report-col.tip-reduction.info"
525
- },
526
- tipShare: {
527
- titleKey: "common.report-col.tip-share",
528
- shortTitleKey: "common.report-col.tip-share.short",
529
- infoTextKey: "common.report-col.tip-share.info"
530
- },
531
- tips: {
532
- titleKey: "common.report-col.tips",
533
- shortTitleKey: "common.report-col.tips.short",
534
- infoTextKey: "common.report-col.tips.info"
535
- },
536
- tipsPerHour: {
537
- titleKey: "common.report-col.tips-per-hour",
538
- shortTitleKey: "common.report-col.tips-per-hour.short",
539
- infoTextKey: "common.report-col.tips-per-hour.info"
540
- },
541
- totalCollected: {
542
- titleKey: "common.report-col.total-collected",
543
- shortTitleKey: "common.report-col.total-collected.short",
544
- infoTextKey: "common.report-col.total-collected.info"
545
- },
546
- totalItemSales: {
547
- titleKey: "common.report-col.total-item-sales",
548
- shortTitleKey: "common.report-col.total-item-sales.short",
549
- infoTextKey: "common.report-col.total-item-sales.info"
550
- },
551
- totalModifierSales: {
552
- titleKey: "common.report-col.total-modifier-sales",
553
- shortTitleKey: "common.report-col.total-modifier-sales.short",
554
- infoTextKey: "common.report-col.total-modifier-sales.info"
555
- },
556
- totalReturns: {
557
- titleKey: "common.report-col.total-returns",
558
- shortTitleKey: "common.report-col.total-returns.short",
559
- infoTextKey: "common.report-col.total-returns.info"
560
- },
561
- totalSales: {
562
- titleKey: "common.report-col.total-sales",
563
- shortTitleKey: "common.report-col.total-sales.short",
564
- infoTextKey: "common.report-col.total-sales.info"
565
- },
566
- totalTips: {
567
- titleKey: "common.report-col.total-tips",
568
- shortTitleKey: "common.report-col.total-tips.short",
569
- infoTextKey: "common.report-col.total-tips.info"
570
- },
571
- transactionDate: {
572
- titleKey: "common.report-col.transaction-date",
573
- shortTitleKey: "common.report-col.transaction-date.short",
574
- infoTextKey: "common.report-col.transaction-date.info"
575
- },
576
- transactionType: {
577
- titleKey: "common.report-col.transaction-type",
578
- shortTitleKey: "common.report-col.transaction-type.short",
579
- infoTextKey: "common.report-col.transaction-type.info"
580
- },
581
- untaxedSales: {
582
- titleKey: "common.report-col.untaxed-sales",
583
- shortTitleKey: "common.report-col.untaxed-sales.short",
584
- infoTextKey: "common.report-col.untaxed-sales.info"
585
- },
586
- visa: {
587
- titleKey: "common.report-col.visa",
588
- shortTitleKey: "common.report-col.visa.short",
589
- infoTextKey: "common.report-col.visa.info"
590
- },
591
- visaReturns: {
592
- titleKey: "common.report-col.visa-returns",
593
- shortTitleKey: "common.report-col.visa-returns.short",
594
- infoTextKey: "common.report-col.visa-returns.info"
595
- },
596
- paymentsCount: {
597
- titleKey: "common.report-col.payments-count",
598
- shortTitleKey: "common.report-col.payments-count.short",
599
- infoTextKey: "common.report-col.payments-count.info"
600
- },
601
- paymentsAmount: {
602
- titleKey: "common.report-col.payments-amount",
603
- shortTitleKey: "common.report-col.payments-amount.short",
604
- infoTextKey: "common.report-col.payments-amount.info"
605
- },
606
- paymentsTotal: {
607
- titleKey: "common.report-col.payments-total",
608
- shortTitleKey: "common.report-col.payments-total.short",
609
- infoTextKey: "common.report-col.payments-total.info"
610
- },
611
- refundVoidDescription: {
612
- titleKey: "common.report-col.refund-void-description",
613
- shortTitleKey: "common.report-col.refund-void-description.short",
614
- infoTextKey: "common.report-col.refund-void-description.info"
615
- },
616
- refundVoidCount: {
617
- titleKey: "common.report-col.refund-void-count",
618
- shortTitleKey: "common.report-col.refund-void-count.short",
619
- infoTextKey: "common.report-col.refund-void-count.info"
620
- },
621
- refundVoidAmount: {
622
- titleKey: "common.report-col.refund-void-amount",
623
- shortTitleKey: "common.report-col.refund-void-amount.short",
624
- infoTextKey: "common.report-col.refund-void-amount.info"
625
- },
626
- refundVoidPctSales: {
627
- titleKey: "common.report-col.refund-void-pct-sales",
628
- shortTitleKey: "common.report-col.refund-void-pct-sales.short",
629
- infoTextKey: "common.report-col.refund-void-pct-sales.info"
630
- },
631
- discountName: {
632
- titleKey: "common.report-col.discount-name",
633
- shortTitleKey: "common.report-col.discount-name.short",
634
- infoTextKey: "common.report-col.discount-name.info"
635
- },
636
- tickets: {
637
- titleKey: "common.report-col.tickets",
638
- shortTitleKey: "common.report-col.tickets.short",
639
- infoTextKey: "common.report-col.tickets.info"
640
- },
641
- guests: {
642
- titleKey: "common.report-col.guests",
643
- shortTitleKey: "common.report-col.guests.short",
644
- infoTextKey: "common.report-col.guests.info"
645
- },
646
- ticketAverage: {
647
- titleKey: "common.report-col.ticket-average",
648
- shortTitleKey: "common.report-col.ticket-average.short",
649
- infoTextKey: "common.report-col.ticket-average.info"
650
- },
651
- guestAverage: {
652
- titleKey: "common.report-col.guest-average",
653
- shortTitleKey: "common.report-col.guest-average.short",
654
- infoTextKey: "common.report-col.guest-average.info"
1186
+ salePaymentType: {
1187
+ titleKey: "common.report-col.sale-payment-type",
1188
+ shortTitleKey: "common.report-col.sale-payment-type.short",
1189
+ infoTextKey: "common.report-col.sale-payment-type.info"
655
1190
  },
656
- net: {
657
- titleKey: "common.report-col.net",
658
- shortTitleKey: "common.report-col.net.short",
659
- infoTextKey: "common.report-col.net.info"
660
- }
661
- };
662
- function getColumnMetadata(key) {
663
- return COLUMN_REGISTRY[key];
664
- }
665
-
666
- // src/utils/alignment.ts
667
- function getColumnAlignment(type) {
668
- if (type === "string" || type === "date" || type === "time") {
669
- return "left";
670
- }
671
- return "right";
672
- }
673
- function isNumericType(type) {
674
- return type === "money" || type === "number" || type === "percent" || type === "fixedNumber";
675
- }
676
-
677
- // src/totals.ts
678
- function calculateReportTotals(data, fieldConfig, opts) {
679
- const rows = data;
680
- const { labelField, label } = opts;
681
- const fieldsToSum = /* @__PURE__ */ new Set();
682
- const derivedFields = [];
683
- for (const [field, config] of Object.entries(fieldConfig)) {
684
- const { type, columnKey, footerCalculation: calc } = config;
685
- if (!type || type === "string" || type === "date" || type === "time" || type === "boolean") {
686
- continue;
687
- }
688
- if (calc?.type === "none") {
689
- } else if (!calc || calc.type === "sum") {
690
- if (columnKey || calc?.type === "sum") {
691
- fieldsToSum.add(field);
692
- }
693
- } else {
694
- derivedFields.push({ field, calc });
695
- if (calc.numeratorField) fieldsToSum.add(calc.numeratorField);
696
- if (calc.denominatorField) fieldsToSum.add(calc.denominatorField);
697
- }
698
- }
699
- const sums = {};
700
- for (const field of fieldsToSum) {
701
- sums[field] = rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
702
- }
703
- const derived = {};
704
- for (const { field, calc } of derivedFields) {
705
- const num = sums[calc.numeratorField ?? ""] ?? 0;
706
- const den = sums[calc.denominatorField ?? ""] ?? 0;
707
- if (calc.type === "percentChange") {
708
- derived[field] = den ? (num - den) / den : 0;
709
- } else if (calc.type === "average") {
710
- derived[field] = den > 0 ? num / den : 0;
711
- }
712
- }
713
- const result = {};
714
- for (const [field, config] of Object.entries(fieldConfig)) {
715
- const { type } = config;
716
- if (!type || type === "string" || type === "date" || type === "time") {
717
- result[field] = "";
718
- } else if (type === "boolean") {
719
- result[field] = false;
720
- } else {
721
- result[field] = 0;
722
- }
723
- }
724
- result[labelField] = label;
725
- for (const [field, value] of Object.entries(sums)) {
726
- result[field] = value;
727
- }
728
- for (const [field, value] of Object.entries(derived)) {
729
- result[field] = value;
730
- }
731
- return result;
732
- }
733
-
734
- // src/reports/salesSummary.ts
735
- var FIRST_COLUMN_WIDTH = 240;
736
- var FIELDS = {
737
- groupById: { type: "number" },
738
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
739
- salesAmountNet: { type: "money", columnKey: "netSales" },
740
- salesVarLW: { type: "money", columnKey: "salesVarLw" },
741
- salesVarLY: { type: "money", columnKey: "salesVarLy" },
742
- salesVarLWPct: {
743
- type: "percent",
744
- columnKey: "salesVarLwPct",
745
- footerCalculation: {
746
- type: "percentChange",
747
- numeratorField: "salesAmountNet",
748
- denominatorField: "salesAmountNetLastWeek"
749
- }
1191
+ status: {
1192
+ titleKey: "common.report-col.status",
1193
+ shortTitleKey: "common.report-col.status.short",
1194
+ infoTextKey: "common.report-col.status.info"
750
1195
  },
751
- salesVarLYPct: {
752
- type: "percent",
753
- columnKey: "salesVarLyPct",
754
- footerCalculation: {
755
- type: "percentChange",
756
- numeratorField: "salesAmountNet",
757
- denominatorField: "salesAmountNetLastYear"
758
- }
1196
+ subtotal: {
1197
+ titleKey: "common.report-col.subtotal",
1198
+ shortTitleKey: "common.report-col.subtotal.short",
1199
+ infoTextKey: "common.report-col.subtotal.info"
759
1200
  },
760
- salesAmountNetLastWeek: { type: "money" },
761
- salesAmountNetLastYear: { type: "money" },
762
- salesAmountGross: { type: "money" },
763
- salesAmountGrossLastWeek: { type: "money" },
764
- salesAmountGrossLastYear: { type: "money" },
765
- ticketsCount: { type: "number" },
766
- ticketsCountLastWeek: { type: "number" },
767
- ticketsCountLastYear: { type: "number" },
768
- guestsCount: { type: "number", columnKey: "guestCount" },
769
- guestsVarLW: { type: "number", columnKey: "guestsVarLw" },
770
- guestsVarLY: { type: "number", columnKey: "guestsVarLy" },
771
- guestsVarLWPct: {
772
- type: "percent",
773
- columnKey: "guestsVarLwPct",
774
- footerCalculation: {
775
- type: "percentChange",
776
- numeratorField: "guestsCount",
777
- denominatorField: "guestsCountLastWeek"
778
- }
1201
+ taxCollected: {
1202
+ titleKey: "common.report-col.tax-collected",
1203
+ shortTitleKey: "common.report-col.tax-collected.short",
1204
+ infoTextKey: "common.report-col.tax-collected.info"
779
1205
  },
780
- guestsVarLYPct: {
781
- type: "percent",
782
- columnKey: "guestsVarLyPct",
783
- footerCalculation: {
784
- type: "percentChange",
785
- numeratorField: "guestsCount",
786
- denominatorField: "guestsCountLastYear"
787
- }
1206
+ taxName: {
1207
+ titleKey: "common.report-col.tax-name",
1208
+ shortTitleKey: "common.report-col.tax-name.short",
1209
+ infoTextKey: "common.report-col.tax-name.info"
788
1210
  },
789
- guestsCountLastWeek: { type: "number" },
790
- guestsCountLastYear: { type: "number" },
791
- salesPerGuestTY: {
792
- type: "money",
793
- columnKey: "salesPerGuest",
794
- footerCalculation: {
795
- type: "average",
796
- numeratorField: "salesAmountNet",
797
- denominatorField: "guestsCount"
798
- }
1211
+ taxRate: {
1212
+ titleKey: "common.report-col.tax-rate",
1213
+ shortTitleKey: "common.report-col.tax-rate.short",
1214
+ infoTextKey: "common.report-col.tax-rate.info"
799
1215
  },
800
- salesPerGuestLW: {
801
- type: "money",
802
- columnKey: "salesPerGuestLw",
803
- footerCalculation: {
804
- type: "average",
805
- numeratorField: "salesAmountNetLastWeek",
806
- denominatorField: "guestsCountLastWeek"
807
- }
1216
+ taxableSales: {
1217
+ titleKey: "common.report-col.taxable-sales",
1218
+ shortTitleKey: "common.report-col.taxable-sales.short",
1219
+ infoTextKey: "common.report-col.taxable-sales.info"
808
1220
  },
809
- salesPerGuestLY: {
810
- type: "money",
811
- columnKey: "salesPerGuestLy",
812
- footerCalculation: {
813
- type: "average",
814
- numeratorField: "salesAmountNetLastYear",
815
- denominatorField: "guestsCountLastYear"
816
- }
817
- }
818
- };
819
- var COLUMN_GROUPS = [
820
- {
821
- id: "sales",
822
- headerTranslationKey: "table.groups.sales",
823
- baseFields: ["salesAmountNet"],
824
- lastWeekFields: ["salesVarLW", "salesVarLWPct"],
825
- lastYearFields: ["salesVarLY", "salesVarLYPct"]
1221
+ ticketClosed: {
1222
+ titleKey: "common.report-col.ticket-closed",
1223
+ shortTitleKey: "common.report-col.ticket-closed.short",
1224
+ infoTextKey: "common.report-col.ticket-closed.info"
826
1225
  },
827
- {
828
- id: "guests",
829
- headerTranslationKey: "table.groups.guests",
830
- baseFields: ["guestsCount"],
831
- lastWeekFields: ["guestsVarLW", "guestsVarLWPct"],
832
- lastYearFields: ["guestsVarLY", "guestsVarLYPct"]
1226
+ ticketFee: {
1227
+ titleKey: "common.report-col.ticket-fee",
1228
+ shortTitleKey: "common.report-col.ticket-fee.short",
1229
+ infoTextKey: "common.report-col.ticket-fee.info"
833
1230
  },
834
- {
835
- id: "salesPerGuest",
836
- headerTranslationKey: "table.groups.sales-per-guest",
837
- baseFields: ["salesPerGuestTY"],
838
- lastWeekFields: ["salesPerGuestLW"],
839
- lastYearFields: ["salesPerGuestLY"]
840
- }
841
- ];
842
- var SALES_SUMMARY_AVAILABLE_COLUMNS = [
843
- "salesAmountNet",
844
- "salesVarLW",
845
- "salesVarLWPct",
846
- "salesVarLY",
847
- "salesVarLYPct",
848
- "guestsCount",
849
- "guestsVarLW",
850
- "guestsVarLWPct",
851
- "guestsVarLY",
852
- "guestsVarLYPct",
853
- "salesPerGuestTY",
854
- "salesPerGuestLW",
855
- "salesPerGuestLY"
856
- ];
857
- var SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS = [
858
- "salesAmountNet",
859
- "guestsCount",
860
- "salesPerGuestTY"
861
- ];
862
- var salesSummaryConfig = {
863
- fields: FIELDS,
864
- availableColumns: SALES_SUMMARY_AVAILABLE_COLUMNS,
865
- defaultVisibleColumns: SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS,
866
- columnGroups: COLUMN_GROUPS
867
- };
868
-
869
- // src/reports/ticketSummary.ts
870
- var FIELDS2 = {
871
- ticketId: { type: "string" },
872
- locationId: { type: "number" },
873
- orderName: { type: "string" },
874
- revenueCenterName: { type: "string", columnKey: "revenueCenter" },
875
- daypartName: { type: "string", columnKey: "daypart" },
876
- inclusiveTaxesAmount: {
877
- type: "money",
878
- columnKey: "inclusiveTax",
879
- footerCalculation: { type: "sum" }
1231
+ ticketNumber: {
1232
+ titleKey: "common.report-col.ticket-number",
1233
+ shortTitleKey: "common.report-col.ticket-number.short",
1234
+ infoTextKey: "common.report-col.ticket-number.info"
880
1235
  },
881
- locationName: { type: "string", size: 240, columnKey: "locationName" },
882
- orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "none" } },
883
- businessDate: { type: "date", columnKey: "date" },
884
- ticketOpenedAt: { type: "time", columnKey: "ticketOpen" },
885
- ticketClosedAt: { type: "time", columnKey: "ticketClosed" },
886
- ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false },
887
- ticketSubtotal: {
888
- type: "money",
889
- columnKey: "subtotal",
890
- footerCalculation: { type: "sum" }
1236
+ ticketOpen: {
1237
+ titleKey: "common.report-col.ticket-open",
1238
+ shortTitleKey: "common.report-col.ticket-open.short",
1239
+ infoTextKey: "common.report-col.ticket-open.info"
891
1240
  },
892
- discountsAmount: {
893
- type: "money",
894
- columnKey: "discountAmount",
895
- footerCalculation: { type: "sum" }
1241
+ ticketTotal: {
1242
+ titleKey: "common.report-col.ticket-total",
1243
+ shortTitleKey: "common.report-col.ticket-total.short",
1244
+ infoTextKey: "common.report-col.ticket-total.info"
896
1245
  },
897
- surchargesAmount: {
898
- type: "money",
899
- columnKey: "ticketFee",
900
- footerCalculation: { type: "sum" }
1246
+ timeOpenMins: {
1247
+ titleKey: "common.report-col.time-open-mins",
1248
+ shortTitleKey: "common.report-col.time-open-mins.short",
1249
+ infoTextKey: "common.report-col.time-open-mins.info"
901
1250
  },
902
- taxesAmount: {
903
- type: "money",
904
- columnKey: "taxCollected",
905
- footerCalculation: { type: "sum" }
1251
+ tipPct: {
1252
+ titleKey: "common.report-col.tip-pct",
1253
+ shortTitleKey: "common.report-col.tip-pct.short",
1254
+ infoTextKey: "common.report-col.tip-pct.info"
906
1255
  },
907
- ticketGrandTotal: {
908
- type: "money",
909
- columnKey: "grandTotal",
910
- footerCalculation: { type: "sum" }
1256
+ tipReduction: {
1257
+ titleKey: "common.report-col.tip-reduction",
1258
+ shortTitleKey: "common.report-col.tip-reduction.short",
1259
+ infoTextKey: "common.report-col.tip-reduction.info"
911
1260
  },
912
- gratuitiesAmount: {
913
- type: "money",
914
- columnKey: "autoGratuity",
915
- footerCalculation: { type: "sum" }
1261
+ tipShare: {
1262
+ titleKey: "common.report-col.tip-share",
1263
+ shortTitleKey: "common.report-col.tip-share.short",
1264
+ infoTextKey: "common.report-col.tip-share.info"
916
1265
  },
917
- tipAmount: {
918
- type: "money",
919
- columnKey: "tips",
920
- footerCalculation: { type: "sum" }
1266
+ tips: {
1267
+ titleKey: "common.report-col.tips",
1268
+ shortTitleKey: "common.report-col.tips.short",
1269
+ infoTextKey: "common.report-col.tips.info"
921
1270
  },
922
- paymentsAmount: {
923
- type: "money",
924
- columnKey: "totalCollected",
925
- footerCalculation: { type: "sum" }
1271
+ tipsPerHour: {
1272
+ titleKey: "common.report-col.tips-per-hour",
1273
+ shortTitleKey: "common.report-col.tips-per-hour.short",
1274
+ infoTextKey: "common.report-col.tips-per-hour.info"
926
1275
  },
927
- paymentTypeName: { type: "string", columnKey: "paymentType" },
928
- guestsCount: {
929
- type: "number",
930
- columnKey: "guestCount",
931
- footerCalculation: { type: "sum" }
1276
+ totalCollected: {
1277
+ titleKey: "common.report-col.total-collected",
1278
+ shortTitleKey: "common.report-col.total-collected.short",
1279
+ infoTextKey: "common.report-col.total-collected.info"
932
1280
  },
933
- employeeName: { type: "string", columnKey: "employeeName" },
934
- orderTypeName: { type: "string", columnKey: "orderType" }
935
- };
936
- var TICKET_SUMMARY_AVAILABLE_COLUMNS = [
937
- "locationName",
938
- "orderNumber",
939
- "businessDate",
940
- "ticketOpenedAt",
941
- "ticketClosedAt",
942
- "ticketTime",
943
- "ticketSubtotal",
944
- "discountsAmount",
945
- "surchargesAmount",
946
- "taxesAmount",
947
- "ticketGrandTotal",
948
- "gratuitiesAmount",
949
- "tipAmount",
950
- "paymentsAmount",
951
- "paymentTypeName",
952
- "guestsCount",
953
- "employeeName",
954
- "orderTypeName"
955
- ];
956
- var TICKET_SUMMARY_DEFAULT_VISIBLE_COLUMNS = TICKET_SUMMARY_AVAILABLE_COLUMNS;
957
- var ticketSummaryConfig = {
958
- fields: FIELDS2,
959
- availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
960
- defaultVisibleColumns: TICKET_SUMMARY_DEFAULT_VISIBLE_COLUMNS
961
- };
962
-
963
- // src/reports/ticketLive.ts
964
- var FIELDS3 = {
965
- locationName: { type: "string", columnKey: "locationName" },
966
- orderNumber: {
967
- type: "number",
968
- columnKey: "ticketNumber",
969
- footerCalculation: { type: "none" }
1281
+ totalItemSales: {
1282
+ titleKey: "common.report-col.total-item-sales",
1283
+ shortTitleKey: "common.report-col.total-item-sales.short",
1284
+ infoTextKey: "common.report-col.total-item-sales.info"
970
1285
  },
971
- dateOpen: { type: "string", columnKey: "date" },
972
- timeOpen: { type: "string", columnKey: "ticketOpen" },
973
- dateClose: { type: "string", columnKey: "dateClose" },
974
- timeClose: { type: "string", columnKey: "ticketClosed" },
975
- durationMinutes: { type: "number", columnKey: "timeOpenMins" },
976
- subtotal: { type: "money", columnKey: "subtotal" },
977
- discountTotal: { type: "money", columnKey: "discountAmount" },
978
- surchargeTotal: { type: "money", columnKey: "ticketFee" },
979
- taxTotal: { type: "money", columnKey: "taxCollected" },
980
- grandTotal: { type: "money", columnKey: "grandTotal" },
981
- gratuityTotal: { type: "money", columnKey: "autoGratuity" },
982
- totalTips: { type: "money", columnKey: "totalTips" },
983
- paymentsReceived: { type: "money", columnKey: "totalCollected" },
984
- paymentTypeName: { type: "string", columnKey: "paymentType" },
985
- guestCount: {
986
- type: "number",
987
- columnKey: "guestCount",
988
- footerCalculation: { type: "sum" }
1286
+ totalModifierSales: {
1287
+ titleKey: "common.report-col.total-modifier-sales",
1288
+ shortTitleKey: "common.report-col.total-modifier-sales.short",
1289
+ infoTextKey: "common.report-col.total-modifier-sales.info"
989
1290
  },
990
- customerName: { type: "string", columnKey: "customerName" },
991
- employeeName: { type: "string", columnKey: "employeeName" },
992
- orderType: { type: "string", columnKey: "orderType" }
993
- };
994
- var TICKET_LIVE_AVAILABLE_COLUMNS = [
995
- "locationName",
996
- "orderNumber",
997
- "dateOpen",
998
- "timeOpen",
999
- "timeClose",
1000
- "durationMinutes",
1001
- "subtotal",
1002
- "discountTotal",
1003
- "surchargeTotal",
1004
- "taxTotal",
1005
- "grandTotal",
1006
- "gratuityTotal",
1007
- "totalTips",
1008
- "paymentsReceived",
1009
- "paymentTypeName",
1010
- "guestCount",
1011
- "employeeName",
1012
- "orderType"
1013
- ];
1014
- var TICKET_LIVE_DEFAULT_VISIBLE_COLUMNS = TICKET_LIVE_AVAILABLE_COLUMNS;
1015
- var ticketLiveConfig = {
1016
- fields: FIELDS3,
1017
- availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
1018
- defaultVisibleColumns: TICKET_LIVE_DEFAULT_VISIBLE_COLUMNS
1019
- };
1020
-
1021
- // src/reports/productMix.ts
1022
- var FIRST_COLUMN_WIDTH2 = 240;
1023
- var FIELDS4 = {
1024
- groupById: { type: "string" },
1025
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH2 },
1026
- salesAmountGross: { type: "money", columnKey: "grossSales" },
1027
- discountsAmount: { type: "money", columnKey: "discountAmount" },
1028
- inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
1029
- salesAmountNet: { type: "money", columnKey: "netSales" },
1030
- itemsQuantity: { type: "fixedNumber", columnKey: "quantity" },
1031
- avgPrice: {
1032
- type: "fixedNumber",
1033
- columnKey: "averageGrossPrice",
1034
- footerCalculation: {
1035
- type: "average",
1036
- numeratorField: "salesAmountGross",
1037
- denominatorField: "itemsQuantity"
1038
- }
1291
+ totalReturns: {
1292
+ titleKey: "common.report-col.total-returns",
1293
+ shortTitleKey: "common.report-col.total-returns.short",
1294
+ infoTextKey: "common.report-col.total-returns.info"
1039
1295
  },
1040
- salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
1041
- };
1042
- var PRODUCT_MIX_AVAILABLE_COLUMNS = [
1043
- "salesAmountGross",
1044
- "discountsAmount",
1045
- "inclusiveTaxesAmount",
1046
- "salesAmountNet",
1047
- "itemsQuantity",
1048
- "avgPrice",
1049
- "salesMixPct"
1050
- ];
1051
- var PRODUCT_MIX_DEFAULT_VISIBLE_COLUMNS = PRODUCT_MIX_AVAILABLE_COLUMNS;
1052
- var PRODUCT_MIX_CHART_FIELDS = [
1053
- "salesAmountGross",
1054
- "itemsQuantity",
1055
- "avgPrice",
1056
- "discountsAmount",
1057
- "inclusiveTaxesAmount",
1058
- "salesAmountNet",
1059
- "salesMixPct"
1060
- ];
1061
- var productMixConfig = {
1062
- fields: FIELDS4,
1063
- availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
1064
- defaultVisibleColumns: PRODUCT_MIX_DEFAULT_VISIBLE_COLUMNS
1065
- };
1066
-
1067
- // src/reports/modifierMix.ts
1068
- var FIRST_COLUMN_WIDTH3 = 240;
1069
- var FIELDS5 = {
1070
- groupById: { type: "string", filteringAvailable: false },
1071
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH3, filteringAvailable: false },
1072
- groupById2: { type: "string", filteringAvailable: false },
1073
- groupByName2: { type: "string", size: FIRST_COLUMN_WIDTH3, filteringAvailable: false },
1074
- modifiersSales: { type: "money", columnKey: "totalModifierSales" },
1075
- modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
1076
- itemsQuantity: {
1077
- type: "number",
1078
- columnKey: "quantity",
1079
- filteringAvailable: false
1296
+ totalSales: {
1297
+ titleKey: "common.report-col.total-sales",
1298
+ shortTitleKey: "common.report-col.total-sales.short",
1299
+ infoTextKey: "common.report-col.total-sales.info"
1300
+ },
1301
+ totalTips: {
1302
+ titleKey: "common.report-col.total-tips",
1303
+ shortTitleKey: "common.report-col.total-tips.short",
1304
+ infoTextKey: "common.report-col.total-tips.info"
1305
+ },
1306
+ transactionDate: {
1307
+ titleKey: "common.report-col.transaction-date",
1308
+ shortTitleKey: "common.report-col.transaction-date.short",
1309
+ infoTextKey: "common.report-col.transaction-date.info"
1310
+ },
1311
+ transactionType: {
1312
+ titleKey: "common.report-col.transaction-type",
1313
+ shortTitleKey: "common.report-col.transaction-type.short",
1314
+ infoTextKey: "common.report-col.transaction-type.info"
1315
+ },
1316
+ untaxedSales: {
1317
+ titleKey: "common.report-col.untaxed-sales",
1318
+ shortTitleKey: "common.report-col.untaxed-sales.short",
1319
+ infoTextKey: "common.report-col.untaxed-sales.info"
1080
1320
  },
1081
- avgGross: {
1082
- type: "money",
1083
- columnKey: "averageGrossPrice",
1084
- footerCalculation: {
1085
- type: "average",
1086
- numeratorField: "modifiersSales",
1087
- denominatorField: "modifiersQuantity"
1088
- }
1321
+ visa: {
1322
+ titleKey: "common.report-col.visa",
1323
+ shortTitleKey: "common.report-col.visa.short",
1324
+ infoTextKey: "common.report-col.visa.info"
1089
1325
  },
1090
- attachRate: {
1091
- type: "percent",
1092
- columnKey: "attachRate",
1093
- footerCalculation: {
1094
- type: "average",
1095
- numeratorField: "modifiersQuantity",
1096
- denominatorField: "itemsQuantity"
1097
- }
1326
+ visaReturns: {
1327
+ titleKey: "common.report-col.visa-returns",
1328
+ shortTitleKey: "common.report-col.visa-returns.short",
1329
+ infoTextKey: "common.report-col.visa-returns.info"
1098
1330
  },
1099
- modifiersSalesComp: { type: "money", filteringAvailable: false },
1100
- modifiersQuantityComp: { type: "number", filteringAvailable: false },
1101
- itemsQuantityComp: { type: "number", filteringAvailable: false },
1102
- attachRateComp: { type: "percent", filteringAvailable: false },
1103
- modifiersSalesVar: { type: "money", filteringAvailable: false },
1104
- modifiersSalesVarPct: {
1105
- type: "percent",
1106
- filteringAvailable: false,
1107
- footerCalculation: {
1108
- type: "percentChange",
1109
- numeratorField: "modifiersSales",
1110
- denominatorField: "modifiersSalesComp"
1111
- }
1331
+ paymentsCount: {
1332
+ titleKey: "common.report-col.payments-count",
1333
+ shortTitleKey: "common.report-col.payments-count.short",
1334
+ infoTextKey: "common.report-col.payments-count.info"
1112
1335
  },
1113
- modifiersQuantityVar: { type: "number", filteringAvailable: false },
1114
- modifiersQuantityVarPct: {
1115
- type: "percent",
1116
- filteringAvailable: false,
1117
- footerCalculation: {
1118
- type: "percentChange",
1119
- numeratorField: "modifiersQuantity",
1120
- denominatorField: "modifiersQuantityComp"
1121
- }
1336
+ paymentsAmount: {
1337
+ titleKey: "common.report-col.payments-amount",
1338
+ shortTitleKey: "common.report-col.payments-amount.short",
1339
+ infoTextKey: "common.report-col.payments-amount.info"
1122
1340
  },
1123
- attachRateVar: { type: "percent", filteringAvailable: false },
1124
- attachRateVarPct: {
1125
- type: "percent",
1126
- filteringAvailable: false,
1127
- footerCalculation: {
1128
- type: "percentChange",
1129
- numeratorField: "attachRate",
1130
- denominatorField: "attachRateComp"
1131
- }
1132
- }
1133
- };
1134
- var MODIFIER_MIX_AVAILABLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
1135
- var MODIFIER_MIX_DEFAULT_VISIBLE_COLUMNS = MODIFIER_MIX_AVAILABLE_COLUMNS;
1136
- var modifierMixConfig = {
1137
- fields: FIELDS5,
1138
- availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
1139
- defaultVisibleColumns: MODIFIER_MIX_DEFAULT_VISIBLE_COLUMNS
1140
- };
1141
-
1142
- // src/reports/itemTax.ts
1143
- var FIELDS6 = {
1144
- locationId: { type: "number", filteringAvailable: false },
1145
- taxIsFlat: { type: "boolean", filteringAvailable: false },
1146
- merchantId: { type: "string", columnKey: "locationMid", filteringAvailable: false },
1147
- locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
1148
- locationCity: { type: "string", columnKey: "locationCity", filteringAvailable: false },
1149
- locationState: { type: "string", columnKey: "locationState", filteringAvailable: false },
1150
- itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
1151
- itemPrice: { type: "money", columnKey: "itemPrice" },
1152
- departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
1153
- revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
1154
- orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
1155
- taxName: { type: "string", columnKey: "taxName", filteringAvailable: false },
1156
- taxValue: { type: "money", columnKey: "taxableSales" },
1157
- taxRate: { type: "number", columnKey: "taxRate" },
1158
- recordsCount: { type: "number", columnKey: "quantity" },
1159
- taxableSales: { type: "money", columnKey: "taxableSales" },
1160
- totalCollected: { type: "money", columnKey: "totalCollected" },
1161
- itemTax: { type: "money", columnKey: "taxCollected" },
1162
- taxCollected: { type: "money", columnKey: "taxCollected" }
1163
- };
1164
- var ITEM_TAX_AVAILABLE_COLUMNS = [
1165
- "merchantId",
1166
- "locationName",
1167
- "locationCity",
1168
- "locationState",
1169
- "itemName",
1170
- "departmentName",
1171
- "revenueClassName",
1172
- "orderTypeName",
1173
- "recordsCount",
1174
- "itemPrice",
1175
- "taxName",
1176
- "taxRate",
1177
- "taxableSales",
1178
- "taxCollected"
1179
- ];
1180
- var ITEM_TAX_DEFAULT_VISIBLE_COLUMNS = ITEM_TAX_AVAILABLE_COLUMNS;
1181
- var itemTaxConfig = {
1182
- fields: FIELDS6,
1183
- availableColumns: ITEM_TAX_AVAILABLE_COLUMNS,
1184
- defaultVisibleColumns: ITEM_TAX_DEFAULT_VISIBLE_COLUMNS
1185
- };
1186
-
1187
- // src/reports/dailySales.ts
1188
- var FIRST_COLUMN_WIDTH4 = 240;
1189
- var FIELDS7 = {
1190
- groupById: { type: "string" },
1191
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH4 },
1192
- itemsQuantity: { type: "number", columnKey: "quantity" },
1193
- salesAmountGross: { type: "money", columnKey: "grossSales" },
1194
- discountsAmount: { type: "money", columnKey: "discountAmount" },
1195
- inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
1196
- salesAmountNet: { type: "money", columnKey: "netSales" },
1197
- salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
1198
- avgPrice: {
1199
- type: "fixedNumber",
1200
- columnKey: "averageGrossPrice",
1201
- footerCalculation: {
1202
- type: "average",
1203
- numeratorField: "salesAmountGross",
1204
- denominatorField: "itemsQuantity"
1205
- }
1341
+ paymentsTotal: {
1342
+ titleKey: "common.report-col.payments-total",
1343
+ shortTitleKey: "common.report-col.payments-total.short",
1344
+ infoTextKey: "common.report-col.payments-total.info"
1345
+ },
1346
+ refundVoidDescription: {
1347
+ titleKey: "common.report-col.refund-void-description",
1348
+ shortTitleKey: "common.report-col.refund-void-description.short",
1349
+ infoTextKey: "common.report-col.refund-void-description.info"
1350
+ },
1351
+ refundVoidCount: {
1352
+ titleKey: "common.report-col.refund-void-count",
1353
+ shortTitleKey: "common.report-col.refund-void-count.short",
1354
+ infoTextKey: "common.report-col.refund-void-count.info"
1355
+ },
1356
+ refundVoidAmount: {
1357
+ titleKey: "common.report-col.refund-void-amount",
1358
+ shortTitleKey: "common.report-col.refund-void-amount.short",
1359
+ infoTextKey: "common.report-col.refund-void-amount.info"
1360
+ },
1361
+ refundVoidPctSales: {
1362
+ titleKey: "common.report-col.refund-void-pct-sales",
1363
+ shortTitleKey: "common.report-col.refund-void-pct-sales.short",
1364
+ infoTextKey: "common.report-col.refund-void-pct-sales.info"
1365
+ },
1366
+ discountName: {
1367
+ titleKey: "common.report-col.discount-name",
1368
+ shortTitleKey: "common.report-col.discount-name.short",
1369
+ infoTextKey: "common.report-col.discount-name.info"
1370
+ },
1371
+ tickets: {
1372
+ titleKey: "common.report-col.tickets",
1373
+ shortTitleKey: "common.report-col.tickets.short",
1374
+ infoTextKey: "common.report-col.tickets.info"
1375
+ },
1376
+ guests: {
1377
+ titleKey: "common.report-col.guests",
1378
+ shortTitleKey: "common.report-col.guests.short",
1379
+ infoTextKey: "common.report-col.guests.info"
1206
1380
  },
1207
- ticketsCount: { type: "number", columnKey: "tickets" },
1208
- guestsCount: { type: "number", columnKey: "guests" },
1209
1381
  ticketAverage: {
1210
- type: "money",
1211
- columnKey: "ticketAverage",
1212
- footerCalculation: {
1213
- type: "average",
1214
- numeratorField: "salesAmountNet",
1215
- denominatorField: "ticketsCount"
1216
- }
1382
+ titleKey: "common.report-col.ticket-average",
1383
+ shortTitleKey: "common.report-col.ticket-average.short",
1384
+ infoTextKey: "common.report-col.ticket-average.info"
1217
1385
  },
1218
1386
  guestAverage: {
1219
- type: "money",
1220
- columnKey: "guestAverage",
1221
- footerCalculation: {
1222
- type: "average",
1223
- numeratorField: "salesAmountNet",
1224
- denominatorField: "guestsCount"
1225
- }
1226
- },
1227
- ticketAvg: {
1228
- type: "money",
1229
- columnKey: "ticketAverage",
1230
- footerCalculation: {
1231
- type: "average",
1232
- numeratorField: "salesAmountNet",
1233
- denominatorField: "ticketsCount"
1234
- }
1387
+ titleKey: "common.report-col.guest-average",
1388
+ shortTitleKey: "common.report-col.guest-average.short",
1389
+ infoTextKey: "common.report-col.guest-average.info"
1235
1390
  },
1236
- guestAvg: {
1237
- type: "money",
1238
- columnKey: "guestAverage",
1239
- footerCalculation: {
1240
- type: "average",
1241
- numeratorField: "salesAmountNet",
1242
- denominatorField: "guestsCount"
1243
- }
1244
- }
1245
- };
1246
- var DAILY_SALES_AVAILABLE_COLUMNS = [
1247
- "itemsQuantity",
1248
- "salesAmountGross",
1249
- "discountsAmount",
1250
- "inclusiveTaxesAmount",
1251
- "salesAmountNet",
1252
- "salesMixPct"
1253
- ];
1254
- var DAILY_SALES_BY_GROUP_AVAILABLE_COLUMNS = [
1255
- "ticketsCount",
1256
- "guestsCount",
1257
- "ticketAverage",
1258
- "guestAverage",
1259
- "salesAmountNet"
1260
- ];
1261
- var DAILY_SALES_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_AVAILABLE_COLUMNS;
1262
- var dailySalesConfig = {
1263
- fields: FIELDS7,
1264
- availableColumns: DAILY_SALES_AVAILABLE_COLUMNS,
1265
- defaultVisibleColumns: DAILY_SALES_DEFAULT_VISIBLE_COLUMNS
1266
- };
1267
- var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
1268
- "ticketsCount",
1269
- "guestsCount",
1270
- "ticketAvg",
1271
- "guestAvg",
1272
- "salesAmountNet"
1273
- ];
1274
- var dailySalesTrendsConfig = {
1275
- fields: FIELDS7,
1276
- availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
1277
- defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS
1391
+ net: {
1392
+ titleKey: "common.report-col.net",
1393
+ shortTitleKey: "common.report-col.net.short",
1394
+ infoTextKey: "common.report-col.net.info"
1395
+ }
1278
1396
  };
1397
+ function getColumnMetadata(key) {
1398
+ return COLUMN_REGISTRY[key];
1399
+ }
1279
1400
 
1280
- // src/reports/dailySalesPayments.ts
1281
- var FIRST_COLUMN_WIDTH5 = 240;
1282
- var FIELDS8 = {
1283
- paymentTypeName: { type: "string", size: FIRST_COLUMN_WIDTH5 },
1284
- paymentsCount: { type: "number", columnKey: "paymentsCount", footerCalculation: { type: "sum" } },
1285
- paymentsAmount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } },
1286
- tipsAmount: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
1287
- totalSales: { type: "money", columnKey: "paymentsTotal", footerCalculation: { type: "sum" } }
1288
- };
1289
- var DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS = [
1290
- "paymentsCount",
1291
- "paymentsAmount",
1292
- "tipsAmount",
1293
- "totalSales"
1294
- ];
1295
- var DAILY_SALES_PAYMENTS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS;
1296
- var dailySalesPaymentsConfig = {
1297
- fields: FIELDS8,
1298
- availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
1299
- defaultVisibleColumns: DAILY_SALES_PAYMENTS_DEFAULT_VISIBLE_COLUMNS
1300
- };
1401
+ // src/utils/alignment.ts
1402
+ function getColumnAlignment(type) {
1403
+ if (type === "string" || type === "date" || type === "time") {
1404
+ return "left";
1405
+ }
1406
+ return "right";
1407
+ }
1408
+ function isNumericType(type) {
1409
+ return type === "money" || type === "number" || type === "percent" || type === "fixedNumber";
1410
+ }
1301
1411
 
1302
- // src/reports/dailySalesDiscounts.ts
1303
- var FIRST_COLUMN_WIDTH6 = 240;
1304
- var FIELDS9 = {
1305
- discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH6 },
1306
- discountsCount: { type: "number", columnKey: "discountCount", footerCalculation: { type: "sum" } },
1307
- discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
1308
- };
1309
- var DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS = [
1310
- "discountsCount",
1311
- "discountsAmount"
1312
- ];
1313
- var DAILY_SALES_DISCOUNTS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS;
1314
- var dailySalesDiscountsConfig = {
1315
- fields: FIELDS9,
1316
- availableColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
1317
- defaultVisibleColumns: DAILY_SALES_DISCOUNTS_DEFAULT_VISIBLE_COLUMNS
1318
- };
1412
+ // src/totals.ts
1413
+ function calculateReportTotals(data, fieldConfig, opts) {
1414
+ const rows = data;
1415
+ const { labelField, label } = opts;
1416
+ const fieldsToSum = /* @__PURE__ */ new Set();
1417
+ const derivedFields = [];
1418
+ for (const [field, config] of Object.entries(fieldConfig)) {
1419
+ const { type, columnKey, footerCalculation: calc } = config;
1420
+ if (!type || type === "string" || type === "date" || type === "time" || type === "boolean") {
1421
+ continue;
1422
+ }
1423
+ if (calc?.type === "none") {
1424
+ } else if (!calc || calc.type === "sum") {
1425
+ if (columnKey || calc?.type === "sum") {
1426
+ fieldsToSum.add(field);
1427
+ }
1428
+ } else {
1429
+ derivedFields.push({ field, calc });
1430
+ if (calc.numeratorField) fieldsToSum.add(calc.numeratorField);
1431
+ if (calc.denominatorField) fieldsToSum.add(calc.denominatorField);
1432
+ }
1433
+ }
1434
+ const sums = {};
1435
+ for (const field of fieldsToSum) {
1436
+ sums[field] = rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
1437
+ }
1438
+ const derived = {};
1439
+ for (const { field, calc } of derivedFields) {
1440
+ const num = sums[calc.numeratorField ?? ""] ?? 0;
1441
+ const den = sums[calc.denominatorField ?? ""] ?? 0;
1442
+ if (calc.type === "percentChange") {
1443
+ derived[field] = den ? (num - den) / den : 0;
1444
+ } else if (calc.type === "average") {
1445
+ derived[field] = den > 0 ? num / den : 0;
1446
+ }
1447
+ }
1448
+ const result = {};
1449
+ for (const [field, config] of Object.entries(fieldConfig)) {
1450
+ const { type } = config;
1451
+ if (!type || type === "string" || type === "date" || type === "time") {
1452
+ result[field] = "";
1453
+ } else if (type === "boolean") {
1454
+ result[field] = false;
1455
+ } else {
1456
+ result[field] = 0;
1457
+ }
1458
+ }
1459
+ result[labelField] = label;
1460
+ for (const [field, value] of Object.entries(sums)) {
1461
+ result[field] = value;
1462
+ }
1463
+ for (const [field, value] of Object.entries(derived)) {
1464
+ result[field] = value;
1465
+ }
1466
+ return result;
1467
+ }
1319
1468
 
1320
1469
  // src/reports/dailySalesRefundsVoids.ts
1321
- var FIRST_COLUMN_WIDTH7 = 240;
1322
- var FIELDS10 = {
1323
- description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH7 },
1470
+ var FIRST_COLUMN_WIDTH8 = 240;
1471
+ var FIELDS12 = {
1472
+ description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH8 },
1324
1473
  count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
1325
1474
  amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
1326
1475
  pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
@@ -1332,15 +1481,15 @@ var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
1332
1481
  ];
1333
1482
  var DAILY_SALES_REFUNDS_VOIDS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS;
1334
1483
  var dailySalesRefundsVoidsConfig = {
1335
- fields: FIELDS10,
1484
+ fields: FIELDS12,
1336
1485
  availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
1337
1486
  defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_DEFAULT_VISIBLE_COLUMNS
1338
1487
  };
1339
1488
 
1340
1489
  // src/reports/dailySalesTaxes.ts
1341
- var FIRST_COLUMN_WIDTH8 = 240;
1342
- var FIELDS11 = {
1343
- taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH8 },
1490
+ var FIRST_COLUMN_WIDTH9 = 240;
1491
+ var FIELDS13 = {
1492
+ taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH9 },
1344
1493
  taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "sum" } },
1345
1494
  taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
1346
1495
  exemptSales: { type: "money", columnKey: "exemptTaxes", footerCalculation: { type: "sum" } }
@@ -1352,147 +1501,10 @@ var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
1352
1501
  ];
1353
1502
  var DAILY_SALES_TAXES_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_TAXES_AVAILABLE_COLUMNS;
1354
1503
  var dailySalesTaxesConfig = {
1355
- fields: FIELDS11,
1504
+ fields: FIELDS13,
1356
1505
  availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
1357
1506
  defaultVisibleColumns: DAILY_SALES_TAXES_DEFAULT_VISIBLE_COLUMNS
1358
1507
  };
1359
-
1360
- // src/reports/employeeTimecard.ts
1361
- var FIRST_COLUMN_WIDTH9 = 240;
1362
- var EMPLOYEE_NAME_WIDTH = 220;
1363
- var STATUS_WIDTH = 140;
1364
- var LOOKUP_WIDTH = 160;
1365
- var PAYROLL_WIDTH = 160;
1366
- var JOB_WIDTH = 200;
1367
- var FIELDS12 = {
1368
- locationId: {
1369
- type: "number",
1370
- enableSorting: false,
1371
- filteringAvailable: false
1372
- },
1373
- locationName: {
1374
- type: "string",
1375
- size: FIRST_COLUMN_WIDTH9,
1376
- columnKey: "locationName"
1377
- },
1378
- businessDate: {
1379
- type: "date",
1380
- columnKey: "date"
1381
- },
1382
- employeeName: {
1383
- type: "string",
1384
- size: EMPLOYEE_NAME_WIDTH,
1385
- columnKey: "employeeName"
1386
- },
1387
- isActive: {
1388
- type: "string",
1389
- size: STATUS_WIDTH,
1390
- columnKey: "status",
1391
- enableSorting: false,
1392
- filteringAvailable: false
1393
- },
1394
- lookup: {
1395
- type: "string",
1396
- size: LOOKUP_WIDTH,
1397
- columnKey: "employeeId"
1398
- },
1399
- payrollCode: {
1400
- type: "string",
1401
- size: PAYROLL_WIDTH,
1402
- columnKey: "payrollId"
1403
- },
1404
- jobName: {
1405
- type: "string",
1406
- size: JOB_WIDTH,
1407
- columnKey: "employeeJob"
1408
- },
1409
- isBreak: {
1410
- type: "string",
1411
- enableSorting: false,
1412
- filteringAvailable: false
1413
- },
1414
- startTime: {
1415
- type: "string",
1416
- columnKey: "clockInTime"
1417
- },
1418
- endTime: {
1419
- type: "string",
1420
- columnKey: "clockOutTime"
1421
- },
1422
- shiftHours: {
1423
- type: "fixedNumber",
1424
- columnKey: "shiftDurationHrs",
1425
- filteringAvailable: false
1426
- }
1427
- };
1428
- var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
1429
- "locationName",
1430
- "businessDate",
1431
- "employeeName",
1432
- "isActive",
1433
- "lookup",
1434
- "payrollCode",
1435
- "jobName",
1436
- "startTime",
1437
- "endTime",
1438
- "shiftHours"
1439
- ];
1440
- var EMPLOYEE_TIMECARD_DEFAULT_VISIBLE_COLUMNS = EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS;
1441
- var employeeTimecardConfig = {
1442
- fields: FIELDS12,
1443
- availableColumns: EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS,
1444
- defaultVisibleColumns: EMPLOYEE_TIMECARD_DEFAULT_VISIBLE_COLUMNS,
1445
- columnGroups: []
1446
- // No column groups for this report
1447
- };
1448
-
1449
- // src/reports/salesByItemDetail.ts
1450
- var FIELDS13 = {
1451
- businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
1452
- ticketClosedAt: { type: "string", columnKey: "ticketClosed", filteringAvailable: false },
1453
- hourId: { type: "number", columnKey: "hour", filteringAvailable: false },
1454
- daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
1455
- locationId: { type: "number", columnKey: "locationId", filteringAvailable: false },
1456
- locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
1457
- departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
1458
- itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
1459
- revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
1460
- revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
1461
- salesAmountGross: { type: "money", columnKey: "grossSales" },
1462
- itemsQuantity: { type: "number", columnKey: "quantity" },
1463
- transactionId: { type: "string", columnKey: "ticketNumber", filteringAvailable: false },
1464
- guestsCount: { type: "number", columnKey: "guestCount" },
1465
- employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
1466
- orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
1467
- salesType: { type: "string", columnKey: "salePaymentType", filteringAvailable: false },
1468
- itemPrice: { type: "money", columnKey: "itemPrice" }
1469
- };
1470
- var SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS = [
1471
- "businessDate",
1472
- "ticketClosedAt",
1473
- "hourId",
1474
- "daypartName",
1475
- "locationId",
1476
- "locationName",
1477
- "departmentName",
1478
- "itemName",
1479
- "revenueCenterName",
1480
- "revenueClassName",
1481
- "salesAmountGross",
1482
- "itemsQuantity",
1483
- "transactionId",
1484
- "guestsCount",
1485
- "employeeName",
1486
- "orderTypeName",
1487
- "salesType",
1488
- "itemPrice"
1489
- ];
1490
- var SALES_BY_ITEM_DETAIL_DEFAULT_VISIBLE_COLUMNS = SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS;
1491
- var salesByItemDetailConfig = {
1492
- fields: FIELDS13,
1493
- availableColumns: SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS,
1494
- defaultVisibleColumns: SALES_BY_ITEM_DETAIL_DEFAULT_VISIBLE_COLUMNS
1495
- };
1496
1508
  export {
1497
1509
  COLUMN_REGISTRY,
1498
1510
  DAILY_SALES_AVAILABLE_COLUMNS,
@@ -1535,6 +1547,7 @@ export {
1535
1547
  employeeTimecardConfig,
1536
1548
  getColumnAlignment,
1537
1549
  getColumnMetadata,
1550
+ getReportConfig,
1538
1551
  isNumericType,
1539
1552
  itemTaxConfig,
1540
1553
  modifierMixConfig,