@managesome/eposmatic-toolkit 0.2.430 → 0.2.432

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 (173) hide show
  1. package/lib/constants/ENUMS.d.ts +3 -285
  2. package/lib/constants/ENUMS.js +7 -387
  3. package/lib/constants/PURCHASE_ORDER.d.ts +5 -3
  4. package/lib/constants/PURCHASE_ORDER.js +58 -20
  5. package/lib/constants/WAREHOUSE_ANALYTICS.d.ts +41 -41
  6. package/lib/constants/WAREHOUSE_ANALYTICS.js +28 -28
  7. package/lib/constants/WAREHOUSE_ENUMS.d.ts +289 -0
  8. package/lib/constants/WAREHOUSE_ENUMS.js +392 -0
  9. package/lib/constants/WAREHOUSE_INVOICE.js +10 -10
  10. package/lib/constants/index.d.ts +1 -0
  11. package/lib/constants/index.js +1 -0
  12. package/lib/helpers/order/generate-purchase-order-rfq.d.ts +3 -3
  13. package/lib/helpers/order/generate-purchase-order-rfq.js +2 -2
  14. package/lib/helpers/order/generate-purchase-order.d.ts +8 -8
  15. package/lib/helpers/order/generate-purchase-order.js +2 -2
  16. package/lib/helpers/order/generate-warehouse-purchase-order-rfq.d.ts +3 -0
  17. package/lib/helpers/order/generate-warehouse-purchase-order-rfq.js +64 -0
  18. package/lib/helpers/order/generate-warehouse-purchase-order.d.ts +11 -0
  19. package/lib/helpers/order/generate-warehouse-purchase-order.js +196 -0
  20. package/lib/helpers/order/index.d.ts +2 -2
  21. package/lib/helpers/order/index.js +2 -2
  22. package/lib/helpers/store/all-purchase-orders-actions.d.ts +7 -7
  23. package/lib/helpers/store/all-purchase-orders-actions.js +2 -2
  24. package/lib/helpers/store/all-sale-orders-actions.d.ts +2 -2
  25. package/lib/helpers/store/all-warehouse-purchase-orders-actions.d.ts +13 -0
  26. package/lib/helpers/store/all-warehouse-purchase-orders-actions.js +56 -0
  27. package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +2 -0
  28. package/lib/helpers/store/all-warehouse-sale-orders-actions.js +8 -0
  29. package/lib/helpers/store/common-purchase-order-actions.d.ts +15 -15
  30. package/lib/helpers/store/common-sale-order-actions.d.ts +5 -5
  31. package/lib/helpers/store/common-warehouse-purchase-order-actions.d.ts +31 -0
  32. package/lib/helpers/store/common-warehouse-purchase-order-actions.js +545 -0
  33. package/lib/helpers/store/common-warehouse-sale-order-actions.d.ts +5 -0
  34. package/lib/helpers/store/common-warehouse-sale-order-actions.js +65 -0
  35. package/lib/helpers/store/index.d.ts +6 -6
  36. package/lib/helpers/store/index.js +6 -6
  37. package/lib/helpers/store/purchase-order-rfq-cart-actions.d.ts +11 -11
  38. package/lib/helpers/store/purchase-order-rfq-cart-actions.js +3 -3
  39. package/lib/helpers/store/purchase-orders-cart-actions.d.ts +18 -18
  40. package/lib/helpers/store/purchase-orders-cart-actions.js +1 -1
  41. package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.d.ts +19 -0
  42. package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +373 -0
  43. package/lib/helpers/store/warehouse-purchase-orders-cart-actions.d.ts +57 -0
  44. package/lib/helpers/store/warehouse-purchase-orders-cart-actions.js +486 -0
  45. package/lib/helpers/types/index.d.ts +1 -1
  46. package/lib/helpers/types/index.js +1 -1
  47. package/lib/helpers/types/purchase-order-cart-actions.d.ts +2 -2
  48. package/lib/helpers/types/warehouse-purchase-order-cart-actions.d.ts +26 -0
  49. package/lib/helpers/types/warehouse-purchase-order-cart-actions.js +2 -0
  50. package/lib/helpers/types/workers.d.ts +18 -18
  51. package/lib/helpers/utils/index.d.ts +8 -8
  52. package/lib/helpers/utils/index.js +8 -11
  53. package/lib/helpers/utils/inventory.js +6 -0
  54. package/lib/helpers/utils/invoice-x-report-helpers.d.ts +2 -2
  55. package/lib/helpers/utils/invoice-x-report-helpers.js +14 -14
  56. package/lib/helpers/utils/purchase-order-engine.d.ts +4 -4
  57. package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +5 -5
  58. package/lib/helpers/utils/purchase-order-receipt-engine.js +2 -2
  59. package/lib/helpers/utils/purchase-order-x-report-helpers.js +2 -2
  60. package/lib/helpers/utils/sale-x-report-helpers.js +2 -2
  61. package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +3 -3
  62. package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +2 -2
  63. package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +3 -3
  64. package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +2 -2
  65. package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +5 -5
  66. package/lib/helpers/utils/warehouse-catalog-conversion.d.ts +3 -3
  67. package/lib/helpers/utils/warehouse-catalog-conversion.js +9 -7
  68. package/lib/helpers/utils/warehouse-inventory.js +9 -0
  69. package/lib/helpers/utils/warehouse-invoice-order-engine.js +1 -1
  70. package/lib/helpers/utils/warehouse-invoice-x-report-helpers.d.ts +58 -0
  71. package/lib/helpers/utils/warehouse-invoice-x-report-helpers.js +1432 -0
  72. package/lib/helpers/utils/warehouse-purchase-order-engine.d.ts +9 -0
  73. package/lib/helpers/utils/warehouse-purchase-order-engine.js +34 -0
  74. package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.d.ts +149 -0
  75. package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.js +214 -0
  76. package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.d.ts +58 -0
  77. package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1440 -0
  78. package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.d.ts +30 -0
  79. package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.js +2 -0
  80. package/lib/helpers/utils/warehouse-sale-x-report-helpers.d.ts +58 -0
  81. package/lib/helpers/utils/warehouse-sale-x-report-helpers.js +1456 -0
  82. package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.d.ts +3 -0
  83. package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.js +38 -0
  84. package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.d.ts +13 -0
  85. package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +22 -0
  86. package/lib/schemas/models/gift_cards.d.ts +108 -108
  87. package/lib/schemas/models/halfhalf_setup.d.ts +3 -3
  88. package/lib/schemas/models/index.d.ts +7 -7
  89. package/lib/schemas/models/index.js +7 -7
  90. package/lib/schemas/models/internal_invoices.d.ts +6 -6
  91. package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +6 -6
  92. package/lib/schemas/models/inventory_transactions.d.ts +3 -3
  93. package/lib/schemas/models/item_transactions.d.ts +6 -6
  94. package/lib/schemas/models/offers.d.ts +146 -146
  95. package/lib/schemas/models/orders.d.ts +2573 -2573
  96. package/lib/schemas/models/printer_settings.d.ts +12 -12
  97. package/lib/schemas/models/reservations.d.ts +6 -6
  98. package/lib/schemas/models/rewards_usage.d.ts +6 -6
  99. package/lib/schemas/models/riders.d.ts +3 -3
  100. package/lib/schemas/models/tenants.d.ts +135 -135
  101. package/lib/schemas/models/void_order_items.d.ts +15 -15
  102. package/lib/schemas/models/void_warehouse_invoice_items.d.ts +25 -25
  103. package/lib/schemas/models/void_warehouse_invoice_items.js +2 -2
  104. package/lib/schemas/models/vouchers.d.ts +9 -9
  105. package/lib/schemas/models/warehouse-activity-logs.d.ts +13 -13
  106. package/lib/schemas/models/warehouse-activity-logs.js +4 -4
  107. package/lib/schemas/models/warehouse_categories.d.ts +4 -4
  108. package/lib/schemas/models/warehouse_categories.js +2 -2
  109. package/lib/schemas/models/warehouse_communications.d.ts +21 -21
  110. package/lib/schemas/models/warehouse_internal_movements.d.ts +33 -33
  111. package/lib/schemas/models/warehouse_internal_movements.js +8 -8
  112. package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +154 -0
  113. package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.js +193 -0
  114. package/lib/schemas/models/warehouse_inventory_transactions.d.ts +6 -6
  115. package/lib/schemas/models/warehouse_invoices.d.ts +351 -351
  116. package/lib/schemas/models/warehouse_item_transactions.d.ts +9 -9
  117. package/lib/schemas/models/warehouse_items.d.ts +13 -13
  118. package/lib/schemas/models/warehouse_items.js +2 -2
  119. package/lib/schemas/models/warehouse_operational_roles.d.ts +3 -3
  120. package/lib/schemas/models/warehouse_purchase_order_receipts.d.ts +165 -0
  121. package/lib/schemas/models/warehouse_purchase_order_receipts.js +151 -0
  122. package/lib/schemas/models/warehouse_purchase_order_rfqs.d.ts +1959 -0
  123. package/lib/schemas/models/warehouse_purchase_order_rfqs.js +328 -0
  124. package/lib/schemas/models/warehouse_purchase_order_vendor_returns.d.ts +234 -0
  125. package/lib/schemas/models/warehouse_purchase_order_vendor_returns.js +188 -0
  126. package/lib/schemas/models/warehouse_purchase_orders.d.ts +2678 -0
  127. package/lib/schemas/models/warehouse_purchase_orders.js +336 -0
  128. package/lib/schemas/models/warehouse_sale_deliveries.d.ts +15 -15
  129. package/lib/schemas/models/warehouse_sale_deliveries.js +7 -4
  130. package/lib/schemas/models/warehouse_sale_invoices.d.ts +30 -30
  131. package/lib/schemas/models/warehouse_sale_invoices.js +8 -5
  132. package/lib/schemas/models/warehouse_sale_order_rfqs.d.ts +362 -362
  133. package/lib/schemas/models/warehouse_sale_order_rfqs.js +5 -5
  134. package/lib/schemas/models/warehouse_sale_orders.d.ts +367 -367
  135. package/lib/schemas/models/warehouse_sale_orders.js +5 -5
  136. package/lib/schemas/models/warehouse_void_invoice_items.d.ts +176 -0
  137. package/lib/schemas/models/warehouse_void_invoice_items.js +176 -0
  138. package/lib/schemas/models/warehouse_void_purchase_order_items.d.ts +176 -0
  139. package/lib/schemas/models/warehouse_void_purchase_order_items.js +177 -0
  140. package/lib/schemas/models/warehouses.d.ts +52 -52
  141. package/lib/schemas/models/warehouses.js +2 -2
  142. package/lib/schemas/types/index.d.ts +9 -9
  143. package/lib/schemas/types/index.js +9 -9
  144. package/lib/schemas/types/inventories.d.ts +2 -0
  145. package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +5 -5
  146. package/lib/schemas/types/warehouse-activity-logs.d.ts +7 -7
  147. package/lib/schemas/types/warehouse_categories.d.ts +2 -2
  148. package/lib/schemas/types/warehouse_internal_movements.d.ts +9 -9
  149. package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.d.ts +85 -0
  150. package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.js +4 -0
  151. package/lib/schemas/types/warehouse_items.d.ts +5 -2
  152. package/lib/schemas/types/warehouse_purchase_order_common.d.ts +39 -0
  153. package/lib/schemas/types/warehouse_purchase_order_common.js +2 -0
  154. package/lib/schemas/types/warehouse_purchase_order_receipts.d.ts +39 -0
  155. package/lib/schemas/types/warehouse_purchase_order_receipts.js +21 -0
  156. package/lib/schemas/types/warehouse_purchase_order_rfqs.d.ts +33 -0
  157. package/lib/schemas/types/warehouse_purchase_order_rfqs.js +2 -0
  158. package/lib/schemas/types/warehouse_purchase_order_vendor_returns.d.ts +48 -0
  159. package/lib/schemas/types/warehouse_purchase_order_vendor_returns.js +2 -0
  160. package/lib/schemas/types/warehouse_purchase_orders.d.ts +33 -0
  161. package/lib/schemas/types/warehouse_purchase_orders.js +2 -0
  162. package/lib/schemas/types/warehouse_sale_deliveries.d.ts +29 -29
  163. package/lib/schemas/types/warehouse_sale_invoices.d.ts +17 -17
  164. package/lib/schemas/types/warehouse_sale_order_common.d.ts +39 -0
  165. package/lib/schemas/types/warehouse_sale_order_common.js +2 -0
  166. package/lib/schemas/types/warehouse_sale_order_rfqs.d.ts +7 -7
  167. package/lib/schemas/types/warehouse_sale_orders.d.ts +7 -7
  168. package/lib/schemas/types/warehouse_void_invoice_items.d.ts +37 -0
  169. package/lib/schemas/types/warehouse_void_invoice_items.js +2 -0
  170. package/lib/schemas/types/warehouse_void_purchase_order_items.d.ts +37 -0
  171. package/lib/schemas/types/warehouse_void_purchase_order_items.js +2 -0
  172. package/lib/schemas/types/warehouses.d.ts +2 -2
  173. package/package.json +1 -1
