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