@things-factory/sales-base 4.3.3 → 4.4.0-alpha.1

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/dist-server/constants/attachment-type.js +1 -2
  2. package/dist-server/constants/attachment-type.js.map +1 -1
  3. package/dist-server/constants/index.js +5 -2
  4. package/dist-server/constants/index.js.map +1 -1
  5. package/dist-server/constants/order.js +3 -12
  6. package/dist-server/constants/order.js.map +1 -1
  7. package/dist-server/controllers/ecommerce/index.js +5 -1
  8. package/dist-server/controllers/ecommerce/index.js.map +1 -1
  9. package/dist-server/controllers/index.js +5 -1
  10. package/dist-server/controllers/index.js.map +1 -1
  11. package/dist-server/errors/index.js +5 -1
  12. package/dist-server/errors/index.js.map +1 -1
  13. package/dist-server/errors/validation-error.js +5 -1
  14. package/dist-server/errors/validation-error.js.map +1 -1
  15. package/dist-server/index.js +5 -1
  16. package/dist-server/index.js.map +1 -1
  17. package/dist-server/service/arrival-notice/index.js +5 -1
  18. package/dist-server/service/arrival-notice/index.js.map +1 -1
  19. package/dist-server/service/claim/index.js +5 -1
  20. package/dist-server/service/claim/index.js.map +1 -1
  21. package/dist-server/service/claim-detail/index.js +5 -1
  22. package/dist-server/service/claim-detail/index.js.map +1 -1
  23. package/dist-server/service/claim-order/index.js +5 -1
  24. package/dist-server/service/claim-order/index.js.map +1 -1
  25. package/dist-server/service/collection-order/index.js +5 -1
  26. package/dist-server/service/collection-order/index.js.map +1 -1
  27. package/dist-server/service/delivery-order/index.js +5 -1
  28. package/dist-server/service/delivery-order/index.js.map +1 -1
  29. package/dist-server/service/goods-receival-note/index.js +5 -1
  30. package/dist-server/service/goods-receival-note/index.js.map +1 -1
  31. package/dist-server/service/index.js +24 -48
  32. package/dist-server/service/index.js.map +1 -1
  33. package/dist-server/service/inventory-check/index.js +5 -1
  34. package/dist-server/service/inventory-check/index.js.map +1 -1
  35. package/dist-server/service/invoice/index.js +5 -1
  36. package/dist-server/service/invoice/index.js.map +1 -1
  37. package/dist-server/service/invoice-product/index.js +5 -1
  38. package/dist-server/service/invoice-product/index.js.map +1 -1
  39. package/dist-server/service/job-sheet/index.js +5 -1
  40. package/dist-server/service/job-sheet/index.js.map +1 -1
  41. package/dist-server/service/order-inventory/index.js +5 -1
  42. package/dist-server/service/order-inventory/index.js.map +1 -1
  43. package/dist-server/service/order-inventory/order-inventory-query.js +1 -38
  44. package/dist-server/service/order-inventory/order-inventory-query.js.map +1 -1
  45. package/dist-server/service/order-inventory/order-inventory-types.js +1 -9
  46. package/dist-server/service/order-inventory/order-inventory-types.js.map +1 -1
  47. package/dist-server/service/order-inventory/order-inventory.js +1 -5
  48. package/dist-server/service/order-inventory/order-inventory.js.map +1 -1
  49. package/dist-server/service/order-product/index.js +5 -1
  50. package/dist-server/service/order-product/index.js.map +1 -1
  51. package/dist-server/service/order-product/order-product-types.js +13 -13
  52. package/dist-server/service/order-product/order-product-types.js.map +1 -1
  53. package/dist-server/service/order-product/order-product.js +4 -39
  54. package/dist-server/service/order-product/order-product.js.map +1 -1
  55. package/dist-server/service/order-vas/index.js +5 -1
  56. package/dist-server/service/order-vas/index.js.map +1 -1
  57. package/dist-server/service/others/index.js +5 -1
  58. package/dist-server/service/others/index.js.map +1 -1
  59. package/dist-server/service/others/other-query.js +2 -37
  60. package/dist-server/service/others/other-query.js.map +1 -1
  61. package/dist-server/service/purchase-order/index.js +5 -1
  62. package/dist-server/service/purchase-order/index.js.map +1 -1
  63. package/dist-server/service/purchase-order-other-charge/index.js +5 -1
  64. package/dist-server/service/purchase-order-other-charge/index.js.map +1 -1
  65. package/dist-server/service/release-good/index.js +5 -1
  66. package/dist-server/service/release-good/index.js.map +1 -1
  67. package/dist-server/service/release-good/release-good-mutation.js +1 -23
  68. package/dist-server/service/release-good/release-good-mutation.js.map +1 -1
  69. package/dist-server/service/release-good/release-good-query.js +2 -28
  70. package/dist-server/service/release-good/release-good-query.js.map +1 -1
  71. package/dist-server/service/release-good/release-good.js +12 -32
  72. package/dist-server/service/release-good/release-good.js.map +1 -1
  73. package/dist-server/service/retail-replenishment-order/index.js +5 -1
  74. package/dist-server/service/retail-replenishment-order/index.js.map +1 -1
  75. package/dist-server/service/return-order/index.js +5 -1
  76. package/dist-server/service/return-order/index.js.map +1 -1
  77. package/dist-server/service/reverse-kitting-order/index.js +5 -1
  78. package/dist-server/service/reverse-kitting-order/index.js.map +1 -1
  79. package/dist-server/service/reverse-kitting-order-inventory/index.js +5 -1
  80. package/dist-server/service/reverse-kitting-order-inventory/index.js.map +1 -1
  81. package/dist-server/service/shipping-order/index.js +5 -1
  82. package/dist-server/service/shipping-order/index.js.map +1 -1
  83. package/dist-server/service/transfer-order/index.js +5 -1
  84. package/dist-server/service/transfer-order/index.js.map +1 -1
  85. package/dist-server/service/vas/index.js +5 -1
  86. package/dist-server/service/vas/index.js.map +1 -1
  87. package/dist-server/service/vas-order/index.js +5 -1
  88. package/dist-server/service/vas-order/index.js.map +1 -1
  89. package/dist-server/utils/index.js +5 -1
  90. package/dist-server/utils/index.js.map +1 -1
  91. package/dist-server/utils/inventory-util.js +99 -258
  92. package/dist-server/utils/inventory-util.js.map +1 -1
  93. package/dist-server/utils/order-no-generator.js +0 -7
  94. package/dist-server/utils/order-no-generator.js.map +1 -1
  95. package/package.json +13 -13
  96. package/server/constants/attachment-type.ts +1 -2
  97. package/server/constants/index.ts +0 -1
  98. package/server/constants/order.ts +2 -12
  99. package/server/service/index.ts +21 -51
  100. package/server/service/order-inventory/order-inventory-query.ts +2 -40
  101. package/server/service/order-inventory/order-inventory-types.ts +0 -6
  102. package/server/service/order-inventory/order-inventory.ts +5 -5
  103. package/server/service/order-product/order-product-types.ts +3 -5
  104. package/server/service/order-product/order-product.ts +3 -30
  105. package/server/service/others/other-query.ts +8 -43
  106. package/server/service/release-good/release-good-mutation.ts +2 -24
  107. package/server/service/release-good/release-good-query.ts +30 -57
  108. package/server/service/release-good/release-good.ts +9 -28
  109. package/server/utils/inventory-util.ts +106 -287
  110. package/server/utils/order-no-generator.ts +48 -42
  111. package/dist-server/constants/release-good.js +0 -9
  112. package/dist-server/constants/release-good.js.map +0 -1
  113. package/dist-server/service/draft-release-good/draft-release-good-mutation.js +0 -563
  114. package/dist-server/service/draft-release-good/draft-release-good-mutation.js.map +0 -1
  115. package/dist-server/service/draft-release-good/draft-release-good-query.js +0 -289
  116. package/dist-server/service/draft-release-good/draft-release-good-query.js.map +0 -1
  117. package/dist-server/service/draft-release-good/draft-release-good-type.js +0 -364
  118. package/dist-server/service/draft-release-good/draft-release-good-type.js.map +0 -1
  119. package/dist-server/service/draft-release-good/draft-release-good.js +0 -321
  120. package/dist-server/service/draft-release-good/draft-release-good.js.map +0 -1
  121. package/dist-server/service/draft-release-good/index.js +0 -21
  122. package/dist-server/service/draft-release-good/index.js.map +0 -1
  123. package/dist-server/service/order-tote/index.js +0 -21
  124. package/dist-server/service/order-tote/index.js.map +0 -1
  125. package/dist-server/service/order-tote/order-tote-mutation.js +0 -56
  126. package/dist-server/service/order-tote/order-tote-mutation.js.map +0 -1
  127. package/dist-server/service/order-tote/order-tote-query.js +0 -123
  128. package/dist-server/service/order-tote/order-tote-query.js.map +0 -1
  129. package/dist-server/service/order-tote/order-tote-types.js +0 -79
  130. package/dist-server/service/order-tote/order-tote-types.js.map +0 -1
  131. package/dist-server/service/order-tote/order-tote.js +0 -91
  132. package/dist-server/service/order-tote/order-tote.js.map +0 -1
  133. package/dist-server/service/order-tote-item/index.js +0 -21
  134. package/dist-server/service/order-tote-item/index.js.map +0 -1
  135. package/dist-server/service/order-tote-item/order-tote-item-mutation.js +0 -56
  136. package/dist-server/service/order-tote-item/order-tote-item-mutation.js.map +0 -1
  137. package/dist-server/service/order-tote-item/order-tote-item-query.js +0 -100
  138. package/dist-server/service/order-tote-item/order-tote-item-query.js.map +0 -1
  139. package/dist-server/service/order-tote-item/order-tote-item-types.js +0 -91
  140. package/dist-server/service/order-tote-item/order-tote-item-types.js.map +0 -1
  141. package/dist-server/service/order-tote-item/order-tote-item.js +0 -104
  142. package/dist-server/service/order-tote-item/order-tote-item.js.map +0 -1
  143. package/dist-server/service/order-tote-seal/index.js +0 -21
  144. package/dist-server/service/order-tote-seal/index.js.map +0 -1
  145. package/dist-server/service/order-tote-seal/order-tote-seal-mutation.js +0 -56
  146. package/dist-server/service/order-tote-seal/order-tote-seal-mutation.js.map +0 -1
  147. package/dist-server/service/order-tote-seal/order-tote-seal-query.js +0 -97
  148. package/dist-server/service/order-tote-seal/order-tote-seal-query.js.map +0 -1
  149. package/dist-server/service/order-tote-seal/order-tote-seal-types.js +0 -71
  150. package/dist-server/service/order-tote-seal/order-tote-seal-types.js.map +0 -1
  151. package/dist-server/service/order-tote-seal/order-tote-seal.js +0 -71
  152. package/dist-server/service/order-tote-seal/order-tote-seal.js.map +0 -1
  153. package/server/constants/release-good.ts +0 -6
  154. package/server/service/draft-release-good/draft-release-good-mutation.ts +0 -734
  155. package/server/service/draft-release-good/draft-release-good-query.ts +0 -314
  156. package/server/service/draft-release-good/draft-release-good-type.ts +0 -261
  157. package/server/service/draft-release-good/draft-release-good.ts +0 -270
  158. package/server/service/draft-release-good/index.ts +0 -9
  159. package/server/service/order-tote/index.ts +0 -9
  160. package/server/service/order-tote/order-tote-mutation.ts +0 -30
  161. package/server/service/order-tote/order-tote-query.ts +0 -114
  162. package/server/service/order-tote/order-tote-types.ts +0 -47
  163. package/server/service/order-tote/order-tote.ts +0 -62
  164. package/server/service/order-tote-item/index.ts +0 -9
  165. package/server/service/order-tote-item/order-tote-item-mutation.ts +0 -30
  166. package/server/service/order-tote-item/order-tote-item-query.ts +0 -88
  167. package/server/service/order-tote-item/order-tote-item-types.ts +0 -56
  168. package/server/service/order-tote-item/order-tote-item.ts +0 -72
  169. package/server/service/order-tote-seal/index.ts +0 -9
  170. package/server/service/order-tote-seal/order-tote-seal-mutation.ts +0 -30
  171. package/server/service/order-tote-seal/order-tote-seal-query.ts +0 -60
  172. package/server/service/order-tote-seal/order-tote-seal-types.ts +0 -41
  173. package/server/service/order-tote-seal/order-tote-seal.ts +0 -46