@@ -23,7 +23,7 @@ export * from './ingredients';
23
23
  export * from './internal-amount-helpers';
24
24
  export * from './inventory';
25
25
  export * from './inventory_transactions';
26
- export * from './invoice-x-report-helpers';
26
+ export * from './warehouse-invoice-x-report-helpers';
27
27
  export * from './item-report-helpers';
28
28
  export * from './items-comparison-report-helpers';
29
29
  export * from './kds-helpers';
@@ -44,16 +44,11 @@ export * from './platform-specific-tenant-shifts';
44
44
  export * from './price-conversion';
45
45
  export * from './printer-helpers';
46
46
  export * from './public-holidays-helpers';
47
- export * from './purchase-order-engine';
48
- export * from './purchase-order-receipt-engine';
49
- export * from './purchase-order-x-report-helpers';
50
47
  export * from './ratings-comparison-report-helpers';
51
48
  export * from './receipt-engine';
52
49
  export * from './review-helpers';
53
50
  export * from './rider-tracking';
54
51
  export * from './riders-report-helpers';
55
- export * from './sale-order-x-report-helpers';
56
- export { getSaleXReportData, getSaleXReportHtml } from './sale-x-report-helpers';
57
52
  export * from './sales-comparison-report-helpers';
58
53
  export * from './sales-comparitive-report-helpers';
