@harbortouch/skytab-analytics-report-utils 0.14.4 → 0.15.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 +269 -103
- package/dist/index.d.cts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.js +265 -103
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
COLUMN_REGISTRY: () => COLUMN_REGISTRY,
|
|
24
|
+
DAILY_SALES_CASH_ROW_LABELS: () => DAILY_SALES_CASH_ROW_LABELS,
|
|
25
|
+
DAILY_SALES_REV_CLASS_FOOTER_LABELS: () => DAILY_SALES_REV_CLASS_FOOTER_LABELS,
|
|
26
|
+
REPORT_SECTION_CONFIGS: () => REPORT_SECTION_CONFIGS,
|
|
24
27
|
Report: () => Report,
|
|
25
28
|
calculateFieldTotal: () => calculateFieldTotal,
|
|
26
29
|
calculateReportTotals: () => calculateReportTotals,
|
|
@@ -32,6 +35,7 @@ __export(index_exports, {
|
|
|
32
35
|
dailySalesRefundsVoidsConfig: () => dailySalesRefundsVoidsConfig,
|
|
33
36
|
dailySalesTaxesConfig: () => dailySalesTaxesConfig,
|
|
34
37
|
dailySalesTrendsConfig: () => dailySalesTrendsConfig,
|
|
38
|
+
dailySalesTrendsOrderTypeConfig: () => dailySalesTrendsOrderTypeConfig,
|
|
35
39
|
employeeTimecardConfig: () => employeeTimecardConfig,
|
|
36
40
|
employeeTipConfig: () => employeeTipConfig,
|
|
37
41
|
formatDate: () => formatDate,
|
|
@@ -346,7 +350,8 @@ var FIELDS4 = {
|
|
|
346
350
|
locationName: { type: "string", columnKey: "locationName" },
|
|
347
351
|
orderNumber: {
|
|
348
352
|
type: "number",
|
|
349
|
-
columnKey: "ticketNumber"
|
|
353
|
+
columnKey: "ticketNumber",
|
|
354
|
+
footerCalculation: { type: "none" }
|
|
350
355
|
},
|
|
351
356
|
dateOpen: { type: "string", columnKey: "date" },
|
|
352
357
|
timeOpen: { type: "string", columnKey: "ticketOpen" },
|
|
@@ -719,38 +724,118 @@ var dailySalesConfig = {
|
|
|
719
724
|
fields: FIELDS10,
|
|
720
725
|
availableColumns: DAILY_SALES_AVAILABLE_COLUMNS,
|
|
721
726
|
defaultVisibleColumns: DAILY_SALES_AVAILABLE_COLUMNS,
|
|
722
|
-
hasFooter: true
|
|
727
|
+
hasFooter: true,
|
|
728
|
+
dataAccessKey: "salesByRevClass",
|
|
729
|
+
sectionName: "common.report-section.revenue-class",
|
|
730
|
+
extraFooterRowsKey: "salesByRevClassFooter"
|
|
723
731
|
};
|
|
724
732
|
|
|
725
|
-
// src/reports/
|
|
733
|
+
// src/reports/dailySalesCache.ts
|
|
726
734
|
var FIELDS11 = {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
itemsQuantity: { type: "number", columnKey: "quantity" },
|
|
730
|
-
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
731
|
-
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
732
|
-
inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
|
|
733
|
-
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
734
|
-
salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
|
|
735
|
-
guestsCount: { type: "number", columnKey: "guests" }
|
|
735
|
+
name: { type: "string", columnKey: "type", size: FIRST_COLUMN_WIDTH },
|
|
736
|
+
amount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } }
|
|
736
737
|
};
|
|
737
|
-
var
|
|
738
|
-
"itemsQuantity",
|
|
739
|
-
"salesAmountGross",
|
|
740
|
-
"discountsAmount",
|
|
741
|
-
"inclusiveTaxesAmount",
|
|
742
|
-
"salesAmountNet",
|
|
743
|
-
"salesMixPct"
|
|
744
|
-
];
|
|
745
|
-
var dailySalesLiveConfig = {
|
|
738
|
+
var dailySalesCacheConfig = {
|
|
746
739
|
fields: FIELDS11,
|
|
747
|
-
availableColumns:
|
|
748
|
-
defaultVisibleColumns:
|
|
749
|
-
hasFooter: true
|
|
740
|
+
availableColumns: ["name", "amount"],
|
|
741
|
+
defaultVisibleColumns: ["name", "amount"],
|
|
742
|
+
hasFooter: true,
|
|
743
|
+
dataAccessKey: "cashPayments",
|
|
744
|
+
sectionName: "common.report-section.cash"
|
|
750
745
|
};
|
|
751
746
|
|
|
752
|
-
// src/reports/
|
|
747
|
+
// src/reports/dailySalesDiscounts.ts
|
|
753
748
|
var FIELDS12 = {
|
|
749
|
+
discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH },
|
|
750
|
+
ticketCount: { type: "number", columnKey: "ticketCount", footerCalculation: { type: "sum" } },
|
|
751
|
+
itemCount: { type: "number", columnKey: "itemCount", footerCalculation: { type: "sum" } },
|
|
752
|
+
discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
|
|
753
|
+
};
|
|
754
|
+
var DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS = [
|
|
755
|
+
"discountName",
|
|
756
|
+
"ticketCount",
|
|
757
|
+
"itemCount",
|
|
758
|
+
"discountsAmount"
|
|
759
|
+
];
|
|
760
|
+
var dailySalesDiscountsConfig = {
|
|
761
|
+
fields: FIELDS12,
|
|
762
|
+
availableColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
|
|
763
|
+
defaultVisibleColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
|
|
764
|
+
hasFooter: true,
|
|
765
|
+
dataAccessKey: "discounts",
|
|
766
|
+
sectionName: "common.report-section.discounts"
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
// src/reports/dailySalesPayments.ts
|
|
770
|
+
var FIELDS13 = {
|
|
771
|
+
paymentTypeName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
772
|
+
paymentsCount: { type: "number", columnKey: "paymentsCount", footerCalculation: { type: "sum" } },
|
|
773
|
+
paymentsAmount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } },
|
|
774
|
+
tipsAmount: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
|
|
775
|
+
totalSales: { type: "money", columnKey: "paymentsTotal", footerCalculation: { type: "sum" } }
|
|
776
|
+
};
|
|
777
|
+
var DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS = [
|
|
778
|
+
"paymentTypeName",
|
|
779
|
+
"paymentsCount",
|
|
780
|
+
"paymentsAmount",
|
|
781
|
+
"tipsAmount",
|
|
782
|
+
"totalSales"
|
|
783
|
+
];
|
|
784
|
+
var dailySalesPaymentsConfig = {
|
|
785
|
+
fields: FIELDS13,
|
|
786
|
+
availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
787
|
+
defaultVisibleColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
788
|
+
hasFooter: true,
|
|
789
|
+
dataAccessKey: "payments",
|
|
790
|
+
sectionName: "common.report-section.payments"
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
// src/reports/dailySalesRefundsVoids.ts
|
|
794
|
+
var FIELDS14 = {
|
|
795
|
+
description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH },
|
|
796
|
+
count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
|
|
797
|
+
amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
|
|
798
|
+
pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
|
|
799
|
+
};
|
|
800
|
+
var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
|
|
801
|
+
"description",
|
|
802
|
+
"count",
|
|
803
|
+
"amount",
|
|
804
|
+
"pctSales"
|
|
805
|
+
];
|
|
806
|
+
var dailySalesRefundsVoidsConfig = {
|
|
807
|
+
fields: FIELDS14,
|
|
808
|
+
availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
809
|
+
defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
810
|
+
hasFooter: true,
|
|
811
|
+
dataAccessKey: "refundsVoids",
|
|
812
|
+
sectionName: "common.report-section.refunds-voids"
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
// src/reports/dailySalesTaxes.ts
|
|
816
|
+
var FIELDS15 = {
|
|
817
|
+
taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH },
|
|
818
|
+
taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "none" } },
|
|
819
|
+
taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
|
|
820
|
+
exemptSales: { type: "money", columnKey: "exemptTaxes", footerCalculation: { type: "sum" } }
|
|
821
|
+
};
|
|
822
|
+
var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
|
|
823
|
+
"taxName",
|
|
824
|
+
"taxableSales",
|
|
825
|
+
"taxesAmount",
|
|
826
|
+
"exemptSales"
|
|
827
|
+
];
|
|
828
|
+
var dailySalesTaxesConfig = {
|
|
829
|
+
fields: FIELDS15,
|
|
830
|
+
availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
831
|
+
defaultVisibleColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
832
|
+
hasFooter: true,
|
|
833
|
+
dataAccessKey: "taxes",
|
|
834
|
+
sectionName: "common.report-section.taxes"
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// src/reports/dailySalesTrends.ts
|
|
838
|
+
var FIELDS16 = {
|
|
754
839
|
groupById: { type: "string" },
|
|
755
840
|
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
756
841
|
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
@@ -783,10 +868,24 @@ var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
|
|
|
783
868
|
"salesAmountNet"
|
|
784
869
|
];
|
|
785
870
|
var dailySalesTrendsConfig = {
|
|
786
|
-
fields:
|
|
871
|
+
fields: FIELDS16,
|
|
787
872
|
availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
788
873
|
defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
789
|
-
hasFooter: true
|
|
874
|
+
hasFooter: true,
|
|
875
|
+
dataAccessKey: "trendsByDayPart",
|
|
876
|
+
sectionName: "common.report-section.sales-by-day-part",
|
|
877
|
+
totalsLabel: "common.report-section.trends-footer.total-sales",
|
|
878
|
+
extraFooterFields: ["salesAmountNet"]
|
|
879
|
+
};
|
|
880
|
+
var dailySalesTrendsOrderTypeConfig = {
|
|
881
|
+
fields: FIELDS16,
|
|
882
|
+
availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
883
|
+
defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
884
|
+
hasFooter: true,
|
|
885
|
+
dataAccessKey: "trendsByOrderType",
|
|
886
|
+
sectionName: "common.report-section.sales-by-order-type",
|
|
887
|
+
totalsLabel: "common.report-section.trends-footer.total-sales",
|
|
888
|
+
extraFooterFields: ["salesAmountNet"]
|
|
790
889
|
};
|
|
791
890
|
|
|
792
891
|
// src/report.ts
|
|
@@ -804,6 +903,16 @@ var Report = {
|
|
|
804
903
|
DAILY_SALES_LIVE: "daily-sales-live",
|
|
805
904
|
DAILY_SALES_TRENDS: "daily-sales-trends"
|
|
806
905
|
};
|
|
906
|
+
var DAILY_SALES_SECTION_CONFIGS = [
|
|
907
|
+
dailySalesConfig,
|
|
908
|
+
dailySalesPaymentsConfig,
|
|
909
|
+
dailySalesCacheConfig,
|
|
910
|
+
dailySalesTaxesConfig,
|
|
911
|
+
dailySalesRefundsVoidsConfig,
|
|
912
|
+
dailySalesDiscountsConfig,
|
|
913
|
+
dailySalesTrendsConfig,
|
|
914
|
+
dailySalesTrendsOrderTypeConfig
|
|
915
|
+
];
|
|
807
916
|
var REPORT_CONFIG_MAP = {
|
|
808
917
|
"sales-summary": salesSummaryConfig,
|
|
809
918
|
"ticket-analytics": ticketSummaryConfig,
|
|
@@ -814,9 +923,9 @@ var REPORT_CONFIG_MAP = {
|
|
|
814
923
|
"employee-timecard": employeeTimecardConfig,
|
|
815
924
|
"employee-tip": employeeTipConfig,
|
|
816
925
|
"sales-by-item": salesByItemDetailConfig,
|
|
817
|
-
"daily-sales":
|
|
818
|
-
"daily-sales-live":
|
|
819
|
-
"daily-sales-trends":
|
|
926
|
+
"daily-sales": DAILY_SALES_SECTION_CONFIGS,
|
|
927
|
+
"daily-sales-live": DAILY_SALES_SECTION_CONFIGS,
|
|
928
|
+
"daily-sales-trends": null
|
|
820
929
|
};
|
|
821
930
|
var REPORT_DEFAULT_NAME_MAP = {
|
|
822
931
|
"sales-summary": "Sales",
|
|
@@ -1581,86 +1690,139 @@ var calculateReportTotals = (data, fieldConfig, opts) => {
|
|
|
1581
1690
|
return result;
|
|
1582
1691
|
};
|
|
1583
1692
|
|
|
1584
|
-
// src/reports/
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
"
|
|
1594
|
-
"
|
|
1595
|
-
"tipsAmount",
|
|
1596
|
-
"totalSales"
|
|
1597
|
-
];
|
|
1598
|
-
var dailySalesPaymentsConfig = {
|
|
1599
|
-
fields: FIELDS13,
|
|
1600
|
-
availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
1601
|
-
defaultVisibleColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
1602
|
-
hasFooter: true
|
|
1603
|
-
};
|
|
1604
|
-
|
|
1605
|
-
// src/reports/dailySalesDiscounts.ts
|
|
1606
|
-
var FIELDS14 = {
|
|
1607
|
-
discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH },
|
|
1608
|
-
ticketCount: { type: "number", columnKey: "ticketCount", footerCalculation: { type: "sum" } },
|
|
1609
|
-
itemCount: { type: "number", columnKey: "itemCount", footerCalculation: { type: "sum" } },
|
|
1610
|
-
discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
|
|
1693
|
+
// src/reports/dailySalesLive.ts
|
|
1694
|
+
var FIELDS17 = {
|
|
1695
|
+
groupById: { type: "string" },
|
|
1696
|
+
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
1697
|
+
itemsQuantity: { type: "number", columnKey: "quantity" },
|
|
1698
|
+
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
1699
|
+
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
1700
|
+
inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
|
|
1701
|
+
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
1702
|
+
salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
|
|
1703
|
+
guestsCount: { type: "number", columnKey: "guests" }
|
|
1611
1704
|
};
|
|
1612
|
-
var
|
|
1613
|
-
"
|
|
1614
|
-
"
|
|
1615
|
-
"discountsAmount"
|
|
1705
|
+
var DAILY_SALES_LIVE_AVAILABLE_COLUMNS = [
|
|
1706
|
+
"itemsQuantity",
|
|
1707
|
+
"salesAmountGross",
|
|
1708
|
+
"discountsAmount",
|
|
1709
|
+
"inclusiveTaxesAmount",
|
|
1710
|
+
"salesAmountNet",
|
|
1711
|
+
"salesMixPct"
|
|
1616
1712
|
];
|
|
1617
|
-
var
|
|
1618
|
-
fields:
|
|
1619
|
-
availableColumns:
|
|
1620
|
-
defaultVisibleColumns:
|
|
1621
|
-
hasFooter: true
|
|
1622
|
-
};
|
|
1623
|
-
|
|
1624
|
-
// src/reports/dailySalesRefundsVoids.ts
|
|
1625
|
-
var FIELDS15 = {
|
|
1626
|
-
description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH },
|
|
1627
|
-
count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
|
|
1628
|
-
amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
|
|
1629
|
-
pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
|
|
1630
|
-
};
|
|
1631
|
-
var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = ["count", "amount", "pctSales"];
|
|
1632
|
-
var dailySalesRefundsVoidsConfig = {
|
|
1633
|
-
fields: FIELDS15,
|
|
1634
|
-
availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
1635
|
-
defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
1713
|
+
var dailySalesLiveConfig = {
|
|
1714
|
+
fields: FIELDS17,
|
|
1715
|
+
availableColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
|
|
1716
|
+
defaultVisibleColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
|
|
1636
1717
|
hasFooter: true
|
|
1637
1718
|
};
|
|
1638
1719
|
|
|
1639
|
-
// src/reports/
|
|
1640
|
-
var
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
};
|
|
1646
|
-
var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = ["taxableSales", "taxesAmount", "exemptSales"];
|
|
1647
|
-
var dailySalesTaxesConfig = {
|
|
1648
|
-
fields: FIELDS16,
|
|
1649
|
-
availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
1650
|
-
defaultVisibleColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
1651
|
-
hasFooter: true
|
|
1720
|
+
// src/reports/reportSection.ts
|
|
1721
|
+
var DAILY_SALES_CASH_ROW_LABELS = {
|
|
1722
|
+
cashPayments: "common.report-section.cash-row.cash-payments",
|
|
1723
|
+
paidInOuts: "common.report-section.cash-row.paid-in-outs",
|
|
1724
|
+
gratuitiesPaidOut: "common.report-section.cash-row.gratuities-paid-out",
|
|
1725
|
+
ccTipsPaidOut: "common.report-section.cash-row.cc-tips-paid-out"
|
|
1652
1726
|
};
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1727
|
+
var DAILY_SALES_REV_CLASS_FOOTER_LABELS = {
|
|
1728
|
+
taxTotal: "common.report-section.rev-class-footer.tax-total",
|
|
1729
|
+
gratuities: "common.report-section.rev-class-footer.gratuities",
|
|
1730
|
+
balancePayments: "common.report-section.rev-class-footer.balance-payments",
|
|
1731
|
+
giftCardSales: "common.report-section.rev-class-footer.gift-card-sales",
|
|
1732
|
+
nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue",
|
|
1733
|
+
totalAccountable: "common.report-section.rev-class-footer.total-accountable"
|
|
1658
1734
|
};
|
|
1659
|
-
var
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1735
|
+
var DAILY_SALES_SECTIONS = [
|
|
1736
|
+
{
|
|
1737
|
+
sectionLabel: "common.report-section.revenue-class",
|
|
1738
|
+
config: dailySalesConfig,
|
|
1739
|
+
columns: [
|
|
1740
|
+
{ fieldKey: "groupByName", columnKey: "revenueClass" },
|
|
1741
|
+
{ fieldKey: "itemsQuantity", columnKey: "quantity" },
|
|
1742
|
+
{ fieldKey: "salesAmountGross", columnKey: "grossSales" },
|
|
1743
|
+
{ fieldKey: "discountsAmount", columnKey: "discountAmount" },
|
|
1744
|
+
{ fieldKey: "inclusiveTaxesAmount", columnKey: "inclusiveTax" },
|
|
1745
|
+
{ fieldKey: "salesAmountNet", columnKey: "netSales" },
|
|
1746
|
+
{ fieldKey: "salesMixPct", columnKey: "salesMixByPct" }
|
|
1747
|
+
]
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
sectionLabel: "common.report-section.payments",
|
|
1751
|
+
config: dailySalesPaymentsConfig,
|
|
1752
|
+
columns: [
|
|
1753
|
+
{ fieldKey: "paymentTypeName", columnKey: "paymentType" },
|
|
1754
|
+
{ fieldKey: "paymentsCount", columnKey: "paymentsCount" },
|
|
1755
|
+
{ fieldKey: "paymentsAmount", columnKey: "paymentsAmount" },
|
|
1756
|
+
{ fieldKey: "tipsAmount", columnKey: "tips" },
|
|
1757
|
+
{ fieldKey: "totalSales", columnKey: "paymentsTotal" }
|
|
1758
|
+
]
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
sectionLabel: "common.report-section.cash",
|
|
1762
|
+
config: dailySalesCacheConfig,
|
|
1763
|
+
columns: [
|
|
1764
|
+
{ fieldKey: "name", columnKey: "type", isRowLabelKey: true },
|
|
1765
|
+
{ fieldKey: "amount", columnKey: "paymentsAmount" }
|
|
1766
|
+
]
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
sectionLabel: "common.report-section.taxes",
|
|
1770
|
+
config: dailySalesTaxesConfig,
|
|
1771
|
+
columns: [
|
|
1772
|
+
{ fieldKey: "taxName", columnKey: "taxName" },
|
|
1773
|
+
{ fieldKey: "taxableSales", columnKey: "taxableSales" },
|
|
1774
|
+
{ fieldKey: "taxesAmount", columnKey: "taxCollected" },
|
|
1775
|
+
{ fieldKey: "exemptSales", columnKey: "exemptTaxes" }
|
|
1776
|
+
]
|
|
1777
|
+
},
|
|
1778
|
+
{
|
|
1779
|
+
sectionLabel: "common.report-section.refunds-voids",
|
|
1780
|
+
config: dailySalesRefundsVoidsConfig,
|
|
1781
|
+
columns: [
|
|
1782
|
+
{ fieldKey: "description", columnKey: "refundVoidDescription" },
|
|
1783
|
+
{ fieldKey: "count", columnKey: "refundVoidCount" },
|
|
1784
|
+
{ fieldKey: "amount", columnKey: "refundVoidAmount" },
|
|
1785
|
+
{ fieldKey: "pctSales", columnKey: "refundVoidPctSales" }
|
|
1786
|
+
]
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
sectionLabel: "common.report-section.discounts",
|
|
1790
|
+
config: dailySalesDiscountsConfig,
|
|
1791
|
+
columns: [
|
|
1792
|
+
{ fieldKey: "discountName", columnKey: "discountName" },
|
|
1793
|
+
{ fieldKey: "ticketCount", columnKey: "ticketCount" },
|
|
1794
|
+
{ fieldKey: "itemCount", columnKey: "itemCount" },
|
|
1795
|
+
{ fieldKey: "discountsAmount", columnKey: "discountAmount" }
|
|
1796
|
+
]
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
sectionLabel: "common.report-section.sales-by-day-part",
|
|
1800
|
+
config: dailySalesTrendsConfig,
|
|
1801
|
+
columns: [
|
|
1802
|
+
{ fieldKey: "groupByName", columnKey: "daypart" },
|
|
1803
|
+
{ fieldKey: "ticketsCount", columnKey: "tickets" },
|
|
1804
|
+
{ fieldKey: "guestsCount", columnKey: "guests" },
|
|
1805
|
+
{ fieldKey: "ticketAvg", columnKey: "ticketAverage" },
|
|
1806
|
+
{ fieldKey: "guestAvg", columnKey: "guestAverage" },
|
|
1807
|
+
{ fieldKey: "salesAmountNet", columnKey: "netSales" }
|
|
1808
|
+
]
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
sectionLabel: "common.report-section.sales-by-order-type",
|
|
1812
|
+
config: dailySalesTrendsOrderTypeConfig,
|
|
1813
|
+
columns: [
|
|
1814
|
+
{ fieldKey: "groupByName", columnKey: "orderType" },
|
|
1815
|
+
{ fieldKey: "ticketsCount", columnKey: "tickets" },
|
|
1816
|
+
{ fieldKey: "guestsCount", columnKey: "guests" },
|
|
1817
|
+
{ fieldKey: "ticketAvg", columnKey: "ticketAverage" },
|
|
1818
|
+
{ fieldKey: "guestAvg", columnKey: "guestAverage" },
|
|
1819
|
+
{ fieldKey: "salesAmountNet", columnKey: "netSales" }
|
|
1820
|
+
]
|
|
1821
|
+
}
|
|
1822
|
+
];
|
|
1823
|
+
var REPORT_SECTION_CONFIGS = {
|
|
1824
|
+
[Report.DAILY_SALES]: DAILY_SALES_SECTIONS,
|
|
1825
|
+
[Report.DAILY_SALES_LIVE]: DAILY_SALES_SECTIONS
|
|
1664
1826
|
};
|
|
1665
1827
|
|
|
1666
1828
|
// src/formatting.ts
|
|
@@ -1804,6 +1966,9 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
1804
1966
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1805
1967
|
0 && (module.exports = {
|
|
1806
1968
|
COLUMN_REGISTRY,
|
|
1969
|
+
DAILY_SALES_CASH_ROW_LABELS,
|
|
1970
|
+
DAILY_SALES_REV_CLASS_FOOTER_LABELS,
|
|
1971
|
+
REPORT_SECTION_CONFIGS,
|
|
1807
1972
|
Report,
|
|
1808
1973
|
calculateFieldTotal,
|
|
1809
1974
|
calculateReportTotals,
|
|
@@ -1815,6 +1980,7 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
1815
1980
|
dailySalesRefundsVoidsConfig,
|
|
1816
1981
|
dailySalesTaxesConfig,
|
|
1817
1982
|
dailySalesTrendsConfig,
|
|
1983
|
+
dailySalesTrendsOrderTypeConfig,
|
|
1818
1984
|
employeeTimecardConfig,
|
|
1819
1985
|
employeeTipConfig,
|
|
1820
1986
|
formatDate,
|
package/dist/index.d.cts
CHANGED
|
@@ -1221,6 +1221,7 @@ interface ColumnGroupConfig {
|
|
|
1221
1221
|
lastWeekFields?: string[];
|
|
1222
1222
|
lastYearFields?: string[];
|
|
1223
1223
|
}
|
|
1224
|
+
type ReportSectionName = 'common.report-section.revenue-class' | 'common.report-section.payments' | 'common.report-section.cash' | 'common.report-section.taxes' | 'common.report-section.refunds-voids' | 'common.report-section.discounts' | 'common.report-section.sales-by-day-part' | 'common.report-section.sales-by-order-type';
|
|
1224
1225
|
interface ReportConfig<TField extends string = string> {
|
|
1225
1226
|
fields: Record<TField, ColumnPresentationConfig<TField>>;
|
|
1226
1227
|
availableColumns: TField[];
|
|
@@ -1228,6 +1229,11 @@ interface ReportConfig<TField extends string = string> {
|
|
|
1228
1229
|
columnGroups?: ColumnGroupConfig[];
|
|
1229
1230
|
chartFields?: TField[];
|
|
1230
1231
|
hasFooter: boolean;
|
|
1232
|
+
dataAccessKey?: string;
|
|
1233
|
+
sectionName?: ReportSectionName;
|
|
1234
|
+
totalsLabel?: string;
|
|
1235
|
+
extraFooterRowsKey?: string;
|
|
1236
|
+
extraFooterFields?: string[];
|
|
1231
1237
|
}
|
|
1232
1238
|
|
|
1233
1239
|
declare const Report: {
|
|
@@ -1245,7 +1251,7 @@ declare const Report: {
|
|
|
1245
1251
|
readonly DAILY_SALES_TRENDS: "daily-sales-trends";
|
|
1246
1252
|
};
|
|
1247
1253
|
type ReportType = (typeof Report)[keyof typeof Report];
|
|
1248
|
-
declare const getReportConfig: (reportType: ReportType) => ReportConfig<string> | null;
|
|
1254
|
+
declare const getReportConfig: (reportType: ReportType) => ReportConfig<string> | ReportConfig<string>[] | null;
|
|
1249
1255
|
declare const getReportExportFileName: ({ reportType, startDate, endDate, format, }: {
|
|
1250
1256
|
reportType: ReportType;
|
|
1251
1257
|
startDate: Date;
|
|
@@ -1319,6 +1325,9 @@ declare const dailySalesConfig: {
|
|
|
1319
1325
|
readonly availableColumns: DailySalesField[];
|
|
1320
1326
|
readonly defaultVisibleColumns: DailySalesField[];
|
|
1321
1327
|
readonly hasFooter: true;
|
|
1328
|
+
readonly dataAccessKey: "salesByRevClass";
|
|
1329
|
+
readonly sectionName: "common.report-section.revenue-class";
|
|
1330
|
+
readonly extraFooterRowsKey: "salesByRevClassFooter";
|
|
1322
1331
|
};
|
|
1323
1332
|
|
|
1324
1333
|
type DailySalesLiveField = 'groupById' | 'groupByName' | 'itemsQuantity' | 'salesAmountGross' | 'discountsAmount' | 'inclusiveTaxesAmount' | 'salesAmountNet' | 'salesMixPct' | 'guestsCount';
|
|
@@ -1335,6 +1344,8 @@ declare const dailySalesPaymentsConfig: {
|
|
|
1335
1344
|
readonly availableColumns: DailySalesPaymentsField[];
|
|
1336
1345
|
readonly defaultVisibleColumns: DailySalesPaymentsField[];
|
|
1337
1346
|
readonly hasFooter: true;
|
|
1347
|
+
readonly dataAccessKey: "payments";
|
|
1348
|
+
readonly sectionName: "common.report-section.payments";
|
|
1338
1349
|
};
|
|
1339
1350
|
|
|
1340
1351
|
type DailySalesDiscountsField = 'discountName' | 'ticketCount' | 'itemCount' | 'discountsAmount';
|
|
@@ -1343,6 +1354,8 @@ declare const dailySalesDiscountsConfig: {
|
|
|
1343
1354
|
readonly availableColumns: DailySalesDiscountsField[];
|
|
1344
1355
|
readonly defaultVisibleColumns: DailySalesDiscountsField[];
|
|
1345
1356
|
readonly hasFooter: true;
|
|
1357
|
+
readonly dataAccessKey: "discounts";
|
|
1358
|
+
readonly sectionName: "common.report-section.discounts";
|
|
1346
1359
|
};
|
|
1347
1360
|
|
|
1348
1361
|
type DailySalesRefundsVoidsField = 'description' | 'count' | 'amount' | 'pctSales';
|
|
@@ -1351,6 +1364,8 @@ declare const dailySalesRefundsVoidsConfig: {
|
|
|
1351
1364
|
readonly availableColumns: DailySalesRefundsVoidsField[];
|
|
1352
1365
|
readonly defaultVisibleColumns: DailySalesRefundsVoidsField[];
|
|
1353
1366
|
readonly hasFooter: true;
|
|
1367
|
+
readonly dataAccessKey: "refundsVoids";
|
|
1368
|
+
readonly sectionName: "common.report-section.refunds-voids";
|
|
1354
1369
|
};
|
|
1355
1370
|
|
|
1356
1371
|
type DailySalesTaxesField = 'taxName' | 'taxableSales' | 'taxesAmount' | 'exemptSales';
|
|
@@ -1359,6 +1374,8 @@ declare const dailySalesTaxesConfig: {
|
|
|
1359
1374
|
readonly availableColumns: DailySalesTaxesField[];
|
|
1360
1375
|
readonly defaultVisibleColumns: DailySalesTaxesField[];
|
|
1361
1376
|
readonly hasFooter: true;
|
|
1377
|
+
readonly dataAccessKey: "taxes";
|
|
1378
|
+
readonly sectionName: "common.report-section.taxes";
|
|
1362
1379
|
};
|
|
1363
1380
|
|
|
1364
1381
|
type DailySalesCacheField = 'name' | 'amount';
|
|
@@ -1367,6 +1384,8 @@ declare const dailySalesCacheConfig: {
|
|
|
1367
1384
|
readonly availableColumns: ["name", "amount"];
|
|
1368
1385
|
readonly defaultVisibleColumns: ["name", "amount"];
|
|
1369
1386
|
readonly hasFooter: true;
|
|
1387
|
+
readonly dataAccessKey: "cashPayments";
|
|
1388
|
+
readonly sectionName: "common.report-section.cash";
|
|
1370
1389
|
};
|
|
1371
1390
|
|
|
1372
1391
|
type EmployeeTimecardField = 'locationId' | 'locationName' | 'businessDate' | 'employeeName' | 'isActive' | 'lookup' | 'payrollCode' | 'jobName' | 'isBreak' | 'startTime' | 'endTime' | 'shiftHours';
|
|
@@ -1399,7 +1418,47 @@ declare const dailySalesTrendsConfig: {
|
|
|
1399
1418
|
readonly availableColumns: DailySalesTrendsField[];
|
|
1400
1419
|
readonly defaultVisibleColumns: DailySalesTrendsField[];
|
|
1401
1420
|
readonly hasFooter: true;
|
|
1421
|
+
readonly dataAccessKey: "trendsByDayPart";
|
|
1422
|
+
readonly sectionName: "common.report-section.sales-by-day-part";
|
|
1423
|
+
readonly totalsLabel: "common.report-section.trends-footer.total-sales";
|
|
1424
|
+
readonly extraFooterFields: ["salesAmountNet"];
|
|
1402
1425
|
};
|
|
1426
|
+
declare const dailySalesTrendsOrderTypeConfig: {
|
|
1427
|
+
readonly fields: Record<DailySalesTrendsField, ColumnPresentationConfig<DailySalesTrendsField>>;
|
|
1428
|
+
readonly availableColumns: DailySalesTrendsField[];
|
|
1429
|
+
readonly defaultVisibleColumns: DailySalesTrendsField[];
|
|
1430
|
+
readonly hasFooter: true;
|
|
1431
|
+
readonly dataAccessKey: "trendsByOrderType";
|
|
1432
|
+
readonly sectionName: "common.report-section.sales-by-order-type";
|
|
1433
|
+
readonly totalsLabel: "common.report-section.trends-footer.total-sales";
|
|
1434
|
+
readonly extraFooterFields: ["salesAmountNet"];
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
interface ReportSectionColumnDef {
|
|
1438
|
+
fieldKey: string;
|
|
1439
|
+
columnKey: ReportColumnKey;
|
|
1440
|
+
isRowLabelKey?: boolean;
|
|
1441
|
+
}
|
|
1442
|
+
interface ReportSectionDefinition {
|
|
1443
|
+
sectionLabel: string;
|
|
1444
|
+
config: ReportConfig;
|
|
1445
|
+
columns: ReportSectionColumnDef[];
|
|
1446
|
+
}
|
|
1447
|
+
declare const DAILY_SALES_CASH_ROW_LABELS: {
|
|
1448
|
+
readonly cashPayments: "common.report-section.cash-row.cash-payments";
|
|
1449
|
+
readonly paidInOuts: "common.report-section.cash-row.paid-in-outs";
|
|
1450
|
+
readonly gratuitiesPaidOut: "common.report-section.cash-row.gratuities-paid-out";
|
|
1451
|
+
readonly ccTipsPaidOut: "common.report-section.cash-row.cc-tips-paid-out";
|
|
1452
|
+
};
|
|
1453
|
+
declare const DAILY_SALES_REV_CLASS_FOOTER_LABELS: {
|
|
1454
|
+
readonly taxTotal: "common.report-section.rev-class-footer.tax-total";
|
|
1455
|
+
readonly gratuities: "common.report-section.rev-class-footer.gratuities";
|
|
1456
|
+
readonly balancePayments: "common.report-section.rev-class-footer.balance-payments";
|
|
1457
|
+
readonly giftCardSales: "common.report-section.rev-class-footer.gift-card-sales";
|
|
1458
|
+
readonly nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue";
|
|
1459
|
+
readonly totalAccountable: "common.report-section.rev-class-footer.total-accountable";
|
|
1460
|
+
};
|
|
1461
|
+
declare const REPORT_SECTION_CONFIGS: Partial<Record<ReportType, ReportSectionDefinition[]>>;
|
|
1403
1462
|
|
|
1404
1463
|
type TimeFormat = '00:00' | '00:00:00' | '00:00-24H';
|
|
1405
1464
|
interface LocaleOption {
|
|
@@ -1442,4 +1501,4 @@ declare const getReportFormattingLocaleOptions: (locations: {
|
|
|
1442
1501
|
}[]) => LocaleOption[];
|
|
1443
1502
|
declare const formatFieldValue: (value: unknown, type: FieldType, localeOptions: LocaleOption, fullRecord: Record<string, unknown> | null | undefined, fieldConfig?: ColumnPresentationConfig) => string;
|
|
1444
1503
|
|
|
1445
|
-
export { COLUMN_REGISTRY, type CalculateReportTotalsOptions, type ColumnAlignment, type ColumnGroupConfig, type ColumnMetadata, type ColumnPresentationConfig, type DailySalesCacheField, type DailySalesDiscountsField, type DailySalesField, type DailySalesLiveField, type DailySalesPaymentsField, type DailySalesRefundsVoidsField, type DailySalesTaxesField, type DailySalesTrendsField, type EmployeeTimecardField, type EmployeeTipField, type FieldType, type FooterCalculation, type FooterCalculationType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, Report, type ReportColumnKey, type ReportConfig, type ReportType, type SalesByItemDetailField, type SalesSummaryField, type TicketLiveField, type TicketSummaryField, type TimeFormat, calculateFieldTotal, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesLiveConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getColumnExportHeaderLabel, getColumnMetadata, getDateToFormat, getNumberToFormat, getReportConfig, getReportExportFileName, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
|
1504
|
+
export { COLUMN_REGISTRY, type CalculateReportTotalsOptions, type ColumnAlignment, type ColumnGroupConfig, type ColumnMetadata, type ColumnPresentationConfig, DAILY_SALES_CASH_ROW_LABELS, DAILY_SALES_REV_CLASS_FOOTER_LABELS, type DailySalesCacheField, type DailySalesDiscountsField, type DailySalesField, type DailySalesLiveField, type DailySalesPaymentsField, type DailySalesRefundsVoidsField, type DailySalesTaxesField, type DailySalesTrendsField, type EmployeeTimecardField, type EmployeeTipField, type FieldType, type FooterCalculation, type FooterCalculationType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, REPORT_SECTION_CONFIGS, Report, type ReportColumnKey, type ReportConfig, type ReportSectionColumnDef, type ReportSectionDefinition, type ReportSectionName, type ReportType, type SalesByItemDetailField, type SalesSummaryField, type TicketLiveField, type TicketSummaryField, type TimeFormat, calculateFieldTotal, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesLiveConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, dailySalesTrendsOrderTypeConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getColumnExportHeaderLabel, getColumnMetadata, getDateToFormat, getNumberToFormat, getReportConfig, getReportExportFileName, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1221,6 +1221,7 @@ interface ColumnGroupConfig {
|
|
|
1221
1221
|
lastWeekFields?: string[];
|
|
1222
1222
|
lastYearFields?: string[];
|
|
1223
1223
|
}
|
|
1224
|
+
type ReportSectionName = 'common.report-section.revenue-class' | 'common.report-section.payments' | 'common.report-section.cash' | 'common.report-section.taxes' | 'common.report-section.refunds-voids' | 'common.report-section.discounts' | 'common.report-section.sales-by-day-part' | 'common.report-section.sales-by-order-type';
|
|
1224
1225
|
interface ReportConfig<TField extends string = string> {
|
|
1225
1226
|
fields: Record<TField, ColumnPresentationConfig<TField>>;
|
|
1226
1227
|
availableColumns: TField[];
|
|
@@ -1228,6 +1229,11 @@ interface ReportConfig<TField extends string = string> {
|
|
|
1228
1229
|
columnGroups?: ColumnGroupConfig[];
|
|
1229
1230
|
chartFields?: TField[];
|
|
1230
1231
|
hasFooter: boolean;
|
|
1232
|
+
dataAccessKey?: string;
|
|
1233
|
+
sectionName?: ReportSectionName;
|
|
1234
|
+
totalsLabel?: string;
|
|
1235
|
+
extraFooterRowsKey?: string;
|
|
1236
|
+
extraFooterFields?: string[];
|
|
1231
1237
|
}
|
|
1232
1238
|
|
|
1233
1239
|
declare const Report: {
|
|
@@ -1245,7 +1251,7 @@ declare const Report: {
|
|
|
1245
1251
|
readonly DAILY_SALES_TRENDS: "daily-sales-trends";
|
|
1246
1252
|
};
|
|
1247
1253
|
type ReportType = (typeof Report)[keyof typeof Report];
|
|
1248
|
-
declare const getReportConfig: (reportType: ReportType) => ReportConfig<string> | null;
|
|
1254
|
+
declare const getReportConfig: (reportType: ReportType) => ReportConfig<string> | ReportConfig<string>[] | null;
|
|
1249
1255
|
declare const getReportExportFileName: ({ reportType, startDate, endDate, format, }: {
|
|
1250
1256
|
reportType: ReportType;
|
|
1251
1257
|
startDate: Date;
|
|
@@ -1319,6 +1325,9 @@ declare const dailySalesConfig: {
|
|
|
1319
1325
|
readonly availableColumns: DailySalesField[];
|
|
1320
1326
|
readonly defaultVisibleColumns: DailySalesField[];
|
|
1321
1327
|
readonly hasFooter: true;
|
|
1328
|
+
readonly dataAccessKey: "salesByRevClass";
|
|
1329
|
+
readonly sectionName: "common.report-section.revenue-class";
|
|
1330
|
+
readonly extraFooterRowsKey: "salesByRevClassFooter";
|
|
1322
1331
|
};
|
|
1323
1332
|
|
|
1324
1333
|
type DailySalesLiveField = 'groupById' | 'groupByName' | 'itemsQuantity' | 'salesAmountGross' | 'discountsAmount' | 'inclusiveTaxesAmount' | 'salesAmountNet' | 'salesMixPct' | 'guestsCount';
|
|
@@ -1335,6 +1344,8 @@ declare const dailySalesPaymentsConfig: {
|
|
|
1335
1344
|
readonly availableColumns: DailySalesPaymentsField[];
|
|
1336
1345
|
readonly defaultVisibleColumns: DailySalesPaymentsField[];
|
|
1337
1346
|
readonly hasFooter: true;
|
|
1347
|
+
readonly dataAccessKey: "payments";
|
|
1348
|
+
readonly sectionName: "common.report-section.payments";
|
|
1338
1349
|
};
|
|
1339
1350
|
|
|
1340
1351
|
type DailySalesDiscountsField = 'discountName' | 'ticketCount' | 'itemCount' | 'discountsAmount';
|
|
@@ -1343,6 +1354,8 @@ declare const dailySalesDiscountsConfig: {
|
|
|
1343
1354
|
readonly availableColumns: DailySalesDiscountsField[];
|
|
1344
1355
|
readonly defaultVisibleColumns: DailySalesDiscountsField[];
|
|
1345
1356
|
readonly hasFooter: true;
|
|
1357
|
+
readonly dataAccessKey: "discounts";
|
|
1358
|
+
readonly sectionName: "common.report-section.discounts";
|
|
1346
1359
|
};
|
|
1347
1360
|
|
|
1348
1361
|
type DailySalesRefundsVoidsField = 'description' | 'count' | 'amount' | 'pctSales';
|
|
@@ -1351,6 +1364,8 @@ declare const dailySalesRefundsVoidsConfig: {
|
|
|
1351
1364
|
readonly availableColumns: DailySalesRefundsVoidsField[];
|
|
1352
1365
|
readonly defaultVisibleColumns: DailySalesRefundsVoidsField[];
|
|
1353
1366
|
readonly hasFooter: true;
|
|
1367
|
+
readonly dataAccessKey: "refundsVoids";
|
|
1368
|
+
readonly sectionName: "common.report-section.refunds-voids";
|
|
1354
1369
|
};
|
|
1355
1370
|
|
|
1356
1371
|
type DailySalesTaxesField = 'taxName' | 'taxableSales' | 'taxesAmount' | 'exemptSales';
|
|
@@ -1359,6 +1374,8 @@ declare const dailySalesTaxesConfig: {
|
|
|
1359
1374
|
readonly availableColumns: DailySalesTaxesField[];
|
|
1360
1375
|
readonly defaultVisibleColumns: DailySalesTaxesField[];
|
|
1361
1376
|
readonly hasFooter: true;
|
|
1377
|
+
readonly dataAccessKey: "taxes";
|
|
1378
|
+
readonly sectionName: "common.report-section.taxes";
|
|
1362
1379
|
};
|
|
1363
1380
|
|
|
1364
1381
|
type DailySalesCacheField = 'name' | 'amount';
|
|
@@ -1367,6 +1384,8 @@ declare const dailySalesCacheConfig: {
|
|
|
1367
1384
|
readonly availableColumns: ["name", "amount"];
|
|
1368
1385
|
readonly defaultVisibleColumns: ["name", "amount"];
|
|
1369
1386
|
readonly hasFooter: true;
|
|
1387
|
+
readonly dataAccessKey: "cashPayments";
|
|
1388
|
+
readonly sectionName: "common.report-section.cash";
|
|
1370
1389
|
};
|
|
1371
1390
|
|
|
1372
1391
|
type EmployeeTimecardField = 'locationId' | 'locationName' | 'businessDate' | 'employeeName' | 'isActive' | 'lookup' | 'payrollCode' | 'jobName' | 'isBreak' | 'startTime' | 'endTime' | 'shiftHours';
|
|
@@ -1399,7 +1418,47 @@ declare const dailySalesTrendsConfig: {
|
|
|
1399
1418
|
readonly availableColumns: DailySalesTrendsField[];
|
|
1400
1419
|
readonly defaultVisibleColumns: DailySalesTrendsField[];
|
|
1401
1420
|
readonly hasFooter: true;
|
|
1421
|
+
readonly dataAccessKey: "trendsByDayPart";
|
|
1422
|
+
readonly sectionName: "common.report-section.sales-by-day-part";
|
|
1423
|
+
readonly totalsLabel: "common.report-section.trends-footer.total-sales";
|
|
1424
|
+
readonly extraFooterFields: ["salesAmountNet"];
|
|
1402
1425
|
};
|
|
1426
|
+
declare const dailySalesTrendsOrderTypeConfig: {
|
|
1427
|
+
readonly fields: Record<DailySalesTrendsField, ColumnPresentationConfig<DailySalesTrendsField>>;
|
|
1428
|
+
readonly availableColumns: DailySalesTrendsField[];
|
|
1429
|
+
readonly defaultVisibleColumns: DailySalesTrendsField[];
|
|
1430
|
+
readonly hasFooter: true;
|
|
1431
|
+
readonly dataAccessKey: "trendsByOrderType";
|
|
1432
|
+
readonly sectionName: "common.report-section.sales-by-order-type";
|
|
1433
|
+
readonly totalsLabel: "common.report-section.trends-footer.total-sales";
|
|
1434
|
+
readonly extraFooterFields: ["salesAmountNet"];
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
interface ReportSectionColumnDef {
|
|
1438
|
+
fieldKey: string;
|
|
1439
|
+
columnKey: ReportColumnKey;
|
|
1440
|
+
isRowLabelKey?: boolean;
|
|
1441
|
+
}
|
|
1442
|
+
interface ReportSectionDefinition {
|
|
1443
|
+
sectionLabel: string;
|
|
1444
|
+
config: ReportConfig;
|
|
1445
|
+
columns: ReportSectionColumnDef[];
|
|
1446
|
+
}
|
|
1447
|
+
declare const DAILY_SALES_CASH_ROW_LABELS: {
|
|
1448
|
+
readonly cashPayments: "common.report-section.cash-row.cash-payments";
|
|
1449
|
+
readonly paidInOuts: "common.report-section.cash-row.paid-in-outs";
|
|
1450
|
+
readonly gratuitiesPaidOut: "common.report-section.cash-row.gratuities-paid-out";
|
|
1451
|
+
readonly ccTipsPaidOut: "common.report-section.cash-row.cc-tips-paid-out";
|
|
1452
|
+
};
|
|
1453
|
+
declare const DAILY_SALES_REV_CLASS_FOOTER_LABELS: {
|
|
1454
|
+
readonly taxTotal: "common.report-section.rev-class-footer.tax-total";
|
|
1455
|
+
readonly gratuities: "common.report-section.rev-class-footer.gratuities";
|
|
1456
|
+
readonly balancePayments: "common.report-section.rev-class-footer.balance-payments";
|
|
1457
|
+
readonly giftCardSales: "common.report-section.rev-class-footer.gift-card-sales";
|
|
1458
|
+
readonly nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue";
|
|
1459
|
+
readonly totalAccountable: "common.report-section.rev-class-footer.total-accountable";
|
|
1460
|
+
};
|
|
1461
|
+
declare const REPORT_SECTION_CONFIGS: Partial<Record<ReportType, ReportSectionDefinition[]>>;
|
|
1403
1462
|
|
|
1404
1463
|
type TimeFormat = '00:00' | '00:00:00' | '00:00-24H';
|
|
1405
1464
|
interface LocaleOption {
|
|
@@ -1442,4 +1501,4 @@ declare const getReportFormattingLocaleOptions: (locations: {
|
|
|
1442
1501
|
}[]) => LocaleOption[];
|
|
1443
1502
|
declare const formatFieldValue: (value: unknown, type: FieldType, localeOptions: LocaleOption, fullRecord: Record<string, unknown> | null | undefined, fieldConfig?: ColumnPresentationConfig) => string;
|
|
1444
1503
|
|
|
1445
|
-
export { COLUMN_REGISTRY, type CalculateReportTotalsOptions, type ColumnAlignment, type ColumnGroupConfig, type ColumnMetadata, type ColumnPresentationConfig, type DailySalesCacheField, type DailySalesDiscountsField, type DailySalesField, type DailySalesLiveField, type DailySalesPaymentsField, type DailySalesRefundsVoidsField, type DailySalesTaxesField, type DailySalesTrendsField, type EmployeeTimecardField, type EmployeeTipField, type FieldType, type FooterCalculation, type FooterCalculationType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, Report, type ReportColumnKey, type ReportConfig, type ReportType, type SalesByItemDetailField, type SalesSummaryField, type TicketLiveField, type TicketSummaryField, type TimeFormat, calculateFieldTotal, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesLiveConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getColumnExportHeaderLabel, getColumnMetadata, getDateToFormat, getNumberToFormat, getReportConfig, getReportExportFileName, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
|
1504
|
+
export { COLUMN_REGISTRY, type CalculateReportTotalsOptions, type ColumnAlignment, type ColumnGroupConfig, type ColumnMetadata, type ColumnPresentationConfig, DAILY_SALES_CASH_ROW_LABELS, DAILY_SALES_REV_CLASS_FOOTER_LABELS, type DailySalesCacheField, type DailySalesDiscountsField, type DailySalesField, type DailySalesLiveField, type DailySalesPaymentsField, type DailySalesRefundsVoidsField, type DailySalesTaxesField, type DailySalesTrendsField, type EmployeeTimecardField, type EmployeeTipField, type FieldType, type FooterCalculation, type FooterCalculationType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, REPORT_SECTION_CONFIGS, Report, type ReportColumnKey, type ReportConfig, type ReportSectionColumnDef, type ReportSectionDefinition, type ReportSectionName, type ReportType, type SalesByItemDetailField, type SalesSummaryField, type TicketLiveField, type TicketSummaryField, type TimeFormat, calculateFieldTotal, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesLiveConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, dailySalesTrendsOrderTypeConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getColumnExportHeaderLabel, getColumnMetadata, getDateToFormat, getNumberToFormat, getReportConfig, getReportExportFileName, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
package/dist/index.js
CHANGED
|
@@ -282,7 +282,8 @@ var FIELDS4 = {
|
|
|
282
282
|
locationName: { type: "string", columnKey: "locationName" },
|
|
283
283
|
orderNumber: {
|
|
284
284
|
type: "number",
|
|
285
|
-
columnKey: "ticketNumber"
|
|
285
|
+
columnKey: "ticketNumber",
|
|
286
|
+
footerCalculation: { type: "none" }
|
|
286
287
|
},
|
|
287
288
|
dateOpen: { type: "string", columnKey: "date" },
|
|
288
289
|
timeOpen: { type: "string", columnKey: "ticketOpen" },
|
|
@@ -655,38 +656,118 @@ var dailySalesConfig = {
|
|
|
655
656
|
fields: FIELDS10,
|
|
656
657
|
availableColumns: DAILY_SALES_AVAILABLE_COLUMNS,
|
|
657
658
|
defaultVisibleColumns: DAILY_SALES_AVAILABLE_COLUMNS,
|
|
658
|
-
hasFooter: true
|
|
659
|
+
hasFooter: true,
|
|
660
|
+
dataAccessKey: "salesByRevClass",
|
|
661
|
+
sectionName: "common.report-section.revenue-class",
|
|
662
|
+
extraFooterRowsKey: "salesByRevClassFooter"
|
|
659
663
|
};
|
|
660
664
|
|
|
661
|
-
// src/reports/
|
|
665
|
+
// src/reports/dailySalesCache.ts
|
|
662
666
|
var FIELDS11 = {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
itemsQuantity: { type: "number", columnKey: "quantity" },
|
|
666
|
-
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
667
|
-
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
668
|
-
inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
|
|
669
|
-
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
670
|
-
salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
|
|
671
|
-
guestsCount: { type: "number", columnKey: "guests" }
|
|
667
|
+
name: { type: "string", columnKey: "type", size: FIRST_COLUMN_WIDTH },
|
|
668
|
+
amount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } }
|
|
672
669
|
};
|
|
673
|
-
var
|
|
674
|
-
"itemsQuantity",
|
|
675
|
-
"salesAmountGross",
|
|
676
|
-
"discountsAmount",
|
|
677
|
-
"inclusiveTaxesAmount",
|
|
678
|
-
"salesAmountNet",
|
|
679
|
-
"salesMixPct"
|
|
680
|
-
];
|
|
681
|
-
var dailySalesLiveConfig = {
|
|
670
|
+
var dailySalesCacheConfig = {
|
|
682
671
|
fields: FIELDS11,
|
|
683
|
-
availableColumns:
|
|
684
|
-
defaultVisibleColumns:
|
|
685
|
-
hasFooter: true
|
|
672
|
+
availableColumns: ["name", "amount"],
|
|
673
|
+
defaultVisibleColumns: ["name", "amount"],
|
|
674
|
+
hasFooter: true,
|
|
675
|
+
dataAccessKey: "cashPayments",
|
|
676
|
+
sectionName: "common.report-section.cash"
|
|
686
677
|
};
|
|
687
678
|
|
|
688
|
-
// src/reports/
|
|
679
|
+
// src/reports/dailySalesDiscounts.ts
|
|
689
680
|
var FIELDS12 = {
|
|
681
|
+
discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH },
|
|
682
|
+
ticketCount: { type: "number", columnKey: "ticketCount", footerCalculation: { type: "sum" } },
|
|
683
|
+
itemCount: { type: "number", columnKey: "itemCount", footerCalculation: { type: "sum" } },
|
|
684
|
+
discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
|
|
685
|
+
};
|
|
686
|
+
var DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS = [
|
|
687
|
+
"discountName",
|
|
688
|
+
"ticketCount",
|
|
689
|
+
"itemCount",
|
|
690
|
+
"discountsAmount"
|
|
691
|
+
];
|
|
692
|
+
var dailySalesDiscountsConfig = {
|
|
693
|
+
fields: FIELDS12,
|
|
694
|
+
availableColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
|
|
695
|
+
defaultVisibleColumns: DAILY_SALES_DISCOUNTS_AVAILABLE_COLUMNS,
|
|
696
|
+
hasFooter: true,
|
|
697
|
+
dataAccessKey: "discounts",
|
|
698
|
+
sectionName: "common.report-section.discounts"
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
// src/reports/dailySalesPayments.ts
|
|
702
|
+
var FIELDS13 = {
|
|
703
|
+
paymentTypeName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
704
|
+
paymentsCount: { type: "number", columnKey: "paymentsCount", footerCalculation: { type: "sum" } },
|
|
705
|
+
paymentsAmount: { type: "money", columnKey: "paymentsAmount", footerCalculation: { type: "sum" } },
|
|
706
|
+
tipsAmount: { type: "money", columnKey: "tips", footerCalculation: { type: "sum" } },
|
|
707
|
+
totalSales: { type: "money", columnKey: "paymentsTotal", footerCalculation: { type: "sum" } }
|
|
708
|
+
};
|
|
709
|
+
var DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS = [
|
|
710
|
+
"paymentTypeName",
|
|
711
|
+
"paymentsCount",
|
|
712
|
+
"paymentsAmount",
|
|
713
|
+
"tipsAmount",
|
|
714
|
+
"totalSales"
|
|
715
|
+
];
|
|
716
|
+
var dailySalesPaymentsConfig = {
|
|
717
|
+
fields: FIELDS13,
|
|
718
|
+
availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
719
|
+
defaultVisibleColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
720
|
+
hasFooter: true,
|
|
721
|
+
dataAccessKey: "payments",
|
|
722
|
+
sectionName: "common.report-section.payments"
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
// src/reports/dailySalesRefundsVoids.ts
|
|
726
|
+
var FIELDS14 = {
|
|
727
|
+
description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH },
|
|
728
|
+
count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
|
|
729
|
+
amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
|
|
730
|
+
pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
|
|
731
|
+
};
|
|
732
|
+
var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
|
|
733
|
+
"description",
|
|
734
|
+
"count",
|
|
735
|
+
"amount",
|
|
736
|
+
"pctSales"
|
|
737
|
+
];
|
|
738
|
+
var dailySalesRefundsVoidsConfig = {
|
|
739
|
+
fields: FIELDS14,
|
|
740
|
+
availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
741
|
+
defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
742
|
+
hasFooter: true,
|
|
743
|
+
dataAccessKey: "refundsVoids",
|
|
744
|
+
sectionName: "common.report-section.refunds-voids"
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
// src/reports/dailySalesTaxes.ts
|
|
748
|
+
var FIELDS15 = {
|
|
749
|
+
taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH },
|
|
750
|
+
taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "none" } },
|
|
751
|
+
taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
|
|
752
|
+
exemptSales: { type: "money", columnKey: "exemptTaxes", footerCalculation: { type: "sum" } }
|
|
753
|
+
};
|
|
754
|
+
var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
|
|
755
|
+
"taxName",
|
|
756
|
+
"taxableSales",
|
|
757
|
+
"taxesAmount",
|
|
758
|
+
"exemptSales"
|
|
759
|
+
];
|
|
760
|
+
var dailySalesTaxesConfig = {
|
|
761
|
+
fields: FIELDS15,
|
|
762
|
+
availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
763
|
+
defaultVisibleColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
764
|
+
hasFooter: true,
|
|
765
|
+
dataAccessKey: "taxes",
|
|
766
|
+
sectionName: "common.report-section.taxes"
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
// src/reports/dailySalesTrends.ts
|
|
770
|
+
var FIELDS16 = {
|
|
690
771
|
groupById: { type: "string" },
|
|
691
772
|
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
692
773
|
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
@@ -719,10 +800,24 @@ var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
|
|
|
719
800
|
"salesAmountNet"
|
|
720
801
|
];
|
|
721
802
|
var dailySalesTrendsConfig = {
|
|
722
|
-
fields:
|
|
803
|
+
fields: FIELDS16,
|
|
723
804
|
availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
724
805
|
defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
725
|
-
hasFooter: true
|
|
806
|
+
hasFooter: true,
|
|
807
|
+
dataAccessKey: "trendsByDayPart",
|
|
808
|
+
sectionName: "common.report-section.sales-by-day-part",
|
|
809
|
+
totalsLabel: "common.report-section.trends-footer.total-sales",
|
|
810
|
+
extraFooterFields: ["salesAmountNet"]
|
|
811
|
+
};
|
|
812
|
+
var dailySalesTrendsOrderTypeConfig = {
|
|
813
|
+
fields: FIELDS16,
|
|
814
|
+
availableColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
815
|
+
defaultVisibleColumns: DAILY_SALES_TRENDS_AVAILABLE_COLUMNS,
|
|
816
|
+
hasFooter: true,
|
|
817
|
+
dataAccessKey: "trendsByOrderType",
|
|
818
|
+
sectionName: "common.report-section.sales-by-order-type",
|
|
819
|
+
totalsLabel: "common.report-section.trends-footer.total-sales",
|
|
820
|
+
extraFooterFields: ["salesAmountNet"]
|
|
726
821
|
};
|
|
727
822
|
|
|
728
823
|
// src/report.ts
|
|
@@ -740,6 +835,16 @@ var Report = {
|
|
|
740
835
|
DAILY_SALES_LIVE: "daily-sales-live",
|
|
741
836
|
DAILY_SALES_TRENDS: "daily-sales-trends"
|
|
742
837
|
};
|
|
838
|
+
var DAILY_SALES_SECTION_CONFIGS = [
|
|
839
|
+
dailySalesConfig,
|
|
840
|
+
dailySalesPaymentsConfig,
|
|
841
|
+
dailySalesCacheConfig,
|
|
842
|
+
dailySalesTaxesConfig,
|
|
843
|
+
dailySalesRefundsVoidsConfig,
|
|
844
|
+
dailySalesDiscountsConfig,
|
|
845
|
+
dailySalesTrendsConfig,
|
|
846
|
+
dailySalesTrendsOrderTypeConfig
|
|
847
|
+
];
|
|
743
848
|
var REPORT_CONFIG_MAP = {
|
|
744
849
|
"sales-summary": salesSummaryConfig,
|
|
745
850
|
"ticket-analytics": ticketSummaryConfig,
|
|
@@ -750,9 +855,9 @@ var REPORT_CONFIG_MAP = {
|
|
|
750
855
|
"employee-timecard": employeeTimecardConfig,
|
|
751
856
|
"employee-tip": employeeTipConfig,
|
|
752
857
|
"sales-by-item": salesByItemDetailConfig,
|
|
753
|
-
"daily-sales":
|
|
754
|
-
"daily-sales-live":
|
|
755
|
-
"daily-sales-trends":
|
|
858
|
+
"daily-sales": DAILY_SALES_SECTION_CONFIGS,
|
|
859
|
+
"daily-sales-live": DAILY_SALES_SECTION_CONFIGS,
|
|
860
|
+
"daily-sales-trends": null
|
|
756
861
|
};
|
|
757
862
|
var REPORT_DEFAULT_NAME_MAP = {
|
|
758
863
|
"sales-summary": "Sales",
|
|
@@ -1517,86 +1622,139 @@ var calculateReportTotals = (data, fieldConfig, opts) => {
|
|
|
1517
1622
|
return result;
|
|
1518
1623
|
};
|
|
1519
1624
|
|
|
1520
|
-
// src/reports/
|
|
1521
|
-
var
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
"
|
|
1530
|
-
"
|
|
1531
|
-
"tipsAmount",
|
|
1532
|
-
"totalSales"
|
|
1533
|
-
];
|
|
1534
|
-
var dailySalesPaymentsConfig = {
|
|
1535
|
-
fields: FIELDS13,
|
|
1536
|
-
availableColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
1537
|
-
defaultVisibleColumns: DAILY_SALES_PAYMENTS_AVAILABLE_COLUMNS,
|
|
1538
|
-
hasFooter: true
|
|
1539
|
-
};
|
|
1540
|
-
|
|
1541
|
-
// src/reports/dailySalesDiscounts.ts
|
|
1542
|
-
var FIELDS14 = {
|
|
1543
|
-
discountName: { type: "string", columnKey: "discountName", size: FIRST_COLUMN_WIDTH },
|
|
1544
|
-
ticketCount: { type: "number", columnKey: "ticketCount", footerCalculation: { type: "sum" } },
|
|
1545
|
-
itemCount: { type: "number", columnKey: "itemCount", footerCalculation: { type: "sum" } },
|
|
1546
|
-
discountsAmount: { type: "money", columnKey: "discountAmount", footerCalculation: { type: "sum" } }
|
|
1625
|
+
// src/reports/dailySalesLive.ts
|
|
1626
|
+
var FIELDS17 = {
|
|
1627
|
+
groupById: { type: "string" },
|
|
1628
|
+
groupByName: { type: "string", size: FIRST_COLUMN_WIDTH },
|
|
1629
|
+
itemsQuantity: { type: "number", columnKey: "quantity" },
|
|
1630
|
+
salesAmountGross: { type: "money", columnKey: "grossSales" },
|
|
1631
|
+
discountsAmount: { type: "money", columnKey: "discountAmount" },
|
|
1632
|
+
inclusiveTaxesAmount: { type: "money", columnKey: "inclusiveTax" },
|
|
1633
|
+
salesAmountNet: { type: "money", columnKey: "netSales" },
|
|
1634
|
+
salesMixPct: { type: "percent", columnKey: "salesMixByPct" },
|
|
1635
|
+
guestsCount: { type: "number", columnKey: "guests" }
|
|
1547
1636
|
};
|
|
1548
|
-
var
|
|
1549
|
-
"
|
|
1550
|
-
"
|
|
1551
|
-
"discountsAmount"
|
|
1637
|
+
var DAILY_SALES_LIVE_AVAILABLE_COLUMNS = [
|
|
1638
|
+
"itemsQuantity",
|
|
1639
|
+
"salesAmountGross",
|
|
1640
|
+
"discountsAmount",
|
|
1641
|
+
"inclusiveTaxesAmount",
|
|
1642
|
+
"salesAmountNet",
|
|
1643
|
+
"salesMixPct"
|
|
1552
1644
|
];
|
|
1553
|
-
var
|
|
1554
|
-
fields:
|
|
1555
|
-
availableColumns:
|
|
1556
|
-
defaultVisibleColumns:
|
|
1557
|
-
hasFooter: true
|
|
1558
|
-
};
|
|
1559
|
-
|
|
1560
|
-
// src/reports/dailySalesRefundsVoids.ts
|
|
1561
|
-
var FIELDS15 = {
|
|
1562
|
-
description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH },
|
|
1563
|
-
count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
|
|
1564
|
-
amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
|
|
1565
|
-
pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
|
|
1566
|
-
};
|
|
1567
|
-
var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = ["count", "amount", "pctSales"];
|
|
1568
|
-
var dailySalesRefundsVoidsConfig = {
|
|
1569
|
-
fields: FIELDS15,
|
|
1570
|
-
availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
1571
|
-
defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
|
|
1645
|
+
var dailySalesLiveConfig = {
|
|
1646
|
+
fields: FIELDS17,
|
|
1647
|
+
availableColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
|
|
1648
|
+
defaultVisibleColumns: DAILY_SALES_LIVE_AVAILABLE_COLUMNS,
|
|
1572
1649
|
hasFooter: true
|
|
1573
1650
|
};
|
|
1574
1651
|
|
|
1575
|
-
// src/reports/
|
|
1576
|
-
var
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
};
|
|
1582
|
-
var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = ["taxableSales", "taxesAmount", "exemptSales"];
|
|
1583
|
-
var dailySalesTaxesConfig = {
|
|
1584
|
-
fields: FIELDS16,
|
|
1585
|
-
availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
1586
|
-
defaultVisibleColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
|
|
1587
|
-
hasFooter: true
|
|
1652
|
+
// src/reports/reportSection.ts
|
|
1653
|
+
var DAILY_SALES_CASH_ROW_LABELS = {
|
|
1654
|
+
cashPayments: "common.report-section.cash-row.cash-payments",
|
|
1655
|
+
paidInOuts: "common.report-section.cash-row.paid-in-outs",
|
|
1656
|
+
gratuitiesPaidOut: "common.report-section.cash-row.gratuities-paid-out",
|
|
1657
|
+
ccTipsPaidOut: "common.report-section.cash-row.cc-tips-paid-out"
|
|
1588
1658
|
};
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1659
|
+
var DAILY_SALES_REV_CLASS_FOOTER_LABELS = {
|
|
1660
|
+
taxTotal: "common.report-section.rev-class-footer.tax-total",
|
|
1661
|
+
gratuities: "common.report-section.rev-class-footer.gratuities",
|
|
1662
|
+
balancePayments: "common.report-section.rev-class-footer.balance-payments",
|
|
1663
|
+
giftCardSales: "common.report-section.rev-class-footer.gift-card-sales",
|
|
1664
|
+
nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue",
|
|
1665
|
+
totalAccountable: "common.report-section.rev-class-footer.total-accountable"
|
|
1594
1666
|
};
|
|
1595
|
-
var
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1667
|
+
var DAILY_SALES_SECTIONS = [
|
|
1668
|
+
{
|
|
1669
|
+
sectionLabel: "common.report-section.revenue-class",
|
|
1670
|
+
config: dailySalesConfig,
|
|
1671
|
+
columns: [
|
|
1672
|
+
{ fieldKey: "groupByName", columnKey: "revenueClass" },
|
|
1673
|
+
{ fieldKey: "itemsQuantity", columnKey: "quantity" },
|
|
1674
|
+
{ fieldKey: "salesAmountGross", columnKey: "grossSales" },
|
|
1675
|
+
{ fieldKey: "discountsAmount", columnKey: "discountAmount" },
|
|
1676
|
+
{ fieldKey: "inclusiveTaxesAmount", columnKey: "inclusiveTax" },
|
|
1677
|
+
{ fieldKey: "salesAmountNet", columnKey: "netSales" },
|
|
1678
|
+
{ fieldKey: "salesMixPct", columnKey: "salesMixByPct" }
|
|
1679
|
+
]
|
|
1680
|
+
},
|
|
1681
|
+
{
|
|
1682
|
+
sectionLabel: "common.report-section.payments",
|
|
1683
|
+
config: dailySalesPaymentsConfig,
|
|
1684
|
+
columns: [
|
|
1685
|
+
{ fieldKey: "paymentTypeName", columnKey: "paymentType" },
|
|
1686
|
+
{ fieldKey: "paymentsCount", columnKey: "paymentsCount" },
|
|
1687
|
+
{ fieldKey: "paymentsAmount", columnKey: "paymentsAmount" },
|
|
1688
|
+
{ fieldKey: "tipsAmount", columnKey: "tips" },
|
|
1689
|
+
{ fieldKey: "totalSales", columnKey: "paymentsTotal" }
|
|
1690
|
+
]
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
sectionLabel: "common.report-section.cash",
|
|
1694
|
+
config: dailySalesCacheConfig,
|
|
1695
|
+
columns: [
|
|
1696
|
+
{ fieldKey: "name", columnKey: "type", isRowLabelKey: true },
|
|
1697
|
+
{ fieldKey: "amount", columnKey: "paymentsAmount" }
|
|
1698
|
+
]
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
sectionLabel: "common.report-section.taxes",
|
|
1702
|
+
config: dailySalesTaxesConfig,
|
|
1703
|
+
columns: [
|
|
1704
|
+
{ fieldKey: "taxName", columnKey: "taxName" },
|
|
1705
|
+
{ fieldKey: "taxableSales", columnKey: "taxableSales" },
|
|
1706
|
+
{ fieldKey: "taxesAmount", columnKey: "taxCollected" },
|
|
1707
|
+
{ fieldKey: "exemptSales", columnKey: "exemptTaxes" }
|
|
1708
|
+
]
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
sectionLabel: "common.report-section.refunds-voids",
|
|
1712
|
+
config: dailySalesRefundsVoidsConfig,
|
|
1713
|
+
columns: [
|
|
1714
|
+
{ fieldKey: "description", columnKey: "refundVoidDescription" },
|
|
1715
|
+
{ fieldKey: "count", columnKey: "refundVoidCount" },
|
|
1716
|
+
{ fieldKey: "amount", columnKey: "refundVoidAmount" },
|
|
1717
|
+
{ fieldKey: "pctSales", columnKey: "refundVoidPctSales" }
|
|
1718
|
+
]
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
sectionLabel: "common.report-section.discounts",
|
|
1722
|
+
config: dailySalesDiscountsConfig,
|
|
1723
|
+
columns: [
|
|
1724
|
+
{ fieldKey: "discountName", columnKey: "discountName" },
|
|
1725
|
+
{ fieldKey: "ticketCount", columnKey: "ticketCount" },
|
|
1726
|
+
{ fieldKey: "itemCount", columnKey: "itemCount" },
|
|
1727
|
+
{ fieldKey: "discountsAmount", columnKey: "discountAmount" }
|
|
1728
|
+
]
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
sectionLabel: "common.report-section.sales-by-day-part",
|
|
1732
|
+
config: dailySalesTrendsConfig,
|
|
1733
|
+
columns: [
|
|
1734
|
+
{ fieldKey: "groupByName", columnKey: "daypart" },
|
|
1735
|
+
{ fieldKey: "ticketsCount", columnKey: "tickets" },
|
|
1736
|
+
{ fieldKey: "guestsCount", columnKey: "guests" },
|
|
1737
|
+
{ fieldKey: "ticketAvg", columnKey: "ticketAverage" },
|
|
1738
|
+
{ fieldKey: "guestAvg", columnKey: "guestAverage" },
|
|
1739
|
+
{ fieldKey: "salesAmountNet", columnKey: "netSales" }
|
|
1740
|
+
]
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
sectionLabel: "common.report-section.sales-by-order-type",
|
|
1744
|
+
config: dailySalesTrendsOrderTypeConfig,
|
|
1745
|
+
columns: [
|
|
1746
|
+
{ fieldKey: "groupByName", columnKey: "orderType" },
|
|
1747
|
+
{ fieldKey: "ticketsCount", columnKey: "tickets" },
|
|
1748
|
+
{ fieldKey: "guestsCount", columnKey: "guests" },
|
|
1749
|
+
{ fieldKey: "ticketAvg", columnKey: "ticketAverage" },
|
|
1750
|
+
{ fieldKey: "guestAvg", columnKey: "guestAverage" },
|
|
1751
|
+
{ fieldKey: "salesAmountNet", columnKey: "netSales" }
|
|
1752
|
+
]
|
|
1753
|
+
}
|
|
1754
|
+
];
|
|
1755
|
+
var REPORT_SECTION_CONFIGS = {
|
|
1756
|
+
[Report.DAILY_SALES]: DAILY_SALES_SECTIONS,
|
|
1757
|
+
[Report.DAILY_SALES_LIVE]: DAILY_SALES_SECTIONS
|
|
1600
1758
|
};
|
|
1601
1759
|
|
|
1602
1760
|
// src/formatting.ts
|
|
@@ -1739,6 +1897,9 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
1739
1897
|
};
|
|
1740
1898
|
export {
|
|
1741
1899
|
COLUMN_REGISTRY,
|
|
1900
|
+
DAILY_SALES_CASH_ROW_LABELS,
|
|
1901
|
+
DAILY_SALES_REV_CLASS_FOOTER_LABELS,
|
|
1902
|
+
REPORT_SECTION_CONFIGS,
|
|
1742
1903
|
Report,
|
|
1743
1904
|
calculateFieldTotal,
|
|
1744
1905
|
calculateReportTotals,
|
|
@@ -1750,6 +1911,7 @@ export {
|
|
|
1750
1911
|
dailySalesRefundsVoidsConfig,
|
|
1751
1912
|
dailySalesTaxesConfig,
|
|
1752
1913
|
dailySalesTrendsConfig,
|
|
1914
|
+
dailySalesTrendsOrderTypeConfig,
|
|
1753
1915
|
employeeTimecardConfig,
|
|
1754
1916
|
employeeTipConfig,
|
|
1755
1917
|
formatDate,
|