@harbortouch/skytab-analytics-report-utils 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -20,7 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- COLUMN_REGISTRY: () => COLUMN_REGISTRY,
24
23
  DAILY_SALES_AVAILABLE_COLUMNS: () => DAILY_SALES_AVAILABLE_COLUMNS,
25
24
  DAILY_SALES_BY_GROUP_AVAILABLE_COLUMNS: () => DAILY_SALES_BY_GROUP_AVAILABLE_COLUMNS,
26
25
  DAILY_SALES_DEFAULT_VISIBLE_COLUMNS: () => DAILY_SALES_DEFAULT_VISIBLE_COLUMNS,
@@ -60,7 +59,7 @@ __export(index_exports, {
60
59
  dailySalesTrendsConfig: () => dailySalesTrendsConfig,
61
60
  employeeTimecardConfig: () => employeeTimecardConfig,
62
61
  getColumnAlignment: () => getColumnAlignment,
63
- getColumnMetadata: () => getColumnMetadata,
62
+ getReportConfig: () => getReportConfig,
64
63
  isNumericType: () => isNumericType,
65
64
  itemTaxConfig: () => itemTaxConfig,
66
65
  modifierMixConfig: () => modifierMixConfig,
@@ -72,739 +71,6 @@ __export(index_exports, {
72
71
  });
73
72
  module.exports = __toCommonJS(index_exports);
74
73
 
75
- // src/report.ts
76
- var Report = {
77
- TICKET_LIVE: "ticket-live",
78
- TICKET_ANALYTICS: "ticket-analytics",
79
- SALES_SUMMARY: "sales-summary",
80
- PRODUCT_MIX: "product-mix",
81
- MODIFIER_MIX: "modifier-mix",
82
- ITEM_TAX: "item-tax",
83
- EMPLOYEE_TIMECARD: "employee-timecard",
84
- EMPLOYEE_TIP: "employee-tip",
85
- SALES_BY_ITEM: "sales-by-item"
86
- };
87
-
88
- // src/columns/index.ts
89
- var COLUMN_REGISTRY = {
90
- fifteenMinInterval: {
91
- titleKey: "common.report-col.fifteen-min-interval",
92
- shortTitleKey: "common.report-col.fifteen-min-interval.short",
93
- infoTextKey: "common.report-col.fifteen-min-interval.info"
94
- },
95
- adjustedTips: {
96
- titleKey: "common.report-col.adjusted-tips",
97
- shortTitleKey: "common.report-col.adjusted-tips.short",
98
- infoTextKey: "common.report-col.adjusted-tips.info"
99
- },
100
- advantageProgram: {
101
- titleKey: "common.report-col.advantage-program",
102
- shortTitleKey: "common.report-col.advantage-program.short",
103
- infoTextKey: "common.report-col.advantage-program.info"
104
- },
105
- amex: {
106
- titleKey: "common.report-col.amex",
107
- shortTitleKey: "common.report-col.amex.short",
108
- infoTextKey: "common.report-col.amex.info"
109
- },
110
- amexReturns: {
111
- titleKey: "common.report-col.amex-returns",
112
- shortTitleKey: "common.report-col.amex-returns.short",
113
- infoTextKey: "common.report-col.amex-returns.info"
114
- },
115
- attachRate: {
116
- titleKey: "common.report-col.attach-rate",
117
- shortTitleKey: "common.report-col.attach-rate.short",
118
- infoTextKey: "common.report-col.attach-rate.info"
119
- },
120
- autoGratuity: {
121
- titleKey: "common.report-col.auto-gratuity",
122
- shortTitleKey: "common.report-col.auto-gratuity.short",
123
- infoTextKey: "common.report-col.auto-gratuity.info"
124
- },
125
- averageGrossPrice: {
126
- titleKey: "common.report-col.average-gross-price",
127
- shortTitleKey: "common.report-col.average-gross-price.short",
128
- infoTextKey: "common.report-col.average-gross-price.info"
129
- },
130
- bankFees: {
131
- titleKey: "common.report-col.bank-fees",
132
- shortTitleKey: "common.report-col.bank-fees.short",
133
- infoTextKey: "common.report-col.bank-fees.info"
134
- },
135
- batchAmount: {
136
- titleKey: "common.report-col.batch-amount",
137
- shortTitleKey: "common.report-col.batch-amount.short",
138
- infoTextKey: "common.report-col.batch-amount.info"
139
- },
140
- batchDate: {
141
- titleKey: "common.report-col.batch-date",
142
- shortTitleKey: "common.report-col.batch-date.short",
143
- infoTextKey: "common.report-col.batch-date.info"
144
- },
145
- batchNumber: {
146
- titleKey: "common.report-col.batch-number",
147
- shortTitleKey: "common.report-col.batch-number.short",
148
- infoTextKey: "common.report-col.batch-number.info"
149
- },
150
- clockInTime: {
151
- titleKey: "common.report-col.clock-in-time",
152
- shortTitleKey: "common.report-col.clock-in-time.short",
153
- infoTextKey: "common.report-col.clock-in-time.info"
154
- },
155
- clockOutTime: {
156
- titleKey: "common.report-col.clock-out-time",
157
- shortTitleKey: "common.report-col.clock-out-time.short",
158
- infoTextKey: "common.report-col.clock-out-time.info"
159
- },
160
- country: {
161
- titleKey: "common.report-col.country",
162
- shortTitleKey: "common.report-col.country.short",
163
- infoTextKey: "common.report-col.country.info"
164
- },
165
- customerName: {
166
- titleKey: "common.report-col.customer-name",
167
- shortTitleKey: "common.report-col.customer-name.short",
168
- infoTextKey: "common.report-col.customer-name.info"
169
- },
170
- date: {
171
- titleKey: "common.report-col.date",
172
- shortTitleKey: "common.report-col.date.short",
173
- infoTextKey: "common.report-col.date.info"
174
- },
175
- dateClose: {
176
- titleKey: "common.report-col.date-close",
177
- shortTitleKey: "common.report-col.date-close.short",
178
- infoTextKey: "common.report-col.date-close.info"
179
- },
180
- daypart: {
181
- titleKey: "common.report-col.daypart",
182
- shortTitleKey: "common.report-col.daypart.short",
183
- infoTextKey: "common.report-col.daypart.info"
184
- },
185
- debit: {
186
- titleKey: "common.report-col.debit",
187
- shortTitleKey: "common.report-col.debit.short",
188
- infoTextKey: "common.report-col.debit.info"
189
- },
190
- debitReturns: {
191
- titleKey: "common.report-col.debit-returns",
192
- shortTitleKey: "common.report-col.debit-returns.short",
193
- infoTextKey: "common.report-col.debit-returns.info"
194
- },
195
- declaredTips: {
196
- titleKey: "common.report-col.declared-tips",
197
- shortTitleKey: "common.report-col.declared-tips.short",
198
- infoTextKey: "common.report-col.declared-tips.info"
199
- },
200
- department: {
201
- titleKey: "common.report-col.department",
202
- shortTitleKey: "common.report-col.department.short",
203
- infoTextKey: "common.report-col.department.info"
204
- },
205
- depositCurrency: {
206
- titleKey: "common.report-col.deposit-currency",
207
- shortTitleKey: "common.report-col.deposit-currency.short",
208
- infoTextKey: "common.report-col.deposit-currency.info"
209
- },
210
- depositDate: {
211
- titleKey: "common.report-col.deposit-date",
212
- shortTitleKey: "common.report-col.deposit-date.short",
213
- infoTextKey: "common.report-col.deposit-date.info"
214
- },
215
- discountAmount: {
216
- titleKey: "common.report-col.discount-amount",
217
- shortTitleKey: "common.report-col.discount-amount.short",
218
- infoTextKey: "common.report-col.discount-amount.info"
219
- },
220
- discountCount: {
221
- titleKey: "common.report-col.discount-count",
222
- shortTitleKey: "common.report-col.discount-count.short",
223
- infoTextKey: "common.report-col.discount-count.info"
224
- },
225
- discover: {
226
- titleKey: "common.report-col.discover",
227
- shortTitleKey: "common.report-col.discover.short",
228
- infoTextKey: "common.report-col.discover.info"
229
- },
230
- discoverReturns: {
231
- titleKey: "common.report-col.discover-returns",
232
- shortTitleKey: "common.report-col.discover-returns.short",
233
- infoTextKey: "common.report-col.discover-returns.info"
234
- },
235
- ebt: {
236
- titleKey: "common.report-col.ebt",
237
- shortTitleKey: "common.report-col.ebt.short",
238
- infoTextKey: "common.report-col.ebt.info"
239
- },
240
- ebtReturns: {
241
- titleKey: "common.report-col.ebt-returns",
242
- shortTitleKey: "common.report-col.ebt-returns.short",
243
- infoTextKey: "common.report-col.ebt-returns.info"
244
- },
245
- employeeId: {
246
- titleKey: "common.report-col.employee-id",
247
- shortTitleKey: "common.report-col.employee-id.short",
248
- infoTextKey: "common.report-col.employee-id.info"
249
- },
250
- employeeJob: {
251
- titleKey: "common.report-col.employee-job",
252
- shortTitleKey: "common.report-col.employee-job.short",
253
- infoTextKey: "common.report-col.employee-job.info"
254
- },
255
- employeeName: {
256
- titleKey: "common.report-col.employee-name",
257
- shortTitleKey: "common.report-col.employee-name.short",
258
- infoTextKey: "common.report-col.employee-name.info"
259
- },
260
- exemptTaxes: {
261
- titleKey: "common.report-col.exempt-taxes",
262
- shortTitleKey: "common.report-col.exempt-taxes.short",
263
- infoTextKey: "common.report-col.exempt-taxes.info"
264
- },
265
- grandTotal: {
266
- titleKey: "common.report-col.grand-total",
267
- shortTitleKey: "common.report-col.grand-total.short",
268
- infoTextKey: "common.report-col.grand-total.info"
269
- },
270
- grossCashSales: {
271
- titleKey: "common.report-col.gross-cash-sales",
272
- shortTitleKey: "common.report-col.gross-cash-sales.short",
273
- infoTextKey: "common.report-col.gross-cash-sales.info"
274
- },
275
- grossCashTips: {
276
- titleKey: "common.report-col.gross-cash-tips",
277
- shortTitleKey: "common.report-col.gross-cash-tips.short",
278
- infoTextKey: "common.report-col.gross-cash-tips.info"
279
- },
280
- grossCreditCardTips: {
281
- titleKey: "common.report-col.gross-credit-card-tips",
282
- shortTitleKey: "common.report-col.gross-credit-card-tips.short",
283
- infoTextKey: "common.report-col.gross-credit-card-tips.info"
284
- },
285
- grossCreditSales: {
286
- titleKey: "common.report-col.gross-credit-sales",
287
- shortTitleKey: "common.report-col.gross-credit-sales.short",
288
- infoTextKey: "common.report-col.gross-credit-sales.info"
289
- },
290
- grossSales: {
291
- titleKey: "common.report-col.gross-sales",
292
- shortTitleKey: "common.report-col.gross-sales.short",
293
- infoTextKey: "common.report-col.gross-sales.info"
294
- },
295
- grossTips: {
296
- titleKey: "common.report-col.gross-tips",
297
- shortTitleKey: "common.report-col.gross-tips.short",
298
- infoTextKey: "common.report-col.gross-tips.info"
299
- },
300
- guestCount: {
301
- titleKey: "common.report-col.guest-count",
302
- shortTitleKey: "common.report-col.guest-count.short",
303
- infoTextKey: "common.report-col.guest-count.info"
304
- },
305
- guestsVarLw: {
306
- titleKey: "common.report-col.guests-var-lw",
307
- shortTitleKey: "common.report-col.guests-var-lw.short",
308
- infoTextKey: "common.report-col.guests-var-lw.info"
309
- },
310
- guestsVarLwPct: {
311
- titleKey: "common.report-col.guests-var-lw-pct",
312
- shortTitleKey: "common.report-col.guests-var-lw-pct.short",
313
- infoTextKey: "common.report-col.guests-var-lw-pct.info"
314
- },
315
- guestsVarLy: {
316
- titleKey: "common.report-col.guests-var-ly",
317
- shortTitleKey: "common.report-col.guests-var-ly.short",
318
- infoTextKey: "common.report-col.guests-var-ly.info"
319
- },
320
- guestsVarLyPct: {
321
- titleKey: "common.report-col.guests-var-ly-pct",
322
- shortTitleKey: "common.report-col.guests-var-ly-pct.short",
323
- infoTextKey: "common.report-col.guests-var-ly-pct.info"
324
- },
325
- hour: {
326
- titleKey: "common.report-col.hour",
327
- shortTitleKey: "common.report-col.hour.short",
328
- infoTextKey: "common.report-col.hour.info"
329
- },
330
- hoursWorked: {
331
- titleKey: "common.report-col.hours-worked",
332
- shortTitleKey: "common.report-col.hours-worked.short",
333
- infoTextKey: "common.report-col.hours-worked.info"
334
- },
335
- inclusiveTax: {
336
- titleKey: "common.report-col.inclusive-tax",
337
- shortTitleKey: "common.report-col.inclusive-tax.short",
338
- infoTextKey: "common.report-col.inclusive-tax.info"
339
- },
340
- itemName: {
341
- titleKey: "common.report-col.item-name",
342
- shortTitleKey: "common.report-col.item-name.short",
343
- infoTextKey: "common.report-col.item-name.info"
344
- },
345
- itemPrice: {
346
- titleKey: "common.report-col.item-price",
347
- shortTitleKey: "common.report-col.item-price.short",
348
- infoTextKey: "common.report-col.item-price.info"
349
- },
350
- locationCity: {
351
- titleKey: "common.report-col.location-city",
352
- shortTitleKey: "common.report-col.location-city.short",
353
- infoTextKey: "common.report-col.location-city.info"
354
- },
355
- locationId: {
356
- titleKey: "common.report-col.location-id",
357
- shortTitleKey: "common.report-col.location-id.short",
358
- infoTextKey: "common.report-col.location-id.info"
359
- },
360
- locationMid: {
361
- titleKey: "common.report-col.location-mid",
362
- shortTitleKey: "common.report-col.location-mid.short",
363
- infoTextKey: "common.report-col.location-mid.info"
364
- },
365
- locationName: {
366
- titleKey: "common.report-col.location-name",
367
- shortTitleKey: "common.report-col.location-name.short",
368
- infoTextKey: "common.report-col.location-name.info"
369
- },
370
- locationState: {
371
- titleKey: "common.report-col.location-state",
372
- shortTitleKey: "common.report-col.location-state.short",
373
- infoTextKey: "common.report-col.location-state.info"
374
- },
375
- mastercard: {
376
- titleKey: "common.report-col.mastercard",
377
- shortTitleKey: "common.report-col.mastercard.short",
378
- infoTextKey: "common.report-col.mastercard.info"
379
- },
380
- mcReturns: {
381
- titleKey: "common.report-col.mc-returns",
382
- shortTitleKey: "common.report-col.mc-returns.short",
383
- infoTextKey: "common.report-col.mc-returns.info"
384
- },
385
- modifierName: {
386
- titleKey: "common.report-col.modifier-name",
387
- shortTitleKey: "common.report-col.modifier-name.short",
388
- infoTextKey: "common.report-col.modifier-name.info"
389
- },
390
- modifierPrice: {
391
- titleKey: "common.report-col.modifier-price",
392
- shortTitleKey: "common.report-col.modifier-price.short",
393
- infoTextKey: "common.report-col.modifier-price.info"
394
- },
395
- modifierQuantity: {
396
- titleKey: "common.report-col.modifier-quantity",
397
- shortTitleKey: "common.report-col.modifier-quantity.short",
398
- infoTextKey: "common.report-col.modifier-quantity.info"
399
- },
400
- netSales: {
401
- titleKey: "common.report-col.net-sales",
402
- shortTitleKey: "common.report-col.net-sales.short",
403
- infoTextKey: "common.report-col.net-sales.info"
404
- },
405
- netTaxCollected: {
406
- titleKey: "common.report-col.net-tax-collected",
407
- shortTitleKey: "common.report-col.net-tax-collected.short",
408
- infoTextKey: "common.report-col.net-tax-collected.info"
409
- },
410
- netTips: {
411
- titleKey: "common.report-col.net-tips",
412
- shortTitleKey: "common.report-col.net-tips.short",
413
- infoTextKey: "common.report-col.net-tips.info"
414
- },
415
- numberOfGuests: {
416
- titleKey: "common.report-col.number-of-guests",
417
- shortTitleKey: "common.report-col.number-of-guests.short",
418
- infoTextKey: "common.report-col.number-of-guests.info"
419
- },
420
- orderType: {
421
- titleKey: "common.report-col.order-type",
422
- shortTitleKey: "common.report-col.order-type.short",
423
- infoTextKey: "common.report-col.order-type.info"
424
- },
425
- paymentType: {
426
- titleKey: "common.report-col.payment-type",
427
- shortTitleKey: "common.report-col.payment-type.short",
428
- infoTextKey: "common.report-col.payment-type.info"
429
- },
430
- payrollId: {
431
- titleKey: "common.report-col.payroll-id",
432
- shortTitleKey: "common.report-col.payroll-id.short",
433
- infoTextKey: "common.report-col.payroll-id.info"
434
- },
435
- quantity: {
436
- titleKey: "common.report-col.quantity",
437
- shortTitleKey: "common.report-col.quantity.short",
438
- infoTextKey: "common.report-col.quantity.info"
439
- },
440
- referenceNumber: {
441
- titleKey: "common.report-col.reference-number",
442
- shortTitleKey: "common.report-col.reference-number.short",
443
- infoTextKey: "common.report-col.reference-number.info"
444
- },
445
- refundAmount: {
446
- titleKey: "common.report-col.refund-amount",
447
- shortTitleKey: "common.report-col.refund-amount.short",
448
- infoTextKey: "common.report-col.refund-amount.info"
449
- },
450
- refundedTaxAmount: {
451
- titleKey: "common.report-col.refunded-tax-amount",
452
- shortTitleKey: "common.report-col.refunded-tax-amount.short",
453
- infoTextKey: "common.report-col.refunded-tax-amount.info"
454
- },
455
- revenueCenter: {
456
- titleKey: "common.report-col.revenue-center",
457
- shortTitleKey: "common.report-col.revenue-center.short",
458
- infoTextKey: "common.report-col.revenue-center.info"
459
- },
460
- revenueClass: {
461
- titleKey: "common.report-col.revenue-class",
462
- shortTitleKey: "common.report-col.revenue-class.short",
463
- infoTextKey: "common.report-col.revenue-class.info"
464
- },
465
- salesVarLw: {
466
- titleKey: "common.report-col.sales-var-lw",
467
- shortTitleKey: "common.report-col.sales-var-lw.short",
468
- infoTextKey: "common.report-col.sales-var-lw.info"
469
- },
470
- salesVarLwPct: {
471
- titleKey: "common.report-col.sales-var-lw-pct",
472
- shortTitleKey: "common.report-col.sales-var-lw-pct.short",
473
- infoTextKey: "common.report-col.sales-var-lw-pct.info"
474
- },
475
- salesVarLy: {
476
- titleKey: "common.report-col.sales-var-ly",
477
- shortTitleKey: "common.report-col.sales-var-ly.short",
478
- infoTextKey: "common.report-col.sales-var-ly.info"
479
- },
480
- salesVarLyPct: {
481
- titleKey: "common.report-col.sales-var-ly-pct",
482
- shortTitleKey: "common.report-col.sales-var-ly-pct.short",
483
- infoTextKey: "common.report-col.sales-var-ly-pct.info"
484
- },
485
- salesMixByPct: {
486
- titleKey: "common.report-col.sales-mix-by-pct",
487
- shortTitleKey: "common.report-col.sales-mix-by-pct.short",
488
- infoTextKey: "common.report-col.sales-mix-by-pct.info"
489
- },
490
- salesPerGuest: {
491
- titleKey: "common.report-col.sales-per-guest",
492
- shortTitleKey: "common.report-col.sales-per-guest.short",
493
- infoTextKey: "common.report-col.sales-per-guest.info"
494
- },
495
- salesPerGuestLw: {
496
- titleKey: "common.report-col.sales-per-guest-lw",
497
- shortTitleKey: "common.report-col.sales-per-guest-lw.short",
498
- infoTextKey: "common.report-col.sales-per-guest-lw.info"
499
- },
500
- salesPerGuestLy: {
501
- titleKey: "common.report-col.sales-per-guest-ly",
502
- shortTitleKey: "common.report-col.sales-per-guest-ly.short",
503
- infoTextKey: "common.report-col.sales-per-guest-ly.info"
504
- },
505
- scheduledShiftEnd: {
506
- titleKey: "common.report-col.scheduled-shift-end",
507
- shortTitleKey: "common.report-col.scheduled-shift-end.short",
508
- infoTextKey: "common.report-col.scheduled-shift-end.info"
509
- },
510
- scheduledShiftStart: {
511
- titleKey: "common.report-col.scheduled-shift-start",
512
- shortTitleKey: "common.report-col.scheduled-shift-start.short",
513
- infoTextKey: "common.report-col.scheduled-shift-start.info"
514
- },
515
- settlementBatchDate: {
516
- titleKey: "common.report-col.settlement-batch-date",
517
- shortTitleKey: "common.report-col.settlement-batch-date.short",
518
- infoTextKey: "common.report-col.settlement-batch-date.info"
519
- },
520
- shiftDurationHrs: {
521
- titleKey: "common.report-col.shift-duration-hrs",
522
- shortTitleKey: "common.report-col.shift-duration-hrs.short",
523
- infoTextKey: "common.report-col.shift-duration-hrs.info"
524
- },
525
- salePaymentType: {
526
- titleKey: "common.report-col.sale-payment-type",
527
- shortTitleKey: "common.report-col.sale-payment-type.short",
528
- infoTextKey: "common.report-col.sale-payment-type.info"
529
- },
530
- status: {
531
- titleKey: "common.report-col.status",
532
- shortTitleKey: "common.report-col.status.short",
533
- infoTextKey: "common.report-col.status.info"
534
- },
535
- subtotal: {
536
- titleKey: "common.report-col.subtotal",
537
- shortTitleKey: "common.report-col.subtotal.short",
538
- infoTextKey: "common.report-col.subtotal.info"
539
- },
540
- taxCollected: {
541
- titleKey: "common.report-col.tax-collected",
542
- shortTitleKey: "common.report-col.tax-collected.short",
543
- infoTextKey: "common.report-col.tax-collected.info"
544
- },
545
- taxName: {
546
- titleKey: "common.report-col.tax-name",
547
- shortTitleKey: "common.report-col.tax-name.short",
548
- infoTextKey: "common.report-col.tax-name.info"
549
- },
550
- taxRate: {
551
- titleKey: "common.report-col.tax-rate",
552
- shortTitleKey: "common.report-col.tax-rate.short",
553
- infoTextKey: "common.report-col.tax-rate.info"
554
- },
555
- taxableSales: {
556
- titleKey: "common.report-col.taxable-sales",
557
- shortTitleKey: "common.report-col.taxable-sales.short",
558
- infoTextKey: "common.report-col.taxable-sales.info"
559
- },
560
- ticketClosed: {
561
- titleKey: "common.report-col.ticket-closed",
562
- shortTitleKey: "common.report-col.ticket-closed.short",
563
- infoTextKey: "common.report-col.ticket-closed.info"
564
- },
565
- ticketFee: {
566
- titleKey: "common.report-col.ticket-fee",
567
- shortTitleKey: "common.report-col.ticket-fee.short",
568
- infoTextKey: "common.report-col.ticket-fee.info"
569
- },
570
- ticketNumber: {
571
- titleKey: "common.report-col.ticket-number",
572
- shortTitleKey: "common.report-col.ticket-number.short",
573
- infoTextKey: "common.report-col.ticket-number.info"
574
- },
575
- ticketOpen: {
576
- titleKey: "common.report-col.ticket-open",
577
- shortTitleKey: "common.report-col.ticket-open.short",
578
- infoTextKey: "common.report-col.ticket-open.info"
579
- },
580
- ticketTotal: {
581
- titleKey: "common.report-col.ticket-total",
582
- shortTitleKey: "common.report-col.ticket-total.short",
583
- infoTextKey: "common.report-col.ticket-total.info"
584
- },
585
- timeOpenMins: {
586
- titleKey: "common.report-col.time-open-mins",
587
- shortTitleKey: "common.report-col.time-open-mins.short",
588
- infoTextKey: "common.report-col.time-open-mins.info"
589
- },
590
- tipPct: {
591
- titleKey: "common.report-col.tip-pct",
592
- shortTitleKey: "common.report-col.tip-pct.short",
593
- infoTextKey: "common.report-col.tip-pct.info"
594
- },
595
- tipReduction: {
596
- titleKey: "common.report-col.tip-reduction",
597
- shortTitleKey: "common.report-col.tip-reduction.short",
598
- infoTextKey: "common.report-col.tip-reduction.info"
599
- },
600
- tipShare: {
601
- titleKey: "common.report-col.tip-share",
602
- shortTitleKey: "common.report-col.tip-share.short",
603
- infoTextKey: "common.report-col.tip-share.info"
604
- },
605
- tips: {
606
- titleKey: "common.report-col.tips",
607
- shortTitleKey: "common.report-col.tips.short",
608
- infoTextKey: "common.report-col.tips.info"
609
- },
610
- tipsPerHour: {
611
- titleKey: "common.report-col.tips-per-hour",
612
- shortTitleKey: "common.report-col.tips-per-hour.short",
613
- infoTextKey: "common.report-col.tips-per-hour.info"
614
- },
615
- totalCollected: {
616
- titleKey: "common.report-col.total-collected",
617
- shortTitleKey: "common.report-col.total-collected.short",
618
- infoTextKey: "common.report-col.total-collected.info"
619
- },
620
- totalItemSales: {
621
- titleKey: "common.report-col.total-item-sales",
622
- shortTitleKey: "common.report-col.total-item-sales.short",
623
- infoTextKey: "common.report-col.total-item-sales.info"
624
- },
625
- totalModifierSales: {
626
- titleKey: "common.report-col.total-modifier-sales",
627
- shortTitleKey: "common.report-col.total-modifier-sales.short",
628
- infoTextKey: "common.report-col.total-modifier-sales.info"
629
- },
630
- totalReturns: {
631
- titleKey: "common.report-col.total-returns",
632
- shortTitleKey: "common.report-col.total-returns.short",
633
- infoTextKey: "common.report-col.total-returns.info"
634
- },
635
- totalSales: {
636
- titleKey: "common.report-col.total-sales",
637
- shortTitleKey: "common.report-col.total-sales.short",
638
- infoTextKey: "common.report-col.total-sales.info"
639
- },
640
- totalTips: {
641
- titleKey: "common.report-col.total-tips",
642
- shortTitleKey: "common.report-col.total-tips.short",
643
- infoTextKey: "common.report-col.total-tips.info"
644
- },
645
- transactionDate: {
646
- titleKey: "common.report-col.transaction-date",
647
- shortTitleKey: "common.report-col.transaction-date.short",
648
- infoTextKey: "common.report-col.transaction-date.info"
649
- },
650
- transactionType: {
651
- titleKey: "common.report-col.transaction-type",
652
- shortTitleKey: "common.report-col.transaction-type.short",
653
- infoTextKey: "common.report-col.transaction-type.info"
654
- },
655
- untaxedSales: {
656
- titleKey: "common.report-col.untaxed-sales",
657
- shortTitleKey: "common.report-col.untaxed-sales.short",
658
- infoTextKey: "common.report-col.untaxed-sales.info"
659
- },
660
- visa: {
661
- titleKey: "common.report-col.visa",
662
- shortTitleKey: "common.report-col.visa.short",
663
- infoTextKey: "common.report-col.visa.info"
664
- },
665
- visaReturns: {
666
- titleKey: "common.report-col.visa-returns",
667
- shortTitleKey: "common.report-col.visa-returns.short",
668
- infoTextKey: "common.report-col.visa-returns.info"
669
- },
670
- paymentsCount: {
671
- titleKey: "common.report-col.payments-count",
672
- shortTitleKey: "common.report-col.payments-count.short",
673
- infoTextKey: "common.report-col.payments-count.info"
674
- },
675
- paymentsAmount: {
676
- titleKey: "common.report-col.payments-amount",
677
- shortTitleKey: "common.report-col.payments-amount.short",
678
- infoTextKey: "common.report-col.payments-amount.info"
679
- },
680
- paymentsTotal: {
681
- titleKey: "common.report-col.payments-total",
682
- shortTitleKey: "common.report-col.payments-total.short",
683
- infoTextKey: "common.report-col.payments-total.info"
684
- },
685
- refundVoidDescription: {
686
- titleKey: "common.report-col.refund-void-description",
687
- shortTitleKey: "common.report-col.refund-void-description.short",
688
- infoTextKey: "common.report-col.refund-void-description.info"
689
- },
690
- refundVoidCount: {
691
- titleKey: "common.report-col.refund-void-count",
692
- shortTitleKey: "common.report-col.refund-void-count.short",
693
- infoTextKey: "common.report-col.refund-void-count.info"
694
- },
695
- refundVoidAmount: {
696
- titleKey: "common.report-col.refund-void-amount",
697
- shortTitleKey: "common.report-col.refund-void-amount.short",
698
- infoTextKey: "common.report-col.refund-void-amount.info"
699
- },
700
- refundVoidPctSales: {
701
- titleKey: "common.report-col.refund-void-pct-sales",
702
- shortTitleKey: "common.report-col.refund-void-pct-sales.short",
703
- infoTextKey: "common.report-col.refund-void-pct-sales.info"
704
- },
705
- discountName: {
706
- titleKey: "common.report-col.discount-name",
707
- shortTitleKey: "common.report-col.discount-name.short",
708
- infoTextKey: "common.report-col.discount-name.info"
709
- },
710
- tickets: {
711
- titleKey: "common.report-col.tickets",
712
- shortTitleKey: "common.report-col.tickets.short",
713
- infoTextKey: "common.report-col.tickets.info"
714
- },
715
- guests: {
716
- titleKey: "common.report-col.guests",
717
- shortTitleKey: "common.report-col.guests.short",
718
- infoTextKey: "common.report-col.guests.info"
719
- },
720
- ticketAverage: {
721
- titleKey: "common.report-col.ticket-average",
722
- shortTitleKey: "common.report-col.ticket-average.short",
723
- infoTextKey: "common.report-col.ticket-average.info"
724
- },
725
- guestAverage: {
726
- titleKey: "common.report-col.guest-average",
727
- shortTitleKey: "common.report-col.guest-average.short",
728
- infoTextKey: "common.report-col.guest-average.info"
729
- },
730
- net: {
731
- titleKey: "common.report-col.net",
732
- shortTitleKey: "common.report-col.net.short",
733
- infoTextKey: "common.report-col.net.info"
734
- }
735
- };
736
- function getColumnMetadata(key) {
737
- return COLUMN_REGISTRY[key];
738
- }
739
-
740
- // src/utils/alignment.ts
741
- function getColumnAlignment(type) {
742
- if (type === "string" || type === "date" || type === "time") {
743
- return "left";
744
- }
745
- return "right";
746
- }
747
- function isNumericType(type) {
748
- return type === "money" || type === "number" || type === "percent" || type === "fixedNumber";
749
- }
750
-
751
- // src/totals.ts
752
- function calculateReportTotals(data, fieldConfig, opts) {
753
- const rows = data;
754
- const { labelField, label } = opts;
755
- const fieldsToSum = /* @__PURE__ */ new Set();
756
- const derivedFields = [];
757
- for (const [field, config] of Object.entries(fieldConfig)) {
758
- const { type, columnKey, footerCalculation: calc } = config;
759
- if (!type || type === "string" || type === "date" || type === "time" || type === "boolean") {
760
- continue;
761
- }
762
- if (calc?.type === "none") {
763
- } else if (!calc || calc.type === "sum") {
764
- if (columnKey || calc?.type === "sum") {
765
- fieldsToSum.add(field);
766
- }
767
- } else {
768
- derivedFields.push({ field, calc });
769
- if (calc.numeratorField) fieldsToSum.add(calc.numeratorField);
770
- if (calc.denominatorField) fieldsToSum.add(calc.denominatorField);
771
- }
772
- }
773
- const sums = {};
774
- for (const field of fieldsToSum) {
775
- sums[field] = rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
776
- }
777
- const derived = {};
778
- for (const { field, calc } of derivedFields) {
779
- const num = sums[calc.numeratorField ?? ""] ?? 0;
780
- const den = sums[calc.denominatorField ?? ""] ?? 0;
781
- if (calc.type === "percentChange") {
782
- derived[field] = den ? (num - den) / den : 0;
783
- } else if (calc.type === "average") {
784
- derived[field] = den > 0 ? num / den : 0;
785
- }
786
- }
787
- const result = {};
788
- for (const [field, config] of Object.entries(fieldConfig)) {
789
- const { type } = config;
790
- if (!type || type === "string" || type === "date" || type === "time") {
791
- result[field] = "";
792
- } else if (type === "boolean") {
793
- result[field] = false;
794
- } else {
795
- result[field] = 0;
796
- }
797
- }
798
- result[labelField] = label;
799
- for (const [field, value] of Object.entries(sums)) {
800
- result[field] = value;
801
- }
802
- for (const [field, value] of Object.entries(derived)) {
803
- result[field] = value;
804
- }
805
- return result;
806
- }
807
-
808
74
  // src/reports/salesSummary.ts
809
75
  var FIRST_COLUMN_WIDTH = 240;
810
76
  var FIELDS = {
@@ -1391,54 +657,14 @@ var dailySalesDiscountsConfig = {
1391
657
  defaultVisibleColumns: DAILY_SALES_DISCOUNTS_DEFAULT_VISIBLE_COLUMNS
1392
658
  };
1393
659
 
1394
- // src/reports/dailySalesRefundsVoids.ts
1395
- var FIRST_COLUMN_WIDTH7 = 240;
1396
- var FIELDS10 = {
1397
- description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH7 },
1398
- count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
1399
- amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
1400
- pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
1401
- };
1402
- var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
1403
- "count",
1404
- "amount",
1405
- "pctSales"
1406
- ];
1407
- var DAILY_SALES_REFUNDS_VOIDS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS;
1408
- var dailySalesRefundsVoidsConfig = {
1409
- fields: FIELDS10,
1410
- availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
1411
- defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_DEFAULT_VISIBLE_COLUMNS
1412
- };
1413
-
1414
- // src/reports/dailySalesTaxes.ts
1415
- var FIRST_COLUMN_WIDTH8 = 240;
1416
- var FIELDS11 = {
1417
- taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH8 },
1418
- taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "sum" } },
1419
- taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
1420
- exemptSales: { type: "money", columnKey: "exemptTaxes", footerCalculation: { type: "sum" } }
1421
- };
1422
- var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
1423
- "taxableSales",
1424
- "taxesAmount",
1425
- "exemptSales"
1426
- ];
1427
- var DAILY_SALES_TAXES_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_TAXES_AVAILABLE_COLUMNS;
1428
- var dailySalesTaxesConfig = {
1429
- fields: FIELDS11,
1430
- availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
1431
- defaultVisibleColumns: DAILY_SALES_TAXES_DEFAULT_VISIBLE_COLUMNS
1432
- };
1433
-
1434
660
  // src/reports/employeeTimecard.ts