59
54
  export * from './sales-overview-report-helpers';
@@ -65,8 +60,6 @@ export * from './tenant-staff-helpers';
65
60
  export * from './time-helpers';
66
61
  export * from './void-items-report-helpers';
67
62
  export * from './void-order-items-helpers';
68
- export * from './void-purchase-order-items-helpers';
69
- export * from './void-purchase-order-items-report-helpers';
70
63
  export * from './void-warehouse-invoice-items-helpers';
71
64
  export * from './void-warehouse-invoice-items-report-helpers';
72
65
  export * from './voidations-summary-report-helpers';
@@ -75,6 +68,13 @@ export * from './wallet-redemption-helpers';
75
68
  export * from './warehouse-catalog-conversion';
76
69
  export * from './warehouse-inventory';
77
70
  export * from './warehouse-invoice-order-engine';
71
+ export * from './warehouse-purchase-order-engine';
72
+ export * from './warehouse-purchase-order-receipt-engine';
73
+ export * from './warehouse-purchase-order-x-report-helpers';
74
+ export * from './warehouse-sale-order-x-report-helpers';
75
+ export * from './warehouse-sale-x-report-helpers';
78
76
  export * from './warehouse-settings-helpers';
77
+ export * from './warehouse-void-purchase-order-items-helpers';
78
+ export * from './warehouse-void-purchase-order-items-report-helpers';
79
79
  export * from './warehouse_inventory_transactions';
80
80
  export * from './x-report-helpers';
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getSaleXReportHtml = exports.getSaleXReportData = void 0;
18
17
  __exportStar(require("./cart-helpers"), exports);
19
18
  __exportStar(require("./cash_in_hand_transactions"), exports);
20
19
  __exportStar(require("./catalog-conversion"), exports);
@@ -40,7 +39,7 @@ __exportStar(require("./ingredients"), exports);
40
39
  __exportStar(require("./internal-amount-helpers"), exports);
41
40
  __exportStar(require("./inventory"), exports);
42
41
  __exportStar(require("./inventory_transactions"), exports);
43
- __exportStar(require("./invoice-x-report-helpers"), exports);
42
+ __exportStar(require("./warehouse-invoice-x-report-helpers"), exports);
44
43
  __exportStar(require("./item-report-helpers"), exports);
45
44
  __exportStar(require("./items-comparison-report-helpers"), exports);
46
45
  __exportStar(require("./kds-helpers"), exports);
@@ -61,18 +60,11 @@ __exportStar(require("./platform-specific-tenant-shifts"), exports);
61
60
  __exportStar(require("./price-conversion"), exports);
62
61
  __exportStar(require("./printer-helpers"), exports);
63
62
  __exportStar(require("./public-holidays-helpers"), exports);
64
- __exportStar(require("./purchase-order-engine"), exports);
65
- __exportStar(require("./purchase-order-receipt-engine"), exports);
66
- __exportStar(require("./purchase-order-x-report-helpers"), exports);
67
63
  __exportStar(require("./ratings-comparison-report-helpers"), exports);
68
64
  __exportStar(require("./receipt-engine"), exports);
69
65
  __exportStar(require("./review-helpers"), exports);
70
66
  __exportStar(require("./rider-tracking"), exports);
71
67
  __exportStar(require("./riders-report-helpers"), exports);
72
- __exportStar(require("./sale-order-x-report-helpers"), exports);
73
- var sale_x_report_helpers_1 = require("./sale-x-report-helpers");
74
- Object.defineProperty(exports, "getSaleXReportData", { enumerable: true, get: function () { return sale_x_report_helpers_1.getSaleXReportData; } });
75
- Object.defineProperty(exports, "getSaleXReportHtml", { enumerable: true, get: function () { return sale_x_report_helpers_1.getSaleXReportHtml; } });
76
68
  __exportStar(require("./sales-comparison-report-helpers"), exports);
77
69
  __exportStar(require("./sales-comparitive-report-helpers"), exports);
