@things-factory/operato-wms 5.0.13 → 6.0.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 (206) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +96 -8
  2. package/client/pages/bulk-operation/validate-gan-popup.js +37 -27
  3. package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
  4. package/client/pages/components/select-inventory-popup.js +633 -0
  5. package/client/pages/constants/order.js +2 -1
  6. package/client/pages/inbound/pallet-label-popup.js +2 -0
  7. package/client/pages/inbound/select-product-batch.js +7 -1
  8. package/client/pages/inbound/undo-unload-popup.js +37 -21
  9. package/client/pages/inbound/unload-product.js +147 -59
  10. package/client/pages/inbound/worksheet-putaway.js +1 -1
  11. package/client/pages/inbound/worksheet-unloading.js +11 -7
  12. package/client/pages/inventory/inventory-adjustment.js +261 -238
  13. package/client/pages/inventory/inventory-by-product-detail.js +99 -92
  14. package/client/pages/inventory/inventory-by-product.js +170 -68
  15. package/client/pages/inventory/onhand-inventory.js +10 -12
  16. package/client/pages/inventory/serial-number-list-popup.js +36 -5
  17. package/client/pages/inventory-check/inspecting-product.js +1 -1
  18. package/client/pages/manifest/create-loading-manifest.js +47 -22
  19. package/client/pages/manifest/dispatcher-verification-popup.js +24 -13
  20. package/client/pages/manifest/loading-manifest-detail.js +311 -46
  21. package/client/pages/manifest/loading-manifest-list.js +86 -13
  22. package/client/pages/order/arrival-notice/arrival-notice-detail.js +305 -52
  23. package/client/pages/order/arrival-notice/arrival-notice-list.js +20 -1
  24. package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
  25. package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
  26. package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
  27. package/client/pages/order/release-order/b2c/b2c-order-requests.js +148 -123
  28. package/client/pages/order/release-order/batch-picking-popup.js +11 -0
  29. package/client/pages/order/release-order/create-release-order.js +762 -250
  30. package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
  31. package/client/pages/order/release-order/release-order-detail.js +897 -215
  32. package/client/pages/order/transport-order/delivery-note-popup.js +1050 -107
  33. package/client/pages/order/transport-order/print-delivery-note.js +214 -33
  34. package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
  35. package/client/pages/order/transport-order/view-delivery-note.js +0 -1
  36. package/client/pages/outbound/generate-worksheet-popup.js +374 -0
  37. package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
  38. package/client/pages/outbound/loading-product.js +88 -78
  39. package/client/pages/outbound/merged-outbound-worksheet.js +1 -1
  40. package/client/pages/outbound/packing-product.js +193 -82
  41. package/client/pages/outbound/packing-worksheet-list.js +10 -9
  42. package/client/pages/outbound/picking-product.js +979 -905
  43. package/client/pages/outbound/route-label-popup.js +283 -191
  44. package/client/pages/outbound/serial-number-popup.js +1 -0
  45. package/client/pages/outbound/sorting-product.js +12 -12
  46. package/client/pages/outbound/worksheet-batch-picking.js +39 -5
  47. package/client/pages/outbound/worksheet-packing.js +17 -4
  48. package/client/pages/outbound/worksheet-picking.js +45 -6
  49. package/client/pages/report/inbound-serial-number-report.js +86 -9
  50. package/client/pages/report/inventory-report.js +10 -0
  51. package/client/pages/report/inventory-summary-report.js +28 -19
  52. package/client/pages/report/outbound-order-details-report.js +204 -43
  53. package/client/pages/report/outbound-serial-number-report.js +87 -9
  54. package/client/pages/report/release-inventory-report.js +503 -0
  55. package/client/route.js +5 -0
  56. package/client/util/index.js +2 -0
  57. package/client/util/page-settings.js +43 -0
  58. package/client/util/toast.js +10 -0
  59. package/dist-server/graphql/resolvers/board-setting/board-settings.js +3 -3
  60. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  61. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js +2 -2
  62. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js.map +1 -1
  63. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js +1 -1
  64. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js.map +1 -1
  65. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js +2 -2
  66. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js.map +1 -1
  67. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +9 -10
  68. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  69. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +2 -2
  70. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
  71. package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js +6 -4
  72. package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js.map +1 -1
  73. package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js +6 -4
  74. package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js.map +1 -1
  75. package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js +21 -10
  76. package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js.map +1 -1
  77. package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js +1 -2
  78. package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js.map +1 -1
  79. package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js +1 -2
  80. package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js.map +1 -1
  81. package/dist-server/graphql/resolvers/dashboard/index.js +2 -1
  82. package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
  83. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +17 -1
  84. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
  85. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +113 -75
  86. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  87. package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js +21 -10
  88. package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js.map +1 -1
  89. package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js +56 -0
  90. package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js.map +1 -0
  91. package/dist-server/graphql/resolvers/index.js +5 -4
  92. package/dist-server/graphql/resolvers/index.js.map +1 -1
  93. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -1
  94. package/dist-server/graphql/resolvers/opa-menu/opa-menus.js +8 -7
  95. package/dist-server/graphql/resolvers/opa-menu/opa-menus.js.map +1 -1
  96. package/dist-server/graphql/resolvers/{extra → other}/add-release-good-products.js +59 -8
  97. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -0
  98. package/dist-server/graphql/resolvers/{extra → other}/index.js +3 -1
  99. package/dist-server/graphql/resolvers/other/index.js.map +1 -0
  100. package/dist-server/graphql/resolvers/other/page-settings.js +87 -0
  101. package/dist-server/graphql/resolvers/other/page-settings.js.map +1 -0
  102. package/dist-server/graphql/resolvers/reports/costing-report.js +4 -4
  103. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  104. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +3 -3
  105. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  106. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +36 -7
  107. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
  108. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  109. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  110. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +69 -30
  111. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  112. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +36 -11
  113. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
  114. package/dist-server/graphql/resolvers/reports/product-label-report.js +3 -3
  115. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  116. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
  117. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
  118. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +2 -2
  119. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -1
  120. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +1 -1
  121. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -1
  122. package/dist-server/graphql/types/dashboard/index.js +1 -0
  123. package/dist-server/graphql/types/dashboard/index.js.map +1 -1
  124. package/dist-server/graphql/types/index.js +7 -2
  125. package/dist-server/graphql/types/index.js.map +1 -1
  126. package/dist-server/graphql/types/other/index.js +19 -0
  127. package/dist-server/graphql/types/other/index.js.map +1 -0
  128. package/dist-server/graphql/types/other/page-setting.js +34 -0
  129. package/dist-server/graphql/types/other/page-setting.js.map +1 -0
  130. package/dist-server/graphql/types/reports/index.js +6 -1
  131. package/dist-server/graphql/types/reports/index.js.map +1 -1
  132. package/dist-server/graphql/types/reports/outbound-order-details-report.js +17 -1
  133. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  134. package/dist-server/graphql/types/reports/release-inventory-report-list.js +12 -0
  135. package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
  136. package/dist-server/graphql/types/reports/release-inventory-report.js +27 -0
  137. package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
  138. package/dist-server/migrations/1568858861188-SeedSetting.js +5 -6
  139. package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
  140. package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js +1 -1
  141. package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js.map +1 -1
  142. package/dist-server/migrations/1623381200659-SeedStoringRule.js +1 -1
  143. package/dist-server/migrations/1623381200659-SeedStoringRule.js.map +1 -1
  144. package/dist-server/tsconfig.tsbuildinfo +1 -1
  145. package/dist-server/utils/report-query-util.js +5 -2
  146. package/dist-server/utils/report-query-util.js.map +1 -1
  147. package/helps/release-note.ko.md +8 -20
  148. package/helps/release-note.md +8 -20
  149. package/helps/release-note.ms.md +8 -20
  150. package/helps/release-note.zh.md +8 -20
  151. package/package.json +42 -42
  152. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -6
  153. package/server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.ts +4 -5
  154. package/server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.ts +9 -10
  155. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.ts +4 -5
  156. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +17 -19
  157. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +10 -8
  158. package/server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.ts +9 -9
  159. package/server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.ts +9 -9
  160. package/server/graphql/resolvers/dashboard/arrival-notices-by-status.ts +23 -14
  161. package/server/graphql/resolvers/dashboard/collection-orders-by-status.ts +4 -5
  162. package/server/graphql/resolvers/dashboard/delivery-orders-by-status.ts +4 -5
  163. package/server/graphql/resolvers/dashboard/index.ts +3 -1
  164. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +18 -6
  165. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +114 -81
  166. package/server/graphql/resolvers/dashboard/release-goods-by-status.ts +23 -14
  167. package/server/graphql/resolvers/dashboard/unit-inbounded-outbounded.ts +61 -0
  168. package/server/graphql/resolvers/index.ts +5 -4
  169. package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +11 -9
  170. package/server/graphql/resolvers/opa-menu/opa-menus.ts +7 -6
  171. package/server/graphql/resolvers/{extra → other}/add-release-good-products.ts +73 -12
  172. package/server/graphql/resolvers/other/index.ts +10 -0
  173. package/server/graphql/resolvers/other/page-settings.ts +105 -0
  174. package/server/graphql/resolvers/reports/costing-report.ts +8 -10
  175. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +7 -9
  176. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +41 -13
  177. package/server/graphql/resolvers/reports/index.ts +3 -1
  178. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +76 -38
  179. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +42 -18
  180. package/server/graphql/resolvers/reports/product-label-report.ts +4 -6
  181. package/server/graphql/resolvers/reports/release-inventory-report.ts +201 -0
  182. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +3 -5
  183. package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +10 -10
  184. package/server/graphql/types/dashboard/index.ts +1 -0
  185. package/server/graphql/types/index.ts +8 -2
  186. package/server/graphql/types/other/index.ts +19 -0
  187. package/server/graphql/types/other/page-setting.ts +33 -0
  188. package/server/graphql/types/reports/index.ts +6 -1
  189. package/server/graphql/types/reports/outbound-order-details-report.ts +17 -1
  190. package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
  191. package/server/graphql/types/reports/release-inventory-report.ts +23 -0
  192. package/server/migrations/1568858861188-SeedSetting.ts +4 -4
  193. package/server/migrations/1623308919899-SeedLocationRecommendSetting.ts +3 -2
  194. package/server/migrations/1623381200659-SeedStoringRule.ts +3 -2
  195. package/server/utils/report-query-util.ts +5 -2
  196. package/things-factory.config.js +4 -0
  197. package/translations/en.json +148 -27
  198. package/translations/ko.json +185 -105
  199. package/translations/ms.json +183 -98
  200. package/translations/zh.json +197 -112
  201. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +0 -1
  202. package/dist-server/graphql/resolvers/extra/index.js.map +0 -1
  203. package/dist-server/graphql/types/extra/index.js +0 -11
  204. package/dist-server/graphql/types/extra/index.js.map +0 -1
  205. package/server/graphql/resolvers/extra/index.ts +0 -5
  206. package/server/graphql/types/extra/index.ts +0 -7
