@things-factory/operato-wms 3.7.2 → 3.7.7
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/components/select-product-popup.js +5 -1
- package/client/pages/constants/order.js +10 -0
- package/client/pages/inbound/putaway-product.js +162 -139
- package/client/pages/inventory-check/inspecting-product.js +146 -80
- package/client/pages/manifest/create-loading-manifest.js +314 -0
- package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
- package/client/pages/manifest/loading-manifest-detail.js +345 -0
- package/client/pages/manifest/loading-manifest-list.js +305 -0
- package/client/pages/order/arrival-notice/create-arrival-notice.js +8 -1
- package/client/pages/order/goods-received-note/received-note-list.js +138 -6
- package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +45 -5
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +181 -21
- package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
- package/client/pages/order/release-order/create-release-order.js +25 -4
- package/client/pages/order/release-order/receive-release-order-request.js +27 -24
- package/client/pages/order/release-order/release-extra-product-popup.js +189 -56
- package/client/pages/order/release-order/release-order-detail.js +292 -71
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +115 -50
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
- package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
- package/client/pages/order/transport-order/delivery-order-list.js +99 -59
- package/client/pages/outbound/loading-product.js +4 -1
- package/client/pages/outbound/merged-outbound-worksheet.js +39 -1
- package/client/pages/outbound/packing-product.js +4 -1
- package/client/pages/outbound/packing-worksheet-list.js +39 -1
- package/client/pages/outbound/picking-product.js +622 -290
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/outbound/worksheet-picking.js +28 -2
- package/client/pages/report/product-label-report.js +401 -0
- package/client/pages/support/inventory-comparison.js +296 -0
- package/client/pages/vas/print-product-label.js +298 -132
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +30 -12
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +75 -5
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +113 -18
- package/client/route.js +23 -0
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -1
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
- package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
- package/dist-server/graphql/types/index.js +5 -2
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
- package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
- package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/product-label-report.js +16 -0
- package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
- package/package.json +65 -65
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
- package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
- package/server/graphql/resolvers/index.ts +3 -1
- package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
- package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
- package/server/graphql/types/index.ts +5 -2
- package/server/graphql/types/inventory-comparison/index.ts +11 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/product-label-report-list.ts +8 -0
- package/server/graphql/types/reports/product-label-report.ts +10 -0
- package/things-factory.config.js +24 -0
- package/translations/en.json +64 -12
- package/translations/ko.json +50 -1
- package/translations/ms.json +51 -1
- package/translations/zh.json +50 -1
|
@@ -833,7 +833,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
833
833
|
select: [
|
|
834
834
|
{ name: 'productId', hidden: true },
|
|
835
835
|
{ name: 'remainUomValue', hidden: true },
|
|
836
|
-
{ name: 'uom', hidden: true },
|
|
837
836
|
{ name: 'batchId', header: i18next.t('field.batch_id') },
|
|
838
837
|
{ name: 'batchIdRef', header: i18next.t('field.batch_no_ref') },
|
|
839
838
|
{
|
|
@@ -848,6 +847,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
848
847
|
},
|
|
849
848
|
{ name: 'packingType', header: i18next.t('field.packing_type') },
|
|
850
849
|
{ name: 'packingSize', header: i18next.t('field.packing_size') },
|
|
850
|
+
{ name: 'uom', header: i18next.t('field.uom') },
|
|
851
851
|
{
|
|
852
852
|
name: 'remainQty',
|
|
853
853
|
header: i18next.t('field.remain_qty'),
|
|
@@ -906,6 +906,12 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
906
906
|
header: i18next.t('field.packing_size'),
|
|
907
907
|
width: 140
|
|
908
908
|
},
|
|
909
|
+
{
|
|
910
|
+
type: 'string',
|
|
911
|
+
name: 'uom',
|
|
912
|
+
header: i18next.t('field.uom'),
|
|
913
|
+
width: 100
|
|
914
|
+
},
|
|
909
915
|
{
|
|
910
916
|
type: 'integer',
|
|
911
917
|
name: 'remainQty',
|
|
@@ -984,7 +990,6 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
984
990
|
select: [
|
|
985
991
|
{ name: 'id', hidden: true },
|
|
986
992
|
{ name: 'name', hidden: true },
|
|
987
|
-
{ name: 'uom', hidden: true },
|
|
988
993
|
{ name: 'remainUomValue', hidden: true },
|
|
989
994
|
{ name: 'product', type: 'object', hidden: true },
|
|
990
995
|
{ name: 'palletId', header: i18next.t('field.lot_id') },
|
|
@@ -999,6 +1004,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
999
1004
|
},
|
|
1000
1005
|
{ name: 'packingType', header: i18next.t('field.packing_type') },
|
|
1001
1006
|
{ name: 'packingSize', header: i18next.t('field.packing_size') },
|
|
1007
|
+
{ name: 'uom', header: i18next.t('field.uom') },
|
|
1002
1008
|
{ name: 'remainQty', type: 'float', header: i18next.t('field.remain_qty') },
|
|
1003
1009
|
{
|
|
1004
1010
|
name: 'remainUomValueWithUom',
|
|
@@ -1052,6 +1058,12 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
1052
1058
|
header: i18next.t('field.packing_size'),
|
|
1053
1059
|
width: 140
|
|
1054
1060
|
},
|
|
1061
|
+
{
|
|
1062
|
+
type: 'string',
|
|
1063
|
+
name: 'uom',
|
|
1064
|
+
header: i18next.t('field.uom'),
|
|
1065
|
+
width: 100
|
|
1066
|
+
},
|
|
1055
1067
|
{
|
|
1056
1068
|
type: 'integer',
|
|
1057
1069
|
name: 'remainQty',
|
|
@@ -1141,6 +1153,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
1141
1153
|
|
|
1142
1154
|
roundedUomValue = releaseQty * packageUomValue
|
|
1143
1155
|
roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
|
|
1156
|
+
this.releaseQty = releaseQty
|
|
1157
|
+
this.releaseUomValue = roundedUomValue
|
|
1144
1158
|
}
|
|
1145
1159
|
}
|
|
1146
1160
|
}
|
|
@@ -1155,8 +1169,13 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
1155
1169
|
(columnName == 'releaseUomValue' || columnName == 'releaseQty' || columnName == 'inventory') &&
|
|
1156
1170
|
idx === e.detail.row
|
|
1157
1171
|
) {
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1172
|
+
if (this.releaseQty > e.detail.record.remainQty && this.releaseUomValue > e.detail.record.releaseUomValue) {
|
|
1173
|
+
record.releaseQty = e.detail.record.releaseQty
|
|
1174
|
+
record.releaseUomValue = e.detail.record.releaseUomValue
|
|
1175
|
+
} else {
|
|
1176
|
+
record.releaseQty = releaseQty
|
|
1177
|
+
record.releaseUomValue = roundedUomValue
|
|
1178
|
+
}
|
|
1160
1179
|
}
|
|
1161
1180
|
|
|
1162
1181
|
let returnObj = {
|
|
@@ -2131,6 +2150,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2131
2150
|
remainUomValueWithUom
|
|
2132
2151
|
packingType
|
|
2133
2152
|
packingSize
|
|
2153
|
+
uom
|
|
2134
2154
|
releaseQty
|
|
2135
2155
|
releaseUomValue
|
|
2136
2156
|
isError
|
|
@@ -2146,6 +2166,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2146
2166
|
remainUomValueWithUom
|
|
2147
2167
|
packingType
|
|
2148
2168
|
packingSize
|
|
2169
|
+
uom
|
|
2149
2170
|
}
|
|
2150
2171
|
product {
|
|
2151
2172
|
id
|
|
@@ -41,8 +41,7 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
41
41
|
_template: Object,
|
|
42
42
|
_mimetype: String,
|
|
43
43
|
_doPath: String,
|
|
44
|
-
|
|
45
|
-
_type: String
|
|
44
|
+
_roType: String
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -247,7 +246,7 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
247
246
|
</div>
|
|
248
247
|
|
|
249
248
|
<label>${i18next.t('label.company')}</label>
|
|
250
|
-
<input name="bizplaceName"
|
|
249
|
+
<input name="bizplaceName" readonly />
|
|
251
250
|
|
|
252
251
|
<label>${i18next.t('label.ref_no')}</label>
|
|
253
252
|
<input name="refNo" readonly />
|
|
@@ -264,6 +263,15 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
264
263
|
<label ?hidden="${!this._ownTransport}">${i18next.t('label.co_no')}</label>
|
|
265
264
|
<input name="collectionOrderNo" ?hidden="${!this._ownTransport}" readonly />
|
|
266
265
|
|
|
266
|
+
<label ?hidden="${this._roType === 'b2b'}">${i18next.t('label.attention_to')}</label>
|
|
267
|
+
<input name="attentionTo" ?hidden="${this._roType === 'b2b'}" readonly />
|
|
268
|
+
|
|
269
|
+
<label ?hidden="${this._roType === 'b2b'}">${i18next.t('label.phone_no')}</label>
|
|
270
|
+
<input name="phone1" ?hidden="${this._roType === 'b2b'}" readonly />
|
|
271
|
+
|
|
272
|
+
<label ?hidden="${this._roType === 'b2b'}">${i18next.t('label.delivery_address')}</label>
|
|
273
|
+
<textarea name="deliveryAddress1" ?hidden="${this._roType === 'b2b'}" rows="5" readonly></textarea>
|
|
274
|
+
|
|
267
275
|
${this._crossDocking
|
|
268
276
|
? html`
|
|
269
277
|
<label for="ganNo">${i18next.t('label.arrival_notice')}</label>
|
|
@@ -341,7 +349,6 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
341
349
|
this._exportOption = false
|
|
342
350
|
this._downloadable = true
|
|
343
351
|
this._ownTransport = true
|
|
344
|
-
this._bizplaceName = ''
|
|
345
352
|
}
|
|
346
353
|
|
|
347
354
|
get releaseOrderForm() {
|
|
@@ -399,12 +406,6 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
399
406
|
header: i18next.t('field.packing_type'),
|
|
400
407
|
width: 150
|
|
401
408
|
},
|
|
402
|
-
// {
|
|
403
|
-
// type: 'integer',
|
|
404
|
-
// name: 'qty',
|
|
405
|
-
// header: i18next.t('field.available_qty'),
|
|
406
|
-
// width: 100
|
|
407
|
-
// },
|
|
408
409
|
{
|
|
409
410
|
type: 'integer',
|
|
410
411
|
name: 'releaseQty',
|
|
@@ -412,12 +413,6 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
412
413
|
record: { options: { min: 0 } },
|
|
413
414
|
width: 100
|
|
414
415
|
},
|
|
415
|
-
// {
|
|
416
|
-
// type: 'string',
|
|
417
|
-
// name: 'remainUomValue',
|
|
418
|
-
// header: i18next.t('field.available_uom_value'),
|
|
419
|
-
// width: 100
|
|
420
|
-
// },
|
|
421
416
|
{
|
|
422
417
|
type: 'string',
|
|
423
418
|
name: 'releaseUomValue',
|
|
@@ -575,6 +570,9 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
575
570
|
type
|
|
576
571
|
ownTransport
|
|
577
572
|
crossDocking
|
|
573
|
+
attentionTo
|
|
574
|
+
deliveryAddress1
|
|
575
|
+
phone1
|
|
578
576
|
arrivalNotice {
|
|
579
577
|
name
|
|
580
578
|
}
|
|
@@ -664,7 +662,6 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
664
662
|
const orderVass = releaseOrder.orderVass
|
|
665
663
|
|
|
666
664
|
this._exportOption = releaseOrder.exportOption
|
|
667
|
-
this._bizplaceName = releaseOrder.bizplace.name
|
|
668
665
|
if (this._exportOption) {
|
|
669
666
|
this._ownTransport = true
|
|
670
667
|
} else if (!this._exportOption) {
|
|
@@ -677,16 +674,22 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
677
674
|
|
|
678
675
|
this._courierOption = releaseOrder.courierOption
|
|
679
676
|
this._packingOption = releaseOrder.packingOption
|
|
677
|
+
|
|
678
|
+
await this.updateComplete
|
|
680
679
|
this._status = releaseOrder.status
|
|
681
|
-
this.
|
|
680
|
+
this._roType = releaseOrder?.type
|
|
681
|
+
|
|
682
|
+
this._fillupRGForm({ ...releaseOrder, bizplaceName: releaseOrder.bizplace?.name })
|
|
683
|
+
|
|
684
|
+
if (shippingOrder) {
|
|
685
|
+
this._shippingOrder = shippingOrder
|
|
686
|
+
this._fillupSOForm(shippingOrder)
|
|
687
|
+
}
|
|
682
688
|
|
|
683
689
|
if (releaseOrder && releaseOrder?.attachment) {
|
|
684
690
|
this._attachments = releaseOrder && releaseOrder.attachment
|
|
685
691
|
}
|
|
686
692
|
|
|
687
|
-
this._fillupRGForm(releaseOrder)
|
|
688
|
-
if (this._exportOption) this._fillupSOForm(shippingOrder)
|
|
689
|
-
|
|
690
693
|
this.inventoryData = { records: orderInventories }
|
|
691
694
|
this.vasData = {
|
|
692
695
|
records: orderVass
|
|
@@ -798,7 +801,7 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
798
801
|
})
|
|
799
802
|
|
|
800
803
|
if (!response.errors) {
|
|
801
|
-
if (this.
|
|
804
|
+
if (this._roType === 'b2b') {
|
|
802
805
|
navigate(`b2b_order_requests`)
|
|
803
806
|
} else {
|
|
804
807
|
navigate(`b2c_order_requests`)
|
|
@@ -867,7 +870,7 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
867
870
|
|
|
868
871
|
if (!response.errors) {
|
|
869
872
|
this._showToast({ message: i18next.t('text.release_order_has_been_cancelled') })
|
|
870
|
-
if (this.
|
|
873
|
+
if (this._roType === 'b2b') {
|
|
871
874
|
navigate(`b2b_order_requests`)
|
|
872
875
|
} else {
|
|
873
876
|
navigate(`b2c_order_requests`)
|
|
@@ -900,7 +903,7 @@ class ReceiveReleaseOrderRequest extends connect(store)(localize(i18next)(PageVi
|
|
|
900
903
|
|
|
901
904
|
if (!response.errors) {
|
|
902
905
|
this._showToast({ message: i18next.t('text.cancellation_request_has_been_rejected') })
|
|
903
|
-
if (this.
|
|
906
|
+
if (this._roType === 'b2b') {
|
|
904
907
|
navigate(`b2b_order_requests`)
|
|
905
908
|
} else {
|
|
906
909
|
navigate(`b2c_order_requests`)
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
2
1
|
import '@things-factory/grist-ui'
|
|
2
|
+
|
|
3
|
+
import gql from 'graphql-tag'
|
|
4
|
+
import { css, html, LitElement } from 'lit-element'
|
|
5
|
+
|
|
6
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
3
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
8
|
import { client, CustomAlert } from '@things-factory/shell'
|
|
5
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
6
10
|
import { isMobileDevice } from '@things-factory/utils'
|
|
7
|
-
|
|
8
|
-
import { css, html, LitElement } from 'lit-element'
|
|
11
|
+
|
|
9
12
|
import { fetchLocationSortingRule } from '../../../fetch-location-sorting-rule'
|
|
10
13
|
import {
|
|
11
14
|
INVENTORY_STATUS,
|
|
@@ -118,7 +121,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
118
121
|
.config="${this.existingInventoryGristConfig}"
|
|
119
122
|
.data="${this.existingInventoryData}"
|
|
120
123
|
@record-change="${this._onProductChangeHandler.bind(this)}"
|
|
121
|
-
@field-change="${this.
|
|
124
|
+
@field-change="${this._onExistingInventoryFieldChanged.bind(this)}"
|
|
122
125
|
></data-grist>
|
|
123
126
|
</div>
|
|
124
127
|
|
|
@@ -271,8 +274,8 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
271
274
|
},
|
|
272
275
|
{
|
|
273
276
|
type: 'integer',
|
|
274
|
-
name: '
|
|
275
|
-
header: i18next.t('field.
|
|
277
|
+
name: 'addableQty',
|
|
278
|
+
header: i18next.t('field.addable_qty'),
|
|
276
279
|
width: 100
|
|
277
280
|
},
|
|
278
281
|
{
|
|
@@ -284,8 +287,8 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
284
287
|
},
|
|
285
288
|
{
|
|
286
289
|
type: 'float',
|
|
287
|
-
name: '
|
|
288
|
-
header: i18next.t('field.
|
|
290
|
+
name: 'addableUomValue',
|
|
291
|
+
header: i18next.t('field.addable_uom_value'),
|
|
289
292
|
width: 100
|
|
290
293
|
},
|
|
291
294
|
{
|
|
@@ -354,7 +357,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
354
357
|
field: 'name'
|
|
355
358
|
},
|
|
356
359
|
{ name: 'packingType', header: i18next.t('field.packing_type') },
|
|
357
|
-
{ name: 'remainQty', type: 'float' },
|
|
360
|
+
{ name: 'remainQty', header: i18next.t('field.remain_qty'), type: 'float' },
|
|
358
361
|
{
|
|
359
362
|
name: 'remainUomValue',
|
|
360
363
|
type: 'float',
|
|
@@ -362,7 +365,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
362
365
|
},
|
|
363
366
|
{ name: 'batchIdRef', header: i18next.t('field.batch_no_ref') }
|
|
364
367
|
],
|
|
365
|
-
list: { fields: ['palletId', 'product', 'batchId', 'location', '
|
|
368
|
+
list: { fields: ['palletId', 'product', 'batchId', 'location', 'batchIdRef'] }
|
|
366
369
|
}
|
|
367
370
|
},
|
|
368
371
|
width: 250
|
|
@@ -419,7 +422,6 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
419
422
|
}
|
|
420
423
|
|
|
421
424
|
resetPage() {
|
|
422
|
-
this.initProperties()
|
|
423
425
|
this._clearGristConditions()
|
|
424
426
|
}
|
|
425
427
|
|
|
@@ -513,41 +515,64 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
513
515
|
return date.toISOString().split('T')[0]
|
|
514
516
|
}
|
|
515
517
|
|
|
516
|
-
|
|
518
|
+
_onExistingInventoryFieldChanged(e) {
|
|
517
519
|
let columnName = e.detail.column.name
|
|
518
|
-
let
|
|
519
|
-
let releaseQty = 0
|
|
520
|
+
let packageUomValue = 0
|
|
520
521
|
|
|
521
|
-
if (
|
|
522
|
-
|
|
523
|
-
if (
|
|
524
|
-
e.detail.record.remainUomValue &&
|
|
525
|
-
e.detail.record.remainQty &&
|
|
526
|
-
e.detail.record.remainUomValue > 0 &&
|
|
527
|
-
e.detail.record.remainQty > 0
|
|
528
|
-
) {
|
|
529
|
-
if (columnName === 'releaseQty') {
|
|
530
|
-
releaseQty = e.detail.after || 0
|
|
531
|
-
} else {
|
|
532
|
-
releaseQty = Math.round(e.detail.after / packageUomValue)
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
roundedUomValue = releaseQty * packageUomValue
|
|
536
|
-
roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
|
|
537
|
-
}
|
|
522
|
+
if (!e.detail.after) {
|
|
523
|
+
throw new Error(i18next.t('text.invalid_form_value'))
|
|
538
524
|
}
|
|
539
525
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
526
|
+
const result = this._calculateQtyAndUom(
|
|
527
|
+
packageUomValue,
|
|
528
|
+
columnName,
|
|
529
|
+
e.detail.record.uomValue,
|
|
530
|
+
e.detail.record.qty,
|
|
531
|
+
e.detail.record.__origin__.releaseUomValue,
|
|
532
|
+
e.detail.record.__origin__.releaseQty,
|
|
533
|
+
e.detail.record.__origin__.addableUomValue,
|
|
534
|
+
e.detail.record.__origin__.addableQty,
|
|
535
|
+
e.detail.record.__origin__.remainUomValue,
|
|
536
|
+
e.detail.record.__origin__.remainQty,
|
|
537
|
+
e.detail.after
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
this.existingInventoryData = {
|
|
541
|
+
...this.existingInventoryGrist.dirtyData,
|
|
542
|
+
records: this.existingInventoryGrist.dirtyData.records.map((record, idx) => {
|
|
543
|
+
if (result.releaseQty >= 0 && result.roundedUom >= 0) {
|
|
544
|
+
if ((columnName == 'releaseUomValue' || columnName == 'releaseQty') && idx === e.detail.row) {
|
|
545
|
+
if (columnName == 'releaseUomValue') {
|
|
546
|
+
record.releaseQty = result.releaseQty
|
|
547
|
+
}
|
|
548
|
+
record.releaseUomValue = result.roundedUom
|
|
549
|
+
record.addableQty = record.__origin__.releaseQty + record.__origin__.addableQty - result.releaseQty
|
|
550
|
+
if (record.addableQty <= 0) {
|
|
551
|
+
record.addableQty = 0
|
|
552
|
+
}
|
|
553
|
+
if (record.addableUomValue == 0) {
|
|
554
|
+
record.addableUomValue =
|
|
555
|
+
record.addableQty * (record.__origin__.releaseUomValue / record.__origin__.releaseQty)
|
|
556
|
+
} else {
|
|
557
|
+
if (record.addableQty == 0) {
|
|
558
|
+
record.addableUomValue = 0
|
|
559
|
+
} else {
|
|
560
|
+
if (e.detail.record.__origin__.releaseQty == 0 || e.detail.record.__origin__.releaseUomValue == 0) {
|
|
561
|
+
record.addableUomValue =
|
|
562
|
+
record.addableQty *
|
|
563
|
+
(e.detail.record.__origin__.addableUomValue / e.detail.record.__origin__.addableQty)
|
|
564
|
+
} else {
|
|
565
|
+
record.addableUomValue =
|
|
566
|
+
record.addableQty *
|
|
567
|
+
(e.detail.record.__origin__.releaseUomValue / e.detail.record.__origin__.releaseQty)
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
546
572
|
}
|
|
547
573
|
|
|
548
574
|
let returnObj = {
|
|
549
|
-
...record
|
|
550
|
-
...record.inventory
|
|
575
|
+
...record
|
|
551
576
|
}
|
|
552
577
|
|
|
553
578
|
if (this._pickingStd === PICKING_STANDARD.SELECT_BY_PRODUCT.value) {
|
|
@@ -560,13 +585,94 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
560
585
|
return returnObj
|
|
561
586
|
})
|
|
562
587
|
}
|
|
588
|
+
}
|
|
563
589
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
590
|
+
_calculateQtyAndUom(
|
|
591
|
+
packageUom,
|
|
592
|
+
columnName,
|
|
593
|
+
detailUom,
|
|
594
|
+
detailQty,
|
|
595
|
+
originUom,
|
|
596
|
+
originQty,
|
|
597
|
+
originAddableUom,
|
|
598
|
+
originAddableQty,
|
|
599
|
+
originRemainUom,
|
|
600
|
+
originRemainQty,
|
|
601
|
+
afterValue
|
|
602
|
+
) {
|
|
603
|
+
var releaseQty = 0
|
|
604
|
+
var roundedUom = 0
|
|
605
|
+
|
|
606
|
+
if (afterValue >= 0) {
|
|
607
|
+
if (columnName == 'releaseUomValue' || columnName == 'releaseQty') {
|
|
608
|
+
if (detailUom && detailQty) {
|
|
609
|
+
packageUom = detailUom / detailQty
|
|
610
|
+
} else {
|
|
611
|
+
if (originQty) {
|
|
612
|
+
if (originQty == 0 || originUom == 0) {
|
|
613
|
+
packageUom = originAddableUom / originAddableQty
|
|
614
|
+
} else {
|
|
615
|
+
packageUom = originUom / originQty
|
|
616
|
+
}
|
|
617
|
+
} else {
|
|
618
|
+
packageUom = originRemainUom / originRemainQty
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if (columnName === 'releaseQty') {
|
|
623
|
+
releaseQty = afterValue || 0
|
|
624
|
+
} else {
|
|
625
|
+
releaseQty = Math.round(afterValue / packageUom)
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
roundedUom = releaseQty * packageUom
|
|
629
|
+
roundedUom = parseFloat(roundedUom.toFixed(2))
|
|
630
|
+
}
|
|
631
|
+
} else {
|
|
632
|
+
releaseQty = afterValue
|
|
633
|
+
roundedUom = afterValue
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
return { releaseQty, roundedUom }
|
|
637
|
+
}
|
|
638
|
+
_onInventoryFieldChanged(e) {
|
|
639
|
+
let columnName = e.detail.column.name
|
|
640
|
+
let roundedUomValue = e.detail.record.roundedUomValue || 0
|
|
641
|
+
let releaseQty = 0
|
|
642
|
+
let packageUomValue = 0
|
|
643
|
+
|
|
644
|
+
try {
|
|
645
|
+
if (e.detail.after == NaN) {
|
|
646
|
+
throw new Error(i18next.t('text.invalid_form_value'))
|
|
647
|
+
}
|
|
648
|
+
} catch (e) {
|
|
649
|
+
this._showToast(e)
|
|
650
|
+
}
|
|
651
|
+
if (e.detail.after >= 0) {
|
|
652
|
+
packageUomValue = e.detail.record.remainUomValue / e.detail.record.remainQty
|
|
653
|
+
|
|
654
|
+
if (columnName === 'releaseQty' && e.detail.after <= e.detail.record.remainQty) {
|
|
655
|
+
releaseQty = e.detail.after || 0
|
|
656
|
+
} else {
|
|
657
|
+
if (columnName === 'releaseUomValue' && e.detail.after <= e.detail.record.remainUomValue) {
|
|
658
|
+
releaseQty = Math.round(e.detail.after / packageUomValue)
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
roundedUomValue = releaseQty * packageUomValue
|
|
662
|
+
roundedUomValue = parseFloat(roundedUomValue.toFixed(2))
|
|
663
|
+
} else {
|
|
664
|
+
releaseQty = e.detail.after
|
|
665
|
+
roundedUomValue = e.detail.after
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
this.inventoryData = {
|
|
669
|
+
...this.inventoryGrist.dirtyData,
|
|
670
|
+
records: this.inventoryGrist.dirtyData.records.map((record, idx) => {
|
|
671
|
+
if (releaseQty >= 0 && roundedUomValue >= 0) {
|
|
672
|
+
if ((columnName == 'releaseUomValue' || columnName == 'releaseQty') && idx === e.detail.row) {
|
|
673
|
+
record.releaseQty = releaseQty
|
|
674
|
+
record.releaseUomValue = roundedUomValue
|
|
675
|
+
}
|
|
570
676
|
}
|
|
571
677
|
|
|
572
678
|
let returnObj = {
|
|
@@ -589,12 +695,22 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
589
695
|
_onProductChangeHandler(event) {
|
|
590
696
|
const changeRecord = event.detail.after
|
|
591
697
|
const changedColumn = event.detail.column.name
|
|
698
|
+
var totalAvailableQty = 0
|
|
699
|
+
var totalAvailableUomValue = 0
|
|
700
|
+
|
|
701
|
+
if (changeRecord.inventory.remainQty) {
|
|
702
|
+
totalAvailableQty = changeRecord.inventory.remainQty
|
|
703
|
+
totalAvailableUomValue = changeRecord.inventory.remainUomValue
|
|
704
|
+
} else if (event.detail.before) {
|
|
705
|
+
totalAvailableQty = event.detail.before.inventory.releaseQty + event.detail.before.addableQty
|
|
706
|
+
totalAvailableUomValue = event.detail.before.inventory.releaseUomValue + event.detail.before.addableUomValue
|
|
707
|
+
}
|
|
592
708
|
|
|
593
709
|
try {
|
|
594
710
|
if (changedColumn === 'releaseQty') {
|
|
595
|
-
this._validateReleaseQty(changeRecord.releaseQty, changeRecord.remainQty)
|
|
711
|
+
this._validateReleaseQty(changeRecord.releaseQty, changeRecord.remainQty, totalAvailableQty)
|
|
596
712
|
} else if (changedColumn === 'releaseUomValue') {
|
|
597
|
-
this._validateReleaseUomValue(changeRecord.releaseUomValue, changeRecord.remainUomValue)
|
|
713
|
+
this._validateReleaseUomValue(changeRecord.releaseUomValue, changeRecord.remainUomValue, totalAvailableUomValue)
|
|
598
714
|
}
|
|
599
715
|
this._updateInventoryList()
|
|
600
716
|
} catch (e) {
|
|
@@ -608,22 +724,39 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
608
724
|
}
|
|
609
725
|
}
|
|
610
726
|
|
|
611
|
-
_validateReleaseQty(releaseQty, remainQty) {
|
|
727
|
+
_validateReleaseQty(releaseQty, remainQty, totalAvailableQty) {
|
|
612
728
|
if (remainQty === undefined) throw new Error(i18next.t('text.there_is_no_selected_items'))
|
|
613
|
-
if (
|
|
614
|
-
|
|
729
|
+
if (totalAvailableQty) {
|
|
730
|
+
if (releaseQty < 0) {
|
|
731
|
+
throw new Error(i18next.t('text.invalid_quantity_input'))
|
|
732
|
+
} else if (releaseQty > totalAvailableQty) {
|
|
733
|
+
throw new Error(i18next.t('text.available_quantity_insufficient'))
|
|
734
|
+
}
|
|
735
|
+
} else {
|
|
736
|
+
if (releaseQty > remainQty) {
|
|
737
|
+
throw new Error(i18next.t('text.available_quantity_insufficient'))
|
|
738
|
+
}
|
|
615
739
|
}
|
|
616
740
|
}
|
|
617
741
|
|
|
618
|
-
_validateReleaseUomValue(releaseUomValue, remainUomValue) {
|
|
742
|
+
_validateReleaseUomValue(releaseUomValue, remainUomValue, totalAvailableUomValue) {
|
|
619
743
|
if (remainUomValue === undefined) throw new Error(i18next.t('text.there_is_no_selected_items'))
|
|
620
|
-
if (
|
|
621
|
-
|
|
744
|
+
if (totalAvailableUomValue) {
|
|
745
|
+
if (releaseUomValue < 0) {
|
|
746
|
+
throw new Error(i18next.t('text.invalid_quantity_input'))
|
|
747
|
+
} else if (releaseUomValue > totalAvailableUomValue) {
|
|
748
|
+
throw new Error(i18next.t('text.available_uom_value_insufficient'))
|
|
749
|
+
}
|
|
750
|
+
} else {
|
|
751
|
+
if (releaseUomValue > remainUomValue) {
|
|
752
|
+
throw new Error(i18next.t('text.available_uom_value_insufficient'))
|
|
753
|
+
}
|
|
622
754
|
}
|
|
623
755
|
}
|
|
624
756
|
|
|
625
757
|
async _addExtraProducts() {
|
|
626
758
|
try {
|
|
759
|
+
this._validateProducts()
|
|
627
760
|
const result = await CustomAlert({
|
|
628
761
|
title: i18next.t('title.are_you_sure'),
|
|
629
762
|
text: i18next.t('text.add_extra_product'),
|
|
@@ -728,9 +861,9 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
728
861
|
}
|
|
729
862
|
|
|
730
863
|
_validateProducts() {
|
|
731
|
-
// no records
|
|
732
|
-
if (!this.inventoryGrist.dirtyData.records || !this.inventoryGrist.dirtyData.records.length)
|
|
733
|
-
|
|
864
|
+
// // no records
|
|
865
|
+
// if (!this.inventoryGrist.dirtyData.records || !this.inventoryGrist.dirtyData.records.length)
|
|
866
|
+
// throw new Error(i18next.t('text.no_products'))
|
|
734
867
|
// required field (batchId, packingType, uomValue, unit, packQty, palletQty)
|
|
735
868
|
if (
|
|
736
869
|
this.inventoryGrist.dirtyData.records.filter(
|