@harbortouch/skytab-analytics-report-utils 0.18.0 → 0.20.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,1562 +1,44 @@
1
- // src/reports/salesByItemDetail.ts
2
- var FIELDS = {
3
- businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
4
- ticketClosedAt: { type: "string", columnKey: "ticketClosed", filteringAvailable: false },
5
- hourId: { type: "number", columnKey: "hour", filteringAvailable: false },
6
- daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
7
- locationId: { type: "number", columnKey: "locationId", filteringAvailable: false },
8
- locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
9
- departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
10
- itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
11
- revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
12
- revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
13
- salesAmountGross: { type: "money", columnKey: "grossSales" },
14
- itemsQuantity: { type: "number", columnKey: "quantity" },
15
- transactionId: { type: "string", columnKey: "ticketNumber", filteringAvailable: false },
16
- guestsCount: { type: "number", columnKey: "guestCount" },
17
- employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
18
- orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
19
- salesType: { type: "string", columnKey: "salePaymentType", filteringAvailable: false },
20
- itemPrice: { type: "money", columnKey: "itemPrice" }
21
- };
22
- var SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS = [
23
- "businessDate",
24
- "ticketClosedAt",
25
- "hourId",
26
- "daypartName",
27
- "locationId",
28
- "locationName",
29
- "departmentName",
30
- "itemName",
31
- "revenueCenterName",
32
- "revenueClassName",
33
- "salesAmountGross",
34
- "itemsQuantity",
35
- "transactionId",
36
- "guestsCount",
37
- "employeeName",
38
- "orderTypeName",
39
- "salesType",
40
- "itemPrice"
41
- ];
42
- var salesByItemDetailConfig = {
43
- fields: FIELDS,
44
- availableColumns: SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS,
45
- defaultVisibleColumns: SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS,
46
- hasFooter: false
47
- };
48
-
49
- // src/reports/constants.ts
50
- var FIRST_COLUMN_WIDTH = 240;
51
-
52
- // src/reports/salesSummary.ts
53
- var FIELDS2 = {
54
- groupById: { type: "number" },
55
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
56
- salesAmountNet: { type: "money", columnKey: "netSales" },
57
- salesVarLW: { type: "money", columnKey: "salesVarLw" },
58
- salesVarLY: { type: "money", columnKey: "salesVarLy" },
59
- salesVarLWPct: {
60
- type: "percent",
61
- columnKey: "salesVarLwPct",
62
- footerCalculation: {
63
- type: "variancePercent",
64
- numeratorField: "salesVarLW",
65
- denominatorField: "salesAmountNet"
66
- }
67
- },
68
- salesVarLYPct: {
69
- type: "percent",
70
- columnKey: "salesVarLyPct",
71
- footerCalculation: {
72
- type: "variancePercent",
73
- numeratorField: "salesVarLY",
74
- denominatorField: "salesAmountNet"
75
- }
76
- },
77
- salesAmountNetLastWeek: { type: "money" },
78
- salesAmountNetLastYear: { type: "money" },
79
- salesAmountGross: { type: "money" },
80
- salesAmountGrossLastWeek: { type: "money" },
81
- salesAmountGrossLastYear: { type: "money" },
82
- ticketsCount: { type: "number" },
83
- ticketsCountLastWeek: { type: "number" },
84
- ticketsCountLastYear: { type: "number" },
85
- guestsCount: { type: "number", columnKey: "guestCount" },
86
- guestsVarLW: { type: "number", columnKey: "guestsVarLw" },
87
- guestsVarLY: { type: "number", columnKey: "guestsVarLy" },
88
- guestsVarLWPct: {
89
- type: "percent",
90
- columnKey: "guestsVarLwPct",
91
- footerCalculation: {
92
- type: "variancePercent",
93
- numeratorField: "guestsVarLW",
94
- denominatorField: "guestsCount"
95
- }
96
- },
97
- guestsVarLYPct: {
98
- type: "percent",
99
- columnKey: "guestsVarLyPct",
100
- footerCalculation: {
101
- type: "variancePercent",
102
- numeratorField: "guestsVarLY",
103
- denominatorField: "guestsCount"
104
- }
105
- },
106
- guestsCountLastWeek: { type: "number" },
107
- guestsCountLastYear: { type: "number" },
108
- salesPerGuestTY: {
109
- type: "money",
110
- columnKey: "salesPerGuest",
111
- footerCalculation: {
112
- type: "average",
113
- numeratorField: "salesAmountNet",
114
- denominatorField: "guestsCount"
115
- }
116
- },
117
- salesPerGuestLW: {
118
- type: "money",
119
- columnKey: "salesPerGuestLw",
120
- footerCalculation: {
121
- type: "quotientOfDifferences",
122
- numeratorField: "salesAmountNet",
123
- numeratorAdjustField: "salesVarLW",
124
- denominatorField: "guestsCount",
125
- denominatorAdjustField: "guestsVarLW"
126
- }
127
- },
128
- salesPerGuestLY: {
129
- type: "money",
130
- columnKey: "salesPerGuestLy",
131
- footerCalculation: {
132
- type: "quotientOfDifferences",
133
- numeratorField: "salesAmountNet",
134
- numeratorAdjustField: "salesVarLY",
135
- denominatorField: "guestsCount",
136
- denominatorAdjustField: "guestsVarLY"
137
- }
138
- }
139
- };
140
- var COLUMN_GROUPS = [
141
- {
142
- id: "sales",
143
- headerTranslationKey: "table.groups.sales",
144
- baseFields: ["salesAmountNet"],
145
- lastWeekFields: ["salesVarLW", "salesVarLWPct"],
146
- lastYearFields: ["salesVarLY", "salesVarLYPct"]
147
- },
148
- {
149
- id: "guests",
150
- headerTranslationKey: "table.groups.guests",
151
- baseFields: ["guestsCount"],
152
- lastWeekFields: ["guestsVarLW", "guestsVarLWPct"],
153
- lastYearFields: ["guestsVarLY", "guestsVarLYPct"]
154
- },
155
- {
156
- id: "salesPerGuest",
157
- headerTranslationKey: "table.groups.sales-per-guest",
158
- baseFields: ["salesPerGuestTY"],
159
- lastWeekFields: ["salesPerGuestLW"],
160
- lastYearFields: ["salesPerGuestLY"]
161
- }
162
- ];
163
- var SALES_SUMMARY_AVAILABLE_COLUMNS = [
164
- "salesAmountNet",
165
- "salesVarLW",
166
- "salesVarLWPct",
167
- "salesVarLY",
168
- "salesVarLYPct",
169
- "guestsCount",
170
- "guestsVarLW",
171
- "guestsVarLWPct",
172
- "guestsVarLY",
173
- "guestsVarLYPct",
174
- "salesPerGuestTY",
175
- "salesPerGuestLW",
176
- "salesPerGuestLY"
177
- ];
178
- var SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS = ["salesAmountNet", "guestsCount", "salesPerGuestTY"];
179
- var salesSummaryConfig = {
180
- fields: FIELDS2,
181
- availableColumns: SALES_SUMMARY_AVAILABLE_COLUMNS,
182
- defaultVisibleColumns: SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS,
183
- columnGroups: COLUMN_GROUPS,
184
- hasFooter: true
185
- };
186
-
187
- // src/reports/ticketSummary.ts
188
- var FIELDS3 = {
189
- ticketId: { type: "string" },
190
- locationId: { type: "number" },
191
- orderName: { type: "string" },
192
- revenueCenterName: { type: "string", columnKey: "revenueCenter" },
193
- daypartName: { type: "string", columnKey: "daypart" },
194
- inclusiveTaxesAmount: {
195
- type: "money",
196
- columnKey: "inclusiveTax",
197
- footerCalculation: { type: "sum" }
198
- },
199
- locationName: { type: "string", size: 240, columnKey: "locationName" },
200
- orderNumber: { type: "number", columnKey: "ticketNumber", footerCalculation: { type: "none" } },
201
- businessDate: { type: "date", columnKey: "date" },
202
- ticketOpenedAt: { type: "time", columnKey: "ticketOpen" },
203
- ticketClosedAt: { type: "time", columnKey: "ticketClosed" },
204
- ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false },
205
- ticketSubtotal: {
206
- type: "money",
207
- columnKey: "subtotal",
208
- footerCalculation: { type: "sum" }
209
- },
210
- discountsAmount: {
211
- type: "money",
212
- columnKey: "discountAmount",
213
- footerCalculation: { type: "sum" }
214
- },
215
- surchargesAmount: {
216
- type: "money",
217
- columnKey: "ticketFee",
218
- footerCalculation: { type: "sum" }
219
- },
220
- taxesAmount: {
221
- type: "money",
222
- columnKey: "taxCollected",
223
- footerCalculation: { type: "sum" }
224
- },
225
- ticketGrandTotal: {
226
- type: "money",
227
- columnKey: "grandTotal",
228
- footerCalculation: { type: "sum" }
229
- },
230
- gratuitiesAmount: {
231
- type: "money",
232
- columnKey: "autoGratuity",
233
- footerCalculation: { type: "sum" }
234
- },
235
- tipAmount: {
236
- type: "money",
237
- columnKey: "tips",
238
- footerCalculation: { type: "sum" }
239
- },
240
- paymentsAmount: {
241
- type: "money",
242
- columnKey: "totalCollected",
243
- footerCalculation: { type: "sum" }
244
- },
245
- paymentTypeName: { type: "string", columnKey: "paymentType" },
246
- guestsCount: {
247
- type: "number",
248
- columnKey: "guestCount",
249
- footerCalculation: { type: "sum" }
250
- },
251
- employeeName: { type: "string", columnKey: "employeeName" },
252
- orderTypeName: { type: "string", columnKey: "orderType" }
253
- };
254
- var TICKET_SUMMARY_AVAILABLE_COLUMNS = [
255
- "locationName",
256
- "businessDate",
257
- "ticketOpenedAt",
258
- "ticketClosedAt",
259
- "ticketTime",
260
- "ticketSubtotal",
261
- "discountsAmount",
262
- "surchargesAmount",
263
- "taxesAmount",
264
- "ticketGrandTotal",
265
- "gratuitiesAmount",
266
- "tipAmount",
267
- "paymentsAmount",
268
- "paymentTypeName",
269
- "guestsCount",
270
- "employeeName",
271
- "orderTypeName"
272
- ];
273
- var ticketSummaryConfig = {
274
- fields: FIELDS3,
275
- availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
276
- defaultVisibleColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
277
- hasFooter: true
278
- };
279
-
280
- // src/reports/ticketLive.ts
281
- var FIELDS4 = {
282
- locationName: { type: "string", columnKey: "locationName" },
283
- orderNumber: {
284
- type: "number",
285
- columnKey: "ticketNumber",
286
- footerCalculation: { type: "none" }
287
- },
288
- dateOpen: { type: "string", columnKey: "date" },
289
- timeOpen: { type: "string", columnKey: "ticketOpen" },
290
- dateClose: { type: "string", columnKey: "dateClose" },
291
- timeClose: { type: "string", columnKey: "ticketClosed" },
292
- durationMinutes: { type: "number", columnKey: "timeOpenMins" },
293
- subtotal: { type: "money", columnKey: "subtotal" },
294
- discountTotal: { type: "money", columnKey: "discountAmount" },
295
- surchargeTotal: { type: "money", columnKey: "ticketFee" },
296
- taxTotal: { type: "money", columnKey: "taxCollected" },
297
- grandTotal: { type: "money", columnKey: "grandTotal" },
298
- gratuityTotal: { type: "money", columnKey: "autoGratuity" },
299
- totalTips: { type: "money", columnKey: "totalTips" },
300
- paymentsReceived: { type: "money", columnKey: "totalCollected" },
301
- paymentTypeName: { type: "string", columnKey: "paymentType" },
302
- guestCount: {
303
- type: "number",
304
- columnKey: "guestCount",
305
- footerCalculation: { type: "sum" }
306
- },
307
- customerName: { type: "string", columnKey: "customerName" },
308
- employeeName: { type: "string", columnKey: "employeeName" },
309
- orderType: { type: "string", columnKey: "orderType" }
310
- };
311
- var TICKET_LIVE_AVAILABLE_COLUMNS = [
312
- "locationName",
313
- "orderNumber",
314
- "dateOpen",
315
- "timeOpen",
316
- "timeClose",
317
- "durationMinutes",
318
- "subtotal",
319
- "discountTotal",
320
- "surchargeTotal",
321
- "taxTotal",
322
- "grandTotal",
323
- "gratuityTotal",
324
- "totalTips",
325
- "paymentsReceived",
326
- "paymentTypeName",
327
- "guestCount",
328
- "employeeName",
329
- "orderType"
330
- ];
331
- var ticketLiveConfig = {
332
- fields: FIELDS4,
333
- availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
334
- defaultVisibleColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
335
- hasFooter: true
336
- };
337
-
338
- // src/reports/productMix.ts
339
- var FIELDS5 = {
340
- groupById: { type: "string" },
341
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
342
- salesAmountGross: { type: "money", columnKey: "grossSales" },
343
- discountsAmount: { type: "money", columnKey: "discountAmount" },
344
- inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
345
- salesAmountNet: { type: "money", columnKey: "netSales" },
346
- itemsQuantity: { type: "fixedNumber", columnKey: "quantity" },
347
- avgPrice: {
348
- type: "money",
349
- columnKey: "averageGrossPrice",
350
- footerCalculation: {
351
- type: "average",
352
- numeratorField: "salesAmountGross",
353
- denominatorField: "itemsQuantity"
354
- }
355
- },
356
- salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
357
- };
358
- var PRODUCT_MIX_AVAILABLE_COLUMNS = [
359
- "salesAmountGross",
360
- "itemsQuantity",
361
- "avgPrice",
362
- "discountsAmount",
363
- "inclusiveTaxesAmount",
364
- "salesAmountNet",
365
- "salesMixPct"
366
- ];
367
- var productMixConfig = {
368
- fields: FIELDS5,
369
- availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
370
- defaultVisibleColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
371
- chartFields: PRODUCT_MIX_AVAILABLE_COLUMNS,
372
- hasFooter: true
373
- };
374
-
375
- // src/reports/modifierMix.ts
376
- var FIELDS6 = {
377
- groupById: { type: "string", filteringAvailable: false },
378
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, filteringAvailable: false },
379
- groupById2: { type: "string", filteringAvailable: false },
380
- groupByName2: { type: "string", size: FIRST_COLUMN_WIDTH, filteringAvailable: false },
381
- modifiersSales: { type: "money", columnKey: "totalModifierSales" },
382
- modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
383
- itemsQuantity: {
384
- type: "number",
385
- columnKey: "quantity",
386
- filteringAvailable: false
387
- },
388
- avgGross: {
389
- type: "money",
390
- columnKey: "averageGrossPrice",
391
- footerCalculation: {
392
- type: "average",
393
- numeratorField: "modifiersSales",
394
- denominatorField: "modifiersQuantity"
395
- }
396
- },
397
- attachRate: {
398
- type: "percent",
399
- columnKey: "attachRate",
400
- footerCalculation: {
401
- type: "average",
402
- numeratorField: "modifiersQuantity",
403
- denominatorField: "itemsQuantity"
404
- }
405
- },
406
- modifiersSalesComp: { type: "money", filteringAvailable: false },
407
- modifiersQuantityComp: { type: "number", filteringAvailable: false },
408
- itemsQuantityComp: { type: "number", filteringAvailable: false },
409
- attachRateComp: { type: "percent", filteringAvailable: false },
410
- modifiersSalesVar: { type: "money", filteringAvailable: false },
411
- modifiersSalesVarPct: {
412
- type: "percent",
413
- filteringAvailable: false,
414
- footerCalculation: {
415
- type: "percentChange",
416
- numeratorField: "modifiersSales",
417
- denominatorField: "modifiersSalesComp"
418
- }
419
- },
420
- modifiersQuantityVar: { type: "number", filteringAvailable: false },
421
- modifiersQuantityVarPct: {
422
- type: "percent",
423
- filteringAvailable: false,
424
- footerCalculation: {
425
- type: "percentChange",
426
- numeratorField: "modifiersQuantity",
427
- denominatorField: "modifiersQuantityComp"
428
- }
429
- },
430
- attachRateVar: { type: "percent", filteringAvailable: false },
431
- attachRateVarPct: {
432
- type: "percent",
433
- filteringAvailable: false,
434
- footerCalculation: {
435
- type: "percentChange",
436
- numeratorField: "attachRate",
437
- denominatorField: "attachRateComp"
438
- }
439
- }
440
- };
441
- var MODIFIER_MIX_AVAILABLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
442
- var modifierMixConfig = {
443
- fields: FIELDS6,
444
- availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
445
- defaultVisibleColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
446
- hasFooter: true
447
- };
448
-
449
- // src/reports/itemTax.ts
450
- var FIELDS7 = {
451
- locationId: { type: "number", filteringAvailable: false },
452
- taxIsFlat: { type: "boolean", filteringAvailable: false },
453
- merchantId: { type: "string", columnKey: "locationMid", filteringAvailable: false },
454
- locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
455
- locationCity: { type: "string", columnKey: "locationCity", filteringAvailable: false },
456
- locationState: { type: "string", columnKey: "locationState", filteringAvailable: false },
457
- itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
458
- itemPrice: { type: "money", columnKey: "itemPrice" },
459
- departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
460
- revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
461
- orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
462
- taxName: { type: "string", columnKey: "taxName", filteringAvailable: false },
463
- taxValue: { type: "money", columnKey: "taxableSales" },
464
- taxRate: {
465
- type: "conditional",
466
- columnKey: "taxRate",
467
- conditionalConfiguration: {
468
- conditionalField: "taxIsFlat",
469
- conditionalFormat: (field) => {
470
- return field ? "money" : "percent";
471
- }
472
- }
473
- },
474
- recordsCount: { type: "number", columnKey: "quantity" },
475
- taxableSales: { type: "money", columnKey: "taxableSales" },
476
- totalCollected: { type: "money", columnKey: "totalCollected" },
477
- itemTax: { type: "money", columnKey: "taxCollected" },
478
- taxCollected: { type: "money", columnKey: "taxCollected" }
479
- };
480
- var ITEM_TAX_AVAILABLE_COLUMNS = [
481
- "merchantId",
482
- "locationName",
483
- "locationCity",
484
- "locationState",
485
- "itemName",
486
- "departmentName",
487
- "revenueClassName",
488
- "orderTypeName",
489
- "recordsCount",
490
- "itemPrice",
491
- "taxName",
492
- "taxRate",
493
- "taxableSales",
494
- "taxCollected"
495
- ];
496
- var itemTaxConfig = {
497
- fields: FIELDS7,
498
- availableColumns: ITEM_TAX_AVAILABLE_COLUMNS,
499
- defaultVisibleColumns: ITEM_TAX_AVAILABLE_COLUMNS,
500
- hasFooter: false
501
- };
502
-
503
- // src/reports/employeeTimecard.ts
504
- var EMPLOYEE_NAME_WIDTH = 220;
505
- var STATUS_WIDTH = 140;
506
- var LOOKUP_WIDTH = 160;
507
- var PAYROLL_WIDTH = 160;
508
- var JOB_WIDTH = 200;
509
- var FIELDS8 = {
510
- locationId: {
511
- type: "number",
512
- enableSorting: false,
513
- filteringAvailable: false
514
- },
515
- locationName: {
516
- type: "string",
517
- size: FIRST_COLUMN_WIDTH,
518
- columnKey: "locationName"
519
- },
520
- businessDate: {
521
- type: "date",
522
- columnKey: "date"
523
- },
524
- employeeName: {
525
- type: "string",
526
- size: EMPLOYEE_NAME_WIDTH,
527
- columnKey: "employeeName"
528
- },
529
- isActive: {
530
- type: "string",
531
- size: STATUS_WIDTH,
532
- columnKey: "status",
533
- enableSorting: false,
534
- filteringAvailable: false
535
- },
536
- lookup: {
537
- type: "string",
538
- size: LOOKUP_WIDTH,
539
- columnKey: "employeeId"
540
- },
541
- payrollCode: {
542
- type: "string",
543
- size: PAYROLL_WIDTH,
544
- columnKey: "payrollId"
545
- },
546
- jobName: {
547
- type: "string",
548
- size: JOB_WIDTH,
549
- columnKey: "employeeJob"
550
- },
551
- isBreak: {
552
- type: "string",
553
- enableSorting: false,
554
- filteringAvailable: false
555
- },
556
- startTime: {
557
- type: "string",
558
- columnKey: "clockInTime"
559
- },
560
- endTime: {
561
- type: "string",
562
- columnKey: "clockOutTime"
563
- },
564
- shiftHours: {
565
- type: "fixedNumber",
566
- columnKey: "shiftDurationHrs",
567
- filteringAvailable: false
568
- }
569
- };
570
- var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
571
- "locationName",
572
- "businessDate",
573
- "isActive",
574
- "lookup",
575
- "payrollCode",
576
- "jobName",
577
- "startTime",
578
- "endTime",
579
- "shiftHours"
580
- ];
581
- var employeeTimecardConfig = {
582
- fields: FIELDS8,
583
- availableColumns: EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS,
584
- defaultVisibleColumns: EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS,
585
- hasFooter: true
586
- };
587
-
588
- // src/reports/employeeTip.ts
589
- var FIELDS9 = {
590
- employeeName: { type: "string", size: 220, columnKey: "employeeName" },
591
- empId: { type: "string", size: 160, columnKey: "employeeId" },
592
- payrollId: { type: "string", size: 160, columnKey: "payrollId" },
593
- locationName: { type: "string", size: 220, columnKey: "locationName" },
594
- status: { type: "string", size: 140, columnKey: "status" },
595
- grossSales: { type: "money", columnKey: "grossSales", footerCalculation: { type: "sum" } },
596
- grossCash: { type: "money", columnKey: "grossCashSales", footerCalculation: { type: "sum" } },
597
- grossCc: { type: "money", columnKey: "grossCreditSales", footerCalculation: { type: "sum" } },
598
- totalPayments: { type: "money", columnKey: "totalCollected", footerCalculation: { type: "sum" } },
599
- autoGratuity: { type: "money", columnKey: "autoGratuity", footerCalculation: { type: "sum" } },
600
- grossTips: { type: "money", columnKey: "grossTips", footerCalculation: { type: "sum" } },
601
- declaredTips: { type: "money", columnKey: "declaredTips", footerCalculation: { type: "sum" } },
602
- tipReduction: { type: "money", columnKey: "tipReduction", footerCalculation: { type: "sum" } },
603
- tipShare: { type: "money", columnKey: "tipShare", footerCalculation: { type: "sum" } },
604
- netTips: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
605
- tipPercentage: {
606
- type: "percent",
607
- columnKey: "tipPct",
608
- footerCalculation: { type: "average", numeratorField: "grossTips", denominatorField: "grossSales" }
609
- }
610
- };
611
- var AVAILABLE_COLUMNS = [
612
- "employeeName",
613
- "empId",
614
- "payrollId",
615
- "locationName",
616
- "status",
617
- "grossSales",
618
- "grossCash",
619
- "grossCc",
620
- "totalPayments",
621
- "autoGratuity",
622
- "grossTips",
623
- "declaredTips",
624
- "tipReduction",
625
- "tipShare",
626
- "netTips",
627
- "tipPercentage"
628
- ];
629
- var employeeTipConfig = {
630
- fields: FIELDS9,
631
- availableColumns: AVAILABLE_COLUMNS,
632
- defaultVisibleColumns: AVAILABLE_COLUMNS,
633
- hasFooter: true
634
- };
635
-
636
- // src/reports/dailySales.ts
637
- var FIELDS10 = {
638
- groupById: { type: "string" },
639
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
640
- itemsQuantity: { type: "number", columnKey: "quantity" },
641
- salesAmountGross: { type: "money", columnKey: "grossSales" },
642
- discountsAmount: { type: "money", columnKey: "discountAmount" },
643
- inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
644
- salesAmountNet: { type: "money", columnKey: "netSales" },
645
- salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
646
- };
647
- var DAILY_SALES_AVAILABLE_COLUMNS = [
648
- "itemsQuantity",
649
- "salesAmountGross",
650
- "discountsAmount",
651
- "inclusiveTaxesAmount",
652
- "salesAmountNet",
653
- "salesMixPct"
654
- ];
655
- var dailySalesConfig = {
656
- fields: FIELDS10,
657
- availableColumns: DAILY_SALES_AVAILABLE_COLUMNS,
658
- defaultVisibleColumns: DAILY_SALES_AVAILABLE_COLUMNS,
659
- hasFooter: true,
660
- dataAccessKey: "salesByRevClass",
661
- sectionName: "common.report-section.revenue-class",
662
- extraFooterRowsKey: "salesByRevClassFooter"
663
- };
664
-
665
- // src/reports/dailySalesCache.ts
666
- var FIELDS11 = {
667
- name: { type: "string", columnKey: "type", size: FIRST_COLUMN_WIDTH },
668
- amount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } }
669
- };
670
- var dailySalesCacheConfig = {
671
- fields: FIELDS11,
672
- availableColumns: ["name", "amount"],
673
- defaultVisibleColumns: ["name", "amount"],
674
- hasFooter: true,
675
- dataAccessKey: "cashPayments",
676
- sectionName: "common.report-section.cash"
677
- };
678
-
679
- // src/reports/dailySalesDiscounts.ts
680
- var FIELDS12 = {
681
- discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH },
682
- ticketCount: { type: "number", columnKey: "ticketCount", footerCalculation: { type: "sum" } },
683
- itemCount: { type: "number", columnKey: "itemCount", footerCalculation: { type: "sum" } },
684
- discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
685
- };
686
- var DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS = [
687
- "discountName",
688
- "ticketCount",
689
- "itemCount",
690
- "discountsAmount"
691
- ];
692
- var dailySalesDiscountsConfig = {
693
- fields: FIELDS12,
694
- availableColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
695
- defaultVisibleColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
696
- hasFooter: true,
697
- dataAccessKey: "discounts",
698
- sectionName: "common.report-section.discounts"
699
- };
700
-
701
- // src/reports/dailySalesPayments.ts
702
- var FIELDS13 = {
703
- paymentTypeName: { type: "string", size: FIRST_COLUMN_WIDTH },
704
- paymentsCount: { type: "number", columnKey: "paymentsCount", footerCalculation: { type: "sum" } },
705
- paymentsAmount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } },
706
- tipsAmount: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
707
- totalSales: { type: "money", columnKey: "paymentsTotal", footerCalculation: { type: "sum" } }
708
- };
709
- var DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS = [
710
- "paymentTypeName",
711
- "paymentsCount",
712
- "paymentsAmount",
713
- "tipsAmount",
714
- "totalSales"
715
- ];
716
- var dailySalesPaymentsConfig = {
717
- fields: FIELDS13,
718
- availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
719
- defaultVisibleColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
720
- hasFooter: true,
721
- dataAccessKey: "payments",
722
- sectionName: "common.report-section.payments"
723
- };
724
-
725
- // src/reports/dailySalesRefundsVoids.ts
726
- var FIELDS14 = {
727
- description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH },
728
- count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
729
- amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
730
- pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
731
- };
732
- var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
733
- "description",
734
- "count",
735
- "amount",
736
- "pctSales"
737
- ];
738
- var dailySalesRefundsVoidsConfig = {
739
- fields: FIELDS14,
740
- availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
741
- defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
742
- hasFooter: true,
743
- dataAccessKey: "refundsVoids",
744
- sectionName: "common.report-section.refunds-voids"
745
- };
746
-
747
- // src/reports/dailySalesTaxes.ts
748
- var FIELDS15 = {
749
- taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH },
750
- taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "none" } },
751
- taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
752
- exemptSales: { type: "money", columnKey: "exemptTaxes", footerCalculation: { type: "sum" } }
753
- };
754
- var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
755
- "taxName",
756
- "taxableSales",
757
- "taxesAmount",
758
- "exemptSales"
759
- ];
760
- var dailySalesTaxesConfig = {
761
- fields: FIELDS15,
762
- availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
763
- defaultVisibleColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
764
- hasFooter: true,
765
- dataAccessKey: "taxes",
766
- sectionName: "common.report-section.taxes"
767
- };
768
-
769
- // src/reports/dailySalesTrends.ts
770
- var FIELDS16 = {
771
- groupById: { type: "string" },
772
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
773
- salesAmountNet: { type: "money", columnKey: "netSales" },
774
- ticketsCount: { type: "number", columnKey: "tickets" },
775
- guestsCount: { type: "number", columnKey: "guests" },
776
- ticketAvg: {
777
- type: "money",
778
- columnKey: "ticketAverage",
779
- footerCalculation: {
780
- type: "average",
781
- numeratorField: "salesAmountNet",
782
- denominatorField: "ticketsCount"
783
- }
784
- },
785
- guestAvg: {
786
- type: "money",
787
- columnKey: "guestAverage",
788
- footerCalculation: {
789
- type: "average",
790
- numeratorField: "salesAmountNet",
791
- denominatorField: "guestsCount"
792
- }
793
- }
794
- };
795
- var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
796
- "ticketsCount",
797
- "guestsCount",
798
- "ticketAvg",
799
- "guestAvg",
800
- "salesAmountNet"
801
- ];
802
- var dailySalesTrendsConfig = {
803
- fields: FIELDS16,
804
- availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
805
- defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
806
- hasFooter: true,
807
- dataAccessKey: "trendsByDayPart",
808
- sectionName: "common.report-section.sales-by-day-part",
809
- totalsLabel: "common.report-section.trends-footer.total-sales",
810
- extraFooterFields: ["salesAmountNet"]
811
- };
812
- var dailySalesTrendsOrderTypeConfig = {
813
- fields: FIELDS16,
814
- availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
815
- defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
816
- hasFooter: true,
817
- dataAccessKey: "trendsByOrderType",
818
- sectionName: "common.report-section.sales-by-order-type",
819
- totalsLabel: "common.report-section.trends-footer.total-sales",
820
- extraFooterFields: ["salesAmountNet"]
821
- };
822
-
823
- // src/report.ts
824
- var Report = {
825
- TICKET_LIVE: "ticket-live",
826
- TICKET_ANALYTICS: "ticket-analytics",
827
- SALES_SUMMARY: "sales-summary",
828
- PRODUCT_MIX: "product-mix",
829
- MODIFIER_MIX: "modifier-mix",
830
- ITEM_TAX: "item-tax",
831
- EMPLOYEE_TIMECARD: "employee-timecard",
832
- EMPLOYEE_TIP: "employee-tip",
833
- SALES_BY_ITEM: "sales-by-item",
834
- DAILY_SALES: "daily-sales",
835
- DAILY_SALES_LIVE: "daily-sales-live",
836
- DAILY_SALES_TRENDS: "daily-sales-trends"
837
- };
838
- var DAILY_SALES_SECTION_CONFIGS = [
1
+ import {
2
+ COLUMN_REGISTRY,
3
+ FIRST_COLUMN_WIDTH,
4
+ Report,
5
+ calculateFieldTotal,
6
+ calculateReportTotals,
7
+ dailySalesCacheConfig,
839
8
  dailySalesConfig,
9
+ dailySalesDiscountsConfig,
840
10
  dailySalesPaymentsConfig,
841
- dailySalesCacheConfig,
842
- dailySalesTaxesConfig,
843
11
  dailySalesRefundsVoidsConfig,
844
- dailySalesDiscountsConfig,
12
+ dailySalesTaxesConfig,
845
13
  dailySalesTrendsConfig,
846
- dailySalesTrendsOrderTypeConfig
847
- ];
848
- var REPORT_CONFIG_MAP = {
849
- "sales-summary": salesSummaryConfig,
850
- "ticket-analytics": ticketSummaryConfig,
851
- "ticket-live": ticketLiveConfig,
852
- "product-mix": productMixConfig,
853
- "modifier-mix": modifierMixConfig,
854
- "item-tax": itemTaxConfig,
855
- "employee-timecard": employeeTimecardConfig,
856
- "employee-tip": employeeTipConfig,
857
- "sales-by-item": salesByItemDetailConfig,
858
- "daily-sales": DAILY_SALES_SECTION_CONFIGS,
859
- "daily-sales-live": DAILY_SALES_SECTION_CONFIGS,
860
- "daily-sales-trends": null
861
- };
862
- var REPORT_DEFAULT_NAME_MAP = {
863
- "sales-summary": "Sales",
864
- "ticket-analytics": "Tickets",
865
- "ticket-live": "Tickets Live",
866
- "product-mix": "Product Mix",
867
- "modifier-mix": "Modifier Mix",
868
- "item-tax": "Sales Tax by Item",
869
- "employee-timecard": "Employee Timecard",
870
- "employee-tip": "Employee Tip",
871
- "sales-by-item": "Sales by Item",
872
- "daily-sales": "Daily Sales",
873
- "daily-sales-live": "Daily Sales Live",
874
- "daily-sales-trends": "Daily Sales Trends"
875
- };
876
- var getReportConfig = (reportType) => REPORT_CONFIG_MAP[reportType];
877
- var getReportExportFileName = ({
878
- reportType,
879
- startDate,
880
- endDate,
881
- format
882
- }) => {
883
- const formatDate2 = (date) => {
884
- return [
885
- date.getFullYear(),
886
- String(date.getMonth() + 1).padStart(2, "0"),
887
- String(date.getDate()).padStart(2, "0")
888
- ].join("-");
889
- };
890
- const filename = REPORT_DEFAULT_NAME_MAP[reportType].replace(/\s+/g, "_") ?? "Report";
891
- return `${filename}_${formatDate2(startDate)}_to_${formatDate2(endDate)}.${format}`.toLocaleLowerCase();
892
- };
893
-
894
- // src/columns/index.ts
895
- var COLUMN_REGISTRY = {
896
- fifteenMinInterval: {
897
- titleKey: "common.report-col.fifteen-min-interval",
898
- shortTitleKey: "common.report-col.fifteen-min-interval.short",
899
- infoTextKey: "common.report-col.fifteen-min-interval.info"
900
- },
901
- adjustedTips: {
902
- titleKey: "common.report-col.adjusted-tips",
903
- shortTitleKey: "common.report-col.adjusted-tips.short",
904
- infoTextKey: "common.report-col.adjusted-tips.info"
905
- },
906
- advantageProgram: {
907
- titleKey: "common.report-col.advantage-program",
908
- shortTitleKey: "common.report-col.advantage-program.short",
909
- infoTextKey: "common.report-col.advantage-program.info"
910
- },
911
- amex: {
912
- titleKey: "common.report-col.amex",
913
- shortTitleKey: "common.report-col.amex.short",
914
- infoTextKey: "common.report-col.amex.info"
915
- },
916
- amexReturns: {
917
- titleKey: "common.report-col.amex-returns",
918
- shortTitleKey: "common.report-col.amex-returns.short",
919
- infoTextKey: "common.report-col.amex-returns.info"
920
- },
921
- attachRate: {
922
- titleKey: "common.report-col.attach-rate",
923
- shortTitleKey: "common.report-col.attach-rate.short",
924
- infoTextKey: "common.report-col.attach-rate.info"
925
- },
926
- autoGratuity: {
927
- titleKey: "common.report-col.auto-gratuity",
928
- shortTitleKey: "common.report-col.auto-gratuity.short",
929
- infoTextKey: "common.report-col.auto-gratuity.info"
930
- },
931
- averageGrossPrice: {
932
- titleKey: "common.report-col.average-gross-price",
933
- shortTitleKey: "common.report-col.average-gross-price.short",
934
- infoTextKey: "common.report-col.average-gross-price.info"
935
- },
936
- bankFees: {
937
- titleKey: "common.report-col.bank-fees",
938
- shortTitleKey: "common.report-col.bank-fees.short",
939
- infoTextKey: "common.report-col.bank-fees.info"
940
- },
941
- batchAmount: {
942
- titleKey: "common.report-col.batch-amount",
943
- shortTitleKey: "common.report-col.batch-amount.short",
944
- infoTextKey: "common.report-col.batch-amount.info"
945
- },
946
- batchDate: {
947
- titleKey: "common.report-col.batch-date",
948
- shortTitleKey: "common.report-col.batch-date.short",
949
- infoTextKey: "common.report-col.batch-date.info"
950
- },
951
- batchNumber: {
952
- titleKey: "common.report-col.batch-number",
953
- shortTitleKey: "common.report-col.batch-number.short",
954
- infoTextKey: "common.report-col.batch-number.info"
955
- },
956
- clockInTime: {
957
- titleKey: "common.report-col.clock-in-time",
958
- shortTitleKey: "common.report-col.clock-in-time.short",
959
- infoTextKey: "common.report-col.clock-in-time.info"
960
- },
961
- clockOutTime: {
962
- titleKey: "common.report-col.clock-out-time",
963
- shortTitleKey: "common.report-col.clock-out-time.short",
964
- infoTextKey: "common.report-col.clock-out-time.info"
965
- },
966
- country: {
967
- titleKey: "common.report-col.country",
968
- shortTitleKey: "common.report-col.country.short",
969
- infoTextKey: "common.report-col.country.info"
970
- },
971
- customerName: {
972
- titleKey: "common.report-col.customer-name",
973
- shortTitleKey: "common.report-col.customer-name.short",
974
- infoTextKey: "common.report-col.customer-name.info"
975
- },
976
- date: {
977
- titleKey: "common.report-col.date",
978
- shortTitleKey: "common.report-col.date.short",
979
- infoTextKey: "common.report-col.date.info"
980
- },
981
- dateClose: {
982
- titleKey: "common.report-col.date-close",
983
- shortTitleKey: "common.report-col.date-close.short",
984
- infoTextKey: "common.report-col.date-close.info"
985
- },
986
- daypart: {
987
- titleKey: "common.report-col.daypart",
988
- shortTitleKey: "common.report-col.daypart.short",
989
- infoTextKey: "common.report-col.daypart.info"
990
- },
991
- debit: {
992
- titleKey: "common.report-col.debit",
993
- shortTitleKey: "common.report-col.debit.short",
994
- infoTextKey: "common.report-col.debit.info"
995
- },
996
- debitReturns: {
997
- titleKey: "common.report-col.debit-returns",
998
- shortTitleKey: "common.report-col.debit-returns.short",
999
- infoTextKey: "common.report-col.debit-returns.info"
1000
- },
1001
- declaredTips: {
1002
- titleKey: "common.report-col.declared-tips",
1003
- shortTitleKey: "common.report-col.declared-tips.short",
1004
- infoTextKey: "common.report-col.declared-tips.info"
1005
- },
1006
- department: {
1007
- titleKey: "common.report-col.department",
1008
- shortTitleKey: "common.report-col.department.short",
1009
- infoTextKey: "common.report-col.department.info"
1010
- },
1011
- depositCurrency: {
1012
- titleKey: "common.report-col.deposit-currency",
1013
- shortTitleKey: "common.report-col.deposit-currency.short",
1014
- infoTextKey: "common.report-col.deposit-currency.info"
1015
- },
1016
- depositDate: {
1017
- titleKey: "common.report-col.deposit-date",
1018
- shortTitleKey: "common.report-col.deposit-date.short",
1019
- infoTextKey: "common.report-col.deposit-date.info"
1020
- },
1021
- discountAmount: {
1022
- titleKey: "common.report-col.discount-amount",
1023
- shortTitleKey: "common.report-col.discount-amount.short",
1024
- infoTextKey: "common.report-col.discount-amount.info"
1025
- },
1026
- ticketCount: {
1027
- titleKey: "common.report-col.ticket-count",
1028
- shortTitleKey: "common.report-col.ticket-count.short",
1029
- infoTextKey: "common.report-col.ticket-count.info"
1030
- },
1031
- itemCount: {
1032
- titleKey: "common.report-col.item-count",
1033
- shortTitleKey: "common.report-col.item-count.short",
1034
- infoTextKey: "common.report-col.item-count.info"
1035
- },
1036
- discover: {
1037
- titleKey: "common.report-col.discover",
1038
- shortTitleKey: "common.report-col.discover.short",
1039
- infoTextKey: "common.report-col.discover.info"
1040
- },
1041
- discoverReturns: {
1042
- titleKey: "common.report-col.discover-returns",
1043
- shortTitleKey: "common.report-col.discover-returns.short",
1044
- infoTextKey: "common.report-col.discover-returns.info"
1045
- },
1046
- ebt: {
1047
- titleKey: "common.report-col.ebt",
1048
- shortTitleKey: "common.report-col.ebt.short",
1049
- infoTextKey: "common.report-col.ebt.info"
1050
- },
1051
- ebtReturns: {
1052
- titleKey: "common.report-col.ebt-returns",
1053
- shortTitleKey: "common.report-col.ebt-returns.short",
1054
- infoTextKey: "common.report-col.ebt-returns.info"
1055
- },
1056
- employeeId: {
1057
- titleKey: "common.report-col.employee-id",
1058
- shortTitleKey: "common.report-col.employee-id.short",
1059
- infoTextKey: "common.report-col.employee-id.info"
1060
- },
1061
- employeeJob: {
1062
- titleKey: "common.report-col.employee-job",
1063
- shortTitleKey: "common.report-col.employee-job.short",
1064
- infoTextKey: "common.report-col.employee-job.info"
1065
- },
1066
- employeeName: {
1067
- titleKey: "common.report-col.employee-name",
1068
- shortTitleKey: "common.report-col.employee-name.short",
1069
- infoTextKey: "common.report-col.employee-name.info"
1070
- },
1071
- exemptTaxes: {
1072
- titleKey: "common.report-col.exempt-taxes",
1073
- shortTitleKey: "common.report-col.exempt-taxes.short",
1074
- infoTextKey: "common.report-col.exempt-taxes.info"
1075
- },
1076
- grandTotal: {
1077
- titleKey: "common.report-col.grand-total",
1078
- shortTitleKey: "common.report-col.grand-total.short",
1079
- infoTextKey: "common.report-col.grand-total.info"
1080
- },
1081
- grossCashSales: {
1082
- titleKey: "common.report-col.gross-cash-sales",
1083
- shortTitleKey: "common.report-col.gross-cash-sales.short",
1084
- infoTextKey: "common.report-col.gross-cash-sales.info"
1085
- },
1086
- grossCashTips: {
1087
- titleKey: "common.report-col.gross-cash-tips",
1088
- shortTitleKey: "common.report-col.gross-cash-tips.short",
1089
- infoTextKey: "common.report-col.gross-cash-tips.info"
1090
- },
1091
- grossCreditCardTips: {
1092
- titleKey: "common.report-col.gross-credit-card-tips",
1093
- shortTitleKey: "common.report-col.gross-credit-card-tips.short",
1094
- infoTextKey: "common.report-col.gross-credit-card-tips.info"
1095
- },
1096
- grossCreditSales: {
1097
- titleKey: "common.report-col.gross-credit-sales",
1098
- shortTitleKey: "common.report-col.gross-credit-sales.short",
1099
- infoTextKey: "common.report-col.gross-credit-sales.info"
1100
- },
1101
- grossSales: {
1102
- titleKey: "common.report-col.gross-sales",
1103
- shortTitleKey: "common.report-col.gross-sales.short",
1104
- infoTextKey: "common.report-col.gross-sales.info"
1105
- },
1106
- grossTips: {
1107
- titleKey: "common.report-col.gross-tips",
1108
- shortTitleKey: "common.report-col.gross-tips.short",
1109
- infoTextKey: "common.report-col.gross-tips.info"
1110
- },
1111
- guestCount: {
1112
- titleKey: "common.report-col.guest-count",
1113
- shortTitleKey: "common.report-col.guest-count.short",
1114
- infoTextKey: "common.report-col.guest-count.info"
1115
- },
1116
- guestsVarLw: {
1117
- titleKey: "common.report-col.guests-var-lw",
1118
- shortTitleKey: "common.report-col.guests-var-lw.short",
1119
- infoTextKey: "common.report-col.guests-var-lw.info"
1120
- },
1121
- guestsVarLwPct: {
1122
- titleKey: "common.report-col.guests-var-lw-pct",
1123
- shortTitleKey: "common.report-col.guests-var-lw-pct.short",
1124
- infoTextKey: "common.report-col.guests-var-lw-pct.info"
1125
- },
1126
- guestsVarLy: {
1127
- titleKey: "common.report-col.guests-var-ly",
1128
- shortTitleKey: "common.report-col.guests-var-ly.short",
1129
- infoTextKey: "common.report-col.guests-var-ly.info"
1130
- },
1131
- guestsVarLyPct: {
1132
- titleKey: "common.report-col.guests-var-ly-pct",
1133
- shortTitleKey: "common.report-col.guests-var-ly-pct.short",
1134
- infoTextKey: "common.report-col.guests-var-ly-pct.info"
1135
- },
1136
- hour: {
1137
- titleKey: "common.report-col.hour",
1138
- shortTitleKey: "common.report-col.hour.short",
1139
- infoTextKey: "common.report-col.hour.info"
1140
- },
1141
- hoursWorked: {
1142
- titleKey: "common.report-col.hours-worked",
1143
- shortTitleKey: "common.report-col.hours-worked.short",
1144
- infoTextKey: "common.report-col.hours-worked.info"
1145
- },
1146
- inclusiveTax: {
1147
- titleKey: "common.report-col.inclusive-tax",
1148
- shortTitleKey: "common.report-col.inclusive-tax.short",
1149
- infoTextKey: "common.report-col.inclusive-tax.info"
1150
- },
1151
- itemName: {
1152
- titleKey: "common.report-col.item-name",
1153
- shortTitleKey: "common.report-col.item-name.short",
1154
- infoTextKey: "common.report-col.item-name.info"
1155
- },
1156
- itemPrice: {
1157
- titleKey: "common.report-col.item-price",
1158
- shortTitleKey: "common.report-col.item-price.short",
1159
- infoTextKey: "common.report-col.item-price.info"
1160
- },
1161
- locationCity: {
1162
- titleKey: "common.report-col.location-city",
1163
- shortTitleKey: "common.report-col.location-city.short",
1164
- infoTextKey: "common.report-col.location-city.info"
1165
- },
1166
- locationId: {
1167
- titleKey: "common.report-col.location-id",
1168
- shortTitleKey: "common.report-col.location-id.short",
1169
- infoTextKey: "common.report-col.location-id.info"
1170
- },
1171
- locationMid: {
1172
- titleKey: "common.report-col.location-mid",
1173
- shortTitleKey: "common.report-col.location-mid.short",
1174
- infoTextKey: "common.report-col.location-mid.info"
1175
- },
1176
- locationName: {
1177
- titleKey: "common.report-col.location-name",
1178
- shortTitleKey: "common.report-col.location-name.short",
1179
- infoTextKey: "common.report-col.location-name.info"
1180
- },
1181
- locationState: {
1182
- titleKey: "common.report-col.location-state",
1183
- shortTitleKey: "common.report-col.location-state.short",
1184
- infoTextKey: "common.report-col.location-state.info"
1185
- },
1186
- mastercard: {
1187
- titleKey: "common.report-col.mastercard",
1188
- shortTitleKey: "common.report-col.mastercard.short",
1189
- infoTextKey: "common.report-col.mastercard.info"
1190
- },
1191
- mcReturns: {
1192
- titleKey: "common.report-col.mc-returns",
1193
- shortTitleKey: "common.report-col.mc-returns.short",
1194
- infoTextKey: "common.report-col.mc-returns.info"
1195
- },
1196
- modifierName: {
1197
- titleKey: "common.report-col.modifier-name",
1198
- shortTitleKey: "common.report-col.modifier-name.short",
1199
- infoTextKey: "common.report-col.modifier-name.info"
1200
- },
1201
- modifierPrice: {
1202
- titleKey: "common.report-col.modifier-price",
1203
- shortTitleKey: "common.report-col.modifier-price.short",
1204
- infoTextKey: "common.report-col.modifier-price.info"
1205
- },
1206
- modifierQuantity: {
1207
- titleKey: "common.report-col.modifier-quantity",
1208
- shortTitleKey: "common.report-col.modifier-quantity.short",
1209
- infoTextKey: "common.report-col.modifier-quantity.info"
1210
- },
1211
- netSales: {
1212
- titleKey: "common.report-col.net-sales",
1213
- shortTitleKey: "common.report-col.net-sales.short",
1214
- infoTextKey: "common.report-col.net-sales.info"
1215
- },
1216
- netTaxCollected: {
1217
- titleKey: "common.report-col.net-tax-collected",
1218
- shortTitleKey: "common.report-col.net-tax-collected.short",
1219
- infoTextKey: "common.report-col.net-tax-collected.info"
1220
- },
1221
- netTips: {
1222
- titleKey: "common.report-col.net-tips",
1223
- shortTitleKey: "common.report-col.net-tips.short",
1224
- infoTextKey: "common.report-col.net-tips.info"
1225
- },
1226
- numberOfGuests: {
1227
- titleKey: "common.report-col.number-of-guests",
1228
- shortTitleKey: "common.report-col.number-of-guests.short",
1229
- infoTextKey: "common.report-col.number-of-guests.info"
1230
- },
1231
- orderType: {
1232
- titleKey: "common.report-col.order-type",
1233
- shortTitleKey: "common.report-col.order-type.short",
1234
- infoTextKey: "common.report-col.order-type.info"
1235
- },
1236
- paymentType: {
1237
- titleKey: "common.report-col.payment-type",
1238
- shortTitleKey: "common.report-col.payment-type.short",
1239
- infoTextKey: "common.report-col.payment-type.info"
1240
- },
1241
- payrollId: {
1242
- titleKey: "common.report-col.payroll-id",
1243
- shortTitleKey: "common.report-col.payroll-id.short",
1244
- infoTextKey: "common.report-col.payroll-id.info"
1245
- },
1246
- quantity: {
1247
- titleKey: "common.report-col.quantity",
1248
- shortTitleKey: "common.report-col.quantity.short",
1249
- infoTextKey: "common.report-col.quantity.info"
1250
- },
1251
- referenceNumber: {
1252
- titleKey: "common.report-col.reference-number",
1253
- shortTitleKey: "common.report-col.reference-number.short",
1254
- infoTextKey: "common.report-col.reference-number.info"
1255
- },
1256
- refundAmount: {
1257
- titleKey: "common.report-col.refund-amount",
1258
- shortTitleKey: "common.report-col.refund-amount.short",
1259
- infoTextKey: "common.report-col.refund-amount.info"
1260
- },
1261
- refundedTaxAmount: {
1262
- titleKey: "common.report-col.refunded-tax-amount",
1263
- shortTitleKey: "common.report-col.refunded-tax-amount.short",
1264
- infoTextKey: "common.report-col.refunded-tax-amount.info"
1265
- },
1266
- revenueCenter: {
1267
- titleKey: "common.report-col.revenue-center",
1268
- shortTitleKey: "common.report-col.revenue-center.short",
1269
- infoTextKey: "common.report-col.revenue-center.info"
1270
- },
1271
- revenueClass: {
1272
- titleKey: "common.report-col.revenue-class",
1273
- shortTitleKey: "common.report-col.revenue-class.short",
1274
- infoTextKey: "common.report-col.revenue-class.info"
1275
- },
1276
- salesVarLw: {
1277
- titleKey: "common.report-col.sales-var-lw",
1278
- shortTitleKey: "common.report-col.sales-var-lw.short",
1279
- infoTextKey: "common.report-col.sales-var-lw.info"
1280
- },
1281
- salesVarLwPct: {
1282
- titleKey: "common.report-col.sales-var-lw-pct",
1283
- shortTitleKey: "common.report-col.sales-var-lw-pct.short",
1284
- infoTextKey: "common.report-col.sales-var-lw-pct.info"
1285
- },
1286
- salesVarLy: {
1287
- titleKey: "common.report-col.sales-var-ly",
1288
- shortTitleKey: "common.report-col.sales-var-ly.short",
1289
- infoTextKey: "common.report-col.sales-var-ly.info"
1290
- },
1291
- salesVarLyPct: {
1292
- titleKey: "common.report-col.sales-var-ly-pct",
1293
- shortTitleKey: "common.report-col.sales-var-ly-pct.short",
1294
- infoTextKey: "common.report-col.sales-var-ly-pct.info"
1295
- },
1296
- salesMixByPct: {
1297
- titleKey: "common.report-col.sales-mix-by-pct",
1298
- shortTitleKey: "common.report-col.sales-mix-by-pct.short",
1299
- infoTextKey: "common.report-col.sales-mix-by-pct.info"
1300
- },
1301
- salesPerGuest: {
1302
- titleKey: "common.report-col.sales-per-guest",
1303
- shortTitleKey: "common.report-col.sales-per-guest.short",
1304
- infoTextKey: "common.report-col.sales-per-guest.info"
1305
- },
1306
- salesPerGuestLw: {
1307
- titleKey: "common.report-col.sales-per-guest-lw",
1308
- shortTitleKey: "common.report-col.sales-per-guest-lw.short",
1309
- infoTextKey: "common.report-col.sales-per-guest-lw.info"
1310
- },
1311
- salesPerGuestLy: {
1312
- titleKey: "common.report-col.sales-per-guest-ly",
1313
- shortTitleKey: "common.report-col.sales-per-guest-ly.short",
1314
- infoTextKey: "common.report-col.sales-per-guest-ly.info"
1315
- },
1316
- scheduledShiftEnd: {
1317
- titleKey: "common.report-col.scheduled-shift-end",
1318
- shortTitleKey: "common.report-col.scheduled-shift-end.short",
1319
- infoTextKey: "common.report-col.scheduled-shift-end.info"
1320
- },
1321
- scheduledShiftStart: {
1322
- titleKey: "common.report-col.scheduled-shift-start",
1323
- shortTitleKey: "common.report-col.scheduled-shift-start.short",
1324
- infoTextKey: "common.report-col.scheduled-shift-start.info"
1325
- },
1326
- settlementBatchDate: {
1327
- titleKey: "common.report-col.settlement-batch-date",
1328
- shortTitleKey: "common.report-col.settlement-batch-date.short",
1329
- infoTextKey: "common.report-col.settlement-batch-date.info"
1330
- },
1331
- shiftDurationHrs: {
1332
- titleKey: "common.report-col.shift-duration-hrs",
1333
- shortTitleKey: "common.report-col.shift-duration-hrs.short",
1334
- infoTextKey: "common.report-col.shift-duration-hrs.info"
1335
- },
1336
- salePaymentType: {
1337
- titleKey: "common.report-col.sale-payment-type",
1338
- shortTitleKey: "common.report-col.sale-payment-type.short",
1339
- infoTextKey: "common.report-col.sale-payment-type.info"
1340
- },
1341
- status: {
1342
- titleKey: "common.report-col.status",
1343
- shortTitleKey: "common.report-col.status.short",
1344
- infoTextKey: "common.report-col.status.info"
1345
- },
1346
- subtotal: {
1347
- titleKey: "common.report-col.subtotal",
1348
- shortTitleKey: "common.report-col.subtotal.short",
1349
- infoTextKey: "common.report-col.subtotal.info"
1350
- },
1351
- taxCollected: {
1352
- titleKey: "common.report-col.tax-collected",
1353
- shortTitleKey: "common.report-col.tax-collected.short",
1354
- infoTextKey: "common.report-col.tax-collected.info"
1355
- },
1356
- taxName: {
1357
- titleKey: "common.report-col.tax-name",
1358
- shortTitleKey: "common.report-col.tax-name.short",
1359
- infoTextKey: "common.report-col.tax-name.info"
1360
- },
1361
- taxRate: {
1362
- titleKey: "common.report-col.tax-rate",
1363
- shortTitleKey: "common.report-col.tax-rate.short",
1364
- infoTextKey: "common.report-col.tax-rate.info"
1365
- },
1366
- taxableSales: {
1367
- titleKey: "common.report-col.taxable-sales",
1368
- shortTitleKey: "common.report-col.taxable-sales.short",
1369
- infoTextKey: "common.report-col.taxable-sales.info"
1370
- },
1371
- ticketClosed: {
1372
- titleKey: "common.report-col.ticket-closed",
1373
- shortTitleKey: "common.report-col.ticket-closed.short",
1374
- infoTextKey: "common.report-col.ticket-closed.info"
1375
- },
1376
- ticketFee: {
1377
- titleKey: "common.report-col.ticket-fee",
1378
- shortTitleKey: "common.report-col.ticket-fee.short",
1379
- infoTextKey: "common.report-col.ticket-fee.info"
1380
- },
1381
- ticketNumber: {
1382
- titleKey: "common.report-col.ticket-number",
1383
- shortTitleKey: "common.report-col.ticket-number.short",
1384
- infoTextKey: "common.report-col.ticket-number.info"
1385
- },
1386
- ticketOpen: {
1387
- titleKey: "common.report-col.ticket-open",
1388
- shortTitleKey: "common.report-col.ticket-open.short",
1389
- infoTextKey: "common.report-col.ticket-open.info"
1390
- },
1391
- ticketTotal: {
1392
- titleKey: "common.report-col.ticket-total",
1393
- shortTitleKey: "common.report-col.ticket-total.short",
1394
- infoTextKey: "common.report-col.ticket-total.info"
1395
- },
1396
- timeOpenMins: {
1397
- titleKey: "common.report-col.time-open-mins",
1398
- shortTitleKey: "common.report-col.time-open-mins.short",
1399
- infoTextKey: "common.report-col.time-open-mins.info"
1400
- },
1401
- tipPct: {
1402
- titleKey: "common.report-col.tip-pct",
1403
- shortTitleKey: "common.report-col.tip-pct.short",
1404
- infoTextKey: "common.report-col.tip-pct.info"
1405
- },
1406
- tipReduction: {
1407
- titleKey: "common.report-col.tip-reduction",
1408
- shortTitleKey: "common.report-col.tip-reduction.short",
1409
- infoTextKey: "common.report-col.tip-reduction.info"
1410
- },
1411
- tipShare: {
1412
- titleKey: "common.report-col.tip-share",
1413
- shortTitleKey: "common.report-col.tip-share.short",
1414
- infoTextKey: "common.report-col.tip-share.info"
1415
- },
1416
- tips: {
1417
- titleKey: "common.report-col.tips",
1418
- shortTitleKey: "common.report-col.tips.short",
1419
- infoTextKey: "common.report-col.tips.info"
1420
- },
1421
- tipsPerHour: {
1422
- titleKey: "common.report-col.tips-per-hour",
1423
- shortTitleKey: "common.report-col.tips-per-hour.short",
1424
- infoTextKey: "common.report-col.tips-per-hour.info"
1425
- },
1426
- totalCollected: {
1427
- titleKey: "common.report-col.total-collected",
1428
- shortTitleKey: "common.report-col.total-collected.short",
1429
- infoTextKey: "common.report-col.total-collected.info"
1430
- },
1431
- totalItemSales: {
1432
- titleKey: "common.report-col.total-item-sales",
1433
- shortTitleKey: "common.report-col.total-item-sales.short",
1434
- infoTextKey: "common.report-col.total-item-sales.info"
1435
- },
1436
- totalModifierSales: {
1437
- titleKey: "common.report-col.total-modifier-sales",
1438
- shortTitleKey: "common.report-col.total-modifier-sales.short",
1439
- infoTextKey: "common.report-col.total-modifier-sales.info"
1440
- },
1441
- totalReturns: {
1442
- titleKey: "common.report-col.total-returns",
1443
- shortTitleKey: "common.report-col.total-returns.short",
1444
- infoTextKey: "common.report-col.total-returns.info"
1445
- },
1446
- totalSales: {
1447
- titleKey: "common.report-col.total-sales",
1448
- shortTitleKey: "common.report-col.total-sales.short",
1449
- infoTextKey: "common.report-col.total-sales.info"
1450
- },
1451
- totalTips: {
1452
- titleKey: "common.report-col.total-tips",
1453
- shortTitleKey: "common.report-col.total-tips.short",
1454
- infoTextKey: "common.report-col.total-tips.info"
1455
- },
1456
- transactionDate: {
1457
- titleKey: "common.report-col.transaction-date",
1458
- shortTitleKey: "common.report-col.transaction-date.short",
1459
- infoTextKey: "common.report-col.transaction-date.info"
1460
- },
1461
- transactionType: {
1462
- titleKey: "common.report-col.transaction-type",
1463
- shortTitleKey: "common.report-col.transaction-type.short",
1464
- infoTextKey: "common.report-col.transaction-type.info"
1465
- },
1466
- untaxedSales: {
1467
- titleKey: "common.report-col.untaxed-sales",
1468
- shortTitleKey: "common.report-col.untaxed-sales.short",
1469
- infoTextKey: "common.report-col.untaxed-sales.info"
1470
- },
1471
- visa: {
1472
- titleKey: "common.report-col.visa",
1473
- shortTitleKey: "common.report-col.visa.short",
1474
- infoTextKey: "common.report-col.visa.info"
1475
- },
1476
- visaReturns: {
1477
- titleKey: "common.report-col.visa-returns",
1478
- shortTitleKey: "common.report-col.visa-returns.short",
1479
- infoTextKey: "common.report-col.visa-returns.info"
1480
- },
1481
- paymentsCount: {
1482
- titleKey: "common.report-col.payments-count",
1483
- shortTitleKey: "common.report-col.payments-count.short",
1484
- infoTextKey: "common.report-col.payments-count.info"
1485
- },
1486
- paymentsAmount: {
1487
- titleKey: "common.report-col.payments-amount",
1488
- shortTitleKey: "common.report-col.payments-amount.short",
1489
- infoTextKey: "common.report-col.payments-amount.info"
1490
- },
1491
- paymentsTotal: {
1492
- titleKey: "common.report-col.payments-total",
1493
- shortTitleKey: "common.report-col.payments-total.short",
1494
- infoTextKey: "common.report-col.payments-total.info"
1495
- },
1496
- refundVoidDescription: {
1497
- titleKey: "common.report-col.refund-void-description",
1498
- shortTitleKey: "common.report-col.refund-void-description.short",
1499
- infoTextKey: "common.report-col.refund-void-description.info"
1500
- },
1501
- refundVoidCount: {
1502
- titleKey: "common.report-col.refund-void-count",
1503
- shortTitleKey: "common.report-col.refund-void-count.short",
1504
- infoTextKey: "common.report-col.refund-void-count.info"
1505
- },
1506
- refundVoidAmount: {
1507
- titleKey: "common.report-col.refund-void-amount",
1508
- shortTitleKey: "common.report-col.refund-void-amount.short",
1509
- infoTextKey: "common.report-col.refund-void-amount.info"
1510
- },
1511
- refundVoidPctSales: {
1512
- titleKey: "common.report-col.refund-void-pct-sales",
1513
- shortTitleKey: "common.report-col.refund-void-pct-sales.short",
1514
- infoTextKey: "common.report-col.refund-void-pct-sales.info"
1515
- },
1516
- discountName: {
1517
- titleKey: "common.report-col.discount-name",
1518
- shortTitleKey: "common.report-col.discount-name.short",
1519
- infoTextKey: "common.report-col.discount-name.info"
1520
- },
1521
- tickets: {
1522
- titleKey: "common.report-col.tickets",
1523
- shortTitleKey: "common.report-col.tickets.short",
1524
- infoTextKey: "common.report-col.tickets.info"
1525
- },
1526
- guests: {
1527
- titleKey: "common.report-col.guests",
1528
- shortTitleKey: "common.report-col.guests.short",
1529
- infoTextKey: "common.report-col.guests.info"
1530
- },
1531
- ticketAverage: {
1532
- titleKey: "common.report-col.ticket-average",
1533
- shortTitleKey: "common.report-col.ticket-average.short",
1534
- infoTextKey: "common.report-col.ticket-average.info"
1535
- },
1536
- guestAverage: {
1537
- titleKey: "common.report-col.guest-average",
1538
- shortTitleKey: "common.report-col.guest-average.short",
1539
- infoTextKey: "common.report-col.guest-average.info"
1540
- },
1541
- net: {
1542
- titleKey: "common.report-col.net",
1543
- shortTitleKey: "common.report-col.net.short",
1544
- infoTextKey: "common.report-col.net.info"
1545
- },
1546
- type: {
1547
- titleKey: "common.report-col.type",
1548
- shortTitleKey: "common.report-col.type.short"
1549
- }
1550
- };
1551
- function getColumnMetadata(key) {
1552
- return COLUMN_REGISTRY[key];
1553
- }
1554
- function getColumnExportHeaderLabel(colTitle, groupTitle) {
1555
- if (groupTitle) {
1556
- return `${groupTitle}: ${colTitle}`;
1557
- }
1558
- return colTitle;
1559
- }
14
+ dailySalesTrendsOrderTypeConfig,
15
+ employeeTimecardConfig,
16
+ employeeTipConfig,
17
+ formatDate,
18
+ formatFieldValue,
19
+ formatFixedNumber,
20
+ formatInteger,
21
+ formatMoney,
22
+ formatMoneyWithoutSymbol,
23
+ formatPercent,
24
+ formatString,
25
+ formatTime,
26
+ getColumnExportHeaderLabel,
27
+ getColumnMetadata,
28
+ getDateToFormat,
29
+ getNumberToFormat,
30
+ getReportConfig,
31
+ getReportExportFileName,
32
+ getReportFormattingLocaleOptions,
33
+ itemTaxConfig,
34
+ modifierMixConfig,
35
+ productMixConfig,
36
+ resolveTranslate,
37
+ salesByItemDetailConfig,
38
+ salesSummaryConfig,
39
+ ticketLiveConfig,
40
+ ticketSummaryConfig
41
+ } from "./chunk-7NXZJEGU.js";
1560
42
 