@@ -1,14 +1,17 @@
1
1
  import '@things-factory/biz-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import '@things-factory/import-ui'
4
+ import '@things-factory/component-ui'
5
+
4
6
  import '../../components/vas-templates'
5
7
  import '../../order/vas-order/popup/vas-create-popup'
8
+ import '../../components/select-inventory-popup'
6
9
 
7
10
  import gql from 'graphql-tag'
8
11
  import { css, html } from 'lit-element'
9
12
 
10
13
  import { getCodeByName } from '@things-factory/code-base'
11
- import { MultiColumnFormStyles } from '@things-factory/form-ui'
14
+ import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
12
15
  import { i18next, localize } from '@things-factory/i18n-base'
13
16
  import { openPopup } from '@things-factory/layout-base'
14
17
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
@@ -75,13 +78,54 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
75
78
  _packingOption: Boolean,
76
79
  _disableTransport: Boolean,
77
80
  _enableTransportationServiceSetting: Boolean,
78
- _vasExpanded: Boolean
81
+ _vasExpanded: Boolean,
82
+ _selectedCP: String,
83
+
84
+ /* Shipping Form Field */
85
+ _contactPointId: String,
86
+ _contactPointName: String,
87
+ _companyName: String,
88
+ _attentionTo: String,
89
+ _deliveryPostCode: Array,
90
+ _deliveryState: String,
91
+ _deliveryCity: String,
92
+ _deliveryContact: String,
93
+ _deliveryFullAddress: String,
94
+ _selectedPostCode: String,
95
+ _selectedDeliveryCountry: String,
96
+ _selectedBillingCountry: String,
97
+ _billingCountry: String,
98
+ _billingPostCode: Array,
99
+ _billingState: String,
100
+ _billingCity: String,
101
+ _billingContact: String,
102
+ _billingFullAddress: String,
103
+ _selectedBillingPostCode: String,
104
+ _switchDeliveryCountryInput: Boolean,
105
+ _switchBillingCountryInput: Boolean,
106
+ _allCountry: Array,
107
+ _containerClosureDate: Date,
108
+ _recallToggle: Boolean,
109
+ _savedStrategy: String,
110
+
111
+ // Export Form Field
112
+ containerSizes: Array,
113
+
114
+ // refractor
115
+ _contactPointInfo: Object,
116
+
117
+ /* Tab Toggle*/
118
+ _showReleasedOrderInfo: Boolean,
119
+ _showShippingInfo: Boolean,
120
+ _disableBillingAddress: Boolean,
121
+ _showExportInfo: Boolean
79
122
  }
80
123
  }
81
124
 
82
125
  static get styles() {
83
126
  return [
84
127
  MultiColumnFormStyles,
128
+ SingleColumnFormStyles,
85
129
  css`
86
130
  :host {
87
131
  display: flex;
@@ -92,7 +136,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
92
136
  flex: 1;
93
137
  display: flex;
94
138
  overflow-y: auto;
95
- min-height: 50vh;
96
139
  }
97
140
  .picking-std-container {
98
141
  margin-top: 0px;
@@ -107,6 +150,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
107
150
  margin-right: 20px;
108
151
  padding-left: 0;
109
152
  }
153
+ [title] {
154
+ margin-top: -5px;
155
+ margin-bottom: -5px;
156
+ }
110
157
  [attachment-wrap] {
111
158
  display: flex;
112
159
  flex-direction: row;
@@ -168,6 +215,11 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
168
215
  grid-auto-rows: minmax(24px, auto);
169
216
  }
170
217
 
218
+ .label-remindContainerDeparture {
219
+ margin-left: 20px;
220
+ width: 50%;
221
+ }
222
+
171
223
  .vas[collapsable] {
172
224
  height: 40%;
173
225
  }
@@ -203,6 +255,25 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
203
255
  width: 6%;
204
256
  }
205
257
  }
258
+
259
+ .section-header {
260
+ grid-column: span 36 / auto !important;
261
+ text-align: left !important;
262
+ margin-top: 10px !important;
263
+ font-weight: 600 !important;
264
+ }
265
+ .quick-find-content-container {
266
+ margin: 0 15px;
267
+ }
268
+
269
+ @media screen and (max-width: 480px) {
270
+ .section-header {
271
+ grid-column: span 12 / auto !important;
272
+ }
273
+ .quick-find-content-container {
274
+ margin: 0;
275
+ }
276
+ }
206
277
  `
207
278
  ]
208
279
  }
