@harbortouch/skytab-analytics-report-utils 0.38.1 → 0.40.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.cjs CHANGED
@@ -327,355 +327,6 @@ var salesSummaryConfig = {
327
327
  hasFooter: true
328
328
  };
329
329
 
330
- // src/reports/ticketSummary.ts
331
- var FIELDS3 = {
332
- ticketId: { type: "string", filteringAvailable: false },
333
- locationId: { type: "number", filteringAvailable: false },
334
- orderName: { type: "string", filteringAvailable: false },
335
- revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
336
- daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
337
- inclusiveTaxesAmount: {
338
- type: "money",
339
- columnKey: "inclusiveTax",
340
- footerCalculation: { type: "sum" },
341
- filteringAvailable: false
342
- },
343
- locationName: { type: "string", size: 240, columnKey: "locationName", filteringAvailable: false },
344
- orderNumber: {
345
- type: "string",
346
- columnKey: "ticketNumber",
347
- footerCalculation: { type: "label", label: "table.total" },
348
- filteringAvailable: false
349
- },
350
- businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
351
- ticketOpenedAt: { type: "time", columnKey: "ticketOpen", filteringAvailable: false },
352
- ticketClosedAt: { type: "time", columnKey: "ticketClosed", filteringAvailable: false },
353
- ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false, filteringAvailable: false },
354
- ticketSubtotal: {
355
- type: "money",
356
- columnKey: "subtotal",
357
- footerCalculation: { type: "sum" },
358
- filteringAvailable: false
359
- },
360
- discountsAmount: {
361
- type: "money",
362
- columnKey: "discountAmount",
363
- footerCalculation: { type: "sum" },
364
- filteringAvailable: false
365
- },
366
- surchargesAmount: {
367
- type: "money",
368
- columnKey: "ticketFee",
369
- footerCalculation: { type: "sum" },
370
- filteringAvailable: false
371
- },
372
- taxesAmount: {
373
- type: "money",
374
- columnKey: "taxCollected",
375
- footerCalculation: { type: "sum" },
376
- filteringAvailable: false
377
- },
378
- ticketGrandTotal: {
379
- type: "money",
380
- columnKey: "grandTotal",
381
- footerCalculation: { type: "sum" },
382
- filteringAvailable: false
383
- },
384
- gratuitiesAmount: {
385
- type: "money",
386
- columnKey: "autoGratuity",
387
- footerCalculation: { type: "sum" },
388
- filteringAvailable: false
389
- },
390
- tipAmount: {
391
- type: "money",
392
- columnKey: "tips",
393
- footerCalculation: { type: "sum" },
394
- filteringAvailable: false
395
- },
396
- paymentsAmount: {
397
- type: "money",
398
- columnKey: "totalCollected",
399
- footerCalculation: { type: "sum" },
400
- filteringAvailable: false
401
- },
402
- paymentTypeName: { type: "string", columnKey: "paymentType", filteringAvailable: false },
403
- guestsCount: {
404
- type: "number",
405
- columnKey: "guestCount",
406
- footerCalculation: { type: "sum" },
407
- filteringAvailable: false
408
- },
409
- employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
410
- orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false }
411
- };
412
- var TICKET_SUMMARY_VISIBLE_COLUMNS = [
413
- "locationName",
414
- "businessDate",
415
- "ticketOpenedAt",
416
- "ticketClosedAt",
417
- "ticketTime",
418
- "ticketSubtotal",
419
- "discountsAmount",
420
- "surchargesAmount",
421
- "taxesAmount",
422
- "ticketGrandTotal",
423
- "gratuitiesAmount",
424
- "tipAmount",
425
- "paymentsAmount",
426
- "paymentTypeName",
427
- "guestsCount",
428
- "employeeName",
429
- "orderTypeName"
430
- ];
431
- var TICKET_SUMMARY_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_SUMMARY_VISIBLE_COLUMNS];
432
- var ticketSummaryConfig = {
433
- fields: FIELDS3,
434
- availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
435
- defaultVisibleColumns: TICKET_SUMMARY_VISIBLE_COLUMNS,
436
- hasFooter: true
437
- };
438
-
439
- // src/reports/ticketLive.ts
440
- var FIELDS4 = {
441
- locationName: { type: "string", columnKey: "locationName" },
442
- orderNumber: {
443
- type: "string",
444
- columnKey: "ticketNumber",
445
- footerCalculation: { type: "label", label: "table.total" }
446
- },
447
- dateOpen: { type: "string", columnKey: "date" },
448
- timeOpen: { type: "string", columnKey: "ticketOpen" },
449
- dateClose: { type: "string", columnKey: "dateClose" },
450
- timeClose: { type: "string", columnKey: "ticketClosed" },
451
- durationMinutes: { type: "number", columnKey: "timeOpenMins" },
452
- subtotal: { type: "money", columnKey: "subtotal" },
453
- discountTotal: { type: "money", columnKey: "discountAmount" },
454
- surchargeTotal: { type: "money", columnKey: "ticketFee" },
455
- taxTotal: { type: "money", columnKey: "taxCollected" },
456
- grandTotal: { type: "money", columnKey: "grandTotal" },
457
- gratuityTotal: { type: "money", columnKey: "autoGratuity" },
458
- totalTips: { type: "money", columnKey: "totalTips" },
459
- paymentsReceived: { type: "money", columnKey: "totalCollected" },
460
- paymentTypeName: { type: "string", columnKey: "paymentType" },
461
- guestCount: {
462
- type: "number",
463
- columnKey: "guestCount",
464
- footerCalculation: { type: "sum" }
465
- },
466
- customerName: { type: "string", columnKey: "customerName" },
467
- employeeName: { type: "string", columnKey: "employeeName" },
468
- orderType: { type: "string", columnKey: "orderType" }
469
- };
470
- var TICKET_LIVE_VISIBLE_COLUMNS = [
471
- "locationName",
472
- "dateOpen",
473
- "timeOpen",
474
- "timeClose",
475
- "durationMinutes",
476
- "subtotal",
477
- "discountTotal",
478
- "surchargeTotal",
479
- "taxTotal",
480
- "grandTotal",
481
- "gratuityTotal",
482
- "totalTips",
483
- "paymentsReceived",
484
- "paymentTypeName",
485
- "guestCount",
486
- "employeeName",
487
- "orderType"
488
- ];
489
- var TICKET_LIVE_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_LIVE_VISIBLE_COLUMNS];
490
- var ticketLiveConfig = {
491
- fields: FIELDS4,
492
- availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
493
- defaultVisibleColumns: TICKET_LIVE_VISIBLE_COLUMNS,
494
- hasFooter: true
495
- };
496
-
497
- // src/reports/productMix.ts
498
- var FIELDS5 = {
499
- groupById: { type: "string" },
500
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
501
- salesAmountGross: { type: "money", columnKey: "grossSales" },
502
- discountsAmount: { type: "money", columnKey: "discountAmount" },
503
- inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
504
- salesAmountNet: { type: "money", columnKey: "netSales" },
505
- itemsQuantity: { type: "fixedNumber", columnKey: "quantity" },
506
- avgPrice: {
507
- type: "money",
508
- columnKey: "averageGrossPrice",
509
- footerCalculation: {
510
- type: "average",
511
- numeratorField: "salesAmountGross",
512
- denominatorField: "itemsQuantity"
513
- }
514
- },
515
- salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
516
- };
517
- var PRODUCT_MIX_VISIBLE_COLUMNS = [
518
- "salesAmountGross",
519
- "itemsQuantity",
520
- "avgPrice",
521
- "discountsAmount",
522
- "inclusiveTaxesAmount",
523
- "salesAmountNet",
524
- "salesMixPct"
525
- ];
526
- var PRODUCT_MIX_AVAILABLE_COLUMNS = ["groupByName", ...PRODUCT_MIX_VISIBLE_COLUMNS];
527
- var productMixConfig = {
528
- fields: FIELDS5,
529
- availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
530
- defaultVisibleColumns: PRODUCT_MIX_VISIBLE_COLUMNS,
531
- chartFields: PRODUCT_MIX_VISIBLE_COLUMNS,
532
- hasFooter: true
533
- };
534
-
535
- // src/reports/modifierMix.ts
536
- var FIELDS6 = {
537
- groupById: { type: "string", filteringAvailable: false },
538
- groupByName: {
539
- type: "string",
540
- size: FIRST_COLUMN_WIDTH,
541
- filteringAvailable: false,
542
- footerCalculation: { type: "label", label: "table.total" }
543
- },
544
- groupById2: { type: "string", filteringAvailable: false },
545
- groupByName2: {
546
- type: "string",
547
- size: FIRST_COLUMN_WIDTH,
548
- filteringAvailable: false,
549
- footerCalculation: { type: "none" }
550
- },
551
- modifiersSales: { type: "money", columnKey: "totalModifierSales" },
552
- modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
553
- itemsQuantity: {
554
- type: "number",
555
- columnKey: "quantity",
556
- filteringAvailable: false
557
- },
558
- avgGross: {
559
- type: "money",
560
- columnKey: "averageGrossPrice",
561
- footerCalculation: {
562
- type: "average",
563
- numeratorField: "modifiersSales",
564
- denominatorField: "modifiersQuantity"
565
- }
566
- },
567
- attachRate: {
568
- type: "percent",
569
- columnKey: "attachRate",
570
- footerCalculation: {
571
- type: "average",
572
- numeratorField: "modifiersQuantity",
573
- denominatorField: "itemsQuantity"
574
- }
575
- },
576
- modifiersSalesComp: { type: "money", filteringAvailable: false },
577
- modifiersQuantityComp: { type: "number", filteringAvailable: false },
578
- itemsQuantityComp: { type: "number", filteringAvailable: false },
579
- attachRateComp: { type: "percent", filteringAvailable: false },
580
- modifiersSalesVar: { type: "money", filteringAvailable: false },
581
- modifiersSalesVarPct: {
582
- type: "percent",
583
- filteringAvailable: false,
584
- footerCalculation: {
585
- type: "percentChange",
586
- numeratorField: "modifiersSales",
587
- denominatorField: "modifiersSalesComp"
588
- }
589
- },
590
- modifiersQuantityVar: { type: "number", filteringAvailable: false },
591
- modifiersQuantityVarPct: {
592
- type: "percent",
593
- filteringAvailable: false,
594
- footerCalculation: {
595
- type: "percentChange",
596
- numeratorField: "modifiersQuantity",
597
- denominatorField: "modifiersQuantityComp"
598
- }
599
- },
600
- attachRateVar: { type: "percent", filteringAvailable: false },
601
- attachRateVarPct: {
602
- type: "percent",
603
- filteringAvailable: false,
604
- footerCalculation: {
605
- type: "percentChange",
606
- numeratorField: "attachRate",
607
- denominatorField: "attachRateComp"
608
- }
609
- }
610
- };
611
- var MODIFIER_MIX_VISIBLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
612
- var MODIFIER_MIX_AVAILABLE_COLUMNS = [
613
- "groupByName",
614
- "groupByName2",
615
- ...MODIFIER_MIX_VISIBLE_COLUMNS
616
- ];
617
- var modifierMixConfig = {
618
- fields: FIELDS6,
619
- chartFields: MODIFIER_MIX_VISIBLE_COLUMNS,
620
- availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
621
- defaultVisibleColumns: MODIFIER_MIX_VISIBLE_COLUMNS,
622
- hasFooter: true
623
- };
624
-
625
- // src/reports/itemTax.ts
626
- var FIELDS7 = {
627
- locationId: { type: "number", filteringAvailable: false },
628
- taxIsFlat: { type: "boolean", filteringAvailable: false },
629
- merchantId: { type: "string", columnKey: "locationMid", filteringAvailable: false },
630
- locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
631
- locationCity: { type: "string", columnKey: "locationCity", filteringAvailable: false },
632
- locationState: { type: "string", columnKey: "locationState", filteringAvailable: false },
633
- itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
634
- itemPrice: { type: "money", columnKey: "itemPrice" },
635
- departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
636
- revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
637
- orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
638
- taxName: { type: "string", columnKey: "taxName", filteringAvailable: false },
639
- taxValue: { type: "money", columnKey: "taxableSales" },
640
- taxRate: {
641
- type: "conditional",
642
- columnKey: "taxRate",
643
- conditionalConfiguration: {
644
- conditionalField: "taxIsFlat",
645
- conditionalFormat: (field) => {
646
- return field ? "money" : "percent";
647
- }
648
- }
649
- },
650
- recordsCount: { type: "number", columnKey: "quantity" },
651
- taxableSales: { type: "money", columnKey: "taxableSales" },
652
- totalCollected: { type: "money", columnKey: "totalCollected" },
653
- itemTax: { type: "money", columnKey: "taxCollected" },
654
- taxCollected: { type: "money", columnKey: "taxCollected" }
655
- };
656
- var ITEM_TAX_AVAILABLE_COLUMNS = [
657
- "merchantId",
658
- "locationName",
659
- "locationCity",
660
- "locationState",
661
- "itemName",
662
- "departmentName",
663
- "revenueClassName",
664
- "orderTypeName",
665
- "recordsCount",
666
- "itemPrice",
667
- "taxName",
668
- "taxRate",
669
- "taxableSales",
670
- "taxCollected"
671
- ];
672
- var itemTaxConfig = {
673
- fields: FIELDS7,
674
- availableColumns: ITEM_TAX_AVAILABLE_COLUMNS,
675
- defaultVisibleColumns: ITEM_TAX_AVAILABLE_COLUMNS,
676
- hasFooter: false
677
- };
678
-
679
330
  // src/translations/crowdin/skytab-analytics-report-utils/en-GB.ts
