@things-factory/operato-wms 4.3.37 → 4.3.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +13 -2
  2. package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
  3. package/client/pages/inbound/pallet-label-popup.js +2 -0
  4. package/client/pages/order/arrival-notice/arrival-notice-detail.js +2 -2
  5. package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
  6. package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
  7. package/client/pages/order/release-order/create-release-order.js +500 -6
  8. package/client/pages/order/release-order/release-order-detail.js +760 -169
  9. package/client/pages/order/transport-order/delivery-note-popup.js +970 -126
  10. package/client/pages/order/transport-order/print-delivery-note.js +162 -2
  11. package/client/pages/outbound/loading-product.js +87 -77
  12. package/client/pages/outbound/merged-outbound-worksheet.js +2 -2
  13. package/client/pages/outbound/picking-product.js +11 -7
  14. package/client/pages/outbound/route-label-popup.js +283 -191
  15. package/client/pages/outbound/sorting-product.js +7 -7
  16. package/client/pages/report/inbound-serial-number-report.js +86 -9
  17. package/client/pages/report/inventory-report.js +10 -0
  18. package/client/pages/report/outbound-serial-number-report.js +87 -9
  19. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +10 -5
  20. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
  21. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +11 -5
  22. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  23. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +33 -4
  24. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
  25. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +33 -8
  26. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
  27. package/dist-server/utils/report-query-util.js +3 -2
  28. package/dist-server/utils/report-query-util.js.map +1 -1
  29. package/helps/release-note.ko.md +10 -12
  30. package/helps/release-note.md +10 -12
  31. package/helps/release-note.ms.md +10 -12
  32. package/helps/release-note.zh.md +10 -12
  33. package/package.json +21 -20
  34. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +10 -8
  35. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +10 -7
  36. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +34 -4
  37. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +34 -8
  38. package/server/utils/report-query-util.ts +3 -2
  39. package/translations/en.json +31 -0
  40. package/translations/ko.json +10 -1
  41. package/translations/ms.json +11 -1
  42. package/translations/zh.json +10 -1
@@ -1,6 +1,8 @@
1
1
  import '@things-factory/biz-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import '@things-factory/import-ui'
4
+ import '@things-factory/component-ui'
5
+
4
6
  import '../../components/vas-templates'
5
7
  import '../../order/vas-order/popup/vas-create-popup'
6
8
 
@@ -8,7 +10,7 @@ import gql from 'graphql-tag'
8
10
  import { css, html } from 'lit-element'
9
11
 
10
12
  import { getCodeByName } from '@things-factory/code-base'
11
- import { MultiColumnFormStyles } from '@things-factory/form-ui'
13
+ import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
12
14
  import { i18next, localize } from '@things-factory/i18n-base'
13
15
  import { openPopup } from '@things-factory/layout-base'
14
16
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
@@ -75,13 +77,45 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
75
77
  _packingOption: Boolean,
76
78
  _disableTransport: Boolean,
77
79
  _enableTransportationServiceSetting: Boolean,
78
- _vasExpanded: Boolean
80
+ _vasExpanded: Boolean,
81
+
82
+ /* Shipping Form Field */
83
+ _contactPointId: String,
84
+ _contactPointName: String,
85
+ _companyName: String,
86
+ _attentionTo: String,
87
+ _deliveryCountry: String,
88
+ _deliveryPostCode: Array,
89
+ _deliveryState: String,
90
+ _deliveryCity: String,
91
+ _deliveryContact: String,
92
+ _deliveryFullAddress: String,
93
+ _selectedPostCode: String,
94
+ _selectedDeliveryCountry: String,
95
+ _selectedBillingCountry: String,
96
+ _billingCountry: String,
97
+ _billingPostCode: Array,
98
+ _billingState: String,
99
+ _billingCity: String,
100
+ _billingContact: String,
101
+ _billingFullAddress: String,
102
+ _selectedBillingPostCode: String,
103
+ _switchDeliveryCountryInput: Boolean,
104
+ _switchBillingCountryInput: Boolean,
105
+ _deliveryAllCountry: Array,
106
+ _billingAllCountry: Array,
107
+
108
+ /* Tab Toggle*/
109
+ _showReleasedOrderInfo: Boolean,
110
+ _showShippingInfo: Boolean,
111
+ _disableBillingAddress: Boolean
79
112
  }