@@ -231,8 +302,36 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
231
302
  }
232
303
 
233
304
  render() {
305
+ const RELEASE_ORDER_TABS = {
306
+ RELEASE_ORDER_INFO: i18next.t('label.order'),
307
+ SHIPPING_INFO: i18next.t('label.shipment'),
308
+ EXPORT_INFO: i18next.t('label.export')
309
+ }
310
+
311
+ const orderSet = {
312
+ [RELEASE_ORDER_TABS.RELEASE_ORDER_INFO]: {},
313
+ [RELEASE_ORDER_TABS.SHIPPING_INFO]: {},
314
+ [RELEASE_ORDER_TABS.EXPORT_INFO]: {}
315
+ }
316
+
317
+ const disabledKey = {
318
+ export: this._exportOption
319
+ }
320
+
234
321
  return html`
235
- <form name="releaseOrder" class="multi-column-form" autocomplete="off">
322
+ <div class="quick-find-content-container" >
323
+ <quick-find-content
324
+ id="order-items-list"
325
+ name="quickFindContent"
326
+ .data="${orderSet}"
327
+ .disabledKey="${disabledKey}"
328
+ @tabChanged="${e => {
329
+ this._tabChange(e.detail.currentTabKey)
330
+ }}"
331
+ ></quick-find-content>
332
+ </div>
333
+
334
+ <form name="releaseOrder" class="multi-column-form" autocomplete="off" ?hidden="${this._showReleasedOrderInfo}">
236
335
  <fieldset>
237
336
  <legend>${i18next.t('title.release_order')}</legend>
238
337
 
@@ -306,6 +405,26 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
306
405
  />
307
406
  <label for="exportOption" ?hidden="${!this._checkTransport}">${i18next.t('label.export')}</label>
308
407
 
408
+
409
+ <input
410
+ id="recall"
411
+ type="checkbox"
412
+ ?hidden="${!this._checkTransport}"
413
+ @change="${async e => {
414
+ this._recallToggle = e.currentTarget.checked
415
+
416
+ if (e.currentTarget.checked) {
417
+ this.selectByPalletInput.checked = true
418
+ this.selectByProductInput.checked = false
419
+ this._pickingStd = PICKING_STANDARD.SELECT_BY_PALLET.value
420
+ }
421
+ await this.switchPickingType()
422
+ await this.fetchCountry()
423
+ }}"
424
+ name="recall"
425
+ />
426
+ <label for="recall" ?hidden="${!this._checkTransport}">${i18next.t('label.recall')}</label>
427
+
309
428
  <input
310
429
  id="packingOption"
311
430
  type="checkbox"
@@ -398,50 +517,192 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
398
517
  </fieldset>
399
518
  </form>
400
519
 
401
- ${
402
- this._exportOption
403
- ? html`
404
- <div class="so-form-container">
405
- <form name="shippingOrder" class="multi-column-form" autocomplete="off">
406
- <fieldset>
407
- <legend>${i18next.t('title.export_order')}</legend>
408
- <label>${i18next.t('label.container_no')}</label>
409
- <input name="containerNo" required .value="${this.containerNo}" />
410
-
411
- <label>${i18next.t('label.container_arrival_date')}</label>
412
- <input
413
- name="containerArrivalDate"
414
- type="date"
415
- min="${this._getStdDate()}"
416
- .value="${this.containerArrivalDate}"
417
- required
418
- @change="${e => {
419
- this._conLeavingDateInput.setAttribute('min', e.currentTarget.value)
420
- }}"
421
- />
422
520
 
423
- <label>${i18next.t('label.container_leaving_date')}</label>
424
- <input
425
- name="containerLeavingDate"
426
- type="date"
427
- min="${this._getStdDate()}"
428
- .value="${this.containerLeavingDate}"
429
- required
430
- @change="${e => {
431
- this._containerArrivalDateInput.setAttribute('max', e.currentTarget.value)
432
- }}"
433
- />
521
+ <form name="shippingInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
522
+ <legend>${i18next.t('title.shipping_information')}</legend>
523
+ <label>${i18next.t('label.company')}</label>
524
+ <input name="attentionCompany" required .value="${this._companyName}" />
434
525
 