@@ -46,271 +46,113 @@ export const InventoryUtil = {
46
46
  * @param {Object} trxMgr
47
47
  * @returns { object } {items, total}
48
48
  */
49
- async bizplaceProductInventory(bizplaces: Bizplace[], params: ListParam, context: any, trxMgr: EntityManager) {
49
+ async bizplaceInventoryProductGroup(bizplaces: Bizplace[], params: ListParam, context: any, trxMgr: EntityManager) {
50
50
  try {
51
51
  let filters = params.filters
52
-
53
52
  const { domain }: { domain: Domain } = context.state
54
53
 
55
- const { bizplaceIds, productWhereClause, bundleWhereClause, whereClause, batchBundle, productDetailWhereClause } = await getConditions(
54
+ const { bizplaceIds, productWhereClause, bundleWhereClause, whereClause, batchBundle } = await getConditions(
56
55
  bizplaces,
57
56
  filters,
58
- trxMgr,
59
- false
57
+ trxMgr
60
58
  )
61
59
 
62
- let productFilter = filters.find(itm => itm.name == 'productName')
63
-
64
60
  let queryStrings = `
65
- CREATE TEMP TABLE temp_inventory_product_group ON COMMIT DROP AS (
66
- SELECT * FROM (
67
- WITH oi as (
68
- SELECT
69
- SUM(oi.release_qty) AS release_qty,
70
- SUM(oi.release_uom_value) AS release_uom_value,
71
- oi.batch_id,
72
- oi.batch_id_ref,
73
- oi.product_id,
74
- p.name AS product_name,
75
- oi.packing_type,
76
- oi.packing_size,
77
- oi.uom
78
- FROM
79
- order_inventories oi
80
- LEFT JOIN
81
- products p
82
- ON
83
- oi.product_id = p.id
84
- WHERE
85
- (oi.status = 'PENDING' or oi.status = 'PENDING_RECEIVE' or oi.status = 'PENDING_WORKSHEET' or oi.status = 'PENDING_SPLIT')
86
- AND oi.batch_id NOTNULL
87
- AND oi.product_id NOTNULL
88
- AND oi.packing_type NOTNULL
89
- AND oi.packing_size NOTNULL
90
- AND oi.inventory_id IS NULL
91
- GROUP BY
92
- oi.batch_id,
93
- oi.batch_id_ref,
94
- oi.product_id,
95
- oi.packing_type,
96
- oi.packing_size,
97
- oi.uom,
98
- p.name
99
- )
61
+ CREATE TEMP TABLE temp_inventory_product_group AS (
62
+ SELECT * FROM (
63
+ WITH oi as (
100
64
  SELECT
101
- pd.packing_type AS "packingType",
102
- pd.packing_size AS "packingSize",
103
- pd.uom AS "uom",
104
- concat(p.name, ' (', p.description, ')') AS "productName",
105
- coalesce(p.sku, '') AS "productSKU",
106
- coalesce(p.brand, '') AS "productBrand",
107
- p.id AS "productId",
108
- COALESCE(SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0)) - MAX(COALESCE(bp.bundle_product_release_qty, 0)),0) AS "remainQty",
109
- COALESCE(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)),0) AS "remainUomValue",
110
- concat(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)), ' ', pd.uom) AS "remainUomValueWithUom",
111
- 'SINGLE' AS "groupType"
112
- FROM products p
113
- INNER join product_details pd on pd.product_id = p.id
114
- LEFT JOIN inventories i ON i.product_id = p.id and i.domain_id = $1 and i.status = 'STORED'
115
- INNER JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id AND l2.type NOT IN ('${LOCATION_TYPE.QUARANTINE}', '${LOCATION_TYPE.RESERVE}')
116
- and i.packing_type = pd.packing_type and i.packing_size = pd.packing_size and i.uom = pd.uom
65
+ SUM(oi.release_qty) AS release_qty,
66
+ SUM(oi.release_uom_value) AS release_uom_value,
67
+ oi.batch_id,
68
+ oi.batch_id_ref,
69
+ oi.product_id,
70
+ p.name AS product_name,
71
+ oi.packing_type,
72
+ oi.packing_size,
73
+ oi.uom
74
+ FROM
75
+ order_inventories oi
76
+ LEFT JOIN
77
+ products p
78
+ ON
79
+ oi.product_id = p.id
80
+ WHERE
81
+ (oi.status = 'PENDING' or oi.status = 'PENDING_RECEIVE' or oi.status = 'PENDING_WORKSHEET' or oi.status = 'PENDING_SPLIT')
82
+ AND oi.batch_id NOTNULL
83
+ AND oi.product_id NOTNULL
84
+ AND oi.packing_type NOTNULL
85
+ AND oi.packing_size NOTNULL
86
+ AND oi.inventory_id IS NULL
87
+ GROUP BY
88
+ oi.batch_id,
89
+ oi.batch_id_ref,
90
+ oi.product_id,
91
+ oi.packing_type,
92
+ oi.packing_size,
93
+ oi.uom,
94
+ p.name
95
+ )
96
+ SELECT
97
+ i.batch_id AS "batchId",
98
+ i.batch_id_ref AS "batchIdRef",
99
+ i.packing_type AS "packingType",
100
+ i.packing_size AS "packingSize",
101
+ i.uom AS "uom",
102
+ concat(p.name, ' (', p.description, ')') AS "productName",
103
+ coalesce(p.sku, '') AS "productSKU",
104
+ coalesce(p.brand, '') AS "productBrand",
105
+ p.id AS "productId",
106
+ SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0)) - MAX(COALESCE(bp.bundle_product_release_qty, 0)) AS "remainQty",
107
+ SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) AS "remainUomValue",
108
+ concat(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)), ' ', i.uom) AS "remainUomValueWithUom",
109
+ 'SINGLE' AS "groupType"
110
+ FROM
111
+ inventories i
112
+ LEFT JOIN products p ON i.product_id = p.id
117
113
  LEFT JOIN oi ON i.batch_id = oi.batch_id AND p.name = oi.product_name AND i.packing_type = oi.packing_type AND i.packing_size = oi.packing_size AND i.uom = oi.uom
114
+ LEFT JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id
118
115
  LEFT JOIN (
119
116
  SELECT pbs.product_id, SUM(pbs.bundle_qty * src.release_qty) AS bundle_product_release_qty, SUM(pbs.bundle_qty * src.release_uom_value) AS bundle_product_release_uom_value
120
117
  FROM product_bundle_settings pbs
121
- INNER JOIN json_populate_recordset(NULL::order_inventories, '${batchBundle}') src ON src.product_id = pbs.product_bundle_id
118
+ INNER JOIN json_populate_recordset(NULL::order_inventories,'${batchBundle}') src ON src.product_id = pbs.product_bundle_id
122
119
  GROUP BY pbs.product_id
123
120
  ) bp on i.product_id = bp.product_id
124
- WHERE p.bizplace_id IN (${bizplaceIds})
125
- ${productDetailWhereClause}
126
- ${productFilter ? `AND (
127
- lower(p.sku) ilike '${productFilter.value}'
128
- OR lower(p.name) ilike '${productFilter.value}'
129
- OR lower(p.description) ilike '${productFilter.value}'
130
- )
131
- ` : ``}
132
- GROUP BY
133
- p.id,
134
- pd.packing_type,
135
- pd.packing_size,
136
- pd.uom
137
- UNION
138
- SELECT packing_type, packing_size,'UNIT' AS "uom", name AS "productName", sku AS "productSKU", '-' AS "productBrand", id AS "productId",
139
- COALESCE(MIN(FLOOR(pbs."availableQty")),0) AS "remainQty",
140
- COALESCE(MIN(FLOOR(pbs."availableUomValue")),0) AS "remainUomValue",
141
- CONCAT(COALESCE(MIN(FLOOR(pbs."availableUomValue")),0),' UNIT') AS "remainUomValueWithUom",
142
- 'BUNDLE' AS "groupType"
143
- FROM product_bundles pb
144
- LEFT JOIN (
145
- SELECT pbs.product_id, pbs.product_bundle_id, min(pbs.bundle_qty),
146
- (SUM(COALESCE(i2.qty, 0)) - SUM(COALESCE(i2.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0))) / min(pbs.bundle_qty) AS "availableQty",
147
- (SUM(COALESCE(i2.uom_value, 0)) - SUM(COALESCE(i2.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0))) / min(pbs.bundle_qty) AS "availableUomValue"
148
- FROM product_bundle_settings pbs
149
- LEFT JOIN inventories i2 ON i2.product_id = pbs.product_id AND i2.domain_id = $1
150
- INNER JOIN locations l2 ON i2.location_id = l2.id AND i2.domain_id = l2.domain_id AND l2.type NOT IN ('${LOCATION_TYPE.QUARANTINE}', '${LOCATION_TYPE.RESERVE}')
151
- AND i2.bizplace_id IN (${bizplaceIds})
152
- AND i2.status = 'STORED'
153
- LEFT JOIN oi ON oi.product_id = i2.product_id
154
- GROUP BY
155
- pbs.product_id,
156
- pbs.product_bundle_id
157
- ) pbs ON pbs.product_bundle_id = pb.id
158
- ${bundleWhereClause}
159
- AND pb.bizplace_id IN (${bizplaceIds})
160
- ${productFilter ? `AND (
161
- lower(pb.sku) ilike '${productFilter.value}'
162
- OR lower(pb.name) ilike '${productFilter.value}'
163
- OR lower(pb.description) ilike '${productFilter.value}'
164
- )
165
- ` : ``}
166
- GROUP BY
167
- pb.packing_type,
168
- pb.packing_size,
169
- pb.name,
170
- pb.sku,
171
- pb.id
172
- )
173
- AS inv_prod_grp
174
- ${whereClause}
175
- order by "productSKU", "productName"
121
+ WHERE i.domain_id = $1
122
+ AND l2.type NOT IN ('${LOCATION_TYPE.QUARANTINE}', '${LOCATION_TYPE.RESERVE}')
123
+ ${productWhereClause}
124
+ GROUP BY
125
+ i.batch_id,
126
+ i.batch_id_ref,
127
+ p.id,
128
+ i.packing_type,
129
+ i.packing_size,
130
+ i.uom
131
+ UNION
132
+ SELECT 'BUNDLE' AS "batchId", null as "batchIdRef", packing_type, packing_size,'UNIT' AS "uom", name AS "productName", sku AS "productSKU", 'brand' AS "productBrand", id AS "productId",
133
+ MIN(FLOOR(pbs."availableQty")) AS "remainQty",
134
+ MIN(FLOOR(pbs."availableUomValue")) AS "remainUomValue",
135
+ CONCAT(MIN(FLOOR(pbs."availableUomValue")),' UNIT') AS "remainUomValueWithUom",
136
+ 'BUNDLE' AS "groupType"
137
+ FROM product_bundles pb
138
+ INNER JOIN (
139
+ SELECT pbs.product_id, pbs.product_bundle_id, min(pbs.bundle_qty),
140
+ (SUM(COALESCE(i2.qty, 0)) - SUM(COALESCE(i2.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0))) / min(pbs.bundle_qty) AS "availableQty",
141
+ (SUM(COALESCE(i2.uom_value, 0)) - SUM(COALESCE(i2.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0))) / min(pbs.bundle_qty) AS "availableUomValue"
142
+ FROM product_bundle_settings pbs
143
+ LEFT JOIN inventories i2 ON i2.product_id = pbs.product_id AND i2.domain_id = $1
144
+ AND i2.bizplace_id IN (${bizplaceIds})
145
+ AND i2.status = 'STORED'
146
+ LEFT JOIN oi ON oi.product_id = i2.product_id
147
+ GROUP BY pbs.product_id, pbs.product_bundle_id
148
+ ) pbs ON pbs.product_bundle_id = pb.id
149
+ ${bundleWhereClause}
150
+ GROUP BY pb.packing_type, pb.packing_size, pb.name, pb.sku, pb.id
176
151
  )
177
- `
178
-
179
- await trxMgr.query(queryStrings, [domain.id])
180
-
181
- const [{ total }]: any = await trxMgr.query(`select count(*) as total from temp_inventory_product_group`)
182
- let items: any[] = []
183
-
184
- if (params?.pagination) {
185
- items = await trxMgr.query(`select * from temp_inventory_product_group OFFSET $1 LIMIT $2`, [
186
- (params.pagination.page - 1) * params.pagination.limit,
187
- params.pagination.limit
188
- ])
189
- } else {
190
- items = await trxMgr.query(`select * from temp_inventory_product_group`)
191
- }
192
-
193
- return { items, total }
194
- } catch (error) {
195
- throw error
196
- }
197
- },
198
-
199
- /**
200
- * Get all available product belonging to list of bizplaces
201
- * @param {[Object]} bizplaces
202
- * @param {Object} params
203
- * @param {Object} context
204
- * @param {Object} trxMgr
205
- * @returns { object } {items, total}
206
- */
207
- async bizplaceInventoryProductGroup(bizplaces: Bizplace[], params: ListParam, context: any, trxMgr: EntityManager) {
208
- try {
209
- let filters = params.filters
210
- const { domain }: { domain: Domain } = context.state
211
-
212
- const { bizplaceIds, productWhereClause, bundleWhereClause, whereClause, batchBundle } = await getConditions(
213
- bizplaces,
214
- filters,
215
- trxMgr
152
+ AS inv_prod_grp
153
+ ${whereClause}
216
154
  )
217
-
218
- let queryStrings = `
219
- CREATE TEMP TABLE temp_inventory_product_group AS (
220
- SELECT * FROM (
221
- WITH oi as (
222
- SELECT
223
- SUM(oi.release_qty) AS release_qty,
224
- SUM(oi.release_uom_value) AS release_uom_value,
225
- oi.batch_id,
226
- oi.batch_id_ref,
227
- oi.product_id,
228
- p.name AS product_name,
229
- oi.packing_type,
230
- oi.packing_size,
231
- oi.uom
232
- FROM
233
- order_inventories oi
234
- LEFT JOIN
235
- products p
236
- ON
237
- oi.product_id = p.id
238
- WHERE
239
- (oi.status = 'PENDING' or oi.status = 'PENDING_RECEIVE' or oi.status = 'PENDING_WORKSHEET' or oi.status = 'PENDING_SPLIT')
240
- AND oi.batch_id NOTNULL
241
- AND oi.product_id NOTNULL
242
- AND oi.packing_type NOTNULL
243
- AND oi.packing_size NOTNULL
244
- AND oi.inventory_id IS NULL
245
- GROUP BY
246
- oi.batch_id,
247
- oi.batch_id_ref,
248
- oi.product_id,
249
- oi.packing_type,
250
- oi.packing_size,
251
- oi.uom,
252
- p.name
253
- )
254
- SELECT
255
- i.batch_id AS "batchId",
256
- i.batch_id_ref AS "batchIdRef",
257
- i.packing_type AS "packingType",
258
- i.packing_size AS "packingSize",
259
- i.uom AS "uom",
260
- concat(p.name, ' (', p.description, ')') AS "productName",
261
- coalesce(p.sku, '') AS "productSKU",
262
- coalesce(p.brand, '') AS "productBrand",
263
- p.id AS "productId",
264
- SUM(COALESCE(i.qty, 0)) - SUM(COALESCE(i.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0)) - MAX(COALESCE(bp.bundle_product_release_qty, 0)) AS "remainQty",
265
- SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)) AS "remainUomValue",
266
- concat(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)) - MAX(COALESCE(bp.bundle_product_release_uom_value, 0)), ' ', i.uom) AS "remainUomValueWithUom",
267
- 'SINGLE' AS "groupType"
268
- FROM
269
- inventories i
270
- LEFT JOIN products p ON i.product_id = p.id
271
- LEFT JOIN oi ON i.batch_id = oi.batch_id AND p.name = oi.product_name AND i.packing_type = oi.packing_type AND i.packing_size = oi.packing_size AND i.uom = oi.uom
272
- LEFT JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id
273
- LEFT JOIN (
274
- SELECT pbs.product_id, SUM(pbs.bundle_qty * src.release_qty) AS bundle_product_release_qty, SUM(pbs.bundle_qty * src.release_uom_value) AS bundle_product_release_uom_value
275
- FROM product_bundle_settings pbs
276
- INNER JOIN json_populate_recordset(NULL::order_inventories,'${batchBundle}') src ON src.product_id = pbs.product_bundle_id
277
- GROUP BY pbs.product_id
278
- ) bp on i.product_id = bp.product_id
279
- WHERE i.domain_id = $1
280
- AND l2.type NOT IN ('${LOCATION_TYPE.QUARANTINE}', '${LOCATION_TYPE.RESERVE}')
281
- ${productWhereClause}
282
- GROUP BY
283
- i.batch_id,
284
- i.batch_id_ref,
285
- p.id,
286
- i.packing_type,
287
- i.packing_size,
288
- i.uom
289
- UNION
290
- SELECT 'BUNDLE' AS "batchId", null as "batchIdRef", packing_type, packing_size,'UNIT' AS "uom", name AS "productName", sku AS "productSKU", 'brand' AS "productBrand", id AS "productId",
291
- MIN(FLOOR(pbs."availableQty")) AS "remainQty",
292
- MIN(FLOOR(pbs."availableUomValue")) AS "remainUomValue",
293
- CONCAT(MIN(FLOOR(pbs."availableUomValue")),' UNIT') AS "remainUomValueWithUom",
294
- 'BUNDLE' AS "groupType"
295
- FROM product_bundles pb
296
- INNER JOIN (
297
- SELECT pbs.product_id, pbs.product_bundle_id, min(pbs.bundle_qty),
298
- (SUM(COALESCE(i2.qty, 0)) - SUM(COALESCE(i2.locked_qty, 0)) - MAX(COALESCE(oi.release_qty, 0))) / min(pbs.bundle_qty) AS "availableQty",
299
- (SUM(COALESCE(i2.uom_value, 0)) - SUM(COALESCE(i2.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0))) / min(pbs.bundle_qty) AS "availableUomValue"
300
- FROM product_bundle_settings pbs
301
- LEFT JOIN inventories i2 ON i2.product_id = pbs.product_id AND i2.domain_id = $1
302
- AND i2.bizplace_id IN (${bizplaceIds})
303
- AND i2.status = 'STORED'
304
- LEFT JOIN oi ON oi.product_id = i2.product_id
305
- GROUP BY pbs.product_id, pbs.product_bundle_id
306
- ) pbs ON pbs.product_bundle_id = pb.id
307
- ${bundleWhereClause}
308
- GROUP BY pb.packing_type, pb.packing_size, pb.name, pb.sku, pb.id
309
- )
310
- AS inv_prod_grp
311
- ${whereClause}
312
- )
313
- `
155
+ `
314
156
 
315
157
  await trxMgr.query(queryStrings, [domain.id])
316
158
 
@@ -387,10 +229,11 @@ export const InventoryUtil = {
387
229
  SUM(COALESCE(i.locked_qty, 0)) + MAX(COALESCE(oi.release_qty, 0)) AS "totalLockedQty",
388
230
  SUM(COALESCE(i.locked_uom_value, 0)) + MAX(COALESCE(oi.release_uom_value, 0)) AS "totalLockedUomValue",
389
231
  concat(SUM(COALESCE(i.uom_value, 0)) - SUM(COALESCE(i.locked_uom_value, 0)) - MAX(COALESCE(oi.release_uom_value, 0)), ' ', i.uom) AS "remainUomValueWithUom"
390
- FROM inventories i
391
- LEFT JOIN products p ON i.product_id = p.id
392
- LEFT JOIN oi ON p.name = oi.product_name AND i.packing_type = oi.packing_type AND i.packing_size = oi.packing_size AND i.uom = oi.uom
393
- LEFT JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id
232
+ FROM
233
+ inventories i
234
+ LEFT JOIN products p ON i.product_id = p.id
235
+ LEFT JOIN oi ON p.name = oi.product_name AND i.packing_type = oi.packing_type AND i.packing_size = oi.packing_size AND i.uom = oi.uom
236
+ LEFT JOIN locations l2 ON i.location_id = l2.id AND i.domain_id = l2.domain_id
394
237
  WHERE i.domain_id = $1
395
238
  AND l2.type NOT IN ('${LOCATION_TYPE.QUARANTINE}', '${LOCATION_TYPE.RESERVE}')
396
239
  ${apiWhereClause}
@@ -616,14 +459,12 @@ interface Conditions {
616
459
  whereClause: string
617
460
  batchBundle: string
618
461
  apiWhereClause: string
619
- productDetailWhereClause: string
620
462
  }
621
463
 
622
464
  async function getConditions(
623
465
  bizplaces: Bizplace[],
624
466
  filters: [{ name: string; operator: string; value: any }],
625
- trxMgr: EntityManager,
626
- hasRemainingQty: Boolean = true
467
+ trxMgr: EntityManager
627
468
  ): Promise<Conditions> {
628
469
  let bizplaceIds = bizplaces.map((bizplace: Bizplace) => `'${bizplace.id}'`).join()
629
470
 
@@ -638,9 +479,9 @@ async function getConditions(
638
479
  WHERE pb.status = 'ACTIVATED'
639
480
  `
640
481
 
641
- let whereClause = hasRemainingQty ? ` WHERE "remainQty" > 0` : ` WHERE 1 = 1`
642
-
643
- let productDetailWhereClause = ``
482
+ let whereClause = `
483
+ WHERE "remainQty" > 0
484
+ `
644
485
 
645
486
  let batchBundle: string
646
487
  if (filters?.length) {
@@ -651,16 +492,6 @@ async function getConditions(
651
492
  let value = filter.value
652
493
 
653
494
  switch (name) {
654
- case 'productId':
655
- if (operator == 'in')
656
- whereClause += `AND "productId" ${operator === 'in' ? 'IN' : 'NOT IN'} (${value.map(itm => { return `'${itm}'` }).join(',')})`
657
- break
658
-
659
- case 'productBundleId':
660
- if (operator == 'in')
661
- whereClause += `AND "productId" ${operator === 'in' ? 'IN' : 'NOT IN'} (${value.map(itm => { return `'${itm}'` }).join(',')})`
662
- break
663
-
664
495
  case 'batchId':
665
496
  whereClause += `AND LOWER("batchId") LIKE '${value.toLowerCase()}'`
666
497
  break
@@ -761,33 +592,21 @@ async function getConditions(
761
592
  case 'batch_product':
762
593
  productWhereClause += `
763
594
  AND (i.batch_id, p.id, i.packing_type) ${operator === 'in' ? 'IN' : 'NOT IN'} (${value
764
- .map(
765
- (v: { batchId: string; productId: string; packingType: string }) =>
766
- `('${v.batchId}', '${v.productId}', '${v.packingType}')`
767
- )
768
- .join()})
595
+ .map(
596
+ (v: { batchId: string; productId: string; packingType: string }) =>
597
+ `('${v.batchId}', '${v.productId}', '${v.packingType}')`
598
+ )
599
+ .join()})
769
600
  `
770
601
  break
771
602
 
772
603
  case 'batch_bundle':
773
604
  bundleWhereClause += `
774
605
  ${bundleWhereClause == '' ? 'WHERE' : 'AND'} pb.id ${operator === 'in' ? 'IN' : 'NOT IN'} (${value
775
- .map((v: { productId: string }) => `('${v.productId}')`)
776
- .join()})
606
+ .map((v: { productId: string }) => `('${v.productId}')`)
607
+ .join()})
777
608
  `
778
609
  break
779
-
780
- case 'product':
781
- productDetailWhereClause += `
782
- AND (pd.product_id, pd.packing_type, pd.packing_size, pd.uom) ${operator === 'in' ? 'IN' : 'NOT IN'} (${value
783
- .map(
784
- (v: { productId: string; packingType: string; packingSize: string, uom: string }) =>
785
- `('${v.productId}', '${v.packingType}', '${v.packingSize}', '${v.uom}')`
786
- )
787
- .join()})
788
- `
789
- break
790
-
791
610
  }
792
611
  })
793
612
  )
@@ -805,7 +624,7 @@ async function getConditions(
805
624
  )
806
625
  }
807
626
 
808
- return { bizplaceIds, productWhereClause, apiWhereClause, bundleWhereClause, whereClause, batchBundle, productDetailWhereClause }
627
+ return { bizplaceIds, productWhereClause, apiWhereClause, bundleWhereClause, whereClause, batchBundle }
809
628
  }
810
629
 
811
630
  async function createInventory(
@@ -3,44 +3,51 @@ import uuid from 'uuid/v4'
3
3
  export class OrderNoGenerator {
4
4
  static arrivalNotice() {
5
5
  const currentDate = new Date()
6
- return `GAN-${currentDate.getFullYear()}${currentDate.getMonth() + 1
7
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
6
+ return `GAN-${currentDate.getFullYear()}${
7
+ currentDate.getMonth() + 1
8
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
8
9
  }
9
10
 
10
11
  static collectionOrder() {
11
12
  const currentDate = new Date()
12
- return `CO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
13
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
13
+ return `CO-${currentDate.getFullYear()}${
14
+ currentDate.getMonth() + 1
15
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
14
16
  }
15
17
 
16
18
  static cycleCount() {
17
19
  const currentDate = new Date()
18
- return `CC-${currentDate.getFullYear()}${currentDate.getMonth() + 1
19
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
20
+ return `CC-${currentDate.getFullYear()}${
21
+ currentDate.getMonth() + 1
22
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
20
23
  }
21
24
 
22
25
  static deliveryOrder() {
23
26
  const currentDate = new Date()
24
- return `DO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
25
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
27
+ return `DO-${currentDate.getFullYear()}${
28
+ currentDate.getMonth() + 1
29
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
26
30
  }
27
31
 
28
32
  static goodsReceiveNote() {
29
33
  const currentDate = new Date()
30
- return `GRN-${currentDate.getFullYear()}${currentDate.getMonth() + 1
31
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
34
+ return `GRN-${currentDate.getFullYear()}${
35
+ currentDate.getMonth() + 1
36
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
32
37
  }
33
38
 
34
39
  static jobSheet(domainName) {
35
40
  const currentDate = new Date()
36
- return `${domainName}-${currentDate.getFullYear()}${currentDate.getMonth() + 1
37
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
41
+ return `${domainName}-${currentDate.getFullYear()}${
42
+ currentDate.getMonth() + 1
43
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
38
44
  }
39
45
 
40
46
  static manifest() {
41
47
  const currentDate = new Date()
42
- return `LM-${currentDate.getFullYear()}${currentDate.getMonth() + 1
43
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
48
+ return `LM-${currentDate.getFullYear()}${
49
+ currentDate.getMonth() + 1
50
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
44
51
  }
45
52
 
46
53
  static orderInventory() {
@@ -59,26 +66,18 @@ export class OrderNoGenerator {
59
66
  return `OV-${uuid()}`
60
67
  }
61
68
 
62
- static orderToteItem() {
63
- return `OTI-${uuid()}`
64
- }
65
-
66
69
  static purchaseOrder() {
67
70
  const currentDate = new Date()
68
- return `PO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
69
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
71
+ return `PO-${currentDate.getFullYear()}${
72
+ currentDate.getMonth() + 1
73
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
70
74
  }
71
75
 
72
76
  static releaseGood() {
73
77
  const currentDate = new Date()
74
- return `RO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
75
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
76
- }
77
-
78
- static draftReleaseGood() {
79
- const currentDate = new Date()
80
- return `ODO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
81
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
78
+ return `RO-${currentDate.getFullYear()}${
79
+ currentDate.getMonth() + 1
80
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
82
81
  }
83
82
 
84
83
  static releaseVas() {
@@ -87,43 +86,50 @@ export class OrderNoGenerator {
87
86
 
88
87
  static retailReplenishmentOrder() {
89
88
  const currentDate = new Date()
90
- return `RR-${currentDate.getFullYear()}${currentDate.getMonth() + 1
91
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
89
+ return `RR-${currentDate.getFullYear()}${
90
+ currentDate.getMonth() + 1
91
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
92
92
  }
93
93
 
94
94
  static returnOrder() {
95
95
  const currentDate = new Date()
96
- return `RTO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
97
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
96
+ return `RTO-${currentDate.getFullYear()}${
97
+ currentDate.getMonth() + 1
98
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
98
99
  }
99
100
 
100
101
  static shippingOrder() {
101
102
  const currentDate = new Date()
102
- return `SO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
103
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
103
+ return `SO-${currentDate.getFullYear()}${
104
+ currentDate.getMonth() + 1
105
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
104
106
  }
105
107
 
106
108
  static stockTake() {
107
109
  const currentDate = new Date()
108
- return `ST-${currentDate.getFullYear()}${currentDate.getMonth() + 1
109
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
110
+ return `ST-${currentDate.getFullYear()}${
111
+ currentDate.getMonth() + 1
112
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
110
113
  }
111
114
 
112
115
  static transferOrder() {
113
116
  const currentDate = new Date()
114
- return `TO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
115
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
117
+ return `TO-${currentDate.getFullYear()}${
118
+ currentDate.getMonth() + 1
119
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
116
120
  }
117
121
 
118
122
  static vasOrder() {
119
123
  const currentDate = new Date()
120
- return `VO-${currentDate.getFullYear()}${currentDate.getMonth() + 1
121
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
124
+ return `VO-${currentDate.getFullYear()}${
125
+ currentDate.getMonth() + 1
126
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
122
127
  }
123
128
 
124
129
  static invoice() {
125
130
  const currentDate = new Date()
126
- return `INV-${currentDate.getFullYear()}${currentDate.getMonth() + 1
127
- }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
131
+ return `INV-${currentDate.getFullYear()}${
132
+ currentDate.getMonth() + 1
133
+ }${currentDate.getDate()}${currentDate.getHours()}${currentDate.getMinutes()}${currentDate.getSeconds()}${currentDate.getMilliseconds()}`
128
134
  }
129
135
  }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReleaseOrderType = void 0;
4
- var ReleaseOrderType;
5
- (function (ReleaseOrderType) {
6
- ReleaseOrderType["B2B"] = "b2b";
7
- ReleaseOrderType["B2C"] = "b2c";
8
- })(ReleaseOrderType = exports.ReleaseOrderType || (exports.ReleaseOrderType = {}));
9
- //# sourceMappingURL=release-good.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"release-good.js","sourceRoot":"","sources":["../../server/constants/release-good.ts"],"names":[],"mappings":";;;AAEA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,+BAAW,CAAA;AACf,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B"}