80
113
  }
81
114
 
82
115
  static get styles() {
83
116
  return [
84
117
  MultiColumnFormStyles,
118
+ SingleColumnFormStyles,
85
119
  css`
86
120
  :host {
87
121
  display: flex;
@@ -107,6 +141,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
107
141
  margin-right: 20px;
108
142
  padding-left: 0;
109
143
  }
144
+ [title] {
145
+ margin-top: -5px;
146
+ margin-bottom: -5px;
147
+ }
110
148
  [attachment-wrap] {
111
149
  display: flex;
112
150
  flex-direction: row;
@@ -231,8 +269,32 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
231
269
  }
232
270
 
233
271
  render() {
272
+ const RELEASE_ORDER_TABS = {
273
+ RELEASE_ORDER_INFO: i18next.t('label.order'),
274
+ SHIPPING_INFO: i18next.t('label.shipment')
275
+ }
276
+
277
+ const orderSet = {
278
+ [RELEASE_ORDER_TABS.RELEASE_ORDER_INFO]: {},
279
+ [RELEASE_ORDER_TABS.SHIPPING_INFO]: {}
280
+ }
281
+
234
282
  return html`
235
- <form name="releaseOrder" class="multi-column-form" autocomplete="off">
283
+ <form class="single-column-form" autocomplete="off" style="margin-bottom:-18px">
284
+ <div>
285
+ <quick-find-content
286
+ id="order-items-list"
287
+ name="quickFindContent"
288
+ .data="${orderSet}"
289
+ @tabChanged="${e => {
290
+ this._tabChange(e.detail.currentTabKey)
291
+ }}"
292
+ ></quick-find-content>
293
+ </div>
294
+
295
+ </form>
296
+
297
+ <form name="releaseOrder" class="multi-column-form" autocomplete="off" ?hidden="${this._showReleasedOrderInfo}">
236
298
  <fieldset>
237
299
  <legend>${i18next.t('title.release_order')}</legend>
238
300
 
@@ -398,6 +460,174 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
398
460
  </fieldset>
399
461
  </form>
400
462
 