435
- <label>${i18next.t('label.ship_name')}</label>
436
- <input name="shipName" required .value="${this.shipName}" />
437
- </fieldset>
438
- </form>
439
- </div>
440
- `
441
- : ''
442
- }
526
+ <label>${i18next.t('label.attention_to')}</label>
527
+ <input name="attentionTo" required .value="${this._attentionTo}" />
528
+
529
+ <button type="button" @click="${this._openContactPointSelector.bind(this)}">import</button>
530
+
531
+ <!-- delivery -->
532
+ <label class="section-header">${i18next.t('label.delivery_address')}</label>
533
+
534
+ <label>${i18next.t('label.country')}</label>
535
+ <select
536
+ name="country"
537
+ @change=${e => {
538
+ this._validateCountry(e)
539
+ }}
540
+ >
541
+ ${this._allCountry?.map((country, key) => html`<option value=${country.name}>${country.name}</option>`)}
542
+ </select>
543
+
544
+
545
+ <label>${i18next.t('label.zip_postal_code')}</label>
546
+
547
+ ${
548
+ this._switchDeliveryCountryInput
549
+ ? html` <input name="postalCode" required .value="" /> `
550
+ : html`<select
551
+ name="postalCode"
552
+ @change=${e => {
553
+ this._getStateAndCityByPostCode(e.target.value, e.target.name)
554
+ }}
555
+ >
556
+ <option value=""></option>
557
+ ${this._deliveryPostCode?.map(
558
+ (country, key) =>
559
+ html`<option value=${country.postalCode} ?selected=${this._selectedPostCode === country.postalCode}>
560
+ ${country.postalCode}
561
+ </option>`
562
+ )}
563
+ </select>`
564
+ }
565
+
566
+
567
+ <label>${i18next.t('label.state')}</label>
568
+ <input name="state" required .value="${this._deliveryState}" />
569
+
570
+ <label>${i18next.t('label.city')}</label>
571
+ <input name="city" required .value="${this._deliveryCity}" />
572
+
573
+ <label>${i18next.t('label.delivery_address')}</label>
574
+ <textarea name="deliveryAddress1" required .value="${this._deliveryFullAddress}"></textarea>
575
+
576
+ <label>${i18next.t('label.contact')}</label>
577
+ <input name="phone1" required .value="${this._deliveryContact}" />
578
+
579
+
580
+ <!-- billing -->
581
+ <label class="section-header">${i18next.t('label.billing_address')}</label>
582
+
583
+ <label>${i18next.t('label.country')}</label>
584
+ <select
585
+ name="billingCountry"
586
+ ?disabled=${this._disableBillingAddress ? true : false}
587
+ @change=${e => {
588
+ this._validateBillingCountry(e)
589
+ }}
590
+ >
591
+ ${this._allCountry?.map((country, key) => html`<option value=${country.name}>${country.name}</option>`)}
592
+ </select>
593
+
594
+ <label>${i18next.t('label.zip_postal_code')}</label>
595
+
596
+ ${
597
+ this._switchBillingCountryInput
598
+ ? html`
599
+ <input
600
+ ?disabled=${this._disableBillingAddress ? true : false}
601
+ name="billingPostalCode"
602
+ required
603
+ .value=""
604
+ />
605
+ `
606
+ : html`<select
607
+ ?disabled=${this._disableBillingAddress ? true : false}
608
+ name="billingPostalCode"
609
+ @change=${e => {
610
+ this._getStateAndCityByPostCode(e.target.value, e.target.name)
611
+ }}
612
+ >
613
+ <option value=${this._selectedBillingPostCode ? this._selectedBillingPostCode : ''} selected>
614
+ ${this._selectedBillingPostCode ? this._selectedBillingPostCode : ''}
615
+ </option>
616
+ ${this._billingPostCode?.map(
617
+ (country, key) => html`<option value=${country.postalCode}>${country.postalCode}</option>`
618
+ )}
619
+ </select>`
620
+ }
621
+
622
+ <label>${i18next.t('label.state')}</label>
623
+ <input ?disabled=${this._disableBillingAddress ? true : false} name="billingState" required
624
+ .value="${this._billingState}" />
625
+
626
+ <label>${i18next.t('label.city')}</label>
627
+ <input ?disabled=${this._disableBillingAddress ? true : false} name="billingCity" required
628
+ .value="${this._billingCity}" />
629
+
630
+ <label>${i18next.t('label.billing_address')}</label>
631
+ <textarea ?disabled=${this._disableBillingAddress ? true : false} name="billingAddress" required
632
+ .value="${this._billingFullAddress}"></textarea>
633
+
634
+ <input type="checkbox" id="matchDeliveryAddress" name="matchDeliveryAddressInput" @click=${e => {
635
+ e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
636
+ }} />
637
+ <label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
638
+
639
+
640
+ </form>
641
+
642
+ <form name="exportInfo" ?hidden="${this._showExportInfo}" class="multi-column-form" autocomplete="off">
643
+ <legend>${i18next.t('title.export_information')}</legend>
644
+
645
+ <label>${i18next.t('label.container_size')}</label>
646
+ <select name="containerSize" required>
647
+ <option value="">--${i18next.t('label.please_select_a_container_size')}--</option>
648
+ ${(this.containerSizes || []).map(
649
+ containerSize =>
650
+ html`
651
+ <option value="${containerSize && containerSize.name}">${containerSize && containerSize.name}</option>
652
+ `
653
+ )}
654
+ </select>
655
+
656
+ <label>${i18next.t('label.container_no')}</label>
657
+ <input name="containerNo" required />
658
+
659
+
660
+ <label>${i18next.t('label.container_arrival_date')}</label>
661
+ <input
662
+ name="containerArrivalDate"
663
+ type="date"
664
+ .value="${this._containerArrivalDate}"
665
+ @change="${e => {
666
+ this._containerClosureDateInput.setAttribute('min', e.currentTarget.value)
667
+ }}"
668
+ required
669
+ />
670
+
671
+ <label>${i18next.t('label.container_departure_date')}</label>
672
+ <input
673
+ name="containerLeavingDate"
674
+ type="date"
675
+ .value="${this._containerArrivalDate}"
676
+ @change="${e => {
677
+ this._containerArrivalDateInput.setAttribute('max', e.currentTarget.value)
678
+ }}"
679
+
680
+ />
681
+
682
+
683
+ <label>${i18next.t('label.container_closure_date')}</label>
684
+ <input
685
+ name="containerClosureDate"
686
+ type="date"
687
+ .value="${this._containerClosureDate}"
688
+ @change="${e => {
689
+ this._containerClosureDate = e.currentTarget.value
690
+ this._containerArrivalDateInput.setAttribute('max', e.currentTarget.value)
691
+ }}"
692
+
693
+ />
694
+
695
+ <label>${i18next.t('label.ship_name')}</label>
696
+ <input name="shipName" />
443
697
 
444
- <form class="picking-std-container multi-column-form">
698
+ <label>${i18next.t('label.export_remark')}</label>
699
+ <input name="exportRemark" />
700
+
701
+ </form>
702
+
703
+ <form class="picking-std-container multi-column-form" ?hidden="${
704
+ !this._showShippingInfo || !this._showExportInfo
705
+ }">
445
706
  <fieldset>
446
707
  <legend>${i18next.t('title.inventory_selection_strategy')}</legend>
447
708
  <input
@@ -449,8 +710,27 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
449
710
  name="picking-std"
450
711
  type="radio"
451
712
  value="${PICKING_STANDARD.SELECT_BY_PRODUCT.value}"
452
- @change="${e => {
453
- this._pickingStd = e.currentTarget.value
713
+ ?disabled="${this._recallInput?.checked}"
714
+ @change="${async e => {
715
+ const value = e.currentTarget.value
716
+
717
+ if (this.inventoryGrist.dirtyData.records.length > 0) {
718
+ const result = await CustomAlert({
719
+ title: i18next.t('title.are_you_sure'),
720
+ text: i18next.t('text.do_you_wish_to_proceed_the_selected_products_will_be_removed'),
721
+ confirmButton: { text: i18next.t('button.proceed') },
722
+ cancelButton: { text: i18next.t('button.cancel') }
723
+ })
724
+
725
+ if (!result.value) {
726
+ this._pickingStd = PICKING_STANDARD.SELECT_BY_PALLET.value
727
+ this.selectByPalletInput.checked = true
728
+ } else {
729
+ this._pickingStd = value
730
+ }
731
+ } else {
732
+ this._pickingStd = value
733
+ }
454
734
  }}"
455
735
  .checked="${this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value}"
456
736
  checked
@@ -466,10 +746,28 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
466
746
  name="picking-std"
467
747
  type="radio"
468
748
  value="${PICKING_STANDARD.SELECT_BY_PALLET.value}"
469
- @change="${e => {
470
- this._pickingStd = e.currentTarget.value
749
+ @change="${async e => {
750
+ const value = e.currentTarget.value
751
+ if (this.inventoryGrist.dirtyData.records.length > 0) {
752
+ const result = await CustomAlert({
753
+ title: i18next.t('title.are_you_sure'),
754
+ text: i18next.t('text.do_you_wish_to_proceed_the_selected_products_will_be_removed'),
755
+ confirmButton: { text: i18next.t('button.proceed') },
756
+ cancelButton: { text: i18next.t('button.cancel') }
757
+ })
758
+
759
+ if (!result.value) {
760
+ this._pickingStd = PICKING_STANDARD.SELECT_BY_PRODUCT.value
761
+ this.selectByProductInput.checked = true
762
+ } else {
763
+ this._pickingStd = value
764
+ }
765
+ } else {
766
+ this._pickingStd = value
767
+ }
471
768
  }}"
472
- .checked="${this._pickingStd === PICKING_STANDARD.SELECT_BY_PALLET.value && !this._crossDocking}"
769
+ .checked="${(this._pickingStd === PICKING_STANDARD.SELECT_BY_PALLET.value && !this._crossDocking) ||
770
+ this._recallToggle}"
473
771
  />
474
772
  <label for="pick-by-pallet">${i18next.t(PICKING_STANDARD.SELECT_BY_PALLET.name)}</label>
475
773
  `
@@ -535,26 +833,70 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
535
833
  return this.shadowRoot.querySelector('form[name=releaseOrder]')
536
834
  }
537
835
 
836
+ get shippingInfoForm() {
837
+ return this.shadowRoot.querySelector('form[name=shippingInfo]')
838
+ }
839
+
840
+ get getDeliveryAddressInfoForm() {
841
+ return this.shadowRoot.querySelector('form[name=deliveryAddressInfo]')
842
+ }
843
+
844
+ get getBillingAddressInfoForm() {
845
+ return this.shadowRoot.querySelector('form[name=billingAddressInfo]')
846
+ }
847
+
538
848
  get _containerArrivalDateInput() {
539
849
  return this.shadowRoot.querySelector('input[name=containerArrivalDate]')
540
850
  }