1561
43
  // src/utils/alignment.ts
1562
44
  function getColumnAlignment(type) {
@@ -1569,61 +51,8 @@ function isNumericType(type) {
1569
51
  return type === "money" || type === "number" || type === "percent" || type === "fixedNumber";
1570
52
  }
1571
53
 
1572
- // src/totals.ts
1573
- var sumField = (rows, field) => rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
1574
- var calculateFieldTotal = (rows, field, config) => {
1575
- const { type } = config;
1576
- if (!type || type === "string" || type === "date" || type === "time" || type === "boolean" || type === "conditional") {
1577
- return null;
1578
- }
1579
- const calc = config.footerCalculation;
1580
- if (calc?.type === "none") {
1581
- return null;
1582
- }
1583
- if (calc?.type === "count") {
1584
- return rows.length;
1585
- }
1586
- if (!calc || calc.type === "sum") {
1587
- return config.columnKey || calc?.type === "sum" ? sumField(rows, field) : 0;
1588
- }
1589
- const { numeratorField, denominatorField } = calc;
1590
- if (!numeratorField || !denominatorField) {
1591
- return 0;
1592
- }
1593
- const num = sumField(rows, numeratorField);
1594
- const den = sumField(rows, denominatorField);
1595
- if (calc.type === "percentChange") {
1596
- return den ? (num - den) / den : 0;
1597
- }
1598
- if (calc.type === "variancePercent") {
1599
- const prior = den - num;
1600
- return prior ? num / prior : 0;
1601
- }
1602
- if (calc.type === "average") {
1603
- return den > 0 ? num / den : 0;
1604
- }
1605
- if (calc.type === "quotientOfDifferences") {
1606
- const { numeratorAdjustField, denominatorAdjustField } = calc;
1607
- const numAdj = numeratorAdjustField ? sumField(rows, numeratorAdjustField) : 0;
1608
- const denAdj = denominatorAdjustField ? sumField(rows, denominatorAdjustField) : 0;
1609
- const effectiveDen = den - denAdj;
1610
- return effectiveDen !== 0 ? (num - numAdj) / effectiveDen : 0;
1611
- }
1612
- return 0;
1613
- };
1614
- var calculateReportTotals = (data, fieldConfig, opts) => {
1615
- const { labelField, label } = opts;
1616
- const result = {};
1617
- for (const [field, config] of Object.entries(fieldConfig)) {
1618
- const total = calculateFieldTotal(data, field, config);
1619
- result[field] = total ?? "";
1620
- }
1621
- result[labelField] = label;
1622
- return result;
1623
- };
1624
-
1625
54
  // src/reports/dailySalesLive.ts
1626
- var FIELDS17 = {
55
+ var FIELDS = {
1627
56
  groupById: { type: "string" },
1628
57
  groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
1629
58
  itemsQuantity: { type: "number", columnKey: "quantity" },
@@ -1643,7 +72,7 @@ var DAILY_SALES_LIVE_AVAILABLE_COLUMNS = [
1643
72
  "salesMixPct"
1644
73
  ];
1645
74
  var dailySalesLiveConfig = {
1646
- fields: FIELDS17,
75
+ fields: FIELDS,
1647
76
  availableColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
1648
77
  defaultVisibleColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
1649
78
  hasFooter: true
@@ -1704,7 +133,7 @@ var DAILY_SALES_SECTIONS = [
1704
133
  { fieldKey: "taxName", columnKey: "taxName" },
1705
134
  { fieldKey: "taxableSales", columnKey: "taxableSales" },
1706
135
  { fieldKey: "taxesAmount", columnKey: "taxCollected" },
1707
- { fieldKey: "exemptSales", columnKey: "exemptTaxes" }
136
+ { fieldKey: "exemptSales", columnKey: "exemptSales" }
1708
137
  ]
1709
138
  },
1710
139
  {
@@ -1756,145 +185,6 @@ var REPORT_SECTION_CONFIGS = {
1756
185
  [Report.DAILY_SALES]: DAILY_SALES_SECTIONS,
1757
186
  [Report.DAILY_SALES_LIVE]: DAILY_SALES_SECTIONS
1758
187
  };
1759
-
1760
- // src/formatting.ts
1761
- var dateFormatterCache = /* @__PURE__ */ new Map();
1762
- var timeFormatterCache = /* @__PURE__ */ new Map();
1763
- var moneyFormatterCache = /* @__PURE__ */ new Map();
1764
- var numberFormatterCache = /* @__PURE__ */ new Map();
1765
- var getDateFormatter = (locale, timeZone) => {
1766
- const key = `${locale}-${timeZone}`;
1767
- let fmt = dateFormatterCache.get(key);
1768
- if (!fmt) {
1769
- fmt = new Intl.DateTimeFormat(locale, { dateStyle: "short", timeZone });
1770
- dateFormatterCache.set(key, fmt);
1771
- }
1772
- return fmt;
1773
- };
1774
- var getTimeFormatter = (locale, timeZone, format) => {
1775
- const key = `${locale}-${timeZone}-${format}`;
1776
- let fmt = timeFormatterCache.get(key);
1777
- if (!fmt) {
1778
- if (format === "00:00") {
1779
- fmt = new Intl.DateTimeFormat(locale, { hour: "2-digit", minute: "2-digit", timeZone });
1780
- } else if (format === "00:00-24H") {
1781
- fmt = new Intl.DateTimeFormat(locale, {
1782
- hour: "2-digit",
1783
- minute: "2-digit",
1784
- hour12: false,
1785
- hourCycle: "h23",
1786
- timeZone
1787
- });
1788
- } else {
1789
- fmt = new Intl.DateTimeFormat(locale, { hour: "2-digit", minute: "2-digit", second: "2-digit", timeZone });
1790
- }
1791
- timeFormatterCache.set(key, fmt);
1792
- }
1793
- return fmt;
1794
- };
1795
- var getMoneyFormatter = (locale, currency, decimals) => {
1796
- const key = `${locale}-${currency}-${decimals}`;
1797
- let fmt = moneyFormatterCache.get(key);
1798
- if (!fmt) {
1799
- fmt = new Intl.NumberFormat(locale, {
1800
- style: "currency",
1801
- currency,
1802
- minimumFractionDigits: decimals,
1803
- maximumFractionDigits: decimals
1804
- });
1805
- moneyFormatterCache.set(key, fmt);
1806
- }
1807
- return fmt;
1808
- };
1809
- var getNumberFormatter = (locale, decimals) => {
1810
- const key = `${locale}-${decimals}`;
1811
- let fmt = numberFormatterCache.get(key);
1812
- if (!fmt) {
1813
- fmt = new Intl.NumberFormat(locale, { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
1814
- numberFormatterCache.set(key, fmt);
1815
- }
1816
- return fmt;
1817
- };
1818
- var formatDate = (date, options = {}) => {
1819
- const { locale = "en-US", timeZone = "UTC" } = options;
1820
- return getDateFormatter(locale, timeZone).format(date);
1821
- };
1822
- var formatTime = (date, options) => {
1823
- const { locale = "en-US", timeZone = "UTC", format } = options;
1824
- const d = new Date(date);
1825
- return getTimeFormatter(locale, timeZone, format).format(d);
1826
- };
1827
- var formatMoney = (amount, options = {}) => {
1828
- const { locale = "en-US", currency = "USD", decimals = 2 } = options;
1829
- return getMoneyFormatter(locale, currency, decimals).format(amount);
1830
- };
1831
- var formatPercent = (value, decimals = 2) => `${value.toFixed(decimals)}%`;
1832
- var formatInteger = (value) => Math.round(value).toString();
1833
- var formatFixedNumber = (value, decimals = 2) => value.toFixed(decimals);
1834
- var formatString = (value) => {
1835
- return value == null ? "" : typeof value === "string" ? value : typeof value === "number" || typeof value === "boolean" ? String(value) : "";
1836
- };
1837
- var getNumberToFormat = (value) => typeof value === "number" ? value : 0;
1838
- var getDateToFormat = (value) => {
1839
- if (value instanceof Date) {
1840
- return isNaN(value.getTime()) ? null : value;
1841
- }
1842
- if (typeof value === "string" || typeof value === "number") {
1843
- const d = new Date(value);
1844
- return isNaN(d.getTime()) ? null : d;
1845
- }
1846
- return null;
1847
- };
1848
- var formatMoneyWithoutSymbol = (amount, options = {}) => {
1849
- const { locale = "en-US", decimals = 2 } = options;
1850
- return getNumberFormatter(locale, decimals).format(amount);
1851
- };
1852
- var getReportFormattingLocaleOptions = (locations) => {
1853
- if (locations.length === 0) {
1854
- return [{ currency: "USD", locale: "en-US" }];
1855
- }
1856
- return Array.from(
1857
- new Map(
1858
- locations.map((loc) => ({
1859
- currency: loc.currency,
1860
- locale: `${loc.language ?? "en"}-${loc.countryCode}`
1861
- })).map((item) => [`${item.currency}-${item.locale}`, item])
1862
- ).values()
1863
- );
1864
- };
1865
- var DEFAULT_FIELD_CONFIG = { type: "string" };
1866
- var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DEFAULT_FIELD_CONFIG) => {
1867
- const { currency, locale } = localeOptions;
1868
- switch (type) {
1869
- case "conditional": {
1870
- if (!fullRecord) {
1871
- return formatString(value);
1872
- }
1873
- const conditionalConfig = fieldConfig.conditionalConfiguration;
1874
- const configType = conditionalConfig.conditionalFormat(fullRecord[conditionalConfig.conditionalField]);
1875
- return formatFieldValue(value, configType, localeOptions, fullRecord, fieldConfig);
1876
- }
1877
- case "string":
1878
- return formatString(value);
1879
- case "money":
1880
- return formatMoney(getNumberToFormat(value), { currency, locale });
1881
- case "percent":
1882
- return formatPercent(getNumberToFormat(value) * 100);
1883
- case "fixedNumber":
1884
- return formatFixedNumber(getNumberToFormat(value));
1885
- case "date": {
1886
- const d = getDateToFormat(value);
1887
- return d ? formatDate(d, { locale }) : "";
1888
- }
1889
- case "time": {
1890
- const d = getDateToFormat(value);
1891
- return d ? formatTime(d, { locale, format: "00:00:00" }) : "";
1892
- }
1893
- case "number":
1894
- default:
1895
- return String(getNumberToFormat(value));
1896
- }
1897
- };
1898
188
  export {
1899
189
  COLUMN_REGISTRY,
1900
190
  DAILY_SALES_CASH_ROW_LABELS,
@@ -1935,6 +225,7 @@ export {
1935
225
  itemTaxConfig,
1936
226
  modifierMixConfig,
1937
227
  productMixConfig,
228
+ resolveTranslate,
1938
229
  salesByItemDetailConfig,
1939
230
  salesSummaryConfig,
1940
231
  ticketLiveConfig,