@things-factory/operato-wms 4.3.108 → 4.3.109
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.
- package/client/pages/bulk-operation/bulk-operation.js +15 -9
- package/client/pages/components/select-inventory-popup.js +1 -7
- package/client/pages/components/select-product-popup.js +2 -31
- package/client/pages/inbound/undo-putaway-popup.js +9 -5
- package/client/pages/inbound/undo-unload-popup.js +2 -15
- package/client/pages/inbound/unload-product.js +67 -72
- package/client/pages/inventory/inventory-adjustment-approval.js +5 -4
- package/client/pages/inventory/inventory-adjustment.js +2 -9
- package/client/pages/inventory/inventory-by-product-detail.js +13 -13
- package/client/pages/inventory-check/check-inventory-popup.js +3 -14
- package/client/pages/inventory-check/create-cycle-count.js +3 -2
- package/client/pages/inventory-check/inspecting-product.js +7 -25
- package/client/pages/inventory-check/inventory-check-list.js +10 -94
- package/client/pages/manifest/loading-manifest-detail.js +4 -7
- package/client/pages/master/generate-location-list.js +22 -30
- package/client/pages/master/location-list.js +71 -134
- package/client/pages/master/pallet-list.js +58 -137
- package/client/pages/master/product/product-details-popup.js +3 -3
- package/client/pages/master/tote-list.js +27 -40
- package/client/pages/master/transport-driver.js +41 -50
- package/client/pages/master/transport-vehicle.js +41 -45
- package/client/pages/master/warehouse-list.js +34 -56
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +25 -36
- package/client/pages/order/arrival-notice/create-arrival-notice.js +32 -53
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +0 -2
- package/client/pages/order/arrival-notice/edit-product-popup.js +7 -9
- package/client/pages/order/draft-release-good/draft-release-good-detail.js +4 -79
- package/client/pages/order/release-order/create-release-order.js +5 -22
- package/client/pages/order/release-order/release-extra-product-popup.js +1 -4
- package/client/pages/order/release-order/release-order-detail.js +0 -24
- package/client/pages/order/return-order/create-return-order.js +0 -5
- package/client/pages/order/return-order/return-order-inventory-popup.js +0 -1
- package/client/pages/order/transport-order/delivery-order-list.js +0 -26
- package/client/pages/outbound/inventory-reassign-popup.js +0 -6
- package/client/pages/outbound/packing-product.js +5 -5
- package/client/pages/outbound/packing-worksheet-list.js +1 -3
- package/client/pages/outbound/picking-product.js +7 -18
- package/client/pages/outbound/show-my-worksheet-list-popup.js +3 -12
- package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +2 -5
- package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
- package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +8 -48
- package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +4 -42
- package/client/pages/vas/print-product-label.js +11 -13
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +5 -6
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
- package/dist-server/graphql/resolvers/other/add-release-good-products.js +11 -7
- package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/costing-report.js +24 -18
- package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +6 -5
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
- package/package.json +50 -50
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +5 -6
- package/server/graphql/resolvers/other/add-release-good-products.ts +12 -8
- package/server/graphql/resolvers/reports/costing-report.ts +24 -18
- package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -5
- package/server/graphql/resolvers/reports/release-inventory-report.ts +4 -6
- package/translations/en.json +13 -43
- package/translations/ko.json +11 -33
- package/translations/ms.json +11 -33
- package/translations/zh.json +4 -26
|
@@ -10,7 +10,6 @@ import { openPopup } from '@things-factory/layout-base'
|
|
|
10
10
|
import { client, CustomAlert, PageView } from '@things-factory/shell'
|
|
11
11
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
12
12
|
import { isMobileDevice } from '@things-factory/utils'
|
|
13
|
-
import { showToast } from '../../util/index'
|
|
14
13
|
|
|
15
14
|
class TransportVehicle extends localize(i18next)(PageView) {
|
|
16
15
|
static get styles() {
|
|
@@ -115,7 +114,6 @@ class TransportVehicle extends localize(i18next)(PageView) {
|
|
|
115
114
|
list: {
|
|
116
115
|
fields: ['name', 'description', 'updatedAt']
|
|
117
116
|
},
|
|
118
|
-
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
119
117
|
columns: [
|
|
120
118
|
{ type: 'gutter', gutterName: 'dirty' },
|
|
121
119
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -123,7 +121,7 @@ class TransportVehicle extends localize(i18next)(PageView) {
|
|
|
123
121
|
{
|
|
124
122
|
type: 'string',
|
|
125
123
|
name: 'name',
|
|
126
|
-
header: i18next.t('field.
|
|
124
|
+
header: i18next.t('field.name'),
|
|
127
125
|
record: { editable: true },
|
|
128
126
|
imex: { header: i18next.t('field.name'), key: 'name', width: 50, type: 'string' },
|
|
129
127
|
sortable: true,
|
|
@@ -241,60 +239,47 @@ class TransportVehicle extends localize(i18next)(PageView) {
|
|
|
241
239
|
}
|
|
242
240
|
|
|
243
241
|
async importHandler(patches) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
const response = await client.mutate({
|
|
243
|
+
mutation: gql`
|
|
244
|
+
mutation updateMultipleTransportVehicle($patches: [TransportVehiclePatch!]!) {
|
|
245
|
+
updateMultipleTransportVehicle(patches: $patches) {
|
|
246
|
+
name
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
`,
|
|
250
|
+
variables: { patches }
|
|
251
|
+
})
|
|
247
252
|
|
|
248
|
-
|
|
249
|
-
|
|
253
|
+
if (!response.errors) {
|
|
254
|
+
history.back()
|
|
255
|
+
this.dataGrist.fetch()
|
|
256
|
+
this._showToast({ message: i18next.t('text.data_imported_successfully') })
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async _saveTransportVehicle() {
|
|
261
|
+
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
262
|
+
if (!patches?.length) {
|
|
263
|
+
CustomAlert({
|
|
264
|
+
title: i18next.t('text.nothing_changed'),
|
|
265
|
+
text: i18next.t('text.there_is_nothing_to_save')
|
|
250
266
|
})
|
|
267
|
+
} else {
|
|
251
268
|
const response = await client.mutate({
|
|
252
269
|
mutation: gql`
|
|
253
270
|
mutation updateMultipleTransportVehicle($patches: [TransportVehiclePatch!]!) {
|
|
254
|
-
updateMultipleTransportVehicle(patches: $patches)
|
|
271
|
+
updateMultipleTransportVehicle(patches: $patches) {
|
|
272
|
+
name
|
|
273
|
+
}
|
|
255
274
|
}
|
|
256
275
|
`,
|
|
257
276
|
variables: { patches }
|
|
258
277
|
})
|
|
259
278
|
|
|
260
279
|
if (!response.errors) {
|
|
261
|
-
history.back()
|
|
262
280
|
this.dataGrist.fetch()
|
|
263
|
-
|
|
281
|
+
this._showToast({ message: i18next.t('text.data_updated_successfully') })
|
|
264
282
|
}
|
|
265
|
-
} catch (e) {
|
|
266
|
-
showToast(e)
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
async _saveTransportVehicle() {
|
|
271
|
-
try {
|
|
272
|
-
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
273
|
-
if (!patches?.length) {
|
|
274
|
-
CustomAlert({
|
|
275
|
-
title: i18next.t('text.nothing_changed'),
|
|
276
|
-
text: i18next.t('text.there_is_nothing_to_save')
|
|
277
|
-
})
|
|
278
|
-
} else {
|
|
279
|
-
if (patches.some(p => (!p.name || !p.size || !p.status) && p.cuFlag == '+'))
|
|
280
|
-
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
281
|
-
|
|
282
|
-
const response = await client.mutate({
|
|
283
|
-
mutation: gql`
|
|
284
|
-
mutation updateMultipleTransportVehicle($patches: [TransportVehiclePatch!]!) {
|
|
285
|
-
updateMultipleTransportVehicle(patches: $patches)
|
|
286
|
-
}
|
|
287
|
-
`,
|
|
288
|
-
variables: { patches }
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
if (!response.errors) {
|
|
292
|
-
this.dataGrist.fetch()
|
|
293
|
-
showToast({ message: i18next.t('text.data_updated_successfully') })
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
} catch (e) {
|
|
297
|
-
showToast(e)
|
|
298
283
|
}
|
|
299
284
|
}
|
|
300
285
|
|
|
@@ -327,7 +312,7 @@ class TransportVehicle extends localize(i18next)(PageView) {
|
|
|
327
312
|
|
|
328
313
|
if (!response.errors) {
|
|
329
314
|
this.dataGrist.fetch()
|
|
330
|
-
|
|
315
|
+
this._showToast({ message: i18next.t('text.data_deleted_successfully') })
|
|
331
316
|
}
|
|
332
317
|
}
|
|
333
318
|
}
|
|
@@ -366,6 +351,17 @@ class TransportVehicle extends localize(i18next)(PageView) {
|
|
|
366
351
|
|
|
367
352
|
return { header: headerSetting, data: data }
|
|
368
353
|
}
|
|
354
|
+
|
|
355
|
+
_showToast({ type, message }) {
|
|
356
|
+
document.dispatchEvent(
|
|
357
|
+
new CustomEvent('notify', {
|
|
358
|
+
detail: {
|
|
359
|
+
type,
|
|
360
|
+
message
|
|
361
|
+
}
|
|
362
|
+
})
|
|
363
|
+
)
|
|
364
|
+
}
|
|
369
365
|
}
|
|
370
366
|
|
|
371
367
|
window.customElements.define('transport-vehicle', TransportVehicle)
|
|
@@ -9,7 +9,6 @@ import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
|
|
|
9
9
|
import { isMobileDevice } from '@things-factory/utils'
|
|
10
10
|
import gql from 'graphql-tag'
|
|
11
11
|
import { css, html } from 'lit-element'
|
|
12
|
-
import { showToast } from '../../util'
|
|
13
12
|
|
|
14
13
|
class WarehouseList extends localize(i18next)(PageView) {
|
|
15
14
|
static get styles() {
|
|
@@ -265,14 +264,41 @@ class WarehouseList extends localize(i18next)(PageView) {
|
|
|
265
264
|
}
|
|
266
265
|
|
|
267
266
|
async importHandler(patches) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
const response = await client.query({
|
|
268
|
+
query: gql`
|
|
269
|
+
mutation updateMultipleWarehouse($patches: [WarehousePatch!]!) {
|
|
270
|
+
updateMultipleWarehouse(patches: $patches) {
|
|
271
|
+
name
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
`,
|
|
275
|
+
variables: {
|
|
276
|
+
patches
|
|
271
277
|
}
|
|
272
|
-
|
|
273
|
-
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
if (!response.errors) {
|
|
281
|
+
history.back()
|
|
282
|
+
this.dataGrist.fetch()
|
|
283
|
+
document.dispatchEvent(
|
|
284
|
+
new CustomEvent('notify', {
|
|
285
|
+
detail: {
|
|
286
|
+
message: i18next.t('text.data_imported_successfully')
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async _saveWarehouse() {
|
|
294
|
+
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
295
|
+
if (patches && patches.length) {
|
|
296
|
+
const response = await client.mutate({
|
|
297
|
+
mutation: gql`
|
|
274
298
|
mutation updateMultipleWarehouse($patches: [WarehousePatch!]!) {
|
|
275
|
-
updateMultipleWarehouse(patches: $patches)
|
|
299
|
+
updateMultipleWarehouse(patches: $patches) {
|
|
300
|
+
name
|
|
301
|
+
}
|
|
276
302
|
}
|
|
277
303
|
`,
|
|
278
304
|
variables: {
|
|
@@ -281,58 +307,15 @@ class WarehouseList extends localize(i18next)(PageView) {
|
|
|
281
307
|
})
|
|
282
308
|
|
|
283
309
|
if (!response.errors) {
|
|
284
|
-
history.back()
|
|
285
310
|
this.dataGrist.fetch()
|
|
286
311
|
document.dispatchEvent(
|
|
287
312
|
new CustomEvent('notify', {
|
|
288
313
|
detail: {
|
|
289
|
-
message: i18next.t('text.
|
|
314
|
+
message: i18next.t('text.data_updated_successfully')
|
|
290
315
|
}
|
|
291
316
|
})
|
|
292
317
|
)
|
|
293
318
|
}
|
|
294
|
-
} catch (e) {
|
|
295
|
-
showToast(e)
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
async _saveWarehouse() {
|
|
300
|
-
try {
|
|
301
|
-
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
302
|
-
if (patches.some(p => (!p.name || !p.type) && p.cuFlag == '+')) {
|
|
303
|
-
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (!patches?.length) {
|
|
307
|
-
CustomAlert({
|
|
308
|
-
title: i18next.t('text.nothing_changed'),
|
|
309
|
-
text: i18next.t('text.there_is_nothing_to_save')
|
|
310
|
-
})
|
|
311
|
-
} else {
|
|
312
|
-
const response = await client.mutate({
|
|
313
|
-
mutation: gql`
|
|
314
|
-
mutation updateMultipleWarehouse($patches: [WarehousePatch!]!) {
|
|
315
|
-
updateMultipleWarehouse(patches: $patches)
|
|
316
|
-
}
|
|
317
|
-
`,
|
|
318
|
-
variables: {
|
|
319
|
-
patches
|
|
320
|
-
}
|
|
321
|
-
})
|
|
322
|
-
|
|
323
|
-
if (!response.errors) {
|
|
324
|
-
this.dataGrist.fetch()
|
|
325
|
-
document.dispatchEvent(
|
|
326
|
-
new CustomEvent('notify', {
|
|
327
|
-
detail: {
|
|
328
|
-
message: i18next.t('text.data_updated_successfully')
|
|
329
|
-
}
|
|
330
|
-
})
|
|
331
|
-
)
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
} catch (e) {
|
|
335
|
-
showToast(e)
|
|
336
319
|
}
|
|
337
320
|
}
|
|
338
321
|
|
|
@@ -366,11 +349,6 @@ class WarehouseList extends localize(i18next)(PageView) {
|
|
|
366
349
|
})
|
|
367
350
|
)
|
|
368
351
|
}
|
|
369
|
-
} else {
|
|
370
|
-
CustomAlert({
|
|
371
|
-
title: i18next.t('text.nothing_selected'),
|
|
372
|
-
text: i18next.t('text.there_is_nothing_to_delete')
|
|
373
|
-
})
|
|
374
352
|
}
|
|
375
353
|
}
|
|
376
354
|
}
|
|
@@ -7,7 +7,6 @@ import '../../inbound/pallet-label-popup'
|
|
|
7
7
|
import './edit-product-popup'
|
|
8
8
|
import './proceed-edit-product-popup'
|
|
9
9
|
import './view-product-changes-popup'
|
|
10
|
-
import { BufferLocationSelector } from '@things-factory/warehouse-ui'
|
|
11
10
|
|
|
12
11
|
import gql from 'graphql-tag'
|
|
13
12
|
import { css, html } from 'lit-element'
|
|
@@ -20,6 +19,7 @@ import { openPopup } from '@things-factory/layout-base'
|
|
|
20
19
|
import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
|
|
21
20
|
import { CommonButtonStyles } from '@things-factory/styles'
|
|
22
21
|
import { isMobileDevice } from '@things-factory/utils'
|
|
22
|
+
import { BufferLocationSelector } from '@things-factory/warehouse-ui'
|
|
23
23
|
import { fetchSettingRule } from '../../../fetch-setting-value'
|
|
24
24
|
|
|
25
25
|
import {
|
|
@@ -929,9 +929,6 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
|
|
|
929
929
|
sku
|
|
930
930
|
brand
|
|
931
931
|
}
|
|
932
|
-
productDetail {
|
|
933
|
-
id
|
|
934
|
-
}
|
|
935
932
|
remark
|
|
936
933
|
unitPrice
|
|
937
934
|
adjustedUnitPrice
|
|
@@ -1083,45 +1080,37 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
|
|
|
1083
1080
|
}
|
|
1084
1081
|
|
|
1085
1082
|
async _updateArrivalNotice() {
|
|
1086
|
-
|
|
1087
|
-
const arrivalNoticeInfo = this._getFormInfo()
|
|
1083
|
+
const arrivalNoticeInfo = this._getFormInfo()
|
|
1088
1084
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
throw new Error(i18next.t('text.container_no_is_empty'))
|
|
1085
|
+
arrivalNoticeInfo.name = this._ganNo
|
|
1086
|
+
delete arrivalNoticeInfo.bizplaceName
|
|
1092
1087
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
arrivalNoticeInfo.
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
if (!arrivalNoticeInfo.container) {
|
|
1101
|
-
arrivalNoticeInfo.containerNo = ''
|
|
1102
|
-
arrivalNoticeInfo.containerSize = ''
|
|
1103
|
-
} else if (arrivalNoticeInfo.warehouseTransport) {
|
|
1104
|
-
arrivalNoticeInfo.deliveryOrderNo = ''
|
|
1105
|
-
arrivalNoticeInfo.truckNo = ''
|
|
1106
|
-
}
|
|
1088
|
+
if (!arrivalNoticeInfo.container) {
|
|
1089
|
+
arrivalNoticeInfo.containerNo = ''
|
|
1090
|
+
arrivalNoticeInfo.containerSize = ''
|
|
1091
|
+
} else if (arrivalNoticeInfo.warehouseTransport) {
|
|
1092
|
+
arrivalNoticeInfo.deliveryOrderNo = ''
|
|
1093
|
+
arrivalNoticeInfo.truckNo = ''
|
|
1094
|
+
}
|
|
1107
1095
|
|
|
1108
|
-
|
|
1109
|
-
|
|
1096
|
+
delete arrivalNoticeInfo.warehouseTransport
|
|
1097
|
+
delete arrivalNoticeInfo['buffer-location']
|
|
1110
1098
|
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1099
|
+
if (this._warehouseTransport) {
|
|
1100
|
+
arrivalNoticeInfo.truckNo = ''
|
|
1101
|
+
arrivalNoticeInfo.deliveryOrderNo = ''
|
|
1102
|
+
}
|
|
1115
1103
|
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1104
|
+
const result = await CustomAlert({
|
|
1105
|
+
title: i18next.t('title.are_you_sure'),
|
|
1106
|
+
text: i18next.t('text.update_arrival_notice_details'),
|
|
1107
|
+
confirmButton: { text: i18next.t('button.submit') },
|
|
1108
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
1109
|
+
})
|
|
1122
1110
|
|
|
1123
|
-
|
|
1111
|
+
if (!result.value) return
|
|
1124
1112
|
|
|
1113
|
+
try {
|
|
1125
1114
|
const response = await client.mutate({
|
|
1126
1115
|
mutation: gql`
|
|
1127
1116
|
mutation updateArrivalNoticeDetails($arrivalNotice: ArrivalNoticePatch!) {
|
|
@@ -872,7 +872,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
872
872
|
|
|
873
873
|
if (changedColumn === 'unitPrice') {
|
|
874
874
|
let unitPrice = changeRecord.unitPrice
|
|
875
|
-
if (typeof unitPrice === undefined || unitPrice < 0
|
|
875
|
+
if (typeof unitPrice === undefined || unitPrice < 0) {
|
|
876
876
|
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.unit_price') } }))
|
|
877
877
|
}
|
|
878
878
|
}
|
|
@@ -1210,12 +1210,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1210
1210
|
_validateForm() {
|
|
1211
1211
|
if (!this.arrivalNoticeForm.checkValidity()) throw new Error(i18next.t('text.arrival_notice_form_invalid'))
|
|
1212
1212
|
|
|
1213
|
-
if (this._hasContainer)
|
|
1214
|
-
if (!this.containerNo.value) throw new Error(i18next.t('text.container_no_is_empty'))
|
|
1215
|
-
|
|
1216
|
-
if (!this.arrivalNoticeForm?.containerSize?.value || this.arrivalNoticeForm?.containerSize?.value == '')
|
|
1217
|
-
throw new Error(i18next.t('text.please_select_container_size'))
|
|
1218
|
-
}
|
|
1213
|
+
if (this._hasContainer) if (!this.containerNo.value) throw new Error(i18next.t('text.container_no_is_empty'))
|
|
1219
1214
|
|
|
1220
1215
|
if (this._ownTransport && this._warehouseTransport)
|
|
1221
1216
|
throw new Error(i18next.t('text.you_can_only_select_one_transport_type'))
|
|
@@ -1223,9 +1218,9 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1223
1218
|
throw new Error(i18next.t('text.please_select_transport_type'))
|
|
1224
1219
|
}
|
|
1225
1220
|
|
|
1226
|
-
_validateProducts(
|
|
1221
|
+
_validateProducts() {
|
|
1227
1222
|
// no records
|
|
1228
|
-
|
|
1223
|
+
const records = this.productGrist.dirtyData.records
|
|
1229
1224
|
if (!records?.length) throw new Error(i18next.t('text.no_products'))
|
|
1230
1225
|
|
|
1231
1226
|
this._checkProductDuplication()
|
|
@@ -1238,10 +1233,6 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1238
1233
|
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
1239
1234
|
}
|
|
1240
1235
|
|
|
1241
|
-
if (records.some(({ unitPrice }) => unitPrice < 0)) {
|
|
1242
|
-
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.unit_price') } }))
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
1236
|
if (records.some(({ packQty }) => packQty < 0)) {
|
|
1246
1237
|
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.pack_qty') } }))
|
|
1247
1238
|
}
|
|
@@ -1361,7 +1352,6 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1361
1352
|
batchId: record.batchId,
|
|
1362
1353
|
batchIdRef: record?.batchIdRef ? record.batchIdRef : null,
|
|
1363
1354
|
product: { id: record.product.id },
|
|
1364
|
-
productDetail: record?.productDetail?.id ? record.productDetail : { id: record.productDetailId },
|
|
1365
1355
|
packingType: record.packingType,
|
|
1366
1356
|
packingSize: record.packingSize || record.product.packingSize,
|
|
1367
1357
|
uomValue: record?.uomValue ? record.uomValue : 0,
|
|
@@ -1708,9 +1698,6 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1708
1698
|
primaryUnit
|
|
1709
1699
|
primaryValue
|
|
1710
1700
|
}
|
|
1711
|
-
productDetail {
|
|
1712
|
-
id
|
|
1713
|
-
}
|
|
1714
1701
|
}
|
|
1715
1702
|
}
|
|
1716
1703
|
`,
|
|
@@ -1740,46 +1727,40 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1740
1727
|
}
|
|
1741
1728
|
|
|
1742
1729
|
this.productGrist.fetch()
|
|
1743
|
-
} else {
|
|
1744
|
-
throw response.errors
|
|
1745
1730
|
}
|
|
1746
1731
|
}
|
|
1747
1732
|
|
|
1748
1733
|
async importHandler(patches) {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
delete itm.manufactureDate
|
|
1758
|
-
}
|
|
1759
|
-
itm.uomValue = parseFloat(itm.uomValue) || ''
|
|
1760
|
-
itm.packQty = parseInt(itm.packQty) || ''
|
|
1761
|
-
itm.palletQty = parseInt(itm.palletQty) || ''
|
|
1762
|
-
})
|
|
1763
|
-
|
|
1764
|
-
const orderProducts = patches.map(patch => {
|
|
1765
|
-
delete patch.cuFlag
|
|
1766
|
-
return {
|
|
1767
|
-
...patch,
|
|
1768
|
-
unitPrice: parseFloat(patch.unitPrice) || 0,
|
|
1769
|
-
uomValue: parseFloat(patch.uomValue) || 0,
|
|
1770
|
-
packQty: parseInt(patch.packQty) || 0,
|
|
1771
|
-
palletQty: parseInt(patch.palletQty) || 0
|
|
1772
|
-
}
|
|
1773
|
-
})
|
|
1774
|
-
this.productData = {
|
|
1775
|
-
records: [...patches]
|
|
1734
|
+
patches.map(itm => {
|
|
1735
|
+
itm.unitPrice = parseFloat(itm.unitPrice) || ''
|
|
1736
|
+
if (itm.manufactureDate) {
|
|
1737
|
+
let mdt = new Date(itm.manufactureDate)
|
|
1738
|
+
itm.manufactureDate =
|
|
1739
|
+
mdt < new Date() ? `${mdt.getFullYear()}-${mdt.getMonth() + 1}-${mdt.getDate()}` || '' : ''
|
|
1740
|
+
} else {
|
|
1741
|
+
delete itm.manufactureDate
|
|
1776
1742
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1743
|
+
itm.uomValue = parseFloat(itm.uomValue) || ''
|
|
1744
|
+
itm.packQty = parseFloat(itm.packQty) || ''
|
|
1745
|
+
itm.palletQty = parseFloat(itm.palletQty) || ''
|
|
1746
|
+
})
|
|
1747
|
+
|
|
1748
|
+
this.productData = {
|
|
1749
|
+
records: [...patches]
|
|
1782
1750
|
}
|
|
1751
|
+
|
|
1752
|
+
const orderProducts = patches.map(patch => {
|
|
1753
|
+
delete patch.cuFlag
|
|
1754
|
+
return {
|
|
1755
|
+
...patch,
|
|
1756
|
+
unitPrice: parseFloat(patch.unitPrice) || 0,
|
|
1757
|
+
uomValue: parseFloat(patch.uomValue) || 0,
|
|
1758
|
+
packQty: parseFloat(patch.packQty) || 0,
|
|
1759
|
+
palletQty: parseFloat(patch.palletQty) || 0
|
|
1760
|
+
}
|
|
1761
|
+
})
|
|
1762
|
+
await this.bulkUploadValidateOrderProducts(orderProducts)
|
|
1763
|
+
history.back()
|
|
1783
1764
|
}
|
|
1784
1765
|
|
|
1785
1766
|
async _importableData(records) {
|
|
@@ -1793,8 +1774,6 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1793
1774
|
}
|
|
1794
1775
|
})
|
|
1795
1776
|
|
|
1796
|
-
this._validateProducts(records)
|
|
1797
|
-
|
|
1798
1777
|
openPopup(
|
|
1799
1778
|
html`
|
|
1800
1779
|
<import-pop-up
|
|
@@ -1425,7 +1425,6 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1425
1425
|
batchId: record.batchId,
|
|
1426
1426
|
batchIdRef: record?.batchIdRef ? record.batchIdRef : null,
|
|
1427
1427
|
product: { id: record.product.id },
|
|
1428
|
-
productDetail: { id: record.productDetailId },
|
|
1429
1428
|
packingType: record.packingType,
|
|
1430
1429
|
packingSize: record?.product?.packingSize ? record.product.packingSize : record.packingSize,
|
|
1431
1430
|
uomValue: record?.uomValue ? record.uomValue : 0,
|
|
@@ -1481,7 +1480,6 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1481
1480
|
} else if (record.targetType === VAS_BATCH_AND_PRODUCT_TYPE) {
|
|
1482
1481
|
result.targetBatchId = record.target.batchId
|
|
1483
1482
|
result.targetProduct = { id: record.target.productId }
|
|
1484
|
-
result.targetProductDetail = { id: record.target.productDetailId }
|
|
1485
1483
|
result.packingType = record.packingType
|
|
1486
1484
|
result.qty = record.qty
|
|
1487
1485
|
result.uomValue = record.uomValue
|
|
@@ -406,7 +406,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
406
406
|
return this.shadowRoot.querySelector('data-grist#addProduct')
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
_onProductChangeHandler(event) {
|
|
410
410
|
try {
|
|
411
411
|
this._checkProductDuplication()
|
|
412
412
|
let changeRecord = event.detail.after
|
|
@@ -423,9 +423,9 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
423
423
|
|
|
424
424
|
const amountRelatedColumns = ['uomValue', 'uom', 'packQty']
|
|
425
425
|
if (amountRelatedColumns.indexOf(changedColumn) >= 0) {
|
|
426
|
-
const calcedAmount =
|
|
426
|
+
const calcedAmount = this._calcAmount(changedColumn, changeRecord)
|
|
427
427
|
for (let key in calcedAmount) {
|
|
428
|
-
changeRecord[key] =
|
|
428
|
+
changeRecord[key] = calcedAmount[key]
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
|
|
@@ -596,8 +596,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
596
596
|
let existingOrderProducts = []
|
|
597
597
|
let newOrderProducts = []
|
|
598
598
|
|
|
599
|
-
existingOrderProducts =
|
|
600
|
-
newOrderProducts =
|
|
599
|
+
existingOrderProducts = this._getExistingOrderProducts()
|
|
600
|
+
newOrderProducts = this._getNewOrderProducts()
|
|
601
601
|
|
|
602
602
|
if (existingOrderProducts?.length || newOrderProducts?.length) {
|
|
603
603
|
const result = await CustomAlert({
|
|
@@ -624,8 +624,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
624
624
|
`,
|
|
625
625
|
variables: {
|
|
626
626
|
ganNo: this.ganNo,
|
|
627
|
-
newOrderProducts,
|
|
628
|
-
existingOrderProducts
|
|
627
|
+
newOrderProducts: this._getNewOrderProducts(),
|
|
628
|
+
existingOrderProducts: this._getExistingOrderProducts()
|
|
629
629
|
}
|
|
630
630
|
})
|
|
631
631
|
|
|
@@ -650,7 +650,6 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
650
650
|
palletQty: 0,
|
|
651
651
|
adjustedPalletQty: record?.palletQty ? record.palletQty : null,
|
|
652
652
|
product: { id: record.product.id },
|
|
653
|
-
productDetail: { id: record.productDetailId },
|
|
654
653
|
packingType: 'N/A',
|
|
655
654
|
adjustedPackingType: record.packingType,
|
|
656
655
|
uomValue: 0,
|
|
@@ -683,7 +682,6 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
683
682
|
adjustedBatchIdRef: record.batchIdRef === record.__origin__.batchIdRef ? null : record.batchIdRef,
|
|
684
683
|
adjustedPalletQty: record.palletQty == record.__origin__.palletQty ? null : record.palletQty,
|
|
685
684
|
product: { id: record.product.id },
|
|
686
|
-
productDetail: { id: record.productDetail.id },
|
|
687
685
|
adjustedPackingType: record.packingType === record.__origin__.packingType ? null : record.packingType,
|
|
688
686
|
adjustedUomValue: record.uomValue == record.__origin__.uomValue ? null : record.uomValue,
|
|
689
687
|
adjustedUom: record.uom === record.__origin__.uom ? null : record.uom,
|