@managesome/eposmatic-toolkit 0.2.212

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.
Files changed (640) hide show
  1. package/LICENSE +13 -0
  2. package/lib/constants/ANALYTICS.d.ts +477 -0
  3. package/lib/constants/ANALYTICS.js +148 -0
  4. package/lib/constants/COMMON.d.ts +72 -0
  5. package/lib/constants/COMMON.js +334 -0
  6. package/lib/constants/DELIVERY.d.ts +14 -0
  7. package/lib/constants/DELIVERY.js +48 -0
  8. package/lib/constants/ENUMS.d.ts +1008 -0
  9. package/lib/constants/ENUMS.js +1693 -0
  10. package/lib/constants/FBR_ENUMS.d.ts +15 -0
  11. package/lib/constants/FBR_ENUMS.js +21 -0
  12. package/lib/constants/HUBRISE_ENUMS.d.ts +74 -0
  13. package/lib/constants/HUBRISE_ENUMS.js +182 -0
  14. package/lib/constants/NOTIFICATIONS.d.ts +5 -0
  15. package/lib/constants/NOTIFICATIONS.js +9 -0
  16. package/lib/constants/ORDER.d.ts +15 -0
  17. package/lib/constants/ORDER.js +242 -0
  18. package/lib/constants/PRA_ENUMS.d.ts +15 -0
  19. package/lib/constants/PRA_ENUMS.js +21 -0
  20. package/lib/constants/PURCHASE_ORDER.d.ts +14 -0
  21. package/lib/constants/PURCHASE_ORDER.js +53 -0
  22. package/lib/constants/SMARTPAY_ENUMS.d.ts +42 -0
  23. package/lib/constants/SMARTPAY_ENUMS.js +58 -0
  24. package/lib/constants/SOCKET.d.ts +95 -0
  25. package/lib/constants/SOCKET.js +135 -0
  26. package/lib/constants/SRB_ENUMS.d.ts +10 -0
  27. package/lib/constants/SRB_ENUMS.js +16 -0
  28. package/lib/constants/SWITCHPAY.d.ts +4 -0
  29. package/lib/constants/SWITCHPAY.js +8 -0
  30. package/lib/constants/WALLET.d.ts +13 -0
  31. package/lib/constants/WALLET.js +54 -0
  32. package/lib/constants/WAREHOUSE_ANALYTICS.d.ts +239 -0
  33. package/lib/constants/WAREHOUSE_ANALYTICS.js +31 -0
  34. package/lib/constants/WAREHOUSE_INVOICE.d.ts +14 -0
  35. package/lib/constants/WAREHOUSE_INVOICE.js +35 -0
  36. package/lib/constants/WEBVIEW.d.ts +44 -0
  37. package/lib/constants/WEBVIEW.js +50 -0
  38. package/lib/constants/index.d.ts +19 -0
  39. package/lib/constants/index.js +35 -0
  40. package/lib/constants/types.d.ts +408 -0
  41. package/lib/constants/types.js +3 -0
  42. package/lib/helpers/fbr/generate-invoice.d.ts +10 -0
  43. package/lib/helpers/fbr/generate-invoice.js +97 -0
  44. package/lib/helpers/fbr/index.d.ts +1 -0
  45. package/lib/helpers/fbr/index.js +17 -0
  46. package/lib/helpers/hubrise/hubrise-catalog.d.ts +43 -0
  47. package/lib/helpers/hubrise/hubrise-catalog.js +314 -0
  48. package/lib/helpers/hubrise/index.d.ts +1 -0
  49. package/lib/helpers/hubrise/index.js +17 -0
  50. package/lib/helpers/index.d.ts +9 -0
  51. package/lib/helpers/index.js +25 -0
  52. package/lib/helpers/kpra/generate-invoice.d.ts +8 -0
  53. package/lib/helpers/kpra/generate-invoice.js +29 -0
  54. package/lib/helpers/kpra/index.d.ts +1 -0
  55. package/lib/helpers/kpra/index.js +17 -0
  56. package/lib/helpers/order/generate-order.d.ts +12 -0
  57. package/lib/helpers/order/generate-order.js +409 -0
  58. package/lib/helpers/order/generate-purchase-order.d.ts +11 -0
  59. package/lib/helpers/order/generate-purchase-order.js +196 -0
  60. package/lib/helpers/order/generate-warehouse-invoice.d.ts +11 -0
  61. package/lib/helpers/order/generate-warehouse-invoice.js +196 -0
  62. package/lib/helpers/order/index.d.ts +3 -0
  63. package/lib/helpers/order/index.js +19 -0
  64. package/lib/helpers/pra/generate-invoice.d.ts +10 -0
  65. package/lib/helpers/pra/generate-invoice.js +97 -0
  66. package/lib/helpers/pra/index.d.ts +1 -0
  67. package/lib/helpers/pra/index.js +17 -0
  68. package/lib/helpers/srb/generate-invoice.d.ts +13 -0
  69. package/lib/helpers/srb/generate-invoice.js +48 -0
  70. package/lib/helpers/srb/index.d.ts +1 -0
  71. package/lib/helpers/srb/index.js +17 -0
  72. package/lib/helpers/store/all-orders-actions.d.ts +5 -0
  73. package/lib/helpers/store/all-orders-actions.js +23 -0
  74. package/lib/helpers/store/all-purchase-orders-actions.d.ts +13 -0
  75. package/lib/helpers/store/all-purchase-orders-actions.js +56 -0
  76. package/lib/helpers/store/all-warehouse-invoice-actions.d.ts +13 -0
  77. package/lib/helpers/store/all-warehouse-invoice-actions.js +58 -0
  78. package/lib/helpers/store/cart-actions.d.ts +159 -0
  79. package/lib/helpers/store/cart-actions.js +2070 -0
  80. package/lib/helpers/store/catalog-actions.d.ts +23 -0
  81. package/lib/helpers/store/catalog-actions.js +216 -0
  82. package/lib/helpers/store/common-order-actions.d.ts +36 -0
  83. package/lib/helpers/store/common-order-actions.js +878 -0
  84. package/lib/helpers/store/common-purchase-order-actions.d.ts +31 -0
  85. package/lib/helpers/store/common-purchase-order-actions.js +543 -0
  86. package/lib/helpers/store/common-warehouse-invoice-actions.d.ts +31 -0
  87. package/lib/helpers/store/common-warehouse-invoice-actions.js +545 -0
  88. package/lib/helpers/store/index.d.ts +11 -0
  89. package/lib/helpers/store/index.js +27 -0
  90. package/lib/helpers/store/offline-ordering.d.ts +15 -0
  91. package/lib/helpers/store/offline-ordering.js +258 -0
  92. package/lib/helpers/store/purchase-orders-cart-actions.d.ts +56 -0
  93. package/lib/helpers/store/purchase-orders-cart-actions.js +486 -0
  94. package/lib/helpers/store/warehouse-cart-actions.d.ts +54 -0
  95. package/lib/helpers/store/warehouse-cart-actions.js +486 -0
  96. package/lib/helpers/store/warehouse-catalog-actions.d.ts +4 -0
  97. package/lib/helpers/store/warehouse-catalog-actions.js +46 -0
  98. package/lib/helpers/store/warehouse-invoice-cart-actions.d.ts +56 -0
  99. package/lib/helpers/store/warehouse-invoice-cart-actions.js +486 -0
  100. package/lib/helpers/types/cart-actions.d.ts +33 -0
  101. package/lib/helpers/types/cart-actions.js +2 -0
  102. package/lib/helpers/types/cart-helpers.d.ts +7 -0
  103. package/lib/helpers/types/cart-helpers.js +2 -0
  104. package/lib/helpers/types/catalog.d.ts +149 -0
  105. package/lib/helpers/types/catalog.js +2 -0
  106. package/lib/helpers/types/common.d.ts +69 -0
  107. package/lib/helpers/types/common.js +2 -0
  108. package/lib/helpers/types/deliverect_menu.d.ts +51 -0
  109. package/lib/helpers/types/deliverect_menu.js +2 -0
  110. package/lib/helpers/types/email-templates.d.ts +173 -0
  111. package/lib/helpers/types/email-templates.js +2 -0
  112. package/lib/helpers/types/fbr-generate-invoice.d.ts +40 -0
  113. package/lib/helpers/types/fbr-generate-invoice.js +2 -0
  114. package/lib/helpers/types/hubrise_catalog.d.ts +123 -0
  115. package/lib/helpers/types/hubrise_catalog.js +2 -0
  116. package/lib/helpers/types/hubrise_customers.d.ts +36 -0
  117. package/lib/helpers/types/hubrise_customers.js +2 -0
  118. package/lib/helpers/types/hubrise_deliveries.d.ts +19 -0
  119. package/lib/helpers/types/hubrise_deliveries.js +2 -0
  120. package/lib/helpers/types/hubrise_location.d.ts +31 -0
  121. package/lib/helpers/types/hubrise_location.js +2 -0
  122. package/lib/helpers/types/hubrise_orders.d.ts +86 -0
  123. package/lib/helpers/types/hubrise_orders.js +2 -0
  124. package/lib/helpers/types/index.d.ts +25 -0
  125. package/lib/helpers/types/index.js +41 -0
  126. package/lib/helpers/types/internal-leads.d.ts +11 -0
  127. package/lib/helpers/types/internal-leads.js +2 -0
  128. package/lib/helpers/types/kpra-generate-invoice.d.ts +6 -0
  129. package/lib/helpers/types/kpra-generate-invoice.js +2 -0
  130. package/lib/helpers/types/marketing.d.ts +12 -0
  131. package/lib/helpers/types/marketing.js +2 -0
  132. package/lib/helpers/types/order-engine.d.ts +39 -0
  133. package/lib/helpers/types/order-engine.js +2 -0
  134. package/lib/helpers/types/pra-generate-invoice.d.ts +40 -0
  135. package/lib/helpers/types/pra-generate-invoice.js +2 -0
  136. package/lib/helpers/types/printer-settings.d.ts +11 -0
  137. package/lib/helpers/types/printer-settings.js +3 -0
  138. package/lib/helpers/types/purchase-order-cart-actions.d.ts +26 -0
  139. package/lib/helpers/types/purchase-order-cart-actions.js +2 -0
  140. package/lib/helpers/types/reports.d.ts +150 -0
  141. package/lib/helpers/types/reports.js +2 -0
  142. package/lib/helpers/types/smartpay-apis.d.ts +170 -0
  143. package/lib/helpers/types/smartpay-apis.js +3 -0
  144. package/lib/helpers/types/split_bill.d.ts +20 -0
  145. package/lib/helpers/types/split_bill.js +2 -0
  146. package/lib/helpers/types/srb-generate-invoice.d.ts +27 -0
  147. package/lib/helpers/types/srb-generate-invoice.js +2 -0
  148. package/lib/helpers/types/switchpay.d.ts +10 -0
  149. package/lib/helpers/types/switchpay.js +2 -0
  150. package/lib/helpers/types/usable-offers.d.ts +27 -0
  151. package/lib/helpers/types/usable-offers.js +2 -0
  152. package/lib/helpers/types/warehouse-cart-actions.d.ts +51 -0
  153. package/lib/helpers/types/warehouse-cart-actions.js +2 -0
  154. package/lib/helpers/types/warehouse-catalog.d.ts +4 -0
  155. package/lib/helpers/types/warehouse-catalog.js +2 -0
  156. package/lib/helpers/types/warehouse-invoice-cart-actions.d.ts +26 -0
  157. package/lib/helpers/types/warehouse-invoice-cart-actions.js +2 -0
  158. package/lib/helpers/types/workers.d.ts +256 -0
  159. package/lib/helpers/types/workers.js +2 -0
  160. package/lib/helpers/utils/cart-helpers.d.ts +48 -0
  161. package/lib/helpers/utils/cart-helpers.js +151 -0
  162. package/lib/helpers/utils/catalog-conversion.d.ts +9 -0
  163. package/lib/helpers/utils/catalog-conversion.js +123 -0
  164. package/lib/helpers/utils/color-helpers.d.ts +3 -0
  165. package/lib/helpers/utils/color-helpers.js +36 -0
  166. package/lib/helpers/utils/common.d.ts +36 -0
  167. package/lib/helpers/utils/common.js +332 -0
  168. package/lib/helpers/utils/comparison-report-helpers.d.ts +27 -0
  169. package/lib/helpers/utils/comparison-report-helpers.js +802 -0
  170. package/lib/helpers/utils/comparitive-report-helpers.d.ts +7 -0
  171. package/lib/helpers/utils/comparitive-report-helpers.js +826 -0
  172. package/lib/helpers/utils/crypt.d.ts +4 -0
  173. package/lib/helpers/utils/crypt.js +49 -0
  174. package/lib/helpers/utils/customers-helpers.d.ts +2 -0
  175. package/lib/helpers/utils/customers-helpers.js +17 -0
  176. package/lib/helpers/utils/delivery-area-helpers.d.ts +4 -0
  177. package/lib/helpers/utils/delivery-area-helpers.js +47 -0
  178. package/lib/helpers/utils/delivery-helpers.d.ts +2 -0
  179. package/lib/helpers/utils/delivery-helpers.js +15 -0
  180. package/lib/helpers/utils/dinein.d.ts +10 -0
  181. package/lib/helpers/utils/dinein.js +47 -0
  182. package/lib/helpers/utils/discount-helpers.d.ts +8 -0
  183. package/lib/helpers/utils/discount-helpers.js +59 -0
  184. package/lib/helpers/utils/email-helpers.d.ts +17 -0
  185. package/lib/helpers/utils/email-helpers.js +99 -0
  186. package/lib/helpers/utils/error-helpers.d.ts +9 -0
  187. package/lib/helpers/utils/error-helpers.js +18 -0
  188. package/lib/helpers/utils/expense.d.ts +4 -0
  189. package/lib/helpers/utils/expense.js +42 -0
  190. package/lib/helpers/utils/getFormFieldsDiff.d.ts +3 -0
  191. package/lib/helpers/utils/getFormFieldsDiff.js +18 -0
  192. package/lib/helpers/utils/halfhalf-setup-helpers.d.ts +22 -0
  193. package/lib/helpers/utils/halfhalf-setup-helpers.js +133 -0
  194. package/lib/helpers/utils/hourly-comparison-report-helpers.d.ts +50 -0
  195. package/lib/helpers/utils/hourly-comparison-report-helpers.js +861 -0
  196. package/lib/helpers/utils/hubrise-utils.d.ts +11 -0
  197. package/lib/helpers/utils/hubrise-utils.js +38 -0
  198. package/lib/helpers/utils/image-helpers.d.ts +3 -0
  199. package/lib/helpers/utils/image-helpers.js +100 -0
  200. package/lib/helpers/utils/index.d.ts +68 -0
  201. package/lib/helpers/utils/index.js +84 -0
  202. package/lib/helpers/utils/ingredients.d.ts +3 -0
  203. package/lib/helpers/utils/ingredients.js +30 -0
  204. package/lib/helpers/utils/inventory.d.ts +4 -0
  205. package/lib/helpers/utils/inventory.js +122 -0
  206. package/lib/helpers/utils/inventory_transactions.d.ts +3 -0
  207. package/lib/helpers/utils/inventory_transactions.js +95 -0
  208. package/lib/helpers/utils/invoice-x-report-helpers.d.ts +58 -0
  209. package/lib/helpers/utils/invoice-x-report-helpers.js +1432 -0
  210. package/lib/helpers/utils/item-report-helpers.d.ts +28 -0
  211. package/lib/helpers/utils/item-report-helpers.js +2494 -0
  212. package/lib/helpers/utils/items-comparison-report-helpers.d.ts +30 -0
  213. package/lib/helpers/utils/items-comparison-report-helpers.js +1066 -0
  214. package/lib/helpers/utils/kds-helpers.d.ts +8 -0
  215. package/lib/helpers/utils/kds-helpers.js +46 -0
  216. package/lib/helpers/utils/location-helpers.d.ts +1 -0
  217. package/lib/helpers/utils/location-helpers.js +16 -0
  218. package/lib/helpers/utils/menu-helpers.d.ts +8 -0
  219. package/lib/helpers/utils/menu-helpers.js +48 -0
  220. package/lib/helpers/utils/minified-catalog.d.ts +17 -0
  221. package/lib/helpers/utils/minified-catalog.js +440 -0
  222. package/lib/helpers/utils/offers-helpers.d.ts +47 -0
  223. package/lib/helpers/utils/offers-helpers.js +899 -0
  224. package/lib/helpers/utils/operational-roles-helpers.d.ts +2 -0
  225. package/lib/helpers/utils/operational-roles-helpers.js +36 -0
  226. package/lib/helpers/utils/order-engine.d.ts +48 -0
  227. package/lib/helpers/utils/order-engine.js +754 -0
  228. package/lib/helpers/utils/order-history.d.ts +15 -0
  229. package/lib/helpers/utils/order-history.js +211 -0
  230. package/lib/helpers/utils/payment-comparison-report-helpers.d.ts +16 -0
  231. package/lib/helpers/utils/payment-comparison-report-helpers.js +882 -0
  232. package/lib/helpers/utils/payment-helpers.d.ts +38 -0
  233. package/lib/helpers/utils/payment-helpers.js +285 -0
  234. package/lib/helpers/utils/pdf-generator.d.ts +19 -0
  235. package/lib/helpers/utils/pdf-generator.js +115 -0
  236. package/lib/helpers/utils/platform-catalog.d.ts +11 -0
  237. package/lib/helpers/utils/platform-catalog.js +234 -0
  238. package/lib/helpers/utils/platform-num.d.ts +9 -0
  239. package/lib/helpers/utils/platform-num.js +128 -0
  240. package/lib/helpers/utils/platform-specific-tenant-shifts.d.ts +8 -0
  241. package/lib/helpers/utils/platform-specific-tenant-shifts.js +22 -0
  242. package/lib/helpers/utils/price-conversion.d.ts +6 -0
  243. package/lib/helpers/utils/price-conversion.js +32 -0
  244. package/lib/helpers/utils/printer-helpers.d.ts +3 -0
  245. package/lib/helpers/utils/printer-helpers.js +74 -0
  246. package/lib/helpers/utils/public-holidays-helpers.d.ts +2 -0
  247. package/lib/helpers/utils/public-holidays-helpers.js +11 -0
  248. package/lib/helpers/utils/purchase-order-engine.d.ts +9 -0
  249. package/lib/helpers/utils/purchase-order-engine.js +34 -0
  250. package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +149 -0
  251. package/lib/helpers/utils/purchase-order-receipt-engine.js +214 -0
  252. package/lib/helpers/utils/purchase-order-x-report-helpers.d.ts +58 -0
  253. package/lib/helpers/utils/purchase-order-x-report-helpers.js +1440 -0
  254. package/lib/helpers/utils/ratings-comparison-report-helpers.d.ts +37 -0
  255. package/lib/helpers/utils/ratings-comparison-report-helpers.js +1194 -0
  256. package/lib/helpers/utils/receipt-engine.d.ts +165 -0
  257. package/lib/helpers/utils/receipt-engine.js +856 -0
  258. package/lib/helpers/utils/review-helpers.d.ts +9 -0
  259. package/lib/helpers/utils/review-helpers.js +398 -0
  260. package/lib/helpers/utils/rider-tracking.d.ts +1 -0
  261. package/lib/helpers/utils/rider-tracking.js +16 -0
  262. package/lib/helpers/utils/riders-report-helpers.d.ts +62 -0
  263. package/lib/helpers/utils/riders-report-helpers.js +1598 -0
  264. package/lib/helpers/utils/sales-comparison-report-helpers.d.ts +31 -0
  265. package/lib/helpers/utils/sales-comparison-report-helpers.js +1266 -0
  266. package/lib/helpers/utils/sales-comparitive-report-helpers.d.ts +7 -0
  267. package/lib/helpers/utils/sales-comparitive-report-helpers.js +945 -0
  268. package/lib/helpers/utils/sales-overview-report-helpers.d.ts +30 -0
  269. package/lib/helpers/utils/sales-overview-report-helpers.js +1052 -0
  270. package/lib/helpers/utils/sales-summary-report-helpers.d.ts +30 -0
  271. package/lib/helpers/utils/sales-summary-report-helpers.js +883 -0
  272. package/lib/helpers/utils/short-inventory.d.ts +3 -0
  273. package/lib/helpers/utils/short-inventory.js +26 -0
  274. package/lib/helpers/utils/simplified-catalog.d.ts +8 -0
  275. package/lib/helpers/utils/simplified-catalog.js +115 -0
  276. package/lib/helpers/utils/simplified-tenant.d.ts +255 -0
  277. package/lib/helpers/utils/simplified-tenant.js +337 -0
  278. package/lib/helpers/utils/simplified-warehouse-catalog.d.ts +10 -0
  279. package/lib/helpers/utils/simplified-warehouse-catalog.js +108 -0
  280. package/lib/helpers/utils/specials-helpers.d.ts +42 -0
  281. package/lib/helpers/utils/specials-helpers.js +216 -0
  282. package/lib/helpers/utils/stock-details.d.ts +3 -0
  283. package/lib/helpers/utils/stock-details.js +26 -0
  284. package/lib/helpers/utils/stock-wastage.d.ts +3 -0
  285. package/lib/helpers/utils/stock-wastage.js +26 -0
  286. package/lib/helpers/utils/tenant-staff-helpers.d.ts +2 -0
  287. package/lib/helpers/utils/tenant-staff-helpers.js +22 -0
  288. package/lib/helpers/utils/terminal-devices-helpers.d.ts +2 -0
  289. package/lib/helpers/utils/terminal-devices-helpers.js +13 -0
  290. package/lib/helpers/utils/time-helpers.d.ts +16 -0
  291. package/lib/helpers/utils/time-helpers.js +57 -0
  292. package/lib/helpers/utils/void-items-report-helpers.d.ts +13 -0
  293. package/lib/helpers/utils/void-items-report-helpers.js +526 -0
  294. package/lib/helpers/utils/void-order-items-helpers.d.ts +3 -0
  295. package/lib/helpers/utils/void-order-items-helpers.js +36 -0
  296. package/lib/helpers/utils/voidations-summary-report-helpers.d.ts +24 -0
  297. package/lib/helpers/utils/voidations-summary-report-helpers.js +807 -0
  298. package/lib/helpers/utils/wallet-helpers.d.ts +2 -0
  299. package/lib/helpers/utils/wallet-helpers.js +25 -0
  300. package/lib/helpers/utils/warehouse-catalog-conversion.d.ts +7 -0
  301. package/lib/helpers/utils/warehouse-catalog-conversion.js +89 -0
  302. package/lib/helpers/utils/warehouse-inventory.d.ts +2 -0
  303. package/lib/helpers/utils/warehouse-inventory.js +53 -0
  304. package/lib/helpers/utils/warehouse-invoice-order-engine.d.ts +11 -0
  305. package/lib/helpers/utils/warehouse-invoice-order-engine.js +39 -0
  306. package/lib/helpers/utils/warehouse-order-engine.d.ts +9 -0
  307. package/lib/helpers/utils/warehouse-order-engine.js +34 -0
  308. package/lib/helpers/utils/warehouse-settings-helpers.d.ts +2 -0
  309. package/lib/helpers/utils/warehouse-settings-helpers.js +30 -0
  310. package/lib/helpers/utils/warehouse_inventory_transactions.d.ts +3 -0
  311. package/lib/helpers/utils/warehouse_inventory_transactions.js +95 -0
  312. package/lib/helpers/utils/x-report-helpers.d.ts +65 -0
  313. package/lib/helpers/utils/x-report-helpers.js +1858 -0
  314. package/lib/index.d.ts +3 -0
  315. package/lib/index.js +19 -0
  316. package/lib/schemas/index.d.ts +2 -0
  317. package/lib/schemas/index.js +18 -0
  318. package/lib/schemas/models/app_configs.d.ts +34 -0
  319. package/lib/schemas/models/app_configs.js +39 -0
  320. package/lib/schemas/models/applied-order-discounts.d.ts +80 -0
  321. package/lib/schemas/models/applied-order-discounts.js +106 -0
  322. package/lib/schemas/models/brand.d.ts +45 -0
  323. package/lib/schemas/models/brand.js +45 -0
  324. package/lib/schemas/models/cash_drawer_sessions.d.ts +107 -0
  325. package/lib/schemas/models/cash_drawer_sessions.js +78 -0
  326. package/lib/schemas/models/cash_drawers.d.ts +44 -0
  327. package/lib/schemas/models/cash_drawers.js +46 -0
  328. package/lib/schemas/models/cash_in_out.d.ts +110 -0
  329. package/lib/schemas/models/cash_in_out.js +81 -0
  330. package/lib/schemas/models/category.d.ts +60 -0
  331. package/lib/schemas/models/category.js +67 -0
  332. package/lib/schemas/models/close_dates.d.ts +50 -0
  333. package/lib/schemas/models/close_dates.js +56 -0
  334. package/lib/schemas/models/common-models.d.ts +493 -0
  335. package/lib/schemas/models/common-models.js +444 -0
  336. package/lib/schemas/models/courses.d.ts +77 -0
  337. package/lib/schemas/models/courses.js +55 -0
  338. package/lib/schemas/models/customers.d.ts +443 -0
  339. package/lib/schemas/models/customers.js +197 -0
  340. package/lib/schemas/models/deliveries.d.ts +123 -0
  341. package/lib/schemas/models/deliveries.js +112 -0
  342. package/lib/schemas/models/delivery_areas.d.ts +263 -0
  343. package/lib/schemas/models/delivery_areas.js +100 -0
  344. package/lib/schemas/models/dinein_floors.d.ts +44 -0
  345. package/lib/schemas/models/dinein_floors.js +45 -0
  346. package/lib/schemas/models/dinein_table_fingerprints.d.ts +65 -0
  347. package/lib/schemas/models/dinein_table_fingerprints.js +85 -0
  348. package/lib/schemas/models/dinein_tables.d.ts +68 -0
  349. package/lib/schemas/models/dinein_tables.js +82 -0
  350. package/lib/schemas/models/discounts.d.ts +1254 -0
  351. package/lib/schemas/models/discounts.js +90 -0
  352. package/lib/schemas/models/drivers.d.ts +55 -0
  353. package/lib/schemas/models/drivers.js +60 -0
  354. package/lib/schemas/models/expense_category.d.ts +83 -0
  355. package/lib/schemas/models/expense_category.js +64 -0
  356. package/lib/schemas/models/expense_details.d.ts +266 -0
  357. package/lib/schemas/models/expense_details.js +113 -0
  358. package/lib/schemas/models/halfhalf_setup.d.ts +1541 -0
  359. package/lib/schemas/models/halfhalf_setup.js +109 -0
  360. package/lib/schemas/models/index.d.ts +65 -0
  361. package/lib/schemas/models/index.js +81 -0
  362. package/lib/schemas/models/instore_shift_sessions.d.ts +146 -0
  363. package/lib/schemas/models/instore_shift_sessions.js +125 -0
  364. package/lib/schemas/models/instore_shifts.d.ts +50 -0
  365. package/lib/schemas/models/instore_shifts.js +55 -0
  366. package/lib/schemas/models/internal_expense_details.d.ts +55 -0
  367. package/lib/schemas/models/internal_expense_details.js +63 -0
  368. package/lib/schemas/models/internal_leads.d.ts +69 -0
  369. package/lib/schemas/models/internal_leads.js +81 -0
  370. package/lib/schemas/models/internal_restaurant_details.d.ts +64 -0
  371. package/lib/schemas/models/internal_restaurant_details.js +77 -0
  372. package/lib/schemas/models/inventory.d.ts +99 -0
  373. package/lib/schemas/models/inventory.js +87 -0
  374. package/lib/schemas/models/inventory_categories.d.ts +50 -0
  375. package/lib/schemas/models/inventory_categories.js +55 -0
  376. package/lib/schemas/models/inventory_transactions.d.ts +83 -0
  377. package/lib/schemas/models/inventory_transactions.js +110 -0
  378. package/lib/schemas/models/item.d.ts +10822 -0
  379. package/lib/schemas/models/item.js +329 -0
  380. package/lib/schemas/models/item_transactions.d.ts +71 -0
  381. package/lib/schemas/models/item_transactions.js +95 -0
  382. package/lib/schemas/models/marketing_fingerprints.d.ts +62 -0
  383. package/lib/schemas/models/marketing_fingerprints.js +81 -0
  384. package/lib/schemas/models/menu.d.ts +905 -0
  385. package/lib/schemas/models/menu.js +69 -0
  386. package/lib/schemas/models/messaging_devices.d.ts +63 -0
  387. package/lib/schemas/models/messaging_devices.js +74 -0
  388. package/lib/schemas/models/modifier_extras.d.ts +516 -0
  389. package/lib/schemas/models/modifier_extras.js +123 -0
  390. package/lib/schemas/models/offers.d.ts +1067 -0
  391. package/lib/schemas/models/offers.js +286 -0
  392. package/lib/schemas/models/offers_fingerprints.d.ts +50 -0
  393. package/lib/schemas/models/offers_fingerprints.js +63 -0
  394. package/lib/schemas/models/operational_roles.d.ts +263 -0
  395. package/lib/schemas/models/operational_roles.js +158 -0
  396. package/lib/schemas/models/order.d.ts +15284 -0
  397. package/lib/schemas/models/order.js +819 -0
  398. package/lib/schemas/models/platform.d.ts +34 -0
  399. package/lib/schemas/models/platform.js +30 -0
  400. package/lib/schemas/models/printer_settings.d.ts +217 -0
  401. package/lib/schemas/models/printer_settings.js +234 -0
  402. package/lib/schemas/models/public_holidays.d.ts +173 -0
  403. package/lib/schemas/models/public_holidays.js +61 -0
  404. package/lib/schemas/models/purchase_orders.d.ts +2675 -0
  405. package/lib/schemas/models/purchase_orders.js +327 -0
  406. package/lib/schemas/models/reservations.d.ts +66 -0
  407. package/lib/schemas/models/reservations.js +88 -0
  408. package/lib/schemas/models/reviews.d.ts +98 -0
  409. package/lib/schemas/models/reviews.js +148 -0
  410. package/lib/schemas/models/rider.d.ts +65 -0
  411. package/lib/schemas/models/rider.js +74 -0
  412. package/lib/schemas/models/short_inventory.d.ts +65 -0
  413. package/lib/schemas/models/short_inventory.js +46 -0
  414. package/lib/schemas/models/specials.d.ts +2551 -0
  415. package/lib/schemas/models/specials.js +145 -0
  416. package/lib/schemas/models/staff_shifts.d.ts +77 -0
  417. package/lib/schemas/models/staff_shifts.js +69 -0
  418. package/lib/schemas/models/stock_consumption.d.ts +77 -0
  419. package/lib/schemas/models/stock_consumption.js +64 -0
  420. package/lib/schemas/models/stock_entry.d.ts +65 -0
  421. package/lib/schemas/models/stock_entry.js +46 -0
  422. package/lib/schemas/models/stock_wastage.d.ts +71 -0
  423. package/lib/schemas/models/stock_wastage.js +54 -0
  424. package/lib/schemas/models/tenant.d.ts +468 -0
  425. package/lib/schemas/models/tenant.js +673 -0
  426. package/lib/schemas/models/tenant_days.d.ts +134 -0
  427. package/lib/schemas/models/tenant_days.js +110 -0
  428. package/lib/schemas/models/tenant_metadata.d.ts +77 -0
  429. package/lib/schemas/models/tenant_metadata.js +91 -0
  430. package/lib/schemas/models/tenant_shift_sessions.d.ts +146 -0
  431. package/lib/schemas/models/tenant_shift_sessions.js +125 -0
  432. package/lib/schemas/models/tenant_shifts.d.ts +53 -0
  433. package/lib/schemas/models/tenant_shifts.js +60 -0
  434. package/lib/schemas/models/tenant_staff.d.ts +896 -0
  435. package/lib/schemas/models/tenant_staff.js +96 -0
  436. package/lib/schemas/models/terminal_devices.d.ts +62 -0
  437. package/lib/schemas/models/terminal_devices.js +74 -0
  438. package/lib/schemas/models/tokens.d.ts +59 -0
  439. package/lib/schemas/models/tokens.js +109 -0
  440. package/lib/schemas/models/track_order_number.d.ts +395 -0
  441. package/lib/schemas/models/track_order_number.js +45 -0
  442. package/lib/schemas/models/void_order_items.d.ts +173 -0
  443. package/lib/schemas/models/void_order_items.js +169 -0
  444. package/lib/schemas/models/wallet.d.ts +38 -0
  445. package/lib/schemas/models/wallet.js +37 -0
  446. package/lib/schemas/models/wallet_transactions.d.ts +74 -0
  447. package/lib/schemas/models/wallet_transactions.js +96 -0
  448. package/lib/schemas/models/warehouse.d.ts +156 -0
  449. package/lib/schemas/models/warehouse.js +213 -0
  450. package/lib/schemas/models/warehouse_categories.d.ts +56 -0
  451. package/lib/schemas/models/warehouse_categories.js +65 -0
  452. package/lib/schemas/models/warehouse_clients.d.ts +53 -0
  453. package/lib/schemas/models/warehouse_clients.js +61 -0
  454. package/lib/schemas/models/warehouse_inventory_transactions.d.ts +83 -0
  455. package/lib/schemas/models/warehouse_inventory_transactions.js +110 -0
  456. package/lib/schemas/models/warehouse_invoices.d.ts +2675 -0
  457. package/lib/schemas/models/warehouse_invoices.js +327 -0
  458. package/lib/schemas/models/warehouse_item_transactions.d.ts +74 -0
  459. package/lib/schemas/models/warehouse_item_transactions.js +100 -0
  460. package/lib/schemas/models/warehouse_items.d.ts +131 -0
  461. package/lib/schemas/models/warehouse_items.js +127 -0
  462. package/lib/schemas/models/warehouse_operational_roles.d.ts +77 -0
  463. package/lib/schemas/models/warehouse_operational_roles.js +90 -0
  464. package/lib/schemas/models/warehouse_settings.d.ts +40 -0
  465. package/lib/schemas/models/warehouse_settings.js +40 -0
  466. package/lib/schemas/models/warehouse_staff.d.ts +65 -0
  467. package/lib/schemas/models/warehouse_staff.js +78 -0
  468. package/lib/schemas/models/warehouse_track_order_number.d.ts +50 -0
  469. package/lib/schemas/models/warehouse_track_order_number.js +52 -0
  470. package/lib/schemas/models/warehouse_vendors.d.ts +89 -0
  471. package/lib/schemas/models/warehouse_vendors.js +73 -0
  472. package/lib/schemas/types/app_configs.d.ts +9 -0
  473. package/lib/schemas/types/app_configs.js +2 -0
  474. package/lib/schemas/types/applied-order-discounts.d.ts +22 -0
  475. package/lib/schemas/types/applied-order-discounts.js +2 -0
  476. package/lib/schemas/types/brand.d.ts +32 -0
  477. package/lib/schemas/types/brand.js +2 -0
  478. package/lib/schemas/types/cash_drawer_sessions.d.ts +18 -0
  479. package/lib/schemas/types/cash_drawer_sessions.js +2 -0
  480. package/lib/schemas/types/cash_drawers.d.ts +9 -0
  481. package/lib/schemas/types/cash_drawers.js +2 -0
  482. package/lib/schemas/types/cash_in_out.d.ts +19 -0
  483. package/lib/schemas/types/cash_in_out.js +2 -0
  484. package/lib/schemas/types/category.d.ts +15 -0
  485. package/lib/schemas/types/category.js +2 -0
  486. package/lib/schemas/types/close_dates.d.ts +12 -0
  487. package/lib/schemas/types/close_dates.js +2 -0
  488. package/lib/schemas/types/common.d.ts +34 -0
  489. package/lib/schemas/types/common.js +2 -0
  490. package/lib/schemas/types/courses.d.ts +15 -0
  491. package/lib/schemas/types/courses.js +2 -0
  492. package/lib/schemas/types/customers.d.ts +51 -0
  493. package/lib/schemas/types/customers.js +2 -0
  494. package/lib/schemas/types/deliveries.d.ts +28 -0
  495. package/lib/schemas/types/deliveries.js +2 -0
  496. package/lib/schemas/types/delivery_areas.d.ts +23 -0
  497. package/lib/schemas/types/delivery_areas.js +2 -0
  498. package/lib/schemas/types/dinein_floors.d.ts +23 -0
  499. package/lib/schemas/types/dinein_floors.js +2 -0
  500. package/lib/schemas/types/dinein_tables.d.ts +19 -0
  501. package/lib/schemas/types/dinein_tables.js +2 -0
  502. package/lib/schemas/types/dinein_tables_fingerprints.d.ts +17 -0
  503. package/lib/schemas/types/dinein_tables_fingerprints.js +2 -0
  504. package/lib/schemas/types/discounts.d.ts +21 -0
  505. package/lib/schemas/types/discounts.js +2 -0
  506. package/lib/schemas/types/drivers.d.ts +13 -0
  507. package/lib/schemas/types/drivers.js +2 -0
  508. package/lib/schemas/types/expense_category.d.ts +20 -0
  509. package/lib/schemas/types/expense_category.js +2 -0
  510. package/lib/schemas/types/expense_details.d.ts +26 -0
  511. package/lib/schemas/types/expense_details.js +2 -0
  512. package/lib/schemas/types/halfhalf_setup.d.ts +26 -0
  513. package/lib/schemas/types/halfhalf_setup.js +2 -0
  514. package/lib/schemas/types/index.d.ts +67 -0
  515. package/lib/schemas/types/index.js +83 -0
  516. package/lib/schemas/types/instore_shift_sessions.d.ts +33 -0
  517. package/lib/schemas/types/instore_shift_sessions.js +2 -0
  518. package/lib/schemas/types/instore_shifts.d.ts +11 -0
  519. package/lib/schemas/types/instore_shifts.js +2 -0
  520. package/lib/schemas/types/internal_expense_details.d.ts +14 -0
  521. package/lib/schemas/types/internal_expense_details.js +2 -0
  522. package/lib/schemas/types/internal_leads.d.ts +18 -0
  523. package/lib/schemas/types/internal_leads.js +2 -0
  524. package/lib/schemas/types/internal_restaurant_details.d.ts +17 -0
  525. package/lib/schemas/types/internal_restaurant_details.js +2 -0
  526. package/lib/schemas/types/inventory.d.ts +48 -0
  527. package/lib/schemas/types/inventory.js +2 -0
  528. package/lib/schemas/types/inventory_categories.d.ts +11 -0
  529. package/lib/schemas/types/inventory_categories.js +2 -0
  530. package/lib/schemas/types/inventory_transactions.d.ts +23 -0
  531. package/lib/schemas/types/inventory_transactions.js +2 -0
  532. package/lib/schemas/types/item.d.ts +88 -0
  533. package/lib/schemas/types/item.js +2 -0
  534. package/lib/schemas/types/item_transactions.d.ts +19 -0
  535. package/lib/schemas/types/item_transactions.js +2 -0
  536. package/lib/schemas/types/marketing.d.ts +10 -0
  537. package/lib/schemas/types/marketing.js +2 -0
  538. package/lib/schemas/types/marketing_fingerprints.d.ts +16 -0
  539. package/lib/schemas/types/marketing_fingerprints.js +2 -0
  540. package/lib/schemas/types/menu.d.ts +17 -0
  541. package/lib/schemas/types/menu.js +2 -0
  542. package/lib/schemas/types/messaging_devices.d.ts +16 -0
  543. package/lib/schemas/types/messaging_devices.js +2 -0
  544. package/lib/schemas/types/modifier_extras.d.ts +31 -0
  545. package/lib/schemas/types/modifier_extras.js +2 -0
  546. package/lib/schemas/types/multi_tenants.d.ts +24 -0
  547. package/lib/schemas/types/multi_tenants.js +2 -0
  548. package/lib/schemas/types/offers.d.ts +82 -0
  549. package/lib/schemas/types/offers.js +2 -0
  550. package/lib/schemas/types/offers_fingerprints.d.ts +11 -0
  551. package/lib/schemas/types/offers_fingerprints.js +2 -0
  552. package/lib/schemas/types/operational_roles.d.ts +41 -0
  553. package/lib/schemas/types/operational_roles.js +18 -0
  554. package/lib/schemas/types/order.d.ts +225 -0
  555. package/lib/schemas/types/order.js +2 -0
  556. package/lib/schemas/types/platform.d.ts +6 -0
  557. package/lib/schemas/types/platform.js +2 -0
  558. package/lib/schemas/types/pos_days.d.ts +29 -0
  559. package/lib/schemas/types/pos_days.js +2 -0
  560. package/lib/schemas/types/pos_shifts.d.ts +33 -0
  561. package/lib/schemas/types/pos_shifts.js +2 -0
  562. package/lib/schemas/types/printer_settings.d.ts +83 -0
  563. package/lib/schemas/types/printer_settings.js +3 -0
  564. package/lib/schemas/types/public_holidays.d.ts +14 -0
  565. package/lib/schemas/types/public_holidays.js +2 -0
  566. package/lib/schemas/types/purchase_orders.d.ts +69 -0
  567. package/lib/schemas/types/purchase_orders.js +2 -0
  568. package/lib/schemas/types/reservations.d.ts +17 -0
  569. package/lib/schemas/types/reservations.js +2 -0
  570. package/lib/schemas/types/reviews.d.ts +28 -0
  571. package/lib/schemas/types/reviews.js +2 -0
  572. package/lib/schemas/types/rider.d.ts +16 -0
  573. package/lib/schemas/types/rider.js +2 -0
  574. package/lib/schemas/types/short_inventory.d.ts +9 -0
  575. package/lib/schemas/types/short_inventory.js +2 -0
  576. package/lib/schemas/types/specials.d.ts +42 -0
  577. package/lib/schemas/types/specials.js +2 -0
  578. package/lib/schemas/types/split_bill.d.ts +18 -0
  579. package/lib/schemas/types/split_bill.js +2 -0
  580. package/lib/schemas/types/staff_shifts.d.ts +15 -0
  581. package/lib/schemas/types/staff_shifts.js +2 -0
  582. package/lib/schemas/types/stock_consumption.d.ts +13 -0
  583. package/lib/schemas/types/stock_consumption.js +2 -0
  584. package/lib/schemas/types/stock_entry.d.ts +9 -0
  585. package/lib/schemas/types/stock_entry.js +2 -0
  586. package/lib/schemas/types/stock_wastage.d.ts +11 -0
  587. package/lib/schemas/types/stock_wastage.js +2 -0
  588. package/lib/schemas/types/tenant.d.ts +175 -0
  589. package/lib/schemas/types/tenant.js +2 -0
  590. package/lib/schemas/types/tenant_days.d.ts +29 -0
  591. package/lib/schemas/types/tenant_days.js +2 -0
  592. package/lib/schemas/types/tenant_metadata.d.ts +13 -0
  593. package/lib/schemas/types/tenant_metadata.js +2 -0
  594. package/lib/schemas/types/tenant_shift_sessions.d.ts +33 -0
  595. package/lib/schemas/types/tenant_shift_sessions.js +2 -0
  596. package/lib/schemas/types/tenant_shifts.d.ts +13 -0
  597. package/lib/schemas/types/tenant_shifts.js +2 -0
  598. package/lib/schemas/types/tenant_staff.d.ts +22 -0
  599. package/lib/schemas/types/tenant_staff.js +2 -0
  600. package/lib/schemas/types/terminal_devices.d.ts +16 -0
  601. package/lib/schemas/types/terminal_devices.js +2 -0
  602. package/lib/schemas/types/third_party_payments.d.ts +41 -0
  603. package/lib/schemas/types/third_party_payments.js +2 -0
  604. package/lib/schemas/types/tokens.d.ts +15 -0
  605. package/lib/schemas/types/tokens.js +2 -0
  606. package/lib/schemas/types/track_order_number.d.ts +10 -0
  607. package/lib/schemas/types/track_order_number.js +2 -0
  608. package/lib/schemas/types/used_ingredients.d.ts +8 -0
  609. package/lib/schemas/types/used_ingredients.js +2 -0
  610. package/lib/schemas/types/void_order_items.d.ts +36 -0
  611. package/lib/schemas/types/void_order_items.js +2 -0
  612. package/lib/schemas/types/wallet.d.ts +7 -0
  613. package/lib/schemas/types/wallet.js +2 -0
  614. package/lib/schemas/types/wallet_transactions.d.ts +20 -0
  615. package/lib/schemas/types/wallet_transactions.js +2 -0
  616. package/lib/schemas/types/warehouse.d.ts +47 -0
  617. package/lib/schemas/types/warehouse.js +2 -0
  618. package/lib/schemas/types/warehouse_categories.d.ts +13 -0
  619. package/lib/schemas/types/warehouse_categories.js +2 -0
  620. package/lib/schemas/types/warehouse_clients.d.ts +13 -0
  621. package/lib/schemas/types/warehouse_clients.js +2 -0
  622. package/lib/schemas/types/warehouse_inventory_transactions.d.ts +23 -0
  623. package/lib/schemas/types/warehouse_inventory_transactions.js +2 -0
  624. package/lib/schemas/types/warehouse_invoices.d.ts +69 -0
  625. package/lib/schemas/types/warehouse_invoices.js +2 -0
  626. package/lib/schemas/types/warehouse_item_transactions.d.ts +20 -0
  627. package/lib/schemas/types/warehouse_item_transactions.js +2 -0
  628. package/lib/schemas/types/warehouse_items.d.ts +65 -0
  629. package/lib/schemas/types/warehouse_items.js +2 -0
  630. package/lib/schemas/types/warehouse_operational_roles.d.ts +22 -0
  631. package/lib/schemas/types/warehouse_operational_roles.js +18 -0
  632. package/lib/schemas/types/warehouse_settings.d.ts +8 -0
  633. package/lib/schemas/types/warehouse_settings.js +2 -0
  634. package/lib/schemas/types/warehouse_staff.d.ts +17 -0
  635. package/lib/schemas/types/warehouse_staff.js +2 -0
  636. package/lib/schemas/types/warehouse_track_order_number.d.ts +11 -0
  637. package/lib/schemas/types/warehouse_track_order_number.js +2 -0
  638. package/lib/schemas/types/warehouse_vendors.d.ts +16 -0
  639. package/lib/schemas/types/warehouse_vendors.js +2 -0
  640. package/package.json +59 -0
