@things-factory/operato-wms 4.3.767 → 4.3.770

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 (46) hide show
  1. package/client/pages/bulk-operation/validate-gan-popup.js +2 -2
  2. package/client/pages/components/list-view/product-list-view.js +28 -3
  3. package/client/pages/components/mobile-condition-of-goods-listing.js +342 -0
  4. package/client/pages/components/unloading-worksheet-information-popup.js +299 -0
  5. package/client/pages/constants/order.js +7 -0
  6. package/client/pages/inbound/condition-of-goods-popup.js +646 -0
  7. package/client/pages/inbound/putaway/putaway-product.js +35 -6
  8. package/client/pages/inbound/unload-product-landing-page.js +282 -0
  9. package/client/pages/inbound/unload-product.js +707 -175
  10. package/client/pages/inbound/unloaded-inventories-popup.js +3 -0
  11. package/client/pages/inventory/inventory-adjustment-approval.js +28 -1
  12. package/client/pages/inventory/inventory-adjustment.js +77 -44
  13. package/client/pages/inventory/inventory-by-product-detail.js +15 -0
  14. package/client/pages/inventory/inventory-history.js +18 -0
  15. package/client/pages/inventory/onhand-inventory.js +14 -0
  16. package/client/pages/order/arrival-notice/create-arrival-notice.js +209 -206
  17. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +132 -129
  18. package/client/pages/order/arrival-notice/edit-product-popup.js +97 -92
  19. package/client/pages/order/release-order/b2b/b2b-order-list.js +99 -0
  20. package/client/pages/order/release-order/packing-label-history-popup.js +378 -0
  21. package/client/pages/order/release-order/preview-print-packing-list.js +533 -0
  22. package/client/pages/order/release-order/print-quantity-popup.js +118 -0
  23. package/client/pages/outbound/loading-v2/loading-execution-base.js +29 -0
  24. package/client/pages/outbound/loading-v2/loading-execution.js +579 -2
  25. package/client/pages/outbound/loading-v2/loading-package-info-popup.js +182 -0
  26. package/client/pages/outbound/loading-v2/loading.js +18 -0
  27. package/client/pages/report/inbound-order-details-report.js +26 -1
  28. package/client/route.js +17 -0
  29. package/dist-server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.js +9 -1
  30. package/dist-server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.js.map +1 -1
  31. package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js +11 -5
  32. package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js.map +1 -1
  33. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -1
  34. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  35. package/dist-server/graphql/types/reports/inbound-order-details-report.js +1 -0
  36. package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +1 -1
  37. package/package.json +15 -15
  38. package/server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.ts +9 -1
  39. package/server/graphql/resolvers/outbound/loading-worksheet-v2.ts +13 -1
  40. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -1
  41. package/server/graphql/types/reports/inbound-order-details-report.ts +1 -0
  42. package/things-factory.config.js +8 -0
  43. package/translations/en.json +45 -1
  44. package/translations/ko.json +40 -0
  45. package/translations/ms.json +40 -0
  46. package/translations/zh.json +40 -0
