@things-factory/operato-wms 4.3.462 → 4.3.465

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.
@@ -1154,6 +1154,16 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1154
1154
  }
1155
1155
  }
1156
1156
 
1157
+ async _checkExpiryFormat() {
1158
+ const inputExpDate = this.expDateInput.value
1159
+ let intValueYear = parseInt(inputExpDate)
1160
+
1161
+ if (intValueYear > 9999) {
1162
+ this._scanning = false
1163
+ throw new Error(i18next.t('text.please_enter_the_correct_date_format'))
1164
+ }
1165
+ }
1166
+
1157
1167
  async _checkExpiry() {
1158
1168
  let date = new Date()
1159
1169
  const acceptBefore = new Date(date.setDate(date.getDate() + this.__minInboundShelfLife))
@@ -1436,6 +1446,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1436
1446
  this._focusOnExpiryDateInput()
1437
1447
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1438
1448
  }
1449
+
1450
+ await this._checkExpiryFormat()
1439
1451
  }
1440
1452
  }
1441
1453
 
@@ -1471,6 +1483,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1471
1483
  this._focusOnExpiryDateInput()
1472
1484
  throw new Error(i18next.t('text.expiry_date_is_empty'))
1473
1485
  }
1486
+
1487
+ await this._checkExpiryFormat()
1474
1488
  }
1475
1489
 
1476
1490
  return orderProducts
@@ -230,7 +230,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
230
230
  }
231
231
 
232
232
  if (this.isUserBelongsDomain) {
233
- if (this._status === ORDER_STATUS.PROCESSING.value || this._status === ORDER_STATUS.READY_TO_UNLOAD.value) {
233
+ if (this._status === ORDER_STATUS.PROCESSING.value) {
234
234
  actions.push(
235
235
  {
236
236
  title: i18next.t('button.update_order_details'),
@@ -284,6 +284,11 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
284
284
  action: this._updateArrivalNotice.bind(this),
285
285
  ...CommonButtonStyles.add
286
286
  },
287
+ {
288
+ title: i18next.t('button.cancel'),
289
+ action: this._cancelArrivalNotice.bind(this),
290
+ ...CommonButtonStyles.cancel
291
+ },
287
292
  {
288
293
  title: i18next.t('button.arrived'),
289
294
  action: this._checkArrivedNotice.bind(this),
@@ -299,12 +304,34 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
299
304
  ...CommonButtonStyles.add
300
305
  },
301
306
  {
307
+ title: i18next.t('button.cancel'),
308
+ action: this._cancelArrivalNotice.bind(this),
309
+ ...CommonButtonStyles.cancel
310
+ },{
302
311
  title: i18next.t('button.assign_warehouse'),
303
312
  action: this._assignBufferLocation.bind(this),
304
313
  ...CommonButtonStyles.warehouse
305
314
  }
306
315
  )
307
316
  this._showAssignWarehouse = true
317
+ } else if (this._status === ORDER_STATUS.READY_TO_UNLOAD.value) {
318
+ actions.push(
319
+ {
320
+ title: i18next.t('button.update_order_details'),
321
+ action: this._updateArrivalNotice.bind(this),
322
+ ...CommonButtonStyles.add
323
+ },
324
+ {
325
+ title: i18next.t('button.cancel'),
326
+ action: this._cancelArrivalNotice.bind(this),
327
+ ...CommonButtonStyles.cancel
328
+ },
329
+ {
330
+ title: i18next.t('button.edit_product'),
331
+ action: this.openEditProductPopup.bind(this),
332
+ ...CommonButtonStyles.add
333
+ }
334
+ )
308
335
  } else if (
309
336
  this._status === ORDER_STATUS.PENDING_APPROVAL.value &&
310
337
  this.productData.records.some(
@@ -360,6 +387,14 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
360
387
  ...CommonButtonStyles.copy
361
388
  })
362
389
  }
390
+
391
+ if (this._status === ORDER_STATUS.INTRANSIT.value || this._status === ORDER_STATUS.ARRIVED.value || this._status === ORDER_STATUS.READY_TO_UNLOAD.value) {
392
+ actions.push({
393
+ title: i18next.t('button.cancel'),
394
+ action: this._cancelArrivalNotice.bind(this),
395
+ ...CommonButtonStyles.cancel
396
+ })
397
+ }
363
398
  }
