@things-factory/operato-wms 4.3.41 → 4.3.44
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 +2 -2
- package/client/pages/inbound/unload-product.js +43 -23
- package/client/pages/inventory/onhand-inventory.js +0 -1
- package/client/pages/order/release-order/create-release-order.js +207 -208
- package/client/pages/order/release-order/release-order-detail.js +151 -192
- package/client/pages/order/transport-order/delivery-note-popup.js +441 -337
- package/package.json +6 -6
- package/translations/en.json +2 -0
|
@@ -47,27 +47,23 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
47
47
|
_contactPointId: String,
|
|
48
48
|
_contactPointName: String,
|
|
49
49
|
_companyName: String,
|
|
50
|
-
_attentionTo: String,
|
|
51
50
|
_deliveryCountry: String,
|
|
52
51
|
_deliveryPostCode: Array,
|
|
53
52
|
_deliveryState: String,
|
|
54
53
|
_deliveryCity: String,
|
|
55
54
|
_deliveryContact: String,
|
|
56
|
-
_deliveryFullAddress: String,
|
|
57
55
|
_selectedPostCode: String,
|
|
58
56
|
_billingCountry: String,
|
|
59
57
|
_billingPostCode: Array,
|
|
60
58
|
_billingState: String,
|
|
61
59
|
_billingCity: String,
|
|
62
60
|
_billingContact: String,
|
|
63
|
-
_billingFullAddress: String,
|
|
64
61
|
_selectedBillingPostCode: String,
|
|
65
62
|
_selectedOwnTransport: Boolean,
|
|
66
63
|
_valueOfTransportType: String,
|
|
67
64
|
_showCoNumber: Boolean,
|
|
68
65
|
_exportOption: Boolean,
|
|
69
66
|
_selectedDeliveryCountry: String,
|
|
70
|
-
_selectedBillingCountry: String,
|
|
71
67
|
_deliveryAllCountry: Array,
|
|
72
68
|
_billingAllCountry: Array,
|
|
73
69
|
_determineOwnCollection: String,
|
|
@@ -79,6 +75,11 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
79
75
|
_containerNo: String,
|
|
80
76
|
_shipName: String,
|
|
81
77
|
|
|
78
|
+
// Refractor
|
|
79
|
+
_deliveryOrder: Object,
|
|
80
|
+
_selectedCountry: String,
|
|
81
|
+
_selectedBillingCountry: String,
|
|
82
|
+
|
|
82
83
|
/* Tab Toggle*/
|
|
83
84
|
_showReleasedOrderInfo: Boolean,
|
|
84
85
|
_showShippingInfo: Boolean,
|
|
@@ -94,19 +95,16 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
94
95
|
this._showReleasedOrderInfo = false
|
|
95
96
|
this._showShippingInfo = true
|
|
96
97
|
this._exportOption = false
|
|
97
|
-
this._attentionTo = ''
|
|
98
98
|
this._companyName = ''
|
|
99
99
|
this._deliveryCountry = 'Malaysia'
|
|
100
100
|
this._deliveryPostCode = []
|
|
101
101
|
this._deliveryState = ''
|
|
102
102
|
this._deliveryCity = ''
|
|
103
|
-
this._deliveryFullAddress = ''
|
|
104
103
|
this._deliveryContact = ''
|
|
105
104
|
this._billingCountry = 'Malaysia'
|
|
106
105
|
this._billingPostCode = []
|
|
107
106
|
this._billingState = ''
|
|
108
107
|
this._billingCity = ''
|
|
109
|
-
this._billingFullAddress = ''
|
|
110
108
|
this._billingContact = ''
|
|
111
109
|
this._selectedPostCode = ''
|
|
112
110
|
this._selectedBillingPostCode = ''
|
|
@@ -115,8 +113,6 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
115
113
|
this._transportType = ['Own Transport', 'Warehouse Transport']
|
|
116
114
|
this._switchDeliveryCountryInput = false
|
|
117
115
|
this._switchBillingCountryInput = false
|
|
118
|
-
this._selectedDeliveryCountry = 'MALAYSIA'
|
|
119
|
-
this._selectedBillingCountry = 'MALAYSIA'
|
|
120
116
|
}
|
|
121
117
|
|
|
122
118
|
static get styles() {
|
|
@@ -181,6 +177,29 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
181
177
|
.content-container {
|
|
182
178
|
overflow-y: auto;
|
|
183
179
|
}
|
|
180
|
+
|
|
181
|
+
[hidden] {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.section-header {
|
|
186
|
+
grid-column: span 36 / auto !important;
|
|
187
|
+
text-align: left !important;
|
|
188
|
+
margin-top: 10px !important;
|
|
189
|
+
font-weight: 600 !important;
|
|
190
|
+
}
|
|
191
|
+
.quick-find-content-container {
|
|
192
|
+
margin: 0 15px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@media screen and (max-width: 480px) {
|
|
196
|
+
.section-header {
|
|
197
|
+
grid-column: span 12 / auto !important;
|
|
198
|
+
}
|
|
199
|
+
.quick-find-content-container {
|
|
200
|
+
margin: 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
184
203
|
`
|
|
185
204
|
]
|
|
186
205
|
}
|
|
@@ -194,13 +213,13 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
194
213
|
await this.fetchCountry()
|
|
195
214
|
await this._getAllPostCode()
|
|
196
215
|
|
|
197
|
-
|
|
216
|
+
await this.fetchDeliveryInfo(this.manualDo)
|
|
198
217
|
const roResponse = await this._fetchReleaseOrder(this.roNo)
|
|
199
218
|
const doRepsonse = await this._fetchDeliveryOrder(this.doNo)
|
|
200
219
|
|
|
201
220
|
this.totalPalletQty = doRepsonse.data.deliveryOrder.palletQty
|
|
202
221
|
|
|
203
|
-
roResponse.ownTransport == true ? (this._showCoNumber =
|
|
222
|
+
roResponse.ownTransport == true ? (this._showCoNumber = true) : (this._showCoNumber = false)
|
|
204
223
|
|
|
205
224
|
this._isDisabled = await fetchSettingRule('disable-reusable-pallet')
|
|
206
225
|
|
|
@@ -276,152 +295,141 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
276
295
|
}
|
|
277
296
|
|
|
278
297
|
return html`
|
|
279
|
-
<div>
|
|
298
|
+
<div class="quick-find-content-container">
|
|
280
299
|
<quick-find-content
|
|
281
300
|
id="order-items-list"
|
|
301
|
+
name="quickFindContent"
|
|
282
302
|
.data="${orderSet}"
|
|
283
303
|
@tabChanged="${e => {
|
|
284
|
-
this.currentTab = e.detail.currentTabKey
|
|
285
304
|
this._tabChange(e.detail.currentTabKey)
|
|
286
305
|
}}"
|
|
287
306
|
></quick-find-content>
|
|
288
307
|
</div>
|
|
308
|
+
|
|
289
309
|
<div class="content-container">
|
|
290
310
|
<div ?hidden="${this._showReleasedOrderInfo}">
|
|
291
311
|
<form id="input-form" name="doForm" class="multi-column-form">
|
|
292
|
-
<
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
(tp, key) => html`<option value=${tp} ?selected=${this._determineOwnCollection === tp}>${tp}</option>`
|
|
322
|
-
)}
|
|
323
|
-
</select>
|
|
324
|
-
|
|
325
|
-
<label ?hidden="${this._showCoNumber}"
|
|
326
|
-
>${i18next.t('label.co_no')}</label
|
|
327
|
-
>
|
|
328
|
-
<input
|
|
329
|
-
name="coNo"
|
|
330
|
-
?hidden="${this._showCoNumber}"
|
|
331
|
-
value="${this.coNo}"
|
|
332
|
-
/>
|
|
333
|
-
|
|
334
|
-
<label>${i18next.t('label.driver_name')}</label>
|
|
335
|
-
<input name="otherDriver" value="${this.orderInfo.otherDriver}" ?hidden="${!this._ownCollection}" />
|
|
336
|
-
<input
|
|
337
|
-
name="ownDriver"
|
|
338
|
-
?hidden="${this._ownCollection}"
|
|
339
|
-
value="${this.orderInfo.driverName}"
|
|
340
|
-
@click="${this._openDriverSelector.bind(this)}"
|
|
341
|
-
readonly
|
|
342
|
-
/>
|
|
343
|
-
|
|
344
|
-
<label>${i18next.t('label.vehicle_no')}</label>
|
|
345
|
-
<input name="otherTruck" ?hidden="${!this._ownCollection}" value="${this._truckNo}" />
|
|
346
|
-
<input
|
|
347
|
-
name="ownTruck"
|
|
348
|
-
readonly
|
|
349
|
-
?hidden="${this._ownCollection}"
|
|
350
|
-
@click="${this._openBufferSelector.bind(this)}"
|
|
351
|
-
value="${this.orderInfo.truckNo || ''}"
|
|
352
|
-
/>
|
|
353
|
-
|
|
354
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_name')}</label>
|
|
355
|
-
<input name="contactName" ?hidden="${!this._otherDestination}" />
|
|
356
|
-
|
|
357
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_phone_no')}</label>
|
|
358
|
-
<input
|
|
359
|
-
name="contactPhone"
|
|
360
|
-
?hidden="${!this._otherDestination}"
|
|
361
|
-
placeholder="(${i18next.t('text.optional')})"
|
|
362
|
-
/>
|
|
363
|
-
|
|
364
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_email')}</label>
|
|
365
|
-
<input
|
|
366
|
-
name="contactEmail"
|
|
367
|
-
?hidden="${!this._otherDestination}"
|
|
368
|
-
placeholder="(${i18next.t('text.optional')})"
|
|
369
|
-
/>
|
|
370
|
-
|
|
371
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.company_name')}</label>
|
|
372
|
-
<input
|
|
373
|
-
name="contactCompany"
|
|
374
|
-
?hidden="${!this._otherDestination}"
|
|
375
|
-
placeholder="(${i18next.t('text.optional')})"
|
|
376
|
-
/>
|
|
377
|
-
|
|
378
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_type')}</label>
|
|
379
|
-
<select name="contactType" ?hidden="${!this._otherDestination}">
|
|
380
|
-
<option value="">-- ${i18next.t('text.please_select_the_contact_type')} --</option>
|
|
381
|
-
<!-- Temporarily use hardcoded value -->
|
|
382
|
-
<option value="CUSTOMER">${i18next.t('text.customer')}</option>
|
|
383
|
-
<option value="SUPPLIER">${i18next.t('text.supplier')}</option>
|
|
384
|
-
</select>
|
|
385
|
-
|
|
386
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.delivery_address')}</label>
|
|
387
|
-
<textarea name="otherDestination" ?hidden="${!this._otherDestination}"></textarea>
|
|
388
|
-
|
|
389
|
-
<label ?hidden="${!this._otherDestination}">${i18next.t('label.billing_address')}</label>
|
|
390
|
-
<textarea name="billingAddress" ?hidden="${!this._otherDestination}"></textarea>
|
|
391
|
-
|
|
392
|
-
<label>${i18next.t('label.total_pallet_qty')}</label>
|
|
393
|
-
<input name="totalPalletQty" value="${this.totalPalletQty}" />
|
|
312
|
+
<legend>${i18next.t('title.delivery_information')} - ${this.doNo}</legend>
|
|
313
|
+
<label>${i18next.t('label.delivery_date')}</label>
|
|
314
|
+
<input
|
|
315
|
+
name="deliveryDate"
|
|
316
|
+
type="date"
|
|
317
|
+
min=${this.status === ORDER_STATUS.READY_TO_DISPATCH.value
|
|
318
|
+
? `${this._getStdDate()}`
|
|
319
|
+
: `${this.orderInfo.createdDate}`}
|
|
320
|
+
value="${this.orderInfo.deliveryDate}"
|
|
321
|
+
required
|
|
322
|
+
/>
|
|
323
|
+
|
|
324
|
+
<label>${i18next.t('label.release_good_no')}</label>
|
|
325
|
+
<input name="releaseGoodNo" ?disabled="${true}" value="${this.roNo}" />
|
|
326
|
+
|
|
327
|
+
<label>${i18next.t('label.ref_no')}</label>
|
|
328
|
+
<input name="refNo" ?disabled="${true}" value="${this.refNo}" />
|
|
329
|
+
|
|
330
|
+
<label>${i18next.t('label.transport_type')}</label>
|
|
331
|
+
<select
|
|
332
|
+
name="transportType"
|
|
333
|
+
@change=${e => {
|
|
334
|
+
this._setTransportType(e.target.value, e.target.name)
|
|
335
|
+
}}
|
|
336
|
+
>
|
|
337
|
+
${this._transportType.map(
|
|
338
|
+
(tp, key) => html`<option value=${tp} ?selected=${this._determineOwnCollection === tp}>${tp}</option>`
|
|
339
|
+
)}
|
|
340
|
+
</select>
|
|
394
341
|
|
|
395
|
-
|
|
396
|
-
|
|
342
|
+
<label ?hidden="${this._showCoNumber}">${i18next.t('label.co_no')}</label>
|
|
343
|
+
<input name="coNo" ?hidden="${this._showCoNumber}" value="${this.coNo}" />
|
|
344
|
+
|
|
345
|
+
<label>${i18next.t('label.driver_name')}</label>
|
|
346
|
+
<input name="otherDriver" value="${this.orderInfo.otherDriver}" ?hidden="${!this._ownCollection}" />
|
|
347
|
+
<input
|
|
348
|
+
name="ownDriver"
|
|
349
|
+
?hidden="${this._ownCollection}"
|
|
350
|
+
value="${this.orderInfo.driverName}"
|
|
351
|
+
@click="${this._openDriverSelector.bind(this)}"
|
|
352
|
+
readonly
|
|
353
|
+
/>
|
|
354
|
+
|
|
355
|
+
<label>${i18next.t('label.vehicle_no')}</label>
|
|
356
|
+
<input name="otherTruck" ?hidden="${!this._ownCollection}" value="${this._truckNo}" />
|
|
357
|
+
<input
|
|
358
|
+
name="ownTruck"
|
|
359
|
+
readonly
|
|
360
|
+
?hidden="${this._ownCollection}"
|
|
361
|
+
@click="${this._openBufferSelector.bind(this)}"
|
|
362
|
+
value="${this.orderInfo.truckNo || ''}"
|
|
363
|
+
/>
|
|
364
|
+
|
|
365
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_name')}</label>
|
|
366
|
+
<input name="contactName" ?hidden="${!this._otherDestination}" />
|
|
367
|
+
|
|
368
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_phone_no')}</label>
|
|
369
|
+
<input
|
|
370
|
+
name="contactPhone"
|
|
371
|
+
?hidden="${!this._otherDestination}"
|
|
372
|
+
placeholder="(${i18next.t('text.optional')})"
|
|
373
|
+
/>
|
|
374
|
+
|
|
375
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_email')}</label>
|
|
376
|
+
<input
|
|
377
|
+
name="contactEmail"
|
|
378
|
+
?hidden="${!this._otherDestination}"
|
|
379
|
+
placeholder="(${i18next.t('text.optional')})"
|
|
380
|
+
/>
|
|
381
|
+
|
|
382
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.company_name')}</label>
|
|
383
|
+
<input
|
|
384
|
+
name="contactCompany"
|
|
385
|
+
?hidden="${!this._otherDestination}"
|
|
386
|
+
placeholder="(${i18next.t('text.optional')})"
|
|
387
|
+
/>
|
|
388
|
+
|
|
389
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.contact_type')}</label>
|
|
390
|
+
<select name="contactType" ?hidden="${!this._otherDestination}">
|
|
391
|
+
<option value="">-- ${i18next.t('text.please_select_the_contact_type')} --</option>
|
|
392
|
+
<!-- Temporarily use hardcoded value -->
|
|
393
|
+
<option value="CUSTOMER">${i18next.t('text.customer')}</option>
|
|
394
|
+
<option value="SUPPLIER">${i18next.t('text.supplier')}</option>
|
|
395
|
+
</select>
|
|
397
396
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
397
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.delivery_address')}</label>
|
|
398
|
+
<textarea name="otherDestination" ?hidden="${!this._otherDestination}"></textarea>
|
|
399
|
+
|
|
400
|
+
<label ?hidden="${!this._otherDestination}">${i18next.t('label.billing_address')}</label>
|
|
401
|
+
<textarea name="billingAddress" ?hidden="${!this._otherDestination}"></textarea>
|
|
402
|
+
|
|
403
|
+
<label>${i18next.t('label.total_pallet_qty')}</label>
|
|
404
|
+
<input name="totalPalletQty" value="${this.totalPalletQty}" />
|
|
405
|
+
|
|
406
|
+
<label>${i18next.t('label.overall_remark')}</label>
|
|
407
|
+
<textarea name="remark" value="${this.orderInfo.remark}">${this.orderInfo.remark}</textarea>
|
|
408
|
+
|
|
409
|
+
<input
|
|
410
|
+
id="exportOption"
|
|
411
|
+
type="checkbox"
|
|
412
|
+
name="exportOption"
|
|
413
|
+
?hidden=${this._determineOwnCollection == 'Warehouse Transport'}
|
|
414
|
+
?checked="${this._exportOption}"
|
|
415
|
+
@change="${e => {
|
|
416
|
+
this._exportOption = e.currentTarget.checked
|
|
417
|
+
if (this._exportOption == true) {
|
|
418
|
+
this._exportOption = true
|
|
419
|
+
this._valueOfTransportType = 'Own Transport'
|
|
420
|
+
this._showCoNumber = false
|
|
421
|
+
}
|
|
422
|
+
if (this._exportOption == false) {
|
|
423
|
+
this._exportOption = false
|
|
424
|
+
this._showCoNumber = true
|
|
425
|
+
this._valueOfTransportType = 'Warehouse Transport'
|
|
426
|
+
}
|
|
427
|
+
}}"
|
|
428
|
+
/>
|
|
429
|
+
<label for="exportOption" ?hidden=${this._determineOwnCollection == 'Warehouse Transport'}
|
|
430
|
+
>${i18next.t('label.export')}</label
|
|
431
|
+
>
|
|
422
432
|
</form>
|
|
423
|
-
|
|
424
|
-
|
|
425
433
|
</div>
|
|
426
434
|
|
|
427
435
|
<div class="so-form-container" export ?hidden=${!this._exportOption}>
|
|
@@ -457,167 +465,157 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
457
465
|
<input name="shipName" .value="${this._shipName}" required />
|
|
458
466
|
</fieldset>
|
|
459
467
|
</form>
|
|
460
|
-
</div>
|
|
461
|
-
|
|
462
|
-
<div ?hidden="${this._showShippingInfo}">
|
|
463
|
-
<form name="deliveryOrderInfo" class="multi-column-form" autocomplete="off">
|
|
464
|
-
<fieldset>
|
|
465
|
-
|
|
466
|
-
<legend>${i18next.t('title.shipping_information')}</legend>
|
|
467
|
-
|
|
468
|
-
<label>${i18next.t('label.search')}</label>
|
|
469
|
-
<input type="hidden" name="contactPointId" value="${this._contactPointId}" />
|
|
470
|
-
<input
|
|
471
|
-
type="text"
|
|
472
|
-
name="contactPointName"
|
|
473
|
-
value="${this._contactPointName}"
|
|
474
|
-
@click="${this._openContactPointSelector.bind(this)}"
|
|
475
|
-
/>
|
|
476
|
-
</fieldset>
|
|
477
|
-
</form>
|
|
468
|
+
</div>
|
|
478
469
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
<input name="companyName" required .value="${this._companyName}" />
|
|
470
|
+
<form name="shippingInfo" class="multi-column-form" autocomplete="off" ?hidden="${this._showShippingInfo}">
|
|
471
|
+
<legend>${i18next.t('title.shipping_information')}</legend>
|
|
482
472
|
|
|
483
|
-
|
|
484
|
-
|
|
473
|
+
<label>${i18next.t('label.company')}</label>
|
|
474
|
+
<input name="attentionCompany" .value="${this._deliveryOrder?.attentionCompany}" />
|
|
485
475
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
</form>
|
|
476
|
+
<label>${i18next.t('label.attention_to')}</label>
|
|
477
|
+
<input name="attentionTo" .value="${this._deliveryOrder?.attentionTo}" />
|
|
489
478
|
|
|
490
|
-
<
|
|
491
|
-
<label>${i18next.t('label.delivery_address')}</label>
|
|
492
|
-
</form>
|
|
479
|
+
<button type="button" @click="${this._openContactPointSelector.bind(this)}">import</button>
|
|
493
480
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
<label>${i18next.t('label.country')}</label>
|
|
481
|
+
<!-- delivery -->
|
|
482
|
+
<label class="section-header">${i18next.t('label.delivery_address')}</label>
|
|
483
|
+
<label>${i18next.t('label.country')}</label>
|
|
498
484
|
|
|
499
|
-
|
|
500
|
-
name="
|
|
485
|
+
<select
|
|
486
|
+
name="country"
|
|
501
487
|
@change=${e => {
|
|
502
488
|
this._validateCountry(e)
|
|
503
489
|
}}
|
|
504
490
|
>
|
|
505
|
-
<option value=${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''} selected>
|
|
506
|
-
${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''}
|
|
507
|
-
</option>
|
|
508
491
|
${this._deliveryAllCountry?.map(
|
|
509
|
-
(country, key) =>
|
|
492
|
+
(country, key) =>
|
|
493
|
+
html`<option value=${country.name} ?selected=${country.name === this._selectedCountry}>
|
|
494
|
+
${country.name}
|
|
495
|
+
</option>`
|
|
510
496
|
)}
|
|
511
497
|
</select>
|
|
512
498
|
|
|
513
499
|
<label>${i18next.t('label.zip_postal_code')}</label>
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
? html` <input name="deliveryPostalCode" .value="" /> `
|
|
500
|
+
${this._selectedCountry !== 'MALAYSIA'
|
|
501
|
+
? html` <input name="postalCode" .value="" /> `
|
|
517
502
|
: html`<select
|
|
518
|
-
name="
|
|
503
|
+
name="postalCode"
|
|
519
504
|
@change=${e => {
|
|
520
505
|
this._getStateAndCityByPostCode(e.target.value, e.target.name)
|
|
521
506
|
}}
|
|
507
|
+
value=${this?._selectedPostCode || ''}
|
|
522
508
|
>
|
|
523
|
-
<option value
|
|
524
|
-
${this._selectedPostCode ? this._selectedPostCode : ''}
|
|
525
|
-
</option>
|
|
509
|
+
<option value=""></option>
|
|
526
510
|
${this._deliveryPostCode.map(
|
|
527
|
-
(country, key) =>
|
|
511
|
+
(country, key) =>
|
|
512
|
+
html`<option
|
|
513
|
+
?selected=${(this._selectedPostCode?.length > 0
|
|
514
|
+
? this._selectedPostCode
|
|
515
|
+
: this._deliveryOrder.postalCode) == country.postalCode}
|
|
516
|
+
value=${country.postalCode}
|
|
517
|
+
>
|
|
518
|
+
${country.postalCode}
|
|
519
|
+
</option>`
|
|
528
520
|
)}
|
|
529
|
-
</select>`
|
|
530
|
-
}
|
|
521
|
+
</select>`}
|
|
531
522
|
|
|
532
523
|
<label>${i18next.t('label.state')}</label>
|
|
533
|
-
<input name="
|
|
524
|
+
<input name="state" required .value="${this._deliveryOrder?.state}" />
|
|
534
525
|
|
|
535
526
|
<label>${i18next.t('label.city')}</label>
|
|
536
|
-
<input name="
|
|
527
|
+
<input name="city" required .value="${this._deliveryOrder?.city}" />
|
|
537
528
|
|
|
538
529
|
<label>${i18next.t('label.delivery_address')}</label>
|
|
539
|
-
<textarea name="
|
|
530
|
+
<textarea name="deliveryAddress1" required .value="${this._deliveryOrder?.deliveryAddress1}"></textarea>
|
|
540
531
|
|
|
541
532
|
<label>${i18next.t('label.contact')}</label>
|
|
542
|
-
<input name="
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
<
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
533
|
+
<input name="phone1" required .value="${this._deliveryOrder?.phone1}" />
|
|
534
|
+
|
|
535
|
+
<!-- billing -->
|
|
536
|
+
<label class="section-header">${i18next.t('label.billing_address')}</label>
|
|
537
|
+
<label>${i18next.t('label.country')}</label>
|
|
538
|
+
<select
|
|
539
|
+
name="billingCountry"
|
|
540
|
+
?disabled=${this._disableBillingAddress}
|
|
541
|
+
@change=${e => {
|
|
542
|
+
this._validateBillingCountry(e)
|
|
543
|
+
}}
|
|
544
|
+
>
|
|
545
|
+
${this._deliveryAllCountry.map(
|
|
546
|
+
(country, key) =>
|
|
547
|
+
html`<option value=${country.name} ?selected=${country.name === this._selectedBillingCountry}>
|
|
548
|
+
${country.name}
|
|
549
|
+
</option>`
|
|
550
|
+
)}
|
|
551
|
+
</select>
|
|
553
552
|
|
|
554
|
-
|
|
555
|
-
<select
|
|
556
|
-
name="billingCountry"
|
|
557
|
-
?disabled=${this._disableBillingAddress ? true : false}
|
|
558
|
-
@change=${e => {
|
|
559
|
-
this._validateBillingCountry(e)
|
|
560
|
-
}}
|
|
561
|
-
>
|
|
562
|
-
<option value=${this._selectedBillingCountry ? this._selectedBillingCountry : ''} selected>
|
|
563
|
-
${this._selectedBillingCountry ? this._selectedBillingCountry : ''}
|
|
564
|
-
</option>
|
|
565
|
-
${this._deliveryAllCountry.map(
|
|
566
|
-
(country, key) => html`<option value=${country.name}>${country.name}</option>`
|
|
567
|
-
)}
|
|
568
|
-
</select>
|
|
553
|
+
<label>${i18next.t('label.zip_postal_code')}</label>
|
|
569
554
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
555
|
+
${this._selectedBillingCountry !== 'MALAYSIA'
|
|
556
|
+
? html`
|
|
557
|
+
<input
|
|
558
|
+
?disabled=${this._disableBillingAddress}
|
|
559
|
+
name="billingPostalCode"
|
|
560
|
+
.value=${this._deliveryOrder?.billingPostalCode}
|
|
561
|
+
/>
|
|
562
|
+
`
|
|
563
|
+
: html`<select
|
|
564
|
+
?disabled=${this._disableBillingAddress}
|
|
565
|
+
name="billingPostalCode"
|
|
566
|
+
@change=${e => {
|
|
567
|
+
this._getStateAndCityByPostCode(e.target.value, e.target.name)
|
|
568
|
+
}}
|
|
569
|
+
value=${this._deliveryOrder?.billingPostalCode}
|
|
570
|
+
>
|
|
571
|
+
<option value=""></option>
|
|
572
|
+
|
|
573
|
+
${this._billingPostCode.map(
|
|
574
|
+
(country, key) => html`<option
|
|
575
|
+
value=${country.postalCode}
|
|
576
|
+
?selected=${this._deliveryOrder.billingPostalCode == country.postalCode}
|
|
577
|
+
>
|
|
578
|
+
${country.postalCode}
|
|
579
|
+
</option>`
|
|
580
|
+
)}
|
|
581
|
+
</select>`}
|
|
596
582
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
this._billingCity
|
|
605
|
-
}" />
|
|
606
|
-
|
|
607
|
-
<label>${i18next.t('label.billing_address')}</label>
|
|
608
|
-
<textarea ?disabled=${
|
|
609
|
-
this._disableBillingAddress ? true : false
|
|
610
|
-
} name="billingFullAddress" required .value="${this._billingFullAddress}"></textarea>
|
|
611
|
-
|
|
612
|
-
<input type="checkbox" id="matchDeliveryAddress" @click=${e => {
|
|
613
|
-
e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
|
|
614
|
-
e.currentTarget.checked ? this.matchDeliveryAddress() : ''
|
|
615
|
-
}} />
|
|
616
|
-
<label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
|
|
583
|
+
<label>${i18next.t('label.state')}</label>
|
|
584
|
+
<input
|
|
585
|
+
?disabled=${this._disableBillingAddress}
|
|
586
|
+
name="billingState"
|
|
587
|
+
required
|
|
588
|
+
.value="${this._deliveryOrder?.billingState}"
|
|
589
|
+
/>
|
|
617
590
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
591
|
+
<label>${i18next.t('label.city')}</label>
|
|
592
|
+
<input
|
|
593
|
+
?disabled=${this._disableBillingAddress}
|
|
594
|
+
name="billingCity"
|
|
595
|
+
required
|
|
596
|
+
.value="${this._deliveryOrder?.billingCity}"
|
|
597
|
+
/>
|
|
598
|
+
|
|
599
|
+
<label>${i18next.t('label.billing_address')}</label>
|
|
600
|
+
<textarea
|
|
601
|
+
?disabled=${this._disableBillingAddress}
|
|
602
|
+
name="billingAddress"
|
|
603
|
+
required
|
|
604
|
+
.value="${this._deliveryOrder?.billingAddress}"
|
|
605
|
+
></textarea>
|
|
606
|
+
|
|
607
|
+
<input
|
|
608
|
+
type="checkbox"
|
|
609
|
+
id="matchDeliveryAddress"
|
|
610
|
+
name="matchDeliveryAddressInputa"
|
|
611
|
+
?checked=${this._deliveryOrder?.postalCode == this._deliveryOrder?.billingPostalCode &&
|
|
612
|
+
this._deliveryOrder?.billingAddress == this._deliveryOrder?.deliveryAddress1}
|
|
613
|
+
@click=${e => {
|
|
614
|
+
e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
|
|
615
|
+
}}
|
|
616
|
+
/>
|
|
617
|
+
<label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
|
|
618
|
+
</form>
|
|
621
619
|
|
|
622
620
|
<div class="container">
|
|
623
621
|
<div class="grist">
|
|
@@ -631,20 +629,16 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
631
629
|
></data-grist>
|
|
632
630
|
</div>
|
|
633
631
|
</div>
|
|
634
|
-
|
|
635
632
|
</div>
|
|
636
633
|
<div class="button-container">
|
|
637
634
|
<mwc-button
|
|
638
635
|
@click="${this._saveDeliveryInfo.bind(this)}"
|
|
639
|
-
label="${
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
: `${i18next.t('button.update')}`
|
|
643
|
-
}"
|
|
636
|
+
label="${this.status === ORDER_STATUS.READY_TO_DISPATCH.value
|
|
637
|
+
? `${i18next.t('button.dispatch')}`
|
|
638
|
+
: `${i18next.t('button.update')}`}"
|
|
644
639
|
raised
|
|
645
640
|
></mwc-button>
|
|
646
641
|
</div>
|
|
647
|
-
|
|
648
642
|
`
|
|
649
643
|
}
|
|
650
644
|
|
|
@@ -652,18 +646,22 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
652
646
|
return this.shadowRoot.querySelector('form[name=deliveryOrderInfo]')
|
|
653
647
|
}
|
|
654
648
|
|
|
655
|
-
get
|
|
656
|
-
return this.shadowRoot.querySelector('form[name=
|
|
649
|
+
get shippingInfoForm() {
|
|
650
|
+
return this.shadowRoot.querySelector('form[name=shippingInfo]')
|
|
657
651
|
}
|
|
658
652
|
|
|
659
|
-
get
|
|
653
|
+
get deliveryAddressForm() {
|
|
660
654
|
return this.shadowRoot.querySelector('form[name=deliveryAddressInfo]')
|
|
661
655
|
}
|
|
662
656
|
|
|
663
|
-
get
|
|
657
|
+
get billingAddressForm() {
|
|
664
658
|
return this.shadowRoot.querySelector('form[name=billingAddressInfo]')
|
|
665
659
|
}
|
|
666
660
|
|
|
661
|
+
get contactPointForm() {
|
|
662
|
+
return this.shadowRoot.querySelector('form[name=contactPointInfo]')
|
|
663
|
+
}
|
|
664
|
+
|
|
667
665
|
get _getBillingPostalCodeInput() {
|
|
668
666
|
return this.shadowRoot.querySelector('select[name=billingPostalCode]')
|
|
669
667
|
}
|
|
@@ -684,6 +682,10 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
684
682
|
return this.shadowRoot.querySelector('input[name=otherDriver]')
|
|
685
683
|
}
|
|
686
684
|
|
|
685
|
+
get otherTruckInput() {
|
|
686
|
+
return this.shadowRoot.querySelector('input[name=otherTruck]')
|
|
687
|
+
}
|
|
688
|
+
|
|
687
689
|
get contactPointInput() {
|
|
688
690
|
return this.shadowRoot.querySelector('input[name=contactPoint]')
|
|
689
691
|
}
|
|
@@ -696,6 +698,22 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
696
698
|
return this.shadowRoot.querySelector('input[name=otherTruck]')
|
|
697
699
|
}
|
|
698
700
|
|
|
701
|
+
get _cityInput() {
|
|
702
|
+
return this.shadowRoot.querySelector('input[name=city]')
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
get _stateInput() {
|
|
706
|
+
return this.shadowRoot.querySelector('input[name=state]')
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
get _cityBillingInput() {
|
|
710
|
+
return this.shadowRoot.querySelector('input[name=billingCity]')
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
get _stateBillingInput() {
|
|
714
|
+
return this.shadowRoot.querySelector('input[name=billingState]')
|
|
715
|
+
}
|
|
716
|
+
|
|
699
717
|
get _truckDriverInput() {
|
|
700
718
|
return this.shadowRoot.querySelector('input[name=ownDriver]')
|
|
701
719
|
}
|
|
@@ -828,19 +846,7 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
828
846
|
html`
|
|
829
847
|
<contact-points-popup
|
|
830
848
|
@selected="${e => {
|
|
831
|
-
this.
|
|
832
|
-
this._attentionTo = e.detail.name
|
|
833
|
-
this._deliveryCountry = 'MALAYSIA'
|
|
834
|
-
this._deliveryCity = e.detail.city ? e.detail.city : ''
|
|
835
|
-
this._selectedPostCode = e.detail.postCode ? e.detail.postCode : ''
|
|
836
|
-
this._deliveryState = e.detail.state ? e.detail.state : ''
|
|
837
|
-
this._deliveryContact = e.detail.phone ? e.detail.phone : ''
|
|
838
|
-
this._deliveryFullAddress = e.detail.address
|
|
839
|
-
? e.detail.address
|
|
840
|
-
: '' + e.detail.address2
|
|
841
|
-
? e.detail.address2
|
|
842
|
-
: ''
|
|
843
|
-
this._billingFullAddress = e.detail.billingAddress
|
|
849
|
+
this._fillUpDeliveryInfo(e.detail)
|
|
844
850
|
}}"
|
|
845
851
|
></contact-points-popup>
|
|
846
852
|
`,
|
|
@@ -880,6 +886,19 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
880
886
|
async _getStateAndCityByPostCode(value, name) {
|
|
881
887
|
const postCode = value
|
|
882
888
|
|
|
889
|
+
// If user select the first empty postal code, the city and state will change to empty
|
|
890
|
+
if (postCode == '') {
|
|
891
|
+
if (name == 'postalCode') {
|
|
892
|
+
this._cityInput.value = ''
|
|
893
|
+
this._stateInput.value = ''
|
|
894
|
+
return
|
|
895
|
+
} else if (name == 'billingPostalCode') {
|
|
896
|
+
this._cityBillingInput.value = ''
|
|
897
|
+
this._stateBillingInput.value = ''
|
|
898
|
+
return
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
|
|
883
902
|
try {
|
|
884
903
|
const response = await client.query({
|
|
885
904
|
query: gql`
|
|
@@ -899,14 +918,14 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
899
918
|
const { stateName, cityName } = response.data.geoAreasGetStateAndCityByPosCode
|
|
900
919
|
|
|
901
920
|
switch (name) {
|
|
902
|
-
case '
|
|
903
|
-
this.
|
|
904
|
-
this.
|
|
921
|
+
case 'postalCode':
|
|
922
|
+
this._cityInput.value = stateName
|
|
923
|
+
this._stateInput.value = cityName.toUpperCase()
|
|
905
924
|
break
|
|
906
925
|
|
|
907
926
|
case 'billingPostalCode':
|
|
908
|
-
this.
|
|
909
|
-
this.
|
|
927
|
+
this._cityBillingInput.value = stateName
|
|
928
|
+
this._stateBillingInput.value = cityName.toUpperCase()
|
|
910
929
|
|
|
911
930
|
default:
|
|
912
931
|
break
|
|
@@ -1045,11 +1064,7 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1045
1064
|
async _saveDeliveryInfo() {
|
|
1046
1065
|
let shippingOrderInfo = {}
|
|
1047
1066
|
|
|
1048
|
-
let contactPointInfo = this._serializeForm(this.
|
|
1049
|
-
|
|
1050
|
-
let deliveryAddressInfo = this._serializeForm(this.getDeliveryAddressInfoForm)
|
|
1051
|
-
|
|
1052
|
-
let billingAddressInfo = this._serializeForm(this.getBillingAddressInfoForm)
|
|
1067
|
+
let contactPointInfo = this._serializeForm(this.shippingInfoForm)
|
|
1053
1068
|
|
|
1054
1069
|
let exportInfo = {}
|
|
1055
1070
|
if (this.shippingOrderForm != null) {
|
|
@@ -1059,28 +1074,21 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1059
1074
|
}
|
|
1060
1075
|
|
|
1061
1076
|
shippingOrderInfo = {
|
|
1062
|
-
...contactPointInfo
|
|
1063
|
-
...deliveryAddressInfo,
|
|
1064
|
-
...billingAddressInfo,
|
|
1065
|
-
shippingOrder: {
|
|
1066
|
-
...exportInfo
|
|
1067
|
-
}
|
|
1077
|
+
...contactPointInfo
|
|
1068
1078
|
}
|
|
1069
1079
|
|
|
1070
1080
|
delete shippingOrderInfo['']
|
|
1081
|
+
delete shippingOrderInfo.matchDeliveryAddressInputa
|
|
1071
1082
|
|
|
1083
|
+
// If match delivery address is ticked, all the billing address info will be the same with delivery address info
|
|
1072
1084
|
if (this._disableBillingAddress) {
|
|
1073
|
-
shippingOrderInfo.billingAddress =
|
|
1074
|
-
shippingOrderInfo.billingPostalCode =
|
|
1075
|
-
shippingOrderInfo.billingCity =
|
|
1076
|
-
shippingOrderInfo.billingState =
|
|
1077
|
-
|
|
1078
|
-
shippingOrderInfo.billingAddress = billingAddressInfo.billingFullAddress
|
|
1085
|
+
shippingOrderInfo.billingAddress = contactPointInfo.deliveryAddress1
|
|
1086
|
+
shippingOrderInfo.billingPostalCode = contactPointInfo.postalCode
|
|
1087
|
+
shippingOrderInfo.billingCity = contactPointInfo.city
|
|
1088
|
+
shippingOrderInfo.billingState = contactPointInfo.state
|
|
1089
|
+
shippingOrderInfo.billingCountry = contactPointInfo.country
|
|
1079
1090
|
}
|
|
1080
1091
|
|
|
1081
|
-
shippingOrderInfo.deliveryAddress = this._deliveryFullAddress
|
|
1082
|
-
shippingOrderInfo.billingCountry = this._billingCountry
|
|
1083
|
-
|
|
1084
1092
|
try {
|
|
1085
1093
|
let response = null
|
|
1086
1094
|
if (this.manualDo) {
|
|
@@ -1110,17 +1118,20 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1110
1118
|
}
|
|
1111
1119
|
})
|
|
1112
1120
|
} else {
|
|
1121
|
+
//** Comment: @Oscar, this class name title is not conform to the naming convention set, kindly change. */
|
|
1113
1122
|
response = await client.mutate({
|
|
1114
1123
|
mutation: gql`
|
|
1115
1124
|
mutation dispatchDeliveryOrder(
|
|
1116
1125
|
$orderInfo: DeliveryOrderPatch
|
|
1117
1126
|
$orderItems: [OrderInventoryPatch!]
|
|
1118
|
-
$
|
|
1127
|
+
$shippingInfo: ShippingOrderInfoPatch
|
|
1128
|
+
$exportInfo: exportInformationPatch
|
|
1119
1129
|
) {
|
|
1120
1130
|
dispatchDeliveryOrder(
|
|
1121
1131
|
orderInfo: $orderInfo
|
|
1122
1132
|
orderItems: $orderItems
|
|
1123
|
-
|
|
1133
|
+
shippingInfo: $shippingInfo
|
|
1134
|
+
exportInfo: $exportInfo
|
|
1124
1135
|
) {
|
|
1125
1136
|
id
|
|
1126
1137
|
name
|
|
@@ -1132,7 +1143,8 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1132
1143
|
variables: {
|
|
1133
1144
|
orderInfo: { ...this._getDeliveryInfo() },
|
|
1134
1145
|
orderItems: this._getOrderItems(),
|
|
1135
|
-
|
|
1146
|
+
shippingInfo: shippingOrderInfo ? shippingOrderInfo : null,
|
|
1147
|
+
exportInfo: exportInfo ? exportInfo : null
|
|
1136
1148
|
}
|
|
1137
1149
|
})
|
|
1138
1150
|
}
|
|
@@ -1295,13 +1307,9 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1295
1307
|
if (!response.errors) {
|
|
1296
1308
|
const releaseOrder = response.data.releaseGoodDetail
|
|
1297
1309
|
// shipment info
|
|
1298
|
-
this._billingFullAddress = releaseOrder?.billingAddress
|
|
1299
|
-
this._deliveryFullAddress = releaseOrder?.deliveryAddress1
|
|
1300
|
-
this._attentionTo = releaseOrder?.attentionTo
|
|
1301
1310
|
this._companyName = releaseOrder?.attentionCompany
|
|
1302
1311
|
this._deliveryCity = releaseOrder?.city
|
|
1303
1312
|
this._deliveryState = releaseOrder?.state
|
|
1304
|
-
this._selectedPostCode = releaseOrder?.postalCode
|
|
1305
1313
|
this._deliveryCountry = releaseOrder?.country
|
|
1306
1314
|
this._deliveryContact = releaseOrder?.phone1
|
|
1307
1315
|
this._selectedBillingPostCode = releaseOrder?.billingPostalCode
|
|
@@ -1329,6 +1337,19 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1329
1337
|
deliveryOrder(name: $name) {
|
|
1330
1338
|
palletQty
|
|
1331
1339
|
ownCollection
|
|
1340
|
+
attentionTo
|
|
1341
|
+
attentionCompany
|
|
1342
|
+
city
|
|
1343
|
+
state
|
|
1344
|
+
postalCode
|
|
1345
|
+
country
|
|
1346
|
+
phone1
|
|
1347
|
+
deliveryAddress1
|
|
1348
|
+
billingAddress
|
|
1349
|
+
billingCountry
|
|
1350
|
+
billingPostalCode
|
|
1351
|
+
billingState
|
|
1352
|
+
billingCity
|
|
1332
1353
|
}
|
|
1333
1354
|
}
|
|
1334
1355
|
`,
|
|
@@ -1337,6 +1358,27 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1337
1358
|
|
|
1338
1359
|
this._ownCollection = response.data.deliveryOrder.ownCollection
|
|
1339
1360
|
|
|
1361
|
+
const deliveryOrder = response.data.deliveryOrder
|
|
1362
|
+
|
|
1363
|
+
this._deliveryOrder = {
|
|
1364
|
+
...deliveryOrder
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
this._fillupDAForm(deliveryOrder)
|
|
1368
|
+
|
|
1369
|
+
this._fillupBLForm(deliveryOrder)
|
|
1370
|
+
|
|
1371
|
+
this._fillupCPForm(deliveryOrder)
|
|
1372
|
+
|
|
1373
|
+
if (
|
|
1374
|
+
deliveryOrder?.postalCode === deliveryOrder?.billingPostalCode &&
|
|
1375
|
+
deliveryOrder?.billingAddress === deliveryOrder?.deliveryAddress1
|
|
1376
|
+
) {
|
|
1377
|
+
this._disableBillingAddress = true
|
|
1378
|
+
} else {
|
|
1379
|
+
this._disableBillingAddress = false
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1340
1382
|
if (response.data.deliveryOrder.ownCollection) {
|
|
1341
1383
|
this._determineOwnCollection = 'Own Transport'
|
|
1342
1384
|
} else {
|
|
@@ -1357,11 +1399,11 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1357
1399
|
const transportFields = this._ownCollection
|
|
1358
1400
|
? {
|
|
1359
1401
|
otherDriver: i18next.t('field.driver_name'),
|
|
1360
|
-
otherTruck: i18next.t('field.
|
|
1402
|
+
otherTruck: i18next.t('field.vehicle_no')
|
|
1361
1403
|
}
|
|
1362
1404
|
: {
|
|
1363
1405
|
ownDriver: i18next.t('field.driver_name'),
|
|
1364
|
-
ownTruck: i18next.t('field.
|
|
1406
|
+
ownTruck: i18next.t('field.vehicle_no')
|
|
1365
1407
|
}
|
|
1366
1408
|
|
|
1367
1409
|
// destination field entries
|
|
@@ -1401,7 +1443,15 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1401
1443
|
if (this.otherDriverInput.value == '') {
|
|
1402
1444
|
throw new Error(i18next.t('text.driver_is_empty'))
|
|
1403
1445
|
}
|
|
1446
|
+
|
|
1447
|
+
if (this.otherTruckInput.value == '') {
|
|
1448
|
+
throw new Error(i18next.t('text.vehicle_no_is_empty'))
|
|
1449
|
+
}
|
|
1404
1450
|
} else {
|
|
1451
|
+
if (this._truckNoInput.value == '') {
|
|
1452
|
+
throw new Error(i18next.t('text.vehicle_no_is_empty'))
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1405
1455
|
if (this._truckDriverInput.value == '') {
|
|
1406
1456
|
throw new Error(i18next.t('text.driver_is_empty'))
|
|
1407
1457
|
}
|
|
@@ -1454,31 +1504,85 @@ class DeliveryNotePopup extends localize(i18next)(LitElement) {
|
|
|
1454
1504
|
}
|
|
1455
1505
|
}
|
|
1456
1506
|
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1507
|
+
_fillUpDeliveryInfo(data) {
|
|
1508
|
+
// remapping according release good table
|
|
1509
|
+
const remapData = {
|
|
1510
|
+
attentionCompany: data.companyName || '',
|
|
1511
|
+
attentionTo: data.name || '',
|
|
1512
|
+
city: data.city || '',
|
|
1513
|
+
state: data.state || '',
|
|
1514
|
+
postalCode: data.postCode || '',
|
|
1515
|
+
country: 'Malaysia',
|
|
1516
|
+
phone1: data.phone || '',
|
|
1517
|
+
deliveryAddress1: data.address ? data.address : '' + data.address2 ? data.address2 : '',
|
|
1518
|
+
billingAddress: data.billingAddress
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
this._selectedPostCode = data.postCode
|
|
1522
|
+
|
|
1523
|
+
this._fillupForm(this.shippingInfoForm, remapData)
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
_resetShippingInfoForm() {
|
|
1527
|
+
this.getContactPointForm.reset()
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
_fillupForm(form, data) {
|
|
1531
|
+
if (form) {
|
|
1532
|
+
form.reset()
|
|
1533
|
+
for (let key in data) {
|
|
1534
|
+
Array.from(form.querySelectorAll('input, textarea', 'select')).forEach(field => {
|
|
1535
|
+
if (field.name === key && field.type === 'checkbox') {
|
|
1536
|
+
field.checked = data[key]
|
|
1537
|
+
} else if (field.name === key && field.type === 'datetime-local') {
|
|
1538
|
+
const datetime = Number(data[key])
|
|
1539
|
+
const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
|
|
1540
|
+
field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
|
|
1541
|
+
} else if (field.name === key) {
|
|
1542
|
+
if (data[key] instanceof Object) {
|
|
1543
|
+
const objectData = data[key]
|
|
1544
|
+
field.value = `${objectData.name} ${objectData.description ? `(${objectData.description})` : ''}`
|
|
1545
|
+
} else {
|
|
1546
|
+
field.value = data[key]
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
})
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1462
1552
|
}
|
|
1463
1553
|
|
|
1464
1554
|
_validateCountry(e) {
|
|
1465
1555
|
if (e.target.value != 'MALAYSIA') {
|
|
1466
|
-
this.
|
|
1556
|
+
this._selectedCountry = e.target.value
|
|
1467
1557
|
} else {
|
|
1468
|
-
this.
|
|
1558
|
+
this._selectedCountry = e.target.value
|
|
1469
1559
|
}
|
|
1470
1560
|
}
|
|
1471
1561
|
|
|
1472
1562
|
_validateBillingCountry(e) {
|
|
1473
1563
|
if (e.target.value != 'MALAYSIA') {
|
|
1474
|
-
this._switchBillingCountryInput = true
|
|
1475
1564
|
this._selectedBillingCountry = e.target.value
|
|
1476
1565
|
} else {
|
|
1477
|
-
this._switchBillingCountryInput = false
|
|
1478
1566
|
this._selectedBillingCountry = e.target.value
|
|
1479
1567
|
}
|
|
1480
1568
|
}
|
|
1481
1569
|
|
|
1570
|
+
_fillupDAForm(data) {
|
|
1571
|
+
this._fillupForm(this.deliveryAddressForm, data)
|
|
1572
|
+
this._selectedCountry = data.country
|
|
1573
|
+
this._deliveryOrder.postalCode = data.postalCode
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
_fillupBLForm(data) {
|
|
1577
|
+
this._fillupForm(this.billingAddressForm, data)
|
|
1578
|
+
this._selectedBillingCountry = data.billingCountry
|
|
1579
|
+
this._deliveryOrder.billingPostalCode = data.billingPostalCode
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
_fillupCPForm(data) {
|
|
1583
|
+
this._fillupForm(this.contactPointForm, data)
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1482
1586
|
_serializeFormRO(form) {
|
|
1483
1587
|
let obj = {}
|
|
1484
1588
|
Array.from(form.querySelectorAll('input, select')).forEach(field => {
|