@@ -0,0 +1,299 @@
1
+ import { css, html, LitElement } from 'lit-element'
2
+ import { connect } from 'pwa-helpers/connect-mixin'
3
+
4
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
5
+ import { i18next, localize } from '@things-factory/i18n-base'
6
+ import { store } from '@things-factory/shell'
7
+ import { CONDITION_OF_GOODS } from '../constants'
8
+
9
+ class UnloadingWorksheetInformationPopup extends connect(store)(localize(i18next)(LitElement)) {
10
+ static get properties() {
11
+ return {
12
+ worksheetInformation: Object,
13
+ unloadedInventories: Array,
14
+ orderProductData: Array
15
+ }
16
+ }
17
+
18
+ static get styles() {
19
+ return [
20
+ MultiColumnFormStyles,
21
+ css`
22
+ :host {
23
+ padding: 0 10px 10px 10px;
24
+ display: flex;
25
+ flex-direction: column;
26
+ overflow-x: overlay;
27
+ background-color: var(--main-section-background-color);
28
+ }
29
+
30
+ .info-section {
31
+ border-bottom: 1px solid #017E7F;
32
+ padding-bottom: 8px;
33
+ }
34
+
35
+ .info-row {
36
+ display: flex;
37
+ flex-direction: row;
38
+ align-items: center;
39
+ padding: 2px 0;
40
+ }
41
+
42
+ .info-row:last-child {
43
+ border-bottom: none;
44
+ }
45
+
46
+ .info-label {
47
+ font-weight: bold;
48
+ min-width: 150px;
49
+ color: #3a5877;
50
+ text-transform: capitalize;
51
+ font-size: 16px;
52
+ }
53
+
54
+ .info-value {
55
+ flex: 1;
56
+ color: #3a5877;
57
+ font-size: 16px;
58
+ }
59
+
60
+ .issues-section {
61
+ margin-top: 10px;
62
+ }
63
+
64
+ .issues-header {
65
+ font-weight: bold;
66
+ font-size: 22px;
67
+ color: #3a5877;
68
+ margin-bottom: 10px;
69
+ }
70
+
71
+ .issue-item {
72
+ padding: 8px 0;
73
+ border-bottom: 1px solid #D9D9D9;
74
+ }
75
+
76
+ .issue-field {
77
+ display: flex;
78
+ flex-direction: row;
79
+ margin-bottom: 4px;
80
+ }
81
+
82
+ .issue-field-label {
83
+ font-weight: bold;
84
+ min-width: 120px;
85
+ color: #3a5877;
86
+ issue-field-labe
87
+ }
88
+
89
+ .issue-field-value {
90
+ flex: 1;
91
+ color: #3a5877;
92
+ issue-field-labe
93
+ }
94
+
95
+ .issue-field.sku-field .issue-field-label,
96
+ .issue-field.sku-field .issue-field-value {
97
+ color: #007E7F;
98
+ }
99
+ `
100
+ ]
101
+ }
102
+
103
+ firstUpdated() {
104
+ if (this.worksheetInformation) {
105
+ this._processData(this.worksheetInformation)
106
+ }
107
+ }
108
+
109
+ updated(changedProperties) {
110
+ if (changedProperties.has('worksheetInformation') && this.worksheetInformation) {
111
+ this._processData(this.worksheetInformation)
112
+ }
113
+ }
114
+
115
+ _processData(data) {
116
+ this._processedData = {}
117
+
118
+ for (let key in data) {
119
+ const value = data[key]
120
+
121
+ if (key === 'startedAt' && value) {
122
+ const datetime = Number(value)
123
+ const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
124
+ const localDate = new Date(datetime - timezoneOffset)
125
+
126
+ // Format as DD/MM/YYYY, HH:MM:SS AM/PM
127
+ const day = String(localDate.getDate()).padStart(2, '0')
128
+ const month = String(localDate.getMonth() + 1).padStart(2, '0')
129
+ const year = localDate.getFullYear()
130
+ const hours = localDate.getHours()
131
+ const minutes = String(localDate.getMinutes()).padStart(2, '0')
132
+ const seconds = String(localDate.getSeconds()).padStart(2, '0')
133
+
134
+ const ampm = hours >= 12 ? 'PM' : 'AM'
135
+ const displayHours = hours % 12 || 12
136
+
137
+ this._processedData[key] = `${day}/${month}/${year}, ${displayHours}:${minutes}:${seconds} ${ampm}`
138
+ } else if (value instanceof Object && !Array.isArray(value)) {
139
+ const objectData = value
140
+ this._processedData[key] = `${objectData.name || ''} ${objectData.description ? `(${objectData.description})` : ''}`.trim()
141
+ } else {
142
+ this._processedData[key] = value
143
+ }
144
+ }
145
+
146
+ this.requestUpdate()
147
+ }
148
+
149
+ _getValue(key) {
150
+ if (!this._processedData) return ''
151
+ return this._processedData[key] || ''
152
+ }
153
+
154
+ _getIssues() {
155
+ if (!this.unloadedInventories || !Array.isArray(this.unloadedInventories)) {
156
+ return []
157
+ }
158
+
159
+ const orderProductMap = new Map()
160
+ if (this.orderProductData && Array.isArray(this.orderProductData)) {
161
+ this.orderProductData.forEach(op => {
162
+ const key = `${op.sku || ''}_${op.batchId || ''}_${op.packingType || ''}_${op.packingSize || ''}`
163
+ orderProductMap.set(key, op)
164
+ })
165
+ }
166
+ console.log("orderProductMap: ", orderProductMap)
167
+
168
+ const badInventories = this.unloadedInventories.filter(
169
+ inventory => inventory.conditionOfGoods && inventory.conditionOfGoods !== CONDITION_OF_GOODS.GOOD.value
170
+ )
171
+ console.log("badInventories: ", badInventories)
172
+
173
+ const issueMap = new Map()
174
+
175
+ badInventories.forEach(inventory => {
176
+ const sku = inventory.product?.sku || ''
177
+ const conditionType = inventory.conditionOfGoods
178
+
179
+ if (sku && conditionType) {
180
+ const orderProductKey = `${sku}_${inventory.batchId || ''}_${inventory.packingType || ''}_${inventory.packingSize || ''}`
181
+ const key = `${orderProductKey}_${conditionType}`
182
+
183
+ if (!issueMap.has(key)) {
184
+ const matchingOrderProduct = orderProductMap.get(orderProductKey)
185
+ const issue = matchingOrderProduct?.issue || ''
186
+
187
+ issueMap.set(key, {
188
+ sku: sku,
189
+ productName: inventory.product?.name || '',
190
+ conditionOfGoods: conditionType,
191
+ issue: issue
192
+ })
193
+ }
194
+ }
195
+ })
196
+
197
+ console.log(issueMap.values())
198
+
199
+ return Array.from(issueMap.values())
200
+ }
201
+
202
+ _formatConditionType(conditionValue) {
203
+ if (!conditionValue) return '-'
204
+
205
+ const conditionKey = Object.keys(CONDITION_OF_GOODS).find(
206
+ key => CONDITION_OF_GOODS[key].value === conditionValue
207
+ )
208
+
209
+ if (conditionKey) {
210
+ return i18next.t(`label.${CONDITION_OF_GOODS[conditionKey].name}`)
211
+ }
212
+
213
+ return conditionValue
214
+ }
215
+
216
+ render() {
217
+ const issues = this._getIssues()
218
+ const uniqueSkuCount = issues.length
219
+ return html`
220
+ <div class="info-section">
221
+ <div class="info-row">
222
+ <div class="info-label">${i18next.t('label.company')}</div>
223
+ <div class="info-value">${this._getValue('bizplaceName')}</div>
224
+ </div>
225
+ <div class="info-row">
226
+ <div class="info-label">${i18next.t('label.container_no')}</div>
227
+ <div class="info-value">${this._getValue('containerNo')}</div>
228
+ </div>
229
+ <div class="info-row">
230
+ <div class="info-label">${i18next.t('label.ref_no')}</div>
231
+ <div class="info-value">${this._getValue('refNo')}</div>
232
+ </div>
233
+ <div class="info-row">
234
+ <div class="info-label">${i18next.t('label.ref_no_2')}</div>
235
+ <div class="info-value">${this._getValue('refNo2')}</div>
236
+ </div>
237
+ <div class="info-row">
238
+ <div class="info-label">${i18next.t('label.ref_no_3')}</div>
239
+ <div class="info-value">${this._getValue('refNo3')}</div>
240
+ </div>
241
+ <div class="info-row">
242
+ <div class="info-label">${i18next.t('label.shipping_provider')}</div>
243
+ <div class="info-value">${this._getValue('shippingProvider')}</div>
244
+ </div>
245
+ <div class="info-row">
246
+ <div class="info-label">${i18next.t('label.tracking_no')}</div>
247
+ <div class="info-value">${this._getValue('trackingNo')}</div>
248
+ </div>
249
+ <div class="info-row">
250
+ <div class="info-label">${i18next.t('label.status')}</div>
251
+ <div class="info-value">${this._getValue('marketplaceStatus')}</div>
252
+ </div>
253
+ <div class="info-row">
254
+ <div class="info-label">${i18next.t('label.staging_area')}</div>
255
+ <div class="info-value">${this._getValue('bufferLocation')}</div>
256
+ </div>
257
+ <div class="info-row">
258
+ <div class="info-label">${i18next.t('label.started_at')}</div>
259
+ <div class="info-value">${this._getValue('startedAt')}</div>
260
+ </div>
261
+ <div class="info-row">
262
+ <div class="info-label">${i18next.t('label.reusable_pallet_id')}</div>
263
+ <div class="info-value">${this._getValue('plasticPallet')}</div>
264
+ </div>
265
+ </div>
266
+
267
+ ${uniqueSkuCount > 0
268
+ ? html`
269
+ <div class="issues-section">
270
+ <div class="issues-header">Total Issues: ${uniqueSkuCount}</div>
271
+ ${issues.map(issue => html`
272
+ <div class="issue-item">
273
+ <div class="issue-field sku-field">
274
+ <div class="issue-field-label">SKU No.</div>
275
+ <div class="issue-field-value">${issue.sku || '-'}</div>
276
+ </div>
277
+ <div class="issue-field">
278
+ <div class="issue-field-label">Product Name</div>
279
+ <div class="issue-field-value">${issue.productName || '-'}</div>
280
+ </div>
281
+ <div class="issue-field">
282
+ <div class="issue-field-label">Type of issue</div>
283
+ <div class="issue-field-value">${this._formatConditionType(issue.conditionOfGoods)}</div>
284
+ </div>
285
+ <div class="issue-field">
286
+ <div class="issue-field-label">Details</div>
287
+ <div class="issue-field-value">${issue.issue || '-'}</div>
288
+ </div>
289
+ </div>
290
+ `)}
291
+ </div>
292
+ `
293
+ : html``}
294
+ `
295
+ }
296
+ }
297
+
298
+ window.customElements.define('unloading-worksheet-information-popup', UnloadingWorksheetInformationPopup)
299
+
@@ -205,3 +205,10 @@ export const INVENTORY_CHECK_ITEM_STATUS = {
205
205
  PENDING_CANCEL: { name: 'inventory_status_pending_cancel', value: 'PENDING_CANCEL' },
206
206
  DONE: { name: 'inventory_status_done', value: 'DONE' }
207
207
  }
208
+
209
+ export const CONDITION_OF_GOODS = {
210
+ GOOD: { name: 'condition_of_goods_good', value: 'GOOD' },
211
+ DEFECT: { name: 'condition_of_goods_defect', value: 'DEFECT' },
212
+ DAMAGED: { name: 'condition_of_goods_damaged', value: 'DAMAGED' },
213
+ QUARANTINE: { name: 'condition_of_goods_quarantine', value: 'QUARANTINE' },
214
+ }