364
399
  if (this._status === ORDER_STATUS.REJECTED.value) {
365
400
  titleName = i18next.t('title.rejected_arrival_notice_detail')
@@ -1473,6 +1508,35 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1473
1508
  }
1474
1509
  }
1475
1510
 
1511
+ async _cancelArrivalNotice() {
1512
+ try {
1513
+ let result = await CustomAlert({
1514
+ title: i18next.t('title.are_you_sure'),
1515
+ text: i18next.t('text.you_wont_be_able_to_revert_this'),
1516
+ confirmButton: { text: i18next.t('button.confirm') },
1517
+ cancelButton: { text: i18next.t('button.cancel') }
1518
+ })
1519
+
1520
+ if (!result.value) return
1521
+
1522
+ const response = await client.mutate({
1523
+ mutation: gql`
1524
+ mutation cancelArrivalNotice($name: String!) {
1525
+ cancelArrivalNotice(name: $name)
1526
+ }
1527
+ `,
1528
+ variables: { name: this._ganNo }
1529
+ })
1530
+
1531
+ if (!response.errors) {
1532
+ navigate('arrival_notices')
1533
+ this._showToast({ message: i18next.t('text.arrival_notice_cancelled') })
1534
+ }
1535
+ } catch (e) {
1536
+ this._showToast(e)
1537
+ }
1538
+ }
1539
+
1476
1540
  _openBufferSelector() {
1477
1541
  openPopup(
1478
1542
  html`
@@ -862,8 +862,21 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
862
862
  }
863
863
 
864
864
  if (changedColumn === 'manufactureDate') {
865
- let manufactureDate = new Date(changeRecord.manufactureDate)
865
+ //verify date value
866
+ let getYear = parseInt(changeRecord.manufactureDate.slice(0, 4))
867
+ let getMonth = parseInt(changeRecord.manufactureDate.slice(5, 7))
868
+ let getDay = parseInt(changeRecord.manufactureDate.slice(8, 10))
869
+
870
+ //year must be greater than year 2000
871
+ //month must be between 1 and 12
872
+ //day must be between 1 and 31
873
+ if (getYear < 2000 || getMonth < 1 || getMonth > 12 || getDay < 1 || getDay > 31) {
874
+ throw Error(i18next.t('text.please_enter_the_correct_date_format'))
875
+ }
876
+
877
+ //verify date range
866
878
  let today = new Date()
879
+ let manufactureDate = new Date(changeRecord.manufactureDate)
867
880
 
868
881
  if (manufactureDate > today) {
869
882
  delete event.detail.after[event.detail.column.name]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.462",
3
+ "version": "4.3.465",
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.462",
94
+ "@things-factory/sales-ui": "^4.3.464",
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.461",
111
- "@things-factory/worksheet-base": "^4.3.462"
110
+ "@things-factory/warehouse-base": "^4.3.464",
111
+ "@things-factory/worksheet-base": "^4.3.464"
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": "3913d5eb1cbcd517e2303289386d278d35771a55"
120
+ "gitHead": "8aaa13591defd6c8cee9cf68f1e4bdd82a216d68"
121
121
  }
@@ -1229,6 +1229,7 @@
1229
1229
  "text.already_existed": "row {state.text} is already existed",
1230
1230
  "text.are_empty": "are empty",
1231
1231
  "text.are_you_sure_to_change_the_order_status_to_Done": "are you sure to change the to Done?",
1232
+ "text.arrival_notice_cancelled": "arrival notice cancelled",
1232
1233
  "text.arrival_notice_details_updated": "arrival notice details updated",
1233
1234
  "text.arrival_notice_form_invalid": "arrival notice form invalid",
1234
1235
  "text.arrival_notice_is_arrived": "arrival notice is arrived",
@@ -1551,6 +1552,7 @@
1551
1552
  "text.please_attach_the_file": "please attach the file",
1552
1553
  "text.please_check_your_setting": "please check your setting",
1553
1554
  "text.please_check_your_vas_target": "please check your vas target",
1555
+ "text.please_enter_the_correct_date_format": "please enter the correct date format",
1554
1556
  "text.please_enter_transfer_qty": "please enter transfer quantity",
1555
1557
  "text.please_fill_in_the_shipping_information_in_shipment_tab": "please fill in the shipping information in shipment tab.",
1556
1558
  "text.please_insert_batch_no": "please insert batch no",
@@ -1219,6 +1219,7 @@
1219
1219
  "text.already_existed": "행 {state.text}이(가) 이미 존재 합니다",
1220
1220
  "text.are_empty": "의 값이 없습니다",
1221
1221
  "text.are_you_sure_to_change_the_order_status_to_Done": "완료 처리하시겠습니까?",
1222
+ "text.arrival_notice_cancelled": "[ko]arrival notice cancelled",
1222
1223
  "text.arrival_notice_details_updated": "[ko]arrival notice details updated",
1223
1224
  "text.arrival_notice_form_invalid": "입고주문 폼이 유효하지 않습니다",
1224
1225
  "text.arrival_notice_is_arrived": "입고요청이 도착했습니다",
@@ -1540,6 +1541,7 @@
1540
1541
  "text.please_attach_the_file": "[ko]please attach the file",
1541
1542
  "text.please_check_your_setting": "설정을 확인해 주세요",
1542
1543
  "text.please_check_your_vas_target": "[ko] please check your vas target",
1544
+ "text.please_enter_the_correct_date_format": "[ko] please enter the correct date format",
1543
1545
  "text.please_enter_transfer_qty": "[ko] please enter transfer quantity",
1544
1546
  "text.please_fill_in_the_shipping_information_in_shipment_tab": "[ko] please fill in the shipping information in shipment tab.",
1545
1547
  "text.please_insert_batch_no": "[ko]please insert batch no",
@@ -1195,6 +1195,7 @@
1195
1195
  "text.already_existed": "baris {state.text} telah tersedia",
1196
1196
  "text.are_empty": "adalah mssong",
1197
1197
  "text.are_you_sure_to_change_the_order_status_to_Done": "adakah anda pasti menukar pesanan status kepada Selesai",
1198
+ "text.arrival_notice_cancelled": "notis ketibaan dibatalkan",
1198
1199
  "text.arrival_notice_details_updated": "[ms]arrival notice details updated",
1199
1200
  "text.arrival_notice_form_invalid": "notis ketibaan tidak sah",
1200
1201
  "text.arrival_notice_is_arrived": "notis ketibaan telah tiba",
@@ -1492,6 +1493,7 @@
1492
1493
  "text.please_attach_the_file": "[ms]please attach the file",
1493
1494
  "text.please_check_your_setting": "tolong semak tetapan anda",
1494
1495
  "text.please_check_your_vas_target": "sila semak sasaran vas anda",
1496
+ "text.please_enter_the_correct_date_format": "[ms] please enter the correct date format",
1495
1497
  "text.please_enter_transfer_qty": "[ms] please enter transfer quantity",
1496
1498
  "text.please_fill_in_the_shipping_information_in_shipment_tab": "[ms] please fill in the shipping information in shipment tab.",
1497
1499
  "text.please_insert_batch_no": "[ms]please insert batch no",
@@ -1161,6 +1161,7 @@
1161
1161
  "text.already_existed": "row {state.text} is already existed",
1162
1162
  "text.are_empty": "are empty",
1163
1163
  "text.are_you_sure_to_change_the_order_status_to_Done": "are you sure to change the to Done?",
1164
+ "text.arrival_notice_cancelled": "[zh]arrival notice cancelled",
1164
1165
  "text.arrival_notice_details_updated": "[zh]arrival notice details updated",
1165
1166
  "text.arrival_notice_form_invalid": "arrival notice form invalid",
1166
1167
  "text.arrival_notice_is_arrived": "arrival notice is arrived",
@@ -1459,6 +1460,7 @@
1459
1460
  "text.please_attach_the_file": "[zh]please attach the file",
1460
1461
  "text.please_check_your_setting": "please check your setting",
1461
1462
  "text.please_check_your_vas_target": "[zh] please check your vas target",
1463
+ "text.please_enter_the_correct_date_format": "[zh] please enter the correct date format",
1462
1464
  "text.please_enter_transfer_qty": "[zh] please enter transfer quantity",
1463
1465
  "text.please_fill_in_the_shipping_information_in_shipment_tab": "[zh] please fill in the shipping information in shipment tab.",
1464
1466
  "text.please_insert_batch_no": "[zh]please insert batch no",