680
331
  var enUS = {
681
332
  "common.report-col.fifteen-min-interval": false,
@@ -1146,6 +797,9 @@ var enUS = {
1146
797
  "common.report-col.total-pay": false,
1147
798
  "common.report-col.total-pay.short": false,
1148
799
  "common.report-col.total-pay.info": false,
800
+ "common.report-col.table-name": false,
801
+ "common.report-col.table-name.short": false,
802
+ "common.report-col.table-name.info": false,
1149
803
  "common.report-section.revenue-class": false,
1150
804
  "common.report-section.payments": false,
1151
805
  "common.report-section.cash": false,
@@ -1165,12 +819,16 @@ var enUS = {
1165
819
  "common.report-section.rev-class-footer.non-sales-revenue": false,
1166
820
  "common.report-section.rev-class-footer.house-account": false,
1167
821
  "common.report-section.rev-class-footer.total-accountable": false,
822
+ "scheduled-reports.report-name": false,
1168
823
  "scheduled-reports.period": false,
824
+ "scheduled-reports.generated-at": false,
825
+ "scheduled-reports.generated-by": false,
1169
826
  "components.form.field.group-by": false,
1170
827
  "components.form.field.last-week": false,
1171
828
  "components.form.field.last-year": false,
1172
829
  "common.labels.locations": false,
1173
830
  "common.labels.yes": false,
831
+ "common.labels.unassigned": false,
1174
832
  // Analytic fields
1175
833
  "analytics.field.location_id": false,
1176
834
  "analytics.field.order_type_id": false,
@@ -1670,6 +1328,9 @@ var enUS2 = {
1670
1328
  "common.report-col.total-pay": false,
1671
1329
  "common.report-col.total-pay.short": false,
1672
1330
  "common.report-col.total-pay.info": false,
1331
+ "common.report-col.table-name": false,
1332
+ "common.report-col.table-name.short": false,
1333
+ "common.report-col.table-name.info": false,
1673
1334
  "common.report-section.revenue-class": false,
1674
1335
  "common.report-section.payments": false,
1675
1336
  "common.report-section.cash": false,
@@ -1689,12 +1350,16 @@ var enUS2 = {
1689
1350
  "common.report-section.rev-class-footer.non-sales-revenue": false,
1690
1351
  "common.report-section.rev-class-footer.house-account": false,
1691
1352
  "common.report-section.rev-class-footer.total-accountable": false,
1353
+ "scheduled-reports.report-name": false,
1692
1354
  "scheduled-reports.period": false,
1355
+ "scheduled-reports.generated-at": false,
1356
+ "scheduled-reports.generated-by": false,
1693
1357
  "components.form.field.group-by": false,
1694
1358
  "components.form.field.last-week": false,
1695
1359
  "components.form.field.last-year": false,
1696
1360
  "common.labels.locations": false,
1697
1361
  "common.labels.yes": false,
1362
+ "common.labels.unassigned": false,
1698
1363
  // Analytic fields
1699
1364
  "analytics.field.location_id": false,
1700
1365
  "analytics.field.order_type_id": false,
@@ -2194,6 +1859,9 @@ var enUS3 = {
2194
1859
  "common.report-col.total-pay": "Total Pay",
2195
1860
  "common.report-col.total-pay.short": "Total Pay",
2196
1861
  "common.report-col.total-pay.info": "Total compensation including wages, overtime, and adjustments",
1862
+ "common.report-col.table-name": "Table Name",
1863
+ "common.report-col.table-name.short": "Table Name",
1864
+ "common.report-col.table-name.info": "Table Name if assigned",
2197
1865
  "common.report-section.revenue-class": "Sales by Revenue Class",
2198
1866
  "common.report-section.payments": "Payments",
2199
1867
  "common.report-section.cash": "Expected Closeout Cash",
@@ -2213,12 +1881,16 @@ var enUS3 = {
2213
1881
  "common.report-section.rev-class-footer.non-sales-revenue": "Non-Sales Revenue",
2214
1882
  "common.report-section.rev-class-footer.house-account": "House Account",
2215
1883
  "common.report-section.rev-class-footer.total-accountable": "Total Accountable",
1884
+ "scheduled-reports.report-name": "Report",
2216
1885
  "scheduled-reports.period": "Period",
1886
+ "scheduled-reports.generated-at": "Generated at",
1887
+ "scheduled-reports.generated-by": "Generated by",
2217
1888
  "components.form.field.group-by": "Group By",
2218
1889
  "components.form.field.last-week": "Compare to Last Week",
2219
1890
  "components.form.field.last-year": "Compare to Last Year",
2220
1891
  "common.labels.locations": "Locations",
2221
1892
  "common.labels.yes": "Yes",
1893
+ "common.labels.unassigned": "Unassigned",
2222
1894
  // Analytic fields
2223
1895
  "analytics.field.location_id": "Location",
2224
1896
  "analytics.field.order_type_id": "Order Types",
@@ -2246,26 +1918,399 @@ var enUS3 = {
2246
1918
  "employee-timecard.status.inactive": "Inactive",
2247
1919
  "employee-timecard.job.break-suffix": " * break"
2248
1920
  };
2249
- var en_US_default = enUS3;
1921
+ var en_US_default = enUS3;
1922
+
1923
+ // src/translations/index.ts
1924
+ var filterCrowdin = (messages) => Object.fromEntries(
1925
+ Object.entries(messages).filter((entry) => typeof entry[1] === "string")
1926
+ );
1927
+ var LOCALE_OVERRIDES = {
1928
+ "en-GB": filterCrowdin(en_GB_default),
1929
+ "es-ES": filterCrowdin(es_ES_default)
1930
+ };
1931
+ function resolveTranslate(key, locale) {
1932
+ const overrides = LOCALE_OVERRIDES[locale];
1933
+ if (overrides) {
1934
+ const override = overrides[key];
1935
+ if (override !== void 0) {
1936
+ return override;
1937
+ }
1938
+ }
1939
+ return en_US_default[key] ?? key;
1940
+ }
1941
+
1942
+ // src/reports/ticketSummary.ts
1943
+ var FIELDS3 = {
1944
+ ticketId: { type: "string", filteringAvailable: false },
1945
+ locationId: { type: "number", filteringAvailable: false },
1946
+ orderName: { type: "string", filteringAvailable: false },
1947
+ revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
1948
+ daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
1949
+ inclusiveTaxesAmount: {
1950
+ type: "money",
1951
+ columnKey: "inclusiveTax",
1952
+ footerCalculation: { type: "sum" },
1953
+ filteringAvailable: false
1954
+ },
1955
+ locationName: { type: "string", size: 240, columnKey: "locationName", filteringAvailable: false },
1956
+ orderNumber: {
1957
+ type: "string",
1958
+ columnKey: "ticketNumber",
1959
+ footerCalculation: { type: "label", label: "table.total" },
1960
+ filteringAvailable: false
1961
+ },
1962
+ businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
1963
+ ticketOpenedAt: { type: "time", columnKey: "ticketOpen", filteringAvailable: false },
1964
+ ticketClosedAt: { type: "time", columnKey: "ticketClosed", filteringAvailable: false },
1965
+ ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false, filteringAvailable: false },
1966
+ ticketSubtotal: {
1967
+ type: "money",
1968
+ columnKey: "subtotal",
1969
+ footerCalculation: { type: "sum" },
1970
+ filteringAvailable: false
1971
+ },
1972
+ discountsAmount: {
1973
+ type: "money",
1974
+ columnKey: "discountAmount",
1975
+ footerCalculation: { type: "sum" },
1976
+ filteringAvailable: false
1977
+ },
1978
+ surchargesAmount: {
1979
+ type: "money",
1980
+ columnKey: "ticketFee",
1981
+ footerCalculation: { type: "sum" },
1982
+ filteringAvailable: false
1983
+ },
1984
+ taxesAmount: {
1985
+ type: "money",
1986
+ columnKey: "taxCollected",
1987
+ footerCalculation: { type: "sum" },
1988
+ filteringAvailable: false
1989
+ },
1990
+ ticketGrandTotal: {
1991
+ type: "money",
1992
+ columnKey: "grandTotal",
1993
+ footerCalculation: { type: "sum" },
1994
+ filteringAvailable: false
1995
+ },
1996
+ gratuitiesAmount: {
1997
+ type: "money",
1998
+ columnKey: "autoGratuity",
1999
+ footerCalculation: { type: "sum" },
2000
+ filteringAvailable: false
2001
+ },
2002
+ tipAmount: {
2003
+ type: "money",
2004
+ columnKey: "tips",
2005
+ footerCalculation: { type: "sum" },
2006
+ filteringAvailable: false
2007
+ },
2008
+ paymentsAmount: {
2009
+ type: "money",
2010
+ columnKey: "totalCollected",
2011
+ footerCalculation: { type: "sum" },
2012
+ filteringAvailable: false
2013
+ },
2014
+ paymentTypeName: { type: "string", columnKey: "paymentType", filteringAvailable: false },
2015
+ guestsCount: {
2016
+ type: "number",
2017
+ columnKey: "guestCount",
2018
+ footerCalculation: { type: "sum" },
2019
+ filteringAvailable: false
2020
+ },
2021
+ employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
2022
+ orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
2023
+ tableName: {
2024
+ type: "custom",
2025
+ columnKey: "tableName",
2026
+ enableSorting: false,
2027
+ filteringAvailable: false,
2028
+ customConfiguration: {
2029
+ customFormat: (value, _full, locale) => {
2030
+ return typeof value === "string" && value !== "" ? value : resolveTranslate("common.labels.unassigned", locale);
2031
+ }
2032
+ }
2033
+ }
2034
+ };
2035
+ var TICKET_SUMMARY_VISIBLE_COLUMNS = [
2036
+ "locationName",
2037
+ "businessDate",
2038
+ "ticketOpenedAt",
2039
+ "ticketClosedAt",
2040
+ "ticketTime",
2041
+ "ticketSubtotal",
2042
+ "discountsAmount",
2043
+ "surchargesAmount",
2044
+ "taxesAmount",
2045
+ "ticketGrandTotal",
2046
+ "gratuitiesAmount",
2047
+ "tipAmount",
2048
+ "paymentsAmount",
2049
+ "paymentTypeName",
2050
+ "guestsCount",
2051
+ "employeeName",
2052
+ "orderTypeName",
2053
+ "tableName"
2054
+ ];
2055
+ var TICKET_SUMMARY_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_SUMMARY_VISIBLE_COLUMNS];
2056
+ var ticketSummaryConfig = {
2057
+ fields: FIELDS3,
2058
+ availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
2059
+ defaultVisibleColumns: TICKET_SUMMARY_VISIBLE_COLUMNS,
2060
+ hasFooter: true
2061
+ };
2062
+
2063
+ // src/reports/ticketLive.ts
2064
+ var FIELDS4 = {
2065
+ locationName: { type: "string", columnKey: "locationName" },
2066
+ orderNumber: {
2067
+ type: "string",
2068
+ columnKey: "ticketNumber",
2069
+ footerCalculation: { type: "label", label: "table.total" }
2070
+ },
2071
+ dateOpen: { type: "string", columnKey: "date" },
2072
+ timeOpen: { type: "string", columnKey: "ticketOpen" },
2073
+ dateClose: { type: "string", columnKey: "dateClose" },
2074
+ timeClose: { type: "string", columnKey: "ticketClosed" },
2075
+ durationMinutes: { type: "number", columnKey: "timeOpenMins" },
2076
+ subtotal: { type: "money", columnKey: "subtotal" },
2077
+ discountTotal: { type: "money", columnKey: "discountAmount" },
2078
+ surchargeTotal: { type: "money", columnKey: "ticketFee" },
2079
+ taxTotal: { type: "money", columnKey: "taxCollected" },
2080
+ grandTotal: { type: "money", columnKey: "grandTotal" },
2081
+ gratuityTotal: { type: "money", columnKey: "autoGratuity" },
2082
+ totalTips: { type: "money", columnKey: "totalTips" },
2083
+ paymentsReceived: { type: "money", columnKey: "totalCollected" },
2084
+ paymentTypeName: { type: "string", columnKey: "paymentType" },
2085
+ guestCount: {
2086
+ type: "number",
2087
+ columnKey: "guestCount",
2088
+ footerCalculation: { type: "sum" }
2089
+ },
2090
+ customerName: { type: "string", columnKey: "customerName" },
2091
+ employeeName: { type: "string", columnKey: "employeeName" },
2092
+ orderType: { type: "string", columnKey: "orderType" },
2093
+ tableName: {
2094
+ type: "custom",
2095
+ columnKey: "tableName",
2096
+ enableSorting: false,
2097
+ filteringAvailable: false,
2098
+ customConfiguration: {
2099
+ customFormat: (value, _full, locale) => {
2100
+ return typeof value === "string" && value !== "" ? value : resolveTranslate("common.labels.unassigned", locale);
2101
+ }
2102
+ }
2103
+ }
2104
+ };
2105
+ var TICKET_LIVE_VISIBLE_COLUMNS = [
2106
+ "locationName",
2107
+ "dateOpen",
2108
+ "timeOpen",
2109
+ "timeClose",
2110
+ "durationMinutes",
2111
+ "subtotal",
2112
+ "discountTotal",
2113
+ "surchargeTotal",
2114
+ "taxTotal",
2115
+ "grandTotal",
2116
+ "gratuityTotal",
2117
+ "totalTips",
2118
+ "paymentsReceived",
2119
+ "paymentTypeName",
2120
+ "guestCount",
2121
+ "employeeName",
2122
+ "orderType",
2123
+ "tableName"
2124
+ ];
2125
+ var TICKET_LIVE_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_LIVE_VISIBLE_COLUMNS];
2126
+ var ticketLiveConfig = {
2127
+ fields: FIELDS4,
2128
+ availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
2129
+ defaultVisibleColumns: TICKET_LIVE_VISIBLE_COLUMNS,
2130
+ hasFooter: true
2131
+ };
2250
2132
 
2251
- // src/translations/index.ts
2252
- var filterCrowdin = (messages) => Object.fromEntries(
2253
- Object.entries(messages).filter((entry) => typeof entry[1] === "string")
2254
- );
2255
- var LOCALE_OVERRIDES = {
2256
- "en-GB": filterCrowdin(en_GB_default),
2257
- "es-ES": filterCrowdin(es_ES_default)
2133
+ // src/reports/productMix.ts
2134
+ var FIELDS5 = {
2135
+ groupById: { type: "string" },
2136
+ groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
2137
+ salesAmountGross: { type: "money", columnKey: "grossSales" },
2138
+ discountsAmount: { type: "money", columnKey: "discountAmount" },
2139
+ inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
2140
+ salesAmountNet: { type: "money", columnKey: "netSales" },
2141
+ itemsQuantity: { type: "fixedNumber", columnKey: "quantity" },
2142
+ avgPrice: {
2143
+ type: "money",
2144
+ columnKey: "averageGrossPrice",
2145
+ footerCalculation: {
2146
+ type: "average",
2147
+ numeratorField: "salesAmountGross",
2148
+ denominatorField: "itemsQuantity"
2149
+ }
2150
+ },
2151
+ salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
2258
2152
  };
2259
- function resolveTranslate(key, locale) {
2260
- const overrides = LOCALE_OVERRIDES[locale];
2261
- if (overrides) {
2262
- const override = overrides[key];
2263
- if (override !== void 0) {
2264
- return override;
2153
+ var PRODUCT_MIX_VISIBLE_COLUMNS = [
2154
+ "salesAmountGross",
2155
+ "itemsQuantity",
2156
+ "avgPrice",
2157
+ "discountsAmount",
2158
+ "inclusiveTaxesAmount",
2159
+ "salesAmountNet",
2160
+ "salesMixPct"
2161
+ ];
2162
+ var PRODUCT_MIX_AVAILABLE_COLUMNS = ["groupByName", ...PRODUCT_MIX_VISIBLE_COLUMNS];
2163
+ var productMixConfig = {
2164
+ fields: FIELDS5,
2165
+ availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
2166
+ defaultVisibleColumns: PRODUCT_MIX_VISIBLE_COLUMNS,
2167
+ chartFields: PRODUCT_MIX_VISIBLE_COLUMNS,
2168
+ hasFooter: true
2169
+ };
2170
+
2171
+ // src/reports/modifierMix.ts
2172
+ var FIELDS6 = {
2173
+ groupById: { type: "string", filteringAvailable: false },
2174
+ groupByName: {
2175
+ type: "string",
2176
+ size: FIRST_COLUMN_WIDTH,
2177
+ filteringAvailable: false,
2178
+ footerCalculation: { type: "label", label: "table.total" }
2179
+ },
2180
+ groupById2: { type: "string", filteringAvailable: false },
2181
+ groupByName2: {
2182
+ type: "string",
2183
+ size: FIRST_COLUMN_WIDTH,
2184
+ filteringAvailable: false,
2185
+ footerCalculation: { type: "none" }
2186
+ },
2187
+ modifiersSales: { type: "money", columnKey: "totalModifierSales" },
2188
+ modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
2189
+ itemsQuantity: {
2190
+ type: "number",
2191
+ columnKey: "quantity",
2192
+ filteringAvailable: false
2193
+ },
2194
+ avgGross: {
2195
+ type: "money",
2196
+ columnKey: "averageGrossPrice",
2197
+ footerCalculation: {
2198
+ type: "average",
2199
+ numeratorField: "modifiersSales",
2200
+ denominatorField: "modifiersQuantity"
2201
+ }
2202
+ },
2203
+ attachRate: {
2204
+ type: "percent",
2205
+ columnKey: "attachRate",
2206
+ footerCalculation: {
2207
+ type: "average",
2208
+ numeratorField: "modifiersQuantity",
2209
+ denominatorField: "itemsQuantity"
2210
+ }
2211
+ },
2212
+ modifiersSalesComp: { type: "money", filteringAvailable: false },
2213
+ modifiersQuantityComp: { type: "number", filteringAvailable: false },
2214
+ itemsQuantityComp: { type: "number", filteringAvailable: false },
2215
+ attachRateComp: { type: "percent", filteringAvailable: false },
2216
+ modifiersSalesVar: { type: "money", filteringAvailable: false },
2217
+ modifiersSalesVarPct: {
2218
+ type: "percent",
2219
+ filteringAvailable: false,
2220
+ footerCalculation: {
2221
+ type: "percentChange",
2222
+ numeratorField: "modifiersSales",
2223
+ denominatorField: "modifiersSalesComp"
2224
+ }
2225
+ },
2226
+ modifiersQuantityVar: { type: "number", filteringAvailable: false },
2227
+ modifiersQuantityVarPct: {
2228
+ type: "percent",
2229
+ filteringAvailable: false,
2230
+ footerCalculation: {
2231
+ type: "percentChange",
2232
+ numeratorField: "modifiersQuantity",
2233
+ denominatorField: "modifiersQuantityComp"
2234
+ }
2235
+ },
2236
+ attachRateVar: { type: "percent", filteringAvailable: false },
2237
+ attachRateVarPct: {
2238
+ type: "percent",
2239
+ filteringAvailable: false,
2240
+ footerCalculation: {
2241
+ type: "percentChange",
2242
+ numeratorField: "attachRate",
2243
+ denominatorField: "attachRateComp"
2265
2244
  }
2266
2245
  }
2267
- return en_US_default[key] ?? key;
2268
- }
2246
+ };
2247
+ var MODIFIER_MIX_VISIBLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
2248
+ var MODIFIER_MIX_AVAILABLE_COLUMNS = [
2249
+ "groupByName",
2250
+ "groupByName2",
2251
+ ...MODIFIER_MIX_VISIBLE_COLUMNS
2252
+ ];
2253
+ var modifierMixConfig = {
2254
+ fields: FIELDS6,
2255
+ chartFields: MODIFIER_MIX_VISIBLE_COLUMNS,
2256
+ availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
2257
+ defaultVisibleColumns: MODIFIER_MIX_VISIBLE_COLUMNS,
2258
+ hasFooter: true
2259
+ };
2260
+
2261
+ // src/reports/itemTax.ts
2262
+ var FIELDS7 = {
2263
+ locationId: { type: "number", filteringAvailable: false },
2264
+ taxIsFlat: { type: "boolean", filteringAvailable: false },
2265
+ merchantId: { type: "string", columnKey: "locationMid", filteringAvailable: false },
2266
+ locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
2267
+ locationCity: { type: "string", columnKey: "locationCity", filteringAvailable: false },
2268
+ locationState: { type: "string", columnKey: "locationState", filteringAvailable: false },
2269
+ itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
2270
+ itemPrice: { type: "money", columnKey: "itemPrice" },
2271
+ departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
2272
+ revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
2273
+ orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
2274
+ taxName: { type: "string", columnKey: "taxName", filteringAvailable: false },
2275
+ taxValue: { type: "money", columnKey: "taxableSales" },
2276
+ taxRate: {
2277
+ type: "conditional",
2278
+ columnKey: "taxRate",
2279
+ conditionalConfiguration: {
2280
+ conditionalField: "taxIsFlat",
2281
+ conditionalFormat: (field) => {
2282
+ return field ? "money" : "percent";
2283
+ }
2284
+ }
2285
+ },
2286
+ recordsCount: { type: "number", columnKey: "quantity" },
2287
+ taxableSales: { type: "money", columnKey: "taxableSales" },
2288
+ totalCollected: { type: "money", columnKey: "totalCollected" },
2289
+ itemTax: { type: "money", columnKey: "taxCollected" },
2290
+ taxCollected: { type: "money", columnKey: "taxCollected" }
2291
+ };
2292
+ var ITEM_TAX_AVAILABLE_COLUMNS = [
2293
+ "merchantId",
2294
+ "locationName",
2295
+ "locationCity",
2296
+ "locationState",
2297
+ "itemName",
2298
+ "departmentName",
2299
+ "revenueClassName",
2300
+ "orderTypeName",
2301
+ "recordsCount",
2302
+ "itemPrice",
2303
+ "taxName",
2304
+ "taxRate",
2305
+ "taxableSales",
2306
+ "taxCollected"
2307
+ ];
2308
+ var itemTaxConfig = {
2309
+ fields: FIELDS7,
2310
+ availableColumns: ITEM_TAX_AVAILABLE_COLUMNS,
2311
+ defaultVisibleColumns: ITEM_TAX_AVAILABLE_COLUMNS,
2312
+ hasFooter: false
2313
+ };
2269
2314
 
2270
2315
  // src/reports/employeeTimecard.ts
2271
2316
  var EMPLOYEE_NAME_WIDTH = 220;
@@ -3652,6 +3697,11 @@ var COLUMN_REGISTRY = {
3652
3697
  titleKey: "common.report-col.total-pay",
3653
3698
  shortTitleKey: "common.report-col.total-pay.short",
3654
3699
  infoTextKey: "common.report-col.total-pay.info"
3700
+ },
3701
+ tableName: {
3702
+ titleKey: "common.report-col.table-name",
3703
+ shortTitleKey: "common.report-col.table-name.short",
3704
+ infoTextKey: "common.report-col.table-name.info"
3655
3705
  }
3656
3706
  };
3657
3707
  function getColumnMetadata(key) {