@things-factory/operato-wms 4.3.42 → 4.3.43

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.
@@ -74,7 +74,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
74
74
  _deliveryFullAddress: String,
75
75
  _selectedPostCode: String,
76
76
  _selectedDeliveryCountry: String,
77
- _selectedBillingCountry: String,
78
77
  _billingCountry: String,
79
78
  _billingPostCode: Array,
80
79
  _billingState: String,
@@ -82,11 +81,14 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
82
81
  _billingContact: String,
83
82
  _billingFullAddress: String,
84
83
  _selectedBillingPostCode: String,
85
- _switchDeliveryCountryInput: Boolean,
86
- _switchBillingCountryInput: Boolean,
87
84
  _deliveryAllCountry: Array,
88
85
  _billingAllCountry: Array,
89
86
 
87
+ // Refractor
88
+ _shippingInfo: Object,
89
+ _selectedCountry: String,
90
+ _selectedBillingCountry: String,
91
+
90
92
  /* Tab Toggle*/
91
93
  _showReleasedOrderInfo: Boolean,
92
94
  _showShippingInfo: Boolean,
@@ -208,6 +210,29 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
208
210
  .form-container > form {
209
211
  flex: 1;
210
212
  }
213
+
214
+ [hidden] {
215
+ display: none;
216
+ }
217
+
218
+ .section-header {
219
+ grid-column: span 36 / auto !important;
220
+ text-align: left !important;
221
+ margin-top: 10px !important;
222
+ font-weight: 600 !important;
223
+ }
224
+ .quick-find-content-container {
225
+ margin: 0 15px;
226
+ }
227
+
228
+ @media screen and (max-width: 480px) {
229
+ .section-header {
230
+ grid-column: span 12 / auto !important;
231
+ }
232
+ .quick-find-content-container {
233
+ margin: 0;
234
+ }
235
+ }
211
236
  `
212
237
  ]
213
238
  }
@@ -224,17 +249,16 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
224
249
  }
225
250
 
226
251
  return html`
227
- <div>
228
- <quick-find-content
229
- id="order-items-list"
230
- .data="${orderSet}"
231
- .currentTabkey="${this.currentTab.selected}"
232
- @tabChanged="${e => {
233
- this.currentTab = e.detail.currentTabKey
234
- this._tabChange(e.detail.currentTabKey)
235
- }}"
236
- ></quick-find-content>
237
- </div>
252
+ <div class="quick-find-content-container" >
253
+ <quick-find-content
254
+ id="order-items-list"
255
+ name="quickFindContent"
256
+ .data="${orderSet}"
257
+ @tabChanged="${e => {
258
+ this._tabChange(e.detail.currentTabKey)
259
+ }}"
260
+ ></quick-find-content>
261
+ </div>
238
262
 
239
263
  <div ?hidden="${this._showReleasedOrderInfo}">
240
264
  <div class="form-container">
@@ -410,62 +434,46 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
410
434
  </div>
411
435
  </div>
412
436
 
413
- <div ?hidden="${this._showShippingInfo}">
414
- <form name="deliveryOrderInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
415
- <fieldset>
437
+
438
+ <form name="shippingInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
416
439
 
417
440
  <legend>${i18next.t('title.shipping_information')}</legend>
418
441
 
419
- <label>${i18next.t('label.search')}</label>
420
- <input type="hidden" name="contactPointId" value="${this._contactPointId}" />
421
- <input
422
- type="text"
423
- name="contactPointName"
424
- value="${this._contactPointName}"
425
- @click="${this._openContactPointSelector.bind(this)}"
426
- />
427
- </fieldset>
428
- </form>
429
-
430
- <form name="contactPointInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
442
+
431
443
  <label>${i18next.t('label.company')}</label>
432
- <input name="companyName" .value="${this._companyName}" />
444
+ <input name="attentionCompany" .value="${this._releaseOrder.attentionCompany}" />
433
445
 
434
446
  <label>${i18next.t('label.attention_to')}</label>
435
- <input name="attentionTo" .value="${this._attentionTo}" />
447
+ <input name="attentionTo" .value="${this._releaseOrder.attentionTo}" />
436
448
 
437
449
 
438
- </fieldset>
439
- </form>
450
+ <button type="button" @click="${this._openContactPointSelector.bind(this)}">import</button>
440
451
 
