@managesome/eposmatic-toolkit 0.2.212 → 0.2.215
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/lib/constants/ANALYTICS.d.ts +3 -3
- package/lib/constants/ENUMS.d.ts +25 -10
- package/lib/constants/ENUMS.js +47 -25
- package/lib/helpers/order/generate-order.js +25 -1
- package/lib/helpers/store/cart-actions.d.ts +3 -1
- package/lib/helpers/store/cart-actions.js +4 -0
- package/lib/helpers/store/common-order-actions.d.ts +1 -1
- package/lib/helpers/store/common-order-actions.js +10 -2
- package/lib/helpers/utils/index.d.ts +1 -0
- package/lib/helpers/utils/index.js +1 -0
- package/lib/helpers/utils/item-report-helpers.d.ts +1 -0
- package/lib/helpers/utils/item-report-helpers.js +169 -108
- package/lib/helpers/utils/receipt-engine.js +24 -4
- package/lib/helpers/utils/simplified-tenant.d.ts +15 -0
- package/lib/helpers/utils/simplified-tenant.js +30 -0
- package/lib/schemas/models/common-models.d.ts +63 -51
- package/lib/schemas/models/common-models.js +28 -20
- package/lib/schemas/models/customers.d.ts +60 -48
- package/lib/schemas/models/deliveries.d.ts +3 -0
- package/lib/schemas/models/deliveries.js +5 -0
- package/lib/schemas/models/delivery_areas.d.ts +9 -9
- package/lib/schemas/models/discounts.d.ts +270 -216
- package/lib/schemas/models/halfhalf_setup.d.ts +330 -264
- package/lib/schemas/models/item.d.ts +2220 -1776
- package/lib/schemas/models/menu.d.ts +180 -144
- package/lib/schemas/models/modifier_extras.d.ts +90 -72
- package/lib/schemas/models/offers.d.ts +180 -144
- package/lib/schemas/models/order.d.ts +120 -90
- package/lib/schemas/models/order.js +35 -4
- package/lib/schemas/models/public_holidays.d.ts +30 -24
- package/lib/schemas/models/specials.d.ts +540 -432
- package/lib/schemas/models/tenant.d.ts +31 -1
- package/lib/schemas/models/tenant.js +41 -0
- package/lib/schemas/models/tenant_staff.d.ts +180 -144
- package/lib/schemas/models/track_order_number.d.ts +90 -72
- package/lib/schemas/types/deliveries.d.ts +1 -0
- package/lib/schemas/types/order.d.ts +5 -1
- package/lib/schemas/types/tenant.d.ts +11 -1
- package/package.json +1 -1
|
@@ -880,8 +880,9 @@ const getLegacyItemReportHead = ({ monochrome, width, zeroPadding }) => {
|
|
|
880
880
|
<title>Item Sales Report</title>
|
|
881
881
|
</head>`;
|
|
882
882
|
};
|
|
883
|
-
function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersChannel, currency_symbol, from, to, tenantName, menuName, itemNetAmount, count, isFilterApplied, monochrome, }) {
|
|
883
|
+
function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersChannel, currency_symbol, from, to, tenantName, menuName, itemNetAmount, count, isFilterApplied, monochrome, showRevenue, }) {
|
|
884
884
|
// ======================>>>><<<<=====================
|
|
885
|
+
const shouldShowRevenue = showRevenue ?? true;
|
|
885
886
|
let itemSales = '';
|
|
886
887
|
if (itemsChannels != null && itemsChannels.length > 0) {
|
|
887
888
|
let categoryItems = '';
|
|
@@ -889,16 +890,24 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
889
890
|
let items = '';
|
|
890
891
|
for (const item of category.channel) {
|
|
891
892
|
let subItems = '';
|
|
893
|
+
const dealCount = item.subChannels?.reduce((sum, subItem) => sum + (subItem.referenceId != null ? subItem.count : 0), 0) ?? 0;
|
|
894
|
+
const individualCount = Math.max(0, item.count - dealCount);
|
|
895
|
+
const hasDeal = dealCount > 0;
|
|
892
896
|
for (const subItem of item.subChannels) {
|
|
897
|
+
const isReferenced = subItem.referenceId != null;
|
|
898
|
+
const nameStyle = isReferenced ? 'color:#9e9e9e;font-style:italic;' : '';
|
|
899
|
+
const dealBadge = isReferenced
|
|
900
|
+
? '<span style="border:1px solid #f1c24a;color:#f1c24a;border-radius:10px;padding:2px 6px;margin-left:6px;font-size:12px;">Deal Item</span>'
|
|
901
|
+
: '';
|
|
893
902
|
subItems += `<div class="css-1oxswqj-askk">
|
|
894
903
|
<div class="css-1qfrzlclkjs" style="margin-left: ${subItem.level * 30}px;"></div>
|
|
895
904
|
<div class="css-1x9oqjh-askk">
|
|
896
905
|
<div class="css-95rbei-askk">
|
|
897
906
|
<h6 class="css-1kyyrbe-jskk">${subItem.count}</h6>
|
|
898
|
-
<p class="css-1jq5hv-jskk">${subItem.name}</p>
|
|
907
|
+
<p class="css-1jq5hv-jskk" style="${nameStyle}">${subItem.name}${dealBadge}</p>
|
|
899
908
|
</div>
|
|
900
909
|
|
|
901
|
-
${subItem.grossAmount > 0
|
|
910
|
+
${shouldShowRevenue && subItem.grossAmount > 0
|
|
902
911
|
? `<h6 class="css-1z023sx-jskk">${(0, common_1.localeAmount)(currency_symbol, subItem.grossAmount)}</h6>`
|
|
903
912
|
: ''}
|
|
904
913
|
</div>
|
|
@@ -909,10 +918,16 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
909
918
|
<div class="css-95rbei-askk">
|
|
910
919
|
<h6 class="css-zfkluy-jskk">${item.count}</h6>
|
|
911
920
|
<h6 class="css-21997j-jskk">${item.name}</h6>
|
|
921
|
+
${hasDeal
|
|
922
|
+
? `<p class="css-1jq5hv-jskk" style="color:#777">Individual: ${individualCount} • Deal: ${dealCount}</p>`
|
|
923
|
+
: ''}
|
|
912
924
|
</div>
|
|
913
|
-
${item.grossAmount > 0
|
|
925
|
+
${shouldShowRevenue && item.grossAmount > 0
|
|
914
926
|
? `<h6 class="css-1z023sx-jskk">${(0, common_1.localeAmount)(currency_symbol, item.grossAmount)}</h6>`
|
|
915
927
|
: ''}
|
|
928
|
+
${shouldShowRevenue && hasDeal && item.grossAmount > 0
|
|
929
|
+
? `<p class="css-1jq5hv-jskk" style="color:#777">Individual revenue</p>`
|
|
930
|
+
: ''}
|
|
916
931
|
</div>
|
|
917
932
|
${subItems}
|
|
918
933
|
</div>`;
|
|
@@ -922,7 +937,9 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
922
937
|
<div class="css-1s8sakjsakl">
|
|
923
938
|
<div class="css-58t1oz-askk">
|
|
924
939
|
<h6 class="css-10h77yy-jskk">${category.count} ${category.category_name}</h6>
|
|
925
|
-
|
|
940
|
+
${shouldShowRevenue
|
|
941
|
+
? `<h6 class="css-1z023sex-jskk">Total: ${(0, common_1.localeAmount)(currency_symbol, category.grossAmount)}</h6>`
|
|
942
|
+
: ''}
|
|
926
943
|
</div>
|
|
927
944
|
<div class="css-r1d07c-askk">
|
|
928
945
|
${items}
|
|
@@ -948,7 +965,7 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
948
965
|
${channel.name}
|
|
949
966
|
</h6>
|
|
950
967
|
</div>
|
|
951
|
-
${channel.grossAmount > 0
|
|
968
|
+
${shouldShowRevenue && channel.grossAmount > 0
|
|
952
969
|
? `<h6 class="css-1z023sx-jskk">${(0, common_1.localeAmount)(currency_symbol, channel.grossAmount)}</h6>`
|
|
953
970
|
: ''}
|
|
954
971
|
</div>
|
|
@@ -969,13 +986,21 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
969
986
|
};
|
|
970
987
|
let categorySales = '';
|
|
971
988
|
let modifierSales = '';
|
|
989
|
+
const normalizeModifierName = (name) => {
|
|
990
|
+
const parts = name.split(':');
|
|
991
|
+
return (parts[1] ?? parts[0] ?? '').trim();
|
|
992
|
+
};
|
|
972
993
|
if (categoriesChannel != null && categoriesChannel.length > 0) {
|
|
973
994
|
extrasExist = true;
|
|
974
995
|
categorySales += getExtraSales('Trending Categories', categoriesChannel);
|
|
975
996
|
}
|
|
976
997
|
if (modifiersChannel != null && modifiersChannel.length > 0) {
|
|
977
998
|
extrasExist = true;
|
|
978
|
-
|
|
999
|
+
const modifiersDisplay = modifiersChannel.map((channel) => ({
|
|
1000
|
+
...channel,
|
|
1001
|
+
name: normalizeModifierName(channel.name),
|
|
1002
|
+
}));
|
|
1003
|
+
modifierSales += getExtraSales('Trending Modifiers', modifiersDisplay);
|
|
979
1004
|
}
|
|
980
1005
|
return `
|
|
981
1006
|
<div class="cssc-1owvoyj-asbq">
|
|
@@ -999,10 +1024,12 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
999
1024
|
|
|
1000
1025
|
<div class="css-13qsmk5-askk">
|
|
1001
1026
|
<div class="css-pl8gqh-askk">
|
|
1002
|
-
|
|
1027
|
+
${shouldShowRevenue
|
|
1028
|
+
? `<div class="css-1xljckjkls">
|
|
1003
1029
|
<h5 class="css-1mt1wnh-jskk">Total Amount</h5>
|
|
1004
1030
|
<h5 class="css-1ul5w1p-jskk">${(0, common_1.localeAmount)(currency_symbol, itemNetAmount)}</h5>
|
|
1005
|
-
</div
|
|
1031
|
+
</div>`
|
|
1032
|
+
: ''}
|
|
1006
1033
|
<div class="css-1xljckjkls">
|
|
1007
1034
|
<h5 class="css-1mt1wnh-jskk">Total Items Sold</h5>
|
|
1008
1035
|
<h5 class="css-43utj0-jskk">${count}</h5>
|
|
@@ -2108,8 +2135,10 @@ const getNewItemReportHead = ({ zeroPadding, monochrome }) => {
|
|
|
2108
2135
|
<title>Item Sales Report</title>
|
|
2109
2136
|
</head>`;
|
|
2110
2137
|
};
|
|
2111
|
-
function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChannel, currency_symbol, from, to, tenantName, menuName, itemNetAmount, count, itemAmount, itemDiscountAmount, itemGrossAmount, itemGstAmount, gstTitle, isFilterApplied, }) {
|
|
2138
|
+
function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChannel, currency_symbol, from, to, tenantName, menuName, itemNetAmount, count, itemAmount, itemDiscountAmount, itemGrossAmount, itemGstAmount, gstTitle, isFilterApplied, showRevenue, }) {
|
|
2112
2139
|
// ======================>>>><<<<=====================
|
|
2140
|
+
const shouldShowRevenue = showRevenue ?? true;
|
|
2141
|
+
const itemTableColumns = shouldShowRevenue ? 7 : 1;
|
|
2113
2142
|
let itemSales = '';
|
|
2114
2143
|
if (itemsChannels != null && itemsChannels.length > 0) {
|
|
2115
2144
|
let categoryItems = '';
|
|
@@ -2117,16 +2146,24 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2117
2146
|
let items = '';
|
|
2118
2147
|
for (const item of category.channel) {
|
|
2119
2148
|
let subItems = '';
|
|
2149
|
+
const dealCount = item.subChannels?.reduce((sum, subItem) => sum + (subItem.referenceId != null ? subItem.count : 0), 0) ?? 0;
|
|
2150
|
+
const individualCount = Math.max(0, item.count - dealCount);
|
|
2151
|
+
const hasDeal = dealCount > 0;
|
|
2120
2152
|
for (const subItem of item.subChannels) {
|
|
2153
|
+
const isReferenced = subItem.referenceId != null;
|
|
2154
|
+
const nameStyle = isReferenced ? 'color:#9e9e9e;font-style:italic;' : '';
|
|
2155
|
+
const dealBadge = isReferenced
|
|
2156
|
+
? '<span style="border:1px solid #f1c24a;color:#f1c24a;border-radius:10px;padding:2px 6px;margin-left:6px;font-size:12px;">Deal Item</span>'
|
|
2157
|
+
: '';
|
|
2121
2158
|
subItems += `<div class="css-5ax1kt">
|
|
2122
2159
|
<div class="css-1qfrzlc" style="margin-left: ${subItem.level * 30}px"></div>
|
|
2123
2160
|
<div class="css-199tt1z">
|
|
2124
2161
|
<div class="css-lmzl00">
|
|
2125
2162
|
<h6 class="css-1tjle8i">${subItem.count}</h6>
|
|
2126
|
-
<p class="css-1qqbci">${subItem.name}</p>
|
|
2163
|
+
<p class="css-1qqbci" style="${nameStyle}">${subItem.name}${dealBadge}</p>
|
|
2127
2164
|
</div>
|
|
2128
2165
|
|
|
2129
|
-
${subItem.grossAmount
|
|
2166
|
+
${shouldShowRevenue && subItem.grossAmount
|
|
2130
2167
|
? `<h6 class="css-3jfma9" style="color: #000">${(0, common_1.localeAmount)(currency_symbol, subItem.grossAmount)}</h6>`
|
|
2131
2168
|
: ''}
|
|
2132
2169
|
</div>
|
|
@@ -2134,7 +2171,7 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2134
2171
|
}
|
|
2135
2172
|
if (subItems.length > 0) {
|
|
2136
2173
|
subItems = `<tr class="css-1lm8qhw">
|
|
2137
|
-
|
|
2174
|
+
<td class="css-1cw6d7s" colspan="${itemTableColumns}">
|
|
2138
2175
|
<div class="css-j7qwjs">
|
|
2139
2176
|
${subItems}
|
|
2140
2177
|
</div>
|
|
@@ -2150,44 +2187,50 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2150
2187
|
<h6 class="css-21997z">
|
|
2151
2188
|
${item.name}
|
|
2152
2189
|
</h6>
|
|
2190
|
+
${hasDeal
|
|
2191
|
+
? `<p class="css-1qqbci" style="color:#777">Individual: ${individualCount} • Deal: ${dealCount}</p>`
|
|
2192
|
+
: ''}
|
|
2153
2193
|
</div>
|
|
2154
2194
|
</td>
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2195
|
+
${shouldShowRevenue
|
|
2196
|
+
? `<td class="css-5u79pd">
|
|
2197
|
+
<h6 class="css-3jfma9">
|
|
2198
|
+
${(0, common_1.localeAmount)(currency_symbol, item.itemAmount)}
|
|
2199
|
+
</h6>
|
|
2200
|
+
${hasDeal && item.itemAmount ? `<p class="css-1qqbci" style="color:#777">Individual revenue</p>` : ''}
|
|
2159
2201
|
</td>
|
|
2160
2202
|
<td class="css-5u79pd">
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2203
|
+
<h6 class="css-3jfma9">
|
|
2204
|
+
${(0, common_1.localeAmount)(currency_symbol, item.itemGstAmount)}
|
|
2205
|
+
</h6>
|
|
2164
2206
|
</td>
|
|
2165
2207
|
<td class="css-5u79pd">
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2208
|
+
<h6 class="css-3jfma9">
|
|
2209
|
+
${(0, common_1.localeAmount)(currency_symbol, item.itemGrossAmount)}
|
|
2210
|
+
</h6>
|
|
2169
2211
|
</td>
|
|
2170
2212
|
<td class="css-5u79pd">
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2213
|
+
<h6 class="css-3jfma9">
|
|
2214
|
+
${(0, common_1.localeAmount)(currency_symbol, item.itemDiscountAmount)}
|
|
2215
|
+
</h6>
|
|
2174
2216
|
</td>
|
|
2175
2217
|
<td class="css-5u79pd">
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2218
|
+
<h6 class="css-3jfma9">
|
|
2219
|
+
${(0, common_1.localeAmount)(currency_symbol, item.itemNetAmount)}
|
|
2220
|
+
</h6>
|
|
2179
2221
|
</td>
|
|
2180
2222
|
<td class="css-5u79pd">
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
</td
|
|
2223
|
+
<h6 class="css-3jfma9">
|
|
2224
|
+
${(0, common_1.localeAmount)(currency_symbol, item.itemNetAmount / (item.count || 1))}
|
|
2225
|
+
</h6>
|
|
2226
|
+
</td>`
|
|
2227
|
+
: ''}
|
|
2185
2228
|
</tr>
|
|
2186
2229
|
${subItems}
|
|
2187
2230
|
`;
|
|
2188
2231
|
}
|
|
2189
2232
|
categoryItems += `<tr class="css-14kha3k">
|
|
2190
|
-
<td class="css-1m25ajq" colspan="
|
|
2233
|
+
<td class="css-1m25ajq" colspan="${itemTableColumns}">
|
|
2191
2234
|
<h5 class="css-kqeuuk">${category.category_name}</h5>
|
|
2192
2235
|
</td>
|
|
2193
2236
|
${items}
|
|
@@ -2203,36 +2246,38 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2203
2246
|
</h6>
|
|
2204
2247
|
</div>
|
|
2205
2248
|
</td>
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
</
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
</
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
</
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
</
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
</
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
</
|
|
2249
|
+
${shouldShowRevenue
|
|
2250
|
+
? `<td class="css-nz0srj">
|
|
2251
|
+
<h6 class="css-10h77yy">
|
|
2252
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemAmount)}
|
|
2253
|
+
</h6>
|
|
2254
|
+
</td>
|
|
2255
|
+
<td class="css-nz0srj">
|
|
2256
|
+
<h6 class="css-10h77yy">
|
|
2257
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemGstAmount)}
|
|
2258
|
+
</h6>
|
|
2259
|
+
</td>
|
|
2260
|
+
<td class="css-nz0srj">
|
|
2261
|
+
<h6 class="css-10h77yy">
|
|
2262
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemGrossAmount)}
|
|
2263
|
+
</h6>
|
|
2264
|
+
</td>
|
|
2265
|
+
<td class="css-nz0srj">
|
|
2266
|
+
<h6 class="css-10h77yy">
|
|
2267
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemDiscountAmount)}
|
|
2268
|
+
</h6>
|
|
2269
|
+
</td>
|
|
2270
|
+
<td class="css-nz0srj">
|
|
2271
|
+
<h6 class="css-10h77yy">
|
|
2272
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemNetAmount)}
|
|
2273
|
+
</h6>
|
|
2274
|
+
</td>
|
|
2275
|
+
<td class="css-nz0srj">
|
|
2276
|
+
<h6 class="css-10h77yy">
|
|
2277
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemNetAmount / category.count)}
|
|
2278
|
+
</h6>
|
|
2279
|
+
</td>`
|
|
2280
|
+
: ''}
|
|
2236
2281
|
</tr>`;
|
|
2237
2282
|
}
|
|
2238
2283
|
itemSales = `<div class="css-1s8sakjsakl">
|
|
@@ -2248,24 +2293,26 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2248
2293
|
<th class="css-1c5674j" scope="col">
|
|
2249
2294
|
<h6 class="css-olpyhf">Item</h6>
|
|
2250
2295
|
</th>
|
|
2251
|
-
|
|
2252
|
-
|
|
2296
|
+
${shouldShowRevenue
|
|
2297
|
+
? `<th class="css-gcb0n5" scope="col">
|
|
2298
|
+
<h6 class="css-olpyhf">Amount</h6>
|
|
2253
2299
|
</th>
|
|
2254
2300
|
<th class="css-gcb0n5" scope="col">
|
|
2255
|
-
|
|
2301
|
+
<h6 class="css-olpyhf">${gstTitle}</h6>
|
|
2256
2302
|
</th>
|
|
2257
2303
|
<th class="css-gcb0n5" scope="col">
|
|
2258
|
-
|
|
2304
|
+
<h6 class="css-olpyhf">Gross Sale</h6>
|
|
2259
2305
|
</th>
|
|
2260
2306
|
<th class="css-gcb0n5" scope="col">
|
|
2261
|
-
|
|
2307
|
+
<h6 class="css-olpyhf">Discount</h6>
|
|
2262
2308
|
</th>
|
|
2263
2309
|
<th class="css-gcb0n5" scope="col">
|
|
2264
|
-
|
|
2310
|
+
<h6 class="css-olpyhf">Net Sale</h6>
|
|
2265
2311
|
</th>
|
|
2266
2312
|
<th class="css-gcb0n5" scope="col">
|
|
2267
|
-
|
|
2268
|
-
</th
|
|
2313
|
+
<h6 class="css-olpyhf">Av. Rate</h6>
|
|
2314
|
+
</th>`
|
|
2315
|
+
: ''}
|
|
2269
2316
|
</tr>
|
|
2270
2317
|
</thead>
|
|
2271
2318
|
|
|
@@ -2291,36 +2338,38 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2291
2338
|
</h6>
|
|
2292
2339
|
</div>
|
|
2293
2340
|
</td>
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2341
|
+
${shouldShowRevenue
|
|
2342
|
+
? `<td class="css-5u79pd">
|
|
2343
|
+
<h6 class="css-3jfma9">
|
|
2344
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemAmount)}
|
|
2345
|
+
</h6>
|
|
2298
2346
|
</td>
|
|
2299
2347
|
<td class="css-5u79pd">
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2348
|
+
<h6 class="css-3jfma9">
|
|
2349
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemGstAmount)}
|
|
2350
|
+
</h6>
|
|
2303
2351
|
</td>
|
|
2304
2352
|
<td class="css-5u79pd">
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2353
|
+
<h6 class="css-3jfma9">
|
|
2354
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemGrossAmount)}
|
|
2355
|
+
</h6>
|
|
2308
2356
|
</td>
|
|
2309
2357
|
<td class="css-5u79pd">
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2358
|
+
<h6 class="css-3jfma9">
|
|
2359
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemDiscountAmount)}
|
|
2360
|
+
</h6>
|
|
2313
2361
|
</td>
|
|
2314
2362
|
<td class="css-5u79pd">
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2363
|
+
<h6 class="css-3jfma9">
|
|
2364
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemNetAmount)}
|
|
2365
|
+
</h6>
|
|
2318
2366
|
</td>
|
|
2319
2367
|
<td class="css-5u79pd">
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
</td
|
|
2368
|
+
<h6 class="css-3jfma9">
|
|
2369
|
+
${(0, common_1.localeAmount)(currency_symbol, category.itemNetAmount / category.count)}
|
|
2370
|
+
</h6>
|
|
2371
|
+
</td>`
|
|
2372
|
+
: ''}
|
|
2324
2373
|
</tr>
|
|
2325
2374
|
`;
|
|
2326
2375
|
}
|
|
@@ -2336,24 +2385,26 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2336
2385
|
<th class="css-1c5674j" scope="col">
|
|
2337
2386
|
<h6 class="css-olpyhf">Category</h6>
|
|
2338
2387
|
</th>
|
|
2339
|
-
|
|
2388
|
+
${shouldShowRevenue
|
|
2389
|
+
? `<th class="css-gcb0n5" scope="col">
|
|
2340
2390
|
<h6 class="css-olpyhf">Amount</h6>
|
|
2341
|
-
|
|
2342
|
-
|
|
2391
|
+
</th>
|
|
2392
|
+
<th class="css-gcb0n5" scope="col">
|
|
2343
2393
|
<h6 class="css-olpyhf">${gstTitle}</h6>
|
|
2344
|
-
|
|
2345
|
-
|
|
2394
|
+
</th>
|
|
2395
|
+
<th class="css-gcb0n5" scope="col">
|
|
2346
2396
|
<h6 class="css-olpyhf">Gross Sale</h6>
|
|
2347
|
-
|
|
2348
|
-
|
|
2397
|
+
</th>
|
|
2398
|
+
<th class="css-gcb0n5" scope="col">
|
|
2349
2399
|
<h6 class="css-olpyhf">Discount</h6>
|
|
2350
|
-
|
|
2351
|
-
|
|
2400
|
+
</th>
|
|
2401
|
+
<th class="css-gcb0n5" scope="col">
|
|
2352
2402
|
<h6 class="css-olpyhf">Net Sale</h6>
|
|
2353
|
-
|
|
2354
|
-
|
|
2403
|
+
</th>
|
|
2404
|
+
<th class="css-gcb0n5" scope="col">
|
|
2355
2405
|
<h6 class="css-olpyhf">Av. Rate</h6>
|
|
2356
|
-
|
|
2406
|
+
</th>`
|
|
2407
|
+
: ''}
|
|
2357
2408
|
</tr>
|
|
2358
2409
|
</thead>
|
|
2359
2410
|
|
|
@@ -2364,6 +2415,10 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2364
2415
|
</div>`;
|
|
2365
2416
|
}
|
|
2366
2417
|
if (modifiersChannel != null && modifiersChannel.length > 0) {
|
|
2418
|
+
const normalizeModifierName = (name) => {
|
|
2419
|
+
const parts = name.split(':');
|
|
2420
|
+
return (parts[1] ?? parts[0] ?? '').trim();
|
|
2421
|
+
};
|
|
2367
2422
|
const getExtraSales = (title, channels) => {
|
|
2368
2423
|
let items = '';
|
|
2369
2424
|
for (const channel of channels) {
|
|
@@ -2375,7 +2430,7 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2375
2430
|
${channel.name}
|
|
2376
2431
|
</h6>
|
|
2377
2432
|
</div>
|
|
2378
|
-
${channel.grossAmount > 0
|
|
2433
|
+
${shouldShowRevenue && channel.grossAmount > 0
|
|
2379
2434
|
? `<h6 class="css-1z023sx-jskk">${(0, common_1.localeAmount)(currency_symbol, channel.grossAmount)}</h6>`
|
|
2380
2435
|
: ''}
|
|
2381
2436
|
</div>
|
|
@@ -2394,7 +2449,11 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2394
2449
|
</div>
|
|
2395
2450
|
</div>`;
|
|
2396
2451
|
};
|
|
2397
|
-
|
|
2452
|
+
const modifiersDisplay = modifiersChannel.map((channel) => ({
|
|
2453
|
+
...channel,
|
|
2454
|
+
name: normalizeModifierName(channel.name),
|
|
2455
|
+
}));
|
|
2456
|
+
modifierSales += getExtraSales('Trending Modifiers', modifiersDisplay);
|
|
2398
2457
|
}
|
|
2399
2458
|
return `<div class="cssc-1owvoyj-asbq">
|
|
2400
2459
|
<br />
|
|
@@ -2421,7 +2480,8 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2421
2480
|
<h5 class="css-1b6n5fl">Total Items Sold</h5>
|
|
2422
2481
|
<h5 class="css-1tuemaa">${count}</h5>
|
|
2423
2482
|
</div>
|
|
2424
|
-
|
|
2483
|
+
${shouldShowRevenue
|
|
2484
|
+
? `<div class="grid-item">
|
|
2425
2485
|
<h5 class="css-1b6n5fl">Amount</h5>
|
|
2426
2486
|
<h5 class="css-lh0dz3">
|
|
2427
2487
|
${(0, common_1.localeAmount)(currency_symbol, itemAmount)}
|
|
@@ -2452,7 +2512,8 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2452
2512
|
<h5 class="css-lh0dz3">
|
|
2453
2513
|
${(0, common_1.localeAmount)(currency_symbol, itemNetAmount)}
|
|
2454
2514
|
</h5>
|
|
2455
|
-
</div
|
|
2515
|
+
</div>`
|
|
2516
|
+
: ''}
|
|
2456
2517
|
</div>
|
|
2457
2518
|
|
|
2458
2519
|
${itemSales}
|
|
@@ -178,7 +178,27 @@ function getReceiptEngineFooterDetails(order, settings) {
|
|
|
178
178
|
right,
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
// 12.
|
|
181
|
+
// 12. Packaging Fee
|
|
182
|
+
if (order.packaging_fee != null && order.packaging_fee !== 0) {
|
|
183
|
+
const right = (0, common_1.localeAmount)(currencySymbol, order.packaging_fee);
|
|
184
|
+
details.push({
|
|
185
|
+
left: 'Packaging Fee',
|
|
186
|
+
right,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
// 13. Adjustment
|
|
190
|
+
if (order.adjustment_amount != null && order.adjustment_amount !== 0) {
|
|
191
|
+
const right = (0, common_1.localeAmount)(currencySymbol, order.adjustment_amount);
|
|
192
|
+
let reason = '';
|
|
193
|
+
if (order.adjustment_reason != null && order.adjustment_reason.length < 20) {
|
|
194
|
+
reason = ` (${order.adjustment_reason})`;
|
|
195
|
+
}
|
|
196
|
+
details.push({
|
|
197
|
+
left: `Adjustment${reason}`,
|
|
198
|
+
right,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
// 14. Tip
|
|
182
202
|
if (order.tip_amount) {
|
|
183
203
|
const right = (0, common_1.localeAmount)(currencySymbol, order.tip_amount);
|
|
184
204
|
details.push({
|
|
@@ -186,7 +206,7 @@ function getReceiptEngineFooterDetails(order, settings) {
|
|
|
186
206
|
right,
|
|
187
207
|
});
|
|
188
208
|
}
|
|
189
|
-
//
|
|
209
|
+
// 15. POS Charges (added last in calculateCartOrderInfoAndSyncData)
|
|
190
210
|
if (order.tax_invoice_provider_charges) {
|
|
191
211
|
const right = (0, common_1.localeAmount)(currencySymbol, order.tax_invoice_provider_charges);
|
|
192
212
|
details.push({
|
|
@@ -194,7 +214,7 @@ function getReceiptEngineFooterDetails(order, settings) {
|
|
|
194
214
|
right,
|
|
195
215
|
});
|
|
196
216
|
}
|
|
197
|
-
//
|
|
217
|
+
// 16. Card Charges (Non Refundable)
|
|
198
218
|
if (cardCharges > 0) {
|
|
199
219
|
const right = (0, common_1.localeAmount)(currencySymbol, cardCharges);
|
|
200
220
|
details.push({
|
|
@@ -719,7 +739,7 @@ function receiptEngine(payload, mappedItems = {}) {
|
|
|
719
739
|
const staff_name = payload.printer_settings.print_staff_name && payload.order.staff_details != null
|
|
720
740
|
? (payload.order.staff_details.staff_name ?? null)
|
|
721
741
|
: null;
|
|
722
|
-
const order_taker_name = payload.order.
|
|
742
|
+
const order_taker_name = payload.order.order_taker_details?.staff_name ?? staff_name;
|
|
723
743
|
const rider_name = payload.order.delivery_details?.rider_details?.staff_name ?? null;
|
|
724
744
|
let payment_status = null;
|
|
725
745
|
// Helper to get expected payment label suffix
|
|
@@ -40,6 +40,11 @@ export interface ISettingsForWeb {
|
|
|
40
40
|
delivery_min_cost_distance_mtrs: ITenant['delivery_min_cost_distance_mtrs'];
|
|
41
41
|
delivery_cost_per_meter: ITenant['delivery_cost_per_meter'];
|
|
42
42
|
delivery_free_over: ITenant['delivery_free_over'];
|
|
43
|
+
min_service_fee_order_value: ITenant['min_service_fee_order_value'];
|
|
44
|
+
packaging_fee: ITenant['packaging_fee'];
|
|
45
|
+
min_packaging_fee_order_value: ITenant['min_packaging_fee_order_value'];
|
|
46
|
+
free_packaging_over: ITenant['free_packaging_over'];
|
|
47
|
+
cash_in_hand_limit: ITenant['cash_in_hand_limit'];
|
|
43
48
|
brand_color: ITenant['brand_color'];
|
|
44
49
|
restaurant_address: ITenant['restaurant_address'];
|
|
45
50
|
public_business_name: ITenant['public_business_name'];
|
|
@@ -138,6 +143,11 @@ export interface ISettingsForPOS {
|
|
|
138
143
|
delivery_min_cost_distance_mtrs: ITenant['delivery_min_cost_distance_mtrs'];
|
|
139
144
|
min_delivery_order_value: ITenant['min_delivery_order_value'];
|
|
140
145
|
delivery_order_value_per_meter: ITenant['delivery_order_value_per_meter'];
|
|
146
|
+
min_service_fee_order_value: ITenant['min_service_fee_order_value'];
|
|
147
|
+
packaging_fee: ITenant['packaging_fee'];
|
|
148
|
+
free_packaging_over: ITenant['free_packaging_over'];
|
|
149
|
+
min_packaging_fee_order_value: ITenant['min_packaging_fee_order_value'];
|
|
150
|
+
cash_in_hand_limit: ITenant['cash_in_hand_limit'];
|
|
141
151
|
delivery_areas_search_type: ITenant['delivery_areas_search_type'];
|
|
142
152
|
static_delivery_cost_multiplier: ITenant['static_delivery_cost_multiplier'];
|
|
143
153
|
delivery_time: ITenant['delivery_time'];
|
|
@@ -249,6 +259,11 @@ export interface ISettingsForCloud {
|
|
|
249
259
|
brand_color: ITenant['brand_color'];
|
|
250
260
|
subscription_expiry: ITenant['subscription_expiry'];
|
|
251
261
|
enabled_review_platforms: ITenant['enabled_review_platforms'];
|
|
262
|
+
rider_revenue_type: ITenant['rider_revenue_type'];
|
|
263
|
+
rider_revenue_per_meter: ITenant['rider_revenue_per_meter'];
|
|
264
|
+
static_rider_revenue_multiplier: ITenant['static_rider_revenue_multiplier'];
|
|
265
|
+
rider_pickup_food_image_mandatory: ITenant['rider_pickup_food_image_mandatory'];
|
|
266
|
+
rider_dropoff_food_image_mandatory: ITenant['rider_dropoff_food_image_mandatory'];
|
|
252
267
|
}
|
|
253
268
|
export declare function getSettingsForCloud(settings: ITenant): ISettingsForCloud;
|
|
254
269
|
export declare function getTenantOnlineOrderingMetadataFromTenant(tenant: ITenant): ITenantOnlineOrderingMetadata;
|
|
@@ -30,6 +30,21 @@ function getSettingsWithPrice(settings, writeable) {
|
|
|
30
30
|
...(settings.delivery_order_value_per_meter != null
|
|
31
31
|
? { delivery_order_value_per_meter: convertSmallNumber(settings.delivery_order_value_per_meter) }
|
|
32
32
|
: {}),
|
|
33
|
+
...(settings.rider_revenue_per_meter != null
|
|
34
|
+
? { rider_revenue_per_meter: convertSmallNumber(settings.rider_revenue_per_meter) }
|
|
35
|
+
: {}),
|
|
36
|
+
// ========================================
|
|
37
|
+
...(settings.min_service_fee_order_value != null
|
|
38
|
+
? { min_service_fee_order_value: convertToPrice(settings.min_service_fee_order_value) }
|
|
39
|
+
: {}),
|
|
40
|
+
...(settings.packaging_fee != null ? { packaging_fee: convertToPrice(settings.packaging_fee) } : {}),
|
|
41
|
+
...(settings.free_packaging_over != null
|
|
42
|
+
? { free_packaging_over: convertToPrice(settings.free_packaging_over) }
|
|
43
|
+
: {}),
|
|
44
|
+
...(settings.min_packaging_fee_order_value != null
|
|
45
|
+
? { min_packaging_fee_order_value: convertToPrice(settings.min_packaging_fee_order_value) }
|
|
46
|
+
: {}),
|
|
47
|
+
...(settings.cash_in_hand_limit != null ? { cash_in_hand_limit: convertToPrice(settings.cash_in_hand_limit) } : {}),
|
|
33
48
|
// ========================================
|
|
34
49
|
...(settings.pos_min_takeaway_order_value != null
|
|
35
50
|
? { pos_min_takeaway_order_value: convertToPrice(settings.pos_min_takeaway_order_value) }
|
|
@@ -121,6 +136,11 @@ function getSettingsForWeb(settings) {
|
|
|
121
136
|
delivery_min_cost_distance_mtrs: settings.delivery_min_cost_distance_mtrs,
|
|
122
137
|
delivery_cost_per_meter: settings.delivery_cost_per_meter,
|
|
123
138
|
delivery_free_over: settings.delivery_free_over,
|
|
139
|
+
min_service_fee_order_value: settings.min_service_fee_order_value,
|
|
140
|
+
packaging_fee: settings.packaging_fee,
|
|
141
|
+
free_packaging_over: settings.free_packaging_over,
|
|
142
|
+
min_packaging_fee_order_value: settings.min_packaging_fee_order_value,
|
|
143
|
+
cash_in_hand_limit: settings.cash_in_hand_limit,
|
|
124
144
|
brand_color: settings.brand_color,
|
|
125
145
|
restaurant_address: settings.restaurant_address,
|
|
126
146
|
public_business_name: settings.public_business_name,
|
|
@@ -220,6 +240,11 @@ function getSettingsForPOS(settings) {
|
|
|
220
240
|
delivery_min_cost_distance_mtrs: settings.delivery_min_cost_distance_mtrs,
|
|
221
241
|
min_delivery_order_value: settings.min_delivery_order_value,
|
|
222
242
|
delivery_order_value_per_meter: settings.delivery_order_value_per_meter,
|
|
243
|
+
min_service_fee_order_value: settings.min_service_fee_order_value,
|
|
244
|
+
packaging_fee: settings.packaging_fee,
|
|
245
|
+
free_packaging_over: settings.free_packaging_over,
|
|
246
|
+
min_packaging_fee_order_value: settings.min_packaging_fee_order_value,
|
|
247
|
+
cash_in_hand_limit: settings.cash_in_hand_limit,
|
|
223
248
|
delivery_areas_search_type: settings.delivery_areas_search_type,
|
|
224
249
|
static_delivery_cost_multiplier: settings.static_delivery_cost_multiplier,
|
|
225
250
|
delivery_time: settings.delivery_time,
|
|
@@ -307,6 +332,11 @@ function getSettingsForCloud(settings) {
|
|
|
307
332
|
brand_color: settings.brand_color,
|
|
308
333
|
subscription_expiry: settings.subscription_expiry,
|
|
309
334
|
enabled_review_platforms: settings.enabled_review_platforms,
|
|
335
|
+
rider_revenue_type: settings.rider_revenue_type,
|
|
336
|
+
rider_revenue_per_meter: settings.rider_revenue_per_meter,
|
|
337
|
+
static_rider_revenue_multiplier: settings.static_rider_revenue_multiplier,
|
|
338
|
+
rider_pickup_food_image_mandatory: settings.rider_pickup_food_image_mandatory,
|
|
339
|
+
rider_dropoff_food_image_mandatory: settings.rider_dropoff_food_image_mandatory,
|
|
310
340
|
};
|
|
311
341
|
}
|
|
312
342
|
function getTenantOnlineOrderingMetadataFromTenant(tenant) {
|