@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,1440 @@
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.getPurchaseOrderXReportData = void 0;
7
+ exports.getPurchaseOrderXReportHtml = getPurchaseOrderXReportHtml;
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: -32px;
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: 32px;
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: 50px;
165
+ display: flex;
166
+ -webkit-box-align: center;
167
+ align-items: center;
168
+ -webkit-box-pack: center;
169
+ justify-content: center;
170
+ padding: 15px;
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.9500000000000002rem;
185
+ font-size: 1.5rem;
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.5rem;
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: 6px 16px;
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: 6px 16px;
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: 6px 16px;
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: 6px 16px;
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
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
790
+ }
791
+
792
+ .cssc-lpyf3z-kjlask {
793
+ font-size: 17px !important;
794
+ line-height: 19px !important;
795
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
796
+ }
797
+
798
+ .cssc-16f6p1q-kjlask {
799
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
800
+ }
801
+
802
+ .cssc-1qek100-kjlask {
803
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
804
+ }
805
+
806
+ .cssc-rorn0c-lkask {
807
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
808
+ }
809
+
810
+ .cssc-1m6vi3w-posi {
811
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
812
+ }
813
+
814
+ .cssc-15wwp11-qwem {
815
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
816
+ }
817
+
818
+ .cssc-ho2sf9-sanbv {
819
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
820
+ }
821
+
822
+ .cssc-apqrd9-skjas {
823
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
824
+ }
825
+
826
+ .cssc-1qrvgoi-sanbv {
827
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
828
+ }
829
+
830
+ .cssc-kkegnv-sanbv {
831
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
832
+ }
833
+ `
834
+ : ''}
835
+ </style>
836
+ <title>Purchase Order X Report</title>
837
+ </head>`;
838
+ };
839
+ function getBody({ vendorWiseData, combinedData, currency_symbol, from, to, warehouseName, monochrome, isFilterApplied, }) {
840
+ let mainBodyElements = ``;
841
+ const fillMainBody = (staffData, index) => {
842
+ let mainBodyFooterElements = `<div class="cssc-gmwslw-kjlask">
843
+ <p class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Total Orders</p>
844
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${staffData.totalOrders}</p>
845
+ </div>`;
846
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
847
+ <div class="cssc-gmwslw-kjlask">
848
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Item Sales</h6>
849
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${(0, common_1.localeAmount)(currency_symbol, staffData.itemSales)}</p>
850
+ </div>`;
851
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
852
+ <div class="cssc-gmwslw-kjlask">
853
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Net Sale</h6>
854
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap;${monochrome ? '' : 'color: #008000'}">${(0, common_1.localeAmount)(currency_symbol, staffData.netSale)}</p>
855
+ </div>`;
856
+ if (staffData.unpaidOrders > 0) {
857
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
858
+ <div class="cssc-gmwslw-kjlask">
859
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Amount Collected</h6>
860
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap;${monochrome ? '' : 'color: #FF6D00'}">${(0, common_1.localeAmount)(currency_symbol, staffData.amountCollected)}</p>
861
+ </div>`;
862
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
863
+ <div class="cssc-gmwslw-kjlask">
864
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">${staffData.unpaidOrders} Unpaid</h6>
865
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap;${monochrome ? '' : 'color: #FF0000'}">${(0, common_1.localeAmount)(currency_symbol, staffData.unpaidAmount)}</p>
866
+ </div>`;
867
+ }
868
+ if (staffData.netWithoutGst > 0 && staffData.netWithoutGst !== staffData.netSale) {
869
+ mainBodyFooterElements += `<hr class="cssc-1l6ueuj-sjaksl" />
870
+ <div class="cssc-gmwslw-kjlask">
871
+ <div class="cssc-lpyf3z-kjlask">
872
+ <h6 class="cssc-1iy4zoj-oilkj" style="font-weight: 700">Net Sale (Other)</h6>
873
+ <span class="cssc-1ebo3gf-oilkj">${staffData.netWithoutGstSubtitle}</span>
874
+ </div>
875
+ <p class="cssc-13sv1r4-oilkj" style="white-space: nowrap">${(0, common_1.localeAmount)(currency_symbol, staffData.netWithoutGst)}</p>
876
+ </div>`;
877
+ }
878
+ let mainBodyTableElements = ``;
879
+ staffData.channels.forEach((channel) => {
880
+ mainBodyTableElements += `<tr class="cssc-1qrvgoi-sanbv">
881
+ <td class="cssc-gnx8yv-ssaaw" colspan="3">
882
+ <h6 class="cssc-1b7x1hq-oilkj">
883
+ ${channel.title}
884
+ </h6>
885
+ </td>
886
+ </tr>`;
887
+ channel.subChannels.forEach((subChannel) => {
888
+ mainBodyTableElements += `<tr class="cssc-kkegnv-sanbv">
889
+ <th class="cssc-1d7qqp0-ssaaw" scope="row">
890
+ <p class="cssc-1ebo3of-oilkj"
891
+ ${subChannel.bold ? `style="font-weight: bold; text-decoration: underline"` : ''}
892
+ >
893
+ ${subChannel.title}
894
+ </p>
895
+ </th>
896
+
897
+ <td class="cssc-up54xb-ssaaw" align="right">
898
+ <p class="cssc-1iy4zoj-oilkj"
899
+ ${subChannel.bold ? `style="font-weight: bold; text-decoration: underline"` : ''}
900
+ >${subChannel.count}</p>
901
+ </td>
902
+
903
+ <td class="cssc-v53jtm-ssaaw" align="right">
904
+ <p class="cssc-1iy4zoj-oilkj"
905
+ ${subChannel.strikeThrough
906
+ ? `style="text-decoration: line-through"`
907
+ : subChannel.bold
908
+ ? `style="font-weight: bold; text-decoration: underline"`
909
+ : ''}
910
+ >${(0, common_1.localeAmount)(currency_symbol, subChannel.amount)}</p>
911
+ </td>
912
+ </tr>`;
913
+ });
914
+ channel.footerDetails.forEach((row) => {
915
+ mainBodyTableElements += `<tr class="cssc-kkegnv-sanbv">
916
+ <th class="cssc-1d7qqp0-ssaaw" scope="row">
917
+ <div class="cssc-1pm8m44-kjlask" >
918
+ <div class="cssc-1ebo3of-gaplas"></div>
919
+ <span class="cssc-1ebo3of-oilkj" style="font-weight: normal">
920
+ ${row.title}
921
+ </span>
922
+ </div>
923
+ </th>
924
+
925
+ <td class="cssc-up54xb-ssaaw" align="right">
926
+ <p class="cssc-1iy4zoj-oilkj" style="font-weight: normal">${row.count}</p>
927
+ </td>
928
+
929
+ <td class="cssc-v53jtm-ssaaw" align="right">
930
+ <p class="cssc-1iy4zoj-oilkj" style="font-weight: normal">${(0, common_1.localeAmount)(currency_symbol, row.amount)}</p>
931
+ </td>
932
+ </tr>`;
933
+ });
934
+ });
935
+ let mainBodyDivider = '';
936
+ if (monochrome && index > 0) {
937
+ mainBodyDivider = `<hr style="height: 3px; color: #000000; background-color: #000000; border: none;" />`;
938
+ }
939
+ mainBodyElements += `<div class="cssc-1owvoyj-kjhgs">
940
+ <div class="cssc-cjhduv-kjhgs">
941
+ ${mainBodyDivider}
942
+ <div class="cssc-1qek100-kjlask">
943
+ <div class="cssc-lpyf3a-skks">
944
+ <h5 class="cssc-1gb95rg-oilkj">${staffData.title}</h5>
945
+ </div>
946
+
947
+ <div class="cssc-rorn0c-lkask">
948
+ <table class="cssc-1m6vi3w-posi">
949
+ <thead class="cssc-15wwp11-qwem">
950
+ <tr class="cssc-ho2sf9-sanbv">
951
+ <th class="cssc-idkl0b-ssaaw" scope="col">
952
+ <h6 class="cssc-rq2z2r-oilkj">
953
+ Description
954
+ </h6>
955
+ </th>
956
+
957
+ <th class="cssc-1ymm2he-ssaaw" scope="col" align="right">
958
+ </th>
959
+
960
+ <th class="cssc-eyhmry-ssaaw" scope="col" align="right">
961
+ <h6 class="cssc-rq2z2r-oilkj" style="text-align: right">Amount</h6>
962
+ </th>
963
+ </tr>
964
+ </thead>
965
+
966
+ <tbody class="cssc-apqrd9-skjas">
967
+ ${mainBodyTableElements}
968
+ </tbody>
969
+ </table>
970
+ </div>
971
+
972
+ <div class="cssc-1ho5x3sk-kjlask">
973
+ <div class="cssc-1ho5x3p-kjlask">
974
+ ${mainBodyFooterElements}
975
+ </div>
976
+ </div>
977
+ </div>
978
+ </div>
979
+ </div>`;
980
+ };
981
+ vendorWiseData.forEach(fillMainBody);
982
+ if (combinedData != null && vendorWiseData.length > 1) {
983
+ fillMainBody(combinedData, vendorWiseData.length);
984
+ }
985
+ return `<div class="cssc-1flmrcm-kjlask">
986
+ <div class="cssc-1qeq10-kjlask">
987
+ <h5 class="cssc-1gb95rg-oilkj" style="color: #000000">Purchase Order X Report</h5>
988
+ <p class="cssc-1iy4zoj-oilkj">${(0, moment_1.default)(from).format('dddd')} ${(0, moment_1.default)(from).format('MMM DD, YYYY')}</p>
989
+ <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>
990
+ </div>
991
+
992
+ <div class="cssc-16f6p1q-kjlask">
993
+ ${mainBodyElements}
994
+ </div>
995
+
996
+ <div class="cssc-1qeq10-kjlask">
997
+ <h5 class="cssc-1gb95rg-oilkj" style="color: #000000">${warehouseName ?? ''}</h5>
998
+ <p class="cssc-1iy4zoj-oilkj">
999
+ 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')}
1000
+ </p>
1001
+ ${isFilterApplied
1002
+ ? `<p class="cssc-1iy4zoj-oilkj"
1003
+ style="text-align: center; font-weight: bold; ${monochrome ? 'color: #000000' : 'color: #FF0000'}"
1004
+ >
1005
+ Note: This report is filtered. Please ensure to tally the data on your end.
1006
+ </p>`
1007
+ : ''}
1008
+ </div>
1009
+ </div>`;
1010
+ }
1011
+ function getPurchaseOrderXReportHtml({ width, monochrome, vendorWiseData, combinedData, currency_symbol, from, to, warehouseName, isFilterApplied, }) {
1012
+ const style = width ? `style=width: ${width}px; max-width: ${width}px` : '';
1013
+ const html = `
1014
+ <html lang="en" ${style}>
1015
+ ${getHead(monochrome)}
1016
+ <body translate="no"
1017
+ ${style}
1018
+ >
1019
+ ${getBody({
1020
+ vendorWiseData,
1021
+ combinedData,
1022
+ currency_symbol,
1023
+ from,
1024
+ to,
1025
+ warehouseName,
1026
+ monochrome,
1027
+ isFilterApplied,
1028
+ })}
1029
+ </body>
1030
+ </html>`;
1031
+ return html;
1032
+ }
1033
+ // ======================>>>><<<<=====================
1034
+ const TOTAL_REF = 'TOTAL';
1035
+ const VENDOR_ID = 'by_vendors';
1036
+ const getSortedUsableChannels = (channels) => {
1037
+ const usableChannels = [];
1038
+ for (let i = 0; i < channels.length; i++) {
1039
+ const c = channels[i];
1040
+ const footerDetailsMap = c.footerDetailsMap;
1041
+ const channel = {
1042
+ _id: c._id,
1043
+ title: c.title,
1044
+ ref: c.ref,
1045
+ sortIndex: c.sortIndex,
1046
+ subChannels: c.subChannels,
1047
+ footerDetails: Object.values(footerDetailsMap)
1048
+ .map((fd) => ({
1049
+ ...fd,
1050
+ amount: (0, price_conversion_1.convertIntToDecimal)(fd.amount),
1051
+ }))
1052
+ .sort((a, b) => a.sortIndex - b.sortIndex),
1053
+ };
1054
+ const subChannels = channel.subChannels;
1055
+ subChannels
1056
+ .sort((a, b) => (a.ref > b.ref ? 1 : -1))
1057
+ .forEach((sc, index) => {
1058
+ sc.sortIndex = index;
1059
+ });
1060
+ for (let j = 0; j < subChannels.length; j++) {
1061
+ const subChannel = subChannels[j];
1062
+ if (subChannel.ref === TOTAL_REF) {
1063
+ subChannel.sortIndex = 100000;
1064
+ subChannel.bold = true;
1065
+ }
1066
+ else if (channel.ref === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES) {
1067
+ const paymentType = subChannel.ref;
1068
+ let sortIndex = constants_1.ALL_PAYMENT_TYPE_NAMES.indexOf(paymentType);
1069
+ if (sortIndex === -1) {
1070
+ sortIndex = 200 + j;
1071
+ }
1072
+ subChannel.sortIndex = sortIndex;
1073
+ if (paymentType === constants_1.PAYMENT_TYPE_ENUM.COMPLIMENTARY) {
1074
+ const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
1075
+ if (totalIndex !== -1) {
1076
+ const totalAmount = channel.subChannels[totalIndex].amount;
1077
+ channel.subChannels[totalIndex].amount = (0, common_1.parseNum)(totalAmount - subChannel.amount);
1078
+ }
1079
+ subChannel.strikeThrough = true;
1080
+ }
1081
+ }
1082
+ else if (channel.ref === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
1083
+ const status = subChannel.ref;
1084
+ let sortIndex = constants_1.ALL_PURCHASE_ORDER_STATUS_NAMES.indexOf(status);
1085
+ if (sortIndex === -1) {
1086
+ sortIndex = 200 + j;
1087
+ }
1088
+ if (status === constants_1.PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
1089
+ const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
1090
+ if (totalIndex !== -1) {
1091
+ const totalAmount = channel.subChannels[totalIndex].amount;
1092
+ channel.subChannels[totalIndex].amount = (0, common_1.parseNum)(totalAmount - subChannel.amount);
1093
+ }
1094
+ subChannel.strikeThrough = true;
1095
+ }
1096
+ subChannel.sortIndex = sortIndex;
1097
+ }
1098
+ else if (channel.ref === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.STAFF) {
1099
+ // Vendors are sorted by ref (vendor_id)
1100
+ subChannel.sortIndex = j;
1101
+ }
1102
+ }
1103
+ usableChannels.push(channel);
1104
+ }
1105
+ const sortedChannels = usableChannels
1106
+ .map((channel) => ({
1107
+ ...channel,
1108
+ subChannels: channel.subChannels.sort((a, b) => a.sortIndex - b.sortIndex),
1109
+ }))
1110
+ .sort((a, b) => a.sortIndex - b.sortIndex);
1111
+ return sortedChannels;
1112
+ };
1113
+ const generateVendorWiseData = (data, currencySymbol, gstName) => {
1114
+ const vendorWiseDataMap = {};
1115
+ const vendorWiseTotalSalesMap = {};
1116
+ const vendorNamesMap = {};
1117
+ data[constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.TOTAL_SALES].forEach((item) => {
1118
+ const vendorName = item.vendor_name ?? 'By Vendors';
1119
+ const vendorId = item.vendor_id ?? VENDOR_ID;
1120
+ vendorWiseTotalSalesMap[vendorId] = item;
1121
+ vendorNamesMap[vendorId] = vendorName;
1122
+ });
1123
+ // ==========>>><<<==========
1124
+ data[constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.STAFF].forEach((item) => {
1125
+ const vendorId = item.vendor_id ?? VENDOR_ID;
1126
+ const vendorName = vendorNamesMap[vendorId];
1127
+ if (vendorName != null) {
1128
+ const amount = item.grossAmount;
1129
+ const obj = {
1130
+ _id: vendorId,
1131
+ ref: item.staff_id,
1132
+ title: 'Staff',
1133
+ description: item.staff_name,
1134
+ type: constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.STAFF,
1135
+ staff_name: vendorName,
1136
+ count: item.count,
1137
+ amount,
1138
+ sortIndex: 1,
1139
+ };
1140
+ if (vendorWiseDataMap[vendorId] != null) {
1141
+ vendorWiseDataMap[vendorId].push(obj);
1142
+ }
1143
+ else {
1144
+ vendorWiseDataMap[vendorId] = [obj];
1145
+ }
1146
+ }
1147
+ });
1148
+ data[constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS].forEach((item) => {
1149
+ const vendorId = item.vendor_id ?? VENDOR_ID;
1150
+ const vendorName = vendorNamesMap[vendorId];
1151
+ if (vendorName != null) {
1152
+ const amount = item.grossAmount;
1153
+ const obj = {
1154
+ _id: vendorId,
1155
+ ref: item.status,
1156
+ type: constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS,
1157
+ staff_name: vendorName,
1158
+ title: 'Order Status',
1159
+ description: (0, common_1.sentenceCase)(item.status.replace(/_/g, ' ')),
1160
+ count: item.count,
1161
+ amount,
1162
+ sortIndex: 2,
1163
+ };
1164
+ if (vendorWiseDataMap[vendorId] != null) {
1165
+ vendorWiseDataMap[vendorId].push(obj);
1166
+ }
1167
+ else {
1168
+ vendorWiseDataMap[vendorId] = [obj];
1169
+ }
1170
+ }
1171
+ });
1172
+ data[constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES].forEach((item) => {
1173
+ const vendorId = item.vendor_id ?? VENDOR_ID;
1174
+ const vendorName = vendorNamesMap[vendorId];
1175
+ if (vendorName != null) {
1176
+ const amount = item.grossAmount;
1177
+ const obj = {
1178
+ _id: vendorId,
1179
+ ref: item.payment_type,
1180
+ type: constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES,
1181
+ staff_name: vendorName,
1182
+ title: 'Payments',
1183
+ description: (0, common_1.sentenceCase)(item.payment_type.replace(/_/g, ' ')),
1184
+ count: item.count,
1185
+ amount,
1186
+ sortIndex: 3,
1187
+ };
1188
+ if (vendorWiseDataMap[vendorId] != null) {
1189
+ vendorWiseDataMap[vendorId].push(obj);
1190
+ }
1191
+ else {
1192
+ vendorWiseDataMap[vendorId] = [obj];
1193
+ }
1194
+ }
1195
+ });
1196
+ data[constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.GST].forEach((item) => {
1197
+ const vendorId = item.vendor_id ?? VENDOR_ID;
1198
+ const vendorName = vendorNamesMap[vendorId];
1199
+ if (vendorName != null) {
1200
+ const gst = (0, price_conversion_1.convertIntToDecimal)(item.gst);
1201
+ const amount = item.grossAmount;
1202
+ const obj = {
1203
+ _id: vendorId,
1204
+ ref: gst,
1205
+ type: constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.GST,
1206
+ staff_name: vendorName,
1207
+ title: gstName,
1208
+ description: `${gst}%`,
1209
+ count: item.count,
1210
+ amount,
1211
+ sortIndex: 4,
1212
+ };
1213
+ if (vendorWiseDataMap[vendorId] != null) {
1214
+ vendorWiseDataMap[vendorId].push(obj);
1215
+ }
1216
+ else {
1217
+ vendorWiseDataMap[vendorId] = [obj];
1218
+ }
1219
+ }
1220
+ });
1221
+ const vendorWiseDataFooterDetailsMap = {};
1222
+ return {
1223
+ vendorWiseDataMap,
1224
+ vendorWiseTotalSalesMap,
1225
+ vendorWiseDataFooterDetailsMap,
1226
+ };
1227
+ };
1228
+ const getUsableData = (data, subtitles) => {
1229
+ const defaultCombinedData = {
1230
+ _id: 'combined',
1231
+ title: 'Combined Report',
1232
+ netSale: 0,
1233
+ netWithoutGst: 0,
1234
+ totalOrders: 0,
1235
+ unpaidOrders: 0,
1236
+ unpaidAmount: 0,
1237
+ amountCollected: 0,
1238
+ itemSales: 0,
1239
+ channels: [],
1240
+ ...subtitles,
1241
+ };
1242
+ const { vendorWiseDataMap, vendorWiseTotalSalesMap, vendorWiseDataFooterDetailsMap } = data;
1243
+ const vendorWiseData = [];
1244
+ const combinedData = {
1245
+ ...defaultCombinedData,
1246
+ };
1247
+ const combinedChannelsMap = {};
1248
+ for (const staffId in vendorWiseDataMap) {
1249
+ const salesData = vendorWiseTotalSalesMap[staffId];
1250
+ if (!salesData)
1251
+ continue;
1252
+ const staffData = vendorWiseDataMap[staffId];
1253
+ const similarTypes = {};
1254
+ for (let i = 0; i < staffData.length; i++) {
1255
+ const d = staffData[i];
1256
+ if (similarTypes[d.type] != null) {
1257
+ similarTypes[d.type].push(d);
1258
+ }
1259
+ else {
1260
+ similarTypes[d.type] = [d];
1261
+ }
1262
+ }
1263
+ const totalOrders = salesData.count;
1264
+ const netSale = salesData.grossAmount;
1265
+ let totalGst = 0;
1266
+ let unpaidOrders = 0;
1267
+ let unpaidAmount = 0;
1268
+ for (const type in similarTypes) {
1269
+ const firstData = similarTypes[type][0];
1270
+ if (!firstData)
1271
+ continue;
1272
+ const combinedData = similarTypes[type].reduce((acc, d) => {
1273
+ acc.count += d.count;
1274
+ acc.amount += d.amount;
1275
+ return acc;
1276
+ }, {
1277
+ count: 0,
1278
+ amount: 0,
1279
+ });
1280
+ similarTypes[type].push({
1281
+ _id: `${firstData._id}-${TOTAL_REF}`,
1282
+ ref: TOTAL_REF,
1283
+ type: firstData.type,
1284
+ staff_name: firstData.staff_name,
1285
+ title: firstData.title,
1286
+ description: 'Total',
1287
+ count: combinedData.count,
1288
+ amount: combinedData.amount,
1289
+ sortIndex: 100000,
1290
+ });
1291
+ }
1292
+ const topLevelChannels = [];
1293
+ for (const type in similarTypes) {
1294
+ const vendorWiseDataArr = similarTypes[type];
1295
+ const firstData = vendorWiseDataArr[0];
1296
+ const footerDetailsMap = structuredClone(vendorWiseDataFooterDetailsMap[staffId]?.[type] ?? {});
1297
+ const channel = {
1298
+ _id: `${firstData._id}-${firstData.type}`,
1299
+ ref: firstData.type,
1300
+ title: firstData.title,
1301
+ subChannels: [],
1302
+ sortIndex: firstData.sortIndex,
1303
+ footerDetailsMap,
1304
+ };
1305
+ const subChannels = [];
1306
+ for (let j = 0; j < vendorWiseDataArr.length; j++) {
1307
+ const d = vendorWiseDataArr[j];
1308
+ if (d.type === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.GST && d.ref !== TOTAL_REF) {
1309
+ totalGst += d.amount;
1310
+ }
1311
+ else if (d.type === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES && d.ref !== TOTAL_REF) {
1312
+ if (String(d.description).toUpperCase() === constants_1.PAYMENT_TYPE_ENUM.UNPAID) {
1313
+ unpaidOrders += d.count;
1314
+ unpaidAmount += d.amount;
1315
+ }
1316
+ }
1317
+ const sChannel = {
1318
+ _id: `${d._id}-${d.ref}`,
1319
+ ref: d.ref,
1320
+ title: typeof d.description === 'string' ? d.description : `${d.description} ${(0, common_1.sentenceCase)(d.type)}`,
1321
+ count: d.count,
1322
+ amount: d.amount,
1323
+ sortIndex: j,
1324
+ };
1325
+ if (combinedChannelsMap[type] != null) {
1326
+ if (combinedChannelsMap[type].subChannels[d.ref] != null) {
1327
+ combinedChannelsMap[type].subChannels[d.ref].amount += d.amount;
1328
+ combinedChannelsMap[type].subChannels[d.ref].count += d.count;
1329
+ }
1330
+ else {
1331
+ combinedChannelsMap[type].subChannels[d.ref] = {
1332
+ ...sChannel,
1333
+ sortIndex: j,
1334
+ };
1335
+ }
1336
+ }
1337
+ else {
1338
+ combinedChannelsMap[type] = {
1339
+ _id: `${d._id}-${d.type}`,
1340
+ ref: d.type,
1341
+ title: d.title,
1342
+ sortIndex: d.sortIndex,
1343
+ footerDetailsMap: {},
1344
+ subChannels: {
1345
+ [d.ref]: {
1346
+ ...sChannel,
1347
+ sortIndex: j,
1348
+ },
1349
+ },
1350
+ };
1351
+ }
1352
+ if (j === 0) {
1353
+ const combinedFooterDetailsMap = structuredClone(combinedChannelsMap[type].footerDetailsMap ?? {});
1354
+ for (const key in footerDetailsMap) {
1355
+ if (combinedFooterDetailsMap[key] != null) {
1356
+ combinedFooterDetailsMap[key].amount += footerDetailsMap[key].amount;
1357
+ combinedFooterDetailsMap[key].count += footerDetailsMap[key].count;
1358
+ }
1359
+ else {
1360
+ combinedFooterDetailsMap[key] = footerDetailsMap[key];
1361
+ }
1362
+ }
1363
+ combinedChannelsMap[type].footerDetailsMap = combinedFooterDetailsMap;
1364
+ }
1365
+ sChannel.amount = (0, price_conversion_1.convertIntToDecimal)(sChannel.amount);
1366
+ subChannels.push(sChannel);
1367
+ }
1368
+ channel.subChannels = subChannels;
1369
+ topLevelChannels.push(channel);
1370
+ }
1371
+ const netWithoutGst = netSale - totalGst;
1372
+ const itemSales = salesData.totalItemSales;
1373
+ const amountCollected = netSale - unpaidAmount;
1374
+ const channelData = {
1375
+ ...subtitles,
1376
+ _id: staffId,
1377
+ title: salesData.vendor_name,
1378
+ netSale: (0, price_conversion_1.convertIntToDecimal)(netSale),
1379
+ netWithoutGst: (0, price_conversion_1.convertIntToDecimal)(netWithoutGst),
1380
+ itemSales: (0, price_conversion_1.convertIntToDecimal)(itemSales),
1381
+ amountCollected: (0, price_conversion_1.convertIntToDecimal)(amountCollected),
1382
+ unpaidAmount: (0, price_conversion_1.convertIntToDecimal)(unpaidAmount),
1383
+ totalOrders,
1384
+ unpaidOrders,
1385
+ channels: topLevelChannels,
1386
+ };
1387
+ combinedData.netSale += channelData.netSale;
1388
+ combinedData.netWithoutGst += channelData.netWithoutGst;
1389
+ combinedData.totalOrders += channelData.totalOrders;
1390
+ combinedData.unpaidOrders += channelData.unpaidOrders;
1391
+ combinedData.unpaidAmount += channelData.unpaidAmount;
1392
+ combinedData.amountCollected += channelData.amountCollected;
1393
+ combinedData.itemSales += channelData.itemSales;
1394
+ vendorWiseData.push(channelData);
1395
+ }
1396
+ const usableVendorWiseData = vendorWiseData
1397
+ .map((d) => ({
1398
+ ...d,
1399
+ channels: getSortedUsableChannels(d.channels),
1400
+ }))
1401
+ .sort((a, b) => b.netSale - a.netSale);
1402
+ const combinedChannels = Object.values(combinedChannelsMap).map((c) => {
1403
+ const subChannels = Object.values(c.subChannels).map((sc) => ({
1404
+ ...sc,
1405
+ amount: (0, price_conversion_1.convertIntToDecimal)(sc.amount),
1406
+ }));
1407
+ return {
1408
+ ...c,
1409
+ subChannels,
1410
+ };
1411
+ });
1412
+ const usableCombinedData = {
1413
+ ...subtitles,
1414
+ _id: combinedData._id,
1415
+ title: combinedData.title,
1416
+ channels: getSortedUsableChannels(combinedChannels),
1417
+ netSale: (0, common_1.parseNum)(combinedData.netSale),
1418
+ netWithoutGst: (0, common_1.parseNum)(combinedData.netWithoutGst),
1419
+ totalOrders: (0, common_1.parseNum)(combinedData.totalOrders),
1420
+ unpaidOrders: (0, common_1.parseNum)(combinedData.unpaidOrders),
1421
+ unpaidAmount: (0, common_1.parseNum)(combinedData.unpaidAmount),
1422
+ amountCollected: (0, common_1.parseNum)(combinedData.amountCollected),
1423
+ itemSales: (0, common_1.parseNum)(combinedData.itemSales),
1424
+ };
1425
+ return {
1426
+ vendorWiseData: usableVendorWiseData,
1427
+ combinedData: usableCombinedData,
1428
+ };
1429
+ };
1430
+ const getPurchaseOrderXReportData = (data, currencySymbol, countryAlpha2) => {
1431
+ const gstName = (0, common_1.getGSTName)(countryAlpha2);
1432
+ const netWithoutGstSubtitle = `excl. ${gstName}`;
1433
+ const subtitles = {
1434
+ netWithoutGstSubtitle,
1435
+ };
1436
+ const vendorWiseData = generateVendorWiseData(data, currencySymbol, gstName);
1437
+ const usableData = getUsableData(vendorWiseData, subtitles);
1438
+ return usableData;
1439
+ };
1440
+ exports.getPurchaseOrderXReportData = getPurchaseOrderXReportData;