441
- <form class="multi-column-form" title ?hidden="${this._showShippingInfo}">
442
- <label>${i18next.t('label.delivery_address')}</label>
443
- </form>
444
452
 
445
- <form name="deliveryAddressInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
446
453
  <!-- delivery -->
447
- <fieldset>
454
+
455
+ <label class="section-header">${i18next.t('label.delivery_address')}</label>
448
456
  <label>${i18next.t('label.country')}</label>
449
457
  <select
450
- name="deliveryCountry"
458
+ name="country"
451
459
  @change=${e => {
452
460
  this._validateCountry(e)
453
461
  }}
454
462
  >
455
- <!-- <option value=${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''} selected>
456
- ${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''}
457
- </option> -->
458
463
  ${this._deliveryAllCountry?.map(
459
- (country, key) => html`<option value=${country.name}>${country.name}</option>`
464
+ (country, key) =>
465
+ html`<option value=${country.name} ?selected=${country.name === this._selectedCountry}>
466
+ ${country.name}
467
+ </option>`
460
468
  )}
461
469
  </select>
462
470
 
463
471
  <label>${i18next.t('label.zip_postal_code')}</label>
464
472
  ${
465
- this._switchDeliveryCountryInput
466
- ? html` <input name="deliveryPostalCode" .value="" /> `
473
+ this._selectedCountry !== 'MALAYSIA'
474
+ ? html` <input name="postalCode" .value="" /> `
467
475
  : html`<select
468
- name="deliveryPostalCode"
476
+ name="postalCode"
469
477
  @change=${e => {
470
478
  this._getStateAndCityByPostCode(e.target.value, e.target.name)
471
479
  }}
@@ -487,43 +495,33 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
487
495
  }
488
496
 
489
497
  <label>${i18next.t('label.state')}</label>
490
- <input name="deliveryState" .value="${this._deliveryState}" />
498
+ <input name="state" .value="${this._releaseOrder.state}" />
491
499
 
492
500
  <label>${i18next.t('label.city')}</label>
493
- <input name="deliveryCity" .value="${this._deliveryCity}" />
501
+ <input name="city" .value="${this._releaseOrder.city}" />
494
502
 
495
503
  <label>${i18next.t('label.delivery_address')}</label>
496
- <textarea name="deliveryFullAddress" .value="${this._deliveryFullAddress}"></textarea>
504
+ <textarea name="deliveryAddress1" .value="${this._releaseOrder.deliveryAddress1}"></textarea>
497
505
 
498
506
  <label>${i18next.t('label.contact')}</label>
499
- <input name="contact" value="${this._deliveryContact}" />
500
- </fieldset>
501
- </form>
502
-
503
-
504
- <form class="multi-column-form" title ?hidden="${this._showShippingInfo}">
505
- <label>${i18next.t('label.billing_address')}</label>
506
- </form>
507
-
508
- <form name="billingAddressInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
507
+ <input name="phone1" value="${this._releaseOrder.phone1}" />
509
508
 
510
509
  <!-- billing -->
511
- <fieldset>
512
-
510
+ <label class="section-header">${i18next.t('label.billing_address')}</label>
513
511
  <label>${i18next.t('label.country')}</label>
514
512
 
515
513
  <select
516
514
  name="billingCountry"
517
- ?disabled=${this._disableBillingAddress ? true : false}
515
+ ?disabled=${this._disableBillingAddress}
518
516
  @change=${e => {
519
517
  this._validateBillingCountry(e)
520
518
  }}
521
519
  >
522
- <option value=${this._selectedBillingCountry ? this._selectedBillingCountry : ''} selected>
523
- ${this._selectedBillingCountry ? this._selectedBillingCountry : ''}
524
- </option>
525
520
  ${this._deliveryAllCountry.map(
526
- (country, key) => html`<option value=${country.name}>${country.name}</option>`
521
+ (country, key) =>
522
+ html`<option value=${country.name} ?selected=${country.name === this._selectedBillingCountry}>
523
+ ${country.name}
524
+ </option>`
527
525
  )}
528
526
  </select>
529
527
 
@@ -532,12 +530,16 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
532
530
 
533
531
 
534
532
  ${
535
- this._switchBillingCountryInput
533
+ this._selectedBillingCountry !== 'MALAYSIA'
536
534
  ? html`
537
- <input ?disabled=${this._disableBillingAddress ? true : false} name="billingPostalCode" .value="" />
535
+ <input
536
+ ?disabled=${this._disableBillingAddress}
537
+ name="billingPostalCode"
538
+ .value=${this._releaseOrder.billingPostalCode}
539
+ />
538
540
  `
539
541
  : html`<select
540
- ?disabled=${this._disableBillingAddress ? true : false}
542
+ ?disabled=${this._disableBillingAddress}
541
543
  name="billingPostalCode"
542
544
  @change=${e => {
543
545
  this._getStateAndCityByPostCode(e.target.value, e.target.name)
@@ -559,32 +561,32 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
559
561
  }
560
562
 
561
563
  <label>${i18next.t('label.state')}</label>
562
- <input ?disabled=${this._disableBillingAddress ? true : false} name="billingState" .value="${
563
- this._billingState
564
+ <input ?disabled=${this._disableBillingAddress} name="billingState" .value="${
565
+ this._releaseOrder.billingState
564
566
  }" />
565
567
 
566
568
  <label>${i18next.t('label.city')}</label>
567
- <input ?disabled=${this._disableBillingAddress ? true : false} name="billingCity" .value="${
568
- this._billingCity
569
+ <input ?disabled=${this._disableBillingAddress} name="billingCity" .value="${
570
+ this._releaseOrder.billingCity
569
571
  }" />
