pos-reports 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,2620 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ EXPENSES_TYPES: () => EXPENSES_TYPES,
24
+ PAYMENT_METHODS: () => PAYMENT_METHODS,
25
+ REPORTS_ENTITY_QUERY: () => REPORTS_ENTITY_QUERY,
26
+ REPORTS_GROUPED_RIGHTS: () => REPORTS_GROUPED_RIGHTS,
27
+ REPORT_ENTITY_OPTION_MAPPERS: () => REPORT_ENTITY_OPTION_MAPPERS,
28
+ REPORT_GROUPS: () => REPORT_GROUPS,
29
+ REPORT_LIST: () => REPORT_LIST,
30
+ REPORT_LOCALES: () => REPORT_LOCALES,
31
+ REPORT_RIGHTS: () => REPORT_RIGHTS,
32
+ REPORT_TRANSLATIONS: () => REPORT_TRANSLATIONS,
33
+ STIMULSOFT_EXPORT_MIME_BY_EXTENSION: () => STIMULSOFT_EXPORT_MIME_BY_EXTENSION,
34
+ STIMULSOFT_EXPORT_MIME_BY_FORMAT: () => STIMULSOFT_EXPORT_MIME_BY_FORMAT,
35
+ buildReportMessage: () => buildReportMessage,
36
+ compactReportFilters: () => compactReportFilters,
37
+ extractReportEntityData: () => extractReportEntityData,
38
+ getReportConfig: () => getReportConfig,
39
+ groupedReportEntries: () => groupedReportEntries,
40
+ inferStimulsoftExportMimeType: () => inferStimulsoftExportMimeType,
41
+ inputValuesToReportFilters: () => inputValuesToReportFilters,
42
+ normalizeReportLocale: () => normalizeReportLocale,
43
+ reportEntries: () => reportEntries,
44
+ reportFiltersToInputValues: () => reportFiltersToInputValues,
45
+ reportList: () => REPORT_LIST,
46
+ reportRequiresCurrentUser: () => reportRequiresCurrentUser,
47
+ sanitizeStimulsoftExportFileName: () => sanitizeStimulsoftExportFileName,
48
+ scopeReportFiltersForUser: () => scopeReportFiltersForUser,
49
+ stimulsoftExportDataToBytes: () => stimulsoftExportDataToBytes,
50
+ toReportEntityOptions: () => toReportEntityOptions,
51
+ translateReportKey: () => translateReportKey
52
+ });
53
+ module.exports = __toCommonJS(index_exports);
54
+
55
+ // src/enums.ts
56
+ var REPORTS_ENTITY_QUERY = {
57
+ CUSTOMER: "CUSTOMER",
58
+ USER: "USER",
59
+ CATEGORIES: "CATEGORIES",
60
+ MONETARY_ACCOUNT: "MONETARY_ACCOUNT",
61
+ ITEM: "ITEM",
62
+ MONETARY_ACCOUNTS: "MONETARY_ACCOUNTS",
63
+ USERS: "USERS",
64
+ CUSTOMERS: "CUSTOMERS",
65
+ ITEMS: "ITEMS",
66
+ SPECIFICATIONS: "SPECIFICATIONS",
67
+ BUSINESS_UNITS: "BUSINESS_UNITS",
68
+ TCR_CODES: "TCR_CODES",
69
+ EXT_BUSINESS_UNITS: "EXT_BUSINESS_UNITS",
70
+ EXPENSE_ACCOUNTS: "EXPENSE_ACCOUNTS",
71
+ PAYMENT_METHODS: "PAYMENT_METHODS"
72
+ };
73
+ var PAYMENT_METHODS = {
74
+ CASH: "CASH",
75
+ CARD: "CARD",
76
+ BANK: "BANK",
77
+ OTHER: "OTHER",
78
+ COMBINED: "COMBINED",
79
+ KIND: "KIND",
80
+ IUTE: "IUTE",
81
+ UPAY: "UPAY"
82
+ };
83
+ var EXPENSES_TYPES = {
84
+ EXPENSE: "EXPENSE",
85
+ PURCHASE: "PURCHASE"
86
+ };
87
+
88
+ // src/entity-options.ts
89
+ var DEFAULT_ENTITY_OPTION_MAPPER = {
90
+ labelKeys: ["name"],
91
+ valueKeys: ["id"]
92
+ };
93
+ var REPORT_ENTITY_OPTION_MAPPERS = {
94
+ [REPORTS_ENTITY_QUERY.CUSTOMER]: DEFAULT_ENTITY_OPTION_MAPPER,
95
+ [REPORTS_ENTITY_QUERY.CUSTOMERS]: DEFAULT_ENTITY_OPTION_MAPPER,
96
+ [REPORTS_ENTITY_QUERY.ITEM]: DEFAULT_ENTITY_OPTION_MAPPER,
97
+ [REPORTS_ENTITY_QUERY.ITEMS]: DEFAULT_ENTITY_OPTION_MAPPER,
98
+ [REPORTS_ENTITY_QUERY.CATEGORIES]: DEFAULT_ENTITY_OPTION_MAPPER,
99
+ [REPORTS_ENTITY_QUERY.BUSINESS_UNITS]: DEFAULT_ENTITY_OPTION_MAPPER,
100
+ [REPORTS_ENTITY_QUERY.SPECIFICATIONS]: DEFAULT_ENTITY_OPTION_MAPPER,
101
+ [REPORTS_ENTITY_QUERY.EXPENSE_ACCOUNTS]: DEFAULT_ENTITY_OPTION_MAPPER,
102
+ [REPORTS_ENTITY_QUERY.USER]: {
103
+ labelKeys: ["email"],
104
+ valueKeys: ["id"]
105
+ },
106
+ [REPORTS_ENTITY_QUERY.USERS]: {
107
+ labelKeys: ["email"],
108
+ valueKeys: ["id"]
109
+ },
110
+ [REPORTS_ENTITY_QUERY.MONETARY_ACCOUNT]: {
111
+ dataPath: ["data", "accounts"],
112
+ labelKeys: ["description"],
113
+ valueKeys: ["id"]
114
+ },
115
+ [REPORTS_ENTITY_QUERY.MONETARY_ACCOUNTS]: {
116
+ dataPath: ["data", "accounts"],
117
+ labelKeys: ["description"],
118
+ valueKeys: ["id"]
119
+ },
120
+ [REPORTS_ENTITY_QUERY.EXT_BUSINESS_UNITS]: {
121
+ dataPath: ["data", "businessUnits"],
122
+ labelKeys: ["name"],
123
+ valueKeys: ["businessUnitCode"]
124
+ },
125
+ [REPORTS_ENTITY_QUERY.TCR_CODES]: {
126
+ dataPath: ["data", "tcr"],
127
+ labelKeys: ["tcrCode"],
128
+ valueKeys: ["tcrCode"]
129
+ },
130
+ [REPORTS_ENTITY_QUERY.PAYMENT_METHODS]: {
131
+ labelKeys: [],
132
+ valueKeys: []
133
+ }
134
+ };
135
+ var getMapper = (queryFilter) => (queryFilter ? REPORT_ENTITY_OPTION_MAPPERS[queryFilter] : void 0) ?? DEFAULT_ENTITY_OPTION_MAPPER;
136
+ var firstString = (item, keys) => {
137
+ if (typeof item === "string" && !keys.length) return item;
138
+ if (typeof item === "number" && !keys.length) return String(item);
139
+ if (!item || typeof item !== "object") return void 0;
140
+ const record = item;
141
+ for (const key of keys) {
142
+ const value = record[key];
143
+ if (typeof value === "string" && value.trim()) return value;
144
+ if (typeof value === "number") return String(value);
145
+ }
146
+ return void 0;
147
+ };
148
+ var getValueAtPath = (value, path) => path.reduce((acc, key) => {
149
+ if (!acc || typeof acc !== "object") return void 0;
150
+ return acc[key];
151
+ }, value);
152
+ var extractReportEntityData = (queryFilter, response) => {
153
+ const mapper = getMapper(queryFilter);
154
+ const value = mapper.dataPath ? getValueAtPath(response, mapper.dataPath) : response;
155
+ return Array.isArray(value) ? value : [];
156
+ };
157
+ var toReportEntityOptions = (queryFilter, data = []) => {
158
+ if (queryFilter === REPORTS_ENTITY_QUERY.PAYMENT_METHODS && !data.length) {
159
+ return Object.values(PAYMENT_METHODS).map((method) => ({
160
+ label: method,
161
+ value: method
162
+ }));
163
+ }
164
+ const mapper = getMapper(queryFilter);
165
+ return data.map((item) => {
166
+ const value = firstString(item, mapper.valueKeys);
167
+ if (!value) return null;
168
+ return {
169
+ label: firstString(item, mapper.labelKeys) || value,
170
+ value
171
+ };
172
+ }).filter((item) => Boolean(item));
173
+ };
174
+
175
+ // src/groups.ts
176
+ var REPORT_GROUPS = {
177
+ bankGroup: { label: "bankGroup" },
178
+ cashGroup: { label: "cashGroup" },
179
+ customersGroup: { label: "customersGroup" },
180
+ expensesGroup: { label: "expensesGroup" },
181
+ inventoryGroup: { label: "inventoryGroup" },
182
+ invoicesGroup: { label: "invoicesGroup" },
183
+ itemsGroup: { label: "itemsGroup" },
184
+ salesGroup: { label: "salesGroup" },
185
+ usersGroup: { label: "usersGroup" }
186
+ };
187
+
188
+ // src/report-list.ts
189
+ var REPORT_LIST = Object.freeze({
190
+ dailySales: {
191
+ name: "reportDailySales",
192
+ group: "salesGroup",
193
+ requiredRights: ["read-reportDailySales"],
194
+ filters: [
195
+ {
196
+ component: "multiple-types-input",
197
+ name: "day",
198
+ props: {
199
+ label: "day",
200
+ type: "date"
201
+ }
202
+ },
203
+ {
204
+ component: "entity-loader",
205
+ name: "userId",
206
+ props: {
207
+ label: "user",
208
+ loader: "modals/user-report-modal",
209
+ limit: 1,
210
+ queryFilter: REPORTS_ENTITY_QUERY.USER
211
+ }
212
+ }
213
+ ]
214
+ },
215
+ detailedDailySales: {
216
+ name: "reportDetailedDailySales",
217
+ group: "salesGroup",
218
+ requiredRights: ["read-reportDetailedDailySales"],
219
+ filters: [
220
+ {
221
+ component: "multiple-types-input",
222
+ name: "day",
223
+ props: {
224
+ label: "day",
225
+ type: "date"
226
+ }
227
+ },
228
+ {
229
+ component: "entity-loader",
230
+ name: "userId",
231
+ props: {
232
+ label: "user",
233
+ loader: "modals/user-report-modal",
234
+ limit: 1,
235
+ queryFilter: REPORTS_ENTITY_QUERY.USER
236
+ }
237
+ }
238
+ ]
239
+ },
240
+ dailyShopsSales: {
241
+ name: "reportDailyShopsSales",
242
+ group: "salesGroup",
243
+ requiredRights: ["read-reportDailyShopsSales"],
244
+ filters: [
245
+ {
246
+ component: "multiple-types-input",
247
+ name: "day",
248
+ props: {
249
+ label: "day",
250
+ type: "date"
251
+ }
252
+ }
253
+ ]
254
+ },
255
+ salesByCategories: {
256
+ name: "reportSalesByCategories",
257
+ group: "salesGroup",
258
+ requiredRights: ["read-reportSalesByCategories"],
259
+ filters: [
260
+ {
261
+ component: "multiple-types-input",
262
+ name: "fromDate",
263
+ props: {
264
+ label: "from",
265
+ type: "date"
266
+ }
267
+ },
268
+ {
269
+ component: "multiple-types-input",
270
+ name: "toDate",
271
+ props: {
272
+ label: "to",
273
+ type: "date"
274
+ }
275
+ },
276
+ {
277
+ component: "multiple-entity-loader",
278
+ name: "categoryIds",
279
+ props: {
280
+ label: "categories",
281
+ queryFilter: REPORTS_ENTITY_QUERY.CATEGORIES
282
+ }
283
+ },
284
+ {
285
+ component: "multiple-entity-loader",
286
+ name: "businessUnitIds",
287
+ props: {
288
+ label: "businessUnitCodes",
289
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
290
+ }
291
+ },
292
+ {
293
+ component: "options-input",
294
+ name: "currency",
295
+ props: {
296
+ label: "currency",
297
+ values: [
298
+ {
299
+ id: "",
300
+ value: void 0
301
+ },
302
+ {
303
+ id: "ALL",
304
+ value: "allCurrency"
305
+ },
306
+ {
307
+ id: "EUR",
308
+ value: "eur"
309
+ },
310
+ {
311
+ id: "USD",
312
+ value: "usd"
313
+ },
314
+ {
315
+ id: "CAD",
316
+ value: "cad"
317
+ },
318
+ {
319
+ id: "GBP",
320
+ value: "gbp"
321
+ },
322
+ {
323
+ id: "MKD",
324
+ value: "mkd"
325
+ }
326
+ ]
327
+ }
328
+ },
329
+ {
330
+ component: "entity-loader",
331
+ name: "userId",
332
+ props: {
333
+ label: "user",
334
+ loader: "modals/user-report-modal",
335
+ limit: 1,
336
+ queryFilter: REPORTS_ENTITY_QUERY.USER
337
+ }
338
+ }
339
+ ]
340
+ },
341
+ fiscalInvoices: {
342
+ name: "reportFiscalInvoices",
343
+ group: "salesGroup",
344
+ requiredRights: ["read-reportFiscalInvoices"],
345
+ filters: [
346
+ {
347
+ component: "multiple-types-input",
348
+ name: "fromDate",
349
+ props: {
350
+ label: "from",
351
+ type: "date"
352
+ }
353
+ },
354
+ {
355
+ component: "multiple-types-input",
356
+ name: "toDate",
357
+ props: {
358
+ label: "to",
359
+ type: "date"
360
+ }
361
+ },
362
+ {
363
+ component: "options-input",
364
+ name: "currency",
365
+ props: {
366
+ label: "currency",
367
+ values: [
368
+ {
369
+ id: "",
370
+ value: void 0
371
+ },
372
+ {
373
+ id: "ALL",
374
+ value: "allCurrency"
375
+ },
376
+ {
377
+ id: "EUR",
378
+ value: "eur"
379
+ },
380
+ {
381
+ id: "USD",
382
+ value: "usd"
383
+ },
384
+ {
385
+ id: "CAD",
386
+ value: "cad"
387
+ },
388
+ {
389
+ id: "GBP",
390
+ value: "gbp"
391
+ },
392
+ {
393
+ id: "MKD",
394
+ value: "mkd"
395
+ }
396
+ ]
397
+ }
398
+ },
399
+ {
400
+ component: "multiple-entity-loader",
401
+ name: "customerIds",
402
+ props: {
403
+ label: "customers",
404
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
405
+ }
406
+ },
407
+ {
408
+ component: "multiple-entity-loader",
409
+ name: "businessUnit",
410
+ props: {
411
+ label: "businessUnitCodes",
412
+ queryFilter: REPORTS_ENTITY_QUERY.EXT_BUSINESS_UNITS
413
+ }
414
+ },
415
+ {
416
+ component: "multiple-entity-loader",
417
+ name: "tcrCodes",
418
+ props: {
419
+ label: "tcrCodes",
420
+ queryFilter: REPORTS_ENTITY_QUERY.TCR_CODES
421
+ }
422
+ }
423
+ ]
424
+ },
425
+ detailedFiscalInvoices: {
426
+ name: "reportDetailedFiscalInvoices",
427
+ group: "salesGroup",
428
+ requiredRights: ["read-reportDetailedFiscalInvoices"],
429
+ filters: [
430
+ {
431
+ component: "multiple-types-input",
432
+ name: "fromDate",
433
+ props: {
434
+ label: "from",
435
+ type: "date"
436
+ }
437
+ },
438
+ {
439
+ component: "multiple-types-input",
440
+ name: "toDate",
441
+ props: {
442
+ label: "to",
443
+ type: "date"
444
+ }
445
+ },
446
+ {
447
+ component: "options-input",
448
+ name: "currency",
449
+ props: {
450
+ label: "currency",
451
+ values: [
452
+ {
453
+ id: "",
454
+ value: void 0
455
+ },
456
+ {
457
+ id: "ALL",
458
+ value: "allCurrency"
459
+ },
460
+ {
461
+ id: "EUR",
462
+ value: "eur"
463
+ },
464
+ {
465
+ id: "USD",
466
+ value: "usd"
467
+ },
468
+ {
469
+ id: "CAD",
470
+ value: "cad"
471
+ },
472
+ {
473
+ id: "GBP",
474
+ value: "gbp"
475
+ },
476
+ {
477
+ id: "MKD",
478
+ value: "mkd"
479
+ }
480
+ ]
481
+ }
482
+ },
483
+ {
484
+ component: "multiple-entity-loader",
485
+ name: "customerIds",
486
+ props: {
487
+ label: "customers",
488
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
489
+ }
490
+ },
491
+ {
492
+ component: "multiple-entity-loader",
493
+ name: "businessUnit",
494
+ props: {
495
+ label: "businessUnitCodes",
496
+ queryFilter: REPORTS_ENTITY_QUERY.EXT_BUSINESS_UNITS
497
+ }
498
+ },
499
+ {
500
+ component: "multiple-entity-loader",
501
+ name: "tcrCodes",
502
+ props: {
503
+ label: "tcrCodes",
504
+ queryFilter: REPORTS_ENTITY_QUERY.TCR_CODES
505
+ }
506
+ }
507
+ ]
508
+ },
509
+ dailySalesGrouped: {
510
+ name: "reportDailySalesGrouped",
511
+ group: "salesGroup",
512
+ requiredRights: ["read-reportDailySalesGrouped"],
513
+ filters: [
514
+ {
515
+ component: "multiple-types-input",
516
+ name: "fromDate",
517
+ props: {
518
+ label: "from",
519
+ type: "date"
520
+ }
521
+ },
522
+ {
523
+ component: "multiple-types-input",
524
+ name: "toDate",
525
+ props: {
526
+ label: "to",
527
+ type: "date"
528
+ }
529
+ },
530
+ {
531
+ component: "options-input",
532
+ name: "currency",
533
+ props: {
534
+ label: "currency",
535
+ values: [
536
+ {
537
+ id: "",
538
+ value: void 0
539
+ },
540
+ {
541
+ id: "ALL",
542
+ value: "allCurrency"
543
+ },
544
+ {
545
+ id: "EUR",
546
+ value: "eur"
547
+ },
548
+ {
549
+ id: "USD",
550
+ value: "usd"
551
+ },
552
+ {
553
+ id: "CAD",
554
+ value: "cad"
555
+ },
556
+ {
557
+ id: "GBP",
558
+ value: "gbp"
559
+ },
560
+ {
561
+ id: "MKD",
562
+ value: "mkd"
563
+ }
564
+ ]
565
+ }
566
+ }
567
+ ]
568
+ },
569
+ weeklySales: {
570
+ name: "reportWeeklySales",
571
+ group: "salesGroup",
572
+ requiredRights: ["read-reportWeeklySales"],
573
+ filters: [
574
+ {
575
+ component: "multiple-types-input",
576
+ name: "fromDate",
577
+ props: {
578
+ label: "from",
579
+ type: "date"
580
+ }
581
+ },
582
+ {
583
+ component: "multiple-types-input",
584
+ name: "toDate",
585
+ props: {
586
+ label: "to",
587
+ type: "date"
588
+ }
589
+ },
590
+ {
591
+ component: "options-input",
592
+ name: "currency",
593
+ props: {
594
+ label: "currency",
595
+ values: [
596
+ {
597
+ id: "",
598
+ value: void 0
599
+ },
600
+ {
601
+ id: "ALL",
602
+ value: "allCurrency"
603
+ },
604
+ {
605
+ id: "EUR",
606
+ value: "eur"
607
+ },
608
+ {
609
+ id: "USD",
610
+ value: "usd"
611
+ },
612
+ {
613
+ id: "CAD",
614
+ value: "cad"
615
+ },
616
+ {
617
+ id: "GBP",
618
+ value: "gbp"
619
+ },
620
+ {
621
+ id: "MKD",
622
+ value: "mkd"
623
+ }
624
+ ]
625
+ }
626
+ }
627
+ ]
628
+ },
629
+ monthlySales: {
630
+ name: "reportMonthlySales",
631
+ group: "salesGroup",
632
+ requiredRights: ["read-reportMonthlySales"],
633
+ filters: [
634
+ {
635
+ component: "multiple-types-input",
636
+ name: "fromDate",
637
+ props: {
638
+ label: "from",
639
+ type: "date"
640
+ }
641
+ },
642
+ {
643
+ component: "multiple-types-input",
644
+ name: "toDate",
645
+ props: {
646
+ label: "to",
647
+ type: "date"
648
+ }
649
+ },
650
+ {
651
+ component: "options-input",
652
+ name: "currency",
653
+ props: {
654
+ label: "currency",
655
+ values: [
656
+ {
657
+ id: "",
658
+ value: void 0
659
+ },
660
+ {
661
+ id: "ALL",
662
+ value: "allCurrency"
663
+ },
664
+ {
665
+ id: "EUR",
666
+ value: "eur"
667
+ },
668
+ {
669
+ id: "USD",
670
+ value: "usd"
671
+ },
672
+ {
673
+ id: "CAD",
674
+ value: "cad"
675
+ },
676
+ {
677
+ id: "GBP",
678
+ value: "gbp"
679
+ },
680
+ {
681
+ id: "MKD",
682
+ value: "mkd"
683
+ }
684
+ ]
685
+ }
686
+ }
687
+ ]
688
+ },
689
+ itemSalesRecap: {
690
+ name: "reportItemSalesRecap",
691
+ group: "itemsGroup",
692
+ requiredRights: ["read-reportItemSalesRecap"],
693
+ filters: [
694
+ {
695
+ component: "multiple-types-input",
696
+ name: "fromDate",
697
+ props: {
698
+ label: "from",
699
+ type: "date"
700
+ }
701
+ },
702
+ {
703
+ component: "multiple-types-input",
704
+ name: "toDate",
705
+ props: {
706
+ label: "to",
707
+ type: "date"
708
+ }
709
+ },
710
+ // {
711
+ // component: "entity-loader",
712
+ // name: "itemId",
713
+ // props: {
714
+ // label: "itemName",
715
+ // loader: 'modals/item-report-modal',
716
+ // limit: 1,
717
+ // queryFilter: REPORTS_ENTITY_QUERY.ITEM
718
+ // },
719
+ // },
720
+ {
721
+ component: "multiple-entity-loader",
722
+ name: "itemIds",
723
+ props: {
724
+ label: "items",
725
+ limit: 1,
726
+ queryFilter: REPORTS_ENTITY_QUERY.ITEMS
727
+ }
728
+ }
729
+ ]
730
+ },
731
+ itemSalesDetailed: {
732
+ name: "reportSalesByItemsDetailed",
733
+ group: "itemsGroup",
734
+ requiredRights: ["read-reportSalesByItemsDetailed"],
735
+ filters: [
736
+ {
737
+ component: "multiple-types-input",
738
+ name: "fromDate",
739
+ props: {
740
+ label: "from",
741
+ type: "date"
742
+ }
743
+ },
744
+ {
745
+ component: "multiple-types-input",
746
+ name: "toDate",
747
+ props: {
748
+ label: "to",
749
+ type: "date"
750
+ }
751
+ },
752
+ {
753
+ component: "options-input",
754
+ name: "currency",
755
+ props: {
756
+ label: "currency",
757
+ values: [
758
+ {
759
+ id: "",
760
+ value: void 0
761
+ },
762
+ {
763
+ id: "ALL",
764
+ value: "allCurrency"
765
+ },
766
+ {
767
+ id: "EUR",
768
+ value: "eur"
769
+ },
770
+ {
771
+ id: "USD",
772
+ value: "usd"
773
+ },
774
+ {
775
+ id: "CAD",
776
+ value: "cad"
777
+ },
778
+ {
779
+ id: "GBP",
780
+ value: "gbp"
781
+ },
782
+ {
783
+ id: "MKD",
784
+ value: "mkd"
785
+ }
786
+ ]
787
+ }
788
+ },
789
+ {
790
+ component: "multiple-entity-loader",
791
+ name: "itemIds",
792
+ props: {
793
+ label: "items",
794
+ limit: 1,
795
+ queryFilter: REPORTS_ENTITY_QUERY.ITEMS
796
+ }
797
+ },
798
+ {
799
+ component: "multiple-entity-loader",
800
+ name: "customerIds",
801
+ props: {
802
+ label: "customers",
803
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
804
+ }
805
+ },
806
+ {
807
+ component: "multiple-entity-loader",
808
+ name: "businessUnitIds",
809
+ props: {
810
+ label: "businessUnitCodes",
811
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
812
+ }
813
+ }
814
+ ]
815
+ },
816
+ salesByCustomers: {
817
+ name: "reportSalesByCustomer",
818
+ group: "customersGroup",
819
+ requiredRights: ["read-reportSalesByCustomer"],
820
+ filters: [
821
+ {
822
+ component: "multiple-types-input",
823
+ name: "fromDate",
824
+ props: {
825
+ label: "from",
826
+ type: "date"
827
+ }
828
+ },
829
+ {
830
+ component: "multiple-types-input",
831
+ name: "toDate",
832
+ props: {
833
+ label: "to",
834
+ type: "date"
835
+ }
836
+ },
837
+ {
838
+ component: "options-input",
839
+ name: "currency",
840
+ props: {
841
+ label: "currency",
842
+ values: [
843
+ {
844
+ id: "",
845
+ value: void 0
846
+ },
847
+ {
848
+ id: "ALL",
849
+ value: "allCurrency"
850
+ },
851
+ {
852
+ id: "EUR",
853
+ value: "eur"
854
+ },
855
+ {
856
+ id: "USD",
857
+ value: "usd"
858
+ },
859
+ {
860
+ id: "CAD",
861
+ value: "cad"
862
+ },
863
+ {
864
+ id: "GBP",
865
+ value: "gbp"
866
+ },
867
+ {
868
+ id: "MKD",
869
+ value: "mkd"
870
+ }
871
+ ]
872
+ }
873
+ },
874
+ // {
875
+ // component: "entity-loader",
876
+ // name: "customerId",
877
+ // props: {
878
+ // label: "customerName",
879
+ // loader: 'modals/customer-report-modal',
880
+ // limit: 1,
881
+ // queryFilter: REPORTS_ENTITY_QUERY.CUSTOMER
882
+ // },
883
+ // },
884
+ {
885
+ component: "multiple-entity-loader",
886
+ name: "customerIds",
887
+ props: {
888
+ label: "customers",
889
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
890
+ }
891
+ },
892
+ {
893
+ component: "multiple-entity-loader",
894
+ name: "businessUnitIds",
895
+ props: {
896
+ label: "businessUnitCodes",
897
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
898
+ }
899
+ }
900
+ ]
901
+ },
902
+ salesByCustomersDetailed: {
903
+ name: "reportSalesByCustomerDetailed",
904
+ group: "customersGroup",
905
+ requiredRights: ["read-reportSalesByCustomerDetailed"],
906
+ filters: [
907
+ {
908
+ component: "multiple-types-input",
909
+ name: "fromDate",
910
+ props: {
911
+ label: "from",
912
+ type: "date"
913
+ }
914
+ },
915
+ {
916
+ component: "multiple-types-input",
917
+ name: "toDate",
918
+ props: {
919
+ label: "to",
920
+ type: "date"
921
+ }
922
+ },
923
+ {
924
+ component: "options-input",
925
+ name: "currency",
926
+ props: {
927
+ label: "currency",
928
+ values: [
929
+ {
930
+ id: "",
931
+ value: void 0
932
+ },
933
+ {
934
+ id: "ALL",
935
+ value: "allCurrency"
936
+ },
937
+ {
938
+ id: "EUR",
939
+ value: "eur"
940
+ },
941
+ {
942
+ id: "USD",
943
+ value: "usd"
944
+ },
945
+ {
946
+ id: "CAD",
947
+ value: "cad"
948
+ },
949
+ {
950
+ id: "GBP",
951
+ value: "gbp"
952
+ },
953
+ {
954
+ id: "MKD",
955
+ value: "mkd"
956
+ }
957
+ ]
958
+ }
959
+ },
960
+ // {
961
+ // component: "entity-loader",
962
+ // name: "customerId",
963
+ // props: {
964
+ // label: "customerName",
965
+ // loader: 'modals/customer-report-modal',
966
+ // limit: 1,
967
+ // queryFilter: REPORTS_ENTITY_QUERY.CUSTOMER
968
+ // },
969
+ // },
970
+ {
971
+ component: "multiple-entity-loader",
972
+ name: "customerIds",
973
+ props: {
974
+ label: "customers",
975
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
976
+ }
977
+ },
978
+ {
979
+ component: "multiple-entity-loader",
980
+ name: "businessUnitIds",
981
+ props: {
982
+ label: "businessUnitCodes",
983
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
984
+ }
985
+ }
986
+ ]
987
+ },
988
+ itemsWithSpecifications: {
989
+ name: "reportItemsWithSpecifications",
990
+ group: "itemsGroup",
991
+ requiredRights: ["read-reportItemsWithSpecifications"],
992
+ filters: [
993
+ {
994
+ component: "multiple-types-input",
995
+ name: "fromDate",
996
+ props: {
997
+ label: "from",
998
+ type: "date"
999
+ }
1000
+ },
1001
+ {
1002
+ component: "multiple-types-input",
1003
+ name: "toDate",
1004
+ props: {
1005
+ label: "to",
1006
+ type: "date"
1007
+ }
1008
+ },
1009
+ {
1010
+ component: "entity-loader",
1011
+ name: "userId",
1012
+ props: {
1013
+ label: "user",
1014
+ loader: "modals/user-report-modal",
1015
+ limit: 1,
1016
+ queryFilter: REPORTS_ENTITY_QUERY.USER
1017
+ }
1018
+ },
1019
+ {
1020
+ component: "entity-loader",
1021
+ name: "itemId",
1022
+ props: {
1023
+ label: "itemName",
1024
+ loader: "modals/item-report-modal",
1025
+ limit: 1,
1026
+ queryFilter: REPORTS_ENTITY_QUERY.ITEM
1027
+ }
1028
+ },
1029
+ {
1030
+ component: "entity-loader",
1031
+ name: "specName",
1032
+ props: {
1033
+ label: "specName",
1034
+ loader: "modals/specifications-report-modal",
1035
+ limit: 1,
1036
+ queryFilter: REPORTS_ENTITY_QUERY.SPECIFICATIONS
1037
+ }
1038
+ }
1039
+ ]
1040
+ },
1041
+ detailedSales: {
1042
+ name: "reportSalesDetailed",
1043
+ group: "salesGroup",
1044
+ requiredRights: ["read-reportSalesDetailed"],
1045
+ filters: [
1046
+ {
1047
+ component: "multiple-types-input",
1048
+ name: "fromDate",
1049
+ props: {
1050
+ label: "from",
1051
+ type: "date"
1052
+ }
1053
+ },
1054
+ {
1055
+ component: "multiple-types-input",
1056
+ name: "toDate",
1057
+ props: {
1058
+ label: "to",
1059
+ type: "date"
1060
+ }
1061
+ },
1062
+ {
1063
+ component: "options-input",
1064
+ name: "currency",
1065
+ props: {
1066
+ label: "currency",
1067
+ values: [
1068
+ {
1069
+ id: "",
1070
+ value: void 0
1071
+ },
1072
+ {
1073
+ id: "ALL",
1074
+ value: "allCurrency"
1075
+ },
1076
+ {
1077
+ id: "EUR",
1078
+ value: "eur"
1079
+ },
1080
+ {
1081
+ id: "USD",
1082
+ value: "usd"
1083
+ },
1084
+ {
1085
+ id: "CAD",
1086
+ value: "cad"
1087
+ },
1088
+ {
1089
+ id: "GBP",
1090
+ value: "gbp"
1091
+ },
1092
+ {
1093
+ id: "MKD",
1094
+ value: "mkd"
1095
+ }
1096
+ ]
1097
+ }
1098
+ },
1099
+ // {
1100
+ // component: "entity-loader",
1101
+ // name: "customerId",
1102
+ // props: {
1103
+ // label: "customerName",
1104
+ // loader: 'modals/customer-report-modal',
1105
+ // limit: 1,
1106
+ // queryFilter: REPORTS_ENTITY_QUERY.CUSTOMER
1107
+ // },
1108
+ // },
1109
+ {
1110
+ component: "multiple-entity-loader",
1111
+ name: "customerIds",
1112
+ props: {
1113
+ label: "customers",
1114
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
1115
+ }
1116
+ },
1117
+ {
1118
+ component: "multiple-entity-loader",
1119
+ name: "businessUnitIds",
1120
+ props: {
1121
+ label: "businessUnitCodes",
1122
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1123
+ }
1124
+ }
1125
+ ]
1126
+ },
1127
+ // itemStockPerWareHouse: {
1128
+ // name: "reportItemStockPerWareHouse",
1129
+ // group: "inventoryGroup",
1130
+ // requiredRights: ['read-reportItemStockPerWareHouse'],
1131
+ // filters: [
1132
+ // // {
1133
+ // // component: "multiple-types-input",
1134
+ // // name: "fromDate",
1135
+ // // props: {
1136
+ // // label: "from",
1137
+ // // type: 'date'
1138
+ // // }
1139
+ // // },
1140
+ // // {
1141
+ // // component: "multiple-types-input",
1142
+ // // name: "toDate",
1143
+ // // props: {
1144
+ // // label: "to",
1145
+ // // type: 'date'
1146
+ // // }
1147
+ // // },
1148
+ // ]
1149
+ // },
1150
+ // itemStockPerWareHousePerDate: {
1151
+ // name: "reportItemStockPerWareHousePerDate",
1152
+ // group: "inventoryGroup",
1153
+ // requiredRights: ['read-reportItemStockPerWareHouse'],
1154
+ // filters: [
1155
+ // {
1156
+ // component: "multiple-types-input",
1157
+ // name: "day",
1158
+ // props: {
1159
+ // label: "day",
1160
+ // type: 'date'
1161
+ // }
1162
+ // }
1163
+ // // {
1164
+ // // component: "multiple-types-input",
1165
+ // // name: "toDate",
1166
+ // // props: {
1167
+ // // label: "to",
1168
+ // // type: 'date'
1169
+ // // }
1170
+ // // },
1171
+ // ]
1172
+ // },
1173
+ itemStockMovementSummary: {
1174
+ name: "reportItemStock",
1175
+ group: "inventoryGroup",
1176
+ requiredRights: ["read-reportItemStock"],
1177
+ filters: [
1178
+ {
1179
+ component: "multiple-types-input",
1180
+ name: "fromDate",
1181
+ props: {
1182
+ label: "from",
1183
+ type: "date"
1184
+ }
1185
+ },
1186
+ {
1187
+ component: "multiple-types-input",
1188
+ name: "toDate",
1189
+ props: {
1190
+ label: "to",
1191
+ type: "date"
1192
+ }
1193
+ },
1194
+ {
1195
+ component: "multiple-entity-loader",
1196
+ name: "itemIds",
1197
+ props: {
1198
+ label: "items",
1199
+ limit: 1,
1200
+ queryFilter: REPORTS_ENTITY_QUERY.ITEMS
1201
+ }
1202
+ },
1203
+ {
1204
+ component: "multiple-entity-loader",
1205
+ name: "businessUnit",
1206
+ props: {
1207
+ label: "warehouses",
1208
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1209
+ }
1210
+ },
1211
+ {
1212
+ component: "multiple-entity-loader",
1213
+ name: "categoryIds",
1214
+ props: {
1215
+ label: "categories",
1216
+ queryFilter: REPORTS_ENTITY_QUERY.CATEGORIES
1217
+ }
1218
+ }
1219
+ ]
1220
+ },
1221
+ itemStockMovement: {
1222
+ name: "reportItemStockMovement",
1223
+ group: "inventoryGroup",
1224
+ requiredRights: ["read-reportItemStockMovement"],
1225
+ filters: [
1226
+ {
1227
+ component: "multiple-types-input",
1228
+ name: "fromDate",
1229
+ props: {
1230
+ label: "from",
1231
+ type: "date"
1232
+ }
1233
+ },
1234
+ {
1235
+ component: "multiple-types-input",
1236
+ name: "toDate",
1237
+ props: {
1238
+ label: "to",
1239
+ type: "date"
1240
+ }
1241
+ },
1242
+ {
1243
+ component: "entity-loader",
1244
+ name: "itemId",
1245
+ props: {
1246
+ label: "itemName",
1247
+ loader: "modals/item-report-modal",
1248
+ limit: 1,
1249
+ queryFilter: REPORTS_ENTITY_QUERY.ITEM
1250
+ }
1251
+ }
1252
+ ]
1253
+ },
1254
+ detailedInventory: {
1255
+ name: "reportDetailedInventory",
1256
+ group: "inventoryGroup",
1257
+ requiredRights: ["read-reportDetailedInventory"],
1258
+ filters: [
1259
+ {
1260
+ component: "multiple-types-input",
1261
+ name: "fromDate",
1262
+ props: {
1263
+ label: "from",
1264
+ type: "date"
1265
+ }
1266
+ },
1267
+ {
1268
+ component: "multiple-types-input",
1269
+ name: "toDate",
1270
+ props: {
1271
+ label: "to",
1272
+ type: "date"
1273
+ }
1274
+ },
1275
+ {
1276
+ component: "multiple-entity-loader",
1277
+ name: "warehouseIds",
1278
+ props: {
1279
+ label: "warehouses",
1280
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1281
+ }
1282
+ },
1283
+ {
1284
+ component: "options-input",
1285
+ name: "type",
1286
+ props: {
1287
+ label: "type",
1288
+ values: [
1289
+ {
1290
+ id: "",
1291
+ value: void 0
1292
+ },
1293
+ {
1294
+ id: "IN",
1295
+ value: "inStock"
1296
+ },
1297
+ {
1298
+ id: "OUT",
1299
+ value: "outStock"
1300
+ }
1301
+ ]
1302
+ }
1303
+ }
1304
+ ]
1305
+ },
1306
+ stockReportForExport: {
1307
+ name: "reportItemStockExcel",
1308
+ group: "inventoryGroup",
1309
+ requiredRights: ["read-reportItemStockMovement"],
1310
+ filters: [
1311
+ {
1312
+ component: "multiple-types-input",
1313
+ name: "toDate",
1314
+ props: {
1315
+ label: "to",
1316
+ type: "date"
1317
+ }
1318
+ },
1319
+ {
1320
+ component: "multiple-entity-loader",
1321
+ name: "businessUnitIds",
1322
+ props: {
1323
+ label: "businessUnitCodes",
1324
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1325
+ }
1326
+ }
1327
+ ]
1328
+ },
1329
+ expensesRecords: {
1330
+ name: "reportExpensesRecords",
1331
+ group: "expensesGroup",
1332
+ requiredRights: ["read-reportExpensesRecords"],
1333
+ filters: [
1334
+ {
1335
+ component: "multiple-types-input",
1336
+ name: "fromDate",
1337
+ props: {
1338
+ label: "from",
1339
+ type: "date"
1340
+ }
1341
+ },
1342
+ {
1343
+ component: "multiple-types-input",
1344
+ name: "toDate",
1345
+ props: {
1346
+ label: "to",
1347
+ type: "date"
1348
+ }
1349
+ },
1350
+ {
1351
+ component: "multiple-entity-loader",
1352
+ name: "businessUnitIds",
1353
+ props: {
1354
+ label: "businessUnitCodes",
1355
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1356
+ }
1357
+ },
1358
+ {
1359
+ component: "options-input",
1360
+ name: "currency",
1361
+ props: {
1362
+ label: "currency",
1363
+ values: [
1364
+ {
1365
+ id: "",
1366
+ value: void 0
1367
+ },
1368
+ {
1369
+ id: "ALL",
1370
+ value: "allCurrency"
1371
+ },
1372
+ {
1373
+ id: "EUR",
1374
+ value: "eur"
1375
+ },
1376
+ {
1377
+ id: "USD",
1378
+ value: "usd"
1379
+ },
1380
+ {
1381
+ id: "CAD",
1382
+ value: "cad"
1383
+ },
1384
+ {
1385
+ id: "GBP",
1386
+ value: "gbp"
1387
+ },
1388
+ {
1389
+ id: "MKD",
1390
+ value: "mkd"
1391
+ }
1392
+ ]
1393
+ }
1394
+ },
1395
+ {
1396
+ component: "options-input",
1397
+ name: "type",
1398
+ props: {
1399
+ label: "type",
1400
+ values: [
1401
+ {
1402
+ id: "",
1403
+ value: void 0
1404
+ },
1405
+ {
1406
+ id: EXPENSES_TYPES.EXPENSE,
1407
+ value: EXPENSES_TYPES.EXPENSE.toLowerCase()
1408
+ },
1409
+ {
1410
+ id: EXPENSES_TYPES.PURCHASE,
1411
+ value: EXPENSES_TYPES.PURCHASE.toLowerCase()
1412
+ }
1413
+ ]
1414
+ }
1415
+ }
1416
+ ]
1417
+ },
1418
+ detailedExpenses: {
1419
+ name: "reportDetailedExpenses",
1420
+ group: "expensesGroup",
1421
+ requiredRights: ["read-reportDetailedExpenses"],
1422
+ filters: [
1423
+ {
1424
+ component: "multiple-types-input",
1425
+ name: "fromDate",
1426
+ props: {
1427
+ label: "from",
1428
+ type: "date"
1429
+ }
1430
+ },
1431
+ {
1432
+ component: "multiple-types-input",
1433
+ name: "toDate",
1434
+ props: {
1435
+ label: "to",
1436
+ type: "date"
1437
+ }
1438
+ },
1439
+ {
1440
+ component: "multiple-entity-loader",
1441
+ name: "businessUnitIds",
1442
+ props: {
1443
+ label: "businessUnitCodes",
1444
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1445
+ }
1446
+ },
1447
+ {
1448
+ component: "options-input",
1449
+ name: "currency",
1450
+ props: {
1451
+ label: "currency",
1452
+ values: [
1453
+ {
1454
+ id: "",
1455
+ value: void 0
1456
+ },
1457
+ {
1458
+ id: "ALL",
1459
+ value: "allCurrency"
1460
+ },
1461
+ {
1462
+ id: "EUR",
1463
+ value: "eur"
1464
+ },
1465
+ {
1466
+ id: "USD",
1467
+ value: "usd"
1468
+ },
1469
+ {
1470
+ id: "CAD",
1471
+ value: "cad"
1472
+ },
1473
+ {
1474
+ id: "GBP",
1475
+ value: "gbp"
1476
+ },
1477
+ {
1478
+ id: "MKD",
1479
+ value: "mkd"
1480
+ }
1481
+ ]
1482
+ }
1483
+ },
1484
+ {
1485
+ component: "options-input",
1486
+ name: "type",
1487
+ props: {
1488
+ label: "type",
1489
+ values: [
1490
+ {
1491
+ id: "",
1492
+ value: void 0
1493
+ },
1494
+ {
1495
+ id: EXPENSES_TYPES.EXPENSE,
1496
+ value: EXPENSES_TYPES.EXPENSE.toLowerCase()
1497
+ },
1498
+ {
1499
+ id: EXPENSES_TYPES.PURCHASE,
1500
+ value: EXPENSES_TYPES.PURCHASE.toLowerCase()
1501
+ }
1502
+ ]
1503
+ }
1504
+ },
1505
+ {
1506
+ component: "multiple-entity-loader",
1507
+ name: "itemIds",
1508
+ props: {
1509
+ label: "items",
1510
+ queryFilter: REPORTS_ENTITY_QUERY.ITEMS
1511
+ }
1512
+ },
1513
+ {
1514
+ component: "multiple-entity-loader",
1515
+ name: "expenseAccountsIds",
1516
+ props: {
1517
+ label: "expenseAccounts",
1518
+ queryFilter: REPORTS_ENTITY_QUERY.EXPENSE_ACCOUNTS
1519
+ }
1520
+ }
1521
+ ]
1522
+ },
1523
+ paymentRecords: {
1524
+ name: "reportPaymentRecords",
1525
+ group: "invoicesGroup",
1526
+ requiredRights: ["read-reportPaymentRecords"],
1527
+ filters: [
1528
+ {
1529
+ component: "multiple-types-input",
1530
+ name: "fromDate",
1531
+ props: {
1532
+ label: "from",
1533
+ type: "date"
1534
+ }
1535
+ },
1536
+ {
1537
+ component: "multiple-types-input",
1538
+ name: "toDate",
1539
+ props: {
1540
+ label: "to",
1541
+ type: "date"
1542
+ }
1543
+ },
1544
+ {
1545
+ component: "options-input",
1546
+ name: "currency",
1547
+ props: {
1548
+ label: "currency",
1549
+ values: [
1550
+ {
1551
+ id: "",
1552
+ value: void 0
1553
+ },
1554
+ {
1555
+ id: "ALL",
1556
+ value: "allCurrency"
1557
+ },
1558
+ {
1559
+ id: "EUR",
1560
+ value: "eur"
1561
+ },
1562
+ {
1563
+ id: "USD",
1564
+ value: "usd"
1565
+ },
1566
+ {
1567
+ id: "CAD",
1568
+ value: "cad"
1569
+ },
1570
+ {
1571
+ id: "GBP",
1572
+ value: "gbp"
1573
+ },
1574
+ {
1575
+ id: "MKD",
1576
+ value: "mkd"
1577
+ }
1578
+ ]
1579
+ }
1580
+ },
1581
+ {
1582
+ component: "options-input",
1583
+ name: "status",
1584
+ props: {
1585
+ label: "status",
1586
+ values: [
1587
+ {
1588
+ id: "",
1589
+ value: void 0
1590
+ },
1591
+ {
1592
+ id: "UNDERDUE",
1593
+ value: "underdue"
1594
+ },
1595
+ {
1596
+ id: "PAID",
1597
+ value: "paid"
1598
+ },
1599
+ {
1600
+ id: "OVERDUE",
1601
+ value: "overdue"
1602
+ },
1603
+ {
1604
+ id: "UNPAID",
1605
+ value: "unpaid"
1606
+ }
1607
+ ]
1608
+ }
1609
+ },
1610
+ {
1611
+ component: "multiple-entity-loader",
1612
+ name: "customerIds",
1613
+ props: {
1614
+ label: "customers",
1615
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
1616
+ }
1617
+ },
1618
+ {
1619
+ component: "multiple-entity-loader",
1620
+ name: "businessUnitIds",
1621
+ props: {
1622
+ label: "businessUnitCodes",
1623
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1624
+ }
1625
+ }
1626
+ ]
1627
+ },
1628
+ paymentRecordsDetailed: {
1629
+ name: "reportPaymentRecordsDetailed",
1630
+ group: "invoicesGroup",
1631
+ requiredRights: ["read-reportPaymentRecordsDetailed"],
1632
+ filters: [
1633
+ {
1634
+ component: "multiple-types-input",
1635
+ name: "fromDate",
1636
+ props: {
1637
+ label: "from",
1638
+ type: "date"
1639
+ }
1640
+ },
1641
+ {
1642
+ component: "multiple-types-input",
1643
+ name: "toDate",
1644
+ props: {
1645
+ label: "to",
1646
+ type: "date"
1647
+ }
1648
+ },
1649
+ {
1650
+ component: "multiple-types-input",
1651
+ name: "orderNo",
1652
+ props: {
1653
+ label: "docNo",
1654
+ type: "text"
1655
+ }
1656
+ },
1657
+ {
1658
+ component: "multiple-entity-loader",
1659
+ name: "customerIds",
1660
+ props: {
1661
+ label: "customers",
1662
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
1663
+ }
1664
+ },
1665
+ {
1666
+ component: "multiple-entity-loader",
1667
+ name: "businessUnitIds",
1668
+ props: {
1669
+ label: "businessUnitCodes",
1670
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1671
+ }
1672
+ }
1673
+ ]
1674
+ },
1675
+ cashRecords: {
1676
+ name: "reportCashRecords",
1677
+ group: "cashGroup",
1678
+ requiredRights: ["read-reportCashRecords"],
1679
+ filters: [
1680
+ {
1681
+ component: "multiple-types-input",
1682
+ name: "fromDate",
1683
+ props: {
1684
+ label: "from",
1685
+ type: "date"
1686
+ }
1687
+ },
1688
+ {
1689
+ component: "multiple-types-input",
1690
+ name: "toDate",
1691
+ props: {
1692
+ label: "to",
1693
+ type: "date"
1694
+ }
1695
+ },
1696
+ {
1697
+ component: "options-input",
1698
+ name: "currency",
1699
+ props: {
1700
+ label: "currency",
1701
+ values: [
1702
+ {
1703
+ id: "",
1704
+ value: void 0
1705
+ },
1706
+ {
1707
+ id: "ALL",
1708
+ value: "allCurrency"
1709
+ },
1710
+ {
1711
+ id: "EUR",
1712
+ value: "eur"
1713
+ },
1714
+ {
1715
+ id: "USD",
1716
+ value: "usd"
1717
+ },
1718
+ {
1719
+ id: "CAD",
1720
+ value: "cad"
1721
+ },
1722
+ {
1723
+ id: "GBP",
1724
+ value: "gbp"
1725
+ },
1726
+ {
1727
+ id: "MKD",
1728
+ value: "mkd"
1729
+ }
1730
+ ]
1731
+ }
1732
+ },
1733
+ {
1734
+ component: "options-input",
1735
+ name: "type",
1736
+ props: {
1737
+ label: "type",
1738
+ values: [
1739
+ {
1740
+ id: "",
1741
+ value: void 0
1742
+ },
1743
+ {
1744
+ id: "DEPOSIT",
1745
+ value: "deposit"
1746
+ },
1747
+ {
1748
+ id: "PAYMENT",
1749
+ value: "payment"
1750
+ }
1751
+ ]
1752
+ }
1753
+ },
1754
+ {
1755
+ component: "multiple-entity-loader",
1756
+ name: "businessUnitIds",
1757
+ props: {
1758
+ label: "businessUnitCodes",
1759
+ queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1760
+ }
1761
+ }
1762
+ ]
1763
+ },
1764
+ bankRecords: {
1765
+ name: "reportBankRecords",
1766
+ group: "bankGroup",
1767
+ requiredRights: ["read-reportBankRecords"],
1768
+ filters: [
1769
+ {
1770
+ component: "multiple-types-input",
1771
+ name: "fromDate",
1772
+ props: {
1773
+ label: "from",
1774
+ type: "date"
1775
+ }
1776
+ },
1777
+ {
1778
+ component: "multiple-types-input",
1779
+ name: "toDate",
1780
+ props: {
1781
+ label: "to",
1782
+ type: "date"
1783
+ }
1784
+ },
1785
+ {
1786
+ component: "entity-loader",
1787
+ name: "monetaryAccount",
1788
+ props: {
1789
+ label: "monetaryAccounts",
1790
+ limit: 1,
1791
+ queryFilter: REPORTS_ENTITY_QUERY.MONETARY_ACCOUNTS
1792
+ }
1793
+ },
1794
+ {
1795
+ component: "options-input",
1796
+ name: "type",
1797
+ props: {
1798
+ label: "type",
1799
+ values: [
1800
+ {
1801
+ id: "",
1802
+ value: void 0
1803
+ },
1804
+ {
1805
+ id: "DEPOSIT",
1806
+ value: "bankDeposit"
1807
+ },
1808
+ {
1809
+ id: "WITHDRAWAL",
1810
+ value: "withdrawal"
1811
+ }
1812
+ ]
1813
+ }
1814
+ }
1815
+ ]
1816
+ },
1817
+ detailedSalesByUser: {
1818
+ name: "reportSalesDetailedByUser",
1819
+ group: "usersGroup",
1820
+ requiredRights: ["read-reportSalesDetailedByUser"],
1821
+ filters: [
1822
+ {
1823
+ component: "multiple-types-input",
1824
+ name: "fromDate",
1825
+ props: {
1826
+ label: "from",
1827
+ type: "date"
1828
+ }
1829
+ },
1830
+ {
1831
+ component: "multiple-types-input",
1832
+ name: "toDate",
1833
+ props: {
1834
+ label: "to",
1835
+ type: "date"
1836
+ }
1837
+ },
1838
+ {
1839
+ component: "options-input",
1840
+ name: "currency",
1841
+ props: {
1842
+ label: "currency",
1843
+ values: [
1844
+ {
1845
+ id: "",
1846
+ value: void 0
1847
+ },
1848
+ {
1849
+ id: "ALL",
1850
+ value: "allCurrency"
1851
+ },
1852
+ {
1853
+ id: "EUR",
1854
+ value: "eur"
1855
+ },
1856
+ {
1857
+ id: "USD",
1858
+ value: "usd"
1859
+ },
1860
+ {
1861
+ id: "CAD",
1862
+ value: "cad"
1863
+ },
1864
+ {
1865
+ id: "GBP",
1866
+ value: "gbp"
1867
+ },
1868
+ {
1869
+ id: "MKD",
1870
+ value: "mkd"
1871
+ }
1872
+ ]
1873
+ }
1874
+ },
1875
+ // {
1876
+ // component: "entity-loader",
1877
+ // name: "userId",
1878
+ // props: {
1879
+ // label: "user",
1880
+ // loader: 'modals/user-report-modal',
1881
+ // limit: 1,
1882
+ // queryFilter: REPORTS_ENTITY_QUERY.USER
1883
+ // },
1884
+ // },
1885
+ // {
1886
+ // component: "multiple-entity-loader",
1887
+ // name: "userIds",
1888
+ // props: {
1889
+ // label: "users",
1890
+ // queryFilter: REPORTS_ENTITY_QUERY.USERS
1891
+ // },
1892
+ // },
1893
+ {
1894
+ component: "entity-loader",
1895
+ name: "userId",
1896
+ props: {
1897
+ label: "user",
1898
+ limit: 1,
1899
+ queryFilter: REPORTS_ENTITY_QUERY.USER
1900
+ }
1901
+ }
1902
+ ]
1903
+ },
1904
+ currentUserDailySales: {
1905
+ name: "reportCurrentUserDailySales",
1906
+ group: "usersGroup",
1907
+ requiredRights: ["read-reportCurrentUserDailySales"],
1908
+ filters: [
1909
+ {
1910
+ component: "multiple-types-input",
1911
+ name: "day",
1912
+ props: {
1913
+ label: "day",
1914
+ type: "date"
1915
+ }
1916
+ }
1917
+ ]
1918
+ },
1919
+ clientDebt: {
1920
+ name: "reportClientDebt",
1921
+ group: "customersGroup",
1922
+ requiredRights: ["read-reportClientDebt"],
1923
+ filters: [
1924
+ {
1925
+ component: "multiple-types-input",
1926
+ name: "fromDate",
1927
+ props: {
1928
+ label: "from",
1929
+ type: "date"
1930
+ }
1931
+ },
1932
+ {
1933
+ component: "multiple-types-input",
1934
+ name: "toDate",
1935
+ props: {
1936
+ label: "to",
1937
+ type: "date"
1938
+ }
1939
+ },
1940
+ {
1941
+ component: "entity-loader",
1942
+ name: "customerId",
1943
+ props: {
1944
+ label: "customerName",
1945
+ loader: "modals/customer-report-modal",
1946
+ limit: 1,
1947
+ queryFilter: REPORTS_ENTITY_QUERY.CUSTOMER
1948
+ }
1949
+ }
1950
+ // {
1951
+ // component: "options-input",
1952
+ // name: "currency",
1953
+ // props: {
1954
+ // label: "currency",
1955
+ // values: [{
1956
+ // id: '',
1957
+ // value: undefined
1958
+ // },
1959
+ // {
1960
+ // id: "ALL",
1961
+ // value: "allCurrency"
1962
+ // },
1963
+ // {
1964
+ // id: "EUR",
1965
+ // value: "eur"
1966
+ // },
1967
+ // {
1968
+ // id: "USD",
1969
+ // value: "usd"
1970
+ // },
1971
+ // {
1972
+ // id: "CAD",
1973
+ // value: "ca"
1974
+ // },
1975
+ // {
1976
+ // id: "GBP",
1977
+ // value: "gbp"
1978
+ // },
1979
+ // {
1980
+ // id: "MKD",
1981
+ // value: "mkd"
1982
+ // },
1983
+ // }
1984
+ // },
1985
+ // {
1986
+ // component: "multiple-entity-loader",
1987
+ // name: "customerIds",
1988
+ // props: {
1989
+ // label: "customers",
1990
+ // queryFilter: REPORTS_ENTITY_QUERY.CUSTOMERS
1991
+ // },
1992
+ // },
1993
+ // {
1994
+ // component: "multiple-entity-loader",
1995
+ // name: "businessUnitIds",
1996
+ // props: {
1997
+ // label: "businessUnitCodes",
1998
+ // queryFilter: REPORTS_ENTITY_QUERY.BUSINESS_UNITS
1999
+ // },
2000
+ // },
2001
+ ]
2002
+ },
2003
+ salesByPaymentMethod: {
2004
+ name: "reportSalesByPaymentMethods",
2005
+ group: "salesGroup",
2006
+ requiredRights: ["read-reportDailySales"],
2007
+ filters: [
2008
+ {
2009
+ component: "multiple-types-input",
2010
+ name: "fromDate",
2011
+ props: {
2012
+ label: "from",
2013
+ type: "date"
2014
+ }
2015
+ },
2016
+ {
2017
+ component: "multiple-types-input",
2018
+ name: "toDate",
2019
+ props: {
2020
+ label: "to",
2021
+ type: "date"
2022
+ }
2023
+ },
2024
+ {
2025
+ component: "options-input",
2026
+ name: "paymentMethod",
2027
+ props: {
2028
+ label: "paymentMethods",
2029
+ values: [
2030
+ {
2031
+ id: "",
2032
+ value: void 0
2033
+ },
2034
+ ...Object.values(PAYMENT_METHODS).map((method) => ({
2035
+ id: method,
2036
+ value: method.toLowerCase()
2037
+ }))
2038
+ ]
2039
+ }
2040
+ },
2041
+ {
2042
+ component: "options-input",
2043
+ name: "currency",
2044
+ props: {
2045
+ label: "currency",
2046
+ values: [
2047
+ {
2048
+ id: "",
2049
+ value: void 0
2050
+ },
2051
+ {
2052
+ id: "ALL",
2053
+ value: "allCurrency"
2054
+ },
2055
+ {
2056
+ id: "EUR",
2057
+ value: "eur"
2058
+ },
2059
+ {
2060
+ id: "USD",
2061
+ value: "usd"
2062
+ },
2063
+ {
2064
+ id: "CAD",
2065
+ value: "cad"
2066
+ },
2067
+ {
2068
+ id: "GBP",
2069
+ value: "gbp"
2070
+ },
2071
+ {
2072
+ id: "MKD",
2073
+ value: "mkd"
2074
+ }
2075
+ ]
2076
+ }
2077
+ }
2078
+ ]
2079
+ }
2080
+ // itemsAuditReport: {
2081
+ // name: "reportItemsAudit",
2082
+ // group: "itemsGroup",
2083
+ // requiredRights: ['read-reportItemsAudit'],
2084
+ // filters: [
2085
+ // {
2086
+ // component: "options-input",
2087
+ // name: "operationType",
2088
+ // props: {
2089
+ // label: "Operation",
2090
+ // values: [{
2091
+ // id: '',
2092
+ // value: undefined
2093
+ // },
2094
+ // {
2095
+ // id: "CREATE",
2096
+ // value: "Created"
2097
+ // },
2098
+ // {
2099
+ // id: "UPDATE",
2100
+ // value: "Updated"
2101
+ // },
2102
+ // ],
2103
+ // }
2104
+ // },
2105
+ // {
2106
+ // component: "entity-loader",
2107
+ // name: "itemId",
2108
+ // props: {
2109
+ // label: "Item",
2110
+ // loader: 'modals/item-report-modal',
2111
+ // limit: 1,
2112
+ // queryFilter: REPORTS_ENTITY_QUERY.ITEM
2113
+ // },
2114
+ // },
2115
+ // {
2116
+ // component: "multiple-types-input",
2117
+ // name: "fromDate",
2118
+ // props: {
2119
+ // label: "From",
2120
+ // type: 'date'
2121
+ // }
2122
+ // },
2123
+ // {
2124
+ // component: "multiple-types-input",
2125
+ // name: "toDate",
2126
+ // props: {
2127
+ // label: "To",
2128
+ // type: 'date'
2129
+ // }
2130
+ // }
2131
+ // ]
2132
+ // },
2133
+ });
2134
+
2135
+ // src/helpers.ts
2136
+ var reportEntries = Object.entries(REPORT_LIST).map(
2137
+ ([id, config]) => ({
2138
+ id,
2139
+ config
2140
+ })
2141
+ );
2142
+ var REPORT_RIGHTS = reportEntries.flatMap(
2143
+ (entry) => entry.config.requiredRights
2144
+ );
2145
+ var REPORTS_GROUPED_RIGHTS = Object.freeze(
2146
+ reportEntries.reduce(
2147
+ (acc, entry) => {
2148
+ acc[entry.id] = [`read-${entry.config.name}`];
2149
+ return acc;
2150
+ },
2151
+ {}
2152
+ )
2153
+ );
2154
+ var groupedReportEntries = reportEntries.reduce((acc, entry) => {
2155
+ const group = entry.config.group;
2156
+ acc[group] = acc[group] || [];
2157
+ acc[group].push(entry);
2158
+ return acc;
2159
+ }, {});
2160
+ var reportRequiresCurrentUser = (reportId) => ["dailyShopsSales", "currentUserDailySales", "cashRecords"].includes(
2161
+ reportId
2162
+ );
2163
+ var compactReportFilters = (filters = {}) => Object.entries(filters).reduce((acc, [key, value]) => {
2164
+ if (value === void 0 || value === "" || Number.isNaN(value)) return acc;
2165
+ acc[key] = value;
2166
+ return acc;
2167
+ }, {});
2168
+ var reportFiltersToInputValues = (report, filters = {}) => report?.filters?.reduce((acc, filter) => {
2169
+ const value = filters[filter.name];
2170
+ acc[filter.name] = filter.component === "multiple-entity-loader" && typeof value === "string" ? value.split(",").filter(Boolean) : value ?? null;
2171
+ return acc;
2172
+ }, {}) || {};
2173
+ var inputValuesToReportFilters = (report, values = {}) => report?.filters?.reduce((acc, filter) => {
2174
+ const value = values[filter.name];
2175
+ if (value === void 0 || value === null || value === "" || Array.isArray(value) && !value.length) {
2176
+ return acc;
2177
+ }
2178
+ acc[filter.name] = Array.isArray(value) ? value.join(",") : value;
2179
+ return acc;
2180
+ }, {}) || {};
2181
+ var scopeReportFiltersForUser = (filters = {}, {
2182
+ isAdmin,
2183
+ userId
2184
+ }) => {
2185
+ const hasTouchedFilters = Object.keys(filters).length > 0;
2186
+ const compactedFilters = compactReportFilters(filters);
2187
+ if (!isAdmin && userId && hasTouchedFilters) {
2188
+ return {
2189
+ ...compactedFilters,
2190
+ userId
2191
+ };
2192
+ }
2193
+ return compactedFilters;
2194
+ };
2195
+ var buildReportMessage = ({
2196
+ authToken,
2197
+ filters,
2198
+ language,
2199
+ reportId,
2200
+ shopId,
2201
+ userId
2202
+ }) => {
2203
+ const messageFilters = {
2204
+ authToken,
2205
+ shopId,
2206
+ reportId,
2207
+ language,
2208
+ ...compactReportFilters(filters)
2209
+ };
2210
+ if (reportRequiresCurrentUser(reportId) && userId) {
2211
+ messageFilters.userId = userId;
2212
+ }
2213
+ return {
2214
+ type: "FILTER",
2215
+ message: messageFilters
2216
+ };
2217
+ };
2218
+ var getReportConfig = (reportId) => REPORT_LIST[reportId];
2219
+
2220
+ // src/stimulsoft-export.ts
2221
+ var STIMULSOFT_EXPORT_MIME_BY_EXTENSION = {
2222
+ csv: "text/csv",
2223
+ doc: "application/msword",
2224
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2225
+ html: "text/html",
2226
+ htm: "text/html",
2227
+ jpg: "image/jpeg",
2228
+ jpeg: "image/jpeg",
2229
+ mdc: "application/octet-stream",
2230
+ ods: "application/vnd.oasis.opendocument.spreadsheet",
2231
+ odt: "application/vnd.oasis.opendocument.text",
2232
+ pdf: "application/pdf",
2233
+ png: "image/png",
2234
+ ppt: "application/vnd.ms-powerpoint",
2235
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
2236
+ rtf: "application/rtf",
2237
+ svg: "image/svg+xml",
2238
+ txt: "text/plain",
2239
+ xls: "application/vnd.ms-excel",
2240
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2241
+ xml: "application/xml"
2242
+ };
2243
+ var STIMULSOFT_EXPORT_MIME_BY_FORMAT = {
2244
+ csv: "text/csv",
2245
+ document: "application/octet-stream",
2246
+ excel2007: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2247
+ html: "text/html",
2248
+ html5: "text/html",
2249
+ imagesvg: "image/svg+xml",
2250
+ ods: "application/vnd.oasis.opendocument.spreadsheet",
2251
+ odt: "application/vnd.oasis.opendocument.text",
2252
+ pdf: "application/pdf",
2253
+ ppt2007: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
2254
+ text: "text/plain",
2255
+ word2007: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
2256
+ };
2257
+ var sanitizeStimulsoftExportFileName = (fileName) => {
2258
+ const cleanName = fileName?.trim().replace(/[\\/:*?"<>|]/g, "-");
2259
+ return cleanName || "report";
2260
+ };
2261
+ var stimulsoftExportDataToBytes = (data) => {
2262
+ if (data instanceof Uint8Array) return data;
2263
+ if (typeof data === "string") {
2264
+ return Uint8Array.from(data, (char) => char.charCodeAt(0) & 255);
2265
+ }
2266
+ if (Array.isArray(data)) return Uint8Array.from(data);
2267
+ return Uint8Array.from(Object.values(data));
2268
+ };
2269
+ var extensionFromFileName = (fileName) => fileName?.toLowerCase().match(/\.([a-z0-9]+)$/)?.[1];
2270
+ var normalizeFormat = (formatName) => formatName?.toLowerCase().replace(/[^a-z0-9]/g, "");
2271
+ var inferStimulsoftExportMimeType = ({
2272
+ fileName,
2273
+ formatName,
2274
+ mimeType
2275
+ }) => {
2276
+ if (mimeType && mimeType !== "application/octet-stream") return mimeType;
2277
+ const extension = extensionFromFileName(fileName);
2278
+ if (extension && extension in STIMULSOFT_EXPORT_MIME_BY_EXTENSION) {
2279
+ return STIMULSOFT_EXPORT_MIME_BY_EXTENSION[extension];
2280
+ }
2281
+ const format = normalizeFormat(formatName);
2282
+ if (format && format in STIMULSOFT_EXPORT_MIME_BY_FORMAT) {
2283
+ return STIMULSOFT_EXPORT_MIME_BY_FORMAT[format];
2284
+ }
2285
+ return "application/octet-stream";
2286
+ };
2287
+
2288
+ // src/translations.ts
2289
+ var REPORT_LOCALES = ["al", "en", "it"];
2290
+ var REPORT_TRANSLATIONS = {
2291
+ al: {
2292
+ allCurrency: "ALL",
2293
+ bank: "Bank\xEB",
2294
+ bankDeposit: "Derdhje",
2295
+ bankGroup: "Banka",
2296
+ businessUnitCodes: "Njesite e biznesit",
2297
+ cad: "CAD",
2298
+ card: "Kart\xEB",
2299
+ cash: "Ark\xEB",
2300
+ cashGroup: "Arka",
2301
+ categories: "Kategorit\xEB",
2302
+ clear: "Pastro",
2303
+ clearFilters: "Pastro filtrat",
2304
+ combined: "E kombinuar",
2305
+ currency: "Monedha",
2306
+ customerName: "Emri i klientit",
2307
+ customers: "Subjekte",
2308
+ customersGroup: "Subjektet",
2309
+ day: "Data",
2310
+ deposit: "Ark\xEBtim",
2311
+ docNo: "Nr i Dokumentit",
2312
+ eur: "EUR",
2313
+ expense: "Shpenzime",
2314
+ expenseAccounts: "Llogari shpenzimesh",
2315
+ expensesGroup: "Blerjet & shpenzimet",
2316
+ filter: "Filtro",
2317
+ filters: "Filtrat",
2318
+ from: "Nga",
2319
+ gbp: "GBP",
2320
+ inStock: "Hyrje",
2321
+ inventoryGroup: "Magazina",
2322
+ invoicesGroup: "Faturat",
2323
+ itemName: "Emri i artikullit",
2324
+ items: "Artikujt",
2325
+ itemsGroup: "Artikujt",
2326
+ iute: "Iute",
2327
+ kind: "Klering",
2328
+ mkd: "MKD",
2329
+ monetaryAccounts: "Llogarit\xEB monetare",
2330
+ open: "Hap",
2331
+ other: "TJERA",
2332
+ outStock: "Dalje",
2333
+ overdue: "Mbi paguar",
2334
+ paid: "Paguar",
2335
+ payment: "Pagesa",
2336
+ paymentMethods: "Metoda e pages\xEBs",
2337
+ purchase: "Blerje",
2338
+ reportBankRecords: "Dokumentet e bank\xEBs",
2339
+ reportCashRecords: "Dokumentet e ark\xEBs",
2340
+ reportClientDebt: "Detyrimi i klientit",
2341
+ reportCurrentUserDailySales: "Shitjet ditore t\xEB p\xEBrdoruesit",
2342
+ reportDailySales: "Shitje ditore",
2343
+ reportDailySalesGrouped: "Xhiro ditore",
2344
+ reportDailyShopsSales: "Shitjet ditore p\xEBr dyqanet",
2345
+ reportDetailedDailySales: "Shitjet ditore t\xEB detajuara",
2346
+ reportDetailedExpenses: "Detaje blerjesh & shpenzimesh",
2347
+ reportDetailedFiscalInvoices: "Detaje t\xEB faturave t\xEB fiskalizuara",
2348
+ reportDetailedInventory: "Detaje inventari",
2349
+ reportExpensesRecords: "Permbledhje e blerjeve & shpenzimeve",
2350
+ reportFiscalInvoices: "Faturat e fiskalizuara",
2351
+ reportItemSalesRecap: "Permbledhje e artikujve te shitur",
2352
+ reportItemStock: "Gjendja e artikujve",
2353
+ reportItemStockExcel: "Inventar (excel)",
2354
+ reportItemStockMovement: "L\xEBvizjet e artikujve",
2355
+ reportItemsWithSpecifications: "Shitje artikujsh me specifikime",
2356
+ reportMonthlySales: "Xhiro mujore",
2357
+ reportPaymentRecords: "Statusi i pages\xEBs s\xEB faturave",
2358
+ reportPaymentRecordsDetailed: "Detaje pagesash p\xEBr faturat",
2359
+ reports: "Raportet",
2360
+ reportSalesByCategories: "Shitje sipas kategorive",
2361
+ reportSalesByCustomer: "Shitjet sipas klientit",
2362
+ reportSalesByCustomerDetailed: "Shitjet detajuar sipas klientit",
2363
+ reportSalesByItemsDetailed: "Shitjet detajuar sipas artikullit",
2364
+ reportSalesByPaymentMethods: "Shitjet sipas metodave t\xEB pages\xEBs",
2365
+ reportSalesDetailed: "Detaje shitjesh",
2366
+ reportSalesDetailedByUser: "Detaje shitjesh per perdorues",
2367
+ reportWeeklySales: "Xhiro javore",
2368
+ salesGroup: "Shitjet",
2369
+ search: "K\xEBrko",
2370
+ select: "Zgjidh",
2371
+ selectAReportFromTheList: "Zgjidhni nj\xEB raport nga lista",
2372
+ specName: "Emri i specifik\xEBs",
2373
+ status: "Statusi",
2374
+ tcrCodes: "Tcr",
2375
+ to: "Deri",
2376
+ type: "Lloji",
2377
+ underdue: "Paguar pjes\xEBrisht",
2378
+ unpaid: "E papaguar",
2379
+ upay: "UPay",
2380
+ usd: "USD",
2381
+ user: "P\xEBrdoruesi",
2382
+ usersGroup: "P\xEBrdoruesit",
2383
+ warehouses: "Magazinat",
2384
+ withdrawal: "Terheqje"
2385
+ },
2386
+ en: {
2387
+ allCurrency: "ALL",
2388
+ bank: "Bank",
2389
+ bankDeposit: "Bank deposit",
2390
+ bankGroup: "Bank",
2391
+ businessUnitCodes: "Business Units",
2392
+ cad: "CAD",
2393
+ card: "Card",
2394
+ cash: "Cash",
2395
+ cashGroup: "Cash",
2396
+ categories: "Categories",
2397
+ clear: "Clear",
2398
+ clearFilters: "Clear Filters",
2399
+ combined: "Combined",
2400
+ currency: "Currency",
2401
+ customerName: "Customer name",
2402
+ customers: "Subjects",
2403
+ customersGroup: "Subjects",
2404
+ day: "Date",
2405
+ deposit: "Deposit",
2406
+ docNo: "Document number",
2407
+ eur: "EUR",
2408
+ expense: "Expenses",
2409
+ expenseAccounts: "Expense accounts",
2410
+ expensesGroup: "Expenses & purchases",
2411
+ filter: "Filter",
2412
+ filters: "Filters",
2413
+ from: "From",
2414
+ gbp: "GBP",
2415
+ inStock: "Add",
2416
+ inventoryGroup: "Warehouse",
2417
+ invoicesGroup: "Invoices",
2418
+ itemName: "Item name",
2419
+ items: "Items",
2420
+ itemsGroup: "Items",
2421
+ iute: "Iute",
2422
+ kind: "Clearing",
2423
+ mkd: "MKD",
2424
+ monetaryAccounts: "Monetary Accounts",
2425
+ open: "Open",
2426
+ other: "OTHER",
2427
+ outStock: "Remove",
2428
+ overdue: "Overdue",
2429
+ paid: "Paid",
2430
+ payment: "Payment",
2431
+ paymentMethods: "Payment methods",
2432
+ purchase: "Purchase",
2433
+ reportBankRecords: "Bank Records",
2434
+ reportCashRecords: "Cash Records",
2435
+ reportClientDebt: "Client debt",
2436
+ reportCurrentUserDailySales: "User daily sales",
2437
+ reportDailySales: "Daily Sales",
2438
+ reportDailySalesGrouped: "Daily Sales Turnover",
2439
+ reportDailyShopsSales: "Daily sales of shops",
2440
+ reportDetailedDailySales: "Detailed daily sales",
2441
+ reportDetailedExpenses: "Detailed expenses & purchases",
2442
+ reportDetailedFiscalInvoices: "Detailed fiscal invoices",
2443
+ reportDetailedInventory: "Detailed inventory",
2444
+ reportExpensesRecords: "Expenses & purchases summary",
2445
+ reportFiscalInvoices: "Fiscal Invoices",
2446
+ reportItemSalesRecap: "Item Sales Recap",
2447
+ reportItemStock: "Item Stock",
2448
+ reportItemStockExcel: "Inventory (excel)",
2449
+ reportItemStockMovement: "Item Stock Movement",
2450
+ reportItemsWithSpecifications: "Items sales with specifications",
2451
+ reportMonthlySales: "Monthly Sales",
2452
+ reportPaymentRecords: "Payment status of orders",
2453
+ reportPaymentRecordsDetailed: "Detailed payments of orders",
2454
+ reports: "Reports",
2455
+ reportSalesByCategories: "Sales by categories",
2456
+ reportSalesByCustomer: "Sales by Customer",
2457
+ reportSalesByCustomerDetailed: "Detailed Sales by Customer",
2458
+ reportSalesByItemsDetailed: "Detailed Sales by Item",
2459
+ reportSalesByPaymentMethods: "Sales by payment methods",
2460
+ reportSalesDetailed: "Detailed Sales",
2461
+ reportSalesDetailedByUser: "Detailed Sales by User",
2462
+ reportWeeklySales: "Weekly Sales",
2463
+ salesGroup: "Sales",
2464
+ search: "Search",
2465
+ select: "Select",
2466
+ selectAReportFromTheList: "Select a report from the list",
2467
+ specName: "Specification name",
2468
+ status: "Status",
2469
+ tcrCodes: "Tcr Codes",
2470
+ to: "To",
2471
+ type: "Type",
2472
+ underdue: "Underdue",
2473
+ unpaid: "Unpaid",
2474
+ upay: "Upay",
2475
+ usd: "USD",
2476
+ user: "User",
2477
+ usersGroup: "Users",
2478
+ warehouses: "Warehouses",
2479
+ withdrawal: "Withdrawal"
2480
+ },
2481
+ it: {
2482
+ allCurrency: "TUTTO",
2483
+ bank: "Banca",
2484
+ bankDeposit: "Deposito bancario",
2485
+ bankGroup: "Banca",
2486
+ businessUnitCodes: "Unit\xE0 aziendali",
2487
+ cad: "CAD",
2488
+ card: "Carta",
2489
+ cash: "Contante",
2490
+ cashGroup: "Contanti",
2491
+ categories: "Categorie",
2492
+ clear: "Cancella",
2493
+ clearFilters: "Cancella filtri",
2494
+ combined: "Combinato",
2495
+ currency: "Valuta",
2496
+ customerName: "Nome cliente",
2497
+ customers: "Clienti",
2498
+ customersGroup: "Soggetti",
2499
+ day: "Data",
2500
+ deposit: "Depositare",
2501
+ docNo: "Numero del documento",
2502
+ eur: "EUR",
2503
+ expense: "Spese",
2504
+ expenseAccounts: "Conti spese",
2505
+ expensesGroup: "Spese e acquisti",
2506
+ filter: "Filtra",
2507
+ filters: "Filtri",
2508
+ from: "Da",
2509
+ gbp: "GBP",
2510
+ inStock: "Aggiungi",
2511
+ inventoryGroup: "Magazzino",
2512
+ invoicesGroup: "Fatture",
2513
+ itemName: "Nome articolo",
2514
+ items: "Articoli",
2515
+ itemsGroup: "Articoli",
2516
+ iute: "Iute",
2517
+ kind: "Cancellazione",
2518
+ mkd: "MKD",
2519
+ monetaryAccounts: "Conti monetari",
2520
+ open: "Apri",
2521
+ other: "ALTRO",
2522
+ outStock: "Rimuovi",
2523
+ overdue: "Scaduto",
2524
+ paid: "Pagato",
2525
+ payment: "Pagamento",
2526
+ paymentMethods: "Metodi di pagamento",
2527
+ purchase: "Acquisto",
2528
+ reportBankRecords: "Registrazioni bancarie",
2529
+ reportCashRecords: "Registrazioni contanti",
2530
+ reportClientDebt: "Debito del cliente",
2531
+ reportCurrentUserDailySales: "Vendite giornaliere utente",
2532
+ reportDailySales: "Vendite giornaliere",
2533
+ reportDailySalesGrouped: "Fatturato giornaliero",
2534
+ reportDailyShopsSales: "Vendite giornaliere dei negozi",
2535
+ reportDetailedDailySales: "Vendite giornaliere dettagliate",
2536
+ reportDetailedExpenses: "Spese e acquisti dettagliati",
2537
+ reportDetailedFiscalInvoices: "Fatture fiscali dettagliate",
2538
+ reportDetailedInventory: "Rapporto dettagliato inventario",
2539
+ reportExpensesRecords: "Riepilogo spese e acquisti",
2540
+ reportFiscalInvoices: "Fatture fiscali",
2541
+ reportItemSalesRecap: "Riepilogo vendite articoli",
2542
+ reportItemStock: "Stock di articoli",
2543
+ reportItemStockExcel: "Inventario (excel)",
2544
+ reportItemStockMovement: "Movimento stock articoli",
2545
+ reportItemsWithSpecifications: "Vendite articoli con specifiche",
2546
+ reportMonthlySales: "Vendite mensili",
2547
+ reportPaymentRecords: "Stato dei pagamenti degli ordini",
2548
+ reportPaymentRecordsDetailed: "Pagamenti dettagliati degli ordini",
2549
+ reports: "Rapporti",
2550
+ reportSalesByCategories: "Vendite per categorie",
2551
+ reportSalesByCustomer: "Vendite per cliente",
2552
+ reportSalesByCustomerDetailed: "Vendite dettagliate per cliente",
2553
+ reportSalesByItemsDetailed: "Vendite dettagliate per articolo",
2554
+ reportSalesByPaymentMethods: "Vendite per metodi di pagamento",
2555
+ reportSalesDetailed: "Vendite dettagliate",
2556
+ reportSalesDetailedByUser: "Vendite dettagliate per utente",
2557
+ reportWeeklySales: "Vendite settimanali",
2558
+ salesGroup: "Vendite",
2559
+ search: "Cerca",
2560
+ select: "Seleziona",
2561
+ selectAReportFromTheList: "Seleziona un report dall'elenco",
2562
+ specName: "Nome specifica",
2563
+ status: "Stato",
2564
+ tcrCodes: "Codici TCR",
2565
+ to: "A",
2566
+ type: "Tipo",
2567
+ underdue: "Non ancora dovuto",
2568
+ unpaid: "Non pagato",
2569
+ upay: "UPay",
2570
+ usd: "USD",
2571
+ user: "Utente",
2572
+ usersGroup: "Utenti",
2573
+ warehouses: "Magazzini",
2574
+ withdrawal: "Prelievo"
2575
+ }
2576
+ };
2577
+ var normalizeReportLocale = (locale) => {
2578
+ const normalizedLocale = locale?.split("-")[0]?.toLowerCase();
2579
+ return REPORT_LOCALES.find((reportLocale) => reportLocale === normalizedLocale) ?? "al";
2580
+ };
2581
+ var translateReportKey = (locale, key, fallback = "") => {
2582
+ if (!key) return fallback;
2583
+ const normalizedLocale = normalizeReportLocale(locale);
2584
+ const translations = REPORT_TRANSLATIONS[normalizedLocale];
2585
+ const englishTranslations = REPORT_TRANSLATIONS.en;
2586
+ return translations[key] ?? englishTranslations[key] ?? (fallback || key);
2587
+ };
2588
+ // Annotate the CommonJS export names for ESM import in node:
2589
+ 0 && (module.exports = {
2590
+ EXPENSES_TYPES,
2591
+ PAYMENT_METHODS,
2592
+ REPORTS_ENTITY_QUERY,
2593
+ REPORTS_GROUPED_RIGHTS,
2594
+ REPORT_ENTITY_OPTION_MAPPERS,
2595
+ REPORT_GROUPS,
2596
+ REPORT_LIST,
2597
+ REPORT_LOCALES,
2598
+ REPORT_RIGHTS,
2599
+ REPORT_TRANSLATIONS,
2600
+ STIMULSOFT_EXPORT_MIME_BY_EXTENSION,
2601
+ STIMULSOFT_EXPORT_MIME_BY_FORMAT,
2602
+ buildReportMessage,
2603
+ compactReportFilters,
2604
+ extractReportEntityData,
2605
+ getReportConfig,
2606
+ groupedReportEntries,
2607
+ inferStimulsoftExportMimeType,
2608
+ inputValuesToReportFilters,
2609
+ normalizeReportLocale,
2610
+ reportEntries,
2611
+ reportFiltersToInputValues,
2612
+ reportList,
2613
+ reportRequiresCurrentUser,
2614
+ sanitizeStimulsoftExportFileName,
2615
+ scopeReportFiltersForUser,
2616
+ stimulsoftExportDataToBytes,
2617
+ toReportEntityOptions,
2618
+ translateReportKey
2619
+ });
2620
+ //# sourceMappingURL=index.cjs.map