@harbortouch/skytab-analytics-report-utils 0.39.0 → 0.41.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-HRMMRGR7.js → chunk-7GHXVTY6.js} +10 -0
- package/dist/exporters/excel/index.d.cts +2 -2
- package/dist/exporters/excel/index.d.ts +2 -2
- package/dist/exporters/exportBuilder.cjs +55 -24
- package/dist/exporters/exportBuilder.d.cts +5 -5
- package/dist/exporters/exportBuilder.d.ts +5 -5
- package/dist/exporters/exportBuilder.js +46 -25
- package/dist/exporters/pdf/fonts/Lato-Bold.ttf +0 -0
- package/dist/exporters/pdf/fonts/Lato-Regular.ttf +0 -0
- package/dist/exporters/pdf/index.cjs +164 -70
- package/dist/exporters/pdf/index.d.cts +7 -5
- package/dist/exporters/pdf/index.d.ts +7 -5
- package/dist/exporters/pdf/index.js +158 -70
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{report-CDeQvFgd.d.cts → report-EBViO5sS.d.cts} +5 -1
- package/dist/{report-CDeQvFgd.d.ts → report-EBViO5sS.d.ts} +5 -1
- package/dist/{types-BPT5hjCR.d.ts → types-MalWTEdo.d.cts} +10 -1
- package/dist/{types-BPT5hjCR.d.cts → types-MalWTEdo.d.ts} +10 -1
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/exporters/pdf/index.ts
|
|
2
2
|
import PDFDocument from "pdfkit";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
3
5
|
|
|
4
6
|
// src/exporters/pdf/pdf.utils.ts
|
|
5
7
|
var sanitizePdfText = (text) => {
|
|
@@ -10,38 +12,75 @@ var sanitizePdfText = (text) => {
|
|
|
10
12
|
return leadingSpaces + text.trimStart().replace(/€/g, "EUR ").replace(
|
|
11
13
|
/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F900}-\u{1F9FF}]|[\u{1FA00}-\u{1FA6F}]|[\u{1FA70}-\u{1FAFF}]|[\u{FE00}-\u{FE0F}]|[\u{1F004}]|[\u{1F0CF}]|[\u{1F18E}]|[\u{1F191}-\u{1F19A}]|[\u{1F1E6}-\u{1F1FF}]|[\u{1F201}-\u{1F251}]/gu,
|
|
12
14
|
""
|
|
13
|
-
).replace(/[\x00-\x1F\x7F]/g, " ").replace(/[
|
|
15
|
+
).replace(/[\x00-\x1F\x7F-\x9F]/g, " ").replace(/ /g, " ").replace(/[^\x20-\x7E\xA1-\xFF]/g, "").replace(/\s+/g, " ").trim();
|
|
14
16
|
};
|
|
15
17
|
|
|
18
|
+
// src/exporters/pdf/constants.ts
|
|
19
|
+
var ZOOM_FACTOR = 1.44;
|
|
20
|
+
var FONT_REGULAR = "Lato";
|
|
21
|
+
var FONT_BOLD = "Lato-Bold";
|
|
22
|
+
var DEFAULT_TEXT_COLOR = "#000000";
|
|
23
|
+
var HEADER_BACKGROUND_COLOR = "#f9fafb";
|
|
24
|
+
var ZEBRA_BACKGROUND_COLOR = "#fafbfc";
|
|
25
|
+
var SEPARATOR_COLOR = "#E4E5E5";
|
|
26
|
+
var SECTION_TITLE_FONT_SIZE = 1.17 * 6 * ZOOM_FACTOR;
|
|
27
|
+
var DEFAULT_FONT_SIZE = 5 * ZOOM_FACTOR;
|
|
28
|
+
var BODY_FONT_SIZE = 6 * ZOOM_FACTOR;
|
|
29
|
+
var TABLE_CELL_PADDING = 4;
|
|
30
|
+
var DEFAULT_ROW_HEIGHT = 25;
|
|
31
|
+
var MIN_COLUMN_WIDTH = 35;
|
|
32
|
+
var MARGINS = { top: 30, bottom: 30, left: 30, right: 30 };
|
|
33
|
+
var PAGE_SIZE = "LETTER";
|
|
34
|
+
var PAGE_LAYOUT = "landscape";
|
|
35
|
+
var SECTION_GAP = 18;
|
|
36
|
+
var MIN_SECTION_HEIGHT = 75;
|
|
37
|
+
var HEADER_RULE_COLOR = "#000000";
|
|
38
|
+
var HEADER_RULE_WIDTH = 1.5;
|
|
39
|
+
var HEADER_SPACING_FACTOR = 0.7;
|
|
40
|
+
|
|
16
41
|
// src/exporters/pdf/index.ts
|
|
17
|
-
var
|
|
18
|
-
var FONT_REGULAR = "Helvetica";
|
|
19
|
-
var COLOR_BLACK = "#000000";
|
|
20
|
-
var COLOR_HEADER_BACKGROUND = "#D3D3D3";
|
|
21
|
-
var COLOR_ROW_BACKGROUND_ALTERNATE = "#F5F5F5";
|
|
42
|
+
var FONTS_DIR = fileURLToPath(new URL("./fonts", import.meta.url));
|
|
22
43
|
var PdfExporter = class {
|
|
44
|
+
registerFonts(doc) {
|
|
45
|
+
doc.registerFont(FONT_REGULAR, join(FONTS_DIR, "Lato-Regular.ttf"));
|
|
46
|
+
doc.registerFont(FONT_BOLD, join(FONTS_DIR, "Lato-Bold.ttf"));
|
|
47
|
+
}
|
|
23
48
|
generate(content) {
|
|
24
|
-
const doc = new PDFDocument({
|
|
49
|
+
const doc = new PDFDocument({
|
|
50
|
+
margin: MARGINS.top,
|
|
51
|
+
size: PAGE_SIZE,
|
|
52
|
+
layout: PAGE_LAYOUT
|
|
53
|
+
});
|
|
54
|
+
this.registerFonts(doc);
|
|
25
55
|
const buffers = [];
|
|
26
56
|
return new Promise((resolve, reject) => {
|
|
27
57
|
doc.on("data", (chunk) => buffers.push(chunk));
|
|
28
58
|
doc.on("end", () => resolve(Buffer.concat(buffers)));
|
|
29
59
|
doc.on("error", reject);
|
|
30
60
|
try {
|
|
61
|
+
const pageBottom = doc.page.height - doc.page.margins.bottom;
|
|
62
|
+
let currentY = doc.page.margins.top;
|
|
31
63
|
content.sections.forEach((section, index) => {
|
|
32
|
-
const
|
|
64
|
+
const sanitized = this.sanitizeSections(section);
|
|
33
65
|
if (index > 0) {
|
|
34
|
-
|
|
66
|
+
if (currentY + SECTION_GAP + MIN_SECTION_HEIGHT > pageBottom) {
|
|
67
|
+
doc.addPage();
|
|
68
|
+
currentY = doc.page.margins.top;
|
|
69
|
+
} else {
|
|
70
|
+
currentY += SECTION_GAP;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (sanitized.filters && sanitized.filters.length > 0) {
|
|
74
|
+
currentY = this.drawFilters(doc, sanitized.filters, currentY);
|
|
35
75
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
currentY = this.drawSectionTitle(doc, sanitizedSections.title);
|
|
76
|
+
if (sanitized.appliedFilters !== void 0) {
|
|
77
|
+
currentY = this.drawAppliedFilters(doc, sanitized.appliedFilters, currentY);
|
|
39
78
|
}
|
|
40
|
-
if (
|
|
41
|
-
currentY = this.
|
|
79
|
+
if (sanitized.title && sanitized.table) {
|
|
80
|
+
currentY = this.drawSectionTitle(doc, sanitized.title, currentY);
|
|
42
81
|
}
|
|
43
|
-
if (
|
|
44
|
-
this.drawTable(doc,
|
|
82
|
+
if (sanitized.table) {
|
|
83
|
+
currentY = this.drawTable(doc, sanitized.table, currentY);
|
|
45
84
|
}
|
|
46
85
|
});
|
|
47
86
|
doc.end();
|
|
@@ -50,21 +89,27 @@ var PdfExporter = class {
|
|
|
50
89
|
}
|
|
51
90
|
});
|
|
52
91
|
}
|
|
53
|
-
sanitizeSections(
|
|
54
|
-
const sanitized = { title: sanitizePdfText(
|
|
55
|
-
if (
|
|
56
|
-
sanitized.filters =
|
|
92
|
+
sanitizeSections(section) {
|
|
93
|
+
const sanitized = { title: sanitizePdfText(section.title) };
|
|
94
|
+
if (section.filters) {
|
|
95
|
+
sanitized.filters = section.filters.map((filter) => ({
|
|
96
|
+
label: sanitizePdfText(filter.label),
|
|
97
|
+
value: sanitizePdfText(filter.value)
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
if (section.appliedFilters !== void 0) {
|
|
101
|
+
sanitized.appliedFilters = section.appliedFilters.map((filter) => ({
|
|
57
102
|
label: sanitizePdfText(filter.label),
|
|
58
103
|
value: sanitizePdfText(filter.value)
|
|
59
104
|
}));
|
|
60
105
|
}
|
|
61
|
-
if (
|
|
106
|
+
if (section.table) {
|
|
62
107
|
sanitized.table = {
|
|
63
|
-
columns:
|
|
108
|
+
columns: section.table.columns.map((col) => ({
|
|
64
109
|
...col,
|
|
65
110
|
header: sanitizePdfText(col.header)
|
|
66
111
|
})),
|
|
67
|
-
rows:
|
|
112
|
+
rows: section.table.rows.map((row) => {
|
|
68
113
|
const sanitizedRow = {};
|
|
69
114
|
for (const [key, value] of Object.entries(row)) {
|
|
70
115
|
sanitizedRow[key] = typeof value === "string" ? sanitizePdfText(value) : value;
|
|
@@ -75,26 +120,45 @@ var PdfExporter = class {
|
|
|
75
120
|
}
|
|
76
121
|
return sanitized;
|
|
77
122
|
}
|
|
78
|
-
drawSectionTitle(doc, title) {
|
|
79
|
-
doc.
|
|
80
|
-
doc.
|
|
81
|
-
|
|
123
|
+
drawSectionTitle(doc, title, startY) {
|
|
124
|
+
const left = doc.page.margins.left;
|
|
125
|
+
const usableWidth = doc.page.width - doc.page.margins.left - doc.page.margins.right;
|
|
126
|
+
doc.fillColor(DEFAULT_TEXT_COLOR).font(FONT_REGULAR).fontSize(SECTION_TITLE_FONT_SIZE).text(title, left, startY, { align: "left", width: usableWidth });
|
|
127
|
+
const spacing = SECTION_TITLE_FONT_SIZE * HEADER_SPACING_FACTOR;
|
|
128
|
+
const ruleY = doc.y + spacing;
|
|
129
|
+
doc.strokeColor(HEADER_RULE_COLOR).lineWidth(HEADER_RULE_WIDTH).moveTo(left, ruleY).lineTo(left + usableWidth, ruleY).stroke();
|
|
130
|
+
return ruleY + spacing;
|
|
82
131
|
}
|
|
83
|
-
drawFilters(doc, filters) {
|
|
84
|
-
doc.
|
|
85
|
-
doc.
|
|
86
|
-
filters.forEach((filter) => {
|
|
87
|
-
|
|
132
|
+
drawFilters(doc, filters, startY) {
|
|
133
|
+
const left = doc.page.margins.left;
|
|
134
|
+
doc.fillColor(DEFAULT_TEXT_COLOR).font(FONT_BOLD).fontSize(BODY_FONT_SIZE);
|
|
135
|
+
filters.forEach((filter, i) => {
|
|
136
|
+
if (i === 0) {
|
|
137
|
+
doc.text(filter.label, left, startY, { continued: true });
|
|
138
|
+
} else {
|
|
139
|
+
doc.font(FONT_BOLD).fontSize(BODY_FONT_SIZE).text(filter.label, { continued: true });
|
|
140
|
+
}
|
|
88
141
|
doc.font(FONT_REGULAR).text(`: ${filter.value}`);
|
|
89
142
|
});
|
|
143
|
+
doc.moveDown(0.5);
|
|
144
|
+
return doc.y;
|
|
145
|
+
}
|
|
146
|
+
drawAppliedFilters(doc, filters, startY) {
|
|
147
|
+
doc.fillColor(DEFAULT_TEXT_COLOR).font(FONT_BOLD).fontSize(BODY_FONT_SIZE).text("Applied Filters:", doc.page.margins.left, startY, { continued: filters.length === 0 });
|
|
148
|
+
if (filters.length === 0) {
|
|
149
|
+
doc.font(FONT_REGULAR).text(" None");
|
|
150
|
+
} else {
|
|
151
|
+
filters.forEach((filter) => {
|
|
152
|
+
doc.font(FONT_BOLD).fontSize(BODY_FONT_SIZE).text(filter.label, { continued: true });
|
|
153
|
+
doc.font(FONT_REGULAR).text(`: ${filter.value}`);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
90
156
|
doc.moveDown(1);
|
|
91
157
|
return doc.y;
|
|
92
158
|
}
|
|
93
|
-
drawTable(doc, table, startY
|
|
159
|
+
drawTable(doc, table, startY) {
|
|
94
160
|
const columns = table.columns.length > 0 ? table.columns.map((c) => ({ ...c })) : [{ header: "No data", key: "no_data", width: 100 }];
|
|
95
161
|
const rows = table.rows ?? [];
|
|
96
|
-
const baseCellPadding = 4;
|
|
97
|
-
const minColumnWidth = 35;
|
|
98
162
|
const columnCount = columns.length;
|
|
99
163
|
const headerFontSize = columnCount > 13 ? 8 : columnCount > 10 ? 9 : columnCount > 7 ? 10 : 11;
|
|
100
164
|
const dataFontSize = columnCount > 13 ? 7 : columnCount > 10 ? 8 : columnCount > 7 ? 9 : 10;
|
|
@@ -115,19 +179,26 @@ var PdfExporter = class {
|
|
|
115
179
|
}
|
|
116
180
|
});
|
|
117
181
|
const contentWidth = Math.max(headerTextWidth, maxDataWidth);
|
|
118
|
-
col.width = Math.max(contentWidth +
|
|
119
|
-
headerMinWidths.set(col, headerMinWidth +
|
|
182
|
+
col.width = Math.max(contentWidth + TABLE_CELL_PADDING * 2 + headerWidthSlack, MIN_COLUMN_WIDTH);
|
|
183
|
+
headerMinWidths.set(col, headerMinWidth + TABLE_CELL_PADDING * 2 + headerWidthSlack);
|
|
120
184
|
});
|
|
121
185
|
const usableWidth = doc.page.width - doc.page.margins.left - doc.page.margins.right;
|
|
122
|
-
const totalColumnWidth = columns.reduce((sum, c) => sum + (c.width ??
|
|
186
|
+
const totalColumnWidth = columns.reduce((sum, c) => sum + (c.width ?? MIN_COLUMN_WIDTH), 0);
|
|
123
187
|
if (totalColumnWidth > usableWidth) {
|
|
124
188
|
const scale = usableWidth / totalColumnWidth;
|
|
125
189
|
columns.forEach((c) => {
|
|
126
|
-
const headerMin = headerMinWidths.get(c) ??
|
|
127
|
-
c.width = Math.max(Math.floor((c.width ??
|
|
190
|
+
const headerMin = headerMinWidths.get(c) ?? MIN_COLUMN_WIDTH;
|
|
191
|
+
c.width = Math.max(Math.floor((c.width ?? MIN_COLUMN_WIDTH) * scale), headerMin, MIN_COLUMN_WIDTH);
|
|
192
|
+
});
|
|
193
|
+
} else if (totalColumnWidth < usableWidth) {
|
|
194
|
+
const scale = usableWidth / totalColumnWidth;
|
|
195
|
+
columns.forEach((c) => {
|
|
196
|
+
c.width = Math.floor((c.width ?? MIN_COLUMN_WIDTH) * scale);
|
|
128
197
|
});
|
|
198
|
+
const expanded = columns.reduce((sum, c) => sum + (c.width ?? 0), 0);
|
|
199
|
+
columns[columns.length - 1].width = (columns[columns.length - 1].width ?? 0) + (usableWidth - expanded);
|
|
129
200
|
}
|
|
130
|
-
const tableWidth = columns.reduce((sum, c) => sum + (c.width ??
|
|
201
|
+
const tableWidth = columns.reduce((sum, c) => sum + (c.width ?? MIN_COLUMN_WIDTH), 0);
|
|
131
202
|
const pageBottom = doc.page.height - doc.page.margins.bottom;
|
|
132
203
|
const calculateRowHeight = (row, isHeader = false) => {
|
|
133
204
|
const fontSize = isHeader ? headerFontSize : dataFontSize;
|
|
@@ -136,17 +207,22 @@ var PdfExporter = class {
|
|
|
136
207
|
columns.forEach((col) => {
|
|
137
208
|
const cellValue = isHeader ? col.header : row?.[col.key] !== void 0 ? String(row[col.key]) : "";
|
|
138
209
|
const textWidth = doc.widthOfString(cellValue);
|
|
139
|
-
const availableWidth = (col.width ??
|
|
210
|
+
const availableWidth = (col.width ?? MIN_COLUMN_WIDTH) - TABLE_CELL_PADDING * 2;
|
|
140
211
|
const lines = Math.ceil(textWidth / availableWidth);
|
|
141
212
|
if (lines > maxLines) {
|
|
142
213
|
maxLines = lines;
|
|
143
214
|
}
|
|
144
215
|
});
|
|
145
|
-
return Math.max(maxLines * (fontSize + 2) +
|
|
216
|
+
return Math.max(maxLines * (fontSize + 2) + TABLE_CELL_PADDING * 2, DEFAULT_ROW_HEIGHT);
|
|
146
217
|
};
|
|
147
218
|
const headerHeight = calculateRowHeight(null, true);
|
|
148
|
-
const drawTableHeader = (y) => this.drawHeader(doc, columns, y, tableWidth, headerHeight,
|
|
149
|
-
let
|
|
219
|
+
const drawTableHeader = (y) => this.drawHeader(doc, columns, y, tableWidth, headerHeight, TABLE_CELL_PADDING, headerFontSize, MIN_COLUMN_WIDTH);
|
|
220
|
+
let tableStartY = startY;
|
|
221
|
+
if (tableStartY + headerHeight > pageBottom) {
|
|
222
|
+
doc.addPage();
|
|
223
|
+
tableStartY = doc.page.margins.top;
|
|
224
|
+
}
|
|
225
|
+
let currentY = drawTableHeader(tableStartY);
|
|
150
226
|
doc.font(FONT_REGULAR).fontSize(dataFontSize);
|
|
151
227
|
rows.forEach((row, rowIndex) => {
|
|
152
228
|
const currentRowHeight = calculateRowHeight(row, false);
|
|
@@ -158,56 +234,68 @@ var PdfExporter = class {
|
|
|
158
234
|
currentY = this.drawRow(
|
|
159
235
|
doc,
|
|
160
236
|
row,
|
|
161
|
-
rowIndex,
|
|
162
237
|
columns,
|
|
163
238
|
currentY,
|
|
164
|
-
tableWidth,
|
|
165
239
|
currentRowHeight,
|
|
166
|
-
|
|
240
|
+
TABLE_CELL_PADDING,
|
|
167
241
|
dataFontSize,
|
|
168
|
-
|
|
242
|
+
MIN_COLUMN_WIDTH,
|
|
243
|
+
rowIndex
|
|
169
244
|
);
|
|
170
245
|
});
|
|
246
|
+
const left = doc.page.margins.left;
|
|
247
|
+
const closingRuleY = currentY + SECTION_TITLE_FONT_SIZE * HEADER_SPACING_FACTOR;
|
|
248
|
+
doc.strokeColor(HEADER_RULE_COLOR).lineWidth(HEADER_RULE_WIDTH).moveTo(left, closingRuleY).lineTo(left + tableWidth, closingRuleY).stroke();
|
|
249
|
+
return closingRuleY;
|
|
171
250
|
}
|
|
172
251
|
drawHeader(doc, columns, startY, tableWidth, headerHeight, cellPadding, headerFontSize, minColumnWidth) {
|
|
173
|
-
|
|
174
|
-
doc.
|
|
175
|
-
|
|
176
|
-
|
|
252
|
+
const left = doc.page.margins.left;
|
|
253
|
+
doc.rect(left, startY, tableWidth, headerHeight).fill(HEADER_BACKGROUND_COLOR);
|
|
254
|
+
doc.strokeColor(SEPARATOR_COLOR).lineWidth(0.5).moveTo(left, startY).lineTo(left + tableWidth, startY).stroke();
|
|
255
|
+
let xPosition = left;
|
|
256
|
+
doc.fillColor(DEFAULT_TEXT_COLOR).font(FONT_BOLD).fontSize(headerFontSize);
|
|
257
|
+
const headerLineHeight = doc.currentLineHeight(true);
|
|
258
|
+
const headerTextY = startY + Math.max((headerHeight - headerLineHeight) / 2, 0);
|
|
177
259
|
columns.forEach((col) => {
|
|
178
|
-
doc.
|
|
179
|
-
doc.text(col.header, xPosition + cellPadding, startY + cellPadding, {
|
|
260
|
+
doc.text(col.header, xPosition + cellPadding, headerTextY, {
|
|
180
261
|
width: (col.width ?? minColumnWidth) - cellPadding * 2,
|
|
262
|
+
height: headerLineHeight,
|
|
181
263
|
align: "left",
|
|
182
|
-
lineBreak: false
|
|
264
|
+
lineBreak: false,
|
|
265
|
+
ellipsis: true
|
|
183
266
|
});
|
|
184
267
|
xPosition += col.width ?? minColumnWidth;
|
|
185
268
|
});
|
|
186
|
-
doc.moveTo(
|
|
187
|
-
doc.moveTo(doc.page.margins.left, startY + headerHeight).lineTo(xPosition, startY + headerHeight).stroke();
|
|
269
|
+
doc.strokeColor(SEPARATOR_COLOR).lineWidth(0.5).moveTo(left, startY + headerHeight).lineTo(left + tableWidth, startY + headerHeight).stroke();
|
|
188
270
|
return startY + headerHeight;
|
|
189
271
|
}
|
|
190
|
-
drawRow(doc, row,
|
|
191
|
-
doc.
|
|
192
|
-
|
|
193
|
-
|
|
272
|
+
drawRow(doc, row, columns, currentY, rowHeight, cellPadding, dataFontSize, minColumnWidth, rowIndex = 0) {
|
|
273
|
+
const left = doc.page.margins.left;
|
|
274
|
+
const tableWidth = columns.reduce((sum, c) => sum + (c.width ?? minColumnWidth), 0);
|
|
275
|
+
if (rowIndex % 2 === 1) {
|
|
276
|
+
doc.rect(left, currentY, tableWidth, rowHeight).fill(ZEBRA_BACKGROUND_COLOR);
|
|
194
277
|
}
|
|
195
|
-
|
|
196
|
-
doc.
|
|
197
|
-
|
|
198
|
-
|
|
278
|
+
doc.font(FONT_REGULAR).fontSize(dataFontSize).fillColor(DEFAULT_TEXT_COLOR);
|
|
279
|
+
const dataLineHeight = doc.currentLineHeight(true);
|
|
280
|
+
const dataTextY = currentY + Math.max((rowHeight - dataLineHeight) / 2, 0);
|
|
281
|
+
let xPosition = left;
|
|
282
|
+
columns.forEach((col, i) => {
|
|
199
283
|
const rawValue = row[col.key];
|
|
200
284
|
const cellValue = typeof rawValue === "string" || typeof rawValue === "number" || typeof rawValue === "boolean" ? String(rawValue) : "";
|
|
201
285
|
const isNumeric = typeof rawValue === "number" || typeof rawValue === "string" && rawValue !== "" && !isNaN(Number(rawValue));
|
|
202
|
-
doc.text(cellValue, xPosition + cellPadding,
|
|
286
|
+
doc.text(cellValue, xPosition + cellPadding, dataTextY, {
|
|
203
287
|
width: (col.width ?? minColumnWidth) - cellPadding * 2,
|
|
288
|
+
height: dataLineHeight,
|
|
204
289
|
align: isNumeric ? "right" : "left",
|
|
205
|
-
lineBreak: false
|
|
290
|
+
lineBreak: false,
|
|
291
|
+
ellipsis: true
|
|
206
292
|
});
|
|
207
293
|
xPosition += col.width ?? minColumnWidth;
|
|
294
|
+
if (i < columns.length - 1) {
|
|
295
|
+
doc.strokeColor(SEPARATOR_COLOR).lineWidth(0.5).moveTo(xPosition, currentY).lineTo(xPosition, currentY + rowHeight).stroke();
|
|
296
|
+
}
|
|
208
297
|
});
|
|
209
|
-
doc.moveTo(
|
|
210
|
-
doc.moveTo(doc.page.margins.left, currentY + rowHeight).lineTo(xPosition, currentY + rowHeight).stroke();
|
|
298
|
+
doc.strokeColor(SEPARATOR_COLOR).lineWidth(0.5).moveTo(left, currentY + rowHeight).lineTo(left + tableWidth, currentY + rowHeight).stroke();
|
|
211
299
|
return currentY + rowHeight;
|
|
212
300
|
}
|
|
213
301
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -819,7 +819,10 @@ var enUS = {
|
|
|
819
819
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
820
820
|
"common.report-section.rev-class-footer.house-account": false,
|
|
821
821
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
822
|
+
"scheduled-reports.report-name": false,
|
|
822
823
|
"scheduled-reports.period": false,
|
|
824
|
+
"scheduled-reports.generated-at": false,
|
|
825
|
+
"scheduled-reports.generated-by": false,
|
|
823
826
|
"components.form.field.group-by": false,
|
|
824
827
|
"components.form.field.last-week": false,
|
|
825
828
|
"components.form.field.last-year": false,
|
|
@@ -1347,7 +1350,10 @@ var enUS2 = {
|
|
|
1347
1350
|
"common.report-section.rev-class-footer.non-sales-revenue": false,
|
|
1348
1351
|
"common.report-section.rev-class-footer.house-account": false,
|
|
1349
1352
|
"common.report-section.rev-class-footer.total-accountable": false,
|
|
1353
|
+
"scheduled-reports.report-name": false,
|
|
1350
1354
|
"scheduled-reports.period": false,
|
|
1355
|
+
"scheduled-reports.generated-at": false,
|
|
1356
|
+
"scheduled-reports.generated-by": false,
|
|
1351
1357
|
"components.form.field.group-by": false,
|
|
1352
1358
|
"components.form.field.last-week": false,
|
|
1353
1359
|
"components.form.field.last-year": false,
|
|
@@ -1875,7 +1881,10 @@ var enUS3 = {
|
|
|
1875
1881
|
"common.report-section.rev-class-footer.non-sales-revenue": "Non-Sales Revenue",
|
|
1876
1882
|
"common.report-section.rev-class-footer.house-account": "House Account",
|
|
1877
1883
|
"common.report-section.rev-class-footer.total-accountable": "Total Accountable",
|
|
1884
|
+
"scheduled-reports.report-name": "Report",
|
|
1878
1885
|
"scheduled-reports.period": "Period",
|
|
1886
|
+
"scheduled-reports.generated-at": "Generated at",
|
|
1887
|
+
"scheduled-reports.generated-by": "Generated by",
|
|
1879
1888
|
"components.form.field.group-by": "Group By",
|
|
1880
1889
|
"components.form.field.last-week": "Compare to Last Week",
|
|
1881
1890
|
"components.form.field.last-year": "Compare to Last Year",
|
|
@@ -1891,6 +1900,7 @@ var enUS3 = {
|
|
|
1891
1900
|
"analytics.field.daypart_id": "Day Parts",
|
|
1892
1901
|
"analytics.field.timeslot_id": "15 Mins",
|
|
1893
1902
|
"analytics.field.employee_id": "Employees",
|
|
1903
|
+
"analytics.field.employee_name": "Employee",
|
|
1894
1904
|
"analytics.field.payroll_id": "Payroll IDs",
|
|
1895
1905
|
"analytics.field.intraday_period_group": "Day Parts",
|
|
1896
1906
|
"analytics.field.item_id": "Item",
|
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 getFixedColumns, n as getReportConfig, o 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-EBViO5sS.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 getFixedColumns, n as getReportConfig, o as getReportExportFileName } from './report-EBViO5sS.cjs';
|
|
3
3
|
import { LocaleCode } from '@harbortouch/locale-registry';
|
|
4
4
|
export { R as RenderedReport, a as ReportDocument, b as ReportFormat, c as ReportSection, d as ResolvedColumn, S as SummaryRow } from './ir-CUi0Z9hv.cjs';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ declare function resolveTranslate(key: MessageKey, locale: string): string;
|
|
|
9
9
|
declare function getColumnAlignment(type?: FieldType): ColumnAlignment;
|
|
10
10
|
declare function isNumericType(type?: FieldType): boolean;
|
|
11
11
|
|
|
12
|
-
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.cash-collected" | "common.report-col.cash-collected.short" | "common.report-col.cash-collected.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.tip-share-contributed" | "common.report-col.tip-share-contributed.short" | "common.report-col.tip-share-contributed.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-col.paid-normal-hours" | "common.report-col.paid-normal-hours.short" | "common.report-col.paid-normal-hours.info" | "common.report-col.normal-pay" | "common.report-col.normal-pay.short" | "common.report-col.normal-pay.info" | "common.report-col.overtime-pay" | "common.report-col.overtime-pay.short" | "common.report-col.overtime-pay.info" | "common.report-col.double-overtime-pay" | "common.report-col.double-overtime-pay.short" | "common.report-col.double-overtime-pay.info" | "common.report-col.gratuity" | "common.report-col.gratuity.short" | "common.report-col.gratuity.info" | "common.report-col.tip-paid-status" | "common.report-col.tip-paid-status.short" | "common.report-col.tip-paid-status.info" | "common.report-col.total-payments" | "common.report-col.total-payments.short" | "common.report-col.total-payments.info" | "common.report-col.minimum-wage-adjustment" | "common.report-col.minimum-wage-adjustment.short" | "common.report-col.minimum-wage-adjustment.info" | "common.report-col.total-pay" | "common.report-col.total-pay.short" | "common.report-col.total-pay.info" | "common.report-col.table-name" | "common.report-col.table-name.short" | "common.report-col.table-name.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.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" | "common.labels.unassigned" | "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.taxes" | "table.groups.gross-sales" | "table.groups.guests" | "table.groups.sales-per-guest" | "employee-timecard.status.active" | "employee-timecard.status.inactive" | "employee-timecard.job.break-suffix" | null;
|
|
12
|
+
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.cash-collected" | "common.report-col.cash-collected.short" | "common.report-col.cash-collected.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.tip-share-contributed" | "common.report-col.tip-share-contributed.short" | "common.report-col.tip-share-contributed.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-col.paid-normal-hours" | "common.report-col.paid-normal-hours.short" | "common.report-col.paid-normal-hours.info" | "common.report-col.normal-pay" | "common.report-col.normal-pay.short" | "common.report-col.normal-pay.info" | "common.report-col.overtime-pay" | "common.report-col.overtime-pay.short" | "common.report-col.overtime-pay.info" | "common.report-col.double-overtime-pay" | "common.report-col.double-overtime-pay.short" | "common.report-col.double-overtime-pay.info" | "common.report-col.gratuity" | "common.report-col.gratuity.short" | "common.report-col.gratuity.info" | "common.report-col.tip-paid-status" | "common.report-col.tip-paid-status.short" | "common.report-col.tip-paid-status.info" | "common.report-col.total-payments" | "common.report-col.total-payments.short" | "common.report-col.total-payments.info" | "common.report-col.minimum-wage-adjustment" | "common.report-col.minimum-wage-adjustment.short" | "common.report-col.minimum-wage-adjustment.info" | "common.report-col.total-pay" | "common.report-col.total-pay.short" | "common.report-col.total-pay.info" | "common.report-col.table-name" | "common.report-col.table-name.short" | "common.report-col.table-name.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.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.report-name" | "scheduled-reports.period" | "scheduled-reports.generated-at" | "scheduled-reports.generated-by" | "components.form.field.group-by" | "components.form.field.last-week" | "components.form.field.last-year" | "common.labels.locations" | "common.labels.yes" | "common.labels.unassigned" | "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.taxes" | "table.groups.gross-sales" | "table.groups.guests" | "table.groups.sales-per-guest" | "employee-timecard.status.active" | "employee-timecard.status.inactive" | "employee-timecard.job.break-suffix" | "analytics.field.employee_name" | null;
|
|
13
13
|
declare const calculateReportTotals: <T>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig>) => T;
|
|
14
14
|
|
|
15
15
|
type SalesSummaryField = 'groupById' | 'groupByName' | 'salesAmountNet' | 'salesVarLW' | 'salesVarLY' | 'salesVarLWPct' | 'salesVarLYPct' | 'salesAmountNetLastWeek' | 'salesAmountNetLastYear' | 'salesAmountGross' | 'salesAmountGrossLastWeek' | 'salesAmountGrossLastYear' | 'grossVarLW' | 'grossVarLY' | 'grossVarLWPct' | 'grossVarLYPct' | 'taxesAmount' | 'taxesAmountLastWeek' | 'taxesAmountLastYear' | 'taxesVarLW' | 'taxesVarLY' | 'taxesVarLWPct' | 'taxesVarLYPct' | 'ticketsCount' | 'ticketsCountLastWeek' | 'ticketsCountLastYear' | 'guestsCount' | 'guestsVarLW' | 'guestsVarLY' | 'guestsVarLWPct' | 'guestsVarLYPct' | 'guestsCountLastWeek' | 'guestsCountLastYear' | 'salesPerGuestTY' | 'salesPerGuestLW' | 'salesPerGuestLY';
|