570
572
 
571
573
  <label>${i18next.t('label.billing_address')}</label>
572
- <textarea ?disabled=${this._disableBillingAddress ? true : false} name="billingFullAddress" .value="${
573
- this._billingFullAddress
574
+ <textarea ?disabled=${this._disableBillingAddress} name="billingAddress" .value="${
575
+ this._releaseOrder.billingAddress || ''
574
576
  }"></textarea>
575
577
 
576
578
  <input type="checkbox" id="matchDeliveryAddress" name="matchDeliveryAddressInputa" ?checked=${
577
- this._billingFullAddress == this._deliveryFullAddress &&
578
- this._selectedPostCode == this._selectedBillingPostCode
579
+ this._releaseOrder.postalCode == this._releaseOrder.billingPostalCode &&
580
+ this._releaseOrder.billingAddress == this._releaseOrder.deliveryAddress1
579
581
  } @click=${e => {
580
582
  e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
581
583
  e.currentTarget.checked ? this.matchDeliveryAddress() : ''
582
584
  }} />
583
585
  <label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
584
586
 
585
- </fieldset>
587
+
586
588
  </form>
587
- </div>
589
+
588
590
 
589
591
  ${
590
592
  this._exportOption
@@ -674,13 +676,11 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
674
676
  this._showShippingInfo = true
675
677
  this._attentionTo = ''
676
678
  this._companyName = ''
677
- this._deliveryCountry = 'Malaysia'
678
679
  this._deliveryPostCode = []
679
680
  this._deliveryState = ''
680
681
  this._deliveryCity = ''
681
682
  this._deliveryFullAddress = ''
682
683
  this._deliveryContact = ''
683
- this._billingCountry = 'Malaysia'
684
684
  this._billingPostCode = []
685
685
  this._billingState = ''
686
686
  this._billingCity = ''
@@ -688,10 +688,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
688
688
  this._billingContact = ''
689
689
  this._selectedPostCode = ''
690
690
  this._selectedBillingPostCode = ''
691
- this._switchDeliveryCountryInput = false
692
- this._switchBillingCountryInput = false
693
- this._selectedDeliveryCountry = 'MALAYSIA'
694
- this._selectedBillingCountry = 'MALAYSIA'
695
691
  this.currentTab = {
696
692
  selected: 'order'
697
693
  }
@@ -809,6 +805,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
809
805
  }
810
806
  }
811
807
 
808
+ get shippingInfoForm() {
809
+ return this.shadowRoot.querySelector('form[name=shippingInfo]')
810
+ }
811
+
812
812
  get releaseOrderForm() {
813
813
  return this.shadowRoot.querySelector('form[name=releaseOrder]')
814
814
  }
@@ -873,6 +873,22 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
873
873
  return this.shadowRoot?.querySelector('input[name=matchDeliveryAddressInputa]')
874
874
  }
875
875
 