@@ -0,0 +1,1858 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getXReportData = void 0;
7
+ exports.getXReportHtml = getXReportHtml;
8
+ const moment_1 = __importDefault(require("moment"));
9
+ const constants_1 = require("../../constants");
10
+ const common_1 = require("./common");
11
+ const price_conversion_1 = require("./price-conversion");
12
+ const getHead = (monochrome) => {
13
+ const palette = monochrome
14
+ ? {
15
+ headingBackground: '#ffffff',
16
+ headingText: '#000000',
17
+ titleBackground: '#ffffff',
18
+ titleText: '#000000',
19
+ text: '#000000',
20
+ border: '#000000',
21
+ borderRight: '#000000',
22
+ tableHeaderBackground: '#ffffff',
23
+ tableHeaderText: '#000000',
24
+ }
25
+ : {
26
+ headingBackground: '#431665',
27
+ headingText: '#ffffff',
28
+ titleBackground: '#666666',
29
+ titleText: '#ffffff',
30
+ text: '#333333',
31
+ border: '#ffffff',
32
+ borderRight: '#431665',
33
+ tableHeaderBackground: '#431665',
34
+ tableHeaderText: '#ffffff',
35
+ };
36
+ const fontLink = monochrome
37
+ ? `<link
38
+ rel="stylesheet"
39
+ href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;500;700&display=swap"
40
+ crossorigin="anonymous"
41
+ />`
42
+ : `<link
43
+ rel="stylesheet"
44
+ href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&amp;display=swap"
45
+ crossorigin="anonymous"
46
+ />`;
47
+ return `<head>
48
+ <meta charset="UTF-8" />
49
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
50
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
51
+ ${fontLink}
52
+ <style>
53
+ .cssc-1flmrcm-kjlask {
54
+ -webkit-font-smoothing: antialiased;
55
+ -webkit-text-size-adjust: 100%;
56
+ color: ${palette.text};
57
+ line-height: 1.15rem;
58
+ font-size: 1rem;
59
+ font-family: Roboto, Public Sans, sans-serif;
60
+ font-weight: 400;
61
+ box-sizing: border-box;
62
+ display: flex;
63
+ flex-direction: column;
64
+ flex: 1;
65
+ margin: 0;
66
+ margin-top: 8px;
67
+ background-color: #ffffff;
68
+ }
69
+ .cssc-16f6p1q-kjlask {
70
+ -webkit-font-smoothing: antialiased;
71
+ -webkit-text-size-adjust: 100%;
72
+ color: ${palette.text};
73
+ line-height: 1.15rem;
74
+ font-size: 1rem;
75
+ font-family: Roboto, Public Sans, sans-serif;
76
+ font-weight: 400;
77
+ box-sizing: inherit;
78
+ display: flex;
79
+ flex-direction: column;
80
+ flex: 1;
81
+ margin: 0;
82
+ border: 1px solid ${palette.borderRight};
83
+ }
84
+
85
+ .cssc-1qeq10-kjlask {
86
+ display: flex;
87
+ flex-direction: column;
88
+ align-items: center;
89
+ justify-content: center;
90
+ gap: 4px;
91
+ margin-top: 8px;
92
+ margin-bottom: 8px;
93
+ }
94
+
95
+ .cssc-1owvoyj-kjhgs {
96
+ -webkit-font-smoothing: antialiased;
97
+ -webkit-text-size-adjust: 100%;
98
+ color: ${palette.text};
99
+ line-height: 1.15rem;
100
+ font-size: 1rem;
101
+ font-family: Roboto, Public Sans, sans-serif;
102
+ font-weight: 400;
103
+ box-sizing: border-box;
104
+ display: flex;
105
+ flex-wrap: wrap;
106
+ flex-direction: row;
107
+ margin-top: -24px;
108
+ width: calc(100% + 16px);
109
+ margin-left: -16px;
110
+ -webkit-box-pack: center;
111
+ justify-content: center;
112
+ }
113
+
114
+ .cssc-cjhduv-kjhgs {
115
+ -webkit-font-smoothing: antialiased;
116
+ -webkit-text-size-adjust: 100%;
117
+ color: ${palette.text};
118
+ line-height: 1.15rem;
119
+ font-size: 1rem;
120
+ font-family: Roboto, Public Sans, sans-serif;
121
+ font-weight: 400;
122
+ box-sizing: border-box;
123
+ margin: 0;
124
+ flex-direction: row;
125
+ flex-basis: 100%;
126
+ -webkit-box-flex: 0;
127
+ flex-grow: 0;
128
+ max-width: 100%;
129
+ padding-top: 24px;
130
+ padding-left: 16px;
131
+ }
132
+
133
+ .cssc-1qek100-kjlask {
134
+ -webkit-font-smoothing: antialiased;
135
+ -webkit-text-size-adjust: 100%;
136
+ color: ${palette.text};
137
+ line-height: 1.15rem;
138
+ font-size: 1rem;
139
+ font-family: Roboto, Public Sans, sans-serif;
140
+ font-weight: 400;
141
+ box-sizing: inherit;
142
+ display: flex;
143
+ flex-direction: column;
144
+ background-color: #ffffff;
145
+ overflow: hidden;
146
+ flex: 1;
147
+ scroll-margin-top: 120px;
148
+ }
149
+
150
+ .cssc-lpyf3a-skks {
151
+ -webkit-font-smoothing: antialiased;
152
+ -webkit-text-size-adjust: 100%;
153
+ position: relative;
154
+ box-sizing: border-box;
155
+ -webkit-tap-highlight-color: transparent;
156
+ outline: 0;
157
+ border: 0;
158
+ margin: 0;
159
+ border-radius: 0;
160
+ vertical-align: middle;
161
+ -webkit-appearance: none;
162
+ text-decoration: none;
163
+ text-align: center;
164
+ height: 40px;
165
+ display: flex;
166
+ -webkit-box-align: center;
167
+ align-items: center;
168
+ -webkit-box-pack: center;
169
+ justify-content: center;
170
+ padding: 10px;
171
+ background-color: ${palette.headingBackground};
172
+ color: ${palette.headingText};
173
+ border-bottom: 1px solid ${palette.borderRight};
174
+ }
175
+
176
+ .cssc-1gb95rg-oilkj {
177
+ -webkit-font-smoothing: antialiased;
178
+ -webkit-text-size-adjust: 100%;
179
+ -webkit-tap-highlight-color: transparent;
180
+ color: ${palette.headingText};
181
+ box-sizing: inherit;
182
+ margin: 0;
183
+ font-weight: 500;
184
+ line-height: 1.25rem;
185
+ font-size: 1.25rem;
186
+ font-family: Roboto, Public Sans, sans-serif;
187
+ text-align: center;
188
+ flex: 1;
189
+ }
190
+
191
+ .cssc-rorn0c-lkask {
192
+ -webkit-font-smoothing: antialiased;
193
+ -webkit-text-size-adjust: 100%;
194
+ color: ${palette.text};
195
+ line-height: 1.15rem;
196
+ font-size: 1rem;
197
+ font-family: Roboto, Public Sans, sans-serif;
198
+ font-weight: 400;
199
+ box-sizing: inherit;
200
+ width: 100%;
201
+ overflow-x: auto;
202
+ }
203
+
204
+ .cssc-1m6vi3w-posi {
205
+ -webkit-font-smoothing: antialiased;
206
+ -webkit-text-size-adjust: 100%;
207
+ color: ${palette.text};
208
+ line-height: 1.15rem;
209
+ font-size: 1rem;
210
+ font-family: Roboto, Public Sans, sans-serif;
211
+ font-weight: 400;
212
+ box-sizing: inherit;
213
+ display: table;
214
+ width: 100%;
215
+ border-collapse: collapse;
216
+ border-spacing: 0;
217
+ }
218
+
219
+ .cssc-15wwp11-qwem {
220
+ -webkit-font-smoothing: antialiased;
221
+ -webkit-text-size-adjust: 100%;
222
+ color: ${palette.text};
223
+ line-height: 1.15rem;
224
+ font-size: 1rem;
225
+ font-family: Roboto, Public Sans, sans-serif;
226
+ font-weight: 400;
227
+ border-collapse: collapse;
228
+ border-spacing: 0;
229
+ box-sizing: inherit;
230
+ display: table-header-group;
231
+ }
232
+
233
+ .cssc-ho2sf9-sanbv {
234
+ -webkit-font-smoothing: antialiased;
235
+ -webkit-text-size-adjust: 100%;
236
+ line-height: 1.15rem;
237
+ font-size: 1rem;
238
+ font-family: Roboto, Public Sans, sans-serif;
239
+ font-weight: 400;
240
+ border-collapse: collapse;
241
+ border-spacing: 0;
242
+ box-sizing: inherit;
243
+ color: inherit;
244
+ display: table-row;
245
+ vertical-align: middle;
246
+ outline: 0;
247
+ }
248
+
249
+ .cssc-idkl0b-ssaaw {
250
+ -webkit-font-smoothing: antialiased;
251
+ -webkit-text-size-adjust: 100%;
252
+ border-collapse: collapse;
253
+ border-spacing: 0;
254
+ box-sizing: inherit;
255
+ line-height: 1.25rem;
256
+ font-size: 0.875rem;
257
+ font-family: Roboto, Public Sans, sans-serif;
258
+ font-weight: 500;
259
+ display: table-cell;
260
+ vertical-align: inherit;
261
+ text-align: left;
262
+ padding: 4px 10px;
263
+ background-color: ${palette.tableHeaderBackground};
264
+ color: ${palette.tableHeaderText};
265
+ border-right: 1px solid ${palette.border};
266
+ }
267
+
268
+ .cssc-rq2z2r-oilkj {
269
+ -webkit-font-smoothing: antialiased;
270
+ -webkit-text-size-adjust: 100%;
271
+ border-collapse: collapse;
272
+ border-spacing: 0;
273
+ text-align: left;
274
+ color: ${palette.tableHeaderText};
275
+ box-sizing: inherit;
276
+ margin: 0;
277
+ font-weight: 500;
278
+ line-height: 1.15rem;
279
+ font-size: 1rem;
280
+ font-family: Roboto, Public Sans, sans-serif;
281
+ }
282
+
283
+ .cssc-1ymm2he-ssaaw {
284
+ -webkit-font-smoothing: antialiased;
285
+ -webkit-text-size-adjust: 100%;
286
+ border-collapse: collapse;
287
+ border-spacing: 0;
288
+ box-sizing: inherit;
289
+ line-height: 1.25rem;
290
+ font-size: 0.875rem;
291
+ font-family: Roboto, Public Sans, sans-serif;
292
+ font-weight: 500;
293
+ display: table-cell;
294
+ vertical-align: inherit;
295
+ text-align: right;
296
+ padding: 4px 10px;
297
+ flex-direction: row-reverse;
298
+ background-color: ${palette.tableHeaderBackground};
299
+ color: ${palette.tableHeaderText};
300
+ border-right: 1px solid ${palette.border};
301
+ }
302
+
303
+ .cssc-eyhmry-ssaaw {
304
+ -webkit-font-smoothing: antialiased;
305
+ -webkit-text-size-adjust: 100%;
306
+ border-collapse: collapse;
307
+ border-spacing: 0;
308
+ box-sizing: inherit;
309
+ line-height: 1.25rem;
310
+ font-size: 0.875rem;
311
+ font-family: Roboto, Public Sans, sans-serif;
312
+ font-weight: 500;
313
+ display: table-cell;
314
+ vertical-align: inherit;
315
+ text-align: right;
316
+ padding: 4px 10px;
317
+ flex-direction: row-reverse;
318
+ background-color: ${palette.tableHeaderBackground};
319
+ color: ${palette.tableHeaderText};
320
+ }
321
+
322
+ .cssc-apqrd9-skjas {
323
+ -webkit-font-smoothing: antialiased;
324
+ -webkit-text-size-adjust: 100%;
325
+ color: ${palette.text};
326
+ line-height: 1.15rem;
327
+ font-size: 1rem;
328
+ font-family: Roboto, Public Sans, sans-serif;
329
+ font-weight: 400;
330
+ border-collapse: collapse;
331
+ border-spacing: 0;
332
+ box-sizing: inherit;
333
+ display: table-row-group;
334
+ }
335
+
336
+ .cssc-1qrvgoi-sanbv {
337
+ -webkit-font-smoothing: antialiased;
338
+ -webkit-text-size-adjust: 100%;
339
+ line-height: 1.15rem;
340
+ font-size: 1rem;
341
+ font-family: Roboto, Public Sans, sans-serif;
342
+ font-weight: 400;
343
+
344
+ border-collapse: collapse;
345
+ border-spacing: 0;
346
+ box-sizing: inherit;
347
+ color: inherit;
348
+ display: table-row;
349
+ vertical-align: middle;
350
+ outline: 0;
351
+ background-color: ${palette.titleBackground};
352
+ }
353
+
354
+ .cssc-gnx8yv-ssaaw {
355
+ -webkit-font-smoothing: antialiased;
356
+ -webkit-text-size-adjust: 100%;
357
+
358
+ border-collapse: collapse;
359
+ border-spacing: 0;
360
+ box-sizing: inherit;
361
+ line-height: 1.1375rem;
362
+ font-size: 0.875rem;
363
+ font-family: Roboto, Public Sans, sans-serif;
364
+ font-weight: 400;
365
+ display: table-cell;
366
+ vertical-align: inherit;
367
+ border-top: 1px solid ${palette.border};
368
+ text-align: left;
369
+ padding: 4px 10px;
370
+ color: ${palette.titleText};
371
+ }
372
+
373
+ .cssc-1b7x1hq-oilkj {
374
+ -webkit-font-smoothing: antialiased;
375
+ -webkit-text-size-adjust: 100%;
376
+
377
+ border-collapse: collapse;
378
+ border-spacing: 0;
379
+ box-sizing: inherit;
380
+ margin: 0;
381
+ font-weight: 500;
382
+ line-height: 1.54375rem;
383
+ font-size: 1.1875rem;
384
+ font-family: Roboto, Public Sans, sans-serif;
385
+ text-align: center;
386
+ color: ${palette.titleText};
387
+ }
388
+
389
+ .cssc-kkegnv-sanbv {
390
+ -webkit-font-smoothing: antialiased;
391
+ -webkit-text-size-adjust: 100%;
392
+ line-height: 1.15rem;
393
+ font-size: 1rem;
394
+ font-family: Roboto, Public Sans, sans-serif;
395
+ font-weight: 400;
396
+
397
+ border-collapse: collapse;
398
+ border-spacing: 0;
399
+ box-sizing: inherit;
400
+ color: inherit;
401
+ display: table-row;
402
+ vertical-align: middle;
403
+ outline: 0;
404
+ }
405
+
406
+ .cssc-1d7qqp0-ssaaw {
407
+ -webkit-font-smoothing: antialiased;
408
+ -webkit-text-size-adjust: 100%;
409
+
410
+ border-collapse: collapse;
411
+ border-spacing: 0;
412
+ box-sizing: inherit;
413
+ line-height: 1.1375rem;
414
+ font-size: 0.875rem;
415
+ font-family: Roboto, Public Sans, sans-serif;
416
+ font-weight: 400;
417
+ display: table-cell;
418
+ vertical-align: inherit;
419
+ border-bottom: 1px solid rgba(240, 240, 240, 1);
420
+ text-align: left;
421
+ padding: 4px 10px;
422
+ color: ${palette.text};
423
+ border-right: 1px solid ${palette.borderRight};
424
+ }
425
+
426
+ .cssc-1ebo3of-oilkj {
427
+ -webkit-font-smoothing: antialiased;
428
+ -webkit-text-size-adjust: 100%;
429
+
430
+ border-collapse: collapse;
431
+ border-spacing: 0;
432
+ text-align: left;
433
+ color: ${palette.text};
434
+ box-sizing: inherit;
435
+ margin: 0;
436
+ line-height: 1.1375rem;
437
+ font-size: 0.875rem;
438
+ font-family: Roboto, Public Sans, sans-serif;
439
+ font-weight: 400;
440
+ }
441
+
442
+ .cssc-up54xb-ssaaw {
443
+ -webkit-font-smoothing: antialiased;
444
+ -webkit-text-size-adjust: 100%;
445
+
446
+ border-collapse: collapse;
447
+ border-spacing: 0;
448
+ box-sizing: inherit;
449
+ line-height: 1.1375rem;
450
+ font-size: 0.875rem;
451
+ font-family: Roboto, Public Sans, sans-serif;
452
+ font-weight: 400;
453
+ display: table-cell;
454
+ vertical-align: inherit;
455
+ border-bottom: 1px solid rgba(240, 240, 240, 1);
456
+ text-align: right;
457
+ padding: 4px 10px;
458
+ color: ${palette.text};
459
+ flex-direction: row-reverse;
460
+ border-right: 1px solid ${palette.borderRight};
461
+ }
462
+
463
+ .cssc-v53jtm-ssaaw {
464
+ -webkit-font-smoothing: antialiased;
465
+ -webkit-text-size-adjust: 100%;
466
+
467
+ border-collapse: collapse;
468
+ border-spacing: 0;
469
+ box-sizing: inherit;
470
+ line-height: 1.1375rem;
471
+ font-size: 0.875rem;
472
+ font-family: Roboto, Public Sans, sans-serif;
473
+ font-weight: 400;
474
+ display: table-cell;
475
+ vertical-align: inherit;
476
+ border-bottom: 1px solid rgba(240, 240, 240, 1);
477
+ text-align: right;
478
+ padding: 4px 10px;
479
+ color: ${palette.text};
480
+ flex-direction: row-reverse;
481
+ }
482
+
483
+ .cssc-1ho5x3sk-kjlask {
484
+ padding: 10px;
485
+ width: 100%;
486
+ border-top: 1px solid ${palette.borderRight};
487
+ }
488
+
489
+ .cssc-1ho5x3p-kjlask {
490
+ -webkit-font-smoothing: antialiased;
491
+ -webkit-text-size-adjust: 100%;
492
+ color: ${palette.text};
493
+ line-height: 1.15rem;
494
+ font-size: 1rem;
495
+ font-family: Roboto, Public Sans, sans-serif;
496
+ font-weight: 400;
497
+ box-sizing: inherit;
498
+ display: flex;
499
+ flex-direction: column;
500
+ max-width: 400px;
501
+ gap: 5px
502
+ }
503
+
504
+ .cssc-gmwslw-kjlask {
505
+ -webkit-font-smoothing: antialiased;
506
+ -webkit-text-size-adjust: 100%;
507
+ color: ${palette.text};
508
+ line-height: 1.15rem;
509
+ font-size: 1rem;
510
+ font-family: Roboto, Public Sans, sans-serif;
511
+ font-weight: 400;
512
+ box-sizing: inherit;
513
+ display: flex;
514
+ flex-direction: row;
515
+ -webkit-box-pack: justify;
516
+ justify-content: space-between;
517
+ margin: 0;
518
+ }
519
+
520
+ .cssc-1iy4zoj-oilkj {
521
+ -webkit-font-smoothing: antialiased;
522
+ -webkit-text-size-adjust: 100%;
523
+ color: ${palette.text};
524
+ box-sizing: inherit;
525
+ margin: 0;
526
+ line-height: 1.15rem;
527
+ font-size: 1rem;
528
+ font-family: Roboto, Public Sans, sans-serif;
529
+ font-weight: 400;
530
+ }
531
+
532
+ .cssc-13sv1r4-oilkj {
533
+ -webkit-font-smoothing: antialiased;
534
+ -webkit-text-size-adjust: 100%;
535
+ color: ${palette.text};
536
+ box-sizing: inherit;
537
+ margin: 0;
538
+ line-height: 1.15rem;
539
+ font-size: 1rem;
540
+ font-family: Roboto, Public Sans, sans-serif;
541
+ font-weight: 700;
542
+ }
543
+
544
+ .cssc-1l6ueuj-sjaksl {
545
+ -webkit-font-smoothing: antialiased;
546
+ -webkit-text-size-adjust: 100%;
547
+ color: ${palette.text};
548
+ line-height: 1.15rem;
549
+ font-size: 1rem;
550
+ font-family: Roboto, Public Sans, sans-serif;
551
+ font-weight: 400;
552
+ box-sizing: inherit;
553
+ flex-shrink: 0;
554
+ border-width: 0;
555
+ border-style: solid;
556
+ border-color: #dcdcdc;
557
+ border-bottom-width: thin;
558
+ margin: 0;
559
+ margin-top: 4px;
560
+ }
561
+
562
+ .cssc-1pm8g43-kjlask {
563
+ -webkit-font-smoothing: antialiased;
564
+ -webkit-text-size-adjust: 100%;
565
+ color: ${palette.text};
566
+ line-height: 1.15rem;
567
+ font-size: 1rem;
568
+ font-family: Roboto, Public Sans, sans-serif;
569
+ font-weight: 400;
570
+ box-sizing: inherit;
571
+ display: flex;
572
+ flex-direction: column;
573
+ max-width: 400px;
574
+ margin: 0;
575
+ gap: 5px;
576
+ }
577
+
578
+ .cssc-gmwslw-kjlask {
579
+ -webkit-font-smoothing: antialiased;
580
+ -webkit-text-size-adjust: 100%;
581
+ color: ${palette.text};
582
+ line-height: 1.15rem;
583
+ font-size: 1rem;
584
+ font-family: Roboto, Public Sans, sans-serif;
585
+ font-weight: 400;
586
+ box-sizing: inherit;
587
+ display: flex;
588
+ flex-direction: row;
589
+ -webkit-box-pack: justify;
590
+ justify-content: space-between;
591
+ margin: 0;
592
+ }
593
+
594
+ .cssc-1pm8m44-kjlask {
595
+ -webkit-font-smoothing: antialiased;
596
+ -webkit-text-size-adjust: 100%;
597
+ -webkit-user-select: none;
598
+ border-collapse: collapse;
599
+ border-spacing: 0;
600
+ line-height: 1.1375rem;
601
+ font-size: 0.875rem;
602
+ font-family: Roboto,Public Sans,sans-serif;
603
+ font-weight: 400;
604
+ text-align: left;
605
+ color: ${palette.text};
606
+ box-sizing: inherit;
607
+ display: flex;
608
+ flex-direction: row;
609
+ }
610
+
611
+ .cssc-1ebo3of-gaplas {
612
+ -webkit-font-smoothing: antialiased;
613
+ -webkit-text-size-adjust: 100%;
614
+ -webkit-user-select: none;
615
+ border-collapse: collapse;
616
+ border-spacing: 0;
617
+ line-height: 1.1375rem;
618
+ font-size: 0.875rem;
619
+ font-family: Roboto,Public Sans,sans-serif;
620
+ font-weight: 400;
621
+ text-align: left;
622
+ color: ${palette.text};
623
+ box-sizing: inherit;
624
+ width: 15px;
625
+ border-left: 1px solid #DCDCDC;
626
+ border-bottom: 1px solid #DCDCDC;
627
+ margin: 0;
628
+ }
629
+
630
+ .cssc-lpyf3z-kjlask {
631
+ -webkit-font-smoothing: antialiased;
632
+ -webkit-text-size-adjust: 100%;
633
+ color: ${palette.text};
634
+ line-height: 1.15rem;
635
+ font-size: 1rem;
636
+ font-family: Roboto,Public Sans,sans-serif;
637
+ font-weight: 400;
638
+ -webkit-user-select: none;
639
+ box-sizing: inherit;
640
+ display: flex;
641
+ flex-direction: column;
642
+ align-items: flex-start;
643
+ }
644
+
645
+ .cssc-1ebo3gf-oilkj {
646
+ -webkit-font-smoothing: antialiased;
647
+ -webkit-text-size-adjust: 100%;
648
+ -webkit-user-select: none;
649
+ box-sizing: inherit;
650
+ margin: 0;
651
+ line-height: 0.975rem;
652
+ font-size: 0.75rem;
653
+ font-family: Roboto,Public Sans,sans-serif;
654
+ font-weight: 400;
655
+ color: ${palette.text};
656
+ }
657
+
658
+ ${monochrome
659
+ ? `
660
+ /* Receipt Printer Optimized Styles - Monochrome */
661
+
662
+ /* Container Styles */
663
+ .cssc-1flmrcm-kjlask {
664
+ margin-top: 4px !important;
665
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
666
+ }
667
+
668
+ .cssc-1qeq10-kjlask {
669
+ gap: 2px !important;
670
+ margin-top: 4px !important;
671
+ margin-bottom: 4px !important;
672
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
673
+ }
674
+
675
+ .cssc-1owvoyj-kjhgs {
676
+ margin-top: 0 !important;
677
+ margin-left: 0 !important;
678
+ width: 100% !important;
679
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
680
+ }
681
+
682
+ .cssc-cjhduv-kjhgs {
683
+ padding-top: 4px !important;
684
+ padding-left: 0 !important;
685
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
686
+ }
687
+
688
+ /* Header Styles */
689
+ .cssc-lpyf3a-skks {
690
+ height: 20px !important;
691
+ padding: 2px 4px !important;
692
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
693
+ }
694
+
695
+ .cssc-1gb95rg-oilkj {
696
+ font-size: 24px !important;
697
+ line-height: 26px !important;
698
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
699
+ }
700
+
701
+ .cssc-1b7x1hq-oilkj {
702
+ font-size: 22px !important;
703
+ line-height: 24px !important;
704
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
705
+ }
706
+
707
+ /* Table Cell Styles */
708
+ .cssc-idkl0b-ssaaw,
709
+ .cssc-1ymm2he-ssaaw,
710
+ .cssc-eyhmry-ssaaw {
711
+ padding: 2px 4px !important;
712
+ font-size: 17px !important;
713
+ line-height: 19px !important;
714
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
715
+ }
716
+
717
+ .cssc-gnx8yv-ssaaw,
718
+ .cssc-1d7qqp0-ssaaw,
719
+ .cssc-up54xb-ssaaw,
720
+ .cssc-v53jtm-ssaaw {
721
+ padding: 2px 4px !important;
722
+ font-size: 17px !important;
723
+ line-height: 19px !important;
724
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
725
+ }
726
+
727
+ /* Footer Styles */
728
+ .cssc-1ho5x3sk-kjlask {
729
+ padding: 4px !important;
730
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
731
+ }
732
+
733
+ .cssc-1ho5x3p-kjlask {
734
+ gap: 2px !important;
735
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
736
+ }
737
+
738
+ .cssc-1pm8g43-kjlask {
739
+ gap: 2px !important;
740
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
741
+ }
742
+
743
+ .cssc-1l6ueuj-sjaksl {
744
+ margin-top: 1px !important;
745
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
746
+ }
747
+
748
+ .cssc-gmwslw-kjlask {
749
+ font-size: 17px !important;
750
+ line-height: 19px !important;
751
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
752
+ }
753
+
754
+ .cssc-1iy4zoj-oilkj,
755
+ .cssc-13sv1r4-oilkj {
756
+ font-size: 17px !important;
757
+ line-height: 19px !important;
758
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
759
+ }
760
+
761
+ /* Subtitle and Label Styles */
762
+ .cssc-rq2z2r-oilkj {
763
+ font-size: 18px !important;
764
+ line-height: 20px !important;
765
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
766
+ }
767
+
768
+ .cssc-1ebo3of-oilkj {
769
+ font-size: 17px !important;
770
+ line-height: 19px !important;
771
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
772
+ }
773
+
774
+ .cssc-1ebo3gf-oilkj {
775
+ font-size: 16px !important;
776
+ line-height: 18px !important;
777
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
778
+ }
779
+
780
+ .cssc-1pm8m44-kjlask {
781
+ font-size: 17px !important;
782
+ line-height: 19px !important;
783
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
784
+ }
785
+
786
+ .cssc-1ebo3of-gaplas {
787
+ font-size: 17px !important;
788
+ line-height: 19px !important;
789
+ width: 8px !important;
790
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
791
+ }
792
+
793
+ .cssc-lpyf3z-kjlask {
794
+ font-size: 17px !important;
795
+ line-height: 19px !important;
796
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
797
+ }
798
+
799
+ .cssc-16f6p1q-kjlask {
800
+ border-width: 1px !important;
801
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
802
+ }
803
+
804
+ .cssc-1qek100-kjlask {
805
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
806
+ }
807
+
808
+ .cssc-rorn0c-lkask {
809
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
810
+ }
811
+
812
+ .cssc-1m6vi3w-posi {
813
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
814
+ }
815
+
816
+ .cssc-15wwp11-qwem {
817
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
818
+ }
819
+
820
+ .cssc-ho2sf9-sanbv {
821
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
822
+ }
823
+
824
+ .cssc-apqrd9-skjas {
825
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
826
+ }
827
+
828
+ .cssc-1qrvgoi-sanbv {
829
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
830
+ }
831
+
832
+ .cssc-kkegnv-sanbv {
833
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
834
+ }
835
+ `
836
+ : ''}
837
+ </style>
838
+ <title>Printer Receipt</title>
839
+ </head>`;
840
+ };
841
+ function getBody({ staffWiseData, combinedData, currency_symbol, from, to, tenantName, monochrome, isFilterApplied, }) {
842
+ // ======================>>>><<<<=====================
843
+ let mainBodyElements = ``;
844
+ const fillMainBody = (staffData, index) => {
845
+ let mainBodyFooterElements = `<div class="cssc-gmwslw-kjlask">
846
+ <p class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Total Orders</p>
847
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${staffData.totalOrders}</p>
848
+ </div>`;
849
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
850
+ <div class="cssc-gmwslw-kjlask">
851
+ <div class="cssc-lpyf3z-kjlask">
852
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Item Sales</h6>
853
+ <span class="cssc-1ebo3gf-oilkj">${staffData.itemSalesSubtitle}</span>
854
+ </div>
855
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${(0, common_1.localeAmount)(currency_symbol, staffData.itemSales)}</p>
856
+ </div>`;
857
+ if (staffData.grossSale > 0 && staffData.grossSale !== staffData.netSale) {
858
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
859
+ <div class="cssc-gmwslw-kjlask">
860
+ <div class="cssc-lpyf3z-kjlask">
861
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Gross Revenue</h6>
862
+ <span class="cssc-1ebo3gf-oilkj">${staffData.grossSaleSubtitle}</span>
863
+ </div>
864
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${(0, common_1.localeAmount)(currency_symbol, staffData.grossSale)}</p>
865
+ </div>`;
866
+ }
867
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
868
+ <div class="cssc-gmwslw-kjlask">
869
+ <div class="cssc-lpyf3z-kjlask">
870
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Net Sale</h6>
871
+ <span class="cssc-1ebo3gf-oilkj">${staffData.netSaleSubtitle}</span>
872
+ </div>
873
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap;${monochrome ? '' : 'color: #008000'}">${(0, common_1.localeAmount)(currency_symbol, staffData.netSale)}</p>
874
+ </div>`;
875
+ if (staffData.unpaidOrders > 0) {
876
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
877
+ <div class="cssc-gmwslw-kjlask">
878
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Amount Collected</h6>
879
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap;${monochrome ? '' : 'color: #FF6D00'}">${(0, common_1.localeAmount)(currency_symbol, staffData.amountCollected)}</p>
880
+ </div>`;
881
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
882
+ <div class="cssc-gmwslw-kjlask">
883
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">${staffData.unpaidOrders} Unpaid</h6>
884
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap;${monochrome ? '' : 'color: #FF0000'}">${(0, common_1.localeAmount)(currency_symbol, staffData.unpaidAmount)}</p>
885
+ </div>`;
886
+ }
887
+ if (staffData.netWithoutServiceFee > 0 && staffData.netWithoutServiceFee !== staffData.netSale) {
888
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
889
+ <div class="cssc-gmwslw-kjlask">
890
+ <div class="cssc-lpyf3z-kjlask">
891
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Net Sale (Other)</h6>
892
+ <span class="cssc-1ebo3gf-oilkj">${staffData.netWithoutServiceFeeSubtitle}</span>
893
+ </div>
894
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${(0, common_1.localeAmount)(currency_symbol, staffData.netWithoutServiceFee)}</p>
895
+ </div>`;
896
+ }
897
+ if (staffData.netWithoutGst > 0 && staffData.netWithoutGst !== staffData.netSale) {
898
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
899
+ <div class="cssc-gmwslw-kjlask">
900
+ <div class="cssc-lpyf3z-kjlask">
901
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Net Sale (Other)</h6>
902
+ <span class="cssc-1ebo3gf-oilkj">${staffData.netWithoutGstSubtitle}</span>
903
+ </div>
904
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${(0, common_1.localeAmount)(currency_symbol, staffData.netWithoutGst)}</p>
905
+ </div>`;
906
+ }
907
+ // ======================>>>><<<<=====================
908
+ let mainBodyTableElements = ``;
909
+ staffData.channels.forEach((channel) => {
910
+ mainBodyTableElements += `<tr class="cssc-1qrvgoi-sanbv">
911
+ <td class="cssc-gnx8yv-ssaaw" colspan="3">
912
+ <h6 class="cssc-1b7x1hq-oilkj">
913
+ ${channel.title}
914
+ </h6>
915
+ </td>
916
+ </tr>`;
917
+ channel.subChannels.forEach((subChannel) => {
918
+ mainBodyTableElements += `<tr class="cssc-kkegnv-sanbv">
919
+ <th class="cssc-1d7qqp0-ssaaw" scope="row">
920
+ <p class="cssc-1ebo3of-oilkj"
921
+ ${subChannel.bold ? `style="font-weight: bold; text-decoration: underline"` : ''}
922
+ >
923
+ ${subChannel.title}
924
+ </p>
925
+ </th>
926
+
927
+ <td class="cssc-up54xb-ssaaw" align="right">
928
+ <p class="cssc-1iy4zoj-oilkj"
929
+ ${subChannel.bold ? `style="font-weight: bold; text-decoration: underline"` : ''}
930
+ >${subChannel.count}</p>
931
+ </td>
932
+
933
+ <td class="cssc-v53jtm-ssaaw" align="right">
934
+ <p class="cssc-1iy4zoj-oilkj"
935
+ ${subChannel.strikeThrough
936
+ ? `style="text-decoration: line-through"`
937
+ : subChannel.bold
938
+ ? `style="font-weight: bold; text-decoration: underline"`
939
+ : ''}
940
+ >${(0, common_1.localeAmount)(currency_symbol, subChannel.amount)}</p>
941
+ </td>
942
+ </tr>`;
943
+ });
944
+ channel.footerDetails.forEach((row) => {
945
+ mainBodyTableElements += `<tr class="cssc-kkegnv-sanbv">
946
+ <th class="cssc-1d7qqp0-ssaaw" scope="row">
947
+ <div class="cssc-1pm8m44-kjlask" >
948
+ <div class="cssc-1ebo3of-gaplas"></div>
949
+ <span class="cssc-1ebo3of-oilkj" style="font-weight: normal">
950
+ ${row.title}
951
+ </span>
952
+ </div>
953
+ </th>
954
+
955
+ <td class="cssc-up54xb-ssaaw" align="right">
956
+ <p class="cssc-1iy4zoj-oilkj" style="font-weight: normal">${row.count}</p>
957
+ </td>
958
+
959
+ <td class="cssc-v53jtm-ssaaw" align="right">
960
+ <p class="cssc-1iy4zoj-oilkj" style="font-weight: normal">${(0, common_1.localeAmount)(currency_symbol, row.amount)}</p>
961
+ </td>
962
+ </tr>`;
963
+ });
964
+ });
965
+ // ======================>>>><<<<=====================
966
+ let mainBodyDivider = '';
967
+ if (monochrome && index > 0) {
968
+ mainBodyDivider = `<hr style="height: 3px; color: #000000; background-color: #000000; border: none;" />`;
969
+ }
970
+ mainBodyElements += `<div class="cssc-1owvoyj-kjhgs">
971
+ <div class="cssc-cjhduv-kjhgs">
972
+ ${mainBodyDivider}
973
+ <div class="cssc-1qek100-kjlask">
974
+ <div class="cssc-lpyf3a-skks">
975
+ <h5 class="cssc-1gb95rg-oilkj">${staffData.title}</h5>
976
+ </div>
977
+
978
+ <div class="cssc-rorn0c-lkask">
979
+ <table class="cssc-1m6vi3w-posi">
980
+ <thead class="cssc-15wwp11-qwem">
981
+ <tr class="cssc-ho2sf9-sanbv">
982
+ <th class="cssc-idkl0b-ssaaw" scope="col">
983
+ <h6 class="cssc-rq2z2r-oilkj">
984
+ Description
985
+ </h6>
986
+ </th>
987
+
988
+ <th class="cssc-1ymm2he-ssaaw" scope="col" align="right">
989
+ </th>
990
+
991
+ <th class="cssc-eyhmry-ssaaw" scope="col" align="right">
992
+ <h6 class="cssc-rq2z2r-oilkj" style="text-align: right">Amount</h6>
993
+ </th>
994
+ </tr>
995
+ </thead>
996
+
997
+ <tbody class="cssc-apqrd9-skjas">
998
+ ${mainBodyTableElements}
999
+ </tbody>
1000
+ </table>
1001
+ </div>
1002
+
1003
+ <div class="cssc-1ho5x3sk-kjlask">
1004
+ <div class="cssc-1ho5x3p-kjlask">
1005
+ ${mainBodyFooterElements}
1006
+ </div>
1007
+ </div>
1008
+ </div>
1009
+ </div>
1010
+ </div>`;
1011
+ };
1012
+ staffWiseData.forEach(fillMainBody);
1013
+ if (combinedData != null && staffWiseData.length > 1) {
1014
+ fillMainBody(combinedData, staffWiseData.length);
1015
+ }
1016
+ return `<div class="cssc-1flmrcm-kjlask">
1017
+ <div class="cssc-1qeq10-kjlask">
1018
+ <h5 class="cssc-1gb95rg-oilkj" style="color: #000000">X Report</h5>
1019
+ <p class="cssc-1iy4zoj-oilkj">${(0, moment_1.default)(from).format('dddd')} ${(0, moment_1.default)(from).format('MMM DD, YYYY')}</p>
1020
+ <p class="cssc-1ebo3of-oilkj">${(0, moment_1.default)(from).format('h:mm a, MMM DD')} - ${(0, moment_1.default)(to).format('h:mm a, MMM DD')}</p>
1021
+ </div>
1022
+
1023
+ <div class="cssc-16f6p1q-kjlask">
1024
+ ${mainBodyElements}
1025
+ </div>
1026
+
1027
+ <div class="cssc-1qeq10-kjlask" style="margin-top: 20px;">
1028
+ <h5 class="cssc-1gb95rg-oilkj" style="color: #000000">${tenantName ?? ''}</h5>
1029
+ <p class="cssc-1iy4zoj-oilkj">
1030
+ Exported on ${(0, moment_1.default)().format('dddd')} ${(0, moment_1.default)().format('MMM DD, YYYY')} at ${(0, moment_1.default)().format('h:mm a')}
1031
+ </p>
1032
+ ${isFilterApplied
1033
+ ? `<p class="cssc-1iy4zoj-oilkj"
1034
+ style="text-align: center; font-weight: bold; ${monochrome ? 'color: #000000' : 'color: #FF0000'}"
1035
+ >
1036
+ Note: This report is filtered. Please ensure to tally the data on your end.
1037
+ </p>`
1038
+ : ''}
1039
+ </div>
1040
+ </div>`;
1041
+ }
1042
+ /*
1043
+
1044
+ <div style="display: flex; justify-content: center; margin-top: 20px">
1045
+ <img
1046
+ src="https://firebasestorage.googleapis.com/v0/b/prod-managesome.appspot.com/o/platforms%2Feposmatic%2FSIDEBAR_LOGO_LIGHT_THEME.svg?alt=media&token=b8933e6c-f559-41f8-b5b8-215b0a2a3d29"
1047
+ height="30px"
1048
+ />
1049
+ </div>
1050
+ */
1051
+ function getXReportHtml({ width, monochrome, staffWiseData, combinedData, currency_symbol, from, to, tenantName, isFilterApplied, }) {
1052
+ const style = width ? `style=width: ${width}px; max-width: ${width}px` : '';
1053
+ const html = `
1054
+ <html lang="en" ${style}>
1055
+ ${getHead(monochrome)}
1056
+ <body translate="no"
1057
+ ${style}
1058
+ >
1059
+ ${getBody({
1060
+ staffWiseData,
1061
+ combinedData,
1062
+ currency_symbol,
1063
+ from,
1064
+ to,
1065
+ tenantName,
1066
+ monochrome,
1067
+ isFilterApplied,
1068
+ })}
1069
+ </body>
1070
+ </html>`;
1071
+ return html;
1072
+ }
1073
+ // ======================>>>><<<<=====================
1074
+ const uniqueTypes = [constants_1.X_REPORT_TYPE_ENUM.COVERS];
1075
+ const TOTAL_REF = 'TOTAL';
1076
+ const ITEM_DISCOUNTS_REF = 'ITEM_DISCOUNTS';
1077
+ const CUSTOMER_ID = 'by_customers';
1078
+ const getSortedUsableChannels = (channels) => {
1079
+ const usableChannels = [];
1080
+ for (let i = 0; i < channels.length; i++) {
1081
+ const c = channels[i];
1082
+ const footerDetailsMap = c.footerDetailsMap;
1083
+ const channel = {
1084
+ _id: c._id,
1085
+ title: c.title,
1086
+ ref: c.ref,
1087
+ sortIndex: c.sortIndex,
1088
+ subChannels: c.subChannels,
1089
+ footerDetails: Object.values(footerDetailsMap)
1090
+ .map((fd) => ({
1091
+ ...fd,
1092
+ amount: (0, price_conversion_1.convertPriceFromCents)(fd.amount),
1093
+ }))
1094
+ .sort((a, b) => a.sortIndex - b.sortIndex),
1095
+ };
1096
+ const subChannels = channel.subChannels;
1097
+ subChannels
1098
+ .sort((a, b) => (a.ref > b.ref ? 1 : -1))
1099
+ .forEach((sc, index) => {
1100
+ sc.sortIndex = index;
1101
+ });
1102
+ for (let j = 0; j < subChannels.length; j++) {
1103
+ const subChannel = subChannels[j];
1104
+ if (subChannel.ref === TOTAL_REF) {
1105
+ if (uniqueTypes.includes(channel.ref)) {
1106
+ // We will remove this subchannel
1107
+ channel.subChannels.splice(j, 1);
1108
+ }
1109
+ subChannel.sortIndex = 100000;
1110
+ subChannel.bold = true;
1111
+ }
1112
+ else if (channel.ref === constants_1.X_REPORT_TYPE_ENUM.SALES_BY_PLATFORM) {
1113
+ const platform = subChannel.ref;
1114
+ let sortIndex = constants_1.ALL_PLATFORMS.indexOf(platform);
1115
+ if (sortIndex === -1) {
1116
+ sortIndex = 200 + j;
1117
+ }
1118
+ subChannel.sortIndex = sortIndex;
1119
+ }
1120
+ else if (channel.ref === constants_1.X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES) {
1121
+ const paymentType = subChannel.ref;
1122
+ let sortIndex = constants_1.ALL_PAYMENT_TYPE_NAMES.indexOf(paymentType);
1123
+ if (sortIndex === -1) {
1124
+ sortIndex = 200 + j;
1125
+ }
1126
+ subChannel.sortIndex = sortIndex;
1127
+ if (paymentType === constants_1.PAYMENT_TYPE_ENUM.COMPLIMENTARY) {
1128
+ const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
1129
+ if (totalIndex !== -1) {
1130
+ const totalAmount = channel.subChannels[totalIndex].amount;
1131
+ channel.subChannels[totalIndex].amount = (0, common_1.parseNum)(totalAmount - subChannel.amount);
1132
+ }
1133
+ subChannel.strikeThrough = true;
1134
+ }
1135
+ }
1136
+ else if (channel.ref === constants_1.X_REPORT_TYPE_ENUM.ORDER_STATUS) {
1137
+ const status = subChannel.ref;
1138
+ let sortIndex = constants_1.ALL_ORDER_STATUS_NAMES.indexOf(status);
1139
+ if (sortIndex === -1) {
1140
+ sortIndex = 200 + j;
1141
+ }
1142
+ if (status === constants_1.ORDER_STATUS_ENUM.CANCELLED) {
1143
+ const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
1144
+ if (totalIndex !== -1) {
1145
+ const totalAmount = channel.subChannels[totalIndex].amount;
1146
+ channel.subChannels[totalIndex].amount = (0, common_1.parseNum)(totalAmount - subChannel.amount);
1147
+ }
1148
+ subChannel.strikeThrough = true;
1149
+ }
1150
+ subChannel.sortIndex = sortIndex;
1151
+ }
1152
+ }
1153
+ usableChannels.push(channel);
1154
+ }
1155
+ const sortedChannels = usableChannels
1156
+ .map((channel) => ({
1157
+ ...channel,
1158
+ subChannels: channel.subChannels.sort((a, b) => a.sortIndex - b.sortIndex),
1159
+ }))
1160
+ .sort((a, b) => a.sortIndex - b.sortIndex);
1161
+ return sortedChannels;
1162
+ };
1163
+ const generateStaffWiseData = (data, currencySymbol, gstName) => {
1164
+ const staffWiseDataMap = {};
1165
+ const saffWiseTotalSalesMap = {};
1166
+ const staffNamesMap = {};
1167
+ data[constants_1.X_REPORT_TYPE_ENUM.TOTAL_SALES].forEach((item) => {
1168
+ const staffName = item.staff_name ?? 'By Customers';
1169
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1170
+ saffWiseTotalSalesMap[staffId] = item;
1171
+ staffNamesMap[staffId] = staffName;
1172
+ });
1173
+ // ==========>>><<<==========
1174
+ data[constants_1.X_REPORT_TYPE_ENUM.SALES_BY_PLATFORM].forEach((item) => {
1175
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1176
+ const staffName = staffNamesMap[staffId];
1177
+ if (staffName != null) {
1178
+ const amount = item.grossAmount;
1179
+ const obj = {
1180
+ _id: staffId,
1181
+ ref: item.platform,
1182
+ title: 'Platform Sales',
1183
+ description: (0, common_1.sentenceCase)(item.platform.replace(/_/g, ' ')),
1184
+ type: constants_1.X_REPORT_TYPE_ENUM.SALES_BY_PLATFORM,
1185
+ staff_name: staffName,
1186
+ count: item.count,
1187
+ amount,
1188
+ sortIndex: 1,
1189
+ };
1190
+ if (staffWiseDataMap[staffId] != null) {
1191
+ staffWiseDataMap[staffId].push(obj);
1192
+ }
1193
+ else {
1194
+ staffWiseDataMap[staffId] = [obj];
1195
+ }
1196
+ }
1197
+ });
1198
+ data[constants_1.X_REPORT_TYPE_ENUM.ORDER_STATUS].forEach((item) => {
1199
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1200
+ const staffName = staffNamesMap[staffId];
1201
+ if (staffName != null) {
1202
+ const amount = item.grossAmount;
1203
+ const obj = {
1204
+ _id: staffId,
1205
+ ref: item.status,
1206
+ type: constants_1.X_REPORT_TYPE_ENUM.ORDER_STATUS,
1207
+ staff_name: staffName,
1208
+ title: 'Order Status',
1209
+ description: (0, common_1.sentenceCase)(item.status.replace(/_/g, ' ')),
1210
+ count: item.count,
1211
+ amount,
1212
+ sortIndex: 2,
1213
+ };
1214
+ if (staffWiseDataMap[staffId] != null) {
1215
+ staffWiseDataMap[staffId].push(obj);
1216
+ }
1217
+ else {
1218
+ staffWiseDataMap[staffId] = [obj];
1219
+ }
1220
+ }
1221
+ });
1222
+ const discountFooterData = {};
1223
+ data[constants_1.X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES].forEach((item) => {
1224
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1225
+ const staffName = staffNamesMap[staffId];
1226
+ if (staffName != null) {
1227
+ const amount = item.grossAmount;
1228
+ const obj = {
1229
+ _id: staffId,
1230
+ ref: item.payment_type,
1231
+ type: constants_1.X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES,
1232
+ staff_name: staffName,
1233
+ title: 'Payments',
1234
+ description: (0, common_1.sentenceCase)(item.payment_type.replace(/_/g, ' ')),
1235
+ count: item.count,
1236
+ amount,
1237
+ sortIndex: 3,
1238
+ };
1239
+ if (staffWiseDataMap[staffId] != null) {
1240
+ staffWiseDataMap[staffId].push(obj);
1241
+ }
1242
+ else {
1243
+ staffWiseDataMap[staffId] = [obj];
1244
+ }
1245
+ if (discountFooterData[staffId] == null) {
1246
+ discountFooterData[staffId] = {};
1247
+ }
1248
+ if (discountFooterData[staffId][item.payment_type] != null) {
1249
+ discountFooterData[staffId][item.payment_type].amount += item.totalDiscountAmount;
1250
+ discountFooterData[staffId][item.payment_type].count += item.totalDiscountCount;
1251
+ }
1252
+ else if (item.totalDiscountAmount > 0) {
1253
+ discountFooterData[staffId][item.payment_type] = {
1254
+ amount: item.totalDiscountAmount,
1255
+ count: item.totalDiscountCount,
1256
+ sortIndex: 0,
1257
+ title: (0, common_1.sentenceCase)(item.payment_type.replace(/_/g, ' ')),
1258
+ };
1259
+ }
1260
+ }
1261
+ });
1262
+ const orderDiscountsMap = {};
1263
+ data[constants_1.X_REPORT_TYPE_ENUM.ORDER_DISCOUNT].forEach((item) => {
1264
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1265
+ const staffName = staffNamesMap[staffId];
1266
+ if (staffName != null) {
1267
+ const amount = item.grossAmount;
1268
+ const discount = (0, price_conversion_1.convertPriceFromCents)(item.discount);
1269
+ const description = item.is_discount_percentage ? `${discount}%` : (0, common_1.localeAmount)(currencySymbol, discount);
1270
+ const obj = {
1271
+ _id: staffId,
1272
+ ref: description,
1273
+ type: constants_1.X_REPORT_TYPE_ENUM.ORDER_DISCOUNT,
1274
+ staff_name: staffName,
1275
+ title: 'Discounts',
1276
+ description,
1277
+ count: item.count,
1278
+ amount,
1279
+ sortIndex: 4,
1280
+ };
1281
+ if (staffWiseDataMap[staffId] != null) {
1282
+ if (orderDiscountsMap[staffId] == null) {
1283
+ orderDiscountsMap[staffId] = {
1284
+ count: 0,
1285
+ amount: 0,
1286
+ };
1287
+ }
1288
+ orderDiscountsMap[staffId].count = (orderDiscountsMap[staffId]?.count ?? 0) + item.count;
1289
+ orderDiscountsMap[staffId].amount = (orderDiscountsMap[staffId]?.amount ?? 0) + amount;
1290
+ staffWiseDataMap[staffId].push(obj);
1291
+ }
1292
+ else {
1293
+ orderDiscountsMap[staffId] = {
1294
+ count: item.count,
1295
+ amount,
1296
+ };
1297
+ staffWiseDataMap[staffId] = [obj];
1298
+ }
1299
+ }
1300
+ });
1301
+ data[constants_1.X_REPORT_TYPE_ENUM.TOTAL_DISCOUNT].forEach((item) => {
1302
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1303
+ const staffName = staffNamesMap[staffId];
1304
+ if (staffName != null) {
1305
+ const staffDiscounts = orderDiscountsMap[staffId] ?? {
1306
+ count: 0,
1307
+ amount: 0,
1308
+ };
1309
+ const count = item.count - staffDiscounts.count;
1310
+ const amount = item.grossAmount - staffDiscounts.amount;
1311
+ if (amount > 0) {
1312
+ const obj = {
1313
+ _id: staffId,
1314
+ ref: ITEM_DISCOUNTS_REF,
1315
+ type: constants_1.X_REPORT_TYPE_ENUM.ORDER_DISCOUNT,
1316
+ staff_name: staffName,
1317
+ title: 'Discounts',
1318
+ description: 'Item Discounts',
1319
+ count: count || item.count,
1320
+ amount,
1321
+ sortIndex: 5,
1322
+ };
1323
+ if (staffWiseDataMap[staffId] != null) {
1324
+ staffWiseDataMap[staffId].push(obj);
1325
+ }
1326
+ else {
1327
+ staffWiseDataMap[staffId] = [obj];
1328
+ }
1329
+ }
1330
+ }
1331
+ });
1332
+ data[constants_1.X_REPORT_TYPE_ENUM.TIP].forEach((item) => {
1333
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1334
+ const staffName = staffNamesMap[staffId];
1335
+ if (staffName != null) {
1336
+ const amount = item.grossAmount;
1337
+ const obj = {
1338
+ _id: staffId,
1339
+ ref: item.tip_amount,
1340
+ type: constants_1.X_REPORT_TYPE_ENUM.TIP,
1341
+ staff_name: staffName,
1342
+ title: 'Tips',
1343
+ description: (0, common_1.localeAmount)(currencySymbol, (0, price_conversion_1.convertPriceFromCents)(item.tip_amount)),
1344
+ count: item.count,
1345
+ amount,
1346
+ sortIndex: 6,
1347
+ };
1348
+ if (staffWiseDataMap[staffId] != null) {
1349
+ staffWiseDataMap[staffId].push(obj);
1350
+ }
1351
+ else {
1352
+ staffWiseDataMap[staffId] = [obj];
1353
+ }
1354
+ }
1355
+ });
1356
+ data[constants_1.X_REPORT_TYPE_ENUM.SERVICE_CHARGE].forEach((item) => {
1357
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1358
+ const staffName = staffNamesMap[staffId];
1359
+ if (staffName != null) {
1360
+ const service_fee = (0, price_conversion_1.convertPriceFromCents)(item.service_fee);
1361
+ const amount = item.grossAmount;
1362
+ const description = item.is_service_fee_percentage
1363
+ ? `${service_fee}%`
1364
+ : (0, common_1.localeAmount)(currencySymbol, service_fee);
1365
+ const obj = {
1366
+ _id: staffId,
1367
+ ref: description,
1368
+ type: constants_1.X_REPORT_TYPE_ENUM.SERVICE_CHARGE,
1369
+ staff_name: staffName,
1370
+ title: 'Service Charges',
1371
+ description,
1372
+ count: item.count,
1373
+ amount,
1374
+ sortIndex: 7,
1375
+ };
1376
+ if (staffWiseDataMap[staffId] != null) {
1377
+ staffWiseDataMap[staffId].push(obj);
1378
+ }
1379
+ else {
1380
+ staffWiseDataMap[staffId] = [obj];
1381
+ }
1382
+ }
1383
+ });
1384
+ data[constants_1.X_REPORT_TYPE_ENUM.DELIVERY_CHARGE].forEach((item) => {
1385
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1386
+ const staffName = staffNamesMap[staffId];
1387
+ if (staffName != null) {
1388
+ const delivery_cost = (0, price_conversion_1.convertPriceFromCents)(item.delivery_cost);
1389
+ const amount = item.grossAmount;
1390
+ const description = (0, common_1.localeAmount)(currencySymbol, delivery_cost);
1391
+ const obj = {
1392
+ _id: staffId,
1393
+ ref: description,
1394
+ type: constants_1.X_REPORT_TYPE_ENUM.DELIVERY_CHARGE,
1395
+ staff_name: staffName,
1396
+ title: 'Delivery Charges',
1397
+ description,
1398
+ count: item.count,
1399
+ amount,
1400
+ sortIndex: 8,
1401
+ };
1402
+ if (staffWiseDataMap[staffId] != null) {
1403
+ staffWiseDataMap[staffId].push(obj);
1404
+ }
1405
+ else {
1406
+ staffWiseDataMap[staffId] = [obj];
1407
+ }
1408
+ }
1409
+ });
1410
+ data[constants_1.X_REPORT_TYPE_ENUM.SURCHARGE].forEach((item) => {
1411
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1412
+ const staffName = staffNamesMap[staffId];
1413
+ if (staffName != null) {
1414
+ const surcharge = (0, price_conversion_1.convertPriceFromCents)(item.surcharge);
1415
+ const amount = item.grossAmount;
1416
+ const description = item.is_surcharge_percentage ? `${surcharge}%` : (0, common_1.localeAmount)(currencySymbol, surcharge);
1417
+ const obj = {
1418
+ _id: staffId,
1419
+ ref: description,
1420
+ type: constants_1.X_REPORT_TYPE_ENUM.SURCHARGE,
1421
+ staff_name: staffName,
1422
+ title: 'Surcharge',
1423
+ description,
1424
+ count: item.count,
1425
+ amount,
1426
+ sortIndex: 9,
1427
+ };
1428
+ if (staffWiseDataMap[staffId] != null) {
1429
+ staffWiseDataMap[staffId].push(obj);
1430
+ }
1431
+ else {
1432
+ staffWiseDataMap[staffId] = [obj];
1433
+ }
1434
+ }
1435
+ });
1436
+ data[constants_1.X_REPORT_TYPE_ENUM.GST].forEach((item) => {
1437
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1438
+ const staffName = staffNamesMap[staffId];
1439
+ if (staffName != null) {
1440
+ const gst = (0, price_conversion_1.convertPriceFromCents)(item.gst);
1441
+ const amount = item.grossAmount;
1442
+ const obj = {
1443
+ _id: staffId,
1444
+ ref: gst,
1445
+ type: constants_1.X_REPORT_TYPE_ENUM.GST,
1446
+ staff_name: staffName,
1447
+ title: gstName,
1448
+ description: `${gst}%`,
1449
+ count: item.count,
1450
+ amount,
1451
+ sortIndex: 10,
1452
+ };
1453
+ if (staffWiseDataMap[staffId] != null) {
1454
+ staffWiseDataMap[staffId].push(obj);
1455
+ }
1456
+ else {
1457
+ staffWiseDataMap[staffId] = [obj];
1458
+ }
1459
+ }
1460
+ });
1461
+ data[constants_1.X_REPORT_TYPE_ENUM.TAX_AMOUNT].forEach((item) => {
1462
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1463
+ const staffName = staffNamesMap[staffId];
1464
+ if (staffName != null) {
1465
+ const taxAmount = (0, price_conversion_1.convertPriceFromCents)(item.grossAmount);
1466
+ const amount = item.grossAmount;
1467
+ const obj = {
1468
+ _id: staffId,
1469
+ ref: taxAmount,
1470
+ type: constants_1.X_REPORT_TYPE_ENUM.TAX_AMOUNT,
1471
+ staff_name: staffName,
1472
+ title: 'Item Tax',
1473
+ description: (0, common_1.localeAmount)(currencySymbol, taxAmount),
1474
+ count: item.count,
1475
+ amount,
1476
+ sortIndex: 11,
1477
+ };
1478
+ if (staffWiseDataMap[staffId] != null) {
1479
+ staffWiseDataMap[staffId].push(obj);
1480
+ }
1481
+ else {
1482
+ staffWiseDataMap[staffId] = [obj];
1483
+ }
1484
+ }
1485
+ });
1486
+ data[constants_1.X_REPORT_TYPE_ENUM.COVERS].forEach((item) => {
1487
+ const staffId = item.staff_id ?? CUSTOMER_ID;
1488
+ const staffName = staffNamesMap[staffId];
1489
+ if (staffName != null) {
1490
+ const amount = item.grossAmount;
1491
+ const obj = {
1492
+ _id: staffId,
1493
+ ref: item.covers,
1494
+ type: constants_1.X_REPORT_TYPE_ENUM.COVERS,
1495
+ staff_name: staffName,
1496
+ title: 'Covers',
1497
+ description: item.covers,
1498
+ count: item.count,
1499
+ amount,
1500
+ sortIndex: 12,
1501
+ };
1502
+ if (staffWiseDataMap[staffId] != null) {
1503
+ staffWiseDataMap[staffId].push(obj);
1504
+ }
1505
+ else {
1506
+ staffWiseDataMap[staffId] = [obj];
1507
+ }
1508
+ }
1509
+ });
1510
+ const staffWiseDataFooterDetailsMap = {};
1511
+ if (Object.keys(discountFooterData).length > 0) {
1512
+ for (const staffId in discountFooterData) {
1513
+ let details = discountFooterData[staffId];
1514
+ if (Object.keys(details).length === 0) {
1515
+ continue;
1516
+ }
1517
+ if (staffWiseDataFooterDetailsMap[staffId] == null) {
1518
+ staffWiseDataFooterDetailsMap[staffId] = {};
1519
+ }
1520
+ details = structuredClone(details);
1521
+ let index = 0;
1522
+ for (const type in details) {
1523
+ let sortIndex = constants_1.ALL_PAYMENT_TYPE_NAMES.indexOf(type);
1524
+ if (sortIndex === -1) {
1525
+ sortIndex = 200 + index;
1526
+ }
1527
+ details[type].sortIndex = sortIndex;
1528
+ index++;
1529
+ }
1530
+ staffWiseDataFooterDetailsMap[staffId][constants_1.X_REPORT_TYPE_ENUM.ORDER_DISCOUNT] = details;
1531
+ }
1532
+ }
1533
+ return {
1534
+ staffWiseDataMap,
1535
+ saffWiseTotalSalesMap,
1536
+ staffWiseDataFooterDetailsMap,
1537
+ };
1538
+ };
1539
+ const getUsableData = (data, subtitles) => {
1540
+ const defaultCombinedData = {
1541
+ _id: 'combined',
1542
+ title: 'Combined Report',
1543
+ netSale: 0,
1544
+ grossSale: 0,
1545
+ netWithoutGst: 0,
1546
+ totalOrders: 0,
1547
+ unpaidOrders: 0,
1548
+ unpaidAmount: 0,
1549
+ itemSales: 0,
1550
+ netWithoutServiceFee: 0,
1551
+ taxInvoiceProviderCharges: 0,
1552
+ amountCollected: 0,
1553
+ channels: [],
1554
+ ...subtitles,
1555
+ };
1556
+ const { staffWiseDataMap, saffWiseTotalSalesMap, staffWiseDataFooterDetailsMap } = data;
1557
+ const staffWiseData = [];
1558
+ const combinedData = {
1559
+ ...defaultCombinedData,
1560
+ };
1561
+ const combinedChannelsMap = {};
1562
+ const uniqueCombinedDataMap = {};
1563
+ for (const staffId in staffWiseDataMap) {
1564
+ const salesData = saffWiseTotalSalesMap[staffId];
1565
+ if (!salesData)
1566
+ continue;
1567
+ const staffData = staffWiseDataMap[staffId];
1568
+ const similarTypes = {};
1569
+ for (let i = 0; i < staffData.length; i++) {
1570
+ const d = staffData[i];
1571
+ if (similarTypes[d.type] != null) {
1572
+ similarTypes[d.type].push(d);
1573
+ }
1574
+ else {
1575
+ similarTypes[d.type] = [d];
1576
+ }
1577
+ }
1578
+ const totalOrders = salesData.count;
1579
+ let netSale = salesData.grossAmount;
1580
+ let totalDiscounts = 0;
1581
+ let totalGst = 0;
1582
+ let unpaidOrders = 0;
1583
+ let unpaidAmount = 0;
1584
+ let totalServiceFee = 0;
1585
+ let totalDeliveryCharges = 0;
1586
+ for (const type in similarTypes) {
1587
+ const firstData = similarTypes[type][0];
1588
+ if (!firstData)
1589
+ continue;
1590
+ const combinedData = similarTypes[type].reduce((acc, d) => {
1591
+ acc.count += d.count;
1592
+ acc.amount += d.amount;
1593
+ return acc;
1594
+ }, {
1595
+ count: 0,
1596
+ amount: 0,
1597
+ });
1598
+ similarTypes[type].push({
1599
+ _id: `${firstData._id}-${TOTAL_REF}`,
1600
+ ref: TOTAL_REF,
1601
+ type: firstData.type,
1602
+ staff_name: firstData.staff_name,
1603
+ title: firstData.title,
1604
+ description: 'Total',
1605
+ count: combinedData.count,
1606
+ amount: combinedData.amount,
1607
+ sortIndex: 100000,
1608
+ });
1609
+ }
1610
+ const topLevelChannels = [];
1611
+ for (const type in similarTypes) {
1612
+ // We will use it for 3rd layer
1613
+ const staffWiseDataArr = similarTypes[type];
1614
+ const firstData = staffWiseDataArr[0];
1615
+ const footerDetailsMap = structuredClone(staffWiseDataFooterDetailsMap[staffId]?.[type] ?? {});
1616
+ // Second Layer ==> Type
1617
+ const channel = {
1618
+ _id: `${firstData._id}-${firstData.type}`,
1619
+ ref: firstData.type,
1620
+ title: firstData.title,
1621
+ subChannels: [],
1622
+ sortIndex: firstData.sortIndex,
1623
+ footerDetailsMap,
1624
+ };
1625
+ // We will use it for 3rd layer
1626
+ const subChannels = [];
1627
+ for (let j = 0; j < staffWiseDataArr.length; j++) {
1628
+ const d = staffWiseDataArr[j];
1629
+ if (d.type === constants_1.X_REPORT_TYPE_ENUM.GST && d.ref !== TOTAL_REF) {
1630
+ totalGst += d.amount;
1631
+ }
1632
+ else if (d.type === constants_1.X_REPORT_TYPE_ENUM.ORDER_DISCOUNT && d.ref !== TOTAL_REF) {
1633
+ totalDiscounts += d.amount;
1634
+ // if (d.ref === ITEM_DISCOUNTS_REF) {
1635
+ // totalItemDiscounts += d.amount;
1636
+ // }
1637
+ }
1638
+ else if (d.type === constants_1.X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES && d.ref !== TOTAL_REF) {
1639
+ if (String(d.description).toUpperCase() === constants_1.PAYMENT_TYPE_ENUM.UNPAID) {
1640
+ unpaidOrders += d.count;
1641
+ unpaidAmount += d.amount;
1642
+ }
1643
+ else if (String(d.description).toUpperCase() === constants_1.PAYMENT_TYPE_ENUM.COMPLIMENTARY) {
1644
+ netSale -= d.amount;
1645
+ }
1646
+ }
1647
+ else if (d.type === constants_1.X_REPORT_TYPE_ENUM.SERVICE_CHARGE && d.ref !== TOTAL_REF) {
1648
+ totalServiceFee += d.amount;
1649
+ }
1650
+ else if (d.type === constants_1.X_REPORT_TYPE_ENUM.DELIVERY_CHARGE && d.ref !== TOTAL_REF) {
1651
+ totalDeliveryCharges += d.amount;
1652
+ }
1653
+ const sChannel = {
1654
+ _id: `${d._id}-${d.ref}`,
1655
+ ref: d.ref,
1656
+ title: typeof d.description === 'string' ? d.description : `${d.description} ${(0, common_1.sentenceCase)(d.type)}`,
1657
+ count: d.count,
1658
+ amount: d.amount,
1659
+ sortIndex: j,
1660
+ };
1661
+ if (uniqueTypes.includes(type)) {
1662
+ if (uniqueCombinedDataMap[type] != null) {
1663
+ if (typeof d.description === 'number') {
1664
+ uniqueCombinedDataMap[type].subChannel.num += d.description;
1665
+ uniqueCombinedDataMap[type].subChannel.count += d.count;
1666
+ uniqueCombinedDataMap[type].subChannel.amount += d.amount;
1667
+ }
1668
+ }
1669
+ else {
1670
+ if (typeof d.description === 'number') {
1671
+ uniqueCombinedDataMap[type] = {
1672
+ _id: `${d._id}-${d.type}`,
1673
+ ref: d.type,
1674
+ title: d.title,
1675
+ sortIndex: d.sortIndex,
1676
+ footerDetailsMap: {},
1677
+ subChannel: {
1678
+ _id: `${d._id}-${d.ref}`,
1679
+ ref: d.ref,
1680
+ num: d.description,
1681
+ count: d.count,
1682
+ amount: d.amount,
1683
+ },
1684
+ };
1685
+ }
1686
+ }
1687
+ if (j === 0) {
1688
+ const combinedFooterDetailsMap = structuredClone(uniqueCombinedDataMap[type].footerDetailsMap ?? {});
1689
+ for (const key in footerDetailsMap) {
1690
+ if (combinedFooterDetailsMap[key] != null) {
1691
+ combinedFooterDetailsMap[key].amount += footerDetailsMap[key].amount;
1692
+ combinedFooterDetailsMap[key].count += footerDetailsMap[key].count;
1693
+ }
1694
+ else {
1695
+ combinedFooterDetailsMap[key] = footerDetailsMap[key];
1696
+ }
1697
+ }
1698
+ uniqueCombinedDataMap[type].footerDetailsMap = combinedFooterDetailsMap;
1699
+ }
1700
+ }
1701
+ else {
1702
+ if (combinedChannelsMap[type] != null) {
1703
+ if (combinedChannelsMap[type].subChannels[d.ref] != null) {
1704
+ combinedChannelsMap[type].subChannels[d.ref].amount += d.amount;
1705
+ combinedChannelsMap[type].subChannels[d.ref].count += d.count;
1706
+ }
1707
+ else {
1708
+ combinedChannelsMap[type].subChannels[d.ref] = {
1709
+ ...sChannel,
1710
+ sortIndex: j,
1711
+ };
1712
+ }
1713
+ }
1714
+ else {
1715
+ combinedChannelsMap[type] = {
1716
+ _id: `${d._id}-${d.type}`,
1717
+ ref: d.type,
1718
+ title: d.title,
1719
+ sortIndex: d.sortIndex,
1720
+ footerDetailsMap: {},
1721
+ subChannels: {
1722
+ [d.ref]: {
1723
+ ...sChannel,
1724
+ sortIndex: j,
1725
+ },
1726
+ },
1727
+ };
1728
+ }
1729
+ if (j === 0) {
1730
+ const combinedFooterDetailsMap = structuredClone(combinedChannelsMap[type].footerDetailsMap ?? {});
1731
+ for (const key in footerDetailsMap) {
1732
+ if (combinedFooterDetailsMap[key] != null) {
1733
+ combinedFooterDetailsMap[key].amount += footerDetailsMap[key].amount;
1734
+ combinedFooterDetailsMap[key].count += footerDetailsMap[key].count;
1735
+ }
1736
+ else {
1737
+ combinedFooterDetailsMap[key] = footerDetailsMap[key];
1738
+ }
1739
+ }
1740
+ combinedChannelsMap[type].footerDetailsMap = combinedFooterDetailsMap;
1741
+ }
1742
+ }
1743
+ sChannel.amount = (0, price_conversion_1.convertPriceFromCents)(sChannel.amount);
1744
+ subChannels.push(sChannel);
1745
+ }
1746
+ // ==================>>><<<==================
1747
+ channel.subChannels = subChannels;
1748
+ topLevelChannels.push(channel);
1749
+ }
1750
+ const grossSale = salesData.grossAmount + totalDiscounts;
1751
+ const netWithoutServiceFee = netSale - totalServiceFee - totalDeliveryCharges;
1752
+ const netWithoutGst = netWithoutServiceFee - totalGst;
1753
+ const itemSales = salesData.totalItemSales - totalDiscounts;
1754
+ const amountCollected = netSale - unpaidAmount;
1755
+ // First Layer ==> Staff
1756
+ const channelData = {
1757
+ ...subtitles,
1758
+ _id: staffId,
1759
+ title: salesData.staff_name ?? '',
1760
+ grossSale: (0, price_conversion_1.convertPriceFromCents)(grossSale),
1761
+ netSale: (0, price_conversion_1.convertPriceFromCents)(netSale),
1762
+ unpaidAmount: (0, price_conversion_1.convertPriceFromCents)(unpaidAmount),
1763
+ netWithoutGst: (0, price_conversion_1.convertPriceFromCents)(netWithoutGst),
1764
+ itemSales: (0, price_conversion_1.convertPriceFromCents)(itemSales),
1765
+ netWithoutServiceFee: (0, price_conversion_1.convertPriceFromCents)(netWithoutServiceFee),
1766
+ taxInvoiceProviderCharges: (0, price_conversion_1.convertPriceFromCents)(salesData.totalTaxInvoiceProviderCharges),
1767
+ amountCollected: (0, price_conversion_1.convertPriceFromCents)(amountCollected),
1768
+ totalOrders,
1769
+ unpaidOrders,
1770
+ channels: topLevelChannels,
1771
+ };
1772
+ combinedData.grossSale += channelData.grossSale;
1773
+ combinedData.netSale += channelData.netSale;
1774
+ combinedData.amountCollected += channelData.amountCollected;
1775
+ combinedData.netWithoutGst += channelData.netWithoutGst;
1776
+ combinedData.totalOrders += channelData.totalOrders;
1777
+ combinedData.unpaidOrders += channelData.unpaidOrders;
1778
+ combinedData.unpaidAmount += channelData.unpaidAmount;
1779
+ combinedData.itemSales += channelData.itemSales;
1780
+ combinedData.netWithoutServiceFee += channelData.netWithoutServiceFee;
1781
+ combinedData.taxInvoiceProviderCharges += channelData.taxInvoiceProviderCharges;
1782
+ staffWiseData.push(channelData);
1783
+ }
1784
+ const usableStaffWiseData = staffWiseData
1785
+ .map((d) => ({
1786
+ ...d,
1787
+ channels: getSortedUsableChannels(d.channels),
1788
+ }))
1789
+ .sort((a, b) => b.netSale - a.netSale);
1790
+ Object.values(uniqueCombinedDataMap).forEach((d) => {
1791
+ combinedChannelsMap[d._id] = {
1792
+ _id: d._id,
1793
+ ref: d.ref,
1794
+ title: d.title,
1795
+ subChannels: {
1796
+ [d.subChannel.ref]: {
1797
+ _id: d.subChannel._id,
1798
+ ref: d.subChannel.ref,
1799
+ title: `${d.subChannel.num} ${(0, common_1.sentenceCase)(d.title)}`,
1800
+ count: d.subChannel.count,
1801
+ amount: d.subChannel.amount,
1802
+ sortIndex: 0,
1803
+ },
1804
+ },
1805
+ sortIndex: d.sortIndex,
1806
+ footerDetailsMap: d.footerDetailsMap,
1807
+ };
1808
+ });
1809
+ const combinedChannels = Object.values(combinedChannelsMap).map((c) => {
1810
+ const subChannels = Object.values(c.subChannels).map((sc) => ({
1811
+ ...sc,
1812
+ amount: (0, price_conversion_1.convertPriceFromCents)(sc.amount),
1813
+ }));
1814
+ return {
1815
+ ...c,
1816
+ subChannels,
1817
+ };
1818
+ });
1819
+ const usableCombinedData = {
1820
+ ...subtitles,
1821
+ _id: combinedData._id,
1822
+ title: combinedData.title,
1823
+ channels: getSortedUsableChannels(combinedChannels),
1824
+ grossSale: (0, common_1.parseNum)(combinedData.grossSale),
1825
+ netSale: (0, common_1.parseNum)(combinedData.netSale),
1826
+ netWithoutGst: (0, common_1.parseNum)(combinedData.netWithoutGst),
1827
+ totalOrders: (0, common_1.parseNum)(combinedData.totalOrders),
1828
+ unpaidAmount: (0, common_1.parseNum)(combinedData.unpaidAmount),
1829
+ unpaidOrders: (0, common_1.parseNum)(combinedData.unpaidOrders),
1830
+ itemSales: (0, common_1.parseNum)(combinedData.itemSales),
1831
+ netWithoutServiceFee: (0, common_1.parseNum)(combinedData.netWithoutServiceFee),
1832
+ taxInvoiceProviderCharges: (0, common_1.parseNum)(combinedData.taxInvoiceProviderCharges),
1833
+ amountCollected: (0, common_1.parseNum)(combinedData.amountCollected),
1834
+ };
1835
+ return {
1836
+ staffWiseData: usableStaffWiseData,
1837
+ combinedData: usableCombinedData,
1838
+ };
1839
+ };
1840
+ const getXReportData = (data, currencySymbol, countryAlpha2, taxInvoiceProvider) => {
1841
+ const gstName = (0, common_1.getGSTName)(countryAlpha2, taxInvoiceProvider);
1842
+ const itemSalesSubtitle = 'Items Amount - Discounts';
1843
+ const grossSaleSubtitle = 'incl. Discounts, Complimentary';
1844
+ const netSaleSubtitle = 'excl. Discounts, Complimentary';
1845
+ const netWithoutServiceFeeSubtitle = 'excl. Service Charges, Delivery Charges, Discounts, Complimentary';
1846
+ const netWithoutGstSubtitle = `excl. ${gstName}, Service Charges, Delivery Charges, Discounts, Complimentary`;
1847
+ const subtitles = {
1848
+ itemSalesSubtitle,
1849
+ grossSaleSubtitle,
1850
+ netSaleSubtitle,
1851
+ netWithoutServiceFeeSubtitle,
1852
+ netWithoutGstSubtitle,
1853
+ };
1854
+ const staffWiseData = generateStaffWiseData(data, currencySymbol, gstName);
1855
+ const usableData = getUsableData(staffWiseData, subtitles);
1856
+ return usableData;
1857
+ };
1858
+ exports.getXReportData = getXReportData;