@managesome/eposmatic-toolkit 0.3.8 → 0.3.9

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 (436) hide show
  1. package/esm/constants/ANALYTICS.js +146 -0
  2. package/esm/constants/API_ERRORS.js +6 -0
  3. package/esm/constants/COMMON.js +369 -0
  4. package/esm/constants/DELIVERY.js +45 -0
  5. package/esm/constants/DIALER_ENUMS.js +11 -0
  6. package/esm/constants/ENUMS.js +1988 -0
  7. package/esm/constants/FBR_ENUMS.js +18 -0
  8. package/esm/constants/HUBRISE_ENUMS.js +179 -0
  9. package/esm/constants/INTERNAL_ENUMS.js +49 -0
  10. package/esm/constants/NOTIFICATIONS.js +6 -0
  11. package/esm/constants/ORDER.js +251 -0
  12. package/esm/constants/PRA_ENUMS.js +18 -0
  13. package/esm/constants/REPORT_WEBVIEW.js +28 -0
  14. package/esm/constants/RFQ_GO.js +83 -0
  15. package/esm/constants/SMARTPAY_ENUMS.js +55 -0
  16. package/esm/constants/SOCKET.js +149 -0
  17. package/esm/constants/SRB_ENUMS.js +13 -0
  18. package/esm/constants/SWITCHPAY.js +28 -0
  19. package/esm/constants/TENANT_ENUMS.js +90 -0
  20. package/esm/constants/TENANT_PURCHASE_ORDER.js +91 -0
  21. package/esm/constants/WALLET.js +51 -0
  22. package/esm/constants/WAREHOUSE_ANALYTICS.js +28 -0
  23. package/esm/constants/WAREHOUSE_ENUMS.js +420 -0
  24. package/esm/constants/WAREHOUSE_PURCHASE_ORDER.js +97 -0
  25. package/esm/constants/WEBVIEW.js +43 -0
  26. package/esm/constants/WORKER_ENDPOINTS.js +79 -0
  27. package/esm/constants/index.js +27 -0
  28. package/esm/constants/types.js +2 -0
  29. package/esm/helpers/fbr/generate-invoice.js +94 -0
  30. package/esm/helpers/fbr/index.js +1 -0
  31. package/esm/helpers/hubrise/hubrise-catalog.js +304 -0
  32. package/esm/helpers/hubrise/index.js +1 -0
  33. package/esm/helpers/index.js +9 -0
  34. package/esm/helpers/kpra/generate-invoice.js +26 -0
  35. package/esm/helpers/kpra/index.js +1 -0
  36. package/esm/helpers/order/generate-order.js +508 -0
  37. package/esm/helpers/order/generate-warehouse-internal-movement.js +71 -0
  38. package/esm/helpers/order/generate-warehouse-purchase-order-rfq.js +176 -0
  39. package/esm/helpers/order/generate-warehouse-purchase-order.js +187 -0
  40. package/esm/helpers/order/generate-warehouse-sale-order-rfq.js +176 -0
  41. package/esm/helpers/order/generate-warehouse-sale-order.js +149 -0
  42. package/esm/helpers/order/index.js +6 -0
  43. package/esm/helpers/pra/generate-invoice.js +94 -0
  44. package/esm/helpers/pra/index.js +1 -0
  45. package/esm/helpers/srb/generate-invoice.js +68 -0
  46. package/esm/helpers/srb/index.js +1 -0
  47. package/esm/helpers/store/all-orders-actions.js +17 -0
  48. package/esm/helpers/store/all-tenant-purchase-orders-actions.js +45 -0
  49. package/esm/helpers/store/all-warehouse-purchase-order-rfqs-actions.js +66 -0
  50. package/esm/helpers/store/all-warehouse-purchase-order-vendor-return-actions.js +50 -0
  51. package/esm/helpers/store/all-warehouse-purchase-orders-actions.js +49 -0
  52. package/esm/helpers/store/all-warehouse-sale-order-invoices-actions.js +132 -0
  53. package/esm/helpers/store/all-warehouse-sale-order-rfqs-actions.js +66 -0
  54. package/esm/helpers/store/all-warehouse-sale-orders-actions.js +72 -0
  55. package/esm/helpers/store/cart-actions.js +3563 -0
  56. package/esm/helpers/store/catalog-actions.js +379 -0
  57. package/esm/helpers/store/common-order-actions.js +937 -0
  58. package/esm/helpers/store/common-tenant-purchase-order-actions.js +440 -0
  59. package/esm/helpers/store/common-warehouse-internal-movement-actions.js +95 -0
  60. package/esm/helpers/store/common-warehouse-purchase-order-actions.js +530 -0
  61. package/esm/helpers/store/common-warehouse-purchase-order-receipt-actions.js +33 -0
  62. package/esm/helpers/store/common-warehouse-purchase-order-rfq-actions.js +523 -0
  63. package/esm/helpers/store/common-warehouse-purchase-order-vendor-return-actions.js +25 -0
  64. package/esm/helpers/store/common-warehouse-sale-order-actions.js +483 -0
  65. package/esm/helpers/store/common-warehouse-sale-order-invoice-actions.js +54 -0
  66. package/esm/helpers/store/common-warehouse-sale-order-rfq-actions.js +523 -0
  67. package/esm/helpers/store/index.js +26 -0
  68. package/esm/helpers/store/offline-ordering.js +251 -0
  69. package/esm/helpers/store/tenant-purchase-orders-cart-actions.js +379 -0
  70. package/esm/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +360 -0
  71. package/esm/helpers/store/warehouse-purchase-orders-cart-actions.js +470 -0
  72. package/esm/helpers/store/warehouse-sale-order-rfq-cart-actions.js +359 -0
  73. package/esm/helpers/store/warehouse-sale-orders-cart-actions.js +456 -0
  74. package/esm/helpers/types/api-types.js +1 -0
  75. package/esm/helpers/types/cart-actions.js +1 -0
  76. package/esm/helpers/types/cart-helpers.js +1 -0
  77. package/esm/helpers/types/catalog.js +1 -0
  78. package/esm/helpers/types/common.js +1 -0
  79. package/esm/helpers/types/deliverect_menu.js +1 -0
  80. package/esm/helpers/types/email-templates.js +1 -0
  81. package/esm/helpers/types/fbr-generate-invoice.js +1 -0
  82. package/esm/helpers/types/halfhalf.js +1 -0
  83. package/esm/helpers/types/hubrise_catalog.js +1 -0
  84. package/esm/helpers/types/hubrise_customers.js +1 -0
  85. package/esm/helpers/types/hubrise_deliveries.js +1 -0
  86. package/esm/helpers/types/hubrise_location.js +1 -0
  87. package/esm/helpers/types/hubrise_orders.js +1 -0
  88. package/esm/helpers/types/index.js +33 -0
  89. package/esm/helpers/types/internal-leads.js +1 -0
  90. package/esm/helpers/types/inventory-catalog.js +1 -0
  91. package/esm/helpers/types/kpra-generate-invoice.js +1 -0
  92. package/esm/helpers/types/marketing.js +1 -0
  93. package/esm/helpers/types/order-engine.js +1 -0
  94. package/esm/helpers/types/pra-generate-invoice.js +1 -0
  95. package/esm/helpers/types/report-webview.js +1 -0
  96. package/esm/helpers/types/reports.js +1 -0
  97. package/esm/helpers/types/smartpay-apis.js +2 -0
  98. package/esm/helpers/types/specials.js +1 -0
  99. package/esm/helpers/types/split_bill.js +1 -0
  100. package/esm/helpers/types/srb-generate-invoice.js +1 -0
  101. package/esm/helpers/types/switchpay.js +1 -0
  102. package/esm/helpers/types/tenant-purchase-order-cart-actions.js +1 -0
  103. package/esm/helpers/types/warehouse-catalog.js +1 -0
  104. package/esm/helpers/types/warehouse-purchase-order-cart-actions.js +1 -0
  105. package/esm/helpers/types/warehouse-purchase-order-rfq-cart-actions.js +1 -0
  106. package/esm/helpers/types/warehouse-sale-order-cart-actions.js +1 -0
  107. package/esm/helpers/types/warehouse-sale-order-rfq-cart-actions.js +1 -0
  108. package/esm/helpers/types/workers.js +1 -0
  109. package/esm/helpers/utils/asaanbill-identifier-helpers.js +31 -0
  110. package/esm/helpers/utils/business-day-helpers.js +201 -0
  111. package/esm/helpers/utils/cart-helpers.js +156 -0
  112. package/esm/helpers/utils/catalog-conversion.js +129 -0
  113. package/esm/helpers/utils/code-redemption-helpers.js +452 -0
  114. package/esm/helpers/utils/color-helpers.js +31 -0
  115. package/esm/helpers/utils/common.js +368 -0
  116. package/esm/helpers/utils/crypt.js +40 -0
  117. package/esm/helpers/utils/customers-helpers.js +15 -0
  118. package/esm/helpers/utils/delivery-area-helpers.js +42 -0
  119. package/esm/helpers/utils/delivery-helpers.js +87 -0
  120. package/esm/helpers/utils/denominations-helpers.js +53 -0
  121. package/esm/helpers/utils/dinein.js +39 -0
  122. package/esm/helpers/utils/discount-helpers.js +55 -0
  123. package/esm/helpers/utils/email-helpers.js +111 -0
  124. package/esm/helpers/utils/error-helpers.js +14 -0
  125. package/esm/helpers/utils/expense.js +26 -0
  126. package/esm/helpers/utils/getFormFieldsDiff.js +15 -0
  127. package/esm/helpers/utils/gift-card-helpers.js +258 -0
  128. package/esm/helpers/utils/halfhalf-setup-helpers.js +779 -0
  129. package/esm/helpers/utils/hourly-comparison-report-helpers.js +851 -0
  130. package/esm/helpers/utils/hr-helpers.js +62 -0
  131. package/esm/helpers/utils/hubrise-utils.js +32 -0
  132. package/esm/helpers/utils/image-helpers.js +95 -0
  133. package/esm/helpers/utils/image-url-helpers.js +96 -0
  134. package/esm/helpers/utils/index.js +96 -0
  135. package/esm/helpers/utils/ingredients.js +26 -0
  136. package/esm/helpers/utils/internal-amount-helpers.js +49 -0
  137. package/esm/helpers/utils/inventory.js +123 -0
  138. package/esm/helpers/utils/inventory_entries.js +91 -0
  139. package/esm/helpers/utils/inventory_transactions.js +91 -0
  140. package/esm/helpers/utils/item-report-helpers.js +2603 -0
  141. package/esm/helpers/utils/items-comparison-report-helpers.js +1057 -0
  142. package/esm/helpers/utils/kds-helpers.js +43 -0
  143. package/esm/helpers/utils/location-helpers.js +13 -0
  144. package/esm/helpers/utils/menu-helpers.js +44 -0
  145. package/esm/helpers/utils/minified-catalog.js +428 -0
  146. package/esm/helpers/utils/offer-apply-helpers.js +613 -0
  147. package/esm/helpers/utils/offers-helpers.js +3351 -0
  148. package/esm/helpers/utils/operational-roles-helpers.js +33 -0
  149. package/esm/helpers/utils/order-engine.js +1409 -0
  150. package/esm/helpers/utils/order-history.js +208 -0
  151. package/esm/helpers/utils/payment-comparison-report-helpers.js +873 -0
  152. package/esm/helpers/utils/payment-helpers.js +302 -0
  153. package/esm/helpers/utils/pdf-generator.js +110 -0
  154. package/esm/helpers/utils/platform-catalog.js +306 -0
  155. package/esm/helpers/utils/platform-num.js +188 -0
  156. package/esm/helpers/utils/platform-specific-tenant-shifts.js +19 -0
  157. package/esm/helpers/utils/price-conversion.js +24 -0
  158. package/esm/helpers/utils/printer-helpers.js +319 -0
  159. package/esm/helpers/utils/public-holidays-helpers.js +8 -0
  160. package/esm/helpers/utils/ratings-comparison-report-helpers.js +1187 -0
  161. package/esm/helpers/utils/receipt-engine.js +1050 -0
  162. package/esm/helpers/utils/review-helpers.js +391 -0
  163. package/esm/helpers/utils/rider-tracking.js +12 -0
  164. package/esm/helpers/utils/riders-report-helpers.js +1590 -0
  165. package/esm/helpers/utils/sales-comparison-report-helpers.js +1259 -0
  166. package/esm/helpers/utils/sales-comparitive-report-helpers.js +939 -0
  167. package/esm/helpers/utils/sales-overview-report-helpers.js +1046 -0
  168. package/esm/helpers/utils/sales-summary-report-helpers.js +877 -0
  169. package/esm/helpers/utils/scan-code-helpers.js +31 -0
  170. package/esm/helpers/utils/selection-model.js +68 -0
  171. package/esm/helpers/utils/shift-window-helpers.js +148 -0
  172. package/esm/helpers/utils/simplified-catalog.js +107 -0
  173. package/esm/helpers/utils/simplified-halfhalf.js +101 -0
  174. package/esm/helpers/utils/simplified-specials.js +107 -0
  175. package/esm/helpers/utils/simplified-tenant.js +411 -0
  176. package/esm/helpers/utils/specials-helpers.js +727 -0
  177. package/esm/helpers/utils/tenant-calendar-helpers.js +67 -0
  178. package/esm/helpers/utils/tenant-cash-drawer-sessions-helpers.js +248 -0
  179. package/esm/helpers/utils/tenant-cash-drawers-helpers.js +31 -0
  180. package/esm/helpers/utils/tenant-cash-in-out-helpers.js +47 -0
  181. package/esm/helpers/utils/tenant-day-sessions-helpers.js +167 -0
  182. package/esm/helpers/utils/tenant-instore-shift-sessions-helpers.js +227 -0
  183. package/esm/helpers/utils/tenant-staff-helpers.js +19 -0
  184. package/esm/helpers/utils/tenant_cash_in_hand_transactions.js +31 -0
  185. package/esm/helpers/utils/time-helpers.js +142 -0
  186. package/esm/helpers/utils/void-items-report-helpers.js +529 -0
  187. package/esm/helpers/utils/void-order-items-helpers.js +32 -0
  188. package/esm/helpers/utils/voidations-summary-report-helpers.js +800 -0
  189. package/esm/helpers/utils/wallet-helpers.js +22 -0
  190. package/esm/helpers/utils/wallet-redemption-helpers.js +46 -0
  191. package/esm/helpers/utils/warehouse-catalog-conversion.js +117 -0
  192. package/esm/helpers/utils/warehouse-inventory.js +59 -0
  193. package/esm/helpers/utils/warehouse-purchase-order-engine.js +27 -0
  194. package/esm/helpers/utils/warehouse-purchase-order-receipt-engine.js +205 -0
  195. package/esm/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1432 -0
  196. package/esm/helpers/utils/warehouse-sale-order-engine.js +27 -0
  197. package/esm/helpers/utils/warehouse-sale-order-receipt-engine.js +207 -0
  198. package/esm/helpers/utils/warehouse-sale-order-x-report-helpers.js +1 -0
  199. package/esm/helpers/utils/warehouse-sale-x-report-helpers.js +1434 -0
  200. package/esm/helpers/utils/warehouse-settings-helpers.js +37 -0
  201. package/esm/helpers/utils/warehouse-void-purchase-order-items-helpers.js +34 -0
  202. package/esm/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +18 -0
  203. package/esm/helpers/utils/warehouse-void-sale-order-items-helpers.js +34 -0
  204. package/esm/helpers/utils/warehouse-void-sale-order-items-report-helpers.js +18 -0
  205. package/esm/helpers/utils/warehouse_inventory_transactions.js +91 -0
  206. package/esm/helpers/utils/x-report-helpers.js +1850 -0
  207. package/esm/index.js +3 -0
  208. package/esm/schemas/index.js +2 -0
  209. package/esm/schemas/models/app_configs.js +36 -0
  210. package/esm/schemas/models/applied_order_discounts.js +103 -0
  211. package/esm/schemas/models/brands.js +56 -0
  212. package/esm/schemas/models/categories.js +74 -0
  213. package/esm/schemas/models/close_dates.js +63 -0
  214. package/esm/schemas/models/common-models.js +449 -0
  215. package/esm/schemas/models/courses.js +62 -0
  216. package/esm/schemas/models/customer_redemptions.js +82 -0
  217. package/esm/schemas/models/customers.js +269 -0
  218. package/esm/schemas/models/deliveries.js +137 -0
  219. package/esm/schemas/models/delivery_areas.js +97 -0
  220. package/esm/schemas/models/dinein_floors.js +55 -0
  221. package/esm/schemas/models/dinein_tables.js +97 -0
  222. package/esm/schemas/models/dinein_tables_fingerprints.js +96 -0
  223. package/esm/schemas/models/discounts.js +87 -0
  224. package/esm/schemas/models/expense_categories.js +61 -0
  225. package/esm/schemas/models/expense_details.js +130 -0
  226. package/esm/schemas/models/gift_cards.js +342 -0
  227. package/esm/schemas/models/halfhalf_setup.js +142 -0
  228. package/esm/schemas/models/index.js +111 -0
  229. package/esm/schemas/models/internal_customers.js +139 -0
  230. package/esm/schemas/models/internal_invoices.js +119 -0
  231. package/esm/schemas/models/internal_leads.js +78 -0
  232. package/esm/schemas/models/internal_operational_roles.js +85 -0
  233. package/esm/schemas/models/internal_staffs.js +65 -0
  234. package/esm/schemas/models/inventories.js +103 -0
  235. package/esm/schemas/models/inventory_categories.js +52 -0
  236. package/esm/schemas/models/inventory_transactions.js +143 -0
  237. package/esm/schemas/models/item_transactions.js +117 -0
  238. package/esm/schemas/models/items.js +341 -0
  239. package/esm/schemas/models/marketing_fingerprints.js +92 -0
  240. package/esm/schemas/models/menus.js +66 -0
  241. package/esm/schemas/models/messaging_devices.js +99 -0
  242. package/esm/schemas/models/modifier_extras.js +120 -0
  243. package/esm/schemas/models/offers.js +470 -0
  244. package/esm/schemas/models/offers_fingerprints.js +61 -0
  245. package/esm/schemas/models/operational_roles.js +155 -0
  246. package/esm/schemas/models/orders.js +1051 -0
  247. package/esm/schemas/models/printer_settings.js +245 -0
  248. package/esm/schemas/models/public_holidays.js +58 -0
  249. package/esm/schemas/models/reservations.js +127 -0
  250. package/esm/schemas/models/reviews.js +145 -0
  251. package/esm/schemas/models/rewards_usage.js +61 -0
  252. package/esm/schemas/models/riders.js +75 -0
  253. package/esm/schemas/models/specials.js +169 -0
  254. package/esm/schemas/models/staff_shifts.js +66 -0
  255. package/esm/schemas/models/tenant-activity-logs.js +126 -0
  256. package/esm/schemas/models/tenant_active_jobs.js +77 -0
  257. package/esm/schemas/models/tenant_calendar.js +89 -0
  258. package/esm/schemas/models/tenant_cash_drawer_sessions.js +208 -0
  259. package/esm/schemas/models/tenant_cash_drawers.js +60 -0
  260. package/esm/schemas/models/tenant_cash_in_hand_transactions.js +69 -0
  261. package/esm/schemas/models/tenant_cash_in_out.js +104 -0
  262. package/esm/schemas/models/tenant_clients.js +66 -0
  263. package/esm/schemas/models/tenant_day_sessions.js +166 -0
  264. package/esm/schemas/models/tenant_hr_attendance_records.js +87 -0
  265. package/esm/schemas/models/tenant_hr_biometric_enrollments.js +69 -0
  266. package/esm/schemas/models/tenant_hr_departments.js +42 -0
  267. package/esm/schemas/models/tenant_hr_documents.js +71 -0
  268. package/esm/schemas/models/tenant_hr_employees.js +172 -0
  269. package/esm/schemas/models/tenant_hr_leave_requests.js +80 -0
  270. package/esm/schemas/models/tenant_hr_payrolls.js +131 -0
  271. package/esm/schemas/models/tenant_hr_performance_reviews.js +58 -0
  272. package/esm/schemas/models/tenant_hr_policies.js +57 -0
  273. package/esm/schemas/models/tenant_hr_positions.js +48 -0
  274. package/esm/schemas/models/tenant_hr_shift_schedules.js +84 -0
  275. package/esm/schemas/models/tenant_hr_shifts.js +64 -0
  276. package/esm/schemas/models/tenant_instore_shift_sessions.js +204 -0
  277. package/esm/schemas/models/tenant_instore_shifts.js +63 -0
  278. package/esm/schemas/models/tenant_inventory_department_transactions.js +116 -0
  279. package/esm/schemas/models/tenant_inventory_department_utilities.js +85 -0
  280. package/esm/schemas/models/tenant_inventory_departments.js +55 -0
  281. package/esm/schemas/models/tenant_inventory_entries.js +131 -0
  282. package/esm/schemas/models/tenant_metadata.js +88 -0
  283. package/esm/schemas/models/tenant_order_item_instructions.js +66 -0
  284. package/esm/schemas/models/tenant_purchase_order_vendor_returns.js +80 -0
  285. package/esm/schemas/models/tenant_purchase_orders.js +158 -0
  286. package/esm/schemas/models/tenant_shifts.js +57 -0
  287. package/esm/schemas/models/tenant_staffs.js +129 -0
  288. package/esm/schemas/models/tenant_vendors.js +99 -0
  289. package/esm/schemas/models/tenants.js +811 -0
  290. package/esm/schemas/models/terminal_devices.js +63 -0
  291. package/esm/schemas/models/tokens.js +73 -0
  292. package/esm/schemas/models/track_order_numbers.js +42 -0
  293. package/esm/schemas/models/void_order_items.js +210 -0
  294. package/esm/schemas/models/vouchers.js +101 -0
  295. package/esm/schemas/models/wallet_transactions.js +128 -0
  296. package/esm/schemas/models/wallets.js +44 -0
  297. package/esm/schemas/models/warehouse-activity-logs.js +144 -0
  298. package/esm/schemas/models/warehouse_categories.js +83 -0
  299. package/esm/schemas/models/warehouse_clients.js +81 -0
  300. package/esm/schemas/models/warehouse_communications.js +226 -0
  301. package/esm/schemas/models/warehouse_internal_movements.js +463 -0
  302. package/esm/schemas/models/warehouse_inventory_entries.js +125 -0
  303. package/esm/schemas/models/warehouse_inventory_lot_serial_numbers.js +188 -0
  304. package/esm/schemas/models/warehouse_inventory_transactions.js +133 -0
  305. package/esm/schemas/models/warehouse_item_transactions.js +97 -0
  306. package/esm/schemas/models/warehouse_items.js +173 -0
  307. package/esm/schemas/models/warehouse_operational_roles.js +87 -0
  308. package/esm/schemas/models/warehouse_purchase_order_receipts.js +163 -0
  309. package/esm/schemas/models/warehouse_purchase_order_rfqs.js +339 -0
  310. package/esm/schemas/models/warehouse_purchase_order_vendor_returns.js +199 -0
  311. package/esm/schemas/models/warehouse_purchase_orders.js +334 -0
  312. package/esm/schemas/models/warehouse_sale_deliveries.js +155 -0
  313. package/esm/schemas/models/warehouse_sale_invoices.js +229 -0
  314. package/esm/schemas/models/warehouse_sale_order_rfqs.js +340 -0
  315. package/esm/schemas/models/warehouse_sale_orders.js +322 -0
  316. package/esm/schemas/models/warehouse_staffs.js +104 -0
  317. package/esm/schemas/models/warehouse_track_order_numbers.js +73 -0
  318. package/esm/schemas/models/warehouse_vendors.js +99 -0
  319. package/esm/schemas/models/warehouse_void_purchase_order_items.js +174 -0
  320. package/esm/schemas/models/warehouse_void_sale_order_items.js +174 -0
  321. package/esm/schemas/models/warehouses.js +253 -0
  322. package/esm/schemas/types/app_configs.js +1 -0
  323. package/esm/schemas/types/applied_order_discounts.js +1 -0
  324. package/esm/schemas/types/brands.js +1 -0
  325. package/esm/schemas/types/categories.js +1 -0
  326. package/esm/schemas/types/close_dates.js +1 -0
  327. package/esm/schemas/types/common.js +1 -0
  328. package/esm/schemas/types/courses.js +1 -0
  329. package/esm/schemas/types/customer_redemptions.js +1 -0
  330. package/esm/schemas/types/customers.js +1 -0
  331. package/esm/schemas/types/deliveries.js +1 -0
  332. package/esm/schemas/types/delivery_areas.js +1 -0
  333. package/esm/schemas/types/dinein_floors.js +1 -0
  334. package/esm/schemas/types/dinein_tables.js +1 -0
  335. package/esm/schemas/types/dinein_tables_fingerprints.js +1 -0
  336. package/esm/schemas/types/discounts.js +1 -0
  337. package/esm/schemas/types/expense_categories.js +1 -0
  338. package/esm/schemas/types/expense_details.js +1 -0
  339. package/esm/schemas/types/gift_cards.js +1 -0
  340. package/esm/schemas/types/halfhalf_setup.js +1 -0
  341. package/esm/schemas/types/index.js +113 -0
  342. package/esm/schemas/types/internal_customers.js +1 -0
  343. package/esm/schemas/types/internal_invoices.js +1 -0
  344. package/esm/schemas/types/internal_leads.js +1 -0
  345. package/esm/schemas/types/internal_operational_roles.js +16 -0
  346. package/esm/schemas/types/internal_staffs.js +1 -0
  347. package/esm/schemas/types/inventories.js +1 -0
  348. package/esm/schemas/types/inventory_categories.js +1 -0
  349. package/esm/schemas/types/inventory_department_transactions.js +1 -0
  350. package/esm/schemas/types/inventory_department_utilities.js +1 -0
  351. package/esm/schemas/types/inventory_departments.js +1 -0
  352. package/esm/schemas/types/inventory_transactions.js +1 -0
  353. package/esm/schemas/types/item_transactions.js +1 -0
  354. package/esm/schemas/types/items.js +1 -0
  355. package/esm/schemas/types/marketing_fingerprints.js +1 -0
  356. package/esm/schemas/types/menus.js +1 -0
  357. package/esm/schemas/types/messaging_devices.js +1 -0
  358. package/esm/schemas/types/modifier_extras.js +1 -0
  359. package/esm/schemas/types/multi_tenants.js +1 -0
  360. package/esm/schemas/types/offers.js +1 -0
  361. package/esm/schemas/types/offers_fingerprints.js +1 -0
  362. package/esm/schemas/types/operational_roles.js +15 -0
  363. package/esm/schemas/types/orders.js +1 -0
  364. package/esm/schemas/types/printer_settings.js +1 -0
  365. package/esm/schemas/types/public_holidays.js +1 -0
  366. package/esm/schemas/types/reservations.js +1 -0
  367. package/esm/schemas/types/reviews.js +1 -0
  368. package/esm/schemas/types/rewards_usage.js +1 -0
  369. package/esm/schemas/types/riders.js +1 -0
  370. package/esm/schemas/types/specials.js +1 -0
  371. package/esm/schemas/types/staff_shifts.js +1 -0
  372. package/esm/schemas/types/tenant-activity-logs.js +1 -0
  373. package/esm/schemas/types/tenant_active_jobs.js +1 -0
  374. package/esm/schemas/types/tenant_calendar.js +1 -0
  375. package/esm/schemas/types/tenant_cash_drawer_sessions.js +1 -0
  376. package/esm/schemas/types/tenant_cash_drawers.js +1 -0
  377. package/esm/schemas/types/tenant_cash_in_hand_transactions.js +1 -0
  378. package/esm/schemas/types/tenant_cash_in_out.js +1 -0
  379. package/esm/schemas/types/tenant_clients.js +1 -0
  380. package/esm/schemas/types/tenant_day_sessions.js +1 -0
  381. package/esm/schemas/types/tenant_hr_attendance_records.js +1 -0
  382. package/esm/schemas/types/tenant_hr_biometric_enrollments.js +1 -0
  383. package/esm/schemas/types/tenant_hr_departments.js +1 -0
  384. package/esm/schemas/types/tenant_hr_documents.js +1 -0
  385. package/esm/schemas/types/tenant_hr_employees.js +1 -0
  386. package/esm/schemas/types/tenant_hr_leave_requests.js +1 -0
  387. package/esm/schemas/types/tenant_hr_payrolls.js +1 -0
  388. package/esm/schemas/types/tenant_hr_performance_reviews.js +1 -0
  389. package/esm/schemas/types/tenant_hr_policies.js +1 -0
  390. package/esm/schemas/types/tenant_hr_positions.js +1 -0
  391. package/esm/schemas/types/tenant_hr_shift_schedules.js +1 -0
  392. package/esm/schemas/types/tenant_hr_shifts.js +1 -0
  393. package/esm/schemas/types/tenant_instore_shift_sessions.js +1 -0
  394. package/esm/schemas/types/tenant_instore_shifts.js +1 -0
  395. package/esm/schemas/types/tenant_inventory_entries.js +1 -0
  396. package/esm/schemas/types/tenant_metadata.js +1 -0
  397. package/esm/schemas/types/tenant_order_item_instructions.js +1 -0
  398. package/esm/schemas/types/tenant_purchase_order_vendor_returns.js +1 -0
  399. package/esm/schemas/types/tenant_purchase_orders.js +1 -0
  400. package/esm/schemas/types/tenant_shifts.js +1 -0
  401. package/esm/schemas/types/tenant_staffs.js +1 -0
  402. package/esm/schemas/types/tenant_vendors.js +1 -0
  403. package/esm/schemas/types/tenants.js +1 -0
  404. package/esm/schemas/types/terminal_devices.js +1 -0
  405. package/esm/schemas/types/tokens.js +1 -0
  406. package/esm/schemas/types/track_order_numbers.js +1 -0
  407. package/esm/schemas/types/void_order_items.js +1 -0
  408. package/esm/schemas/types/vouchers.js +1 -0
  409. package/esm/schemas/types/wallet_transactions.js +1 -0
  410. package/esm/schemas/types/wallets.js +1 -0
  411. package/esm/schemas/types/warehouse-activity-logs.js +1 -0
  412. package/esm/schemas/types/warehouse_categories.js +1 -0
  413. package/esm/schemas/types/warehouse_clients.js +1 -0
  414. package/esm/schemas/types/warehouse_communications.js +1 -0
  415. package/esm/schemas/types/warehouse_internal_movements.js +1 -0
  416. package/esm/schemas/types/warehouse_inventory_entries.js +1 -0
  417. package/esm/schemas/types/warehouse_inventory_lot_serial_numbers.js +1 -0
  418. package/esm/schemas/types/warehouse_inventory_transactions.js +1 -0
  419. package/esm/schemas/types/warehouse_item_transactions.js +1 -0
  420. package/esm/schemas/types/warehouse_items.js +1 -0
  421. package/esm/schemas/types/warehouse_operational_roles.js +15 -0
  422. package/esm/schemas/types/warehouse_purchase_order_receipts.js +18 -0
  423. package/esm/schemas/types/warehouse_purchase_order_rfqs.js +1 -0
  424. package/esm/schemas/types/warehouse_purchase_order_vendor_returns.js +1 -0
  425. package/esm/schemas/types/warehouse_purchase_orders.js +1 -0
  426. package/esm/schemas/types/warehouse_sale_deliveries.js +1 -0
  427. package/esm/schemas/types/warehouse_sale_invoices.js +1 -0
  428. package/esm/schemas/types/warehouse_sale_order_rfqs.js +1 -0
  429. package/esm/schemas/types/warehouse_sale_orders.js +1 -0
  430. package/esm/schemas/types/warehouse_staffs.js +1 -0
  431. package/esm/schemas/types/warehouse_track_order_numbers.js +1 -0
  432. package/esm/schemas/types/warehouse_vendors.js +1 -0
  433. package/esm/schemas/types/warehouse_void_purchase_order_items.js +1 -0
  434. package/esm/schemas/types/warehouse_void_sale_order_items.js +1 -0
  435. package/esm/schemas/types/warehouses.js +1 -0
  436. package/package.json +6 -3