78
70
  __exportStar(require("./sales-overview-report-helpers"), exports);
@@ -84,8 +76,6 @@ __exportStar(require("./tenant-staff-helpers"), exports);
84
76
  __exportStar(require("./time-helpers"), exports);
85
77
  __exportStar(require("./void-items-report-helpers"), exports);
86
78
  __exportStar(require("./void-order-items-helpers"), exports);
87
- __exportStar(require("./void-purchase-order-items-helpers"), exports);
88
- __exportStar(require("./void-purchase-order-items-report-helpers"), exports);
89
79
  __exportStar(require("./void-warehouse-invoice-items-helpers"), exports);
90
80
  __exportStar(require("./void-warehouse-invoice-items-report-helpers"), exports);
91
81
  __exportStar(require("./voidations-summary-report-helpers"), exports);
@@ -94,6 +84,13 @@ __exportStar(require("./wallet-redemption-helpers"), exports);
94
84
  __exportStar(require("./warehouse-catalog-conversion"), exports);
95
85
  __exportStar(require("./warehouse-inventory"), exports);
96
86
  __exportStar(require("./warehouse-invoice-order-engine"), exports);
87
+ __exportStar(require("./warehouse-purchase-order-engine"), exports);
88
+ __exportStar(require("./warehouse-purchase-order-receipt-engine"), exports);
89
+ __exportStar(require("./warehouse-purchase-order-x-report-helpers"), exports);
90
+ __exportStar(require("./warehouse-sale-order-x-report-helpers"), exports);
91
+ __exportStar(require("./warehouse-sale-x-report-helpers"), exports);
97
92
  __exportStar(require("./warehouse-settings-helpers"), exports);
93
+ __exportStar(require("./warehouse-void-purchase-order-items-helpers"), exports);
94
+ __exportStar(require("./warehouse-void-purchase-order-items-report-helpers"), exports);
98
95
  __exportStar(require("./warehouse_inventory_transactions"), exports);
99
96
  __exportStar(require("./x-report-helpers"), exports);
@@ -100,6 +100,12 @@ function getKitchenInventoryWithDecimal(inventory) {
100
100
  ...(typeof inventory.variance_quantity === 'number'
101
101
  ? { variance_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.variance_quantity) }
102
102
  : {}),
103
+ ...(typeof inventory.transfer_quantity === 'number'
104
+ ? { transfer_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.transfer_quantity) }
105
+ : {}),
106
+ ...(typeof inventory.return_quantity === 'number'
107
+ ? { return_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.return_quantity) }
108
+ : {}),
103
109
  ...(typeof inventory.new_stock_price === 'number'
104
110
  ? { new_stock_price: (0, price_conversion_1.convertIntToDecimal)(inventory.new_stock_price) }
105
111
  : {}),
