@harbortouch/skytab-analytics-report-utils 0.27.0 → 0.29.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.
@@ -681,10 +681,56 @@ var employeeTipConfig = {
681
681
  hasFooter: true
682
682
  };
683
683
 
684
- // src/reports/dailySales/dailySales.ts
684
+ // src/reports/tipCashoutReconciliation.ts
685
685
  var FIELDS10 = {
686
686
  groupById: { type: "string" },
687
- groupByName: { type: "string", size: FIRST_COLUMN_WIDTH, footerCalculation: { type: "label", label: "table.total" } },
687
+ groupByName: {
688
+ type: "string",
689
+ size: FIRST_COLUMN_WIDTH,
690
+ footerCalculation: { type: "label", label: "table.total" }
691
+ },
692
+ locationName: { type: "string", size: 220, columnKey: "locationName" },
693
+ employeeName: { type: "string", size: 220, columnKey: "employeeName" },
694
+ empId: { type: "string", size: 160, columnKey: "employeeId" },
695
+ payrollId: { type: "string", size: 160, columnKey: "payrollId" },
696
+ netSales: { type: "money", columnKey: "netSales", footerCalculation: { type: "sum" } },
697
+ cashCollected: { type: "money", columnKey: "cashCollected", footerCalculation: { type: "sum" } },
698
+ grossTips: { type: "money", columnKey: "grossTips", footerCalculation: { type: "sum" } },
699
+ autoGratuity: { type: "money", columnKey: "autoGratuity", footerCalculation: { type: "sum" } },
700
+ tipReduction: { type: "money", columnKey: "tipReduction", footerCalculation: { type: "sum" } },
701
+ tipShareContributed: { type: "money", columnKey: "tipShareContributed", footerCalculation: { type: "sum" } },
702
+ declaredTips: { type: "money", columnKey: "declaredTips", footerCalculation: { type: "sum" } }
703
+ };
704
+ var VISIBLE_COLUMNS2 = [
705
+ "groupByName",
706
+ "locationName",
707
+ "employeeName",
708
+ "payrollId",
709
+ "netSales",
710
+ "cashCollected",
711
+ "grossTips",
712
+ "autoGratuity",
713
+ "tipReduction",
714
+ "tipShareContributed",
715
+ "declaredTips"
716
+ ];
717
+ var AVAILABLE_COLUMNS2 = ["groupById", "empId", ...VISIBLE_COLUMNS2];
718
+ var tipCashoutReconciliationConfig = {
719
+ fields: FIELDS10,
720
+ availableColumns: AVAILABLE_COLUMNS2,
721
+ defaultVisibleColumns: VISIBLE_COLUMNS2,
722
+ hasFooter: true
723
+ };
724
+
725
+ // src/reports/dailySales/dailySales.ts
726
+ var FIELDS11 = {
727
+ groupById: { type: "string" },
728
+ groupByName: {
729
+ type: "string",
730
+ size: FIRST_COLUMN_WIDTH,
731
+ columnKey: "revenueClass",
732
+ footerCalculation: { type: "label", label: "table.total" }
733
+ },
688
734
  itemsQuantity: { type: "number", columnKey: "quantity" },
689
735
  salesAmountGross: { type: "money", columnKey: "grossSales" },
690
736
  discountsAmount: { type: "money", columnKey: "discountAmount" },
@@ -702,7 +748,7 @@ var DAILY_SALES_AVAILABLE_COLUMNS = [
702
748
  "salesMixPct"
703
749
  ];
704
750
  var dailySalesConfig = {
705
- fields: FIELDS10,
751
+ fields: FIELDS11,
706
752
  availableColumns: DAILY_SALES_AVAILABLE_COLUMNS,
707
753
  defaultVisibleColumns: DAILY_SALES_AVAILABLE_COLUMNS,
708
754
  hasFooter: true,
@@ -712,7 +758,7 @@ var dailySalesConfig = {
712
758
  };
713
759
 
714
760
  // src/reports/dailySales/dailySalesCache.ts
715
- var FIELDS11 = {
761
+ var FIELDS12 = {
716
762
  name: {
717
763
  type: "string",
718
764
  columnKey: "type",
@@ -722,7 +768,7 @@ var FIELDS11 = {
722
768
  amount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } }
723
769
  };
724
770
  var dailySalesCacheConfig = {
725
- fields: FIELDS11,
771
+ fields: FIELDS12,
726
772
  availableColumns: ["name", "amount"],
727
773
  defaultVisibleColumns: ["name", "amount"],
728
774
  hasFooter: true,
@@ -731,7 +777,7 @@ var dailySalesCacheConfig = {
731
777
  };
732
778
 
733
779
  // src/reports/dailySales/dailySalesDiscounts.ts
734
- var FIELDS12 = {
780
+ var FIELDS13 = {
735
781
  discountName: {
736
782
  type: "string",
737
783
  columnKey: "discountName",
@@ -749,7 +795,7 @@ var DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS = [
749
795
  "discountsAmount"
750
796
  ];
751
797
  var dailySalesDiscountsConfig = {
752
- fields: FIELDS12,
798
+ fields: FIELDS13,
753
799
  availableColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
754
800
  defaultVisibleColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
755
801
  hasFooter: true,
@@ -758,7 +804,7 @@ var dailySalesDiscountsConfig = {
758
804
  };
759
805
 
760
806
  // src/reports/dailySales/dailySalesPayments.ts
761
- var FIELDS13 = {
807
+ var FIELDS14 = {
762
808
  paymentTypeName: {
763
809
  type: "string",
764
810
  size: FIRST_COLUMN_WIDTH,
@@ -778,7 +824,7 @@ var DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS = [
778
824
  "totalSales"
779
825
  ];
780
826
  var dailySalesPaymentsConfig = {
781
- fields: FIELDS13,
827
+ fields: FIELDS14,
782
828
  availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
783
829
  defaultVisibleColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
784
830
  hasFooter: true,
@@ -787,7 +833,7 @@ var dailySalesPaymentsConfig = {
787
833
  };
788
834
 
789
835
  // src/reports/dailySales/dailySalesRefundsVoids.ts
790
- var FIELDS14 = {
836
+ var FIELDS15 = {
791
837
  description: {
792
838
  type: "string",
793
839
  columnKey: "refundVoidDescription",
@@ -805,7 +851,7 @@ var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
805
851
  "pctSales"
806
852
  ];
807
853
  var dailySalesRefundsVoidsConfig = {
808
- fields: FIELDS14,
854
+ fields: FIELDS15,
809
855
  availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
810
856
  defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
811
857
  hasFooter: true,
@@ -814,7 +860,7 @@ var dailySalesRefundsVoidsConfig = {
814
860
  };
815
861
 
816
862
  // src/reports/dailySales/dailySalesTaxes.ts
817
- var FIELDS15 = {
863
+ var FIELDS16 = {
818
864
  taxName: {
819
865
  type: "string",
820
866
  columnKey: "taxName",
@@ -832,7 +878,7 @@ var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
832
878
  "exemptSales"
833
879
  ];
834
880
  var dailySalesTaxesConfig = {
835
- fields: FIELDS15,
881
+ fields: FIELDS16,
836
882
  availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
837
883
  defaultVisibleColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
838
884
  hasFooter: true,
@@ -840,11 +886,12 @@ var dailySalesTaxesConfig = {
840
886
  sectionName: "common.report-section.taxes"
841
887
  };
842
888
 
843
- // src/reports/dailySales/dailySalesTrends.ts
844
- var FIELDS16 = {
889
+ // src/reports/dailySales/dailySalesTrendsDayPart.ts
890
+ var FIELDS17 = {
845
891
  groupById: { type: "string" },
846
892
  groupByName: {
847
893
  type: "string",
894
+ columnKey: "daypart",
848
895
  size: FIRST_COLUMN_WIDTH,
849
896
  footerCalculation: { type: "label", label: "common.report-section.trends-footer.total-sales" }
850
897
  },
@@ -878,8 +925,8 @@ var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
878
925
  "guestAvg",
879
926
  "salesAmountNet"
880
927
  ];
881
- var dailySalesTrendsConfig = {
882
- fields: FIELDS16,
928
+ var dailySalesTrendsDayPartConfig = {
929
+ fields: FIELDS17,
883
930
  availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
884
931
  defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
885
932
  hasFooter: true,
@@ -887,10 +934,50 @@ var dailySalesTrendsConfig = {
887
934
  sectionName: "common.report-section.sales-by-day-part",
888
935
  extraFooterFields: ["salesAmountNet"]
889
936
  };
937
+
938
+ // src/reports/dailySales/dailySalesTrendsOrderType.ts
939
+ var FIELDS18 = {
940
+ groupById: { type: "string" },
941
+ groupByName: {
942
+ columnKey: "orderType",
943
+ type: "string",
944
+ size: FIRST_COLUMN_WIDTH,
945
+ footerCalculation: { type: "label", label: "common.report-section.trends-footer.total-sales" }
946
+ },
947
+ salesAmountNet: { type: "money", columnKey: "netSales" },
948
+ ticketsCount: { type: "number", columnKey: "tickets" },
949
+ guestsCount: { type: "number", columnKey: "guests" },
950
+ ticketAvg: {
951
+ type: "money",
952
+ columnKey: "ticketAverage",
953
+ footerCalculation: {
954
+ type: "average",
955
+ numeratorField: "salesAmountNet",
956
+ denominatorField: "ticketsCount"
957
+ }
958
+ },
959
+ guestAvg: {
960
+ type: "money",
961
+ columnKey: "guestAverage",
962
+ footerCalculation: {
963
+ type: "average",
964
+ numeratorField: "salesAmountNet",
965
+ denominatorField: "guestsCount"
966
+ }
967
+ }
968
+ };
969
+ var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS2 = [
970
+ "groupByName",
971
+ "ticketsCount",
972
+ "guestsCount",
973
+ "ticketAvg",
974
+ "guestAvg",
975
+ "salesAmountNet"
976
+ ];
890
977
  var dailySalesTrendsOrderTypeConfig = {
891
- fields: FIELDS16,
892
- availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
893
- defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
978
+ fields: FIELDS18,
979
+ availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS2,
980
+ defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS2,
894
981
  hasFooter: true,
895
982
  dataAccessKey: "trendsByOrderType",
896
983
  sectionName: "common.report-section.sales-by-order-type",
@@ -907,6 +994,7 @@ var Report = {
907
994
  ITEM_TAX: "item-tax",
908
995
  EMPLOYEE_TIMECARD: "employee-timecard",
909
996
  EMPLOYEE_TIP: "employee-tip",
997
+ TIP_CASHOUT_RECONCILIATION: "tip-cashout-reconciliation",
910
998
  SALES_BY_ITEM: "sales-by-item",
911
999
  DAILY_SALES: "daily-sales",
912
1000
  DAILY_SALES_LIVE: "daily-sales-live"
@@ -918,7 +1006,7 @@ var DAILY_SALES_SECTION_CONFIGS = [
918
1006
  dailySalesTaxesConfig,
919
1007
  dailySalesRefundsVoidsConfig,
920
1008
  dailySalesDiscountsConfig,
921
- dailySalesTrendsConfig,
1009
+ dailySalesTrendsDayPartConfig,
922
1010
  dailySalesTrendsOrderTypeConfig
923
1011
  ];
924
1012
  var REPORT_CONFIG_MAP = {
@@ -930,6 +1018,7 @@ var REPORT_CONFIG_MAP = {
930
1018
  "item-tax": itemTaxConfig,
931
1019
  "employee-timecard": employeeTimecardConfig,
932
1020
  "employee-tip": employeeTipConfig,
1021
+ "tip-cashout-reconciliation": tipCashoutReconciliationConfig,
933
1022
  "sales-by-item": salesByItemDetailConfig,
934
1023
  "daily-sales": DAILY_SALES_SECTION_CONFIGS,
935
1024
  "daily-sales-live": DAILY_SALES_SECTION_CONFIGS
@@ -943,6 +1032,7 @@ var REPORT_DEFAULT_NAME_MAP = {
943
1032
  "item-tax": "Sales Tax by Item",
944
1033
  "employee-timecard": "Employee Timecard",
945
1034
  "employee-tip": "Employee Tip",
1035
+ "tip-cashout-reconciliation": "Tip & Cashout Reconciliation",
946
1036
  "sales-by-item": "Sales by Item",
947
1037
  "daily-sales": "Daily Sales",
948
1038
  "daily-sales-live": "Daily Sales Live"
@@ -1027,6 +1117,11 @@ var COLUMN_REGISTRY = {
1027
1117
  shortTitleKey: "common.report-col.batch-number.short",
1028
1118
  infoTextKey: "common.report-col.batch-number.info"
1029
1119
  },
1120
+ cashCollected: {
1121
+ titleKey: "common.report-col.cash-collected",
1122
+ shortTitleKey: "common.report-col.cash-collected.short",
1123
+ infoTextKey: "common.report-col.cash-collected.info"
1124
+ },
1030
1125
  clockInTime: {
1031
1126
  titleKey: "common.report-col.clock-in-time",
1032
1127
  shortTitleKey: "common.report-col.clock-in-time.short",
@@ -1507,6 +1602,11 @@ var COLUMN_REGISTRY = {
1507
1602
  shortTitleKey: "common.report-col.tip-share.short",
1508
1603
  infoTextKey: "common.report-col.tip-share.info"
1509
1604
  },
1605
+ tipShareContributed: {
1606
+ titleKey: "common.report-col.tip-share-contributed",
1607
+ shortTitleKey: "common.report-col.tip-share-contributed.short",
1608
+ infoTextKey: "common.report-col.tip-share-contributed.info"
1609
+ },
1510
1610
  tips: {
1511
1611
  titleKey: "common.report-col.tips",
1512
1612
  shortTitleKey: "common.report-col.tips.short",
@@ -1798,6 +1898,9 @@ var enUS = {
1798
1898
  "common.report-col.batch-number": false,
1799
1899
  "common.report-col.batch-number.short": false,
1800
1900
  "common.report-col.batch-number.info": false,
1901
+ "common.report-col.cash-collected": false,
1902
+ "common.report-col.cash-collected.short": false,
1903
+ "common.report-col.cash-collected.info": false,
1801
1904
  "common.report-col.clock-in-time": false,
1802
1905
  "common.report-col.clock-in-time.short": false,
1803
1906
  "common.report-col.clock-in-time.info": false,
@@ -2107,6 +2210,9 @@ var enUS = {
2107
2210
  "common.report-col.tip-share": false,
2108
2211
  "common.report-col.tip-share.short": false,
2109
2212
  "common.report-col.tip-share.info": false,
2213
+ "common.report-col.tip-share-contributed": false,
2214
+ "common.report-col.tip-share-contributed.short": false,
2215
+ "common.report-col.tip-share-contributed.info": false,
2110
2216
  "common.report-col.tips": false,
2111
2217
  "common.report-col.tips.short": false,
2112
2218
  "common.report-col.tips.info": false,
@@ -2285,6 +2391,9 @@ var enUS2 = {
2285
2391
  "common.report-col.batch-number": false,
2286
2392
  "common.report-col.batch-number.short": false,
2287
2393
  "common.report-col.batch-number.info": false,
2394
+ "common.report-col.cash-collected": false,
2395
+ "common.report-col.cash-collected.short": false,
2396
+ "common.report-col.cash-collected.info": false,
2288
2397
  "common.report-col.clock-in-time": false,
2289
2398
  "common.report-col.clock-in-time.short": false,
2290
2399
  "common.report-col.clock-in-time.info": false,
@@ -2594,6 +2703,9 @@ var enUS2 = {
2594
2703
  "common.report-col.tip-share": false,
2595
2704
  "common.report-col.tip-share.short": false,
2596
2705
  "common.report-col.tip-share.info": false,
2706
+ "common.report-col.tip-share-contributed": false,
2707
+ "common.report-col.tip-share-contributed.short": false,
2708
+ "common.report-col.tip-share-contributed.info": false,
2597
2709
  "common.report-col.tips": false,
2598
2710
  "common.report-col.tips.short": false,
2599
2711
  "common.report-col.tips.info": false,
@@ -2772,6 +2884,9 @@ var enUS3 = {
2772
2884
  "common.report-col.batch-number": "Batch Number",
2773
2885
  "common.report-col.batch-number.short": "Batch No",
2774
2886
  "common.report-col.batch-number.info": "The system-generated number used to track this batch of transactions",
2887
+ "common.report-col.cash-collected": "Cash Collected",
2888
+ "common.report-col.cash-collected.short": "Cash Collected",
2889
+ "common.report-col.cash-collected.info": "Total cash collected by the employee",
2775
2890
  "common.report-col.clock-in-time": "Clock-In Time",
2776
2891
  "common.report-col.clock-in-time.short": "In Time",
2777
2892
  "common.report-col.clock-in-time.info": "Actual time the employee clocked in",
@@ -3081,6 +3196,9 @@ var enUS3 = {
3081
3196
  "common.report-col.tip-share": "Tip Share",
3082
3197
  "common.report-col.tip-share.short": "Tip Share",
3083
3198
  "common.report-col.tip-share.info": "Tips distributed to other employees",
3199
+ "common.report-col.tip-share-contributed": "Tip Share Contributed",
3200
+ "common.report-col.tip-share-contributed.short": "Tip Share Contrib",
3201
+ "common.report-col.tip-share-contributed.info": "Tips contributed by this employee to the tip share pool",
3084
3202
  "common.report-col.tips": "Tips",
3085
3203
  "common.report-col.tips.short": "Tips",
3086
3204
  "common.report-col.tips.info": "Total tips received for the ticket",
@@ -3171,11 +3289,11 @@ var enUS3 = {
3171
3289
  "common.report-col.type": "Type",
3172
3290
  "common.report-col.type.short": "Type",
3173
3291
  "common.report-col.type.info": " ",
3174
- "common.report-section.revenue-class": "Revenue Class",
3292
+ "common.report-section.revenue-class": "Sales by Revenue Class",
3175
3293
  "common.report-section.payments": "Payments",
3176
3294
  "common.report-section.cash": "Expected Closeout Cash",
3177
3295
  "common.report-section.taxes": "Taxes",
3178
- "common.report-section.refunds-voids": "Refunds & Voids",
3296
+ "common.report-section.refunds-voids": "Refunds/Voids",
3179
3297
  "common.report-section.discounts": "Discounts",
3180
3298
  "common.report-section.sales-by-day-part": "Sales by Day Part",
3181
3299
  "common.report-section.sales-by-order-type": "Sales by Order Type",
@@ -3397,13 +3515,14 @@ export {
3397
3515
  itemTaxConfig,
3398
3516
  employeeTimecardConfig,
3399
3517
  employeeTipConfig,
3518
+ tipCashoutReconciliationConfig,
3400
3519
  dailySalesConfig,
3401
3520
  dailySalesCacheConfig,
3402
3521
  dailySalesDiscountsConfig,
3403
3522
  dailySalesPaymentsConfig,
3404
3523
  dailySalesRefundsVoidsConfig,
3405
3524
  dailySalesTaxesConfig,
3406
- dailySalesTrendsConfig,
3525
+ dailySalesTrendsDayPartConfig,
3407
3526
  dailySalesTrendsOrderTypeConfig,
3408
3527
  Report,
3409
3528
  getReportConfig,
@@ -52,8 +52,8 @@ var ExcelExporter = class {
52
52
  async generate(content) {
53
53
  const workbook = new import_exceljs.default.Workbook();
54
54
  const usedNames = /* @__PURE__ */ new Set();
55
- for (const section of content.sections) {
56
- let sheetName = section.sheetName.slice(0, 31);
55
+ for (const [sectionIndex, section] of content.sections.entries()) {
56
+ let sheetName = (section.title || `Sheet${sectionIndex + 1}`).slice(0, 31);
57
57
  if (usedNames.has(sheetName.toLowerCase())) {
58
58
  let suffix = 2;
59
59
  let candidate = `${sheetName.slice(0, 28)}_${suffix}`;
@@ -1,15 +1,10 @@
1
- import { E as ExportTable, a as ExportFilter } from '../../types-BzLsgnfc.cjs';
2
- export { b as XlsxTableColumn } from '../../types-BzLsgnfc.cjs';
1
+ import { E as ExportSection } from '../../types-BPT5hjCR.cjs';
2
+ export { a as XlsxFilter, b as XlsxTable, c as XlsxTableColumn } from '../../types-BPT5hjCR.cjs';
3
3
 
4
- interface XlsxDocumentSection {
5
- sheetName: string;
6
- table?: ExportTable;
7
- filters?: ExportFilter[];
8
- }
9
4
  declare class ExcelExporter {
10
5
  generate(content: {
11
- sections: XlsxDocumentSection[];
6
+ sections: ExportSection[];
12
7
  }): Promise<Buffer>;
13
8
  }
14
9
 
15
- export { ExcelExporter, type XlsxDocumentSection, ExportFilter as XlsxFilter, ExportTable as XlsxTable };
10
+ export { ExcelExporter, ExportSection as XlsxSection };
@@ -1,15 +1,10 @@
1
- import { E as ExportTable, a as ExportFilter } from '../../types-BzLsgnfc.js';
2
- export { b as XlsxTableColumn } from '../../types-BzLsgnfc.js';
1
+ import { E as ExportSection } from '../../types-BPT5hjCR.js';
2
+ export { a as XlsxFilter, b as XlsxTable, c as XlsxTableColumn } from '../../types-BPT5hjCR.js';
3
3
 
4
- interface XlsxDocumentSection {
5
- sheetName: string;
6
- table?: ExportTable;
7
- filters?: ExportFilter[];
8
- }
9
4
  declare class ExcelExporter {
10
5
  generate(content: {
11
- sections: XlsxDocumentSection[];
6
+ sections: ExportSection[];
12
7
  }): Promise<Buffer>;
13
8
  }
14
9
 
15
- export { ExcelExporter, type XlsxDocumentSection, ExportFilter as XlsxFilter, ExportTable as XlsxTable };
10
+ export { ExcelExporter, ExportSection as XlsxSection };
@@ -18,8 +18,8 @@ var ExcelExporter = class {
18
18
  async generate(content) {
19
19
  const workbook = new ExcelJS.Workbook();
20
20
  const usedNames = /* @__PURE__ */ new Set();
21
- for (const section of content.sections) {
22
- let sheetName = section.sheetName.slice(0, 31);
21
+ for (const [sectionIndex, section] of content.sections.entries()) {
22
+ let sheetName = (section.title || `Sheet${sectionIndex + 1}`).slice(0, 31);
23
23
  if (usedNames.has(sheetName.toLowerCase())) {
24
24
  let suffix = 2;
25
25
  let candidate = `${sheetName.slice(0, 28)}_${suffix}`;