@harbortouch/skytab-analytics-report-utils 0.23.2 → 0.24.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/{chunk-6CXSU5L4.js → chunk-SZ4VPNAX.js} +6 -9
- package/dist/exporters/exportBuilder.cjs +35 -67
- package/dist/exporters/exportBuilder.d.cts +3 -4
- package/dist/exporters/exportBuilder.d.ts +3 -4
- package/dist/exporters/exportBuilder.js +30 -59
- package/dist/index.cjs +6 -9
- package/dist/index.d.cts +4 -8
- package/dist/index.d.ts +4 -8
- package/dist/index.js +1 -1
- package/dist/{report-DklnjPk7.d.cts → report-Bx5XpFQ0.d.cts} +1 -1
- package/dist/{report-DklnjPk7.d.ts → report-Bx5XpFQ0.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -160,8 +160,7 @@ var COLUMN_GROUPS = [
|
|
|
160
160
|
lastYearFields: ["salesPerGuestLY"]
|
|
161
161
|
}
|
|
162
162
|
];
|
|
163
|
-
var
|
|
164
|
-
"groupByName",
|
|
163
|
+
var SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS = [
|
|
165
164
|
"salesAmountNet",
|
|
166
165
|
"salesVarLW",
|
|
167
166
|
"salesVarLWPct",
|
|
@@ -176,7 +175,7 @@ var SALES_SUMMARY_AVAILABLE_COLUMNS = [
|
|
|
176
175
|
"salesPerGuestLW",
|
|
177
176
|
"salesPerGuestLY"
|
|
178
177
|
];
|
|
179
|
-
var
|
|
178
|
+
var SALES_SUMMARY_AVAILABLE_COLUMNS = ["groupByName", ...SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS];
|
|
180
179
|
var salesSummaryConfig = {
|
|
181
180
|
fields: FIELDS2,
|
|
182
181
|
availableColumns: SALES_SUMMARY_AVAILABLE_COLUMNS,
|
|
@@ -692,6 +691,7 @@ var FIELDS10 = {
|
|
|
692
691
|
salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
|
|
693
692
|
};
|
|
694
693
|
var DAILY_SALES_AVAILABLE_COLUMNS = [
|
|
694
|
+
"groupByName",
|
|
695
695
|
"itemsQuantity",
|
|
696
696
|
"salesAmountGross",
|
|
697
697
|
"discountsAmount",
|
|
@@ -869,6 +869,7 @@ var FIELDS16 = {
|
|
|
869
869
|
}
|
|
870
870
|
};
|
|
871
871
|
var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
|
|
872
|
+
"groupByName",
|
|
872
873
|
"ticketsCount",
|
|
873
874
|
"guestsCount",
|
|
874
875
|
"ticketAvg",
|
|
@@ -1748,16 +1749,12 @@ var getFooterValue = (rows, field, config) => {
|
|
|
1748
1749
|
}
|
|
1749
1750
|
return 0;
|
|
1750
1751
|
};
|
|
1751
|
-
var calculateReportTotals = (data, fieldConfig
|
|
1752
|
-
const { labelField, label } = opts;
|
|
1752
|
+
var calculateReportTotals = (data, fieldConfig) => {
|
|
1753
1753
|
const result = {};
|
|
1754
1754
|
for (const [field, config] of Object.entries(fieldConfig)) {
|
|
1755
1755
|
const total = getFooterValue(data, field, config);
|
|
1756
1756
|
result[field] = total ?? "";
|
|
1757
1757
|
}
|
|
1758
|
-
if (result[labelField] === "" || result[labelField] === null) {
|
|
1759
|
-
result[labelField] = label;
|
|
1760
|
-
}
|
|
1761
1758
|
return result;
|
|
1762
1759
|
};
|
|
1763
1760
|
|
|
@@ -3020,7 +3017,7 @@ var enUS3 = {
|
|
|
3020
3017
|
"common.report-col.sales-mix-by-pct.short": "Sales Mix %",
|
|
3021
3018
|
"common.report-col.sales-mix-by-pct.info": "Percentage of total sales contributed by this item or category",
|
|
3022
3019
|
"common.report-col.sales-per-guest": "Sales/Guest",
|
|
3023
|
-
"common.report-col.sales-per-guest.short": "
|
|
3020
|
+
"common.report-col.sales-per-guest.short": "Sales/Guest",
|
|
3024
3021
|
"common.report-col.sales-per-guest.info": "Average spend per guest",
|
|
3025
3022
|
"common.report-col.sales-per-guest-lw": "Sales/Guest LW",
|
|
3026
3023
|
"common.report-col.sales-per-guest-lw.short": "Amt/Guest LW",
|
|
@@ -309,7 +309,7 @@ var enUS = {
|
|
|
309
309
|
"common.report-col.sales-mix-by-pct.short": "Sales Mix %",
|
|
310
310
|
"common.report-col.sales-mix-by-pct.info": "Percentage of total sales contributed by this item or category",
|
|
311
311
|
"common.report-col.sales-per-guest": "Sales/Guest",
|
|
312
|
-
"common.report-col.sales-per-guest.short": "
|
|
312
|
+
"common.report-col.sales-per-guest.short": "Sales/Guest",
|
|
313
313
|
"common.report-col.sales-per-guest.info": "Average spend per guest",
|
|
314
314
|
"common.report-col.sales-per-guest-lw": "Sales/Guest LW",
|
|
315
315
|
"common.report-col.sales-per-guest-lw.short": "Amt/Guest LW",
|
|
@@ -1794,8 +1794,7 @@ var COLUMN_GROUPS = [
|
|
|
1794
1794
|
lastYearFields: ["salesPerGuestLY"]
|
|
1795
1795
|
}
|
|
1796
1796
|
];
|
|
1797
|
-
var
|
|
1798
|
-
"groupByName",
|
|
1797
|
+
var SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS = [
|
|
1799
1798
|
"salesAmountNet",
|
|
1800
1799
|
"salesVarLW",
|
|
1801
1800
|
"salesVarLWPct",
|
|
@@ -1810,7 +1809,7 @@ var SALES_SUMMARY_AVAILABLE_COLUMNS = [
|
|
|
1810
1809
|
"salesPerGuestLW",
|
|
1811
1810
|
"salesPerGuestLY"
|
|
1812
1811
|
];
|
|
1813
|
-
var
|
|
1812
|
+
var SALES_SUMMARY_AVAILABLE_COLUMNS = ["groupByName", ...SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS];
|
|
1814
1813
|
var salesSummaryConfig = {
|
|
1815
1814
|
fields: FIELDS2,
|
|
1816
1815
|
availableColumns: SALES_SUMMARY_AVAILABLE_COLUMNS,
|
|
@@ -2326,6 +2325,7 @@ var FIELDS10 = {
|
|
|
2326
2325
|
salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
|
|
2327
2326
|
};
|
|
2328
2327
|
var DAILY_SALES_AVAILABLE_COLUMNS = [
|
|
2328
|
+
"groupByName",
|
|
2329
2329
|
"itemsQuantity",
|
|
2330
2330
|
"salesAmountGross",
|
|
2331
2331
|
"discountsAmount",
|
|
@@ -2503,6 +2503,7 @@ var FIELDS16 = {
|
|
|
2503
2503
|
}
|
|
2504
2504
|
};
|
|
2505
2505
|
var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
|
|
2506
|
+
"groupByName",
|
|
2506
2507
|
"ticketsCount",
|
|
2507
2508
|
"guestsCount",
|
|
2508
2509
|
"ticketAvg",
|
|
@@ -3340,16 +3341,12 @@ var getFooterValue = (rows, field, config) => {
|
|
|
3340
3341
|
}
|
|
3341
3342
|
return 0;
|
|
3342
3343
|
};
|
|
3343
|
-
var calculateReportTotals = (data, fieldConfig
|
|
3344
|
-
const { labelField, label } = opts;
|
|
3344
|
+
var calculateReportTotals = (data, fieldConfig) => {
|
|
3345
3345
|
const result = {};
|
|
3346
3346
|
for (const [field, config] of Object.entries(fieldConfig)) {
|
|
3347
3347
|
const total = getFooterValue(data, field, config);
|
|
3348
3348
|
result[field] = total ?? "";
|
|
3349
3349
|
}
|
|
3350
|
-
if (result[labelField] === "" || result[labelField] === null) {
|
|
3351
|
-
result[labelField] = label;
|
|
3352
|
-
}
|
|
3353
3350
|
return result;
|
|
3354
3351
|
};
|
|
3355
3352
|
|
|
@@ -3374,31 +3371,33 @@ var ExportBuilder = class {
|
|
|
3374
3371
|
translate(messageKey) {
|
|
3375
3372
|
return resolveTranslate(messageKey, this.locale);
|
|
3376
3373
|
}
|
|
3377
|
-
|
|
3378
|
-
const
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3374
|
+
getFixedColFromConfig(config, parameters) {
|
|
3375
|
+
const visibleColumns = new Set(config.defaultVisibleColumns ?? []);
|
|
3376
|
+
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
3377
|
+
return fixedCols.filter((col) => {
|
|
3378
|
+
if (col === "groupByName2") {
|
|
3379
|
+
return !!parameters.secondGroupBy;
|
|
3380
|
+
}
|
|
3381
|
+
return true;
|
|
3382
|
+
});
|
|
3386
3383
|
}
|
|
3387
|
-
|
|
3384
|
+
sortAndAddFixedCols(config, parameters, collected) {
|
|
3385
|
+
const fixedCols = this.getFixedColFromConfig(config, parameters);
|
|
3386
|
+
const fixedColSet = new Set(fixedCols);
|
|
3388
3387
|
const orderMap = new Map(config.availableColumns.map((col, i) => [col, i]));
|
|
3389
|
-
const sorted =
|
|
3390
|
-
return [...
|
|
3388
|
+
const sorted = collected.filter((col) => !fixedColSet.has(col)).sort((a, b) => (orderMap.get(a) ?? Infinity) - (orderMap.get(b) ?? Infinity));
|
|
3389
|
+
return [...fixedCols, ...sorted];
|
|
3391
3390
|
}
|
|
3392
3391
|
resolveColumns(config, parameters) {
|
|
3393
|
-
const
|
|
3392
|
+
const selectedColumns = Array.isArray(parameters.cols) ? parameters.cols : null;
|
|
3394
3393
|
const compareToLastWeek = parameters.compareToLastWeek === true;
|
|
3395
3394
|
const compareToLastYear = parameters.compareToLastYear === true;
|
|
3396
|
-
if (
|
|
3397
|
-
return this.
|
|
3395
|
+
if (selectedColumns !== null && selectedColumns.length === 0) {
|
|
3396
|
+
return this.sortAndAddFixedCols(config, parameters, []);
|
|
3398
3397
|
}
|
|
3399
|
-
if (
|
|
3398
|
+
if (selectedColumns?.length && config.columnGroups?.length) {
|
|
3400
3399
|
const collected = [];
|
|
3401
|
-
for (const groupId of
|
|
3400
|
+
for (const groupId of selectedColumns) {
|
|
3402
3401
|
const group = config.columnGroups.find((g) => g.id === groupId);
|
|
3403
3402
|
if (!group) {
|
|
3404
3403
|
continue;
|
|
@@ -3411,26 +3410,10 @@ var ExportBuilder = class {
|
|
|
3411
3410
|
collected.push(...group.lastYearFields);
|
|
3412
3411
|
}
|
|
3413
3412
|
}
|
|
3414
|
-
return this.
|
|
3413
|
+
return this.sortAndAddFixedCols(config, parameters, collected);
|
|
3415
3414
|
}
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
for (const col of config.defaultVisibleColumns) {
|
|
3419
|
-
collected.push(col);
|
|
3420
|
-
const group = config.columnGroups.find((g) => g.baseFields.includes(col));
|
|
3421
|
-
if (group) {
|
|
3422
|
-
if (compareToLastWeek && group.lastWeekFields) {
|
|
3423
|
-
collected.push(...group.lastWeekFields);
|
|
3424
|
-
}
|
|
3425
|
-
if (compareToLastYear && group.lastYearFields) {
|
|
3426
|
-
collected.push(...group.lastYearFields);
|
|
3427
|
-
}
|
|
3428
|
-
}
|
|
3429
|
-
}
|
|
3430
|
-
return this.sortAndPrependPrefix(config, parameters, collected);
|
|
3431
|
-
}
|
|
3432
|
-
const metricCols = selectedGroupIds?.length ? config.availableColumns.filter((c) => selectedGroupIds.includes(c)) : config.defaultVisibleColumns;
|
|
3433
|
-
return [...this.buildColumnPrefix(config, parameters), ...metricCols];
|
|
3415
|
+
const metricCols = selectedColumns?.length ? config.availableColumns.filter((c) => selectedColumns.includes(c)) : config.defaultVisibleColumns;
|
|
3416
|
+
return this.sortAndAddFixedCols(config, parameters, metricCols);
|
|
3434
3417
|
}
|
|
3435
3418
|
getColumnHeader(fieldName, config, parameters) {
|
|
3436
3419
|
if (fieldName === "groupByName" && parameters.groupBy) {
|
|
@@ -3466,24 +3449,13 @@ var ExportBuilder = class {
|
|
|
3466
3449
|
});
|
|
3467
3450
|
return formatted;
|
|
3468
3451
|
}
|
|
3469
|
-
|
|
3470
|
-
if (columns.includes("groupByName")) {
|
|
3471
|
-
return "groupByName";
|
|
3472
|
-
}
|
|
3473
|
-
const firstStringCol = columns.find((col) => {
|
|
3474
|
-
const field = config.fields[col];
|
|
3475
|
-
return field?.type === "string" && !field.footerCalculation;
|
|
3476
|
-
});
|
|
3477
|
-
return firstStringCol ?? columns[0];
|
|
3478
|
-
}
|
|
3479
|
-
buildTotalsRow(data, config, columns) {
|
|
3452
|
+
buildTotalsRow(data, config) {
|
|
3480
3453
|
if (data.length === 0) {
|
|
3481
3454
|
return null;
|
|
3482
3455
|
}
|
|
3483
|
-
|
|
3484
|
-
return calculateReportTotals(data, config.fields, { labelField, label: this.translate("table.total") });
|
|
3456
|
+
return calculateReportTotals(data, config.fields);
|
|
3485
3457
|
}
|
|
3486
|
-
getExtraFooterRows(data, config, sectionData
|
|
3458
|
+
getExtraFooterRows(data, config, sectionData) {
|
|
3487
3459
|
if (config.extraFooterRowsKey) {
|
|
3488
3460
|
if (!Array.isArray(data)) {
|
|
3489
3461
|
const rows = data[config.extraFooterRowsKey];
|
|
@@ -3493,12 +3465,8 @@ var ExportBuilder = class {
|
|
|
3493
3465
|
}
|
|
3494
3466
|
}
|
|
3495
3467
|
if (config.extraFooterFields?.length && sectionData.length > 0) {
|
|
3496
|
-
const
|
|
3497
|
-
const
|
|
3498
|
-
labelField,
|
|
3499
|
-
label: this.translate("table.total")
|
|
3500
|
-
});
|
|
3501
|
-
const row = { [labelField]: totals[labelField] };
|
|
3468
|
+
const totals = calculateReportTotals(sectionData, config.fields);
|
|
3469
|
+
const row = {};
|
|
3502
3470
|
for (const field of config.extraFooterFields) {
|
|
3503
3471
|
row[field] = totals[field];
|
|
3504
3472
|
}
|
|
@@ -3513,12 +3481,12 @@ var ExportBuilder = class {
|
|
|
3513
3481
|
const tableColumns = columns.map((col, i) => ({ header: headers[i], key: col }));
|
|
3514
3482
|
const rows = data.filter((row) => typeof row === "object" && row !== null).map((row) => this.formatRow(row, columns, columnTypes, localeConfig, row));
|
|
3515
3483
|
if (config.hasFooter) {
|
|
3516
|
-
const totalsRow = this.buildTotalsRow(data, config
|
|
3484
|
+
const totalsRow = this.buildTotalsRow(data, config);
|
|
3517
3485
|
if (totalsRow) {
|
|
3518
3486
|
rows.push(this.formatRow(totalsRow, columns, columnTypes, localeConfig, null));
|
|
3519
3487
|
}
|
|
3520
3488
|
}
|
|
3521
|
-
for (const extraRow of this.getExtraFooterRows(reportData, config, data
|
|
3489
|
+
for (const extraRow of this.getExtraFooterRows(reportData, config, data)) {
|
|
3522
3490
|
rows.push(this.formatRow(extraRow, columns, columnTypes, localeConfig, extraRow));
|
|
3523
3491
|
}
|
|
3524
3492
|
return { table: { columns: tableColumns, rows } };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ReportType, A as AnalyticsField } from '../report-
|
|
1
|
+
import { R as ReportType, A as AnalyticsField } from '../report-Bx5XpFQ0.cjs';
|
|
2
2
|
import { E as ExportTable, a as ExportFilter } from '../types-BzLsgnfc.cjs';
|
|
3
3
|
|
|
4
4
|
interface ReportDocumentSection {
|
|
@@ -36,14 +36,13 @@ declare class ExportBuilder {
|
|
|
36
36
|
private getConfig;
|
|
37
37
|
private getConfigSectionName;
|
|
38
38
|
private translate;
|
|
39
|
-
private
|
|
40
|
-
private
|
|
39
|
+
private getFixedColFromConfig;
|
|
40
|
+
private sortAndAddFixedCols;
|
|
41
41
|
private resolveColumns;
|
|
42
42
|
private getColumnHeader;
|
|
43
43
|
private resolveColumnsAndHeaders;
|
|
44
44
|
private formatField;
|
|
45
45
|
private formatRow;
|
|
46
|
-
private resolveLabelField;
|
|
47
46
|
private buildTotalsRow;
|
|
48
47
|
private getExtraFooterRows;
|
|
49
48
|
private renderTableContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ReportType, A as AnalyticsField } from '../report-
|
|
1
|
+
import { R as ReportType, A as AnalyticsField } from '../report-Bx5XpFQ0.js';
|
|
2
2
|
import { E as ExportTable, a as ExportFilter } from '../types-BzLsgnfc.js';
|
|
3
3
|
|
|
4
4
|
interface ReportDocumentSection {
|
|
@@ -36,14 +36,13 @@ declare class ExportBuilder {
|
|
|
36
36
|
private getConfig;
|
|
37
37
|
private getConfigSectionName;
|
|
38
38
|
private translate;
|
|
39
|
-
private
|
|
40
|
-
private
|
|
39
|
+
private getFixedColFromConfig;
|
|
40
|
+
private sortAndAddFixedCols;
|
|
41
41
|
private resolveColumns;
|
|
42
42
|
private getColumnHeader;
|
|
43
43
|
private resolveColumnsAndHeaders;
|
|
44
44
|
private formatField;
|
|
45
45
|
private formatRow;
|
|
46
|
-
private resolveLabelField;
|
|
47
46
|
private buildTotalsRow;
|
|
48
47
|
private getExtraFooterRows;
|
|
49
48
|
private renderTableContent;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getReportConfig,
|
|
7
7
|
getReportFormattingLocaleOptions,
|
|
8
8
|
resolveTranslate
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-SZ4VPNAX.js";
|
|
10
10
|
|
|
11
11
|
// src/exporters/exportBuilder.ts
|
|
12
12
|
import { format, isValid, parseISO } from "date-fns";
|
|
@@ -29,31 +29,33 @@ var ExportBuilder = class {
|
|
|
29
29
|
translate(messageKey) {
|
|
30
30
|
return resolveTranslate(messageKey, this.locale);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
getFixedColFromConfig(config, parameters) {
|
|
33
|
+
const visibleColumns = new Set(config.defaultVisibleColumns ?? []);
|
|
34
|
+
const fixedCols = config.availableColumns.filter((col) => !visibleColumns.has(col));
|
|
35
|
+
return fixedCols.filter((col) => {
|
|
36
|
+
if (col === "groupByName2") {
|
|
37
|
+
return !!parameters.secondGroupBy;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
});
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
sortAndAddFixedCols(config, parameters, collected) {
|
|
43
|
+
const fixedCols = this.getFixedColFromConfig(config, parameters);
|
|
44
|
+
const fixedColSet = new Set(fixedCols);
|
|
43
45
|
const orderMap = new Map(config.availableColumns.map((col, i) => [col, i]));
|
|
44
|
-
const sorted =
|
|
45
|
-
return [...
|
|
46
|
+
const sorted = collected.filter((col) => !fixedColSet.has(col)).sort((a, b) => (orderMap.get(a) ?? Infinity) - (orderMap.get(b) ?? Infinity));
|
|
47
|
+
return [...fixedCols, ...sorted];
|
|
46
48
|
}
|
|
47
49
|
resolveColumns(config, parameters) {
|
|
48
|
-
const
|
|
50
|
+
const selectedColumns = Array.isArray(parameters.cols) ? parameters.cols : null;
|
|
49
51
|
const compareToLastWeek = parameters.compareToLastWeek === true;
|
|
50
52
|
const compareToLastYear = parameters.compareToLastYear === true;
|
|
51
|
-
if (
|
|
52
|
-
return this.
|
|
53
|
+
if (selectedColumns !== null && selectedColumns.length === 0) {
|
|
54
|
+
return this.sortAndAddFixedCols(config, parameters, []);
|
|
53
55
|
}
|
|
54
|
-
if (
|
|
56
|
+
if (selectedColumns?.length && config.columnGroups?.length) {
|
|
55
57
|
const collected = [];
|
|
56
|
-
for (const groupId of
|
|
58
|
+
for (const groupId of selectedColumns) {
|
|
57
59
|
const group = config.columnGroups.find((g) => g.id === groupId);
|
|
58
60
|
if (!group) {
|
|
59
61
|
continue;
|
|
@@ -66,26 +68,10 @@ var ExportBuilder = class {
|
|
|
66
68
|
collected.push(...group.lastYearFields);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
return this.
|
|
71
|
+
return this.sortAndAddFixedCols(config, parameters, collected);
|
|
70
72
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (const col of config.defaultVisibleColumns) {
|
|
74
|
-
collected.push(col);
|
|
75
|
-
const group = config.columnGroups.find((g) => g.baseFields.includes(col));
|
|
76
|
-
if (group) {
|
|
77
|
-
if (compareToLastWeek && group.lastWeekFields) {
|
|
78
|
-
collected.push(...group.lastWeekFields);
|
|
79
|
-
}
|
|
80
|
-
if (compareToLastYear && group.lastYearFields) {
|
|
81
|
-
collected.push(...group.lastYearFields);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return this.sortAndPrependPrefix(config, parameters, collected);
|
|
86
|
-
}
|
|
87
|
-
const metricCols = selectedGroupIds?.length ? config.availableColumns.filter((c) => selectedGroupIds.includes(c)) : config.defaultVisibleColumns;
|
|
88
|
-
return [...this.buildColumnPrefix(config, parameters), ...metricCols];
|
|
73
|
+
const metricCols = selectedColumns?.length ? config.availableColumns.filter((c) => selectedColumns.includes(c)) : config.defaultVisibleColumns;
|
|
74
|
+
return this.sortAndAddFixedCols(config, parameters, metricCols);
|
|
89
75
|
}
|
|
90
76
|
getColumnHeader(fieldName, config, parameters) {
|
|
91
77
|
if (fieldName === "groupByName" && parameters.groupBy) {
|
|
@@ -121,24 +107,13 @@ var ExportBuilder = class {
|
|
|
121
107
|
});
|
|
122
108
|
return formatted;
|
|
123
109
|
}
|
|
124
|
-
|
|
125
|
-
if (columns.includes("groupByName")) {
|
|
126
|
-
return "groupByName";
|
|
127
|
-
}
|
|
128
|
-
const firstStringCol = columns.find((col) => {
|
|
129
|
-
const field = config.fields[col];
|
|
130
|
-
return field?.type === "string" && !field.footerCalculation;
|
|
131
|
-
});
|
|
132
|
-
return firstStringCol ?? columns[0];
|
|
133
|
-
}
|
|
134
|
-
buildTotalsRow(data, config, columns) {
|
|
110
|
+
buildTotalsRow(data, config) {
|
|
135
111
|
if (data.length === 0) {
|
|
136
112
|
return null;
|
|
137
113
|
}
|
|
138
|
-
|
|
139
|
-
return calculateReportTotals(data, config.fields, { labelField, label: this.translate("table.total") });
|
|
114
|
+
return calculateReportTotals(data, config.fields);
|
|
140
115
|
}
|
|
141
|
-
getExtraFooterRows(data, config, sectionData
|
|
116
|
+
getExtraFooterRows(data, config, sectionData) {
|
|
142
117
|
if (config.extraFooterRowsKey) {
|
|
143
118
|
if (!Array.isArray(data)) {
|
|
144
119
|
const rows = data[config.extraFooterRowsKey];
|
|
@@ -148,12 +123,8 @@ var ExportBuilder = class {
|
|
|
148
123
|
}
|
|
149
124
|
}
|
|
150
125
|
if (config.extraFooterFields?.length && sectionData.length > 0) {
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
labelField,
|
|
154
|
-
label: this.translate("table.total")
|
|
155
|
-
});
|
|
156
|
-
const row = { [labelField]: totals[labelField] };
|
|
126
|
+
const totals = calculateReportTotals(sectionData, config.fields);
|
|
127
|
+
const row = {};
|
|
157
128
|
for (const field of config.extraFooterFields) {
|
|
158
129
|
row[field] = totals[field];
|
|
159
130
|
}
|
|
@@ -168,12 +139,12 @@ var ExportBuilder = class {
|
|
|
168
139
|
const tableColumns = columns.map((col, i) => ({ header: headers[i], key: col }));
|
|
169
140
|
const rows = data.filter((row) => typeof row === "object" && row !== null).map((row) => this.formatRow(row, columns, columnTypes, localeConfig, row));
|
|
170
141
|
if (config.hasFooter) {
|
|
171
|
-
const totalsRow = this.buildTotalsRow(data, config
|
|
142
|
+
const totalsRow = this.buildTotalsRow(data, config);
|
|
172
143
|
if (totalsRow) {
|
|
173
144
|
rows.push(this.formatRow(totalsRow, columns, columnTypes, localeConfig, null));
|
|
174
145
|
}
|
|
175
146
|
}
|
|
176
|
-
for (const extraRow of this.getExtraFooterRows(reportData, config, data
|
|
147
|
+
for (const extraRow of this.getExtraFooterRows(reportData, config, data)) {
|
|
177
148
|
rows.push(this.formatRow(extraRow, columns, columnTypes, localeConfig, extraRow));
|
|
178
149
|
}
|
|
179
150
|
return { table: { columns: tableColumns, rows } };
|
package/dist/index.cjs
CHANGED
|
@@ -232,8 +232,7 @@ var COLUMN_GROUPS = [
|
|
|
232
232
|
lastYearFields: ["salesPerGuestLY"]
|
|
233
233
|
}
|
|
234
234
|
];
|
|
235
|
-
var
|
|
236
|
-
"groupByName",
|
|
235
|
+
var SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS = [
|
|
237
236
|
"salesAmountNet",
|
|
238
237
|
"salesVarLW",
|
|
239
238
|
"salesVarLWPct",
|
|
@@ -248,7 +247,7 @@ var SALES_SUMMARY_AVAILABLE_COLUMNS = [
|
|
|
248
247
|
"salesPerGuestLW",
|
|
249
248
|
"salesPerGuestLY"
|
|
250
249
|
];
|
|
251
|
-
var
|
|
250
|
+
var SALES_SUMMARY_AVAILABLE_COLUMNS = ["groupByName", ...SALES_SUMMARY_DEFAULT_VISIBLE_COLUMNS];
|
|
252
251
|
var salesSummaryConfig = {
|
|
253
252
|
fields: FIELDS2,
|
|
254
253
|
availableColumns: SALES_SUMMARY_AVAILABLE_COLUMNS,
|
|
@@ -764,6 +763,7 @@ var FIELDS10 = {
|
|
|
764
763
|
salesMixPct: { type: "percent", columnKey: "salesMixByPct" }
|
|
765
764
|
};
|
|
766
765
|
var DAILY_SALES_AVAILABLE_COLUMNS = [
|
|
766
|
+
"groupByName",
|
|
767
767
|
"itemsQuantity",
|
|
768
768
|
"salesAmountGross",
|
|
769
769
|
"discountsAmount",
|
|
@@ -941,6 +941,7 @@ var FIELDS16 = {
|
|
|
941
941
|
}
|
|
942
942
|
};
|
|
943
943
|
var DAILY_SALES_TRENDS_AVAILABLE_COLUMNS = [
|
|
944
|
+
"groupByName",
|
|
944
945
|
"ticketsCount",
|
|
945
946
|
"guestsCount",
|
|
946
947
|
"ticketAvg",
|
|
@@ -1831,16 +1832,12 @@ var getFooterValue = (rows, field, config) => {
|
|
|
1831
1832
|
}
|
|
1832
1833
|
return 0;
|
|
1833
1834
|
};
|
|
1834
|
-
var calculateReportTotals = (data, fieldConfig
|
|
1835
|
-
const { labelField, label } = opts;
|
|
1835
|
+
var calculateReportTotals = (data, fieldConfig) => {
|
|
1836
1836
|
const result = {};
|
|
1837
1837
|
for (const [field, config] of Object.entries(fieldConfig)) {
|
|
1838
1838
|
const total = getFooterValue(data, field, config);
|
|
1839
1839
|
result[field] = total ?? "";
|
|
1840
1840
|
}
|
|
1841
|
-
if (result[labelField] === "" || result[labelField] === null) {
|
|
1842
|
-
result[labelField] = label;
|
|
1843
|
-
}
|
|
1844
1841
|
return result;
|
|
1845
1842
|
};
|
|
1846
1843
|
|
|
@@ -3260,7 +3257,7 @@ var enUS3 = {
|
|
|
3260
3257
|
"common.report-col.sales-mix-by-pct.short": "Sales Mix %",
|
|
3261
3258
|
"common.report-col.sales-mix-by-pct.info": "Percentage of total sales contributed by this item or category",
|
|
3262
3259
|
"common.report-col.sales-per-guest": "Sales/Guest",
|
|
3263
|
-
"common.report-col.sales-per-guest.short": "
|
|
3260
|
+
"common.report-col.sales-per-guest.short": "Sales/Guest",
|
|
3264
3261
|
"common.report-col.sales-per-guest.info": "Average spend per guest",
|
|
3265
3262
|
"common.report-col.sales-per-guest-lw": "Sales/Guest LW",
|
|
3266
3263
|
"common.report-col.sales-per-guest-lw.short": "Amt/Guest LW",
|
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-Bx5XpFQ0.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-Bx5XpFQ0.cjs';
|
|
3
3
|
import { LocaleCode } from '@harbortouch/locale-registry';
|
|
4
4
|
|
|
5
5
|
type SupportedLocale = LocaleCode;
|
|
@@ -8,12 +8,8 @@ declare function resolveTranslate(key: MessageKey, locale: string): string;
|
|
|
8
8
|
declare function getColumnAlignment(type?: FieldType): ColumnAlignment;
|
|
9
9
|
declare function isNumericType(type?: FieldType): boolean;
|
|
10
10
|
|
|
11
|
-
interface CalculateReportTotalsOptions {
|
|
12
|
-
labelField: string;
|
|
13
|
-
label: string;
|
|
14
|
-
}
|
|
15
11
|
declare const getFooterValue: <T>(rows: T[], field: keyof T, config: ColumnPresentationConfig) => number | "common.report-col.fifteen-min-interval" | "common.report-col.fifteen-min-interval.short" | "common.report-col.fifteen-min-interval.info" | "common.report-col.adjusted-tips" | "common.report-col.adjusted-tips.short" | "common.report-col.adjusted-tips.info" | "common.report-col.advantage-program" | "common.report-col.advantage-program.short" | "common.report-col.advantage-program.info" | "common.report-col.amex" | "common.report-col.amex.short" | "common.report-col.amex.info" | "common.report-col.amex-returns" | "common.report-col.amex-returns.short" | "common.report-col.amex-returns.info" | "common.report-col.attach-rate" | "common.report-col.attach-rate.short" | "common.report-col.attach-rate.info" | "common.report-col.auto-gratuity" | "common.report-col.auto-gratuity.short" | "common.report-col.auto-gratuity.info" | "common.report-col.average-gross-price" | "common.report-col.average-gross-price.short" | "common.report-col.average-gross-price.info" | "common.report-col.bank-fees" | "common.report-col.bank-fees.short" | "common.report-col.bank-fees.info" | "common.report-col.batch-amount" | "common.report-col.batch-amount.short" | "common.report-col.batch-amount.info" | "common.report-col.batch-date" | "common.report-col.batch-date.short" | "common.report-col.batch-date.info" | "common.report-col.batch-number" | "common.report-col.batch-number.short" | "common.report-col.batch-number.info" | "common.report-col.clock-in-time" | "common.report-col.clock-in-time.short" | "common.report-col.clock-in-time.info" | "common.report-col.clock-out-time" | "common.report-col.clock-out-time.short" | "common.report-col.clock-out-time.info" | "common.report-col.status" | "common.report-col.status.short" | "common.report-col.status.info" | "common.report-col.last-modified" | "common.report-col.last-modified.short" | "common.report-col.last-modified.info" | "common.report-col.country" | "common.report-col.country.short" | "common.report-col.country.info" | "common.report-col.customer-name" | "common.report-col.customer-name.short" | "common.report-col.customer-name.info" | "common.report-col.date" | "common.report-col.date.short" | "common.report-col.date.info" | "common.report-col.date-close" | "common.report-col.date-close.short" | "common.report-col.date-close.info" | "common.report-col.daypart" | "common.report-col.daypart.short" | "common.report-col.daypart.info" | "common.report-col.debit" | "common.report-col.debit.short" | "common.report-col.debit.info" | "common.report-col.debit-returns" | "common.report-col.debit-returns.short" | "common.report-col.debit-returns.info" | "common.report-col.declared-tips" | "common.report-col.declared-tips.short" | "common.report-col.declared-tips.info" | "common.report-col.department" | "common.report-col.department.short" | "common.report-col.department.info" | "common.report-col.deposit-currency" | "common.report-col.deposit-currency.short" | "common.report-col.deposit-currency.info" | "common.report-col.deposit-date" | "common.report-col.deposit-date.short" | "common.report-col.deposit-date.info" | "common.report-col.discount-amount" | "common.report-col.discount-amount.short" | "common.report-col.discount-amount.info" | "common.report-col.discount-count" | "common.report-col.discount-count.short" | "common.report-col.discount-count.info" | "common.report-col.ticket-count" | "common.report-col.ticket-count.short" | "common.report-col.ticket-count.info" | "common.report-col.item-count" | "common.report-col.item-count.short" | "common.report-col.item-count.info" | "common.report-col.discover" | "common.report-col.discover.short" | "common.report-col.discover.info" | "common.report-col.discover-returns" | "common.report-col.discover-returns.short" | "common.report-col.discover-returns.info" | "common.report-col.ebt" | "common.report-col.ebt.short" | "common.report-col.ebt.info" | "common.report-col.ebt-returns" | "common.report-col.ebt-returns.short" | "common.report-col.ebt-returns.info" | "common.report-col.employee-id" | "common.report-col.employee-id.short" | "common.report-col.employee-id.info" | "common.report-col.employee-job" | "common.report-col.employee-job.short" | "common.report-col.employee-job.info" | "common.report-col.employee-name" | "common.report-col.employee-name.short" | "common.report-col.employee-name.info" | "common.report-col.exempt-taxes" | "common.report-col.exempt-taxes.short" | "common.report-col.exempt-taxes.info" | "common.report-col.exempt-sales" | "common.report-col.exempt-sales.short" | "common.report-col.exempt-sales.info" | "common.report-col.grand-total" | "common.report-col.grand-total.short" | "common.report-col.grand-total.info" | "common.report-col.gross-cash-sales" | "common.report-col.gross-cash-sales.short" | "common.report-col.gross-cash-sales.info" | "common.report-col.gross-credit-sales" | "common.report-col.gross-credit-sales.short" | "common.report-col.gross-credit-sales.info" | "common.report-col.gross-sales" | "common.report-col.gross-sales.short" | "common.report-col.gross-sales.info" | "common.report-col.gross-tips" | "common.report-col.gross-tips.short" | "common.report-col.gross-tips.info" | "common.report-col.guest-count" | "common.report-col.guest-count.short" | "common.report-col.guest-count.info" | "common.report-col.guests-var-lw" | "common.report-col.guests-var-lw.short" | "common.report-col.guests-var-lw.info" | "common.report-col.guests-var-lw-pct" | "common.report-col.guests-var-lw-pct.short" | "common.report-col.guests-var-lw-pct.info" | "common.report-col.guests-var-ly" | "common.report-col.guests-var-ly.short" | "common.report-col.guests-var-ly.info" | "common.report-col.guests-var-ly-pct" | "common.report-col.guests-var-ly-pct.short" | "common.report-col.guests-var-ly-pct.info" | "common.report-col.hour" | "common.report-col.hour.short" | "common.report-col.hour.info" | "common.report-col.hours-worked" | "common.report-col.hours-worked.short" | "common.report-col.hours-worked.info" | "common.report-col.inclusive-tax" | "common.report-col.inclusive-tax.short" | "common.report-col.inclusive-tax.info" | "common.report-col.item-name" | "common.report-col.item-name.short" | "common.report-col.item-name.info" | "common.report-col.item-price" | "common.report-col.item-price.short" | "common.report-col.item-price.info" | "common.report-col.location-city" | "common.report-col.location-city.short" | "common.report-col.location-city.info" | "common.report-col.location-id" | "common.report-col.location-id.short" | "common.report-col.location-id.info" | "common.report-col.location-mid" | "common.report-col.location-mid.short" | "common.report-col.location-mid.info" | "common.report-col.location-name" | "common.report-col.location-name.short" | "common.report-col.location-name.info" | "common.report-col.location-state" | "common.report-col.location-state.short" | "common.report-col.location-state.info" | "common.report-col.mastercard" | "common.report-col.mastercard.short" | "common.report-col.mastercard.info" | "common.report-col.mc-returns" | "common.report-col.mc-returns.short" | "common.report-col.mc-returns.info" | "common.report-col.modifier-name" | "common.report-col.modifier-name.short" | "common.report-col.modifier-name.info" | "common.report-col.modifier-price" | "common.report-col.modifier-price.short" | "common.report-col.modifier-price.info" | "common.report-col.modifier-quantity" | "common.report-col.modifier-quantity.short" | "common.report-col.modifier-quantity.info" | "common.report-col.item-quantity" | "common.report-col.item-quantity.short" | "common.report-col.item-quantity.info" | "common.report-col.modifier-quantity-comp" | "common.report-col.modifier-quantity-comp.short" | "common.report-col.modifier-quantity-comp.info" | "common.report-col.item-quantity-comp" | "common.report-col.item-quantity-comp.short" | "common.report-col.item-quantity-comp.info" | "common.report-col.attach-rate-comp" | "common.report-col.attach-rate-comp.short" | "common.report-col.attach-rate-comp.info" | "common.report-col.total-modifier-sales-var" | "common.report-col.total-modifier-sales-var.short" | "common.report-col.total-modifier-sales-var.info" | "common.report-col.total-modifier-sales-var-pct" | "common.report-col.total-modifier-sales-var-pct.short" | "common.report-col.total-modifier-sales-var-pct.info" | "common.report-col.modifier-quantity-var" | "common.report-col.modifier-quantity-var.short" | "common.report-col.modifier-quantity-var.info" | "common.report-col.modifier-quantity-var-pct" | "common.report-col.modifier-quantity-var-pct.short" | "common.report-col.modifier-quantity-var-pct.info" | "common.report-col.attach-rate-var" | "common.report-col.attach-rate-var.short" | "common.report-col.attach-rate-var.info" | "common.report-col.attach-rate-var-pct" | "common.report-col.attach-rate-var-pct.short" | "common.report-col.attach-rate-var-pct.info" | "common.report-col.total-modifier-sales-comp" | "common.report-col.total-modifier-sales-comp.short" | "common.report-col.total-modifier-sales-comp.info" | "common.report-col.net-sales" | "common.report-col.net-sales.short" | "common.report-col.net-sales.info" | "common.report-col.net-tax-collected" | "common.report-col.net-tax-collected.short" | "common.report-col.net-tax-collected.info" | "common.report-col.net-tips" | "common.report-col.net-tips.short" | "common.report-col.net-tips.info" | "common.report-col.number-of-guests" | "common.report-col.number-of-guests.short" | "common.report-col.number-of-guests.info" | "common.report-col.order-type" | "common.report-col.order-type.short" | "common.report-col.order-type.info" | "common.report-col.payment-type" | "common.report-col.payment-type.short" | "common.report-col.payment-type.info" | "common.report-col.payroll-id" | "common.report-col.payroll-id.short" | "common.report-col.payroll-id.info" | "common.report-col.quantity" | "common.report-col.quantity.short" | "common.report-col.quantity.info" | "common.report-col.reference-number" | "common.report-col.reference-number.short" | "common.report-col.reference-number.info" | "common.report-col.refund-amount" | "common.report-col.refund-amount.short" | "common.report-col.refund-amount.info" | "common.report-col.refunded-tax-amount" | "common.report-col.refunded-tax-amount.short" | "common.report-col.refunded-tax-amount.info" | "common.report-col.revenue-center" | "common.report-col.revenue-center.short" | "common.report-col.revenue-center.info" | "common.report-col.revenue-class" | "common.report-col.revenue-class.short" | "common.report-col.revenue-class.info" | "common.report-col.sales-var-lw" | "common.report-col.sales-var-lw.short" | "common.report-col.sales-var-lw.info" | "common.report-col.sales-var-lw-pct" | "common.report-col.sales-var-lw-pct.short" | "common.report-col.sales-var-lw-pct.info" | "common.report-col.sales-var-ly" | "common.report-col.sales-var-ly.short" | "common.report-col.sales-var-ly.info" | "common.report-col.sales-var-ly-pct" | "common.report-col.sales-var-ly-pct.short" | "common.report-col.sales-var-ly-pct.info" | "common.report-col.sales-mix-by-pct" | "common.report-col.sales-mix-by-pct.short" | "common.report-col.sales-mix-by-pct.info" | "common.report-col.sales-per-guest" | "common.report-col.sales-per-guest.short" | "common.report-col.sales-per-guest.info" | "common.report-col.sales-per-guest-lw" | "common.report-col.sales-per-guest-lw.short" | "common.report-col.sales-per-guest-lw.info" | "common.report-col.sales-per-guest-ly" | "common.report-col.sales-per-guest-ly.short" | "common.report-col.sales-per-guest-ly.info" | "common.report-col.scheduled-shift-end" | "common.report-col.scheduled-shift-end.short" | "common.report-col.scheduled-shift-end.info" | "common.report-col.scheduled-shift-start" | "common.report-col.scheduled-shift-start.short" | "common.report-col.scheduled-shift-start.info" | "common.report-col.settlement-batch-date" | "common.report-col.settlement-batch-date.short" | "common.report-col.settlement-batch-date.info" | "common.report-col.shift-duration-hrs" | "common.report-col.shift-duration-hrs.short" | "common.report-col.shift-duration-hrs.info" | "common.report-col.subtotal" | "common.report-col.subtotal.short" | "common.report-col.subtotal.info" | "common.report-col.tax-collected" | "common.report-col.tax-collected.short" | "common.report-col.tax-collected.info" | "common.report-col.tax-name" | "common.report-col.tax-name.short" | "common.report-col.tax-name.info" | "common.report-col.tax-rate" | "common.report-col.tax-rate.short" | "common.report-col.tax-rate.info" | "common.report-col.taxable-sales" | "common.report-col.taxable-sales.short" | "common.report-col.taxable-sales.info" | "common.report-col.ticket-closed" | "common.report-col.ticket-closed.short" | "common.report-col.ticket-closed.info" | "common.report-col.ticket-fee" | "common.report-col.ticket-fee.short" | "common.report-col.ticket-fee.info" | "common.report-col.ticket-number" | "common.report-col.ticket-number.short" | "common.report-col.ticket-number.info" | "common.report-col.ticket-open" | "common.report-col.ticket-open.short" | "common.report-col.ticket-open.info" | "common.report-col.ticket-total" | "common.report-col.ticket-total.short" | "common.report-col.ticket-total.info" | "common.report-col.time-open-mins" | "common.report-col.time-open-mins.short" | "common.report-col.time-open-mins.info" | "common.report-col.tip-pct" | "common.report-col.tip-pct.short" | "common.report-col.tip-pct.info" | "common.report-col.tip-reduction" | "common.report-col.tip-reduction.short" | "common.report-col.tip-reduction.info" | "common.report-col.tip-share" | "common.report-col.tip-share.short" | "common.report-col.tip-share.info" | "common.report-col.tips" | "common.report-col.tips.short" | "common.report-col.tips.info" | "common.report-col.tips-per-hour" | "common.report-col.tips-per-hour.short" | "common.report-col.tips-per-hour.info" | "common.report-col.total-collected" | "common.report-col.total-collected.short" | "common.report-col.total-collected.info" | "common.report-col.total-item-sales" | "common.report-col.total-item-sales.short" | "common.report-col.total-item-sales.info" | "common.report-col.total-modifier-sales" | "common.report-col.total-modifier-sales.short" | "common.report-col.total-modifier-sales.info" | "common.report-col.total-returns" | "common.report-col.total-returns.short" | "common.report-col.total-returns.info" | "common.report-col.total-sales" | "common.report-col.total-sales.short" | "common.report-col.total-sales.info" | "common.report-col.total-tips" | "common.report-col.total-tips.short" | "common.report-col.total-tips.info" | "common.report-col.transaction-date" | "common.report-col.transaction-date.short" | "common.report-col.transaction-date.info" | "common.report-col.sale-payment-type" | "common.report-col.sale-payment-type.short" | "common.report-col.sale-payment-type.info" | "common.report-col.transaction-type" | "common.report-col.transaction-type.short" | "common.report-col.transaction-type.info" | "common.report-col.untaxed-sales" | "common.report-col.untaxed-sales.short" | "common.report-col.untaxed-sales.info" | "common.report-col.visa" | "common.report-col.visa.short" | "common.report-col.visa.info" | "common.report-col.visa-returns" | "common.report-col.visa-returns.short" | "common.report-col.visa-returns.info" | "common.report-col.payments-count" | "common.report-col.payments-count.short" | "common.report-col.payments-count.info" | "common.report-col.payments-amount" | "common.report-col.payments-amount.short" | "common.report-col.payments-amount.info" | "common.report-col.payments-total" | "common.report-col.payments-total.short" | "common.report-col.payments-total.info" | "common.report-col.refund-void-description" | "common.report-col.refund-void-description.short" | "common.report-col.refund-void-description.info" | "common.report-col.refund-void-count" | "common.report-col.refund-void-count.short" | "common.report-col.refund-void-count.info" | "common.report-col.refund-void-amount" | "common.report-col.refund-void-amount.short" | "common.report-col.refund-void-amount.info" | "common.report-col.refund-void-pct-sales" | "common.report-col.refund-void-pct-sales.short" | "common.report-col.refund-void-pct-sales.info" | "common.report-col.discount-name" | "common.report-col.discount-name.short" | "common.report-col.discount-name.info" | "common.report-col.tickets" | "common.report-col.tickets.short" | "common.report-col.tickets.info" | "common.report-col.guests" | "common.report-col.guests.short" | "common.report-col.guests.info" | "common.report-col.ticket-average" | "common.report-col.ticket-average.short" | "common.report-col.ticket-average.info" | "common.report-col.guest-average" | "common.report-col.guest-average.short" | "common.report-col.guest-average.info" | "common.report-col.net" | "common.report-col.net.short" | "common.report-col.net.info" | "common.report-col.gross-cash-tips" | "common.report-col.gross-cash-tips.short" | "common.report-col.gross-cash-tips.info" | "common.report-col.gross-credit-card-tips" | "common.report-col.gross-credit-card-tips.short" | "common.report-col.gross-credit-card-tips.info" | "common.report-col.type" | "common.report-col.type.short" | "common.report-col.type.info" | "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" | "common.report-section.cash-row.cash-payments" | "common.report-section.cash-row.paid-in-outs" | "common.report-section.cash-row.gratuities-paid-out" | "common.report-section.cash-row.cc-tips-paid-out" | "common.report-section.trends-footer.total-sales" | "common.report-section.rev-class-footer.tax-total" | "common.report-section.rev-class-footer.gratuities" | "common.report-section.rev-class-footer.balance-payments" | "common.report-section.rev-class-footer.gift-card-sales" | "common.report-section.rev-class-footer.non-sales-revenue" | "common.report-section.rev-class-footer.house-account" | "common.report-section.rev-class-footer.total-accountable" | "scheduled-reports.period" | "components.form.field.group-by" | "components.form.field.last-week" | "components.form.field.last-year" | "common.labels.locations" | "common.labels.yes" | "analytics.field.location_id" | "analytics.field.order_type_id" | "analytics.field.revenue_center_id" | "analytics.field.revenue_center_id.all" | "analytics.field.hour_id" | "analytics.field.daypart_id" | "analytics.field.timeslot_id" | "analytics.field.employee_id" | "analytics.field.payroll_id" | "analytics.field.intraday_period_group" | "analytics.field.item_id" | "analytics.field.department_id" | "analytics.field.revenue_class_id" | "analytics.field.modifier_id" | "table.total" | "table.groups.sales" | "table.groups.net-sales" | "table.groups.guests" | "table.groups.sales-per-guest" | null;
|
|
16
|
-
declare const calculateReportTotals: <T>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig
|
|
12
|
+
declare const calculateReportTotals: <T>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig>) => T;
|
|
17
13
|
|
|
18
14
|
type SalesSummaryField = 'groupById' | 'groupByName' | 'salesAmountNet' | 'salesVarLW' | 'salesVarLY' | 'salesVarLWPct' | 'salesVarLYPct' | 'salesAmountNetLastWeek' | 'salesAmountNetLastYear' | 'salesAmountGross' | 'salesAmountGrossLastWeek' | 'salesAmountGrossLastYear' | 'ticketsCount' | 'ticketsCountLastWeek' | 'ticketsCountLastYear' | 'guestsCount' | 'guestsVarLW' | 'guestsVarLY' | 'guestsVarLWPct' | 'guestsVarLYPct' | 'guestsCountLastWeek' | 'guestsCountLastYear' | 'salesPerGuestTY' | 'salesPerGuestLW' | 'salesPerGuestLY';
|
|
19
15
|
declare const salesSummaryConfig: {
|
|
@@ -306,4 +302,4 @@ declare const getReportFormattingLocaleOptions: (locations: {
|
|
|
306
302
|
}[]) => LocaleOption[];
|
|
307
303
|
declare const formatFieldValue: (value: unknown, type: FieldType, localeOptions: LocaleOption, fullRecord: Record<string, unknown> | null | undefined, fieldConfig?: ColumnPresentationConfig) => string;
|
|
308
304
|
|
|
309
|
-
export {
|
|
305
|
+
export { ColumnAlignment, ColumnGroupConfig, ColumnPresentationConfig, DAILY_SALES_CASH_ROW_LABELS, DAILY_SALES_REV_CLASS_FOOTER_LABELS, type DailySalesCacheField, type DailySalesDiscountsField, type DailySalesField, 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, buildPaymentsSectionData, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, dailySalesTrendsOrderTypeConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getDateToFormat, getFooterValue, 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-Bx5XpFQ0.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-Bx5XpFQ0.js';
|
|
3
3
|
import { LocaleCode } from '@harbortouch/locale-registry';
|
|
4
4
|
|
|
5
5
|
type SupportedLocale = LocaleCode;
|
|
@@ -8,12 +8,8 @@ declare function resolveTranslate(key: MessageKey, locale: string): string;
|
|
|
8
8
|
declare function getColumnAlignment(type?: FieldType): ColumnAlignment;
|
|
9
9
|
declare function isNumericType(type?: FieldType): boolean;
|
|
10
10
|
|
|
11
|
-
interface CalculateReportTotalsOptions {
|
|
12
|
-
labelField: string;
|
|
13
|
-
label: string;
|
|
14
|
-
}
|
|
15
11
|
declare const getFooterValue: <T>(rows: T[], field: keyof T, config: ColumnPresentationConfig) => number | "common.report-col.fifteen-min-interval" | "common.report-col.fifteen-min-interval.short" | "common.report-col.fifteen-min-interval.info" | "common.report-col.adjusted-tips" | "common.report-col.adjusted-tips.short" | "common.report-col.adjusted-tips.info" | "common.report-col.advantage-program" | "common.report-col.advantage-program.short" | "common.report-col.advantage-program.info" | "common.report-col.amex" | "common.report-col.amex.short" | "common.report-col.amex.info" | "common.report-col.amex-returns" | "common.report-col.amex-returns.short" | "common.report-col.amex-returns.info" | "common.report-col.attach-rate" | "common.report-col.attach-rate.short" | "common.report-col.attach-rate.info" | "common.report-col.auto-gratuity" | "common.report-col.auto-gratuity.short" | "common.report-col.auto-gratuity.info" | "common.report-col.average-gross-price" | "common.report-col.average-gross-price.short" | "common.report-col.average-gross-price.info" | "common.report-col.bank-fees" | "common.report-col.bank-fees.short" | "common.report-col.bank-fees.info" | "common.report-col.batch-amount" | "common.report-col.batch-amount.short" | "common.report-col.batch-amount.info" | "common.report-col.batch-date" | "common.report-col.batch-date.short" | "common.report-col.batch-date.info" | "common.report-col.batch-number" | "common.report-col.batch-number.short" | "common.report-col.batch-number.info" | "common.report-col.clock-in-time" | "common.report-col.clock-in-time.short" | "common.report-col.clock-in-time.info" | "common.report-col.clock-out-time" | "common.report-col.clock-out-time.short" | "common.report-col.clock-out-time.info" | "common.report-col.status" | "common.report-col.status.short" | "common.report-col.status.info" | "common.report-col.last-modified" | "common.report-col.last-modified.short" | "common.report-col.last-modified.info" | "common.report-col.country" | "common.report-col.country.short" | "common.report-col.country.info" | "common.report-col.customer-name" | "common.report-col.customer-name.short" | "common.report-col.customer-name.info" | "common.report-col.date" | "common.report-col.date.short" | "common.report-col.date.info" | "common.report-col.date-close" | "common.report-col.date-close.short" | "common.report-col.date-close.info" | "common.report-col.daypart" | "common.report-col.daypart.short" | "common.report-col.daypart.info" | "common.report-col.debit" | "common.report-col.debit.short" | "common.report-col.debit.info" | "common.report-col.debit-returns" | "common.report-col.debit-returns.short" | "common.report-col.debit-returns.info" | "common.report-col.declared-tips" | "common.report-col.declared-tips.short" | "common.report-col.declared-tips.info" | "common.report-col.department" | "common.report-col.department.short" | "common.report-col.department.info" | "common.report-col.deposit-currency" | "common.report-col.deposit-currency.short" | "common.report-col.deposit-currency.info" | "common.report-col.deposit-date" | "common.report-col.deposit-date.short" | "common.report-col.deposit-date.info" | "common.report-col.discount-amount" | "common.report-col.discount-amount.short" | "common.report-col.discount-amount.info" | "common.report-col.discount-count" | "common.report-col.discount-count.short" | "common.report-col.discount-count.info" | "common.report-col.ticket-count" | "common.report-col.ticket-count.short" | "common.report-col.ticket-count.info" | "common.report-col.item-count" | "common.report-col.item-count.short" | "common.report-col.item-count.info" | "common.report-col.discover" | "common.report-col.discover.short" | "common.report-col.discover.info" | "common.report-col.discover-returns" | "common.report-col.discover-returns.short" | "common.report-col.discover-returns.info" | "common.report-col.ebt" | "common.report-col.ebt.short" | "common.report-col.ebt.info" | "common.report-col.ebt-returns" | "common.report-col.ebt-returns.short" | "common.report-col.ebt-returns.info" | "common.report-col.employee-id" | "common.report-col.employee-id.short" | "common.report-col.employee-id.info" | "common.report-col.employee-job" | "common.report-col.employee-job.short" | "common.report-col.employee-job.info" | "common.report-col.employee-name" | "common.report-col.employee-name.short" | "common.report-col.employee-name.info" | "common.report-col.exempt-taxes" | "common.report-col.exempt-taxes.short" | "common.report-col.exempt-taxes.info" | "common.report-col.exempt-sales" | "common.report-col.exempt-sales.short" | "common.report-col.exempt-sales.info" | "common.report-col.grand-total" | "common.report-col.grand-total.short" | "common.report-col.grand-total.info" | "common.report-col.gross-cash-sales" | "common.report-col.gross-cash-sales.short" | "common.report-col.gross-cash-sales.info" | "common.report-col.gross-credit-sales" | "common.report-col.gross-credit-sales.short" | "common.report-col.gross-credit-sales.info" | "common.report-col.gross-sales" | "common.report-col.gross-sales.short" | "common.report-col.gross-sales.info" | "common.report-col.gross-tips" | "common.report-col.gross-tips.short" | "common.report-col.gross-tips.info" | "common.report-col.guest-count" | "common.report-col.guest-count.short" | "common.report-col.guest-count.info" | "common.report-col.guests-var-lw" | "common.report-col.guests-var-lw.short" | "common.report-col.guests-var-lw.info" | "common.report-col.guests-var-lw-pct" | "common.report-col.guests-var-lw-pct.short" | "common.report-col.guests-var-lw-pct.info" | "common.report-col.guests-var-ly" | "common.report-col.guests-var-ly.short" | "common.report-col.guests-var-ly.info" | "common.report-col.guests-var-ly-pct" | "common.report-col.guests-var-ly-pct.short" | "common.report-col.guests-var-ly-pct.info" | "common.report-col.hour" | "common.report-col.hour.short" | "common.report-col.hour.info" | "common.report-col.hours-worked" | "common.report-col.hours-worked.short" | "common.report-col.hours-worked.info" | "common.report-col.inclusive-tax" | "common.report-col.inclusive-tax.short" | "common.report-col.inclusive-tax.info" | "common.report-col.item-name" | "common.report-col.item-name.short" | "common.report-col.item-name.info" | "common.report-col.item-price" | "common.report-col.item-price.short" | "common.report-col.item-price.info" | "common.report-col.location-city" | "common.report-col.location-city.short" | "common.report-col.location-city.info" | "common.report-col.location-id" | "common.report-col.location-id.short" | "common.report-col.location-id.info" | "common.report-col.location-mid" | "common.report-col.location-mid.short" | "common.report-col.location-mid.info" | "common.report-col.location-name" | "common.report-col.location-name.short" | "common.report-col.location-name.info" | "common.report-col.location-state" | "common.report-col.location-state.short" | "common.report-col.location-state.info" | "common.report-col.mastercard" | "common.report-col.mastercard.short" | "common.report-col.mastercard.info" | "common.report-col.mc-returns" | "common.report-col.mc-returns.short" | "common.report-col.mc-returns.info" | "common.report-col.modifier-name" | "common.report-col.modifier-name.short" | "common.report-col.modifier-name.info" | "common.report-col.modifier-price" | "common.report-col.modifier-price.short" | "common.report-col.modifier-price.info" | "common.report-col.modifier-quantity" | "common.report-col.modifier-quantity.short" | "common.report-col.modifier-quantity.info" | "common.report-col.item-quantity" | "common.report-col.item-quantity.short" | "common.report-col.item-quantity.info" | "common.report-col.modifier-quantity-comp" | "common.report-col.modifier-quantity-comp.short" | "common.report-col.modifier-quantity-comp.info" | "common.report-col.item-quantity-comp" | "common.report-col.item-quantity-comp.short" | "common.report-col.item-quantity-comp.info" | "common.report-col.attach-rate-comp" | "common.report-col.attach-rate-comp.short" | "common.report-col.attach-rate-comp.info" | "common.report-col.total-modifier-sales-var" | "common.report-col.total-modifier-sales-var.short" | "common.report-col.total-modifier-sales-var.info" | "common.report-col.total-modifier-sales-var-pct" | "common.report-col.total-modifier-sales-var-pct.short" | "common.report-col.total-modifier-sales-var-pct.info" | "common.report-col.modifier-quantity-var" | "common.report-col.modifier-quantity-var.short" | "common.report-col.modifier-quantity-var.info" | "common.report-col.modifier-quantity-var-pct" | "common.report-col.modifier-quantity-var-pct.short" | "common.report-col.modifier-quantity-var-pct.info" | "common.report-col.attach-rate-var" | "common.report-col.attach-rate-var.short" | "common.report-col.attach-rate-var.info" | "common.report-col.attach-rate-var-pct" | "common.report-col.attach-rate-var-pct.short" | "common.report-col.attach-rate-var-pct.info" | "common.report-col.total-modifier-sales-comp" | "common.report-col.total-modifier-sales-comp.short" | "common.report-col.total-modifier-sales-comp.info" | "common.report-col.net-sales" | "common.report-col.net-sales.short" | "common.report-col.net-sales.info" | "common.report-col.net-tax-collected" | "common.report-col.net-tax-collected.short" | "common.report-col.net-tax-collected.info" | "common.report-col.net-tips" | "common.report-col.net-tips.short" | "common.report-col.net-tips.info" | "common.report-col.number-of-guests" | "common.report-col.number-of-guests.short" | "common.report-col.number-of-guests.info" | "common.report-col.order-type" | "common.report-col.order-type.short" | "common.report-col.order-type.info" | "common.report-col.payment-type" | "common.report-col.payment-type.short" | "common.report-col.payment-type.info" | "common.report-col.payroll-id" | "common.report-col.payroll-id.short" | "common.report-col.payroll-id.info" | "common.report-col.quantity" | "common.report-col.quantity.short" | "common.report-col.quantity.info" | "common.report-col.reference-number" | "common.report-col.reference-number.short" | "common.report-col.reference-number.info" | "common.report-col.refund-amount" | "common.report-col.refund-amount.short" | "common.report-col.refund-amount.info" | "common.report-col.refunded-tax-amount" | "common.report-col.refunded-tax-amount.short" | "common.report-col.refunded-tax-amount.info" | "common.report-col.revenue-center" | "common.report-col.revenue-center.short" | "common.report-col.revenue-center.info" | "common.report-col.revenue-class" | "common.report-col.revenue-class.short" | "common.report-col.revenue-class.info" | "common.report-col.sales-var-lw" | "common.report-col.sales-var-lw.short" | "common.report-col.sales-var-lw.info" | "common.report-col.sales-var-lw-pct" | "common.report-col.sales-var-lw-pct.short" | "common.report-col.sales-var-lw-pct.info" | "common.report-col.sales-var-ly" | "common.report-col.sales-var-ly.short" | "common.report-col.sales-var-ly.info" | "common.report-col.sales-var-ly-pct" | "common.report-col.sales-var-ly-pct.short" | "common.report-col.sales-var-ly-pct.info" | "common.report-col.sales-mix-by-pct" | "common.report-col.sales-mix-by-pct.short" | "common.report-col.sales-mix-by-pct.info" | "common.report-col.sales-per-guest" | "common.report-col.sales-per-guest.short" | "common.report-col.sales-per-guest.info" | "common.report-col.sales-per-guest-lw" | "common.report-col.sales-per-guest-lw.short" | "common.report-col.sales-per-guest-lw.info" | "common.report-col.sales-per-guest-ly" | "common.report-col.sales-per-guest-ly.short" | "common.report-col.sales-per-guest-ly.info" | "common.report-col.scheduled-shift-end" | "common.report-col.scheduled-shift-end.short" | "common.report-col.scheduled-shift-end.info" | "common.report-col.scheduled-shift-start" | "common.report-col.scheduled-shift-start.short" | "common.report-col.scheduled-shift-start.info" | "common.report-col.settlement-batch-date" | "common.report-col.settlement-batch-date.short" | "common.report-col.settlement-batch-date.info" | "common.report-col.shift-duration-hrs" | "common.report-col.shift-duration-hrs.short" | "common.report-col.shift-duration-hrs.info" | "common.report-col.subtotal" | "common.report-col.subtotal.short" | "common.report-col.subtotal.info" | "common.report-col.tax-collected" | "common.report-col.tax-collected.short" | "common.report-col.tax-collected.info" | "common.report-col.tax-name" | "common.report-col.tax-name.short" | "common.report-col.tax-name.info" | "common.report-col.tax-rate" | "common.report-col.tax-rate.short" | "common.report-col.tax-rate.info" | "common.report-col.taxable-sales" | "common.report-col.taxable-sales.short" | "common.report-col.taxable-sales.info" | "common.report-col.ticket-closed" | "common.report-col.ticket-closed.short" | "common.report-col.ticket-closed.info" | "common.report-col.ticket-fee" | "common.report-col.ticket-fee.short" | "common.report-col.ticket-fee.info" | "common.report-col.ticket-number" | "common.report-col.ticket-number.short" | "common.report-col.ticket-number.info" | "common.report-col.ticket-open" | "common.report-col.ticket-open.short" | "common.report-col.ticket-open.info" | "common.report-col.ticket-total" | "common.report-col.ticket-total.short" | "common.report-col.ticket-total.info" | "common.report-col.time-open-mins" | "common.report-col.time-open-mins.short" | "common.report-col.time-open-mins.info" | "common.report-col.tip-pct" | "common.report-col.tip-pct.short" | "common.report-col.tip-pct.info" | "common.report-col.tip-reduction" | "common.report-col.tip-reduction.short" | "common.report-col.tip-reduction.info" | "common.report-col.tip-share" | "common.report-col.tip-share.short" | "common.report-col.tip-share.info" | "common.report-col.tips" | "common.report-col.tips.short" | "common.report-col.tips.info" | "common.report-col.tips-per-hour" | "common.report-col.tips-per-hour.short" | "common.report-col.tips-per-hour.info" | "common.report-col.total-collected" | "common.report-col.total-collected.short" | "common.report-col.total-collected.info" | "common.report-col.total-item-sales" | "common.report-col.total-item-sales.short" | "common.report-col.total-item-sales.info" | "common.report-col.total-modifier-sales" | "common.report-col.total-modifier-sales.short" | "common.report-col.total-modifier-sales.info" | "common.report-col.total-returns" | "common.report-col.total-returns.short" | "common.report-col.total-returns.info" | "common.report-col.total-sales" | "common.report-col.total-sales.short" | "common.report-col.total-sales.info" | "common.report-col.total-tips" | "common.report-col.total-tips.short" | "common.report-col.total-tips.info" | "common.report-col.transaction-date" | "common.report-col.transaction-date.short" | "common.report-col.transaction-date.info" | "common.report-col.sale-payment-type" | "common.report-col.sale-payment-type.short" | "common.report-col.sale-payment-type.info" | "common.report-col.transaction-type" | "common.report-col.transaction-type.short" | "common.report-col.transaction-type.info" | "common.report-col.untaxed-sales" | "common.report-col.untaxed-sales.short" | "common.report-col.untaxed-sales.info" | "common.report-col.visa" | "common.report-col.visa.short" | "common.report-col.visa.info" | "common.report-col.visa-returns" | "common.report-col.visa-returns.short" | "common.report-col.visa-returns.info" | "common.report-col.payments-count" | "common.report-col.payments-count.short" | "common.report-col.payments-count.info" | "common.report-col.payments-amount" | "common.report-col.payments-amount.short" | "common.report-col.payments-amount.info" | "common.report-col.payments-total" | "common.report-col.payments-total.short" | "common.report-col.payments-total.info" | "common.report-col.refund-void-description" | "common.report-col.refund-void-description.short" | "common.report-col.refund-void-description.info" | "common.report-col.refund-void-count" | "common.report-col.refund-void-count.short" | "common.report-col.refund-void-count.info" | "common.report-col.refund-void-amount" | "common.report-col.refund-void-amount.short" | "common.report-col.refund-void-amount.info" | "common.report-col.refund-void-pct-sales" | "common.report-col.refund-void-pct-sales.short" | "common.report-col.refund-void-pct-sales.info" | "common.report-col.discount-name" | "common.report-col.discount-name.short" | "common.report-col.discount-name.info" | "common.report-col.tickets" | "common.report-col.tickets.short" | "common.report-col.tickets.info" | "common.report-col.guests" | "common.report-col.guests.short" | "common.report-col.guests.info" | "common.report-col.ticket-average" | "common.report-col.ticket-average.short" | "common.report-col.ticket-average.info" | "common.report-col.guest-average" | "common.report-col.guest-average.short" | "common.report-col.guest-average.info" | "common.report-col.net" | "common.report-col.net.short" | "common.report-col.net.info" | "common.report-col.gross-cash-tips" | "common.report-col.gross-cash-tips.short" | "common.report-col.gross-cash-tips.info" | "common.report-col.gross-credit-card-tips" | "common.report-col.gross-credit-card-tips.short" | "common.report-col.gross-credit-card-tips.info" | "common.report-col.type" | "common.report-col.type.short" | "common.report-col.type.info" | "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" | "common.report-section.cash-row.cash-payments" | "common.report-section.cash-row.paid-in-outs" | "common.report-section.cash-row.gratuities-paid-out" | "common.report-section.cash-row.cc-tips-paid-out" | "common.report-section.trends-footer.total-sales" | "common.report-section.rev-class-footer.tax-total" | "common.report-section.rev-class-footer.gratuities" | "common.report-section.rev-class-footer.balance-payments" | "common.report-section.rev-class-footer.gift-card-sales" | "common.report-section.rev-class-footer.non-sales-revenue" | "common.report-section.rev-class-footer.house-account" | "common.report-section.rev-class-footer.total-accountable" | "scheduled-reports.period" | "components.form.field.group-by" | "components.form.field.last-week" | "components.form.field.last-year" | "common.labels.locations" | "common.labels.yes" | "analytics.field.location_id" | "analytics.field.order_type_id" | "analytics.field.revenue_center_id" | "analytics.field.revenue_center_id.all" | "analytics.field.hour_id" | "analytics.field.daypart_id" | "analytics.field.timeslot_id" | "analytics.field.employee_id" | "analytics.field.payroll_id" | "analytics.field.intraday_period_group" | "analytics.field.item_id" | "analytics.field.department_id" | "analytics.field.revenue_class_id" | "analytics.field.modifier_id" | "table.total" | "table.groups.sales" | "table.groups.net-sales" | "table.groups.guests" | "table.groups.sales-per-guest" | null;
|
|
16
|
-
declare const calculateReportTotals: <T>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig
|
|
12
|
+
declare const calculateReportTotals: <T>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig>) => T;
|
|
17
13
|
|
|
18
14
|
type SalesSummaryField = 'groupById' | 'groupByName' | 'salesAmountNet' | 'salesVarLW' | 'salesVarLY' | 'salesVarLWPct' | 'salesVarLYPct' | 'salesAmountNetLastWeek' | 'salesAmountNetLastYear' | 'salesAmountGross' | 'salesAmountGrossLastWeek' | 'salesAmountGrossLastYear' | 'ticketsCount' | 'ticketsCountLastWeek' | 'ticketsCountLastYear' | 'guestsCount' | 'guestsVarLW' | 'guestsVarLY' | 'guestsVarLWPct' | 'guestsVarLYPct' | 'guestsCountLastWeek' | 'guestsCountLastYear' | 'salesPerGuestTY' | 'salesPerGuestLW' | 'salesPerGuestLY';
|
|
19
15
|
declare const salesSummaryConfig: {
|
|
@@ -306,4 +302,4 @@ declare const getReportFormattingLocaleOptions: (locations: {
|
|
|
306
302
|
}[]) => LocaleOption[];
|
|
307
303
|
declare const formatFieldValue: (value: unknown, type: FieldType, localeOptions: LocaleOption, fullRecord: Record<string, unknown> | null | undefined, fieldConfig?: ColumnPresentationConfig) => string;
|
|
308
304
|
|
|
309
|
-
export {
|
|
305
|
+
export { ColumnAlignment, ColumnGroupConfig, ColumnPresentationConfig, DAILY_SALES_CASH_ROW_LABELS, DAILY_SALES_REV_CLASS_FOOTER_LABELS, type DailySalesCacheField, type DailySalesDiscountsField, type DailySalesField, 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, buildPaymentsSectionData, calculateReportTotals, dailySalesCacheConfig, dailySalesConfig, dailySalesDiscountsConfig, dailySalesPaymentsConfig, dailySalesRefundsVoidsConfig, dailySalesTaxesConfig, dailySalesTrendsConfig, dailySalesTrendsOrderTypeConfig, employeeTimecardConfig, employeeTipConfig, formatDate, formatFieldValue, formatFixedNumber, formatInteger, formatMoney, formatMoneyWithoutSymbol, formatPercent, formatString, formatTime, getColumnAlignment, getDateToFormat, getFooterValue, getNumberToFormat, getReportFormattingLocaleOptions, isNumericType, itemTaxConfig, modifierMixConfig, productMixConfig, resolveTranslate, salesByItemDetailConfig, salesSummaryConfig, ticketLiveConfig, ticketSummaryConfig };
|
package/dist/index.js
CHANGED
|
@@ -1017,7 +1017,7 @@ declare const enUS: {
|
|
|
1017
1017
|
readonly 'common.report-col.sales-mix-by-pct.short': "Sales Mix %";
|
|
1018
1018
|
readonly 'common.report-col.sales-mix-by-pct.info': "Percentage of total sales contributed by this item or category";
|
|
1019
1019
|
readonly 'common.report-col.sales-per-guest': "Sales/Guest";
|
|
1020
|
-
readonly 'common.report-col.sales-per-guest.short': "
|
|
1020
|
+
readonly 'common.report-col.sales-per-guest.short': "Sales/Guest";
|
|
1021
1021
|
readonly 'common.report-col.sales-per-guest.info': "Average spend per guest";
|
|
1022
1022
|
readonly 'common.report-col.sales-per-guest-lw': "Sales/Guest LW";
|
|
1023
1023
|
readonly 'common.report-col.sales-per-guest-lw.short': "Amt/Guest LW";
|
|
@@ -1017,7 +1017,7 @@ declare const enUS: {
|
|
|
1017
1017
|
readonly 'common.report-col.sales-mix-by-pct.short': "Sales Mix %";
|
|
1018
1018
|
readonly 'common.report-col.sales-mix-by-pct.info': "Percentage of total sales contributed by this item or category";
|
|
1019
1019
|
readonly 'common.report-col.sales-per-guest': "Sales/Guest";
|
|
1020
|
-
readonly 'common.report-col.sales-per-guest.short': "
|
|
1020
|
+
readonly 'common.report-col.sales-per-guest.short': "Sales/Guest";
|
|
1021
1021
|
readonly 'common.report-col.sales-per-guest.info': "Average spend per guest";
|
|
1022
1022
|
readonly 'common.report-col.sales-per-guest-lw': "Sales/Guest LW";
|
|
1023
1023
|
readonly 'common.report-col.sales-per-guest-lw.short': "Amt/Guest LW";
|