463
+ <form name="deliveryOrderInfo" ?hidden="${this._showShippingInfo}" 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>
478
+
479
+
480
+ <form name="contactPointInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
481
+ <label>${i18next.t('label.company')}</label>
482
+ <input name="companyName" required .value="${this._companyName}" />
483
+
484
+ <label>${i18next.t('label.attention_to')}</label>
485
+ <input name="attentionTo" required .value="${this._attentionTo}" />
486
+
487
+
488
+ </fieldset>
489
+ </form>
490
+
491
+ <form class="multi-column-form" title ?hidden="${this._showShippingInfo}">
492
+ <label>${i18next.t('label.delivery_address')}</label>
493
+ </form>
494
+
495
+
496
+ <form name="deliveryAddressInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
497
+ <!-- delivery -->
498
+ <fieldset>
499
+ <label>${i18next.t('label.country')}</label>
500
+
501
+ <select
502
+ name="deliveryCountry"
503
+ @change=${e => {
504
+ this._validateCountry(e)
505
+ }}
506
+ >
507
+ <option value=${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''} selected>
508
+ ${this._selectedDeliveryCountry ? this._selectedDeliveryCountry : ''}
509
+ </option>
510
+ ${this._deliveryAllCountry?.map(
511
+ (country, key) => html`<option value=${country.name}>${country.name}</option>`
512
+ )}
513
+ </select>
514
+
515
+
516
+ <label>${i18next.t('label.zip_postal_code')}</label>
517
+
518
+ ${
519
+ this._switchDeliveryCountryInput
520
+ ? html` <input name="deliveryPostalCode" required .value="" /> `
521
+ : html`<select
522
+ name="deliveryPostalCode"
523
+ @change=${e => {
524
+ this._getStateAndCityByPostCode(e.target.value, e.target.name)
525
+ }}
526
+ >
527
+ <option value=${this._selectedPostCode ? this._selectedPostCode : ''} selected>
528
+ ${this._selectedPostCode ? this._selectedPostCode : ''}
529
+ </option>
530
+ ${this._deliveryPostCode.map(
531
+ (country, key) => html`<option value=${country.postalCode}>${country.postalCode}</option>`
532
+ )}
533
+ </select>`
534
+ }
535
+
536
+
537
+ <label>${i18next.t('label.state')}</label>
538
+ <input name="deliveryState" required .value="${this._deliveryState}" />
539
+
540
+ <label>${i18next.t('label.city')}</label>
541
+ <input name="deliveryCity" required .value="${this._deliveryCity}" />
542
+
543
+ <label>${i18next.t('label.delivery_address')}</label>
544
+ <textarea name="deliveryFullAddress" required .value="${this._deliveryFullAddress}"></textarea>
545
+
546
+ <label>${i18next.t('label.contact')}</label>
547
+ <input name="contact" required .value="${this._deliveryContact}" />
548
+ </fieldset>
549
+ </form>
550
+
551
+
552
+ <form class="multi-column-form" title ?hidden="${this._showShippingInfo}">
553
+ <label>${i18next.t('label.billing_address')}</label>
554
+ </form>
555
+
556
+ <form name="billingAddressInfo" ?hidden="${this._showShippingInfo}" class="multi-column-form" autocomplete="off">
557
+
558
+ <!-- billing -->
559
+ <fieldset>
560
+
561
+ <label>${i18next.t('label.country')}</label>
562
+
563
+ <select
564
+ name="billingCountry"
565
+ ?disabled=${this._disableBillingAddress ? true : false}
566
+ @change=${e => {
567
+ this._validateBillingCountry(e)
568
+ }}
569
+ >
570
+ <option value=${this._selectedBillingCountry ? this._selectedBillingCountry : ''} selected>
571
+ ${this._selectedBillingCountry ? this._selectedBillingCountry : ''}
572
+ </option>
573
+ ${this._deliveryAllCountry.map(
574
+ (country, key) => html`<option value=${country.name}>${country.name}</option>`
575
+ )}
576
+ </select>
577
+
578
+ <label>${i18next.t('label.zip_postal_code')}</label>
579
+
580
+ ${
581
+ this._switchBillingCountryInput
582
+ ? html`
583
+ <input
584
+ ?disabled=${this._disableBillingAddress ? true : false}
585
+ name="billingPostalCode"
586
+ required
587
+ .value=""
588
+ />
589
+ `
590
+ : html`<select
591
+ ?disabled=${this._disableBillingAddress ? true : false}
592
+ name="billingPostalCode"
593
+ @change=${e => {
594
+ this._getStateAndCityByPostCode(e.target.value, e.target.name)
595
+ }}
596
+ >
597
+ <option value=${this._selectedBillingPostCode ? this._selectedBillingPostCode : ''} selected>
598
+ ${this._selectedBillingPostCode ? this._selectedBillingPostCode : ''}
599
+ </option>
600
+ ${this._billingPostCode.map(
601
+ (country, key) => html`<option value=${country.postalCode}>${country.postalCode}</option>`
602
+ )}
603
+ </select>`
604
+ }
605
+
606
+ <label>${i18next.t('label.state')}</label>
607
+ <input ?disabled=${this._disableBillingAddress ? true : false} name="billingState" required .value="${
608
+ this._billingState
609
+ }" />
610
+
611
+ <label>${i18next.t('label.city')}</label>
612
+ <input ?disabled=${this._disableBillingAddress ? true : false} name="billingCity" required .value="${
613
+ this._billingCity
614
+ }" />
615
+
616
+ <label>${i18next.t('label.billing_address')}</label>
617
+ <textarea ?disabled=${
618
+ this._disableBillingAddress ? true : false
619
+ } name="billingFullAddress" required .value="${this._billingFullAddress}"></textarea>
620
+
621
+ <input type="checkbox" id="matchDeliveryAddress" name="matchDeliveryAddressInputa" @click=${e => {
622
+ e.currentTarget.checked ? (this._disableBillingAddress = true) : (this._disableBillingAddress = false)
623
+ e.currentTarget.checked ? this.matchDeliveryAddress() : ''
624
+ }} />
625
+ <label for="matchDeliveryAddress">${i18next.t('label.match_delivery_address')}</label>
626
+
627
+ </fieldset>
628
+ </form>
629
+
630
+
401
631
  ${
402
632
  this._exportOption
403
633
  ? html`
@@ -441,7 +671,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
441
671
  : ''
442
672
  }
443
673
 
444
- <form class="picking-std-container multi-column-form">
674
+ <form class="picking-std-container multi-column-form" ?hidden="${!this._showShippingInfo}">
445
675
  <fieldset>
446
676
  <legend>${i18next.t('title.inventory_selection_strategy')}</legend>
447
677
  <input
@@ -535,6 +765,26 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
535
765
  return this.shadowRoot.querySelector('form[name=releaseOrder]')
536
766
  }
537
767
 
768
+ get getDeliveryOrderForm() {
769
+ return this.shadowRoot.querySelector('form[name=deliveryOrderInfo]')
770
+ }
771
+
772
+ get getContactPointForm() {
773
+ return this.shadowRoot.querySelector('form[name=contactPointInfo]')
774
+ }
775
+
776
+ get getDeliveryAddressInfoForm() {
777
+ return this.shadowRoot.querySelector('form[name=deliveryAddressInfo]')
778
+ }
779
+
780
+ get getBillingAddressInfoForm() {
781
+ return this.shadowRoot.querySelector('form[name=billingAddressInfo]')
782
+ }
783
+
784
+ get getDeliveryOrderForm() {
785
+ return this.shadowRoot.querySelector('form[name=deliveryOrderInfo]')
786
+ }
787
+
538
788
  get _containerArrivalDateInput() {
539
789
  return this.shadowRoot.querySelector('input[name=containerArrivalDate]')
540
790
  }
@@ -555,6 +805,10 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
555
805
  return this.shadowRoot.querySelector('input[name=warehouseTransport]')
556
806
  }
557
807
 
808
+ get _getBillingPostalCodeInput() {
809
+ return this.shadowRoot.querySelector('select[name=billingPostalCode]')
810
+ }
811
+
558
812
  get _exportOptionInput() {
559
813
  return this.shadowRoot.querySelector('input[name=exportOption]')
560
814
  }
@@ -583,13 +837,23 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
583
837
  return this.shadowRoot.querySelector('input[name=bizplaceName]')
584
838
  }
585
839
 
840
+ get matchDeliveryAddressInput() {
841
+ return this.shadowRoot?.querySelector('input[name=matchDeliveryAddressInputa]')
842
+ }
843
+
586
844
  get _inventoryColumns() {
587
845
  return this.inventoryGrist.columns
588
846
  }
589
847
 
848
+ get quickFindContent() {
849
+ return this.shadowRoot?.querySelector('quick-find-content[name=quickFindContent]')
850
+ }
851
+
590
852
  constructor() {
591
853
  super()
592
854
  this.initProperties()
855
+ this._getAllPostCode()
856
+ this.fetchCountry()
593
857
  this._pickingStd = PICKING_STANDARD.SELECT_BY_PRODUCT.value
594
858
  this._bundleSettingData = []
595
859
  this._vasExpanded = false
@@ -648,6 +912,8 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
648
912
  getCodeByName('PACKING_TYPES')
649
913
  ])
650
914
 
915
+ this.quickFindContent.currentTabKey = i18next.t('label.order')
916
+ this._disableBillingAddress = false
651
917
  this._enableTransportationServiceSetting = enableTransportationServiceSetting
652
918
  this._bizplaces = bizplaces
653
919
  this.packingTypes = packingTypes
@@ -800,6 +1066,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
800
1066
  this.releaseDate = ''
801
1067
  this.collectionOrderNo = ''
802
1068
  this._files = []
1069
+ this._deliveryAllCountry = []
803
1070
  this.containerNo = ''
804
1071
  this.containerArrivalDate = ''
805
1072
  this.containerLeavingDate = ''
@@ -807,15 +1074,41 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
807
1074
  this.inventoryData = { ...this.inventoryData, records: [] }
808
1075
  this.vasData = { ...this.vasData, records: [] }
809
1076
  this.bundleData = { ...this.bundleData, records: [] }
1077
+ this._showReleasedOrderInfo = false
1078
+ this._showShippingInfo = true
1079
+ this._attentionTo = ''
1080
+ this._companyName = ''
1081
+ this._deliveryCountry = 'Malaysia'
1082
+ this._deliveryPostCode = []
1083
+ this._deliveryState = ''
1084
+ this._deliveryCity = ''
1085
+ this._deliveryFullAddress = ''
1086
+ this._deliveryContact = ''
1087
+ this._billingCountry = 'Malaysia'
1088
+ this._billingPostCode = []
1089
+ this._billingState = ''
1090
+ this._billingCity = ''
1091
+ this._billingFullAddress = ''
1092
+ this._billingContact = ''
1093
+ this._selectedPostCode = ''
1094
+ this._selectedBillingPostCode = ''
1095
+ this._switchDeliveryCountryInput = false
1096
+ this._switchBillingCountryInput = false
1097
+ this._disableBillingAddress = false
1098
+ this._selectedDeliveryCountry = 'MALAYSIA'
1099
+ this._selectedBillingCountry = 'MALAYSIA'
810
1100
  }
811
1101
 
812
1102
  resetPage() {
813
1103
  this._selectedVasRecord = null
814
1104
  this._selectedVasRecordIdx = null
815
1105
  this.bundleData = {}
1106
+ this.matchDeliveryAddressInput.checked = false
1107
+ this.quickFindContent.currentTabKey = i18next.t('label.order')
816
1108
  this.initProperties()
817
1109
  this._clearGristConditions()
818
1110
  this._validateTransport()
1111
+ this._getAllPostCode()
819
1112
  }
820
1113
 
821
1114
  async switchPickingType() {
@@ -1513,6 +1806,27 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1513
1806
  }
1514
1807
  }
1515
1808
 
1809
+ async fetchCountry() {
1810
+ const response = await client.query({
1811
+ query: gql`
1812
+ query geoCountriesWithoutParam {
1813
+ geoCountriesWithoutParam {
1814
+ items {
1815
+ id
1816
+ name
1817
+ description
1818
+ }
1819
+ }
1820
+ }
1821
+ `
1822
+ })
1823
+
1824
+ if (!response.error) {
1825
+ this._billingAllCountry = response.data.geoCountriesWithoutParam.items
1826
+ this._deliveryAllCountry = response.data.geoCountriesWithoutParam.items
1827
+ }
1828
+ }
1829
+
1516
1830
  async fetchInventoriesByBundle(productBundleId, bundleReleaseQty) {
1517
1831
  const page = 1
1518
1832
  const limit = 99999
@@ -1603,6 +1917,38 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1603
1917
  this._validateInventories()
1604
1918
  this._validateVas()
1605
1919
 
1920
+ let shippingOrderInfo = {}
1921
+
1922
+ let contactPointInfo = this._serializeForm(this.getContactPointForm)
1923
+
1924
+ let deliveryAddressInfo = this._serializeForm(this.getDeliveryAddressInfoForm)
1925
+
1926
+ let billingAddressInfo = this._serializeForm(this.getBillingAddressInfoForm)
1927
+
1928
+ shippingOrderInfo = {
1929
+ ...contactPointInfo,
1930
+ ...deliveryAddressInfo,
1931
+ ...billingAddressInfo
1932
+ }
1933
+
1934
+ delete shippingOrderInfo['']
1935
+ if (this._disableBillingAddress) {
1936
+ shippingOrderInfo.billingAddress = deliveryAddressInfo.deliveryFullAddress
1937
+ shippingOrderInfo.billingPostalCode = deliveryAddressInfo.deliveryPostalCode
1938
+ shippingOrderInfo.billingCity = deliveryAddressInfo.deliveryCity
1939
+ shippingOrderInfo.billingState = deliveryAddressInfo.deliveryState
1940
+ } else {
1941
+ shippingOrderInfo.billingAddress = billingAddressInfo.billingFullAddress
1942
+ }
1943
+ shippingOrderInfo.deliveryAddress = deliveryAddressInfo.deliveryFullAddress
1944
+ shippingOrderInfo.billingCountry = this._selectedBillingCountry
1945
+
1946
+ delete shippingOrderInfo.deliveryFullAddress
1947
+ delete shippingOrderInfo.billingFullAddress
1948
+ delete shippingOrderInfo.matchDeliveryAddressInputa
1949
+
1950
+ this.matchDeliveryAddressInput
1951
+
1606
1952
  let result = await CustomAlert({
1607
1953
  title: i18next.t('title.are_you_sure'),
1608
1954
  text: i18next.t('text.create_release_order'),
@@ -1639,9 +1985,15 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1639
1985
  mutation generateReleaseGood(
1640
1986
  $releaseGood: NewReleaseGood
1641
1987
  $shippingOrder: ShippingOrderPatch
1988
+ $shippingOrderInfo: ShippingOrderInfoPatch
1642
1989
  $attachments: [Upload!]
1643
1990
  ) {
1644
- generateReleaseGood(releaseGood: $releaseGood, shippingOrder: $shippingOrder, attachments: $attachments) {
1991
+ generateReleaseGood(
1992
+ releaseGood: $releaseGood
1993
+ shippingOrder: $shippingOrder
1994
+ shippingOrderInfo: $shippingOrderInfo
1995
+ attachments: $attachments
1996
+ ) {
1645
1997
  id
1646
1998
  name
1647
1999
  }
@@ -1653,6 +2005,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
1653
2005
  partnerBizplaceId: this._bizplaceId
1654
2006
  },
1655
2007
  shippingOrder: this._exportOption ? this._serializeForm(this.shippingOrderForm) : null,
2008
+ shippingOrderInfo: shippingOrderInfo ? shippingOrderInfo : null,
1656
2009
  attachments: this._document?.files ? this._document.files : undefined
1657
2010
  },
1658
2011
  context: { hasUpload: true }
@@ -2078,9 +2431,111 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2078
2431
  .flat()
2079
2432
  }
2080
2433
 
2434
+ matchDeliveryAddress() {
2435
+ this._billingFullAddress = ''
2436
+ this._billingState = ''
2437
+ this._billingCity = ''
2438
+ this._getBillingPostalCodeInput.value = ''
2439
+ }
2440
+
2441
+ _validateCountry(e) {
2442
+ if (e.target.value != 'MALAYSIA') {
2443
+ this._switchDeliveryCountryInput = true
2444
+ } else {
2445
+ this._switchDeliveryCountryInput = false
2446
+ }
2447
+ }
2448
+
2449
+ _validateBillingCountry(e) {
2450
+ if (e.target.value != 'MALAYSIA') {
2451
+ this._switchBillingCountryInput = true
2452
+ this._selectedBillingCountry = e.target.value
2453
+ } else {
2454
+ this._switchBillingCountryInput = false
2455
+ this._selectedBillingCountry = e.target.value
2456
+ }
2457
+ }
2458
+
2459
+ async _getAllPostCode() {
2460
+ try {
2461
+ const response = await client.query({
2462
+ query: gql`
2463
+ query geoAreasAllPostCode {
2464
+ geoAreasAllPostCode {
2465
+ items {
2466
+ postalCode
2467
+ }
2468
+ total
2469
+ }
2470
+ }
2471
+ `
2472
+ })
2473
+
2474
+ if (!response.errors) {
2475
+ const items = response.data.geoAreasAllPostCode.items
2476
+ this._deliveryPostCode = items
2477
+ this._billingPostCode = items
2478
+ }
2479
+ } catch (e) {
2480
+ this._showToast(e)
2481
+ }
2482
+ }
2483
+
2484
+ async _getStateAndCityByPostCode(value, name) {
2485
+ const postCode = value
2486
+
2487
+ if (postCode == '') {
2488
+ if (name == 'deliveryPostalCode') {
2489
+ this._deliveryState = ''
2490
+ this._deliveryCity = ''
2491
+ return
2492
+ } else if (name == 'billingPostalCode') {
2493
+ this._billingState = ''
2494
+ this._billingCity = ''
2495
+ return
2496
+ }
2497
+ }
2498
+
2499
+ try {
2500
+ const response = await client.query({
2501
+ query: gql`
2502
+ query geoAreasGetStateAndCityByPosCode($postCode: String!) {
2503
+ geoAreasGetStateAndCityByPosCode(postCode: $postCode) {
2504
+ stateName
2505
+ cityName
2506
+ }
2507
+ }
2508
+ `,
2509
+ variables: {
2510
+ postCode
2511
+ }
2512
+ })
2513
+
2514
+ if (!response.errors) {
2515
+ const { stateName, cityName } = response.data.geoAreasGetStateAndCityByPosCode
2516
+
2517
+ switch (name) {
2518
+ case 'deliveryPostalCode':
2519
+ this._deliveryState = stateName
2520
+ this._deliveryCity = cityName.toUpperCase()
2521
+ break
2522
+
2523
+ case 'billingPostalCode':
2524
+ this._billingState = stateName
2525
+ this._billingCity = cityName.toUpperCase()
2526
+
2527
+ default:
2528
+ break
2529
+ }
2530
+ }
2531
+ } catch (error) {
2532
+ this._showToast(e)
2533
+ }
2534
+ }
2535
+
2081
2536
  _serializeForm(form) {
2082
2537
  let obj = {}
2083
- Array.from(form.querySelectorAll('input, select')).forEach(field => {
2538
+ Array.from(form.querySelectorAll('input, select,textarea')).forEach(field => {
2084
2539
  if (!field.hasAttribute('hidden') && field.value) {
2085
2540
  obj[field.name] = field.type === 'checkbox' ? field.checked : field.value
2086
2541
  }
@@ -2269,6 +2724,35 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2269
2724
  )
2270
2725
  }
2271
2726
 
2727
+ _openContactPointSelector() {
2728
+ openPopup(
2729
+ html`
2730
+ <contact-points-popup
2731
+ @selected="${e => {
2732
+ this._companyName = e.detail.companyName
2733
+ this._attentionTo = e.detail.name
2734
+ this._deliveryCountry = 'MALAYSIA'
2735
+ this._deliveryCity = e.detail.city ? e.detail.city : ''
2736
+ this._selectedPostCode = e.detail.postCode ? e.detail.postCode : ''
2737
+ this._deliveryState = e.detail.state ? e.detail.state : ''
2738
+ this._deliveryContact = e.detail.phone ? e.detail.phone : ''
2739
+ this._deliveryFullAddress = e.detail.address
2740
+ ? e.detail.address
2741
+ : '' + e.detail.address2
2742
+ ? e.detail.address2
2743
+ : ''
2744
+ this._billingFullAddress = e.detail.billingAddress
2745
+ }}"
2746
+ ></contact-points-popup>
2747
+ `,
2748
+ {
2749
+ backdrop: true,
2750
+ size: 'large',
2751
+ title: i18next.t('title.select_destination')
2752
+ }
2753
+ )
2754
+ }
2755
+
2272
2756
  async bulkUploadValidateWarehousePartnersProductsQuantity(orderInventories) {
2273
2757
  const response = await client.query({
2274
2758
  query: gql`
@@ -2466,6 +2950,16 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
2466
2950
  }
2467
2951
  }
2468
2952
 
2953
+ _tabChange(key) {
2954
+ if (key == 'order') {
2955
+ this._showReleasedOrderInfo = false
2956
+ this._showShippingInfo = true
2957
+ } else {
2958
+ this._showReleasedOrderInfo = true
2959
+ this._showShippingInfo = false
2960
+ }
2961
+ }
2962
+
2469
2963
  _showToast({ type, message }) {
2470
2964
  document.dispatchEvent(
2471
2965
  new CustomEvent('notify', {