1435
- var FIRST_COLUMN_WIDTH9 = 240;
661
+ var FIRST_COLUMN_WIDTH7 = 240;
1436
662
  var EMPLOYEE_NAME_WIDTH = 220;
1437
663
  var STATUS_WIDTH = 140;
1438
664
  var LOOKUP_WIDTH = 160;
1439
665
  var PAYROLL_WIDTH = 160;
1440
666
  var JOB_WIDTH = 200;
1441
- var FIELDS12 = {
667
+ var FIELDS10 = {
1442
668
  locationId: {
1443
669
  type: "number",
1444
670
  enableSorting: false,
@@ -1446,7 +672,7 @@ var FIELDS12 = {
1446
672
  },
1447
673
  locationName: {
1448
674
  type: "string",
1449
- size: FIRST_COLUMN_WIDTH9,
675
+ size: FIRST_COLUMN_WIDTH7,
1450
676
  columnKey: "locationName"
1451
677
  },
1452
678
  businessDate: {
@@ -1513,7 +739,7 @@ var EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS = [
1513
739
  ];
1514
740
  var EMPLOYEE_TIMECARD_DEFAULT_VISIBLE_COLUMNS = EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS;
1515
741
  var employeeTimecardConfig = {
1516
- fields: FIELDS12,
742
+ fields: FIELDS10,
1517
743
  availableColumns: EMPLOYEE_TIMECARD_AVAILABLE_COLUMNS,
1518
744
  defaultVisibleColumns: EMPLOYEE_TIMECARD_DEFAULT_VISIBLE_COLUMNS,
1519
745
  columnGroups: []
@@ -1521,7 +747,7 @@ var employeeTimecardConfig = {
1521
747
  };
1522
748
 
1523
749
  // src/reports/salesByItemDetail.ts
1524
- var FIELDS13 = {
750
+ var FIELDS11 = {
1525
751
  businessDate: { type: "date", columnKey: "date", filteringAvailable: false },
1526
752
  ticketClosedAt: { type: "string", columnKey: "ticketClosed", filteringAvailable: false },
1527
753
  hourId: { type: "number", columnKey: "hour", filteringAvailable: false },
@@ -1563,13 +789,145 @@ var SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS = [
1563
789
  ];
1564
790
  var SALES_BY_ITEM_DETAIL_DEFAULT_VISIBLE_COLUMNS = SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS;
1565
791
  var salesByItemDetailConfig = {
1566
- fields: FIELDS13,
792
+ fields: FIELDS11,
1567
793
  availableColumns: SALES_BY_ITEM_DETAIL_AVAILABLE_COLUMNS,
1568
794
  defaultVisibleColumns: SALES_BY_ITEM_DETAIL_DEFAULT_VISIBLE_COLUMNS
1569
795
  };
796
+
797
+ // src/report.ts
798
+ var Report = {
799
+ TICKET_LIVE: "ticket-live",
800
+ TICKET_ANALYTICS: "ticket-analytics",
801
+ SALES_SUMMARY: "sales-summary",
802
+ PRODUCT_MIX: "product-mix",
803
+ MODIFIER_MIX: "modifier-mix",
804
+ ITEM_TAX: "item-tax",
805
+ EMPLOYEE_TIMECARD: "employee-timecard",
806
+ EMPLOYEE_TIP: "employee-tip",
807
+ SALES_BY_ITEM: "sales-by-item"
808
+ };
809
+ var REPORT_CONFIG_MAP = {
810
+ "sales-summary": salesSummaryConfig,
811
+ "ticket-analytics": ticketSummaryConfig,
812
+ "ticket-live": ticketLiveConfig,
813
+ "product-mix": productMixConfig,
814
+ "modifier-mix": modifierMixConfig,
815
+ "item-tax": itemTaxConfig,
816
+ "employee-timecard": employeeTimecardConfig,
817
+ "employee-tip": null,
818
+ "sales-by-item": salesByItemDetailConfig
819
+ };
820
+ var getReportConfig = (reportType) => REPORT_CONFIG_MAP[reportType];
821
+
822
+ // src/utils/alignment.ts
823
+ function getColumnAlignment(type) {
824
+ if (type === "string" || type === "date" || type === "time") {
825
+ return "left";
826
+ }
827
+ return "right";
828
+ }
829
+ function isNumericType(type) {
830
+ return type === "money" || type === "number" || type === "percent" || type === "fixedNumber";
831
+ }
832
+
833
+ // src/totals.ts
834
+ function calculateReportTotals(data, fieldConfig, opts) {
835
+ const rows = data;
836
+ const { labelField, label } = opts;
837
+ const fieldsToSum = /* @__PURE__ */ new Set();
838
+ const derivedFields = [];
839
+ for (const [field, config] of Object.entries(fieldConfig)) {
840
+ const { type, columnKey, footerCalculation: calc } = config;
841
+ if (!type || type === "string" || type === "date" || type === "time" || type === "boolean") {
842
+ continue;
843
+ }
844
+ if (calc?.type === "none") {
845
+ } else if (!calc || calc.type === "sum") {
846
+ if (columnKey || calc?.type === "sum") {
847
+ fieldsToSum.add(field);
848
+ }
849
+ } else {
850
+ derivedFields.push({ field, calc });
851
+ if (calc.numeratorField) fieldsToSum.add(calc.numeratorField);
852
+ if (calc.denominatorField) fieldsToSum.add(calc.denominatorField);
853
+ }
854
+ }
855
+ const sums = {};
856
+ for (const field of fieldsToSum) {
857
+ sums[field] = rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
858
+ }
859
+ const derived = {};
860
+ for (const { field, calc } of derivedFields) {
861
+ const num = sums[calc.numeratorField ?? ""] ?? 0;
862
+ const den = sums[calc.denominatorField ?? ""] ?? 0;
863
+ if (calc.type === "percentChange") {
864
+ derived[field] = den ? (num - den) / den : 0;
865
+ } else if (calc.type === "average") {
866
+ derived[field] = den > 0 ? num / den : 0;
867
+ }
868
+ }
869
+ const result = {};
870
+ for (const [field, config] of Object.entries(fieldConfig)) {
871
+ const { type } = config;
872
+ if (!type || type === "string" || type === "date" || type === "time") {
873
+ result[field] = "";
874
+ } else if (type === "boolean") {
875
+ result[field] = false;
876
+ } else {
877
+ result[field] = 0;
878
+ }
879
+ }
880
+ result[labelField] = label;
881
+ for (const [field, value] of Object.entries(sums)) {
882
+ result[field] = value;
883
+ }
884
+ for (const [field, value] of Object.entries(derived)) {
885
+ result[field] = value;
886
+ }
887
+ return result;
888
+ }
889
+
890
+ // src/reports/dailySalesRefundsVoids.ts
891
+ var FIRST_COLUMN_WIDTH8 = 240;
892
+ var FIELDS12 = {
893
+ description: { type: "string", columnKey: "refundVoidDescription", size: FIRST_COLUMN_WIDTH8 },
894
+ count: { type: "number", columnKey: "refundVoidCount", footerCalculation: { type: "sum" } },
895
+ amount: { type: "money", columnKey: "refundVoidAmount", footerCalculation: { type: "sum" } },
896
+ pctSales: { type: "percent", columnKey: "refundVoidPctSales", footerCalculation: { type: "sum" } }
897
+ };
898
+ var DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS = [
899
+ "count",
900
+ "amount",
901
+ "pctSales"
902
+ ];
903
+ var DAILY_SALES_REFUNDS_VOIDS_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS;
904
+ var dailySalesRefundsVoidsConfig = {
905
+ fields: FIELDS12,
906
+ availableColumns: DAILY_SALES_REFUNDS_VOIDS_AVAILABLE_COLUMNS,
907
+ defaultVisibleColumns: DAILY_SALES_REFUNDS_VOIDS_DEFAULT_VISIBLE_COLUMNS
908
+ };
909
+
910
+ // src/reports/dailySalesTaxes.ts
911
+ var FIRST_COLUMN_WIDTH9 = 240;
912
+ var FIELDS13 = {
913
+ taxName: { type: "string", columnKey: "taxName", size: FIRST_COLUMN_WIDTH9 },
914
+ taxableSales: { type: "money", columnKey: "taxableSales", footerCalculation: { type: "sum" } },
915
+ taxesAmount: { type: "money", columnKey: "taxCollected", footerCalculation: { type: "sum" } },
916
+ exemptSales: { type: "money", columnKey: "exemptTaxes", footerCalculation: { type: "sum" } }
917
+ };
918
+ var DAILY_SALES_TAXES_AVAILABLE_COLUMNS = [
919
+ "taxableSales",
920
+ "taxesAmount",
921
+ "exemptSales"
922
+ ];
923
+ var DAILY_SALES_TAXES_DEFAULT_VISIBLE_COLUMNS = DAILY_SALES_TAXES_AVAILABLE_COLUMNS;
924
+ var dailySalesTaxesConfig = {
925
+ fields: FIELDS13,
926
+ availableColumns: DAILY_SALES_TAXES_AVAILABLE_COLUMNS,
927
+ defaultVisibleColumns: DAILY_SALES_TAXES_DEFAULT_VISIBLE_COLUMNS
928
+ };
1570
929
  // Annotate the CommonJS export names for ESM import in node:
1571
930
  0 && (module.exports = {
1572
- COLUMN_REGISTRY,
1573
931
  DAILY_SALES_AVAILABLE_COLUMNS,
1574
932
  DAILY_SALES_BY_GROUP_AVAILABLE_COLUMNS,
1575
933
  DAILY_SALES_DEFAULT_VISIBLE_COLUMNS,
@@ -1609,7 +967,7 @@ var salesByItemDetailConfig = {
1609
967
  dailySalesTrendsConfig,
1610
968
  employeeTimecardConfig,
1611
969
  getColumnAlignment,
1612
- getColumnMetadata,
970
+ getReportConfig,
1613
971
  isNumericType,
1614
972
  itemTaxConfig,
1615
973
  modifierMixConfig,