541
851
 
852
+ get _containerClosureDateInput() {
853
+ return this.shadowRoot.querySelector('input[name=containerClosureDate]')
854
+ }
855
+
542
856
  get _conLeavingDateInput() {
543
- return this.shadowRoot.querySelector('input[name=containerLeavingDate]')
857
+ return this.shadowRoot.querySelector('input[name=containerClosureDate]')
544
858
  }
545
859
 
546
860
  get shippingOrderForm() {
547
861
  return this.shadowRoot.querySelector('form[name=shippingOrder]')
548
862
  }
549
863
 
864
+ get exportInfoForm() {
865
+ return this.shadowRoot.querySelector('form[name=exportInfo]')
866
+ }
867
+
550
868
  get _ownTransportInput() {
551
869
  return this.shadowRoot.querySelector('input[name=ownTransport]')
552
870
  }
553
871
 
872
+ get _cityInput() {
873
+ return this.shadowRoot.querySelector('input[name=city]')
874
+ }
875
+
876
+ get _stateInput() {
877
+ return this.shadowRoot.querySelector('input[name=state]')
878
+ }
879
+
880
+ get _recallInput() {
881
+ return this.shadowRoot.querySelector('input[name=recall]')
882
+ }
883
+
884
+ get _cityBillingInput() {
885
+ return this.shadowRoot.querySelector('input[id=billingCity]')
886
+ }
887
+
888
+ get _stateBillingInput() {
889
+ return this.shadowRoot.querySelector('input[name=billingState]')
890
+ }
891
+
554
892
  get _warehouseTransportInput() {
555
893
  return this.shadowRoot.querySelector('input[name=warehouseTransport]')
556
894
  }
557
895
 
896
+ get _getBillingPostalCodeInput() {
897
+ return this.shadowRoot.querySelector('select[name=billingPostalCode]')
898
+ }
899
+
558
900
  get _exportOptionInput() {
559
901
  return this.shadowRoot.querySelector('input[name=exportOption]')
560
902
  }
@@ -583,13 +925,31 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
583
925
  return this.shadowRoot.querySelector('input[name=bizplaceName]')
584
926
  }
585
927
 
928
+ get selectByProductInput() {
929
+ return this.shadowRoot.querySelector('input[id=pick-by-prod]')
930
+ }
931
+
932
+ get selectByPalletInput() {
933
+ return this.shadowRoot.querySelector('input[id=pick-by-pallet]')
934
+ }
935
+
936
+ get matchDeliveryAddressInput() {
937
+ return this.shadowRoot?.querySelector('input[name=matchDeliveryAddressInput]')
938
+ }
939
+
586
940
  get _inventoryColumns() {
587
941
  return this.inventoryGrist.columns
588
942
  }
589
943
 
944
+ get quickFindContent() {
945
+ return this.shadowRoot?.querySelector('quick-find-content[name=quickFindContent]')
946
+ }
947
+
590
948
  constructor() {
591
949
  super()
592
950
  this.initProperties()
951
+ this._getAllPostCode()
952
+ this.fetchCountry()
593
953
  this._pickingStd = PICKING_STANDARD.SELECT_BY_PRODUCT.value
594
954
  this._bundleSettingData = []
595
955
  this._vasExpanded = false
@@ -648,6 +1008,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
648
1008
  getCodeByName('PACKING_TYPES')
649
1009
  ])
650
1010
 
1011
+ this.containerSizes = await getCodeByName('CONTAINER_SIZES')
1012
+
1013
+ this.quickFindContent.currentTabKey = i18next.t('label.order')
1014
+ this._disableBillingAddress = false
651
1015
  this._enableTransportationServiceSetting = enableTransportationServiceSetting
652
1016
  this._bizplaces = bizplaces
653
1017
  this.packingTypes = packingTypes
@@ -800,6 +1164,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
800
1164
  this.releaseDate = ''
801
1165
  this.collectionOrderNo = ''
802
1166
  this._files = []
1167
+ this._allCountry = []
803
1168
  this.containerNo = ''
804
1169
  this.containerArrivalDate = ''
805
1170
  this.containerLeavingDate = ''
@@ -807,15 +1172,44 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
807
1172
  this.inventoryData = { ...this.inventoryData, records: [] }
808
1173
  this.vasData = { ...this.vasData, records: [] }
809
1174
  this.bundleData = { ...this.bundleData, records: [] }
1175
+ this._showReleasedOrderInfo = false
1176
+ this._showShippingInfo = true
1177
+ this._attentionTo = ''
1178
+ this._companyName = ''
1179
+ this._deliveryState = ''
1180
+ this._deliveryCity = ''
1181
+ this._deliveryFullAddress = ''
1182
+ this._deliveryContact = ''
1183
+ this._billingState = ''
1184
+ this._billingCity = ''
1185
+ this._billingFullAddress = ''
1186
+ this._billingContact = ''
1187
+ this._switchDeliveryCountryInput = false
1188
+ this._switchBillingCountryInput = false
1189
+ this._disableBillingAddress = false
1190
+ this._showExportInfo = true
1191
+ this._selectedDeliveryCountry = 'MALAYSIA'
1192
+ this._selectedBillingCountry = 'MALAYSIA'
1193
+ this.containerSizes = []
1194
+ this._containerClosureDate = ''
1195
+ this._recallToggle = false
810
1196
  }
811
1197
 
812
1198
  resetPage() {
813
1199
  this._selectedVasRecord = null
814
1200
  this._selectedVasRecordIdx = null
815
1201
  this.bundleData = {}
1202
+ this.matchDeliveryAddressInput.checked = false
1203
+ this.quickFindContent.currentTabKey = i18next.t('label.order')
1204
+
816
1205
  this.initProperties()
817
1206
  this._clearGristConditions()
818
1207
  this._validateTransport()
1208
+ this._getAllPostCode()
1209
+
1210
+ if (this._exportOptionInput.checked === true && this._recallInput.checked === false) {
1211
+ this._exportOption = true
1212
+ }
819
1213
  }
820
1214
 
