@things-factory/operato-wms 4.3.456 → 4.3.458

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.
@@ -1,22 +1,12 @@
1
1
  import '@things-factory/grist-ui'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import {
5
- css,
6
- html,
7
- LitElement
8
- } from 'lit-element'
4
+ import { css, html, LitElement } from 'lit-element'
9
5
  import { connect } from 'pwa-helpers/connect-mixin'
10
6
 
11
7
  import { DirectPrinter } from '@things-factory/barcode-base'
12
- import {
13
- i18next,
14
- localize
15
- } from '@things-factory/i18n-base'
16
- import {
17
- client,
18
- store
19
- } from '@things-factory/shell'
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { client, store } from '@things-factory/shell'
20
10
  import { isMobileDevice } from '@things-factory/utils'
21
11
 
22
12
  import { PALLET_LABEL_SETTING_KEY } from '../constants'
@@ -127,14 +117,13 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
127
117
  this.data = {
128
118
  records: this.pallets.records
129
119
  .map(record => ({ ...record, startSeq: 1 }))
130
- .sort((a, b) => a.product.sku.localeCompare(b.product.sku))
131
- };
120
+ .sort((a, b) => a.product.sku.localeCompare(b.product.sku))
121
+ }
132
122
  //console.log(this.data.records)
133
123
  }
134
124
  }
135
125
  }
136
126
 
137
-
138
127
  async _printLabel() {
139
128
  try {
140
129
  let labelId = this._palletLabel && this._palletLabel.id
@@ -168,7 +157,10 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
168
157
  orderProductRemark
169
158
  purchaseOrderNo
170
159
  arrivalNoticeRefNo
160
+ arrivalNoticeRefNo2
161
+ arrivalNoticeRefNo3
171
162
  arrivalNoticeNo
163
+ manufactureDate
172
164
  }
173
165
  }
174
166
  `,
@@ -208,7 +200,16 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
208
200
  searchParams.append('orderProductRemark', results[i].orderProductRemark)
209
201
  searchParams.append('purchaseOrderNo', results[i].purchaseOrderNo)
210
202
  searchParams.append('refNo', results[i].arrivalNoticeRefNo)
203
+ searchParams.append('refNo2', results[i].arrivalNoticeRefNo2)
204
+ searchParams.append('refNo3', results[i].arrivalNoticeRefNo3)
211
205
  searchParams.append('ganNo', results[i].arrivalNoticeNo)
206
+ if (typeof results[i].manufactureDate === 'number') {
207
+ let date = new Date(results[i].manufactureDate)
208
+ let year = date.getFullYear()
209
+
210
+ searchParams.append('manufactureYear', year.toString())
211
+ }
212
+
212
213
  try {
213
214
  const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
214
215
  method: 'GET'
@@ -257,8 +258,6 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
257
258
  })
258
259
  )
259
260
  }
260
-
261
-
262
261
  }
263
262
 
264
263
  window.customElements.define('pallet-label-popup', PalletLabelPopup)
@@ -669,6 +669,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
669
669
  uom
670
670
  uomValue
671
671
  manufactureDate
672
+ manufactureYear
672
673
  serialNumbers
673
674
  obsolete
674
675
  transferQty
@@ -725,6 +726,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
725
726
  inventoryItemCount
726
727
  purchaseOrderNo
727
728
  orderProductRemark
729
+ refOrderId
728
730
  arrivalNoticeRefNo
729
731
  arrivalNoticeNo
730
732
  adjustmentCode
@@ -755,11 +757,14 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
755
757
  remark
756
758
  expirationDate
757
759
  manufactureDate
760
+ manufactureYear
758
761
  unitCost
759
762
  adjustmentCode
760
763
  adjustmentNote
761
764
  serialNumbers
762
765
  obsolete
766
+ refOrderId
767
+ arrivalNoticeRefNo
763
768
  partnerDomain {
764
769
  id
765
770
  }
@@ -1549,8 +1554,55 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1549
1554
 
1550
1555
  async printLotLabel() {
1551
1556
  const records = this.dataGrist.selected
1557
+ let bulkRefNo = records.map(itm => itm.refOrderId)
1552
1558
  var labelId = this._palletLabel && this._palletLabel.id
1553
1559
 
1560
+ const filters = [
1561
+ {
1562
+ name: 'refOrderId',
1563
+ operator: 'eq',
1564
+ value: bulkRefNo
1565
+ }
1566
+ ]
1567
+
1568
+ const response = await client.query({
1569
+ query: gql`
1570
+ query arrivalNotices($filters: [Filter!]) {
1571
+ arrivalNotices(filters: $filters) {
1572
+ items {
1573
+ id
1574
+ refNo
1575
+ refNo2
1576
+ refNo3
1577
+ }
1578
+ total
1579
+ }
1580
+ }
1581
+ `,
1582
+ variables: {
1583
+ filters
1584
+ }
1585
+ })
1586
+
1587
+ const arrivalNotices = response.data.arrivalNotices.items
1588
+ const arrivalNoticesMap = {}
1589
+
1590
+ arrivalNotices.forEach(itm => {
1591
+ arrivalNoticesMap[itm.id] = itm
1592
+ })
1593
+
1594
+ records.forEach(record => {
1595
+ const matchingArrivalNotice = arrivalNoticesMap[record.refOrderId]
1596
+ if (matchingArrivalNotice) {
1597
+ record.arrivalNotice = {
1598
+ id: matchingArrivalNotice.id,
1599
+ refNo: matchingArrivalNotice.refNo,
1600
+ refNo2: matchingArrivalNotice.refNo2,
1601
+ refNo3: matchingArrivalNotice.refNo3
1602
+ }
1603
+ }
1604
+ })
1605
+
1554
1606
  if (!labelId) {
1555
1607
  this.showToast({
1556
1608
  type: 'error',
@@ -1578,11 +1630,20 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1578
1630
  searchParams.append('date', dateIn)
1579
1631
  searchParams.append('remark', record.remark)
1580
1632
  searchParams.append('batchRef', record.batchIdRef)
1633
+ searchParams.append('refNo', record.arrivalNoticeRefNo ? record.arrivalNoticeRefNo : '')
1634
+ searchParams.append('refNo2', record.arrivalNotice ? record.arrivalNotice.refNo2 : '')
1635
+ searchParams.append('refNo3', record.arrivalNotice ? record.arrivalNotice.refNo3 : '')
1581
1636
  searchParams.append('expirationDate', record.expirationDate)
1582
1637
  searchParams.append('purchaseOrderNo', record.purchaseOrderNo)
1583
1638
  searchParams.append('orderProductRemark', record.orderProductRemark)
1584
1639
  searchParams.append('refNo', record.arrivalNoticeRefNo)
1585
1640
  searchParams.append('ganNo', record.arrivalNoticeNo)
1641
+ if (typeof record.manufactureDate === 'number') {
1642
+ let date = new Date(record.manufactureDate)
1643
+ let year = date.getFullYear()
1644
+
1645
+ searchParams.append('manufactureYear', year.toString())
1646
+ }
1586
1647
 
1587
1648
  try {
1588
1649
  const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
@@ -695,14 +695,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
695
695
  let fetchOrder = async id => {
696
696
  const response = await client.mutate({
697
697
  mutation: gql`
