@things-factory/operato-wms 4.3.481 → 4.3.485

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.
@@ -630,6 +630,10 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
630
630
  this.focusOnReleaseQtyInput()
631
631
  }
632
632
 
633
+ if (worksheetInfo.source == 'POWRUP') {
634
+ this.fetchPowrupOrderDocument(worksheetInfo.orderPackage.id)
635
+ }
636
+
633
637
  this.updateContext()
634
638
  }
635
639
  }
@@ -806,8 +810,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
806
810
 
807
811
  async printPowrupDocument(type) {
808
812
  try {
809
- if (this.releaseGoodId == undefined) {
810
- throw new Error('Unable to find order id, please rescan your order.')
813
+ if (this._orderPackageInformation.orderPackage.id == undefined) {
814
+ throw new Error('Unable to find package id, please rescan your order.')
811
815
  }
812
816
 
813
817
  // Increment the attempt count
@@ -815,36 +819,12 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
815
819
  this._awbAttempts++
816
820
  }
817
821
 
818
- // get powrup document fetcher function
819
- let fetchOrder = async id => {
820
- const response = await client.mutate({
821
- mutation: gql`
822
- mutation fetchPowrupDocument($releaseGoodId: String!) {
823
- fetchPowrupDocument(releaseGoodId: $releaseGoodId) {
824
- airwayBill
825
- invoice
826
- }
827
- }
828
- `,
829
- variables: { releaseGoodId: id }
830
- })
831
- if (!response.errors) {
832
- this.invoice = document.invoice
833
- this.airwayBill = document.airwayBill
834
-
835
- return {
836
- invoice: response.data.fetchPowrupDocument.invoice,
837
- airwayBill: response.data.fetchPowrupDocument.airwayBill
838
- }
839
- }
840
- }
841
-
842
822
  let convertedPdfUrl = ''
843
823
  if (type == 'invoice') {
844
824
  let invoice = this.invoice
845
825
  // fetch and set variable if invoice not found
846
826
  if (!invoice || invoice.trim() == '') {
847
- let document = await fetchOrder(this.releaseGoodId)
827
+ let document = await this.fetchPowrupOrderDocument(this._orderPackageInformation.orderPackage.id)
848
828
  invoice = document.invoice
849
829
  }
850
830
  let url = new URL(window.location)
@@ -853,7 +833,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
853
833
  let airwayBill = this.airwayBill
854
834
  // fetch and set variable if awb not found
855
835
  if (!airwayBill || airwayBill.trim() == '') {
856
- let document = await fetchOrder(this.releaseGoodId)
836
+ let document = await this.fetchPowrupOrderDocument(this._orderPackageInformation.orderPackage.id)
857
837
  airwayBill = document.airwayBill
858
838
  }
859
839
  if (airwayBill.includes('partner.shopeemobile.com')) {
@@ -880,6 +860,30 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
880
860
  }
881
861
  }
882
862
 
863
+ // get powrup document fetcher function
864
+ async fetchPowrupOrderDocument(id) {
865
+ const response = await client.mutate({
866
+ mutation: gql`
867
+ mutation fetchPowrupDocument($orderPackageId: String!) {
868
+ fetchPowrupDocument(orderPackageId: $orderPackageId) {
869
+ airwayBill
870
+ invoice
871
+ }
872
+ }
873
+ `,
874
+ variables: { orderPackageId: id }
875
+ })
876
+ if (!response.errors) {
877
+ this.invoice = document.invoice
878
+ this.airwayBill = document.airwayBill
879
+
880
+ return {
881
+ invoice: response.data.fetchPowrupDocument.invoice,
882
+ airwayBill: response.data.fetchPowrupDocument.airwayBill
883
+ }
884
+ }
885
+ }
886
+
883
887
  async printInvoice() {
884
888
  var orderDocInfo = await this.getOrderDocument(this.refNo, 'invoice')
885
889
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.481",
3
+ "version": "4.3.485",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -91,7 +91,7 @@
91
91
  "@things-factory/print-ui": "^4.3.434",
92
92
  "@things-factory/product-base": "^4.3.452",
93
93
  "@things-factory/resource-ui": "^4.3.452",
94
- "@things-factory/sales-ui": "^4.3.481",
94
+ "@things-factory/sales-ui": "^4.3.485",
95
95
  "@things-factory/scene-data-transform": "^4.3.381",
96
96
  "@things-factory/scene-excel": "^4.3.381",
97
97
  "@things-factory/scene-firebase": "^4.3.381",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.452",
109
109
  "@things-factory/tutorial-ui": "^4.3.452",
110
110
  "@things-factory/warehouse-base": "^4.3.479",
111
- "@things-factory/worksheet-base": "^4.3.481"
111
+ "@things-factory/worksheet-base": "^4.3.485"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.381",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "8a023dc284142afe63158ce1075eeaefc0f81878"
120
+ "gitHead": "7d6afb8c3f9b107025fcd2717323f46be79e151e"
121
121
  }