821
1215
  async switchPickingType() {
@@ -824,7 +1218,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
824
1218
  this.inventoryGristConfig = {
825
1219
  pagination: { infinite: true },
826
1220
  rows: {
827
- selectable: { multiple: false },
1221
+ selectable: { multiple: true },
828
1222
  classifier: (record, rowIndex) => {
829
1223
  return {
830
1224
  emphasized: record.isCrossDocking || record.isError
@@ -863,76 +1257,18 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
863
1257
  }
864
1258
  }
865
1259
  },
1260
+
866
1261
  {
867
- type: 'object',
868
- name: 'inventory',
1262
+ type: 'string',
1263
+ name: 'productName',
869
1264
  header: i18next.t('field.inventory_list'),
870
- imex: {
871
- header: i18next.t('field.inventory_list'),
872
- key: 'inventory.name',
873
- width: 50,
874
- type: 'array',
875
- arrData: []
876
- },
877
- record: {
878
- editable: !!this._bizplaceId,
879
- options: {
880
- queryName: 'inventoryProductGroup',
881
- basicArgs: {
882
- filters: [{ name: 'bizplace_id', operator: 'eq', value: this._bizplaceId }]
883
- },
884
- nameField: 'batchId',
885
- descriptionField: 'productName',
886
- select: [
887
- { name: 'productId', hidden: true },
888
- { name: 'remainUomValue', hidden: true },
889
- { name: 'batchId', header: i18next.t('field.batch_id') },
890
- { name: 'batchIdRef', header: i18next.t('field.batch_no_ref') },
891
- {
892
- name: 'productSKU',
893
- header: i18next.t('field.sku'),
894
- width: 150
895
- },
896
- {
897
- name: 'productName',
898
- header: i18next.t('field.product_info'),
899
- width: 280
900
- },
901
- { name: 'productBrand', header: i18next.t('field.brand') },
902
- { name: 'packingType', header: i18next.t('field.packing_type') },
903
- { name: 'packingSize', header: i18next.t('field.packing_size') },
904
- { name: 'uom', header: i18next.t('field.uom') },
905
- {
906
- name: 'remainQty',
907
- header: i18next.t('field.remain_qty'),
908
- ignoreCondition: true
909
- },
910
- {
911
- name: 'remainUomValueWithUom',
912
- header: i18next.t('field.remain_uom_value'),
913
- ignoreCondition: true
914
- },
915
- {
916
- name: 'groupType',
917
- header: i18next.t('field.group_type'),
918
- ignoreCondition: true
919
- }
920
- ],
921
- list: {
922
- fields: [
923
- 'batchId',
924
- 'batchIdRef',
925
- 'productName',
926
- 'productBrand',
927
- 'packingType',
928
- 'remainQty',
929
- 'remainUomValue',
930
- 'groupType'
931
- ]
932
- }
1265
+ imex: { header: i18next.t('field.inventory_list'), key: 'productName', width: 50, type: 'string' },
1266
+ handlers: {
1267
+ click: (columns, data, column, record, rowIndex) => {
1268
+ this._openBulkProductSelection('product', rowIndex)
933
1269
  }
934
1270
  },
935
- width: 250
1271
+ width: 350
936
1272
  },
937
1273
  {
938
1274
  type: 'string',
@@ -1005,6 +1341,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1005
1341
  }
1006
1342
  } else {
1007
1343
  const locationSortingRules = await fetchLocationSortingRule(LOCATION_SORTING_RULE.CREATE_RELEASE_ORDER.value)
1344
+
1345
+ const recall = this._recallInput.checked
1346
+
1008
1347
  this.inventoryGristConfig = {
1009
1348
  pagination: { infinite: true },
1010
1349
  rows: {
@@ -1032,68 +1371,16 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1032
1371
  }
1033
1372
  },
1034
1373
  {
1035
- type: 'object',
1036
- name: 'inventory',
1374
+ type: 'string',
1375
+ name: 'productName',
1037
1376
  header: i18next.t('field.inventory_list'),
1038
- record: {
1039
- editable: !!this._bizplaceId,
1040
- options: {
1041
- queryName: 'inventoriesByPallet',
1042
- basicArgs: {
1043
- filters: [
1044
- { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value },
1045
- { name: 'bizplace', operator: 'in', value: [this._bizplaceId] }
1046
- ],
1047
- locationSortingRules
1048
- },
1049
- nameField: 'batchId',
1050
- descriptionField: 'palletId',
1051
- select: [
1052
- { name: 'id', hidden: true },
1053
- { name: 'name', hidden: true },
1054
- { name: 'remainUomValue', hidden: true },
1055
- { name: 'product', type: 'object', hidden: true },
1056
- { name: 'palletId', header: i18next.t('field.lot_id') },
1057
- { name: 'productSKU', header: i18next.t('field.sku') },
1058
- { name: 'productName', header: i18next.t('field.product_info') },
1059
- { name: 'productBrand', header: i18next.t('field.brand') },
1060
- { name: 'batchId', header: i18next.t('field.batch_id') },
1061
- {
1062
- name: 'location',
1063
- type: 'object',
1064
- queryName: 'locations',
1065
- field: 'name'
1066
- },
1067
- { name: 'packingType', header: i18next.t('field.packing_type') },
1068
- { name: 'packingSize', header: i18next.t('field.packing_size') },
1069
- { name: 'uom', header: i18next.t('field.uom') },
1070
- { name: 'remainQty', type: 'float', header: i18next.t('field.remain_qty') },
1071
- {
1072
- name: 'remainUomValueWithUom',
1073
- type: 'string',
1074
- header: i18next.t('field.total_uom_value')
1075
- },
1076
- { name: 'batchIdRef', header: i18next.t('field.batch_no_ref') },
1077
- {
1078
- name: 'remark',
1079
- type: 'string',
1080
- header: i18next.t('field.remark')
1081
- }
1082
- ],
1083
- list: {
1084
- fields: [
1085
- 'palletId',
1086
- 'productName',
1087
- 'productBrand',
1088
- 'batchId',
1089
- 'location',
1090
- 'remainUomValue',
1091
- 'batchIdRef'
1092
- ]
1093
- }
1377
+ imex: { header: i18next.t('field.inventory_list'), key: 'productName', width: 50, type: 'string' },
1378
+ handlers: {
1379
+ click: (columns, data, column, record, rowIndex) => {
1380
+ this._openBulkProductSelection('pallet', rowIndex)
1094
1381
  }
1095
1382
  },
1096
- width: 250
1383
+ width: 350
1097
1384
  },
1098
1385
  {
1099
1386
  type: 'string',
@@ -1114,7 +1401,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1114
1401
  width: 100
1115
1402
  },
1116
1403
  {
1117
- type: 'object',
1404
+ type: 'string',
1118
1405
  name: 'location',
1119
1406
  header: i18next.t('field.location'),
1120
1407
  width: 150
@@ -1171,72 +1458,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1171
1458
  }
1172
1459
  }
1173
1460
 
1174
- // _openBulkProductSelection() {
1175
- // if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
1176
- // let filters = [
1177
- // {
1178
- // name: 'bizplace_id',
1179
- // operator: 'eq',
1180
- // value: this._bizplaceId
1181
- // }
1182
- // ]
1183
-
1184
- // const response = await client.query({
1185
- // query: gql`
1186
- // query inventoryProductGroup($filters: [Filter]) {
1187
- // inventoryProductGroup(filters: $filters) {
1188
- // items {
1189
- // productId
1190
- // productSKU
1191
- // productName
1192
- // batchId
1193
- // packingType
1194
- // remainQty
1195
- // remainWeight
1196
- // remainUomValue
1197
- // }
1198
- // total
1199
- // }
1200
- // }
1201
- // `,
1202
- // variables: { filters }
1203
- // })
1204
-
1205
- // if (!response.errors) {
1206
- // }
1207
- // } else {
1208
- // let filters = [
1209
- // {
1210
- // name: 'bizplace_id',
1211
- // operator: 'eq',
1212
- // value: this._bizplaceId
1213
- // },
1214
- // { name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value }
1215
- // ]
1216
-
1217
- // const response = await client.query({
1218
- // query: gql`
1219
- // query inventoryProductGroup($filters: [Filter]) {
1220
- // inventoryProductGroup(filters: $filters) {
1221
- // items {
1222
- // productId
1223
- // productSKU
1224
- // productName
1225
- // batchId
1226
- // packingType
1227
- // remainQty
1228
- // remainWeight
1229
- // remainUomValue
1230
- // }
1231
- // total
1232
- // }
1233
- // }
1234
- // `,
1235
- // variables: { filters }
1236
- // })
1237
- // }
1238
- // }
1239
-
1240
1461
  _getStdDate() {
1241
1462
  let date = new Date()
1242
1463
  date.setDate(date.getDate())
@@ -1513,6 +1734,26 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1513
1734
  }
1514
1735
  }
1515
1736
 
1737
+ async fetchCountry() {
1738
+ const response = await client.query({
1739
+ query: gql`
1740
+ query geoCountriesWithoutParam {
1741
+ geoCountriesWithoutParam {
1742
+ items {
1743
+ id
1744
+ name
1745
+ description
1746
+ }
1747
+ }
1748
+ }
1749
+ `
1750
+ })
1751
+
1752
+ if (!response.error) {
1753
+ this._allCountry = response.data.geoCountriesWithoutParam.items
1754
+ }
1755
+ }
1756
+
1516
1757
  async fetchInventoriesByBundle(productBundleId, bundleReleaseQty) {
1517
1758
  const page = 1
1518
1759
  const limit = 99999
@@ -1603,6 +1844,25 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1603
1844
  this._validateInventories()
1604
1845
  this._validateVas()
1605
1846
 
1847
+ let shippingOrderInfo = {}
1848
+
1849
+ let contactPointInfo = this._serializeForm(this.shippingInfoForm)
1850
+
1851
+ shippingOrderInfo = {
1852
+ ...contactPointInfo
1853
+ }
1854
+
1855
+ delete shippingOrderInfo['']
1856
+ delete shippingOrderInfo.matchDeliveryAddressInput
1857
+
1858
+ // If match delivery address is ticked, all the billing address info will be the same with delivery address info
1859
+ if (this._disableBillingAddress) {
1860
+ shippingOrderInfo.billingAddress = shippingOrderInfo.deliveryAddress1
1861
+ shippingOrderInfo.billingPostalCode = shippingOrderInfo.postalCode
1862
+ shippingOrderInfo.billingCity = shippingOrderInfo.city
1863
+ shippingOrderInfo.billingState = shippingOrderInfo.state
1864
+ }
1865
+
1606
1866
  let result = await CustomAlert({
1607
1867
  title: i18next.t('title.are_you_sure'),
1608
1868
  text: i18next.t('text.create_release_order'),
@@ -1630,18 +1890,25 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1630
1890
  releaseGood.orderVass = this._getOrderVass()
1631
1891
  releaseGood.ownTransport = this._ownTransport
1632
1892
  releaseGood.type = RO_TYPES.B2B.value
1893
+ releaseGood.orderMethod = this._pickingStd
1633
1894
 
1634
1895
  delete releaseGood.bizplaceId
1635
1896
  delete releaseGood.bizplaceName
1636
1897
 
1637
1898
  const response = await client.mutate({
1638
1899
  mutation: gql`
1639
- mutation generateReleaseGood(
1900
+ mutation (
1640
1901
  $releaseGood: NewReleaseGood
1641
1902
  $shippingOrder: ShippingOrderPatch
1903
+ $shippingOrderInfo: ShippingOrderInfoPatch
1642
1904
  $attachments: [Upload!]
1643
1905
  ) {
1644
- generateReleaseGood(releaseGood: $releaseGood, shippingOrder: $shippingOrder, attachments: $attachments) {
1906
+ generateReleaseGood(
1907
+ releaseGood: $releaseGood
1908
+ shippingOrder: $shippingOrder
1909
+ shippingOrderInfo: $shippingOrderInfo
1910
+ attachments: $attachments
1911
+ ) {
1645
1912
  id
1646
1913
  name
1647
1914
  }
@@ -1652,7 +1919,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1652
1919
  ...releaseGood,
1653
1920
  partnerBizplaceId: this._bizplaceId
1654
1921
  },
1655
- shippingOrder: this._exportOption ? this._serializeForm(this.shippingOrderForm) : null,
1922
+ shippingOrder: this._exportOption ? this._serializeForm(this.exportInfoForm) : null,
1923
+ shippingOrderInfo: shippingOrderInfo ? shippingOrderInfo : null,
1656
1924
  attachments: this._document?.files ? this._document.files : undefined
1657
1925
  },
1658
1926
  context: { hasUpload: true }
@@ -1660,6 +1928,14 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1660
1928
 
1661
1929
  if (!response.errors) {
1662
1930
  this.resetPage()
1931
+ this._resetShippingInfoForm()
1932
+ this._resetExportInfoForm()
1933
+ this._deliveryPostCode = []
1934
+ this._billingPostCode = []
1935
+ this._selectedPostCode = ''
1936
+ this._selectedBillingPostCode = ''
1937
+ this._recallInput.checked = false
1938
+
1663
1939
  navigate(`release_order_detail/${response.data.generateReleaseGood.name}`)
1664
1940
  this._showToast({ message: i18next.t('text.release_order_created') })
1665
1941
  } else {
@@ -1740,6 +2016,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1740
2016
  throw new Error(i18next.t('text.shipping_order_form_invalid'))
1741
2017
  }
1742
2018
 
2019
+ if (this._exportOption && !this.exportInfoForm.checkValidity()) {
2020
+ throw new Error(i18next.t('text.export_form_is_invalid'))
2021
+ }
2022
+
1743
2023
  if (this._ownTransport && this._warehouseTransport) {
1744
2024
  throw new Error(i18next.t('text.you_can_only_select_one_transport_type'))
1745
2025
  } else if (!this._ownTransport && !this._warehouseTransport) {
@@ -1780,6 +2060,52 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1780
2060
  if (!this.vasGrist.dirtyData.records.every(record => record.ready)) throw new Error('there_is_not_ready_vas')
1781
2061
  }
1782
2062
 
2063
+ _openBulkProductSelection(type, rowIndex) {
2064
+ if (this._bizplaceId) {
2065
+ openPopup(
2066
+ html`
2067
+ <select-inventory-popup
2068
+ .bizplaceId="${this._bizplaceId}"
2069
+ .selectMultipleProducts="${true}"
2070
+ .switchTypePane="${type}"
2071
+ .inventoryData="${this.inventoryGrist.dirtyData.records}"
2072
+ .recall="${this._recallInput.checked}"
2073
+ @selected="${e => {
2074
+ let newRecords = []
2075
+ for (let i = 0; i < e.detail.multipleProducts.length; i++) {
2076
+ newRecords.push(e.detail.multipleProducts[i])
2077
+ }
2078
+
2079
+ if (newRecords.length > 1) {
2080
+ this.inventoryData = {
2081
+ ...this.inventoryData,
2082
+ records: [...this.inventoryGrist.dirtyData.records, ...newRecords]
2083
+ }
2084
+ } else {
2085
+ // update existing inventory data records
2086
+ this.inventoryGrist.dirtyData.records.splice(rowIndex, 1, {
2087
+ ...this.inventoryGrist.dirtyData.records[rowIndex],
2088
+ ...newRecords[0]
2089
+ })
2090
+ this.inventoryData = {
2091
+ ...this.inventoryData,
2092
+ records: [...this.inventoryGrist.dirtyData.records]
2093
+ }
2094
+ }
2095
+ }}"
2096
+ ></select-inventory-popup>
2097
+ `,
2098
+ {
2099
+ backdrop: true,
2100
+ size: 'large',
2101
+ title: i18next.t('title.select_item')
2102
+ }
2103
+ )
2104
+ } else {
2105
+ this._showToast({ message: i18next.t('text.company_selection_is_empty') })
2106
+ }
2107
+ }
2108
+
1783
2109
  _updateInventoryGristConfig() {
1784
2110
  if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
1785
2111
  const _selectedInv = (this.inventoryGrist.dirtyData.records || [])
@@ -2002,8 +2328,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2002
2328
  }
2003
2329
  } else {
2004
2330
  newRecord.product = {
2005
- id: record.inventory.product.id,
2006
- name: record.inventory.product.name
2331
+ id: record.inventory.productId || record.inventory.product.id,
2332
+ name: record.inventory.productName || record.inventory.product.name
2007
2333
  }
2008
2334
  newRecord.inventory = { id: record.id }
2009
2335
  }
@@ -2078,9 +2404,105 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2078
2404
  .flat()
2079
2405
  }
2080
2406
 
2407
+ _validateCountry(e) {
2408
+ if (e.target.value != 'MALAYSIA') {
2409
+ this._switchDeliveryCountryInput = true
2410
+ } else {
2411
+ this._switchDeliveryCountryInput = false
2412
+ }
2413
+ }
2414
+
2415
+ _validateBillingCountry(e) {
2416
+ if (e.target.value != 'MALAYSIA') {
2417
+ this._switchBillingCountryInput = true
2418
+ this._selectedBillingCountry = e.target.value
2419
+ } else {
2420
+ this._switchBillingCountryInput = false
2421
+ this._selectedBillingCountry = e.target.value
2422
+ }
2423
+ }
2424
+
2425
+ async _getAllPostCode() {
2426
+ try {
2427
+ const response = await client.query({
2428
+ query: gql`
2429
+ query geoAreasAllPostCode {
2430
+ geoAreasAllPostCode {
2431
+ items {
2432
+ postalCode
2433
+ }
2434
+ total
2435
+ }
2436
+ }
2437
+ `
2438
+ })
2439
+
2440
+ if (!response.errors) {
2441
+ const items = response.data.geoAreasAllPostCode.items
2442
+ this._deliveryPostCode = items
2443
+ this._billingPostCode = items
2444
+ }
2445
+ } catch (e) {
2446
+ this._showToast(e)
2447
+ }
2448
+ }
2449
+
2450
+ async _getStateAndCityByPostCode(value, name) {
2451
+ const postCode = value
2452
+
2453
+ // If user select the first empty postal code, the city and state will change to empty
2454
+ if (postCode == '') {
2455
+ if (name == 'postalCode') {
2456
+ this._cityInput.value = ''
2457
+ this._stateInput.value = ''
2458
+ return
2459
+ } else if (name == 'billingPostalCode') {
2460
+ this._cityBillingInput.value = ''
2461
+ this._stateBillingInput.value = ''
2462
+ return
2463
+ }
2464
+ }
2465
+
2466
+ try {
2467
+ const response = await client.query({
2468
+ query: gql`
2469
+ query geoAreasGetStateAndCityByPosCode($postCode: String!) {
2470
+ geoAreasGetStateAndCityByPosCode(postCode: $postCode) {
2471
+ stateName
2472
+ cityName
2473
+ }
2474
+ }
2475
+ `,
2476
+ variables: {
2477
+ postCode
2478
+ }
2479
+ })
2480
+
2481
+ if (!response.errors) {
2482
+ const { stateName, cityName } = response.data.geoAreasGetStateAndCityByPosCode
2483
+
2484
+ switch (name) {
2485
+ case 'postalCode':
2486
+ this._cityInput.value = stateName
2487
+ this._stateInput.value = cityName.toUpperCase()
2488
+ break
2489
+
2490
+ case 'billingPostalCode':
2491
+ this._cityBillingInput.value = stateName
2492
+ this._stateBillingInput.value = cityName.toUpperCase()
2493
+
2494
+ default:
2495
+ break
2496
+ }
2497
+ }
2498
+ } catch (error) {
2499
+ this._showToast(e)
2500
+ }
2501
+ }
2502
+
2081
2503
  _serializeForm(form) {
2082
2504
  let obj = {}
2083
- Array.from(form.querySelectorAll('input, select')).forEach(field => {
2505
+ Array.from(form.querySelectorAll('input, select,textarea')).forEach(field => {
2084
2506
  if (!field.hasAttribute('hidden') && field.value) {
2085
2507
  obj[field.name] = field.type === 'checkbox' ? field.checked : field.value
2086
2508
  }
@@ -2258,6 +2680,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2258
2680
  this._bizplaceId = e.detail.id
2259
2681
  this._bizplaceName = e.detail.name
2260
2682
  this.switchPickingType()
2683
+ // this._resetShippingInfoForm()
2684
+ this.fetchCountry()
2261
2685
  }}"
2262
2686
  ></popup-partner-bizplaces-selector>
2263
2687
  `,
@@ -2269,6 +2693,24 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2269
2693
  )
2270
2694
  }
2271
2695
 
2696
+ _openContactPointSelector() {
2697
+ openPopup(
2698
+ html`
2699
+ <contact-points-popup
2700
+ @selected="${e => {
2701
+ this._fillUpDeliveryInfo(e.detail)
2702
+ }}"
2703
+ .partnerBizplaceIds="${this._bizplaces.map(itm => itm.id)}"
2704
+ ></contact-points-popup>
2705
+ `,
2706
+ {
2707
+ backdrop: true,
2708
+ size: 'large',
2709
+ title: i18next.t('title.select_destination')
2710
+ }
2711
+ )
2712
+ }
2713
+
2272
2714
  async bulkUploadValidateWarehousePartnersProductsQuantity(orderInventories) {
2273
2715
  const response = await client.query({
2274
2716
  query: gql`
@@ -2466,6 +2908,76 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2466
2908
  }
2467
2909
  }
2468
2910
 
2911
+ async _tabChange(key) {
2912
+ if (key == 'order') {
2913
+ this._showReleasedOrderInfo = false
2914
+ this._showShippingInfo = true
2915
+ this._showExportInfo = true
2916
+ } else if (key == 'shipment') {
2917
+ this._showReleasedOrderInfo = true
2918
+ this._showShippingInfo = false
2919
+ this._showExportInfo = true
2920
+ } else {
2921
+ this.containerSizes = await getCodeByName('CONTAINER_SIZES')
2922
+
2923
+ this._showReleasedOrderInfo = true
2924
+ this._showShippingInfo = true
2925
+ this._showExportInfo = false
2926
+ }
2927
+ }
2928
+
2929
+ _fillUpDeliveryInfo(data) {
2930
+ // remapping according release good table
2931
+ const remapData = {
2932
+ attentionCompany: data.companyName || '',
2933
+ attentionTo: data.name || '',
2934
+ city: data.city || '',
2935
+ state: data.state || '',
2936
+ postalCode: data.postCode || '',
2937
+ country: 'Malaysia',
2938
+ phone1: data.phone || '',
2939
+ deliveryAddress1: data.address ? data.address : '' + data.address2 ? data.address2 : '',
2940
+ billingAddress: data.billingAddress
2941
+ }
2942
+
2943
+ this._selectedPostCode = data.postCode
2944
+
2945
+ this._fillupForm(this.shippingInfoForm, remapData)
2946
+ }
2947
+
2948
+ _resetShippingInfoForm() {
2949
+ this.shippingInfoForm.reset()
2950
+ }
2951
+
2952
+ _resetExportInfoForm() {
2953
+ this.exportInfoForm.reset()
2954
+ this._containerClosureDate = ''
2955
+ }
2956
+
2957
+ _fillupForm(form, data) {
2958
+ if (form) {
2959
+ form.reset()
2960
+ for (let key in data) {
2961
+ Array.from(form.querySelectorAll('input, textarea', 'select')).forEach(field => {
2962
+ if (field.name === key && field.type === 'checkbox') {
2963
+ field.checked = data[key]
2964
+ } else if (field.name === key && field.type === 'datetime-local') {
2965
+ const datetime = Number(data[key])
2966
+ const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
2967
+ field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
2968
+ } else if (field.name === key) {
2969
+ if (data[key] instanceof Object) {
2970
+ const objectData = data[key]
2971
+ field.value = `${objectData.name} ${objectData.description ? `(${objectData.description})` : ''}`
2972
+ } else {
2973
+ field.value = data[key]
2974
+ }
2975
+ }
2976
+ })
2977
+ }
2978
+ }
2979
+ }
2980
+
2469
2981
  _showToast({ type, message }) {
2470
2982
  document.dispatchEvent(
2471
2983
  new CustomEvent('notify', {