698
- mutation fetchSellercraftDocument($releaseGoodId: String!) {
699
- fetchSellercraftDocument(releaseGoodId: $releaseGoodId) {
698
+ mutation fetchSellercraftDocument($orderPackageId: String!) {
699
+ fetchSellercraftDocument(orderPackageId: $orderPackageId) {
700
700
  airwayBill
701
701
  invoice
702
702
  }
703
703
  }
704
704
  `,
705
- variables: { releaseGoodId: id }
705
+ variables: { orderPackageId: id }
706
706
  })
707
707
  if (!response.errors) {
708
708
  this.invoice = document.invoice
@@ -720,7 +720,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
720
720
  let invoice = this.invoice
721
721
  // fetch and set variable if invoice not found
722
722
  if (!invoice || invoice.trim() == '') {
723
- let document = await fetchOrder(this.releaseGoodId)
723
+ let document = await fetchOrder(this._orderPackageInformation.orderPackage.id)
724
724
  invoice = document.invoice
725
725
  }
726
726
  let url = new URL(window.location)
@@ -729,7 +729,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
729
729
  let airwayBill = this.airwayBill
730
730
  // fetch and set variable if awb not found
731
731
  if (!airwayBill || airwayBill.trim() == '') {
732
- let document = await fetchOrder(this.releaseGoodId)
732
+ let document = await fetchOrder(this._orderPackageInformation.orderPackage.id)
733
733
  airwayBill = document.airwayBill
734
734
  }
735
735
  if (airwayBill.includes('partner.shopeemobile.com')) {
@@ -17,17 +17,17 @@ module.exports = {
17
17
  // synchronize: false,
18
18
  // logging: true
19
19
  // },
20
- // ormconfig: {
21
- // name: 'default',
22
- // type: 'postgres',
23
- // database: 'postgres',
24
- // username: 'postgres',
25
- // password: 'abcd1234',
26
- // host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
27
- // port: 55432,
28
- // synchronize: false,
29
- // logging: true
30
- // },
20
+ ormconfig: {
21
+ name: 'default',
22
+ type: 'postgres',
23
+ database: 'postgres',
24
+ username: 'postgres',
25
+ password: 'abcd1234',
26
+ host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
27
+ port: 55432,
28
+ synchronize: false,
29
+ logging: true
30
+ },
31
31
  sellercraftIntegrationConfig: {
32
32
  apiKey: 'Et0KqtLvA6e92bDvOywy9eCCud4hpAal8akpqI90'
33
33
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.456",
3
+ "version": "4.3.458",
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.456",
94
+ "@things-factory/sales-ui": "^4.3.458",
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",
@@ -107,8 +107,8 @@
107
107
  "@things-factory/system-ui": "^4.3.434",
108
108
  "@things-factory/transport-base": "^4.3.452",
109
109
  "@things-factory/tutorial-ui": "^4.3.452",
110
- "@things-factory/warehouse-base": "^4.3.452",
111
- "@things-factory/worksheet-base": "^4.3.456"
110
+ "@things-factory/warehouse-base": "^4.3.458",
111
+ "@things-factory/worksheet-base": "^4.3.458"
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": "d46f0de8f4442e965db2b51e51e672a0dad79899"
120
+ "gitHead": "6eacfb960706fcbb043857752fd7c555383a7d27"
121
121
  }