@harbortouch/skytab-analytics-report-utils 0.38.0 → 0.39.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,
@@ -1171,6 +825,7 @@ var enUS = {
1171
825
  "components.form.field.last-year": false,
1172
826
  "common.labels.locations": false,
1173
827
  "common.labels.yes": false,
828
+ "common.labels.unassigned": false,
1174
829
  // Analytic fields
1175
830
  "analytics.field.location_id": false,
1176
831
  "analytics.field.order_type_id": false,
@@ -1670,6 +1325,9 @@ var enUS2 = {
1670
1325
  "common.report-col.total-pay": false,
1671
1326
  "common.report-col.total-pay.short": false,
1672
1327
  "common.report-col.total-pay.info": false,
1328
+ "common.report-col.table-name": false,
1329
+ "common.report-col.table-name.short": false,
1330
+ "common.report-col.table-name.info": false,
1673
1331
  "common.report-section.revenue-class": false,
1674
1332
  "common.report-section.payments": false,
1675
1333
  "common.report-section.cash": false,
@@ -1695,6 +1353,7 @@ var enUS2 = {
1695
1353
  "components.form.field.last-year": false,
1696
1354
  "common.labels.locations": false,
1697
1355
  "common.labels.yes": false,
1356
+ "common.labels.unassigned": false,
1698
1357
  // Analytic fields
1699
1358
  "analytics.field.location_id": false,
1700
1359
  "analytics.field.order_type_id": false,
@@ -2194,6 +1853,9 @@ var enUS3 = {
2194
1853
  "common.report-col.total-pay": "Total Pay",
2195
1854
  "common.report-col.total-pay.short": "Total Pay",
2196
1855
  "common.report-col.total-pay.info": "Total compensation including wages, overtime, and adjustments",
1856
+ "common.report-col.table-name": "Table Name",
1857
+ "common.report-col.table-name.short": "Table Name",
1858
+ "common.report-col.table-name.info": "Table Name if assigned",
2197
1859
  "common.report-section.revenue-class": "Sales by Revenue Class",
2198
1860
  "common.report-section.payments": "Payments",
2199
1861
  "common.report-section.cash": "Expected Closeout Cash",
@@ -2219,6 +1881,7 @@ var enUS3 = {
2219
1881
  "components.form.field.last-year": "Compare to Last Year",
2220
1882
  "common.labels.locations": "Locations",
2221
1883
  "common.labels.yes": "Yes",
1884
+ "common.labels.unassigned": "Unassigned",
2222
1885
  // Analytic fields
2223
1886
  "analytics.field.location_id": "Location",
2224
1887
  "analytics.field.order_type_id": "Order Types",
@@ -2246,26 +1909,399 @@ var enUS3 = {
2246
1909
  "employee-timecard.status.inactive": "Inactive",
2247
1910
  "employee-timecard.job.break-suffix": " * break"
2248
1911
  };
2249
- var en_US_default = enUS3;
1912
+ var en_US_default = enUS3;
1913
+
1914
+ // src/translations/index.ts
1915
+ var filterCrowdin = (messages) => Object.fromEntries(
1916
+ Object.entries(messages).filter((entry) => typeof entry[1] === "string")
1917
+ );
1918
+ var LOCALE_OVERRIDES = {
1919
+ "en-GB": filterCrowdin(en_GB_default),
1920
+ "es-ES": filterCrowdin(es_ES_default)
1921
+ };
1922
+ function resolveTranslate(key, locale) {
1923
+ const overrides = LOCALE_OVERRIDES[locale];
1924
+ if (overrides) {
1925
+ const override = overrides[key];
1926
+ if (override !== void 0) {
1927
+ return override;
1928
+ }
1929
+ }
1930
+ return en_US_default[key] ?? key;
1931
+ }
1932
+
1933
+ // src/reports/ticketSummary.ts
1934
+ var FIELDS3 = {
1935
+ ticketId: { type: "string", filteringAvailable: false },
1936
+ locationId: { type: "number", filteringAvailable: false },
1937
+ orderName: { type: "string", filteringAvailable: false },
1938
+ revenueCenterName: { type: "string", columnKey: "revenueCenter", filteringAvailable: false },
1939
+ daypartName: { type: "string", columnKey: "daypart", filteringAvailable: false },
1940
+ inclusiveTaxesAmount: {
1941
+ type: "money",
1942
+ columnKey: "inclusiveTax",
1943
+ footerCalculation: { type: "sum" },
1944
+ filteringAvailable: false
1945
+ },
1946
+ locationName: { type: "string", size: 240, columnKey: "locationName", filteringAvailable: false },
1947
+ orderNumber: {
1948
+ type: "string",
1949
+ columnKey: "ticketNumber",
1950
+ footerCalculation: { type: "label", label: "table.total" },
1951
+ filteringAvailable: false
1952
+ },
1953
+ businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
1954
+ ticketOpenedAt: { type: "time", columnKey: "ticketOpen", filteringAvailable: false },
1955
+ ticketClosedAt: { type: "time", columnKey: "ticketClosed", filteringAvailable: false },
1956
+ ticketTime: { type: "number", columnKey: "timeOpenMins", enableSorting: false, filteringAvailable: false },
1957
+ ticketSubtotal: {
1958
+ type: "money",
1959
+ columnKey: "subtotal",
1960
+ footerCalculation: { type: "sum" },
1961
+ filteringAvailable: false
1962
+ },
1963
+ discountsAmount: {
1964
+ type: "money",
1965
+ columnKey: "discountAmount",
1966
+ footerCalculation: { type: "sum" },
1967
+ filteringAvailable: false
1968
+ },
1969
+ surchargesAmount: {
1970
+ type: "money",
1971
+ columnKey: "ticketFee",
1972
+ footerCalculation: { type: "sum" },
1973
+ filteringAvailable: false
1974
+ },
1975
+ taxesAmount: {
1976
+ type: "money",
1977
+ columnKey: "taxCollected",
1978
+ footerCalculation: { type: "sum" },
1979
+ filteringAvailable: false
1980
+ },
1981
+ ticketGrandTotal: {
1982
+ type: "money",
1983
+ columnKey: "grandTotal",
1984
+ footerCalculation: { type: "sum" },
1985
+ filteringAvailable: false
1986
+ },
1987
+ gratuitiesAmount: {
1988
+ type: "money",
1989
+ columnKey: "autoGratuity",
1990
+ footerCalculation: { type: "sum" },
1991
+ filteringAvailable: false
1992
+ },
1993
+ tipAmount: {
1994
+ type: "money",
1995
+ columnKey: "tips",
1996
+ footerCalculation: { type: "sum" },
1997
+ filteringAvailable: false
1998
+ },
1999
+ paymentsAmount: {
2000
+ type: "money",
2001
+ columnKey: "totalCollected",
2002
+ footerCalculation: { type: "sum" },
2003
+ filteringAvailable: false
2004
+ },
2005
+ paymentTypeName: { type: "string", columnKey: "paymentType", filteringAvailable: false },
2006
+ guestsCount: {
2007
+ type: "number",
2008
+ columnKey: "guestCount",
2009
+ footerCalculation: { type: "sum" },
2010
+ filteringAvailable: false
2011
+ },
2012
+ employeeName: { type: "string", columnKey: "employeeName", filteringAvailable: false },
2013
+ orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
2014
+ tableName: {
2015
+ type: "custom",
2016
+ columnKey: "tableName",
2017
+ enableSorting: false,
2018
+ filteringAvailable: false,
2019
+ customConfiguration: {
2020
+ customFormat: (value, _full, locale) => {
2021
+ return typeof value === "string" && value !== "" ? value : resolveTranslate("common.labels.unassigned", locale);
2022
+ }
2023
+ }
2024
+ }
2025
+ };
2026
+ var TICKET_SUMMARY_VISIBLE_COLUMNS = [
2027
+ "locationName",
2028
+ "businessDate",
2029
+ "ticketOpenedAt",
2030
+ "ticketClosedAt",
2031
+ "ticketTime",
2032
+ "ticketSubtotal",
2033
+ "discountsAmount",
2034
+ "surchargesAmount",
2035
+ "taxesAmount",
2036
+ "ticketGrandTotal",
2037
+ "gratuitiesAmount",
2038
+ "tipAmount",
2039
+ "paymentsAmount",
2040
+ "paymentTypeName",
2041
+ "guestsCount",
2042
+ "employeeName",
2043
+ "orderTypeName",
2044
+ "tableName"
2045
+ ];
2046
+ var TICKET_SUMMARY_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_SUMMARY_VISIBLE_COLUMNS];
2047
+ var ticketSummaryConfig = {
2048
+ fields: FIELDS3,
2049
+ availableColumns: TICKET_SUMMARY_AVAILABLE_COLUMNS,
2050
+ defaultVisibleColumns: TICKET_SUMMARY_VISIBLE_COLUMNS,
2051
+ hasFooter: true
2052
+ };
2053
+
2054
+ // src/reports/ticketLive.ts
2055
+ var FIELDS4 = {
2056
+ locationName: { type: "string", columnKey: "locationName" },
2057
+ orderNumber: {
2058
+ type: "string",
2059
+ columnKey: "ticketNumber",
2060
+ footerCalculation: { type: "label", label: "table.total" }
2061
+ },
2062
+ dateOpen: { type: "string", columnKey: "date" },
2063
+ timeOpen: { type: "string", columnKey: "ticketOpen" },
2064
+ dateClose: { type: "string", columnKey: "dateClose" },
2065
+ timeClose: { type: "string", columnKey: "ticketClosed" },
2066
+ durationMinutes: { type: "number", columnKey: "timeOpenMins" },
2067
+ subtotal: { type: "money", columnKey: "subtotal" },
2068
+ discountTotal: { type: "money", columnKey: "discountAmount" },
2069
+ surchargeTotal: { type: "money", columnKey: "ticketFee" },
2070
+ taxTotal: { type: "money", columnKey: "taxCollected" },
2071
+ grandTotal: { type: "money", columnKey: "grandTotal" },
2072
+ gratuityTotal: { type: "money", columnKey: "autoGratuity" },
2073
+ totalTips: { type: "money", columnKey: "totalTips" },
2074
+ paymentsReceived: { type: "money", columnKey: "totalCollected" },
2075
+ paymentTypeName: { type: "string", columnKey: "paymentType" },
2076
+ guestCount: {
2077
+ type: "number",
2078
+ columnKey: "guestCount",
2079
+ footerCalculation: { type: "sum" }
2080
+ },
2081
+ customerName: { type: "string", columnKey: "customerName" },
2082
+ employeeName: { type: "string", columnKey: "employeeName" },
2083
+ orderType: { type: "string", columnKey: "orderType" },
2084
+ tableName: {
2085
+ type: "custom",
2086
+ columnKey: "tableName",
2087
+ enableSorting: false,
2088
+ filteringAvailable: false,
2089
+ customConfiguration: {
2090
+ customFormat: (value, _full, locale) => {
2091
+ return typeof value === "string" && value !== "" ? value : resolveTranslate("common.labels.unassigned", locale);
2092
+ }
2093
+ }
2094
+ }
2095
+ };
2096
+ var TICKET_LIVE_VISIBLE_COLUMNS = [
2097
+ "locationName",
2098
+ "dateOpen",
2099
+ "timeOpen",
2100
+ "timeClose",
2101
+ "durationMinutes",
2102
+ "subtotal",
2103
+ "discountTotal",
2104
+ "surchargeTotal",
2105
+ "taxTotal",
2106
+ "grandTotal",
2107
+ "gratuityTotal",
2108
+ "totalTips",
2109
+ "paymentsReceived",
2110
+ "paymentTypeName",
2111
+ "guestCount",
2112
+ "employeeName",
2113
+ "orderType",
2114
+ "tableName"
2115
+ ];
2116
+ var TICKET_LIVE_AVAILABLE_COLUMNS = ["orderNumber", ...TICKET_LIVE_VISIBLE_COLUMNS];
2117
+ var ticketLiveConfig = {
2118
+ fields: FIELDS4,
2119
+ availableColumns: TICKET_LIVE_AVAILABLE_COLUMNS,
2120
+ defaultVisibleColumns: TICKET_LIVE_VISIBLE_COLUMNS,
2121
+ hasFooter: true
2122
+ };
2250
2123
 
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)
2124
+ // src/reports/productMix.ts
2125
+ var FIELDS5 = {
2126
+ groupById: { type: "string" },
2127
+ groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
2128
+ salesAmountGross: { type: "money", columnKey: "grossSales" },
2129
+ discountsAmount: { type: "money", columnKey: "discountAmount" },
2130
+ inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
2131
+ salesAmountNet: { type: "money", columnKey: "netSales" },
2132
+ itemsQuantity: { type: "fixedNumber", columnKey: "quantity" },
2133
+ avgPrice: {
2134
+ type: "money",
2135
+ columnKey: "averageGrossPrice",
2136
+ footerCalculation: {
2137
+ type: "average",
2138
+ numeratorField: "salesAmountGross",
2139
+ denominatorField: "itemsQuantity"
2140
+ }
2141
+ },
2142
+ salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
2258
2143
  };
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;
2144
+ var PRODUCT_MIX_VISIBLE_COLUMNS = [
2145
+ "salesAmountGross",
2146
+ "itemsQuantity",
2147
+ "avgPrice",
2148
+ "discountsAmount",
2149
+ "inclusiveTaxesAmount",
2150
+ "salesAmountNet",
2151
+ "salesMixPct"
2152
+ ];
2153
+ var PRODUCT_MIX_AVAILABLE_COLUMNS = ["groupByName", ...PRODUCT_MIX_VISIBLE_COLUMNS];
2154
+ var productMixConfig = {
2155
+ fields: FIELDS5,
2156
+ availableColumns: PRODUCT_MIX_AVAILABLE_COLUMNS,
2157
+ defaultVisibleColumns: PRODUCT_MIX_VISIBLE_COLUMNS,
2158
+ chartFields: PRODUCT_MIX_VISIBLE_COLUMNS,
2159
+ hasFooter: true
2160
+ };
2161
+
2162
+ // src/reports/modifierMix.ts
2163
+ var FIELDS6 = {
2164
+ groupById: { type: "string", filteringAvailable: false },
2165
+ groupByName: {
2166
+ type: "string",
2167
+ size: FIRST_COLUMN_WIDTH,
2168
+ filteringAvailable: false,
2169
+ footerCalculation: { type: "label", label: "table.total" }
2170
+ },
2171
+ groupById2: { type: "string", filteringAvailable: false },
2172
+ groupByName2: {
2173
+ type: "string",
2174
+ size: FIRST_COLUMN_WIDTH,
2175
+ filteringAvailable: false,
2176
+ footerCalculation: { type: "none" }
2177
+ },
2178
+ modifiersSales: { type: "money", columnKey: "totalModifierSales" },
2179
+ modifiersQuantity: { type: "number", columnKey: "modifierQuantity" },
2180
+ itemsQuantity: {
2181
+ type: "number",
2182
+ columnKey: "quantity",
2183
+ filteringAvailable: false
2184
+ },
2185
+ avgGross: {
2186
+ type: "money",
2187
+ columnKey: "averageGrossPrice",
2188
+ footerCalculation: {
2189
+ type: "average",
2190
+ numeratorField: "modifiersSales",
2191
+ denominatorField: "modifiersQuantity"
2192
+ }
2193
+ },
2194
+ attachRate: {
2195
+ type: "percent",
2196
+ columnKey: "attachRate",
2197
+ footerCalculation: {
2198
+ type: "average",
2199
+ numeratorField: "modifiersQuantity",
2200
+ denominatorField: "itemsQuantity"
2201
+ }
2202
+ },
2203
+ modifiersSalesComp: { type: "money", filteringAvailable: false },
2204
+ modifiersQuantityComp: { type: "number", filteringAvailable: false },
2205
+ itemsQuantityComp: { type: "number", filteringAvailable: false },
2206
+ attachRateComp: { type: "percent", filteringAvailable: false },
2207
+ modifiersSalesVar: { type: "money", filteringAvailable: false },
2208
+ modifiersSalesVarPct: {
2209
+ type: "percent",
2210
+ filteringAvailable: false,
2211
+ footerCalculation: {
2212
+ type: "percentChange",
2213
+ numeratorField: "modifiersSales",
2214
+ denominatorField: "modifiersSalesComp"
2215
+ }
2216
+ },
2217
+ modifiersQuantityVar: { type: "number", filteringAvailable: false },
2218
+ modifiersQuantityVarPct: {
2219
+ type: "percent",
2220
+ filteringAvailable: false,
2221
+ footerCalculation: {
2222
+ type: "percentChange",
2223
+ numeratorField: "modifiersQuantity",
2224
+ denominatorField: "modifiersQuantityComp"
2225
+ }
2226
+ },
2227
+ attachRateVar: { type: "percent", filteringAvailable: false },
2228
+ attachRateVarPct: {
2229
+ type: "percent",
2230
+ filteringAvailable: false,
2231
+ footerCalculation: {
2232
+ type: "percentChange",
2233
+ numeratorField: "attachRate",
2234
+ denominatorField: "attachRateComp"
2265
2235
  }
2266
2236
  }
2267
- return en_US_default[key] ?? key;
2268
- }
2237
+ };
2238
+ var MODIFIER_MIX_VISIBLE_COLUMNS = ["modifiersSales", "modifiersQuantity", "avgGross"];
2239
+ var MODIFIER_MIX_AVAILABLE_COLUMNS = [
2240
+ "groupByName",
2241
+ "groupByName2",
2242
+ ...MODIFIER_MIX_VISIBLE_COLUMNS
2243
+ ];
2244
+ var modifierMixConfig = {
2245
+ fields: FIELDS6,
2246
+ chartFields: MODIFIER_MIX_VISIBLE_COLUMNS,
2247
+ availableColumns: MODIFIER_MIX_AVAILABLE_COLUMNS,
2248
+ defaultVisibleColumns: MODIFIER_MIX_VISIBLE_COLUMNS,
2249
+ hasFooter: true
2250
+ };
2251
+
2252
+ // src/reports/itemTax.ts
2253
+ var FIELDS7 = {
2254
+ locationId: { type: "number", filteringAvailable: false },
2255
+ taxIsFlat: { type: "boolean", filteringAvailable: false },
2256
+ merchantId: { type: "string", columnKey: "locationMid", filteringAvailable: false },
2257
+ locationName: { type: "string", columnKey: "locationName", filteringAvailable: false },
2258
+ locationCity: { type: "string", columnKey: "locationCity", filteringAvailable: false },
2259
+ locationState: { type: "string", columnKey: "locationState", filteringAvailable: false },
2260
+ itemName: { type: "string", columnKey: "itemName", filteringAvailable: false },
2261
+ itemPrice: { type: "money", columnKey: "itemPrice" },
2262
+ departmentName: { type: "string", columnKey: "department", filteringAvailable: false },
2263
+ revenueClassName: { type: "string", columnKey: "revenueClass", filteringAvailable: false },
2264
+ orderTypeName: { type: "string", columnKey: "orderType", filteringAvailable: false },
2265
+ taxName: { type: "string", columnKey: "taxName", filteringAvailable: false },
2266
+ taxValue: { type: "money", columnKey: "taxableSales" },
2267
+ taxRate: {
2268
+ type: "conditional",
2269
+ columnKey: "taxRate",
2270
+ conditionalConfiguration: {
2271
+ conditionalField: "taxIsFlat",
2272
+ conditionalFormat: (field) => {
2273
+ return field ? "money" : "percent";
2274
+ }
2275
+ }
2276
+ },
2277
+ recordsCount: { type: "number", columnKey: "quantity" },
2278
+ taxableSales: { type: "money", columnKey: "taxableSales" },
2279
+ totalCollected: { type: "money", columnKey: "totalCollected" },
2280
+ itemTax: { type: "money", columnKey: "taxCollected" },
2281
+ taxCollected: { type: "money", columnKey: "taxCollected" }
2282
+ };
2283
+ var ITEM_TAX_AVAILABLE_COLUMNS = [
2284
+ "merchantId",
2285
+ "locationName",
2286
+ "locationCity",
2287
+ "locationState",
2288
+ "itemName",
2289
+ "departmentName",
2290
+ "revenueClassName",
2291
+ "orderTypeName",
2292
+ "recordsCount",
2293
+ "itemPrice",
2294
+ "taxName",
2295
+ "taxRate",
2296
+ "taxableSales",
2297
+ "taxCollected"
2298
+ ];
2299
+ var itemTaxConfig = {
2300
+ fields: FIELDS7,
2301
+ availableColumns: ITEM_TAX_AVAILABLE_COLUMNS,
2302
+ defaultVisibleColumns: ITEM_TAX_AVAILABLE_COLUMNS,
2303
+ hasFooter: false
2304
+ };
2269
2305
 
2270
2306
  // src/reports/employeeTimecard.ts
2271
2307
  var EMPLOYEE_NAME_WIDTH = 220;
@@ -2519,7 +2555,7 @@ var VISIBLE_COLUMNS3 = [
2519
2555
  "minimumWageAdjustment",
2520
2556
  "totalPay"
2521
2557
  ];
2522
- var AVAILABLE_COLUMNS3 = ["groupById", "groupByName", "rowType", "empId", ...VISIBLE_COLUMNS3];
2558
+ var AVAILABLE_COLUMNS3 = ["empId", ...VISIBLE_COLUMNS3];
2523
2559
  var payrollConfig = {
2524
2560
  fields: FIELDS11,
2525
2561
  availableColumns: AVAILABLE_COLUMNS3,
@@ -3652,6 +3688,11 @@ var COLUMN_REGISTRY = {
3652
3688
  titleKey: "common.report-col.total-pay",
3653
3689
  shortTitleKey: "common.report-col.total-pay.short",
3654
3690
  infoTextKey: "common.report-col.total-pay.info"
3691
+ },
3692
+ tableName: {
3693
+ titleKey: "common.report-col.table-name",
3694
+ shortTitleKey: "common.report-col.table-name.short",
3695
+ infoTextKey: "common.report-col.table-name.info"
3655
3696
  }
3656
3697
  };
3657
3698
  function getColumnMetadata(key) {