@@ -0,0 +1,877 @@
1
+ import moment from 'moment';
2
+ import { PAYMENT_TYPE_ENUM, PLATFORM_NAMES, SALES_SUMMARY_ENUM, } from '../../constants';
3
+ import { getGSTName, localeAmount, sentenceCase } from './common';
4
+ import { convertPriceFromCents } from './price-conversion';
5
+ const getHead = (monochrome) => {
6
+ const palette = monochrome
7
+ ? {
8
+ headingBackground: '#FFFFFF',
9
+ headingText: '#000000',
10
+ text: '#000000',
11
+ textGreen: '#000000',
12
+ greyBorder: '#000000',
13
+ bottomGreyBorder: 'rgb(200, 200, 200)',
14
+ lighGreyBgColor: 'rgb(232, 232, 232)',
15
+ whiteBackground: 'rgb(255, 255, 255)',
16
+ boxShadow: '#000000',
17
+ }
18
+ : {
19
+ headingBackground: '#431665',
20
+ headingText: '#ffffff',
21
+ text: 'rgb(51, 51, 51)',
22
+ textGreen: 'rgb(0, 128, 0)',
23
+ greyBorder: 'rgb(220, 220, 220)',
24
+ bottomGreyBorder: 'rgb(250, 250, 250)',
25
+ lighGreyBgColor: 'rgb(232, 232, 232)',
26
+ whiteBackground: 'rgb(255, 255, 255)',
27
+ boxShadow: 'rgba(99, 99, 99, 0.2)',
28
+ };
29
+ const fontLink = monochrome
30
+ ? `<link
31
+ rel="stylesheet"
32
+ href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;500;700&display=swap"
33
+ crossorigin="anonymous"
34
+ />`
35
+ : `<link
36
+ rel="stylesheet"
37
+ href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&amp;display=swap"
38
+ crossorigin="anonymous"
39
+ />`;
40
+ return `<head>
41
+ <meta charset="UTF-8" />
42
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
43
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
44
+ ${fontLink}
45
+ <style>
46
+ .cssc-1qeq10-kjlask {
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-items: center;
50
+ justify-content: center;
51
+ gap: 4px;
52
+ margin-top: 8px;
53
+ margin-bottom: 8px;
54
+ }
55
+
56
+ .cssc-1gb95rg-oilkj {
57
+ -webkit-font-smoothing: antialiased;
58
+ -webkit-text-size-adjust: 100%;
59
+ -webkit-tap-highlight-color: transparent;
60
+ color: ${palette.headingText};
61
+ box-sizing: inherit;
62
+ margin: 0;
63
+ font-weight: 500;
64
+ line-height: 1.3rem;
65
+ font-size: 1.25rem;
66
+ font-family: Roboto, Public Sans, sans-serif;
67
+ text-align: center;
68
+ flex: 1;
69
+ }
70
+
71
+ .cssc-1iy4zoj-oilkj {
72
+ -webkit-font-smoothing: antialiased;
73
+ -webkit-text-size-adjust: 100%;
74
+ color: ${palette.text};
75
+ box-sizing: inherit;
76
+ margin: 0;
77
+ line-height: 1.15rem;
78
+ font-size: 1rem;
79
+ font-family: Roboto, Public Sans, sans-serif;
80
+ font-weight: 400;
81
+ }
82
+ .cssc-1ebo3of-oilkj {
83
+ -webkit-font-smoothing: antialiased;
84
+ -webkit-text-size-adjust: 100%;
85
+
86
+ border-collapse: collapse;
87
+ border-spacing: 0;
88
+ text-align: left;
89
+ color: ${palette.text};
90
+ box-sizing: inherit;
91
+ margin: 0;
92
+ line-height: 1.1375rem;
93
+ font-size: 0.875rem;
94
+ font-family: Roboto, Public Sans, sans-serif;
95
+ font-weight: 400;
96
+ }
97
+ .css-yuo5dk1 {
98
+ -webkit-font-smoothing: antialiased;
99
+ text-size-adjust: 100%;
100
+ color: ${palette.text};
101
+ line-height: 1.15rem;
102
+ font-size: 1rem;
103
+ font-family: Roboto, "Public Sans", sans-serif;
104
+ font-weight: 400;
105
+ box-sizing: inherit;
106
+ display: flex;
107
+ flex-direction: column;
108
+ flex: 1 1 0%;
109
+ background-color: ${palette.whiteBackground};
110
+ border: 1px solid ${palette.boxShadow};
111
+ }
112
+
113
+ .css-l5xv051 {
114
+ -webkit-font-smoothing: antialiased;
115
+ text-size-adjust: 100%;
116
+ color: ${palette.text};
117
+ line-height: 1.15rem;
118
+ font-size: 1rem;
119
+ font-family: Roboto, "Public Sans", sans-serif;
120
+ font-weight: 400;
121
+ box-sizing: inherit;
122
+ position: relative;
123
+ margin: 0px;
124
+ }
125
+
126
+ .css-10ejif01 {
127
+ -webkit-font-smoothing: antialiased;
128
+ text-size-adjust: 100%;
129
+ color: ${palette.text};
130
+ background-color: red;
131
+ line-height: 1.15rem;
132
+ font-size: 1rem;
133
+ font-family: Roboto, "Public Sans", sans-serif;
134
+ font-weight: 400;
135
+ box-sizing: inherit;
136
+ margin: 0px;
137
+ flex-shrink: 0;
138
+ border-width: 0px 0px thin;
139
+ border-style: solid;
140
+ border-color: ${palette.greyBorder};
141
+ }
142
+
143
+ .css-k060yy11 {
144
+ -webkit-font-smoothing: antialiased;
145
+ text-size-adjust: 100%;
146
+ line-height: 1.15rem;
147
+ font-size: 1rem;
148
+ font-family: Roboto, "Public Sans", sans-serif;
149
+ font-weight: 400;
150
+ box-sizing: inherit;
151
+ padding: 10px;
152
+ position: sticky;
153
+ top: 0px;
154
+ background-color: ${palette.headingBackground};
155
+ color: ${palette.text};
156
+ z-index: 1;
157
+ }
158
+
159
+ .css-1fnlilj11 {
160
+ -webkit-font-smoothing: antialiased;
161
+ text-size-adjust: 100%;
162
+ color: ${palette.headingText};
163
+ box-sizing: inherit;
164
+ margin: 0px;
165
+ font-weight: 500;
166
+ line-height: 1.4625rem;
167
+ font-family: Roboto, "Public Sans", sans-serif;
168
+ font-size: 1.3125rem;
169
+ }
170
+
171
+ .css-1w3huuy11 {
172
+ -webkit-font-smoothing: antialiased;
173
+ text-size-adjust: 100%;
174
+ color: ${palette.headingText};
175
+ box-sizing: inherit;
176
+ margin: 0px;
177
+ line-height: 0.975rem;
178
+ font-size: 0.75rem;
179
+ font-family: Roboto, "Public Sans", sans-serif;
180
+ font-weight: 400;
181
+ }
182
+
183
+ .css-u6h4lt11 {
184
+ -webkit-font-smoothing: antialiased;
185
+ text-size-adjust: 100%;
186
+ color: ${palette.text};
187
+ line-height: 1.15rem;
188
+ font-size: 1rem;
189
+ font-family: Roboto, "Public Sans", sans-serif;
190
+ font-weight: 400;
191
+ box-sizing: inherit;
192
+ display: table;
193
+ width: 100%;
194
+ border-collapse: collapse;
195
+ border-spacing: 0px;
196
+ }
197
+
198
+ .css-s4zxv011 {
199
+ -webkit-font-smoothing: antialiased;
200
+ text-size-adjust: 100%;
201
+ color: ${palette.text};
202
+ line-height: 1.15rem;
203
+ font-size: 1rem;
204
+ font-family: Roboto, "Public Sans", sans-serif;
205
+ font-weight: 400;
206
+ border-collapse: collapse;
207
+ border-spacing: 0px;
208
+ box-sizing: inherit;
209
+ display: table-header-group;
210
+ }
211
+
212
+ .css-1gleevd11 {
213
+ -webkit-font-smoothing: antialiased;
214
+ text-size-adjust: 100%;
215
+ line-height: 1.15rem;
216
+ font-size: 1rem;
217
+ font-family: Roboto, "Public Sans", sans-serif;
218
+ font-weight: 400;
219
+ border-collapse: collapse;
220
+ border-spacing: 0px;
221
+ box-sizing: inherit;
222
+ color: inherit;
223
+ display: table-row;
224
+ vertical-align: middle;
225
+ outline: 0px;
226
+ }
227
+
228
+ .css-6f0tvb11 {
229
+ -webkit-font-smoothing: antialiased;
230
+ text-size-adjust: 100%;
231
+ border-collapse: collapse;
232
+ border-spacing: 0px;
233
+ box-sizing: inherit;
234
+ font-size: 0.875rem;
235
+ font-family: Roboto, "Public Sans", sans-serif;
236
+ display: table-cell;
237
+ vertical-align: inherit;
238
+ border-bottom: 1px solid ${palette.bottomGreyBorder};
239
+ text-align: left;
240
+ padding: 10px;
241
+ line-height: 1.25rem;
242
+ font-weight: 500;
243
+ background-color: ${palette.lighGreyBgColor};
244
+ color: ${palette.text};
245
+ }
246
+
247
+ .css-ed1d6w11 {
248
+ -webkit-font-smoothing: antialiased;
249
+ text-size-adjust: 100%;
250
+ border-collapse: collapse;
251
+ border-spacing: 0px;
252
+ box-sizing: inherit;
253
+ font-size: 0.875rem;
254
+ font-family: Roboto, "Public Sans", sans-serif;
255
+ display: table-cell;
256
+ vertical-align: inherit;
257
+ border-bottom: 1px solid ${palette.bottomGreyBorder};
258
+ padding: 10px;
259
+ line-height: 1.25rem;
260
+ font-weight: 500;
261
+ text-align: right;
262
+ flex-direction: row-reverse;
263
+ background-color: ${palette.lighGreyBgColor};
264
+ color: ${palette.text};
265
+ }
266
+
267
+ .css-y6j1my11 {
268
+ -webkit-font-smoothing: antialiased;
269
+ text-size-adjust: 100%;
270
+ color: ${palette.text};
271
+ line-height: 1.15rem;
272
+ font-size: 1rem;
273
+ font-family: Roboto, "Public Sans", sans-serif;
274
+ font-weight: 400;
275
+ border-collapse: collapse;
276
+ border-spacing: 0px;
277
+ box-sizing: inherit;
278
+ display: table-row-group;
279
+ }
280
+
281
+ .css-11i3qbx11 {
282
+ -webkit-font-smoothing: antialiased;
283
+ text-size-adjust: 100%;
284
+ line-height: 1.15rem;
285
+ font-size: 1rem;
286
+ font-family: Roboto, "Public Sans", sans-serif;
287
+ font-weight: 400;
288
+ border-collapse: collapse;
289
+ border-spacing: 0px;
290
+ box-sizing: inherit;
291
+ color: inherit;
292
+ display: table-row;
293
+ vertical-align: middle;
294
+ outline: 0px;
295
+ }
296
+
297
+ .css-6gjlp411 {
298
+ -webkit-font-smoothing: antialiased;
299
+ text-size-adjust: 100%;
300
+ border-collapse: collapse;
301
+ border-spacing: 0px;
302
+ box-sizing: inherit;
303
+ line-height: 1.15rem;
304
+ font-size: 0.875rem;
305
+ font-family: Roboto, "Public Sans", sans-serif;
306
+ font-weight: 400;
307
+ display: table-cell;
308
+ vertical-align: inherit;
309
+ border-bottom: 1px solid ${palette.bottomGreyBorder};
310
+ text-align: left;
311
+ padding: 10px;
312
+ color: ${palette.text};
313
+ }
314
+
315
+ .css-1frso49112 {
316
+ -webkit-font-smoothing: antialiased;
317
+ text-size-adjust: 100%;
318
+ border-collapse: collapse;
319
+ border-spacing: 0px;
320
+ text-align: left;
321
+ box-sizing: inherit;
322
+ margin: 0px;
323
+ line-height: 1.15rem;
324
+ font-size: 0.875rem;
325
+ font-family: Roboto, "Public Sans", sans-serif;
326
+ font-weight: 400;
327
+ color: ${palette.textGreen};
328
+ }
329
+
330
+ .css-1itf2nw11 {
331
+ -webkit-font-smoothing: antialiased;
332
+ text-size-adjust: 100%;
333
+ border-collapse: collapse;
334
+ border-spacing: 0px;
335
+ box-sizing: inherit;
336
+ line-height: 1.15rem;
337
+ font-size: 0.875rem;
338
+ font-family: Roboto, "Public Sans", sans-serif;
339
+ font-weight: 400;
340
+ display: table-cell;
341
+ vertical-align: inherit;
342
+ border-bottom: 1px solid ${palette.bottomGreyBorder};
343
+ padding: 10px;
344
+ color: ${palette.text};
345
+ text-align: right;
346
+ flex-direction: row-reverse;
347
+ }
348
+
349
+ .css-l5zp2s212 {
350
+ -webkit-font-smoothing: antialiased;
351
+ text-size-adjust: 100%;
352
+ border-collapse: collapse;
353
+ border-spacing: 0px;
354
+ color: ${palette.text};
355
+ text-align: right;
356
+ box-sizing: inherit;
357
+ margin: 0px;
358
+ line-height: 1.15rem;
359
+ font-size: 0.875rem;
360
+ font-family: Roboto, "Public Sans", sans-serif;
361
+ font-weight: 700;
362
+ }
363
+
364
+ .css-v3960x21 {
365
+ -webkit-font-smoothing: antialiased;
366
+ text-size-adjust: 100%;
367
+ border-collapse: collapse;
368
+ border-spacing: 0px;
369
+ color: ${palette.text};
370
+ text-align: right;
371
+ box-sizing: inherit;
372
+ margin: 0px;
373
+ line-height: 1.1375rem;
374
+ font-size: 0.875rem;
375
+ font-family: Roboto, "Public Sans", sans-serif;
376
+ font-weight: 400;
377
+ text-decoration: underline;
378
+ }
379
+
380
+ .css-1qzwazd {
381
+ -webkit-font-smoothing: antialiased;
382
+ text-size-adjust: 100%;
383
+ box-sizing: inherit;
384
+ margin: 0px;
385
+ line-height: 1.15rem;
386
+ font-size: 0.875rem;
387
+ font-family: Roboto, "Public Sans", sans-serif;
388
+ font-weight: 400;
389
+ color: ${palette.text};
390
+ }
391
+
392
+ ${monochrome
393
+ ? `
394
+ /* Receipt Printer Optimized Styles - Monochrome */
395
+
396
+ .cssc-1qeq10-kjlask {
397
+ gap: 1px !important;
398
+ margin-top: 2px !important;
399
+ margin-bottom: 2px !important;
400
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
401
+ }
402
+
403
+ .cssc-1gb95rg-oilkj {
404
+ font-size: 24px !important;
405
+ line-height: 26px !important;
406
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
407
+ }
408
+
409
+ .cssc-1iy4zoj-oilkj {
410
+ font-size: 16px !important;
411
+ line-height: 18px !important;
412
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
413
+ }
414
+
415
+ .cssc-1ebo3of-oilkj {
416
+ font-size: 16px !important;
417
+ line-height: 18px !important;
418
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
419
+ }
420
+
421
+ .css-1owvoyj-asbq {
422
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
423
+ }
424
+
425
+ .css-paper21 {
426
+ padding: 2px !important;
427
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
428
+ }
429
+
430
+ .css-p0ysa1 {
431
+ font-size: 22px !important;
432
+ line-height: 24px !important;
433
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
434
+ }
435
+
436
+ .css-1owvoyjnp {
437
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
438
+ }
439
+
440
+ .css-1xflghj21 {
441
+ padding: 2px !important;
442
+ margin: 0px 2px !important;
443
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
444
+ }
445
+
446
+ .css-170whi821 {
447
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
448
+ }
449
+
450
+ .css-1dq67yy2 {
451
+ font-size: 16px !important;
452
+ line-height: 18px !important;
453
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
454
+ }
455
+
456
+ .css-1n56s23 {
457
+ padding: 2px 4px !important;
458
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
459
+ }
460
+
461
+ .css-1n56s232 {
462
+ padding: 2px 4px !important;
463
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
464
+ }
465
+
466
+ .css-1dq67yy21 {
467
+ padding: 2px 4px !important;
468
+ font-size: 17px !important;
469
+ line-height: 19px !important;
470
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
471
+ }
472
+
473
+ .css-1n56s2321 {
474
+ padding: 2px 4px !important;
475
+ font-size: 17px !important;
476
+ line-height: 19px !important;
477
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
478
+ }
479
+
480
+ .css-l5zp2s212 {
481
+ font-size: 17px !important;
482
+ line-height: 19px !important;
483
+ margin: 0px !important;
484
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
485
+ }
486
+
487
+ .css-v3960x21 {
488
+ font-size: 17px !important;
489
+ line-height: 19px !important;
490
+ margin: 0px !important;
491
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
492
+ }
493
+
494
+ /* Sales Summary Specific - Larger Fonts for Receipt */
495
+ .css-yuo5dk1 {
496
+ font-size: 15px !important;
497
+ line-height: 18px !important;
498
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
499
+ }
500
+
501
+ .css-l5xv051 {
502
+ font-size: 15px !important;
503
+ line-height: 18px !important;
504
+ margin-bottom: 2px !important;
505
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
506
+ }
507
+
508
+ .css-10ejif01 {
509
+ margin: 2px 0px !important;
510
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
511
+ }
512
+
513
+ .css-k060yy11 {
514
+ padding: 2px !important;
515
+ font-size: 15px !important;
516
+ line-height: 18px !important;
517
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
518
+ }
519
+
520
+ .css-1fnlilj11 {
521
+ font-size: 18px !important;
522
+ line-height: 20px !important;
523
+ margin: 0px !important;
524
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
525
+ }
526
+
527
+ .css-1w3huuy11 {
528
+ font-size: 14px !important;
529
+ line-height: 16px !important;
530
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
531
+ }
532
+
533
+ .css-u6h4lt11 {
534
+ font-size: 17px !important;
535
+ line-height: 19px !important;
536
+ border-collapse: collapse !important;
537
+ border-spacing: 0px !important;
538
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
539
+ }
540
+
541
+ .css-s4zxv011 {
542
+ font-size: 17px !important;
543
+ line-height: 19px !important;
544
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
545
+ }
546
+
547
+ .css-1gleevd11 {
548
+ font-size: 17px !important;
549
+ line-height: 19px !important;
550
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
551
+ }
552
+
553
+ .css-6f0tvb11 {
554
+ padding: 2px !important;
555
+ font-size: 17px !important;
556
+ line-height: 19px !important;
557
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
558
+ }
559
+
560
+ .css-ed1d6w11 {
561
+ padding: 2px !important;
562
+ font-size: 17px !important;
563
+ line-height: 19px !important;
564
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
565
+ }
566
+
567
+ .css-y6j1my11 {
568
+ font-size: 17px !important;
569
+ line-height: 19px !important;
570
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
571
+ }
572
+
573
+ .css-11i3qbx11 {
574
+ font-size: 17px !important;
575
+ line-height: 19px !important;
576
+ padding: 0px !important;
577
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
578
+ }
579
+
580
+ .css-6gjlp411 {
581
+ padding: 2px !important;
582
+ font-size: 17px !important;
583
+ line-height: 19px !important;
584
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
585
+ }
586
+
587
+ .css-1frso49112 {
588
+ font-size: 17px !important;
589
+ line-height: 19px !important;
590
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
591
+ }
592
+
593
+ .css-1itf2nw11 {
594
+ padding: 2px !important;
595
+ font-size: 17px !important;
596
+ line-height: 19px !important;
597
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
598
+ }
599
+
600
+ .css-1qzwazd {
601
+ font-size: 17px !important;
602
+ line-height: 19px !important;
603
+ margin: 0px !important;
604
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
605
+ }
606
+
607
+ .css-l5zp2s212 {
608
+ font-size: 17px !important;
609
+ line-height: 19px !important;
610
+ margin: 0px !important;
611
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
612
+ }
613
+
614
+ .css-v3960x21 {
615
+ font-size: 17px !important;
616
+ line-height: 19px !important;
617
+ margin: 0px !important;
618
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
619
+ }
620
+ `
621
+ : ''}
622
+ </style>
623
+
624
+ <title>Summary Report</title>
625
+ </head>`;
626
+ };
627
+ function getBody({ from, to, data, country_alpha_2, tax_invoice_provider, currencySymbol, tenantName, isFilterApplied, monochrome, }) {
628
+ // Constants
629
+ const TAX_WHITELIST = [SALES_SUMMARY_ENUM.TAX_AMOUNT, SALES_SUMMARY_ENUM.GST];
630
+ const WHITELIST = [
631
+ SALES_SUMMARY_ENUM.TOTAL_SALES,
632
+ SALES_SUMMARY_ENUM.CANCELLED_ORDERS,
633
+ SALES_SUMMARY_ENUM.SURCHARGE,
634
+ SALES_SUMMARY_ENUM.TIP,
635
+ SALES_SUMMARY_ENUM.SERVICE_CHARGE,
636
+ SALES_SUMMARY_ENUM.TOTAL_DISCOUNT,
637
+ ];
638
+ // Helper functions
639
+ const formatAmount = (amount) => localeAmount(currencySymbol, convertPriceFromCents(amount));
640
+ const formatDateRange = () => `${moment(from).format('llll')} - ${moment(to).format('llll')}`;
641
+ const formatKeyToTitle = (key) => sentenceCase(key.replace(/_/g, ' '));
642
+ // Calculate totals
643
+ const paymentSales = data[SALES_SUMMARY_ENUM.TOTAL_PAYMENT_SALES] || [];
644
+ const totalComplimentaryAmount = paymentSales.reduce((total, obj) => (obj._id === PAYMENT_TYPE_ENUM.COMPLIMENTARY ? total + obj.grossAmount : total), 0);
645
+ const { totalUnpaidAmount, totalUnpaidOrders } = paymentSales.reduce((total, obj) => {
646
+ if (obj._id === PAYMENT_TYPE_ENUM.UNPAID) {
647
+ total.totalUnpaidAmount += obj.grossAmount;
648
+ total.totalUnpaidOrders += obj.count;
649
+ }
650
+ return total;
651
+ }, { totalUnpaidAmount: 0, totalUnpaidOrders: 0 });
652
+ // Generate table rows helper
653
+ const generateTableRows = (dataArray, rowGenerator) => {
654
+ if (!dataArray)
655
+ return '';
656
+ return dataArray.map(rowGenerator).join('');
657
+ };
658
+ // Sales Summary Table
659
+ let salesSummaryRowsHTML = '';
660
+ Object.entries(data).forEach(([key, objArr]) => {
661
+ if (!WHITELIST.includes(key))
662
+ return;
663
+ (Array.isArray(objArr) ? objArr : [objArr]).forEach((obj) => {
664
+ const amount = (obj.grossAmount ?? 0) - (key === SALES_SUMMARY_ENUM.TOTAL_SALES ? totalComplimentaryAmount : 0);
665
+ const formattedAmount = formatAmount(amount);
666
+ const isSuccess = key === SALES_SUMMARY_ENUM.TOTAL_SALES && obj.count > 0;
667
+ const isError = key === SALES_SUMMARY_ENUM.CANCELLED_ORDERS && obj.count > 0;
668
+ const isWarning = key === SALES_SUMMARY_ENUM.TOTAL_DISCOUNT && obj.count > 0;
669
+ const colorClass = monochrome
670
+ ? '#000000'
671
+ : isSuccess
672
+ ? '#2e7d32'
673
+ : isError
674
+ ? '#d32f2f'
675
+ : isWarning
676
+ ? '#ed6c02'
677
+ : 'inherit';
678
+ const textDecoration = obj.strikeThrough ? 'line-through' : 'underline';
679
+ salesSummaryRowsHTML += `
680
+ <tr class="css-11i3qbx11">
681
+ <td class="css-6gjlp411">
682
+ <p class="css-1frso49112" style='color: ${colorClass}'>${formatKeyToTitle(key)}</p>
683
+ </td>
684
+ <td class="css-1itf2nw11">
685
+ <p class="css-l5zp2s212">${obj.count}</p>
686
+ </td>
687
+ <td class="css-1itf2nw11">
688
+ <p class="css-v3960x21" style="text-decoration: ${textDecoration}">${formattedAmount}</p>
689
+ </td>
690
+ </tr>
691
+ `;
692
+ if (isSuccess) {
693
+ const collected = amount - totalUnpaidAmount;
694
+ const match = collected === amount;
695
+ salesSummaryRowsHTML += `
696
+ <tr class="css-11i3qbx11">
697
+ <td class="css-6gjlp411">
698
+ <p class="css-1frso49112" style='color: ${monochrome ? '#000000' : match ? '#2e7d32' : '#ed6c02'}'>Amount Collected</p>
699
+ </td>
700
+ <td class="css-1itf2nw11">
701
+ <p class="css-l5zp2s212">${obj.count - totalUnpaidOrders}</p>
702
+ </td>
703
+ <td class="css-1itf2nw11">
704
+ <p class="css-v3960x21" style="text-decoration: ${collected ? 'underline' : 'line-through'}">
705
+ ${formatAmount(collected)}
706
+ </p>
707
+ </td>
708
+ </tr>
709
+ `;
710
+ }
711
+ });
712
+ });
713
+ // Payments Received Table
714
+ const paymentsReceivedRowsHTML = generateTableRows(paymentSales, (row) => {
715
+ const isError = row._id === PAYMENT_TYPE_ENUM.UNPAID;
716
+ const isWarning = row._id === PAYMENT_TYPE_ENUM.COMPLIMENTARY;
717
+ const colorClass = monochrome ? '#000000' : isError ? '#d32f2f' : isWarning ? '#ed6c02' : 'inherit';
718
+ const textDecoration = isWarning ? 'line-through' : 'none';
719
+ return `
720
+ <tr class="css-11i3qbx11">
721
+ <td class="css-6gjlp411">
722
+ <p class="css-1qzwazd" style="color: ${colorClass}">
723
+ ${formatKeyToTitle(row._id)}
724
+ </p>
725
+ </td>
726
+ <td class="css-1itf2nw11">
727
+ <p class="css-l5zp2s212">${row.count}</p>
728
+ </td>
729
+ <td class="css-1itf2nw11">
730
+ <p class="css-v3960x21" style="text-decoration: ${textDecoration}">
731
+ ${formatAmount(row.grossAmount ?? 0)}
732
+ </p>
733
+ </td>
734
+ </tr>
735
+ `;
736
+ });
737
+ // Tax Summary Table
738
+ const gstName = getGSTName(country_alpha_2, tax_invoice_provider);
739
+ let taxSummaryRowsHTML = '';
740
+ TAX_WHITELIST.forEach((key) => {
741
+ const entries = data[key] || [];
742
+ entries.forEach((entry) => {
743
+ const title = key === SALES_SUMMARY_ENUM.GST ? gstName : formatKeyToTitle(key).toUpperCase();
744
+ taxSummaryRowsHTML += `
745
+ <tr class="css-11i3qbx11">
746
+ <td class="css-6gjlp411"><p class="css-1qzwazd">${title}</p></td>
747
+ <td class="css-1itf2nw11"><p class="css-l5zp2s212">${entry.count}</p></td>
748
+ <td class="css-1itf2nw11">
749
+ <p class="css-v3960x21">${formatAmount(entry.grossAmount ?? 0)}</p>
750
+ </td>
751
+ </tr>
752
+ `;
753
+ });
754
+ });
755
+ // Staff Performance Table
756
+ const staffPerformanceRowsHTML = generateTableRows(data?.[SALES_SUMMARY_ENUM.STAFF_PERFORMANCE] || [], (row) => `
757
+ <tr class="css-11i3qbx11">
758
+ <td class="css-6gjlp411">
759
+ <p class="css-1qzwazd">${formatKeyToTitle(row.name ?? row._id)}</p>
760
+ </td>
761
+ <td class="css-1itf2nw11">
762
+ <p class="css-l5zp2s212">${row.count}</p>
763
+ </td>
764
+ <td class="css-1itf2nw11">
765
+ <p class="css-v3960x21">${formatAmount(row.grossAmount ?? 0)}</p>
766
+ </td>
767
+ </tr>
768
+ `);
769
+ // Sales by Platform Table
770
+ const salesByPlatformRowsHTML = generateTableRows(data?.[SALES_SUMMARY_ENUM.SALES_BY_PLATFORM] || [], (row) => {
771
+ const label = PLATFORM_NAMES[row._id] ?? row._id;
772
+ return `
773
+ <tr class="css-11i3qbx11">
774
+ <td class="css-6gjlp411">
775
+ <p class="css-1qzwazd">${label}</p>
776
+ </td>
777
+ <td class="css-1itf2nw11">
778
+ <p class="css-l5zp2s212">${row.count}</p>
779
+ </td>
780
+ <td class="css-1itf2nw11">
781
+ <p class="css-v3960x21">${formatAmount(row.grossAmount ?? 0)}</p>
782
+ </td>
783
+ </tr>
784
+ `;
785
+ });
786
+ // Table template generator
787
+ const generateTableSection = (title, description, rowsHTML, headers) => `
788
+ <div class="css-l5xv051">
789
+ <hr class="css-10ejif01">
790
+ <div class="css-k060yy11">
791
+ <h5 class="css-1fnlilj11">${title}</h5>
792
+ <span class="css-1w3huuy11">${description}</span>
793
+ </div>
794
+ <table class="css-u6h4lt11" aria-label="customized table">
795
+ <thead class="css-s4zxv011">
796
+ <tr class="css-1gleevd11">
797
+ ${headers
798
+ .map((header, index) => `<th class="${index === 0 ? 'css-6f0tvb11' : 'css-ed1d6w11'}" scope="col">${header}</th>`)
799
+ .join('')}
800
+
801
+ </tr>
802
+ </thead>
803
+ <tbody class="css-y6j1my11">
804
+ ${rowsHTML}
805
+ </tbody>
806
+ </table>
807
+ </div>
808
+ `;
809
+ return `
810
+ <div class="css-yuo5dk1">
811
+ <div class="cssc-1qeq10-kjlask">
812
+ <h5 class="cssc-1gb95rg-oilkj" style="color: #000000">Summary Report</h5>
813
+ <p class="cssc-1iy4zoj-oilkj">${moment(from).format('dddd MMM DD, YYYY')}</p>
814
+ <p class="cssc-1ebo3of-oilkj">${moment(from).format('hh:mm a, MMM DD')} - ${moment(to).format('hh:mm a, MMM DD')}</p>
815
+ </div>
816
+ ${generateTableSection('Sales Summary', formatDateRange(), salesSummaryRowsHTML, ['Details', 'Orders', 'Revenue'])}
817
+
818
+
819
+ ${generateTableSection('Payments Received', formatDateRange(), paymentsReceivedRowsHTML, [
820
+ 'Details',
821
+ 'Payments',
822
+ 'Revenue',
823
+ ])}
824
+
825
+ ${generateTableSection('Tax Summary', formatDateRange(), taxSummaryRowsHTML, ['Details', 'Orders', 'Amount'])}
826
+
827
+ ${generateTableSection('Staff Performance', formatDateRange(), staffPerformanceRowsHTML, [
828
+ 'Details',
829
+ 'Orders',
830
+ 'Revenue',
831
+ ])}
832
+
833
+ ${generateTableSection('Sales By Platform', formatDateRange(), salesByPlatformRowsHTML, [
834
+ 'Platform',
835
+ 'Orders',
836
+ 'Revenue',
837
+ ])}
838
+
839
+ <div class="cssc-1qeq10-kjlask" style="margin-top: 20px;">
840
+ <h5 class="cssc-1gb95rg-oilkj" style="color: #000000">${tenantName}</h5>
841
+ <p class="cssc-1iy4zoj-oilkj">
842
+ Exported on ${moment().format('dddd MMM DD, YYYY [at] hh:mm a')}
843
+ </p>
844
+ ${isFilterApplied
845
+ ? `<p class="cssc-1iy4zoj-oilkj"
846
+ style="text-align: center; font-weight: bold; color: ${monochrome ? '#000000' : '#FF0000'}"
847
+ >
848
+ Note: This report is filtered. Please ensure to tally the data on your end.
849
+ </p>`
850
+ : ''}
851
+ </div>
852
+ </div>
853
+ `;
854
+ }
855
+ export function getSummaryReportHTMl({ from, to, width, monochrome, data, country_alpha_2, tax_invoice_provider, currencySymbol, tenantName, isFilterApplied, }) {
856
+ const style = width ? `style=width: ${width}px; max-width: ${width}px` : '';
857
+ const html = `
858
+ <html lang="en" ${style}>
859
+ ${getHead(monochrome)}
860
+ <body translate="no"
861
+ ${style}
862
+ >
863
+ ${getBody({
864
+ from,
865
+ to,
866
+ data,
867
+ country_alpha_2,
868
+ tax_invoice_provider,
869
+ currencySymbol,
870
+ tenantName,
871
+ isFilterApplied,
872
+ monochrome,
873
+ })}
874
+ </body>
875
+ </html>`;
876
+ return html;
877
+ }