876
+ get _cityInput() {
877
+ return this.shadowRoot.querySelector('input[name=city]')
878
+ }
879
+
880
+ get _stateInput() {
881
+ return this.shadowRoot.querySelector('input[name=state]')
882
+ }
883
+
884
+ get _cityBillingInput() {
885
+ return this.shadowRoot.querySelector('input[name=billingCity]')
886
+ }
887
+
888
+ get _stateBillingInput() {
889
+ return this.shadowRoot.querySelector('input[name=billingState]')
890
+ }
891
+
876
892
  async pageUpdated(changes) {
877
893
  if (this.active) {
878
894
  if (changes.resourceId) {
@@ -1240,7 +1256,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1240
1256
  releaseUomValueWithUom: inventoryInfo.releaseUomValue + ' ' + inventoryInfo.uom,
1241
1257
  remainUomValueWithUom: `${inventoryInfo.uomValue - inventoryInfo.releaseUomValue} ${inventoryInfo.uom}`,
1242
1258
  status: inventoryInfo.status,
1243
- invStatus: inventoryInfo.status == 'MISSING' ? true : false,
1259
+ invStatus: inventoryInfo.status == 'MISSING',
1244
1260
  existing: true,
1245
1261
  roundedUomValue: `${roundedUomValue} ${inventoryInfo.uom}`,
1246
1262
  addableQty: inventoryInfo.qty - inventoryInfo.lockedQty,
@@ -1262,32 +1278,9 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1262
1278
  this._packingOption = releaseOrder.packingOption
1263
1279
  this._crossDocking = releaseOrder?.crossDocking
1264
1280
 
1265
- // shipment info
1266
- this._billingFullAddress = releaseOrder?.billingAddress || ''
1267
- this._deliveryFullAddress = releaseOrder?.deliveryAddress1
1268
- this._attentionTo = releaseOrder?.attentionTo
1269
- this._companyName = releaseOrder?.attentionCompany
1270
- this._deliveryCity = releaseOrder?.city
1271
- this._deliveryState = releaseOrder?.state
1272
- this._deliveryCountry = releaseOrder?.country
1273
- this._deliveryContact = releaseOrder?.phone1
1274
- this._selectedBillingPostCode = releaseOrder?.billingPostalCode
1275
- this._billingCity = releaseOrder?.billingCity
1276
- this._billingState = releaseOrder?.billingState
1277
- this._billingCountry = releaseOrder?.billingCountry
1278
-
1279
- releaseOrder.deliveryCity = releaseOrder?.city
1280
- releaseOrder.deliveryState = releaseOrder?.state
1281
- releaseOrder.contact = releaseOrder?.phone1
1282
- releaseOrder.deliveryFullAddress = releaseOrder?.deliveryAddress1
1283
- releaseOrder.deliveryCountry = releaseOrder?.country
1284
- releaseOrder.deliveryPostalCode = releaseOrder?.postalCode
1285
- releaseOrder.billingFullAddress = releaseOrder?.billingAddress
1286
- releaseOrder.companyName = releaseOrder?.attentionCompany
1287
-
1288
1281
  if (
1289
- releaseOrder?.billingAddress == releaseOrder?.deliveryAddress1 &&
1290
- releaseOrder?.postalCode == releaseOrder?.billingPostalCode
1282
+ releaseOrder?.postalCode === releaseOrder?.billingPostalCode &&
1283
+ releaseOrder?.billingAddress === releaseOrder.deliveryAddress1
1291
1284
  ) {
1292
1285
  this._disableBillingAddress = true
1293
1286
  } else {
@@ -1311,10 +1304,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1311
1304
 
1312
1305
  this._fillupDAForm(releaseOrder)
1313
1306
 
1314
- this._fillupBLForm(releaseOrder)
1315
-
1316
- this._fillupCPForm(releaseOrder)
1317
-
1318
1307
  if (this._exportOption) {
1319
1308
  this._ownTransport = true
1320
1309
  this._ownTransportInput.checked = true
@@ -1540,15 +1529,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1540
1529
  }
1541
1530
 
1542
1531
  _fillupDAForm(data) {
1543
- this._fillupForm(this.deliveryAddressForm, data)
1544
- }
1545
-
1546
- _fillupBLForm(data) {
1547
- this._fillupForm(this.billingAddressForm, data)
1548
- }
1549
-
1550
- _fillupCPForm(data) {
1551
- this._fillupForm(this.contactPointForm, data)
1532
+ this._fillupForm(this.shippingInfoForm, data)
1533
+ this._selectedCountry = data.country
1534
+ this._selectedBillingCountry = data.billingCountry
1535
+ this._releaseOrder.billingPostalCode = data.billingPostalCode
1552
1536
  }
1553
1537
 
1554
1538
  _fillupForm(form, data) {
@@ -1804,37 +1788,24 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1804
1788
 
1805
1789
  let shippingOrderInfo = {}
1806
1790
 
1807
- let contactPointInfo = this._serializeForm(this.contactPointForm)
1808
-
1809
- let deliveryAddressInfo = this._serializeForm(this.deliveryAddressForm)
1810
-
1811
- let billingAddressInfo = this._serializeForm(this.billingAddressForm)
1791
+ let contactPointInfo = this._serializeForm(this.shippingInfoForm)
1812
1792
 
1813
1793
  shippingOrderInfo = {
1814
- ...contactPointInfo,
1815
- ...deliveryAddressInfo,
1816
- ...billingAddressInfo
1794
+ ...contactPointInfo
1817
1795
  }
1818
1796
 
1819
1797
  delete shippingOrderInfo['']
1798
+ delete shippingOrderInfo.matchDeliveryAddressInputa
1820
1799
 
1821
- if (
1822
- this._disableBillingAddress ||
1823
- (shippingOrderInfo.billingFullAddress == shippingOrderInfo.deliveryFullAddress &&
1824
- shippingOrderInfo.billingPostalCode == shippingOrderInfo.deliveryPostalCode)
1825
- ) {
1826
- shippingOrderInfo.billingAddress = deliveryAddressInfo.deliveryFullAddress
1827
- shippingOrderInfo.billingPostalCode = deliveryAddressInfo.deliveryPostalCode
1828
- shippingOrderInfo.billingCity = deliveryAddressInfo.deliveryCity
1829
- shippingOrderInfo.billingState = deliveryAddressInfo.deliveryState
1830
- } else {
1831
- shippingOrderInfo.billingAddress = billingAddressInfo.billingFullAddress
1800
+ // If match delivery address is ticked, all the billing address info will be the same with delivery address info
1801
+ if (this._disableBillingAddress) {
1802
+ shippingOrderInfo.billingAddress = contactPointInfo.deliveryAddress1
1803
+ shippingOrderInfo.billingPostalCode = contactPointInfo.postalCode
1804
+ shippingOrderInfo.billingCity = contactPointInfo.city
1805
+ shippingOrderInfo.billingState = contactPointInfo.state
1806
+ shippingOrderInfo.billingCountry = contactPointInfo.country
1832
1807
  }
1833
1808
 
1834
- shippingOrderInfo.deliveryAddress = this._deliveryFullAddress
1835
- shippingOrderInfo.billingCountry = this._billingCountry
1836
- delete shippingOrderInfo.matchDeliveryAddressInputa
1837
-
1838
1809
  let afterRemarkValue
1839
1810
  if (releaseOrder?.remark) {
1840
1811
  afterRemarkValue = releaseOrder.remark = releaseOrder.remark.trimStart()
@@ -1896,8 +1867,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1896
1867
  })
1897
1868
 
1898
1869
  if (!response.errors) {
1899
- this.matchDeliveryAddressInput.checked = false
1900
- this._disableBillingAddress = false
1901
1870
  this._showToast({ message: i18next.t('text.release_order_details_updated') })
1902
1871
  await this._fetchReleaseOrder()
1903
1872
  }
@@ -1911,34 +1880,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1911
1880
  html`
1912
1881
  <contact-points-popup
1913
1882
  @selected="${e => {
1914
- this._companyName = e.detail.companyName
1915
- this._attentionTo = e.detail.name
1916
- this._deliveryCountry = 'MALAYSIA'
1917
- this._deliveryCity = e.detail.city ? e.detail.city : ''
1918
- this._deliveryState = e.detail.state ? e.detail.state : ''
1919
- this._selectedPostCode = e.detail.postCode ? e.detail.postCode : ''
1920
- this._deliveryContact = e.detail.phone ? e.detail.phone : ''
1921
- this._deliveryFullAddress = e.detail.address
1922
- ? e.detail.address
1923
- : '' + e.detail.address2
1924
- ? e.detail.address2
1925
- : ''
1926
- this._billingFullAddress = e.detail.billingAddress
1927
-
1928
- const deliveryAddressInfo = {
1929
- deliveryCountry: 'Malaysia',
1930
- deliveryState: e.detail.state ? e.detail.state : '',
1931
- deliveryCity: e.detail.city ? e.detail.city : '',
1932
- deliveryFullAddress: e.detail.address
1933
- ? e.detail.address
1934
- : '' + e.detail.address2
1935
- ? e.detail.address2
1936
- : '',
1937
- deliveryContact: e.detail.phone ? e.detail.phone : '',
1938
- deliveryPostalCode: e.detail.postCode ? e.detail.postCode : ''
1939
- }
1940
-
1941
- this._fillupDAForm(deliveryAddressInfo)
1883
+ this._fillUpDeliveryInfo(e.detail)
1942
1884
  }}"
1943
1885
  ></contact-points-popup>
1944
1886
  `,
@@ -1954,7 +1896,6 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1954
1896
  this._billingFullAddress = ''
1955
1897
  this._billingState = ''
1956
1898
  this._billingCity = ''
1957
- this.billingPostalCodeInput.value = ''
1958
1899
  }
1959
1900
 
1960
1901
  async _getAllPostCode() {
@@ -1987,14 +1928,15 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
1987
1928
  async _getStateAndCityByPostCode(value, name) {
1988
1929
  const postCode = value
1989
1930
 
1931
+ // If user select the first empty postal code, the city and state will change to empty
1990
1932
  if (postCode == '') {
1991
- if (name == 'deliveryPostalCode') {
1992
- this._deliveryState = ''
1993
- this._deliveryCity = ''
1933
+ if (name == 'postalCode') {
1934
+ this._cityInput.value = ''
1935
+ this._stateInput.value = ''
1994
1936
  return
1995
1937
  } else if (name == 'billingPostalCode') {
1996
- this._billingState = ''
1997
- this._billingCity = ''
1938
+ this._cityBillingInput.value = ''
1939
+ this._stateBillingInput.value = ''
1998
1940
  return
1999
1941
  }
2000
1942
  }
@@ -2018,14 +1960,14 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2018
1960
  const { stateName, cityName } = response.data.geoAreasGetStateAndCityByPosCode
2019
1961
 
2020
1962
  switch (name) {
2021
- case 'deliveryPostalCode':
2022
- this._deliveryState = stateName
2023
- this._deliveryCity = cityName.toUpperCase()
1963
+ case 'postalCode':
1964
+ this._cityInput.value = stateName
1965
+ this._stateInput.value = cityName.toUpperCase()
2024
1966
  break
2025
1967
 
2026
1968
  case 'billingPostalCode':
2027
- this._billingState = stateName
2028
- this._billingCity = cityName.toUpperCase()
1969
+ this._cityBillingInput.value = stateName
1970
+ this._stateBillingInput.value = cityName.toUpperCase()
2029
1971
 
2030
1972
  default:
2031
1973
  break
@@ -2135,20 +2077,37 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
2135
2077
  }
2136
2078
  }
2137
2079
 
2080
+ _fillUpDeliveryInfo(data) {
2081
+ // remapping according release good table
2082
+ const remapData = {
2083
+ attentionCompany: data.companyName || '',
2084
+ attentionTo: data.name || '',
2085
+ city: data.city || '',
2086
+ state: data.state || '',
2087
+ postalCode: data.postCode || '',
2088
+ country: 'Malaysia',
2089
+ phone1: data.phone || '',
2090
+ deliveryAddress1: data.address ? data.address : '' + data.address2 ? data.address2 : '',
2091
+ billingAddress: data.billingAddress
2092
+ }
2093
+
2094
+ this._selectedPostCode = data.postCode
2095
+
2096
+ this._fillupForm(this.shippingInfoForm, remapData)
2097
+ }
2098
+
2138
2099
  _validateCountry(e) {
2139
2100
  if (e.target.value != 'MALAYSIA') {
2140
- this._switchDeliveryCountryInput = true
2101
+ this._selectedCountry = e.target.value
2141
2102
  } else {
2142
- this._switchDeliveryCountryInput = false
2103
+ this._selectedCountry = e.target.value
2143
2104
  }
2144
2105
  }
2145
2106
 
2146
2107
  _validateBillingCountry(e) {
2147
2108
  if (e.target.value != 'MALAYSIA') {
2148
- this._switchBillingCountryInput = true
2149
2109
  this._selectedBillingCountry = e.target.value
2150
2110
  } else {
2151
- this._switchBillingCountryInput = false
2152
2111
  this._selectedBillingCountry = e.target.value
2153
2112
  }
2154
2113
  }