@harbortouch/skytab-analytics-report-utils 0.21.0 → 0.22.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/{chunk-7NXZJEGU.js → chunk-2UW4QVTT.js} +670 -584
- package/dist/exporters/exportBuilder.cjs +2865 -2779
- package/dist/exporters/exportBuilder.d.cts +1 -1
- package/dist/exporters/exportBuilder.d.ts +1 -1
- package/dist/exporters/exportBuilder.js +5 -8
- package/dist/index.cjs +178 -105
- package/dist/index.d.cts +22 -15
- package/dist/index.d.ts +22 -15
- package/dist/index.js +19 -34
- package/dist/{report-BOL9p86o.d.cts → report-DklnjPk7.d.cts} +13 -5
- package/dist/{report-BOL9p86o.d.ts → report-DklnjPk7.d.ts} +13 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -28,12 +28,10 @@ __export(index_exports, {
|
|
|
28
28
|
TENDER_TYPE: () => TENDER_TYPE,
|
|
29
29
|
buildDailySalesCashPayments: () => buildDailySalesCashPayments,
|
|
30
30
|
buildDailySalesRevClassFooter: () => buildDailySalesRevClassFooter,
|
|
31
|
-
calculateFieldTotal: () => calculateFieldTotal,
|
|
32
31
|
calculateReportTotals: () => calculateReportTotals,
|
|
33
32
|
dailySalesCacheConfig: () => dailySalesCacheConfig,
|
|
34
33
|
dailySalesConfig: () => dailySalesConfig,
|
|
35
34
|
dailySalesDiscountsConfig: () => dailySalesDiscountsConfig,
|
|
36
|
-
dailySalesLiveConfig: () => dailySalesLiveConfig,
|
|
37
35
|
dailySalesPaymentsConfig: () => dailySalesPaymentsConfig,
|
|
38
36
|
dailySalesRefundsVoidsConfig: () => dailySalesRefundsVoidsConfig,
|
|
39
37
|
dailySalesTaxesConfig: () => dailySalesTaxesConfig,
|
|
@@ -54,6 +52,7 @@ __export(index_exports, {
|
|
|
54
52
|
getColumnExportHeaderLabel: () => getColumnExportHeaderLabel,
|
|
55
53
|
getColumnMetadata: () => getColumnMetadata,
|
|
56
54
|
getDateToFormat: () => getDateToFormat,
|
|
55
|
+
getFooterValue: () => getFooterValue,
|
|
57
56
|
getNumberToFormat: () => getNumberToFormat,
|
|
58
57
|
getReportConfig: () => getReportConfig,
|
|
59
58
|
getReportExportFileName: () => getReportExportFileName,
|
|
@@ -124,7 +123,7 @@ var FIRST_COLUMN_WIDTH = 240;
|
|
|
124
123
|
// src/reports/salesSummary.ts
|
|
125
124
|
var FIELDS2 = {
|
|
126
125
|
groupById: { type: "number" },
|
|
127
|
-
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
126
|
+
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
|
|
128
127
|
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
129
128
|
salesVarLW: { type: "money", columnKey: "salesVarLw" },
|
|
130
129
|
salesVarLY: { type: "money", columnKey: "salesVarLy" },
|
|
@@ -233,6 +232,7 @@ var COLUMN_GROUPS = [
|
|
|
233
232
|
}
|
|
234
233
|
];
|
|
235
234
|
var SALES_SUMMARY_AVAILABLE_COLUMNS = [
|
|
235
|
+
"groupByName",
|
|
236
236
|
"salesAmountNet",
|
|
237
237
|
"salesVarLW",
|
|
238
238
|
"salesVarLWPct",
|
|
@@ -258,72 +258,87 @@ var salesSummaryConfig = {
|
|
|
258
258
|
|
|
259
259
|
// src/reports/ticketSummary.ts
|
|
260
260
|
var FIELDS3 = {
|
|
261
|
-
ticketId: { type: "string" },
|
|
262
|
-
locationId: { type: "number" },
|
|
263
|
-
orderName: { type: "string" },
|
|
264
|
-
revenueCenterName: { type: "string", columnKey: "revenueCenter" },
|
|
265
|
-
daypartName: { type: "string", columnKey: "daypart" },
|
|
261
|
+
ticketId: { type: "string", filteringAvailable: false },
|
|
262
|
+
locationId: { type: "number", filteringAvailable: false },
|
|
263
|
+
orderName: { type: "string", filteringAvailable: false },
|
|
264
|
+
revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
|
|
265
|
+
daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
|
|
266
266
|
inclusiveTaxesAmount: {
|
|
267
267
|
type: "money",
|
|
268
268
|
columnKey: "inclusiveTax",
|
|
269
|
-
footerCalculation: { type: "sum" }
|
|
269
|
+
footerCalculation: { type: "sum" },
|
|
270
|
+
filteringAvailable: false
|
|
270
271
|
},
|
|
271
|
-
locationName: { type: "string", size: 240, columnKey: "locationName" },
|
|
272
|
-
orderNumber: {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
locationName: { type: "string", size: 240, columnKey: "locationName", filteringAvailable: false },
|
|
273
|
+
orderNumber: {
|
|
274
|
+
type: "string",
|
|
275
|
+
columnKey: "ticketNumber",
|
|
276
|
+
footerCalculation: { type: "label", label: "table.total" },
|
|
277
|
+
filteringAvailable: false
|
|
278
|
+
},
|
|
279
|
+
businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
|
|
280
|
+
ticketOpenedAt: { type: "time", columnKey: "ticketOpen", filteringAvailable: false },
|
|
281
|
+
ticketClosedAt: { type: "time", columnKey: "ticketClosed", filteringAvailable: false },
|
|
282
|
+
ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false, filteringAvailable: false },
|
|
277
283
|
ticketSubtotal: {
|
|
278
284
|
type: "money",
|
|
279
285
|
columnKey: "subtotal",
|
|
280
|
-
footerCalculation: { type: "sum" }
|
|
286
|
+
footerCalculation: { type: "sum" },
|
|
287
|
+
filteringAvailable: false
|
|
281
288
|
},
|
|
282
289
|
discountsAmount: {
|
|
283
290
|
type: "money",
|
|
284
291
|
columnKey: "discountAmount",
|
|
285
|
-
footerCalculation: { type: "sum" }
|
|
292
|
+
footerCalculation: { type: "sum" },
|
|
293
|
+
filteringAvailable: false
|
|
286
294
|
},
|
|
287
295
|
surchargesAmount: {
|
|
288
296
|
type: "money",
|
|
289
297
|
columnKey: "ticketFee",
|
|
290
|
-
footerCalculation: { type: "sum" }
|
|
298
|
+
footerCalculation: { type: "sum" },
|
|
299
|
+
filteringAvailable: false
|
|
291
300
|
},
|
|
292
301
|
taxesAmount: {
|
|
293
302
|
type: "money",
|
|
294
303
|
columnKey: "taxCollected",
|
|
295
|
-
footerCalculation: { type: "sum" }
|
|
304
|
+
footerCalculation: { type: "sum" },
|
|
305
|
+
filteringAvailable: false
|
|
296
306
|
},
|
|
297
307
|
ticketGrandTotal: {
|
|
298
308
|
type: "money",
|
|
299
309
|
columnKey: "grandTotal",
|
|
300
|
-
footerCalculation: { type: "sum" }
|
|
310
|
+
footerCalculation: { type: "sum" },
|
|
311
|
+
filteringAvailable: false
|
|
301
312
|
},
|
|
302
313
|
gratuitiesAmount: {
|
|
303
314
|
type: "money",
|
|
304
315
|
columnKey: "autoGratuity",
|
|
305
|
-
footerCalculation: { type: "sum" }
|
|
316
|
+
footerCalculation: { type: "sum" },
|
|
317
|
+
filteringAvailable: false
|
|
306
318
|
},
|
|
307
319
|
tipAmount: {
|
|
308
320
|
type: "money",
|
|
309
321
|
columnKey: "tips",
|
|
310
|
-
footerCalculation: { type: "sum" }
|
|
322
|
+
footerCalculation: { type: "sum" },
|
|
323
|
+
filteringAvailable: false
|
|
311
324
|
},
|
|
312
325
|
paymentsAmount: {
|
|
313
326
|
type: "money",
|
|
314
327
|
columnKey: "totalCollected",
|
|
315
|
-
footerCalculation: { type: "sum" }
|
|
328
|
+
footerCalculation: { type: "sum" },
|
|
329
|
+
filteringAvailable: false
|
|
316
330
|
},
|
|
317
|
-
paymentTypeName: { type: "string", columnKey: "paymentType" },
|
|
331
|
+
paymentTypeName: { type: "string", columnKey: "paymentType", filteringAvailable: false },
|
|
318
332
|
guestsCount: {
|
|
319
333
|
type: "number",
|
|
320
334
|
columnKey: "guestCount",
|
|
321
|
-
footerCalculation: { type: "sum" }
|
|
335
|
+
footerCalculation: { type: "sum" },
|
|
336
|
+
filteringAvailable: false
|
|
322
337
|
},
|
|
323
|
-
employeeName: { type: "string", columnKey: "employeeName" },
|
|
324
|
-
orderTypeName: { type: "string", columnKey: "orderType" }
|
|
338
|
+
employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
|
|
339
|
+
orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false }
|
|
325
340
|
};
|
|
326
|
-
var
|
|
341
|
+
var TICKET_SUMMARY_VISIBLE_COLUMNS = [
|
|
327
342
|
"locationName",
|
|
328
343
|
"businessDate",
|
|
329
344
|
"ticketOpenedAt",
|
|
@@ -342,10 +357,11 @@ var TICKET_SUMMARY_AVAILABLE_COLUMNS = [
|
|
|
342
357
|
"employeeName",
|
|
343
358
|
"orderTypeName"
|
|
344
359
|
];
|
|
360
|
+
var TICKET_SUMMARY_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_SUMMARY_VISIBLE_COLUMNS];
|
|
345
361
|
var ticketSummaryConfig = {
|
|
346
362
|
fields: FIELDS3,
|
|
347
363
|
availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
|
|
348
|
-
defaultVisibleColumns:
|
|
364
|
+
defaultVisibleColumns: TICKET_SUMMARY_VISIBLE_COLUMNS,
|
|
349
365
|
hasFooter: true
|
|
350
366
|
};
|
|
351
367
|
|
|
@@ -353,9 +369,9 @@ var ticketSummaryConfig = {
|
|
|
353
369
|
var FIELDS4 = {
|
|
354
370
|
locationName: { type: "string", columnKey: "locationName" },
|
|
355
371
|
orderNumber: {
|
|
356
|
-
type: "
|
|
372
|
+
type: "string",
|
|
357
373
|
columnKey: "ticketNumber",
|
|
358
|
-
footerCalculation: { type: "
|
|
374
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
359
375
|
},
|
|
360
376
|
dateOpen: { type: "string", columnKey: "date" },
|
|
361
377
|
timeOpen: { type: "string", columnKey: "ticketOpen" },
|
|
@@ -380,9 +396,8 @@ var FIELDS4 = {
|
|
|
380
396
|
employeeName: { type: "string", columnKey: "employeeName" },
|
|
381
397
|
orderType: { type: "string", columnKey: "orderType" }
|
|
382
398
|
};
|
|
383
|
-
var
|
|
399
|
+
var TICKET_LIVE_VISIBLE_COLUMNS = [
|
|
384
400
|
"locationName",
|
|
385
|
-
"orderNumber",
|
|
386
401
|
"dateOpen",
|
|
387
402
|
"timeOpen",
|
|
388
403
|
"timeClose",
|
|
@@ -400,17 +415,18 @@ var TICKET_LIVE_AVAILABLE_COLUMNS = [
|
|
|
400
415
|
"employeeName",
|
|
401
416
|
"orderType"
|
|
402
417
|
];
|
|
418
|
+
var TICKET_LIVE_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_LIVE_VISIBLE_COLUMNS];
|
|
403
419
|
var ticketLiveConfig = {
|
|
404
420
|
fields: FIELDS4,
|
|
405
421
|
availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
|
|
406
|
-
defaultVisibleColumns:
|
|
422
|
+
defaultVisibleColumns: TICKET_LIVE_VISIBLE_COLUMNS,
|
|
407
423
|
hasFooter: true
|
|
408
424
|
};
|
|
409
425
|
|
|
410
426
|
// src/reports/productMix.ts
|
|
411
427
|
var FIELDS5 = {
|
|
412
428
|
groupById: { type: "string" },
|
|
413
|
-
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
429
|
+
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
|
|
414
430
|
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
415
431
|
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
416
432
|
inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
|
|
@@ -427,7 +443,7 @@ var FIELDS5 = {
|
|
|
427
443
|
},
|
|
428
444
|
salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
|
|
429
445
|
};
|
|
430
|
-
var
|
|
446
|
+
var PRODUCT_MIX_VISIBLE_COLUMNS = [
|
|
431
447
|
"salesAmountGross",
|
|
432
448
|
"itemsQuantity",
|
|
433
449
|
"avgPrice",
|
|
@@ -436,20 +452,31 @@ var PRODUCT_MIX_AVAILABLE_COLUMNS = [
|
|
|
436
452
|
"salesAmountNet",
|
|
437
453
|
"salesMixPct"
|
|
438
454
|
];
|
|
455
|
+
var PRODUCT_MIX_AVAILABLE_COLUMNS = ["groupByName", ...PRODUCT_MIX_VISIBLE_COLUMNS];
|
|
439
456
|
var productMixConfig = {
|
|
440
457
|
fields: FIELDS5,
|
|
441
458
|
availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
|
|
442
|
-
defaultVisibleColumns:
|
|
443
|
-
chartFields:
|
|
459
|
+
defaultVisibleColumns: PRODUCT_MIX_VISIBLE_COLUMNS,
|
|
460
|
+
chartFields: PRODUCT_MIX_VISIBLE_COLUMNS,
|
|
444
461
|
hasFooter: true
|
|
445
462
|
};
|
|
446
463
|
|
|
447
464
|
// src/reports/modifierMix.ts
|
|
448
465
|
var FIELDS6 = {
|
|
449
466
|
groupById: { type: "string", filteringAvailable: false },
|
|
450
|
-
groupByName: {
|
|
467
|
+
groupByName: {
|
|
468
|
+
type: "string",
|
|
469
|
+
size: FIRST_COLUMN_WIDTH,
|
|
470
|
+
filteringAvailable: false,
|
|
471
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
472
|
+
},
|
|
451
473
|
groupById2: { type: "string", filteringAvailable: false },
|
|
452
|
-
groupByName2: {
|
|
474
|
+
groupByName2: {
|
|
475
|
+
type: "string",
|
|
476
|
+
size: FIRST_COLUMN_WIDTH,
|
|
477
|
+
filteringAvailable: false,
|
|
478
|
+
footerCalculation: { type: "none" }
|
|
479
|
+
},
|
|
453
480
|
modifiersSales: { type: "money", columnKey: "totalModifierSales" },
|
|
454
481
|
modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
|
|
455
482
|
itemsQuantity: {
|
|
@@ -510,11 +537,16 @@ var FIELDS6 = {
|
|
|
510
537
|
}
|
|
511
538
|
}
|
|
512
539
|
};
|
|
513
|
-
var
|
|
540
|
+
var MODIFIER_MIX_VISIBLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
|
|
541
|
+
var MODIFIER_MIX_AVAILABLE_COLUMNS = [
|
|
542
|
+
"groupByName",
|
|
543
|
+
"groupByName2",
|
|
544
|
+
...MODIFIER_MIX_VISIBLE_COLUMNS
|
|
545
|
+
];
|
|
514
546
|
var modifierMixConfig = {
|
|
515
547
|
fields: FIELDS6,
|
|
516
548
|
availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
|
|
517
|
-
defaultVisibleColumns:
|
|
549
|
+
defaultVisibleColumns: MODIFIER_MIX_VISIBLE_COLUMNS,
|
|
518
550
|
hasFooter: true
|
|
519
551
|
};
|
|
520
552
|
|
|
@@ -596,7 +628,8 @@ var FIELDS8 = {
|
|
|
596
628
|
employeeName: {
|
|
597
629
|
type: "string",
|
|
598
630
|
size: EMPLOYEE_NAME_WIDTH,
|
|
599
|
-
columnKey: "employeeName"
|
|
631
|
+
columnKey: "employeeName",
|
|
632
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
600
633
|
},
|
|
601
634
|
isActive: {
|
|
602
635
|
type: "string",
|
|
@@ -639,7 +672,7 @@ var FIELDS8 = {
|
|
|
639
672
|
filteringAvailable: false
|
|
640
673
|
}
|
|
641
674
|
};
|
|
642
|
-
var
|
|
675
|
+
var EMPLOYEE_TIMECARD_VISIBLE_COLUMNS = [
|
|
643
676
|
"locationName",
|
|
644
677
|
"businessDate",
|
|
645
678
|
"isActive",
|
|
@@ -650,17 +683,30 @@ var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
|
|
|
650
683
|
"endTime",
|
|
651
684
|
"shiftHours"
|
|
652
685
|
];
|
|
686
|
+
var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
|
|
687
|
+
"employeeName",
|
|
688
|
+
...EMPLOYEE_TIMECARD_VISIBLE_COLUMNS
|
|
689
|
+
];
|
|
653
690
|
var employeeTimecardConfig = {
|
|
654
691
|
fields: FIELDS8,
|
|
655
692
|
availableColumns: EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS,
|
|
656
|
-
defaultVisibleColumns:
|
|
693
|
+
defaultVisibleColumns: EMPLOYEE_TIMECARD_VISIBLE_COLUMNS,
|
|
657
694
|
hasFooter: true
|
|
658
695
|
};
|
|
659
696
|
|
|
660
697
|
// src/reports/employeeTip.ts
|
|
661
698
|
var FIELDS9 = {
|
|
662
|
-
employeeName: {
|
|
663
|
-
|
|
699
|
+
employeeName: {
|
|
700
|
+
type: "string",
|
|
701
|
+
size: 220,
|
|
702
|
+
columnKey: "employeeName"
|
|
703
|
+
},
|
|
704
|
+
empId: {
|
|
705
|
+
type: "string",
|
|
706
|
+
size: 160,
|
|
707
|
+
columnKey: "employeeId",
|
|
708
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
709
|
+
},
|
|
664
710
|
payrollId: { type: "string", size: 160, columnKey: "payrollId" },
|
|
665
711
|
locationName: { type: "string", size: 220, columnKey: "locationName" },
|
|
666
712
|
status: { type: "string", size: 140, columnKey: "status" },
|
|
@@ -680,9 +726,8 @@ var FIELDS9 = {
|
|
|
680
726
|
footerCalculation: { type: "average", numeratorField: "grossTips", denominatorField: "grossSales" }
|
|
681
727
|
}
|
|
682
728
|
};
|
|
683
|
-
var
|
|
729
|
+
var VISIBLE_COLUMNS = [
|
|
684
730
|
"employeeName",
|
|
685
|
-
"empId",
|
|
686
731
|
"payrollId",
|
|
687
732
|
"locationName",
|
|
688
733
|
"status",
|
|
@@ -698,17 +743,18 @@ var AVAILABLE_COLUMNS = [
|
|
|
698
743
|
"netTips",
|
|
699
744
|
"tipPercentage"
|
|
700
745
|
];
|
|
746
|
+
var AVAILABLE_COLUMNS = ["empId", ...VISIBLE_COLUMNS];
|
|
701
747
|
var employeeTipConfig = {
|
|
702
748
|
fields: FIELDS9,
|
|
703
749
|
availableColumns: AVAILABLE_COLUMNS,
|
|
704
|
-
defaultVisibleColumns:
|
|
750
|
+
defaultVisibleColumns: VISIBLE_COLUMNS,
|
|
705
751
|
hasFooter: true
|
|
706
752
|
};
|
|
707
753
|
|
|
708
|
-
// src/reports/dailySales.ts
|
|
754
|
+
// src/reports/dailySales/dailySales.ts
|
|
709
755
|
var FIELDS10 = {
|
|
710
756
|
groupById: { type: "string" },
|
|
711
|
-
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
757
|
+
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
|
|
712
758
|
itemsQuantity: { type: "number", columnKey: "quantity" },
|
|
713
759
|
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
714
760
|
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
@@ -734,9 +780,14 @@ var dailySalesConfig = {
|
|
|
734
780
|
extraFooterRowsKey: "salesByRevClassFooter"
|
|
735
781
|
};
|
|
736
782
|
|
|
737
|
-
// src/reports/dailySalesCache.ts
|
|
783
|
+
// src/reports/dailySales/dailySalesCache.ts
|
|
738
784
|
var FIELDS11 = {
|
|
739
|
-
name: {
|
|
785
|
+
name: {
|
|
786
|
+
type: "string",
|
|
787
|
+
columnKey: "type",
|
|
788
|
+
size: FIRST_COLUMN_WIDTH,
|
|
789
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
790
|
+
},
|
|
740
791
|
amount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } }
|
|
741
792
|
};
|
|
742
793
|
var dailySalesCacheConfig = {
|
|
@@ -748,9 +799,14 @@ var dailySalesCacheConfig = {
|
|
|
748
799
|
sectionName: "common.report-section.cash"
|
|
749
800
|
};
|
|
750
801
|
|
|
751
|
-
// src/reports/dailySalesDiscounts.ts
|
|
802
|
+
// src/reports/dailySales/dailySalesDiscounts.ts
|
|
752
803
|
var FIELDS12 = {
|
|
753
|
-
discountName: {
|
|
804
|
+
discountName: {
|
|
805
|
+
type: "string",
|
|
806
|
+
columnKey: "discountName",
|
|
807
|
+
size: FIRST_COLUMN_WIDTH,
|
|
808
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
809
|
+
},
|
|
754
810
|
ticketCount: { type: "number", columnKey: "ticketCount", footerCalculation: { type: "sum" } },
|
|
755
811
|
itemCount: { type: "number", columnKey: "itemCount", footerCalculation: { type: "sum" } },
|
|
756
812
|
discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
|
|
@@ -770,9 +826,13 @@ var dailySalesDiscountsConfig = {
|
|
|
770
826
|
sectionName: "common.report-section.discounts"
|
|
771
827
|
};
|
|
772
828
|
|
|
773
|
-
// src/reports/dailySalesPayments.ts
|
|
829
|
+
// src/reports/dailySales/dailySalesPayments.ts
|
|
774
830
|
var FIELDS13 = {
|
|
775
|
-
paymentTypeName: {
|
|
831
|
+
paymentTypeName: {
|
|
832
|
+
type: "string",
|
|
833
|
+
size: FIRST_COLUMN_WIDTH,
|
|
834
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
835
|
+
},
|
|
776
836
|
paymentsCount: { type: "number", columnKey: "paymentsCount", footerCalculation: { type: "sum" } },
|
|
777
837
|
paymentsAmount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } },
|
|
778
838
|
tipsAmount: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
|
|
@@ -794,9 +854,14 @@ var dailySalesPaymentsConfig = {
|
|
|
794
854
|
sectionName: "common.report-section.payments"
|
|
795
855
|
};
|
|
796
856
|
|
|
797
|
-
// src/reports/dailySalesRefundsVoids.ts
|
|
857
|
+
// src/reports/dailySales/dailySalesRefundsVoids.ts
|
|
798
858
|
var FIELDS14 = {
|
|
799
|
-
description: {
|
|
859
|
+
description: {
|
|
860
|
+
type: "string",
|
|
861
|
+
columnKey: "refundVoidDescription",
|
|
862
|
+
size: FIRST_COLUMN_WIDTH,
|
|
863
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
864
|
+
},
|
|
800
865
|
count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
|
|
801
866
|
amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
|
|
802
867
|
pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
|
|
@@ -816,9 +881,14 @@ var dailySalesRefundsVoidsConfig = {
|
|
|
816
881
|
sectionName: "common.report-section.refunds-voids"
|
|
817
882
|
};
|
|
818
883
|
|
|
819
|
-
// src/reports/dailySalesTaxes.ts
|
|
884
|
+
// src/reports/dailySales/dailySalesTaxes.ts
|
|
820
885
|
var FIELDS15 = {
|
|
821
|
-
taxName: {
|
|
886
|
+
taxName: {
|
|
887
|
+
type: "string",
|
|
888
|
+
columnKey: "taxName",
|
|
889
|
+
size: FIRST_COLUMN_WIDTH,
|
|
890
|
+
footerCalculation: { type: "label", label: "table.total" }
|
|
891
|
+
},
|
|
822
892
|
taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "none" } },
|
|
823
893
|
taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
|
|
824
894
|
exemptSales: { type: "money", columnKey: "exemptSales", footerCalculation: { type: "sum" } }
|
|
@@ -838,10 +908,14 @@ var dailySalesTaxesConfig = {
|
|
|
838
908
|
sectionName: "common.report-section.taxes"
|
|
839
909
|
};
|
|
840
910
|
|
|
841
|
-
// src/reports/dailySalesTrends.ts
|
|
911
|
+
// src/reports/dailySales/dailySalesTrends.ts
|
|
842
912
|
var FIELDS16 = {
|
|
843
913
|
groupById: { type: "string" },
|
|
844
|
-
groupByName: {
|
|
914
|
+
groupByName: {
|
|
915
|
+
type: "string",
|
|
916
|
+
size: FIRST_COLUMN_WIDTH,
|
|
917
|
+
footerCalculation: { type: "label", label: "common.report-section.trends-footer.total-sales" }
|
|
918
|
+
},
|
|
845
919
|
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
846
920
|
ticketsCount: { type: "number", columnKey: "tickets" },
|
|
847
921
|
guestsCount: { type: "number", columnKey: "guests" },
|
|
@@ -878,7 +952,6 @@ var dailySalesTrendsConfig = {
|
|
|
878
952
|
hasFooter: true,
|
|
879
953
|
dataAccessKey: "trendsByDayPart",
|
|
880
954
|
sectionName: "common.report-section.sales-by-day-part",
|
|
881
|
-
totalsLabel: "common.report-section.trends-footer.total-sales",
|
|
882
955
|
extraFooterFields: ["salesAmountNet"]
|
|
883
956
|
};
|
|
884
957
|
var dailySalesTrendsOrderTypeConfig = {
|
|
@@ -888,7 +961,6 @@ var dailySalesTrendsOrderTypeConfig = {
|
|
|
888
961
|
hasFooter: true,
|
|
889
962
|
dataAccessKey: "trendsByOrderType",
|
|
890
963
|
sectionName: "common.report-section.sales-by-order-type",
|
|
891
|
-
totalsLabel: "common.report-section.trends-footer.total-sales",
|
|
892
964
|
extraFooterFields: ["salesAmountNet"]
|
|
893
965
|
};
|
|
894
966
|
|
|
@@ -1711,12 +1783,18 @@ function isNumericType(type) {
|
|
|
1711
1783
|
|
|
1712
1784
|
// src/totals.ts
|
|
1713
1785
|
var sumField = (rows, field) => rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
|
|
1714
|
-
var
|
|
1786
|
+
var getFooterValue = (rows, field, config) => {
|
|
1715
1787
|
const { type } = config;
|
|
1716
|
-
if (!type || type === "
|
|
1788
|
+
if (!type || type === "date" || type === "time" || type === "boolean" || type === "conditional") {
|
|
1717
1789
|
return null;
|
|
1718
1790
|
}
|
|
1719
1791
|
const calc = config.footerCalculation;
|
|
1792
|
+
if (type === "string") {
|
|
1793
|
+
if (calc?.type === "label") {
|
|
1794
|
+
return calc.label;
|
|
1795
|
+
}
|
|
1796
|
+
return null;
|
|
1797
|
+
}
|
|
1720
1798
|
if (calc?.type === "none") {
|
|
1721
1799
|
return null;
|
|
1722
1800
|
}
|
|
@@ -1755,40 +1833,15 @@ var calculateReportTotals = (data, fieldConfig, opts) => {
|
|
|
1755
1833
|
const { labelField, label } = opts;
|
|
1756
1834
|
const result = {};
|
|
1757
1835
|
for (const [field, config] of Object.entries(fieldConfig)) {
|
|
1758
|
-
const total =
|
|
1836
|
+
const total = getFooterValue(data, field, config);
|
|
1759
1837
|
result[field] = total ?? "";
|
|
1760
1838
|
}
|
|
1761
|
-
result[labelField]
|
|
1839
|
+
if (result[labelField] === "" || result[labelField] === null) {
|
|
1840
|
+
result[labelField] = label;
|
|
1841
|
+
}
|
|
1762
1842
|
return result;
|
|
1763
1843
|
};
|
|
1764
1844
|
|
|
1765
|
-
// src/reports/dailySalesLive.ts
|
|
1766
|
-
var FIELDS17 = {
|
|
1767
|
-
groupById: { type: "string" },
|
|
1768
|
-
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
1769
|
-
itemsQuantity: { type: "number", columnKey: "quantity" },
|
|
1770
|
-
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
1771
|
-
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
1772
|
-
inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
|
|
1773
|
-
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
1774
|
-
salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
|
|
1775
|
-
guestsCount: { type: "number", columnKey: "guests" }
|
|
1776
|
-
};
|
|
1777
|
-
var DAILY_SALES_LIVE_AVAILABLE_COLUMNS = [
|
|
1778
|
-
"itemsQuantity",
|
|
1779
|
-
"salesAmountGross",
|
|
1780
|
-
"discountsAmount",
|
|
1781
|
-
"inclusiveTaxesAmount",
|
|
1782
|
-
"salesAmountNet",
|
|
1783
|
-
"salesMixPct"
|
|
1784
|
-
];
|
|
1785
|
-
var dailySalesLiveConfig = {
|
|
1786
|
-
fields: FIELDS17,
|
|
1787
|
-
availableColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
|
|
1788
|
-
defaultVisibleColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
|
|
1789
|
-
hasFooter: true
|
|
1790
|
-
};
|
|
1791
|
-
|
|
1792
1845
|
// src/reports/reportSection.ts
|
|
1793
1846
|
var DAILY_SALES_CASH_ROW_LABELS = {
|
|
1794
1847
|
cashPayments: "common.report-section.cash-row.cash-payments",
|
|
@@ -1802,6 +1855,7 @@ var DAILY_SALES_REV_CLASS_FOOTER_LABELS = {
|
|
|
1802
1855
|
balancePayments: "common.report-section.rev-class-footer.balance-payments",
|
|
1803
1856
|
giftCardSales: "common.report-section.rev-class-footer.gift-card-sales",
|
|
1804
1857
|
nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue",
|
|
1858
|
+
houseAccount: "common.report-section.rev-class-footer.house-account",
|
|
1805
1859
|
totalAccountable: "common.report-section.rev-class-footer.total-accountable"
|
|
1806
1860
|
};
|
|
1807
1861
|
var DAILY_SALES_SECTIONS = [
|
|
@@ -1900,11 +1954,23 @@ var REPORT_SECTION_CONFIGS = {
|
|
|
1900
1954
|
// src/constants.ts
|
|
1901
1955
|
var TENDER_TYPE = {
|
|
1902
1956
|
CASH: "Cash",
|
|
1957
|
+
CHECK: "Check",
|
|
1958
|
+
CREDIT: "Credit",
|
|
1959
|
+
CRYPTO: "Crypto",
|
|
1960
|
+
DEBIT: "Debit",
|
|
1961
|
+
GIFT_CARD: "Gift Card",
|
|
1962
|
+
GIFT_CERTIFICATE: "Gift Certificate",
|
|
1963
|
+
HOUSE_ACCOUNT: "House Account",
|
|
1964
|
+
VIRTUAL: "Virtual",
|
|
1965
|
+
MOBILE_WALLET: "Digital Wallet",
|
|
1966
|
+
PROPERTY_MANAGEMENT_SYSTEM: "PMS",
|
|
1967
|
+
ROOM_CHARGE: "Room Charge",
|
|
1968
|
+
WALK_OUT: "Walk Out",
|
|
1903
1969
|
CASH_REFUNDS: "Cash Refunds",
|
|
1904
1970
|
UNKNOWN: "Unknown"
|
|
1905
1971
|
};
|
|
1906
1972
|
|
|
1907
|
-
// src/reports/dailySales.utils.ts
|
|
1973
|
+
// src/reports/dailySales/dailySales.utils.ts
|
|
1908
1974
|
var buildDailySalesCashPayments = (payments, paidOutAmount, gratuitiesPaidOutAmount, tipsPaidOutAmount) => [
|
|
1909
1975
|
{
|
|
1910
1976
|
name: DAILY_SALES_CASH_ROW_LABELS.cashPayments,
|
|
@@ -1915,7 +1981,7 @@ var buildDailySalesCashPayments = (payments, paidOutAmount, gratuitiesPaidOutAmo
|
|
|
1915
1981
|
{ name: DAILY_SALES_CASH_ROW_LABELS.ccTipsPaidOut, amount: tipsPaidOutAmount }
|
|
1916
1982
|
];
|
|
1917
1983
|
var buildDailySalesRevClassFooter = (inputs) => {
|
|
1918
|
-
const totalAccountable = inputs.revClassNetSales + inputs.taxTotal + inputs.gratuitiesTotal + inputs.
|
|
1984
|
+
const totalAccountable = inputs.revClassNetSales + inputs.taxTotal + inputs.gratuitiesTotal + inputs.balancePaymentsTotal + inputs.giftCardSalesTotal + inputs.nonSalesTotal - inputs.houseAccountTotal;
|
|
1919
1985
|
return [
|
|
1920
1986
|
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.taxTotal, salesAmountNet: inputs.taxTotal },
|
|
1921
1987
|
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.gratuities, salesAmountNet: inputs.gratuitiesTotal },
|
|
@@ -1925,6 +1991,7 @@ var buildDailySalesRevClassFooter = (inputs) => {
|
|
|
1925
1991
|
},
|
|
1926
1992
|
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.giftCardSales, salesAmountNet: inputs.giftCardSalesTotal },
|
|
1927
1993
|
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.nonSalesRevenue, salesAmountNet: inputs.nonSalesTotal },
|
|
1994
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.houseAccount, salesAmountNet: inputs.houseAccountTotal },
|
|
1928
1995
|
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.totalAccountable, salesAmountNet: totalAccountable }
|
|
1929
1996
|
];
|
|
1930
1997
|
};
|
|
@@ -2384,6 +2451,7 @@ var enUS = {
|
|
|
2384
2451
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2385
2452
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2386
2453
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2454
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2387
2455
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2388
2456
|
"scheduled-reports.period": false,
|
|
2389
2457
|
"components.form.field.group-by": false,
|
|
@@ -2870,6 +2938,7 @@ var enUS2 = {
|
|
|
2870
2938
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2871
2939
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2872
2940
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2941
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2873
2942
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2874
2943
|
"scheduled-reports.period": false,
|
|
2875
2944
|
"components.form.field.group-by": false,
|
|
@@ -3356,6 +3425,7 @@ var enUS3 = {
|
|
|
3356
3425
|
"common.report-section.rev-class-footer.balance-payments": "Balance Payments",
|
|
3357
3426
|
"common.report-section.rev-class-footer.gift-card-sales": "Gift Card Sales",
|
|
3358
3427
|
"common.report-section.rev-class-footer.non-sales-revenue": "Non-Sales Revenue",
|
|
3428
|
+
"common.report-section.rev-class-footer.house-account": "House Account",
|
|
3359
3429
|
"common.report-section.rev-class-footer.total-accountable": "Total Accountable",
|
|
3360
3430
|
"scheduled-reports.period": "Period",
|
|
3361
3431
|
"components.form.field.group-by": "Group By",
|
|
@@ -3481,8 +3551,12 @@ var formatMoney = (amount, options = {}) => {
|
|
|
3481
3551
|
var formatPercent = (value, decimals = 2) => `${value.toFixed(decimals)}%`;
|
|
3482
3552
|
var formatInteger = (value) => Math.round(value).toString();
|
|
3483
3553
|
var formatFixedNumber = (value, decimals = 2) => value.toFixed(decimals);
|
|
3484
|
-
var formatString = (value) => {
|
|
3485
|
-
|
|
3554
|
+
var formatString = (value, localeOptions) => {
|
|
3555
|
+
const newValue = value == null ? "" : typeof value === "string" ? value : typeof value === "number" || typeof value === "boolean" ? String(value) : "";
|
|
3556
|
+
if (newValue in en_US_default) {
|
|
3557
|
+
return resolveTranslate(newValue, localeOptions.locale);
|
|
3558
|
+
}
|
|
3559
|
+
return newValue;
|
|
3486
3560
|
};
|
|
3487
3561
|
var getNumberToFormat = (value) => typeof value === "number" ? value : 0;
|
|
3488
3562
|
var getDateToFormat = (value) => {
|
|
@@ -3518,14 +3592,14 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
3518
3592
|
switch (type) {
|
|
3519
3593
|
case "conditional": {
|
|
3520
3594
|
if (!fullRecord) {
|
|
3521
|
-
return formatString(value);
|
|
3595
|
+
return formatString(value, localeOptions);
|
|
3522
3596
|
}
|
|
3523
3597
|
const conditionalConfig = fieldConfig.conditionalConfiguration;
|
|
3524
3598
|
const configType = conditionalConfig.conditionalFormat(fullRecord[conditionalConfig.conditionalField]);
|
|
3525
3599
|
return formatFieldValue(value, configType, localeOptions, fullRecord, fieldConfig);
|
|
3526
3600
|
}
|
|
3527
3601
|
case "string":
|
|
3528
|
-
return formatString(value);
|
|
3602
|
+
return formatString(value, localeOptions);
|
|
3529
3603
|
case "money":
|
|
3530
3604
|
return formatMoney(getNumberToFormat(value), { currency, locale });
|
|
3531
3605
|
case "percent":
|
|
@@ -3555,12 +3629,10 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
3555
3629
|
TENDER_TYPE,
|
|
3556
3630
|
buildDailySalesCashPayments,
|
|
3557
3631
|
buildDailySalesRevClassFooter,
|
|
3558
|
-
calculateFieldTotal,
|
|
3559
3632
|
calculateReportTotals,
|
|
3560
3633
|
dailySalesCacheConfig,
|
|
3561
3634
|
dailySalesConfig,
|
|
3562
3635
|
dailySalesDiscountsConfig,
|
|
3563
|
-
dailySalesLiveConfig,
|
|
3564
3636
|
dailySalesPaymentsConfig,
|
|
3565
3637
|
dailySalesRefundsVoidsConfig,
|
|
3566
3638
|
dailySalesTaxesConfig,
|
|
@@ -3581,6 +3653,7 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
3581
3653
|
getColumnExportHeaderLabel,
|
|
3582
3654
|
getColumnMetadata,
|
|
3583
3655
|
getDateToFormat,
|
|
3656
|
+
getFooterValue,
|
|
3584
3657
|
getNumberToFormat,
|
|
3585
3658
|
getReportConfig,
|
|
3586
3659
|
getReportExportFileName,
|