@harbortouch/skytab-analytics-report-utils 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7NXZJEGU.js → chunk-Y7HQPSMO.js} +3 -0
- package/dist/exporters/exportBuilder.cjs +3 -0
- package/dist/exporters/exportBuilder.d.cts +1 -1
- package/dist/exporters/exportBuilder.d.ts +1 -1
- package/dist/exporters/exportBuilder.js +1 -1
- package/dist/index.cjs +55 -0
- package/dist/index.d.cts +69 -3
- package/dist/index.d.ts +69 -3
- package/dist/index.js +50 -1
- package/dist/{report-BOL9p86o.d.cts → report-cTbF3q_4.d.cts} +1 -0
- package/dist/{report-BOL9p86o.d.ts → report-cTbF3q_4.d.ts} +1 -0
- package/package.json +1 -1
|
@@ -2134,6 +2134,7 @@ var enUS = {
|
|
|
2134
2134
|
"common.report-section.rev-class-footer.balance-payments": "Balance Payments",
|
|
2135
2135
|
"common.report-section.rev-class-footer.gift-card-sales": "Gift Card Sales",
|
|
2136
2136
|
"common.report-section.rev-class-footer.non-sales-revenue": "Non-Sales Revenue",
|
|
2137
|
+
"common.report-section.rev-class-footer.house-account": "House Account",
|
|
2137
2138
|
"common.report-section.rev-class-footer.total-accountable": "Total Accountable",
|
|
2138
2139
|
"scheduled-reports.period": "Period",
|
|
2139
2140
|
"components.form.field.group-by": "Group By",
|
|
@@ -2620,6 +2621,7 @@ var enUS2 = {
|
|
|
2620
2621
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2621
2622
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2622
2623
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2624
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2623
2625
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2624
2626
|
"scheduled-reports.period": false,
|
|
2625
2627
|
"components.form.field.group-by": false,
|
|
@@ -3106,6 +3108,7 @@ var enUS3 = {
|
|
|
3106
3108
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
3107
3109
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
3108
3110
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
3111
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
3109
3112
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
3110
3113
|
"scheduled-reports.period": false,
|
|
3111
3114
|
"components.form.field.group-by": false,
|
|
@@ -2242,6 +2242,7 @@ var enUS = {
|
|
|
2242
2242
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2243
2243
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2244
2244
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2245
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2245
2246
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2246
2247
|
"scheduled-reports.period": false,
|
|
2247
2248
|
"components.form.field.group-by": false,
|
|
@@ -2728,6 +2729,7 @@ var enUS2 = {
|
|
|
2728
2729
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2729
2730
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2730
2731
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2732
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2731
2733
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2732
2734
|
"scheduled-reports.period": false,
|
|
2733
2735
|
"components.form.field.group-by": false,
|
|
@@ -3214,6 +3216,7 @@ var enUS3 = {
|
|
|
3214
3216
|
"common.report-section.rev-class-footer.balance-payments": "Balance Payments",
|
|
3215
3217
|
"common.report-section.rev-class-footer.gift-card-sales": "Gift Card Sales",
|
|
3216
3218
|
"common.report-section.rev-class-footer.non-sales-revenue": "Non-Sales Revenue",
|
|
3219
|
+
"common.report-section.rev-class-footer.house-account": "House Account",
|
|
3217
3220
|
"common.report-section.rev-class-footer.total-accountable": "Total Accountable",
|
|
3218
3221
|
"scheduled-reports.period": "Period",
|
|
3219
3222
|
"components.form.field.group-by": "Group By",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ReportType, A as AnalyticsField } from '../report-
|
|
1
|
+
import { R as ReportType, A as AnalyticsField } from '../report-cTbF3q_4.cjs';
|
|
2
2
|
import { E as ExportTable, a as ExportFilter } from '../types-BzLsgnfc.cjs';
|
|
3
3
|
|
|
4
4
|
interface ReportDocumentSection {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ReportType, A as AnalyticsField } from '../report-
|
|
1
|
+
import { R as ReportType, A as AnalyticsField } from '../report-cTbF3q_4.js';
|
|
2
2
|
import { E as ExportTable, a as ExportFilter } from '../types-BzLsgnfc.js';
|
|
3
3
|
|
|
4
4
|
interface ReportDocumentSection {
|
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,9 @@ __export(index_exports, {
|
|
|
25
25
|
DAILY_SALES_REV_CLASS_FOOTER_LABELS: () => DAILY_SALES_REV_CLASS_FOOTER_LABELS,
|
|
26
26
|
REPORT_SECTION_CONFIGS: () => REPORT_SECTION_CONFIGS,
|
|
27
27
|
Report: () => Report,
|
|
28
|
+
TENDER_TYPE: () => TENDER_TYPE,
|
|
29
|
+
buildDailySalesCashPayments: () => buildDailySalesCashPayments,
|
|
30
|
+
buildDailySalesRevClassFooter: () => buildDailySalesRevClassFooter,
|
|
28
31
|
calculateFieldTotal: () => calculateFieldTotal,
|
|
29
32
|
calculateReportTotals: () => calculateReportTotals,
|
|
30
33
|
dailySalesCacheConfig: () => dailySalesCacheConfig,
|
|
@@ -1799,6 +1802,7 @@ var DAILY_SALES_REV_CLASS_FOOTER_LABELS = {
|
|
|
1799
1802
|
balancePayments: "common.report-section.rev-class-footer.balance-payments",
|
|
1800
1803
|
giftCardSales: "common.report-section.rev-class-footer.gift-card-sales",
|
|
1801
1804
|
nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue",
|
|
1805
|
+
houseAccount: "common.report-section.rev-class-footer.house-account",
|
|
1802
1806
|
totalAccountable: "common.report-section.rev-class-footer.total-accountable"
|
|
1803
1807
|
};
|
|
1804
1808
|
var DAILY_SALES_SECTIONS = [
|
|
@@ -1894,6 +1898,51 @@ var REPORT_SECTION_CONFIGS = {
|
|
|
1894
1898
|
[Report.DAILY_SALES_LIVE]: DAILY_SALES_SECTIONS
|
|
1895
1899
|
};
|
|
1896
1900
|
|
|
1901
|
+
// src/constants.ts
|
|
1902
|
+
var TENDER_TYPE = {
|
|
1903
|
+
CASH: "Cash",
|
|
1904
|
+
CHECK: "Check",
|
|
1905
|
+
CREDIT: "Credit",
|
|
1906
|
+
CRYPTO: "Crypto",
|
|
1907
|
+
DEBIT: "Debit",
|
|
1908
|
+
GIFT_CARD: "Gift Card",
|
|
1909
|
+
GIFT_CERTIFICATE: "Gift Certificate",
|
|
1910
|
+
HOUSE_ACCOUNT: "House Account",
|
|
1911
|
+
VIRTUAL: "Virtual",
|
|
1912
|
+
MOBILE_WALLET: "Digital Wallet",
|
|
1913
|
+
PROPERTY_MANAGEMENT_SYSTEM: "PMS",
|
|
1914
|
+
ROOM_CHARGE: "Room Charge",
|
|
1915
|
+
WALK_OUT: "Walk Out",
|
|
1916
|
+
CASH_REFUNDS: "Cash Refunds",
|
|
1917
|
+
UNKNOWN: "Unknown"
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
// src/reports/dailySales.utils.ts
|
|
1921
|
+
var buildDailySalesCashPayments = (payments, paidOutAmount, gratuitiesPaidOutAmount, tipsPaidOutAmount) => [
|
|
1922
|
+
{
|
|
1923
|
+
name: DAILY_SALES_CASH_ROW_LABELS.cashPayments,
|
|
1924
|
+
amount: payments.filter((r) => r.paymentTypeName === TENDER_TYPE.CASH || r.paymentTypeName === TENDER_TYPE.CASH_REFUNDS).reduce((sum, r) => sum + r.paymentsAmount, 0)
|
|
1925
|
+
},
|
|
1926
|
+
{ name: DAILY_SALES_CASH_ROW_LABELS.paidInOuts, amount: paidOutAmount },
|
|
1927
|
+
{ name: DAILY_SALES_CASH_ROW_LABELS.gratuitiesPaidOut, amount: gratuitiesPaidOutAmount },
|
|
1928
|
+
{ name: DAILY_SALES_CASH_ROW_LABELS.ccTipsPaidOut, amount: tipsPaidOutAmount }
|
|
1929
|
+
];
|
|
1930
|
+
var buildDailySalesRevClassFooter = (inputs) => {
|
|
1931
|
+
const totalAccountable = inputs.revClassNetSales + inputs.taxTotal + inputs.gratuitiesTotal + inputs.balancePaymentsTotal + inputs.giftCardSalesTotal + inputs.nonSalesTotal - inputs.houseAccountTotal;
|
|
1932
|
+
return [
|
|
1933
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.taxTotal, salesAmountNet: inputs.taxTotal },
|
|
1934
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.gratuities, salesAmountNet: inputs.gratuitiesTotal },
|
|
1935
|
+
{
|
|
1936
|
+
groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.balancePayments,
|
|
1937
|
+
salesAmountNet: inputs.balancePaymentsTotal
|
|
1938
|
+
},
|
|
1939
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.giftCardSales, salesAmountNet: inputs.giftCardSalesTotal },
|
|
1940
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.nonSalesRevenue, salesAmountNet: inputs.nonSalesTotal },
|
|
1941
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.houseAccount, salesAmountNet: inputs.houseAccountTotal },
|
|
1942
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.totalAccountable, salesAmountNet: totalAccountable }
|
|
1943
|
+
];
|
|
1944
|
+
};
|
|
1945
|
+
|
|
1897
1946
|
// src/translations/crowdin/skytab-analytics-report-utils/en-GB.ts
|
|
1898
1947
|
var enUS = {
|
|
1899
1948
|
"common.report-col.fifteen-min-interval": false,
|
|
@@ -2349,6 +2398,7 @@ var enUS = {
|
|
|
2349
2398
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2350
2399
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2351
2400
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2401
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2352
2402
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2353
2403
|
"scheduled-reports.period": false,
|
|
2354
2404
|
"components.form.field.group-by": false,
|
|
@@ -2835,6 +2885,7 @@ var enUS2 = {
|
|
|
2835
2885
|
"common.report-section.rev-class-footer.balance-payments": false,
|
|
2836
2886
|
"common.report-section.rev-class-footer.gift-card-sales": false,
|
|
2837
2887
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
2888
|
+
"common.report-section.rev-class-footer.house-account": false,
|
|
2838
2889
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
2839
2890
|
"scheduled-reports.period": false,
|
|
2840
2891
|
"components.form.field.group-by": false,
|
|
@@ -3321,6 +3372,7 @@ var enUS3 = {
|
|
|
3321
3372
|
"common.report-section.rev-class-footer.balance-payments": "Balance Payments",
|
|
3322
3373
|
"common.report-section.rev-class-footer.gift-card-sales": "Gift Card Sales",
|
|
3323
3374
|
"common.report-section.rev-class-footer.non-sales-revenue": "Non-Sales Revenue",
|
|
3375
|
+
"common.report-section.rev-class-footer.house-account": "House Account",
|
|
3324
3376
|
"common.report-section.rev-class-footer.total-accountable": "Total Accountable",
|
|
3325
3377
|
"scheduled-reports.period": "Period",
|
|
3326
3378
|
"components.form.field.group-by": "Group By",
|
|
@@ -3517,6 +3569,9 @@ var formatFieldValue = (value, type, localeOptions, fullRecord, fieldConfig = DE
|
|
|
3517
3569
|
DAILY_SALES_REV_CLASS_FOOTER_LABELS,
|
|
3518
3570
|
REPORT_SECTION_CONFIGS,
|
|
3519
3571
|
Report,
|
|
3572
|
+
TENDER_TYPE,
|
|
3573
|
+
buildDailySalesCashPayments,
|
|
3574
|
+
buildDailySalesRevClassFooter,
|
|
3520
3575
|
calculateFieldTotal,
|
|
3521
3576
|
calculateReportTotals,
|
|
3522
3577
|
dailySalesCacheConfig,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-
|
|
2
|
-
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as getReportConfig, n as getReportExportFileName } from './report-
|
|
1
|
+
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-cTbF3q_4.cjs';
|
|
2
|
+
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as getReportConfig, n as getReportExportFileName } from './report-cTbF3q_4.cjs';
|
|
3
3
|
|
|
4
4
|
type SupportedLocale = 'en-US' | 'en-GB' | 'es-ES';
|
|
5
5
|
declare function resolveTranslate(key: MessageKey, locale: string): string;
|
|
@@ -103,6 +103,53 @@ declare const dailySalesDiscountsConfig: {
|
|
|
103
103
|
readonly sectionName: "common.report-section.discounts";
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
+
declare const buildDailySalesCashPayments: (payments: {
|
|
107
|
+
paymentTypeName: string;
|
|
108
|
+
paymentsAmount: number;
|
|
109
|
+
}[], paidOutAmount: number, gratuitiesPaidOutAmount: number, tipsPaidOutAmount: number) => ({
|
|
110
|
+
name: "common.report-section.cash-row.cash-payments";
|
|
111
|
+
amount: number;
|
|
112
|
+
} | {
|
|
113
|
+
name: "common.report-section.cash-row.paid-in-outs";
|
|
114
|
+
amount: number;
|
|
115
|
+
} | {
|
|
116
|
+
name: "common.report-section.cash-row.gratuities-paid-out";
|
|
117
|
+
amount: number;
|
|
118
|
+
} | {
|
|
119
|
+
name: "common.report-section.cash-row.cc-tips-paid-out";
|
|
120
|
+
amount: number;
|
|
121
|
+
})[];
|
|
122
|
+
declare const buildDailySalesRevClassFooter: (inputs: {
|
|
123
|
+
revClassNetSales: number;
|
|
124
|
+
taxTotal: number;
|
|
125
|
+
gratuitiesTotal: number;
|
|
126
|
+
giftCardSalesTotal: number;
|
|
127
|
+
balancePaymentsTotal: number;
|
|
128
|
+
nonSalesTotal: number;
|
|
129
|
+
houseAccountTotal: number;
|
|
130
|
+
}) => ({
|
|
131
|
+
groupByName: "common.report-section.rev-class-footer.tax-total";
|
|
132
|
+
salesAmountNet: number;
|
|
133
|
+
} | {
|
|
134
|
+
groupByName: "common.report-section.rev-class-footer.gratuities";
|
|
135
|
+
salesAmountNet: number;
|
|
136
|
+
} | {
|
|
137
|
+
groupByName: "common.report-section.rev-class-footer.balance-payments";
|
|
138
|
+
salesAmountNet: number;
|
|
139
|
+
} | {
|
|
140
|
+
groupByName: "common.report-section.rev-class-footer.gift-card-sales";
|
|
141
|
+
salesAmountNet: number;
|
|
142
|
+
} | {
|
|
143
|
+
groupByName: "common.report-section.rev-class-footer.non-sales-revenue";
|
|
144
|
+
salesAmountNet: number;
|
|
145
|
+
} | {
|
|
146
|
+
groupByName: "common.report-section.rev-class-footer.house-account";
|
|
147
|
+
salesAmountNet: number;
|
|
148
|
+
} | {
|
|
149
|
+
groupByName: "common.report-section.rev-class-footer.total-accountable";
|
|
150
|
+
salesAmountNet: number;
|
|
151
|
+
})[];
|
|
152
|
+
|
|
106
153
|
type DailySalesRefundsVoidsField = 'description' | 'count' | 'amount' | 'pctSales';
|
|
107
154
|
declare const dailySalesRefundsVoidsConfig: {
|
|
108
155
|
readonly fields: Record<DailySalesRefundsVoidsField, ColumnPresentationConfig<DailySalesRefundsVoidsField>>;
|
|
@@ -201,10 +248,29 @@ declare const DAILY_SALES_REV_CLASS_FOOTER_LABELS: {
|
|
|
201
248
|
readonly balancePayments: "common.report-section.rev-class-footer.balance-payments";
|
|
202
249
|
readonly giftCardSales: "common.report-section.rev-class-footer.gift-card-sales";
|
|
203
250
|
readonly nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue";
|
|
251
|
+
readonly houseAccount: "common.report-section.rev-class-footer.house-account";
|
|
204
252
|
readonly totalAccountable: "common.report-section.rev-class-footer.total-accountable";
|
|
205
253
|
};
|
|
206
254
|
declare const REPORT_SECTION_CONFIGS: Partial<Record<ReportType, ReportSectionDefinition[]>>;
|
|
207
255
|
|
|
256
|
+
declare const TENDER_TYPE: {
|
|
257
|
+
readonly CASH: "Cash";
|
|
258
|
+
readonly CHECK: "Check";
|
|
259
|
+
readonly CREDIT: "Credit";
|
|
260
|
+
readonly CRYPTO: "Crypto";
|
|
261
|
+
readonly DEBIT: "Debit";
|
|
262
|
+
readonly GIFT_CARD: "Gift Card";
|
|
263
|
+
readonly GIFT_CERTIFICATE: "Gift Certificate";
|
|
264
|
+
readonly HOUSE_ACCOUNT: "House Account";
|
|
265
|
+
readonly VIRTUAL: "Virtual";
|
|
266
|
+
readonly MOBILE_WALLET: "Digital Wallet";
|
|
267
|
+
readonly PROPERTY_MANAGEMENT_SYSTEM: "PMS";
|
|
268
|
+
readonly ROOM_CHARGE: "Room Charge";
|
|
269
|
+
readonly WALK_OUT: "Walk Out";
|
|
270
|
+
readonly CASH_REFUNDS: "Cash Refunds";
|
|
271
|
+
readonly UNKNOWN: "Unknown";
|
|
272
|
+
};
|
|
273
|
+
|
|
208
274
|
type TimeFormat = '00:00' | '00:00:00' | '00:00-24H';
|
|
209
275
|
interface LocaleOption {
|
|
210
276
|
currency: string;
|
|
@@ -246,4 +312,4 @@ declare const getReportFormattingLocaleOptions: (locations: {
|
|
|
246
312
|
}[]) => LocaleOption[];
|
|
247
313
|
declare const formatFieldValue: (value: unknown, type: FieldType, localeOptions: LocaleOption, fullRecord: Record<string, unknown> | null | undefined, fieldConfig?: ColumnPresentationConfig) => string;
|
|
248
314
|
|
|
249
|
-
export { type CalculateReportTotalsOptions, ColumnAlignment, ColumnGroupConfig, 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, FieldType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, REPORT_SECTION_CONFIGS, ReportColumnKey, ReportConfig, type ReportSectionColumnDef, type ReportSectionDefinition, ReportType, type SalesByItemDetailField, type SalesSummaryField, type SupportedLocale, 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, getDateToFormat, getNumberToFormat, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, resolveTranslate, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
|
315
|
+
export { type CalculateReportTotalsOptions, ColumnAlignment, ColumnGroupConfig, 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, FieldType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, REPORT_SECTION_CONFIGS, ReportColumnKey, ReportConfig, type ReportSectionColumnDef, type ReportSectionDefinition, ReportType, type SalesByItemDetailField, type SalesSummaryField, type SupportedLocale, TENDER_TYPE, type TicketLiveField, type TicketSummaryField, type TimeFormat, buildDailySalesCashPayments, buildDailySalesRevClassFooter, calculateFieldTotal, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesLiveConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, dailySalesTrendsOrderTypeConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getDateToFormat, getNumberToFormat, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, resolveTranslate, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-
|
|
2
|
-
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as getReportConfig, n as getReportExportFileName } from './report-
|
|
1
|
+
import { M as MessageKey, F as FieldType, C as ColumnAlignment, a as ColumnPresentationConfig, b as ColumnGroupConfig, R as ReportType, c as ReportConfig, d as ReportColumnKey } from './report-cTbF3q_4.js';
|
|
2
|
+
export { e as COLUMN_REGISTRY, f as ColumnMessageKey, g as ColumnMetadata, h as FooterCalculation, i as FooterCalculationType, j as Report, k as getColumnExportHeaderLabel, l as getColumnMetadata, m as getReportConfig, n as getReportExportFileName } from './report-cTbF3q_4.js';
|
|
3
3
|
|
|
4
4
|
type SupportedLocale = 'en-US' | 'en-GB' | 'es-ES';
|
|
5
5
|
declare function resolveTranslate(key: MessageKey, locale: string): string;
|
|
@@ -103,6 +103,53 @@ declare const dailySalesDiscountsConfig: {
|
|
|
103
103
|
readonly sectionName: "common.report-section.discounts";
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
+
declare const buildDailySalesCashPayments: (payments: {
|
|
107
|
+
paymentTypeName: string;
|
|
108
|
+
paymentsAmount: number;
|
|
109
|
+
}[], paidOutAmount: number, gratuitiesPaidOutAmount: number, tipsPaidOutAmount: number) => ({
|
|
110
|
+
name: "common.report-section.cash-row.cash-payments";
|
|
111
|
+
amount: number;
|
|
112
|
+
} | {
|
|
113
|
+
name: "common.report-section.cash-row.paid-in-outs";
|
|
114
|
+
amount: number;
|
|
115
|
+
} | {
|
|
116
|
+
name: "common.report-section.cash-row.gratuities-paid-out";
|
|
117
|
+
amount: number;
|
|
118
|
+
} | {
|
|
119
|
+
name: "common.report-section.cash-row.cc-tips-paid-out";
|
|
120
|
+
amount: number;
|
|
121
|
+
})[];
|
|
122
|
+
declare const buildDailySalesRevClassFooter: (inputs: {
|
|
123
|
+
revClassNetSales: number;
|
|
124
|
+
taxTotal: number;
|
|
125
|
+
gratuitiesTotal: number;
|
|
126
|
+
giftCardSalesTotal: number;
|
|
127
|
+
balancePaymentsTotal: number;
|
|
128
|
+
nonSalesTotal: number;
|
|
129
|
+
houseAccountTotal: number;
|
|
130
|
+
}) => ({
|
|
131
|
+
groupByName: "common.report-section.rev-class-footer.tax-total";
|
|
132
|
+
salesAmountNet: number;
|
|
133
|
+
} | {
|
|
134
|
+
groupByName: "common.report-section.rev-class-footer.gratuities";
|
|
135
|
+
salesAmountNet: number;
|
|
136
|
+
} | {
|
|
137
|
+
groupByName: "common.report-section.rev-class-footer.balance-payments";
|
|
138
|
+
salesAmountNet: number;
|
|
139
|
+
} | {
|
|
140
|
+
groupByName: "common.report-section.rev-class-footer.gift-card-sales";
|
|
141
|
+
salesAmountNet: number;
|
|
142
|
+
} | {
|
|
143
|
+
groupByName: "common.report-section.rev-class-footer.non-sales-revenue";
|
|
144
|
+
salesAmountNet: number;
|
|
145
|
+
} | {
|
|
146
|
+
groupByName: "common.report-section.rev-class-footer.house-account";
|
|
147
|
+
salesAmountNet: number;
|
|
148
|
+
} | {
|
|
149
|
+
groupByName: "common.report-section.rev-class-footer.total-accountable";
|
|
150
|
+
salesAmountNet: number;
|
|
151
|
+
})[];
|
|
152
|
+
|
|
106
153
|
type DailySalesRefundsVoidsField = 'description' | 'count' | 'amount' | 'pctSales';
|
|
107
154
|
declare const dailySalesRefundsVoidsConfig: {
|
|
108
155
|
readonly fields: Record<DailySalesRefundsVoidsField, ColumnPresentationConfig<DailySalesRefundsVoidsField>>;
|
|
@@ -201,10 +248,29 @@ declare const DAILY_SALES_REV_CLASS_FOOTER_LABELS: {
|
|
|
201
248
|
readonly balancePayments: "common.report-section.rev-class-footer.balance-payments";
|
|
202
249
|
readonly giftCardSales: "common.report-section.rev-class-footer.gift-card-sales";
|
|
203
250
|
readonly nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue";
|
|
251
|
+
readonly houseAccount: "common.report-section.rev-class-footer.house-account";
|
|
204
252
|
readonly totalAccountable: "common.report-section.rev-class-footer.total-accountable";
|
|
205
253
|
};
|
|
206
254
|
declare const REPORT_SECTION_CONFIGS: Partial<Record<ReportType, ReportSectionDefinition[]>>;
|
|
207
255
|
|
|
256
|
+
declare const TENDER_TYPE: {
|
|
257
|
+
readonly CASH: "Cash";
|
|
258
|
+
readonly CHECK: "Check";
|
|
259
|
+
readonly CREDIT: "Credit";
|
|
260
|
+
readonly CRYPTO: "Crypto";
|
|
261
|
+
readonly DEBIT: "Debit";
|
|
262
|
+
readonly GIFT_CARD: "Gift Card";
|
|
263
|
+
readonly GIFT_CERTIFICATE: "Gift Certificate";
|
|
264
|
+
readonly HOUSE_ACCOUNT: "House Account";
|
|
265
|
+
readonly VIRTUAL: "Virtual";
|
|
266
|
+
readonly MOBILE_WALLET: "Digital Wallet";
|
|
267
|
+
readonly PROPERTY_MANAGEMENT_SYSTEM: "PMS";
|
|
268
|
+
readonly ROOM_CHARGE: "Room Charge";
|
|
269
|
+
readonly WALK_OUT: "Walk Out";
|
|
270
|
+
readonly CASH_REFUNDS: "Cash Refunds";
|
|
271
|
+
readonly UNKNOWN: "Unknown";
|
|
272
|
+
};
|
|
273
|
+
|
|
208
274
|
type TimeFormat = '00:00' | '00:00:00' | '00:00-24H';
|
|
209
275
|
interface LocaleOption {
|
|
210
276
|
currency: string;
|
|
@@ -246,4 +312,4 @@ declare const getReportFormattingLocaleOptions: (locations: {
|
|
|
246
312
|
}[]) => LocaleOption[];
|
|
247
313
|
declare const formatFieldValue: (value: unknown, type: FieldType, localeOptions: LocaleOption, fullRecord: Record<string, unknown> | null | undefined, fieldConfig?: ColumnPresentationConfig) => string;
|
|
248
314
|
|
|
249
|
-
export { type CalculateReportTotalsOptions, ColumnAlignment, ColumnGroupConfig, 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, FieldType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, REPORT_SECTION_CONFIGS, ReportColumnKey, ReportConfig, type ReportSectionColumnDef, type ReportSectionDefinition, ReportType, type SalesByItemDetailField, type SalesSummaryField, type SupportedLocale, 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, getDateToFormat, getNumberToFormat, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, resolveTranslate, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
|
315
|
+
export { type CalculateReportTotalsOptions, ColumnAlignment, ColumnGroupConfig, 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, FieldType, type FormatDateOptions, type FormatMoneyOptions, type FormatNumberOptions, type FormatTimeOptions, type ItemTaxField, type LocaleOption, type ModifierMixField, type ProductMixField, REPORT_SECTION_CONFIGS, ReportColumnKey, ReportConfig, type ReportSectionColumnDef, type ReportSectionDefinition, ReportType, type SalesByItemDetailField, type SalesSummaryField, type SupportedLocale, TENDER_TYPE, type TicketLiveField, type TicketSummaryField, type TimeFormat, buildDailySalesCashPayments, buildDailySalesRevClassFooter, calculateFieldTotal, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesLiveConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, dailySalesTrendsOrderTypeConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getDateToFormat, getNumberToFormat, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, resolveTranslate, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
salesSummaryConfig,
|
|
39
39
|
ticketLiveConfig,
|
|
40
40
|
ticketSummaryConfig
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-Y7HQPSMO.js";
|
|
42
42
|
|
|
43
43
|
// src/utils/alignment.ts
|
|
44
44
|
function getColumnAlignment(type) {
|
|
@@ -91,6 +91,7 @@ var DAILY_SALES_REV_CLASS_FOOTER_LABELS = {
|
|
|
91
91
|
balancePayments: "common.report-section.rev-class-footer.balance-payments",
|
|
92
92
|
giftCardSales: "common.report-section.rev-class-footer.gift-card-sales",
|
|
93
93
|
nonSalesRevenue: "common.report-section.rev-class-footer.non-sales-revenue",
|
|
94
|
+
houseAccount: "common.report-section.rev-class-footer.house-account",
|
|
94
95
|
totalAccountable: "common.report-section.rev-class-footer.total-accountable"
|
|
95
96
|
};
|
|
96
97
|
var DAILY_SALES_SECTIONS = [
|
|
@@ -185,12 +186,60 @@ var REPORT_SECTION_CONFIGS = {
|
|
|
185
186
|
[Report.DAILY_SALES]: DAILY_SALES_SECTIONS,
|
|
186
187
|
[Report.DAILY_SALES_LIVE]: DAILY_SALES_SECTIONS
|
|
187
188
|
};
|
|
189
|
+
|
|
190
|
+
// src/constants.ts
|
|
191
|
+
var TENDER_TYPE = {
|
|
192
|
+
CASH: "Cash",
|
|
193
|
+
CHECK: "Check",
|
|
194
|
+
CREDIT: "Credit",
|
|
195
|
+
CRYPTO: "Crypto",
|
|
196
|
+
DEBIT: "Debit",
|
|
197
|
+
GIFT_CARD: "Gift Card",
|
|
198
|
+
GIFT_CERTIFICATE: "Gift Certificate",
|
|
199
|
+
HOUSE_ACCOUNT: "House Account",
|
|
200
|
+
VIRTUAL: "Virtual",
|
|
201
|
+
MOBILE_WALLET: "Digital Wallet",
|
|
202
|
+
PROPERTY_MANAGEMENT_SYSTEM: "PMS",
|
|
203
|
+
ROOM_CHARGE: "Room Charge",
|
|
204
|
+
WALK_OUT: "Walk Out",
|
|
205
|
+
CASH_REFUNDS: "Cash Refunds",
|
|
206
|
+
UNKNOWN: "Unknown"
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// src/reports/dailySales.utils.ts
|
|
210
|
+
var buildDailySalesCashPayments = (payments, paidOutAmount, gratuitiesPaidOutAmount, tipsPaidOutAmount) => [
|
|
211
|
+
{
|
|
212
|
+
name: DAILY_SALES_CASH_ROW_LABELS.cashPayments,
|
|
213
|
+
amount: payments.filter((r) => r.paymentTypeName === TENDER_TYPE.CASH || r.paymentTypeName === TENDER_TYPE.CASH_REFUNDS).reduce((sum, r) => sum + r.paymentsAmount, 0)
|
|
214
|
+
},
|
|
215
|
+
{ name: DAILY_SALES_CASH_ROW_LABELS.paidInOuts, amount: paidOutAmount },
|
|
216
|
+
{ name: DAILY_SALES_CASH_ROW_LABELS.gratuitiesPaidOut, amount: gratuitiesPaidOutAmount },
|
|
217
|
+
{ name: DAILY_SALES_CASH_ROW_LABELS.ccTipsPaidOut, amount: tipsPaidOutAmount }
|
|
218
|
+
];
|
|
219
|
+
var buildDailySalesRevClassFooter = (inputs) => {
|
|
220
|
+
const totalAccountable = inputs.revClassNetSales + inputs.taxTotal + inputs.gratuitiesTotal + inputs.balancePaymentsTotal + inputs.giftCardSalesTotal + inputs.nonSalesTotal - inputs.houseAccountTotal;
|
|
221
|
+
return [
|
|
222
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.taxTotal, salesAmountNet: inputs.taxTotal },
|
|
223
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.gratuities, salesAmountNet: inputs.gratuitiesTotal },
|
|
224
|
+
{
|
|
225
|
+
groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.balancePayments,
|
|
226
|
+
salesAmountNet: inputs.balancePaymentsTotal
|
|
227
|
+
},
|
|
228
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.giftCardSales, salesAmountNet: inputs.giftCardSalesTotal },
|
|
229
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.nonSalesRevenue, salesAmountNet: inputs.nonSalesTotal },
|
|
230
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.houseAccount, salesAmountNet: inputs.houseAccountTotal },
|
|
231
|
+
{ groupByName: DAILY_SALES_REV_CLASS_FOOTER_LABELS.totalAccountable, salesAmountNet: totalAccountable }
|
|
232
|
+
];
|
|
233
|
+
};
|
|
188
234
|
export {
|
|
189
235
|
COLUMN_REGISTRY,
|
|
190
236
|
DAILY_SALES_CASH_ROW_LABELS,
|
|
191
237
|
DAILY_SALES_REV_CLASS_FOOTER_LABELS,
|
|
192
238
|
REPORT_SECTION_CONFIGS,
|
|
193
239
|
Report,
|
|
240
|
+
TENDER_TYPE,
|
|
241
|
+
buildDailySalesCashPayments,
|
|
242
|
+
buildDailySalesRevClassFooter,
|
|
194
243
|
calculateFieldTotal,
|
|
195
244
|
calculateReportTotals,
|
|
196
245
|
dailySalesCacheConfig,
|
|
@@ -1187,6 +1187,7 @@ declare const enUS: {
|
|
|
1187
1187
|
readonly 'common.report-section.rev-class-footer.balance-payments': "Balance Payments";
|
|
1188
1188
|
readonly 'common.report-section.rev-class-footer.gift-card-sales': "Gift Card Sales";
|
|
1189
1189
|
readonly 'common.report-section.rev-class-footer.non-sales-revenue': "Non-Sales Revenue";
|
|
1190
|
+
readonly 'common.report-section.rev-class-footer.house-account': "House Account";
|
|
1190
1191
|
readonly 'common.report-section.rev-class-footer.total-accountable': "Total Accountable";
|
|
1191
1192
|
readonly 'scheduled-reports.period': "Period";
|
|
1192
1193
|
readonly 'components.form.field.group-by': "Group By";
|
|
@@ -1187,6 +1187,7 @@ declare const enUS: {
|
|
|
1187
1187
|
readonly 'common.report-section.rev-class-footer.balance-payments': "Balance Payments";
|
|
1188
1188
|
readonly 'common.report-section.rev-class-footer.gift-card-sales': "Gift Card Sales";
|
|
1189
1189
|
readonly 'common.report-section.rev-class-footer.non-sales-revenue': "Non-Sales Revenue";
|
|
1190
|
+
readonly 'common.report-section.rev-class-footer.house-account': "House Account";
|
|
1190
1191
|
readonly 'common.report-section.rev-class-footer.total-accountable': "Total Accountable";
|
|
1191
1192
|
readonly 'scheduled-reports.period': "Period";
|
|
1192
1193
|
readonly 'components.form.field.group-by': "Group By";
|