@@ -1,4 +1,4 @@
1
- import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, IInvoiceXReport } from '../../constants';
1
+ import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, IWarehouseInvoiceXReport } from '../../constants';
2
2
  interface IFooterDetail {
3
3
  amount: number;
4
4
  count: number;
@@ -54,5 +54,5 @@ interface IProps extends IInvoiceXReportProps {
54
54
  monochrome?: boolean;
55
55
  }
56
56
  export declare function getInvoiceXReportHtml({ width, monochrome, clientWiseData, combinedData, currency_symbol, from, to, warehouseName, isFilterApplied, }: IProps): string;
57
- export declare const getInvoiceXReportData: (data: IInvoiceXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IUsableData;
57
+ export declare const getInvoiceXReportData: (data: IWarehouseInvoiceXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IUsableData;
58
58
  export {};
@@ -1063,7 +1063,7 @@ const getSortedUsableChannels = (channels) => {
1063
1063
  subChannel.sortIndex = 100000;
1064
1064
  subChannel.bold = true;
1065
1065
  }
1066
- else if (channel.ref === constants_1.INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES) {
1066
+ else if (channel.ref === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES) {
1067
1067
  const paymentType = subChannel.ref;
1068
1068
  let sortIndex = constants_1.ALL_PAYMENT_TYPE_NAMES.indexOf(paymentType);
1069
1069
  if (sortIndex === -1) {
@@ -1071,7 +1071,7 @@ const getSortedUsableChannels = (channels) => {
1071
1071
  }
1072
1072
  subChannel.sortIndex = sortIndex;
1073
1073
  }
1074
- else if (channel.ref === constants_1.INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
1074
+ else if (channel.ref === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
1075
1075
  const status = subChannel.ref;
1076
1076
  let sortIndex = constants_1.ALL_WAREHOUSE_INVOICE_STATUS_NAMES.indexOf(status);
1077
1077
  if (sortIndex === -1) {
@@ -1087,7 +1087,7 @@ const getSortedUsableChannels = (channels) => {
1087
1087
  }
1088
1088
  subChannel.sortIndex = sortIndex;
1089
1089
  }
1090
- else if (channel.ref === constants_1.INVOICE_X_REPORT_TYPE_ENUM.STAFF) {
1090
+ else if (channel.ref === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.STAFF) {
1091
1091
  // Clients are sorted by ref (client_id)
1092
1092
  subChannel.sortIndex = j;
1093
1093
  }
@@ -1106,14 +1106,14 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1106
1106
  const clientWiseDataMap = {};
1107
1107
  const clientWiseTotalSalesMap = {};
1108
1108
  const clientNamesMap = {};
1109
- data[constants_1.INVOICE_X_REPORT_TYPE_ENUM.TOTAL_SALES].forEach((item) => {
1109
+ data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_SALES].forEach((item) => {
1110
1110
  const clientName = item.client_name ?? 'By Client';
1111
1111
  const clientId = item.client_id ?? CLIENT_ID;
1112
1112
  clientWiseTotalSalesMap[clientId] = item;
1113
1113
  clientNamesMap[clientId] = clientName;
1114
1114
  });
1115
1115
  // ==========>>><<<==========
1116
- data[constants_1.INVOICE_X_REPORT_TYPE_ENUM.STAFF].forEach((item) => {
1116
+ data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.STAFF].forEach((item) => {
1117
1117
  const clientId = item.client_id ?? CLIENT_ID;
1118
1118
  const clientName = clientNamesMap[clientId];
1119
1119
  if (clientName != null) {
@@ -1123,7 +1123,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1123
1123
  ref: item.staff_id,
1124
1124
  title: 'Staff',
1125
1125
  description: item.staff_name,
1126
- type: constants_1.INVOICE_X_REPORT_TYPE_ENUM.STAFF,
1126
+ type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.STAFF,
1127
1127
  staff_name: clientName,
1128
1128
  count: item.count,
1129
1129
  amount,
@@ -1137,7 +1137,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1137
1137
  }
1138
1138
  }
1139
1139
  });
1140
- data[constants_1.INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS].forEach((item) => {
1140
+ data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS].forEach((item) => {
1141
1141
  const clientId = item.client_id ?? CLIENT_ID;
1142
1142
  const clientName = clientNamesMap[clientId];
1143
1143
  if (clientName != null) {
@@ -1145,7 +1145,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1145
1145
  const obj = {
1146
1146
  _id: clientId,
1147
1147
  ref: item.status,
1148
- type: constants_1.INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS,
1148
+ type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.ORDER_STATUS,
1149
1149
  staff_name: clientName,
1150
1150
  title: 'Order Status',
1151
1151
  description: (0, common_1.sentenceCase)(item.status.replace(/_/g, ' ')),
@@ -1161,7 +1161,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1161
1161
  }
1162
1162
  }
1163
1163
  });
1164
- data[constants_1.INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES].forEach((item) => {
1164
+ data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES].forEach((item) => {
1165
1165
  const clientId = item.client_id ?? CLIENT_ID;
1166
1166
  const clientName = clientNamesMap[clientId];
1167
1167
  if (clientName != null) {
@@ -1169,7 +1169,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1169
1169
  const obj = {
1170
1170
  _id: clientId,
1171
1171
  ref: item.payment_type,
1172
- type: constants_1.INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES,
1172
+ type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES,
1173
1173
  staff_name: clientName,
1174
1174
  title: 'Payments',
1175
1175
  description: (0, common_1.sentenceCase)(item.payment_type.replace(/_/g, ' ')),
@@ -1185,7 +1185,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1185
1185
  }
1186
1186
  }
1187
1187
  });
1188
- data[constants_1.INVOICE_X_REPORT_TYPE_ENUM.GST].forEach((item) => {
1188
+ data[constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.GST].forEach((item) => {
1189
1189
  const clientId = item.client_id ?? CLIENT_ID;
1190
1190
  const clientName = clientNamesMap[clientId];
1191
1191
  if (clientName != null) {
@@ -1194,7 +1194,7 @@ const generateClientWiseData = (data, currencySymbol, gstName) => {
1194
1194
  const obj = {
1195
1195
  _id: clientId,
1196
1196
  ref: gst,
1197
- type: constants_1.INVOICE_X_REPORT_TYPE_ENUM.GST,
1197
+ type: constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.GST,
1198
1198
  staff_name: clientName,
1199
1199
  title: gstName,
1200
1200
  description: `${gst}%`,
@@ -1297,10 +1297,10 @@ const getUsableData = (data, subtitles) => {
1297
1297
  const subChannels = [];
1298
1298
  for (let j = 0; j < clientWiseDataArr.length; j++) {
1299
1299
  const d = clientWiseDataArr[j];
1300
- if (d.type === constants_1.INVOICE_X_REPORT_TYPE_ENUM.GST && d.ref !== TOTAL_REF) {
1300
+ if (d.type === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.GST && d.ref !== TOTAL_REF) {
1301
1301
  totalGst += d.amount;
1302
1302
  }
1303
- else if (d.type === constants_1.INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES && d.ref !== TOTAL_REF) {
1303
+ else if (d.type === constants_1.WAREHOUSE_INVOICE_X_REPORT_TYPE_ENUM.TOTAL_PAYMENT_SALES && d.ref !== TOTAL_REF) {
1304
1304
  if (String(d.description).toUpperCase() === constants_1.PAYMENT_TYPE_ENUM.UNPAID) {
1305
1305
  unpaidOrders += d.count;
1306
1306
  unpaidAmount += d.amount;
@@ -1,9 +1,9 @@
1
- import { IPurchaseOrderItem, IWarehouseItem } from '../../schemas';
1
+ import { WarehouseIPurchaseOrderItem, IWarehouseItem } from '../../schemas';
2
2
  interface IConvertWarehouseItemToPurchaseOrderItemParams {
3
3
  vendorId: string;
4
4
  item: IWarehouseItem;
5
- orderItem?: IPurchaseOrderItem;
5
+ orderItem?: WarehouseIPurchaseOrderItem;
6
6
  }
7
- export declare function convertWarehouseItemToPurchaseOrderItem({ vendorId, item, orderItem, }: IConvertWarehouseItemToPurchaseOrderItemParams): IPurchaseOrderItem;
8
- export declare function getCurrentPurchaseOrderItemTotalPrice(orderItem: IPurchaseOrderItem): number;
7
+ export declare function convertWarehouseItemToPurchaseOrderItem({ vendorId, item, orderItem, }: IConvertWarehouseItemToPurchaseOrderItemParams): WarehouseIPurchaseOrderItem;
8
+ export declare function getCurrentPurchaseOrderItemTotalPrice(orderItem: WarehouseIPurchaseOrderItem): number;
9
9
  export {};
@@ -1,7 +1,7 @@
1
1
  import { CURRENCY_SYMBOL_ENUM } from '../../constants';
2
- import { IPurchaseOrder, IPurchaseOrderItem, IWarehouse } from '../../schemas';
2
+ import { WarehouseIPurchaseOrder, WarehouseIPurchaseOrderItem, IWarehouse } from '../../schemas';
3
3
  export interface IWarehouseReceiptProps {
4
- order: Partial<IPurchaseOrder>;
4
+ order: Partial<WarehouseIPurchaseOrder>;
5
5
  warehouse_settings: {
6
6
  image_url: IWarehouse['image_url'] | undefined;
7
7
  name: IWarehouse['name'] | undefined;
@@ -61,7 +61,7 @@ export interface IWarehouseReceiptEngine {
61
61
  cancel_reason: string | null;
62
62
  }
63
63
  export interface IWarehouseReceiptProps {
64
- order: Partial<IPurchaseOrder>;
64
+ order: Partial<WarehouseIPurchaseOrder>;
65
65
  warehouse_settings: {
66
66
  image_url: IWarehouse['image_url'] | undefined;
67
67
  name: IWarehouse['name'] | undefined;
@@ -125,8 +125,8 @@ interface IWarehouseSettings {
125
125
  gstName: string;
126
126
  hide_gst_value: boolean | undefined;
127
127
  }
128
- export declare function getWarehouseReceiptEngineFooterDetails(order: Partial<IPurchaseOrder>, settings: IWarehouseSettings): IWarehouseReceiptItem[];
129
- interface IWarehouseReceiptOrderItem extends IPurchaseOrderItem {
128
+ export declare function getWarehouseReceiptEngineFooterDetails(order: Partial<WarehouseIPurchaseOrder>, settings: IWarehouseSettings): IWarehouseReceiptItem[];
129
+ interface IWarehouseReceiptOrderItem extends WarehouseIPurchaseOrderItem {
130
130
  image_url?: string;
131
131
  }
132
132
  interface IGetWarehouseOrderItemReceiptBody {
@@ -151,7 +151,7 @@ function warehouseReceiptEngine(payload) {
151
151
  if (payload.order.is_deleted) {
152
152
  payment_status = '* DELETED *';
153
153
  }
154
- else if (payload.order.order_status === constants_1.PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
154
+ else if (payload.order.order_status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
155
155
  payment_status = '* CANCELLED *';
156
156
  }
157
157
  else {
@@ -170,7 +170,7 @@ function warehouseReceiptEngine(payload) {
170
170
  }
171
171
  }
172
172
  let cancel_reason = null;
173
- if (payload.order.order_status === constants_1.PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
173
+ if (payload.order.order_status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
174
174
  cancel_reason = payload.order.cancel_reason ?? null;
175
175
  }
176
176
  let invoice_name = `Invoice #${payload.order.order_number ?? ''}`;
@@ -1081,11 +1081,11 @@ const getSortedUsableChannels = (channels) => {
1081
1081
  }
1082
1082
  else if (channel.ref === constants_1.PURCHASE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
1083
1083
  const status = subChannel.ref;
1084
- let sortIndex = constants_1.ALL_PURCHASE_ORDER_STATUS_NAMES.indexOf(status);
1084
+ let sortIndex = constants_1.ALL_WAREHOUSE_PURCHASE_ORDER_STATUS_NAMES.indexOf(status);
1085
1085
  if (sortIndex === -1) {
1086
1086
  sortIndex = 200 + j;
1087
1087
  }
1088
- if (status === constants_1.PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
1088
+ if (status === constants_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED) {
1089
1089
  const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
1090
1090
  if (totalIndex !== -1) {
1091
1091
  const totalAmount = channel.subChannels[totalIndex].amount;
@@ -1073,11 +1073,11 @@ const getSortedUsableChannels = (channels) => {
1073
1073
  }
1074
1074
  else if (channel.ref === constants_1.SALE_ORDER_X_REPORT_TYPE_ENUM.ORDER_STATUS) {
1075
1075
  const status = subChannel.ref;
1076
- let sortIndex = constants_1.ALL_SALES_ORDER_STATUS_NAMES.indexOf(status);
1076
+ let sortIndex = constants_1.ALL_WAREHOUSE_SALES_ORDER_STATUS_NAMES.indexOf(status);
1077
1077
  if (sortIndex === -1) {
1078
1078
  sortIndex = 200 + j;
1079
1079
  }
1080
- if (status === constants_1.SALES_ORDER_STATUS_ENUM.CANCELLED) {
1080
+ if (status === constants_1.WAREHOUSE_SALES_ORDER_STATUS_ENUM.CANCELLED) {
1081
1081
  const totalIndex = channel.subChannels.findIndex((sc) => sc.ref === TOTAL_REF);
1082
1082
  if (totalIndex !== -1) {
1083
1083
  const totalAmount = channel.subChannels[totalIndex].amount;
@@ -1,3 +1,3 @@
1
- import { IVoidPurchaseOrderItem } from '../../schemas';
2
- export declare function getVoidPurchaseOrderItemFromCents<T extends Partial<IVoidPurchaseOrderItem> | IVoidPurchaseOrderItem>(voidPurchaseOrderItem: T): T;
3
- export declare function getFetchedVoidPurchaseOrderItems(voidItems: IVoidPurchaseOrderItem[]): IVoidPurchaseOrderItem[];
1
+ import { WarehouseIVoidPurchaseOrderItem } from '../../schemas';
2
+ export declare function getVoidPurchaseOrderItemFromCents<T extends Partial<WarehouseIVoidPurchaseOrderItem> | WarehouseIVoidPurchaseOrderItem>(voidPurchaseOrderItem: T): T;
3
+ export declare function getFetchedVoidPurchaseOrderItems(voidItems: WarehouseIVoidPurchaseOrderItem[]): WarehouseIVoidPurchaseOrderItem[];
@@ -1,7 +1,7 @@
1
1
  import { CURRENCY_SYMBOL_ENUM } from '../../constants';
2
- import { IVoidPurchaseOrderItem } from '../../schemas';
2
+ import { WarehouseIVoidPurchaseOrderItem } from '../../schemas';
3
3
  export interface IVoidPurchaseOrderItemsReportProps {
4
- data: IVoidPurchaseOrderItem[];
4
+ data: WarehouseIVoidPurchaseOrderItem[];
5
5
  warehouseName: string | undefined;
6
6
  from: Date | null;
7
7
  to: Date | null;
@@ -1,3 +1,3 @@
1
- import { IVoidWarehouseInvoiceItem } from '../../schemas';
2
- export declare function getVoidWarehouseInvoiceItemFromCents<T extends Partial<IVoidWarehouseInvoiceItem> | IVoidWarehouseInvoiceItem>(voidWarehouseInvoiceItem: T): T;
3
- export declare function getFetchedVoidWarehouseInvoiceItems(voidItems: IVoidWarehouseInvoiceItem[]): IVoidWarehouseInvoiceItem[];
1
+ import { IWarehouseVoidInvoiceItem } from '../../schemas';
2
+ export declare function getVoidWarehouseInvoiceItemFromCents<T extends Partial<IWarehouseVoidInvoiceItem> | IWarehouseVoidInvoiceItem>(voidWarehouseInvoiceItem: T): T;
3
+ export declare function getFetchedWarehouseVoidInvoiceItems(voidItems: IWarehouseVoidInvoiceItem[]): IWarehouseVoidInvoiceItem[];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVoidWarehouseInvoiceItemFromCents = getVoidWarehouseInvoiceItemFromCents;
4
- exports.getFetchedVoidWarehouseInvoiceItems = getFetchedVoidWarehouseInvoiceItems;
4
+ exports.getFetchedWarehouseVoidInvoiceItems = getFetchedWarehouseVoidInvoiceItems;
5
5
  const common_order_actions_1 = require("../store/common-order-actions");
6
6
  const price_conversion_1 = require("./price-conversion");
7
7
  function getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem) {
@@ -31,7 +31,7 @@ function getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem) {
31
31
  : {}),
32
32
  };
33
33
  }
34
- function getFetchedVoidWarehouseInvoiceItems(voidItems) {
34
+ function getFetchedWarehouseVoidInvoiceItems(voidItems) {
35
35
  return voidItems
36
36
  .map((voidWarehouseInvoiceItem) => getVoidWarehouseInvoiceItemFromCents(voidWarehouseInvoiceItem))
37
37
  .sort(common_order_actions_1.sortByCreatedAt);
@@ -1,7 +1,7 @@
1
1
  import { CURRENCY_SYMBOL_ENUM } from '../../constants';
2
- import { IVoidWarehouseInvoiceItem } from '../../schemas';
3
- export interface IVoidWarehouseInvoiceItemsReportProps {
4
- data: IVoidWarehouseInvoiceItem[];
2
+ import { IWarehouseVoidInvoiceItem } from '../../schemas';
3
+ export interface IWarehouseVoidInvoiceItemsReportProps {
4
+ data: IWarehouseVoidInvoiceItem[];
5
5
  warehouseName: string | undefined;
6
6
  from: Date | null;
7
7
  to: Date | null;
@@ -9,5 +9,5 @@ export interface IVoidWarehouseInvoiceItemsReportProps {
9
9
  monochrome?: boolean;
10
10
  currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
11
11
  }
12
- export declare function getVoidWarehouseInvoiceItemsReportHtml(props: IVoidWarehouseInvoiceItemsReportProps): string;
13
- export declare function getVoidWarehouseInvoiceItemsReportReceiptHtml(props: IVoidWarehouseInvoiceItemsReportProps): string;
12
+ export declare function getVoidWarehouseInvoiceItemsReportHtml(props: IWarehouseVoidInvoiceItemsReportProps): string;
13
+ export declare function getVoidWarehouseInvoiceItemsReportReceiptHtml(props: IWarehouseVoidInvoiceItemsReportProps): string;
@@ -1,7 +1,7 @@
1
1
  import { IGeneralPrice, IWarehouseCategory, IWarehouseItem } from '../../schemas';
2
2
  import { IWarehouseCatalog } from '../types';
3
- export declare function convertPriceObjFromDecimalToInt(price: IGeneralPrice | null | undefined): IGeneralPrice | null;
4
- export declare function convertPriceObjFromIntToDecimal(priceObj: IGeneralPrice | null | undefined): IGeneralPrice | null;
5
- export declare function getGeneralPriceEnum(price: IGeneralPrice | null | undefined, platform: string | null | undefined): number;
3
+ export declare function convertWarehousePriceObjFromDecimalToInt(price: IGeneralPrice | null | undefined): IGeneralPrice | null;
4
+ export declare function convertWarehousePriceObjFromIntToDecimal(priceObj: IGeneralPrice | null | undefined): IGeneralPrice | null;
5
+ export declare function getWarehouseGeneralPriceEnum(price: IGeneralPrice | null | undefined, platform: string | null | undefined): number;
6
6
  export declare function getPartialWarehouseItemWithPrice<T extends IWarehouseItem | Partial<IWarehouseItem>>(item: T, writeable?: boolean): T;
7
7
  export declare function getWarehouseCatalogFetchedData(categories: IWarehouseCategory[], items: IWarehouseItem[]): IWarehouseCatalog[];
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertPriceObjFromDecimalToInt = convertPriceObjFromDecimalToInt;
4
- exports.convertPriceObjFromIntToDecimal = convertPriceObjFromIntToDecimal;
5
- exports.getGeneralPriceEnum = getGeneralPriceEnum;
3
+ exports.convertWarehousePriceObjFromDecimalToInt = convertWarehousePriceObjFromDecimalToInt;
4
+ exports.convertWarehousePriceObjFromIntToDecimal = convertWarehousePriceObjFromIntToDecimal;
5
+ exports.getWarehouseGeneralPriceEnum = getWarehouseGeneralPriceEnum;
6
6
  exports.getPartialWarehouseItemWithPrice = getPartialWarehouseItemWithPrice;
7
7
  exports.getWarehouseCatalogFetchedData = getWarehouseCatalogFetchedData;
8
8
  const ingredients_1 = require("./ingredients");
9
9
  const price_conversion_1 = require("./price-conversion");
10
- function convertPriceObjFromDecimalToInt(price) {
10
+ function convertWarehousePriceObjFromDecimalToInt(price) {
11
11
  // Step 1: check if price is null, if so return null
12
12
  if (!price)
13
13
  return null;
@@ -29,20 +29,22 @@ function convertPriceObjFromDecimalToInt(price) {
29
29
  }
30
30
  return priceObjInCents;
31
31
  }
32
- function convertPriceObjFromIntToDecimal(priceObj) {
32
+ function convertWarehousePriceObjFromIntToDecimal(priceObj) {
33
33
  if (!priceObj)
34
34
  return null;
35
35
  const keys = Object.keys(priceObj);
36
36
  return keys.reduce((obj, key) => ({ ...obj, [key]: (0, price_conversion_1.convertIntToDecimal)(priceObj[key]) }), {});
37
37
  }
38
- function getGeneralPriceEnum(price, platform) {
38
+ function getWarehouseGeneralPriceEnum(price, platform) {
39
39
  if (!price)
40
40
  return 0;
41
41
  const priceInCents = price[platform] ?? price.BASE_PRICE;
42
42
  return priceInCents;
43
43
  }
44
44
  function getPartialWarehouseItemWithPrice(item, writeable) {
45
- const convertPriceObj = writeable ? convertPriceObjFromDecimalToInt : convertPriceObjFromIntToDecimal;
45
+ const convertPriceObj = writeable
46
+ ? convertWarehousePriceObjFromDecimalToInt
47
+ : convertWarehousePriceObjFromIntToDecimal;
46
48
  const convertPrice = writeable ? price_conversion_1.convertDecimalToInt : price_conversion_1.convertIntToDecimal;
47
49
  const convertIngredients = writeable ? ingredients_1.getIngredientsWithInt : ingredients_1.getIngredientsWithDecimal;
48
50
  return {
@@ -36,6 +36,15 @@ function getWarehouseInventoryWithDecimal(inventory) {
36
36
  ...(typeof inventory.variance_quantity === 'number'
37
37
  ? { variance_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.variance_quantity) }
38
38
  : {}),
39
+ ...(typeof inventory.transfer_quantity === 'number'
40
+ ? { transfer_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.transfer_quantity) }
41
+ : {}),
42
+ ...(typeof inventory.return_quantity === 'number'
43
+ ? { return_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.return_quantity) }
44
+ : {}),
45
+ ...(typeof inventory.sale_quantity === 'number'
46
+ ? { sale_quantity: (0, price_conversion_1.convertIntToDecimal)(inventory.sale_quantity) }
47
+ : {}),
39
48
  ...(typeof inventory.unit_price === 'number' ? { unit_price: (0, price_conversion_1.convertIntToDecimal)(inventory.unit_price) } : {}),
40
49
  ...(typeof inventory.remaining_stock_price === 'number'
41
50
  ? { remaining_stock_price: (0, price_conversion_1.convertIntToDecimal)(inventory.remaining_stock_price) }
@@ -9,7 +9,7 @@ const bson_objectid_1 = __importDefault(require("bson-objectid"));
9
9
  const warehouse_catalog_conversion_1 = require("./warehouse-catalog-conversion");
10
10
  function convertWarehouseItemToWarehouseClientInvoiceItem({ clientId, item, defaultQuantity = 1, orderItem, shouldUseAvgPrice, }) {
11
11
  const { _id = (0, bson_objectid_1.default)().toHexString(), quantity = defaultQuantity, special_instructions = '', is_ready, } = orderItem ?? {};
12
- let newPrice = (0, warehouse_catalog_conversion_1.getGeneralPriceEnum)(item.selling_price, clientId) || item.purchase_price?.BASE_PRICE || 0;
12
+ let newPrice = (0, warehouse_catalog_conversion_1.getWarehouseGeneralPriceEnum)(item.selling_price, clientId) || item.purchase_price?.BASE_PRICE || 0;
13
13
  if (shouldUseAvgPrice && orderItem == null) {
14
14
  newPrice = item.unit_price || newPrice;
15
15
  }
@@ -0,0 +1,58 @@
1
+ import { COUNTRY_ALPHA_2_ENUM, CURRENCY_SYMBOL_ENUM, IWarehouseInvoiceXReport } from '../../constants';
2
+ interface IWarehouseFooterDetail {
3
+ amount: number;
4
+ count: number;
5
+ title: string;
6
+ sortIndex: number;
7
+ }
8
+ export interface IWarehouseUsableInvoiceXReportSubChannel {
9
+ _id: string;
10
+ ref: string | number;
11
+ title: string;
12
+ count: number;
13
+ amount: number;
14
+ strikeThrough?: boolean;
15
+ bold?: boolean;
16
+ sortIndex: number;
17
+ }
18
+ export interface IWarehouseUsableInvoiceXReportChannel {
19
+ _id: string;
20
+ ref: string;
21
+ title: string;
22
+ sortIndex: number;
23
+ footerDetails: IWarehouseFooterDetail[];
24
+ subChannels: IWarehouseUsableInvoiceXReportSubChannel[];
25
+ }
26
+ export interface IWarehouseUsableInvoiceXReportData {
27
+ _id: string;
28
+ title: string;
29
+ netSale: number;
30
+ netWithoutGst: number;
31
+ netWithoutGstSubtitle: string;
32
+ totalOrders: number;
33
+ unpaidOrders: number;
34
+ unpaidAmount: number;
35
+ amountCollected: number;
36
+ itemSales: number;
37
+ channels: IWarehouseUsableInvoiceXReportChannel[];
38
+ }
39
+ export interface IWarehouseInvoiceXReportProps {
40
+ from: Date;
41
+ to: Date;
42
+ clientWiseData: IWarehouseUsableInvoiceXReportData[];
43
+ combinedData?: IWarehouseUsableInvoiceXReportData;
44
+ currency_symbol: CURRENCY_SYMBOL_ENUM | undefined;
45
+ warehouseName: string | undefined;
46
+ isFilterApplied: boolean;
47
+ }
48
+ interface IWarehouseUsableData {
49
+ clientWiseData: IWarehouseUsableInvoiceXReportData[];
50
+ combinedData: IWarehouseUsableInvoiceXReportData;
51
+ }
52
+ interface IWarehouseInvoiceXReportHtmlProps extends IWarehouseInvoiceXReportProps {
53
+ width?: number;
54
+ monochrome?: boolean;
55
+ }
56
+ export declare function getWarehouseInvoiceXReportHtml({ width, monochrome, clientWiseData, combinedData, currency_symbol, from, to, warehouseName, isFilterApplied, }: IWarehouseInvoiceXReportHtmlProps): string;
57
+ export declare const getWarehouseInvoiceXReportData: (data: IWarehouseInvoiceXReport, currencySymbol: CURRENCY_SYMBOL_ENUM | undefined, countryAlpha2: COUNTRY_ALPHA_2_ENUM | undefined) => IWarehouseUsableData;
58
+ export {};