@things-factory/operato-wms 4.3.155 → 4.3.156

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 (27) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +1 -1
  2. package/client/pages/bulk-operation/validate-gan-popup.js +18 -1
  3. package/client/pages/components/select-inventory-popup.js +2 -2
  4. package/client/pages/components/select-product-popup.js +35 -6
  5. package/client/pages/constants/adjustment-code.js +30 -0
  6. package/client/pages/constants/index.js +1 -0
  7. package/client/pages/constants/order.js +6 -4
  8. package/client/pages/inventory/inventory-adjustment-approval.js +67 -0
  9. package/client/pages/inventory/inventory-adjustment.js +106 -12
  10. package/client/pages/order/arrival-notice/arrival-notice-detail.js +7 -0
  11. package/client/pages/order/arrival-notice/create-arrival-notice.js +38 -4
  12. package/client/pages/order/arrival-notice/edit-product-popup.js +4 -1
  13. package/client/pages/order/arrival-notice/proceed-edit-product-popup.js +5 -1
  14. package/client/pages/order/arrival-notice/view-product-changes-popup.js +3 -0
  15. package/client/pages/outbound/inventory-reassign-popup.js +18 -2
  16. package/client/pages/outbound/picking-product.js +20 -16
  17. package/client/pages/outbound/worksheet-batch-picking.js +10 -1
  18. package/client/pages/outbound/worksheet-picking.js +10 -2
  19. package/config.development.js +28 -35
  20. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +8 -9
  21. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  22. package/package.json +50 -50
  23. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +8 -9
  24. package/translations/en.json +6 -0
  25. package/translations/ko.json +7 -1
  26. package/translations/ms.json +7 -1
  27. package/translations/zh.json +7 -1
@@ -411,7 +411,7 @@ class BulkOperation extends localize(i18next)(PageView) {
411
411
  uom: raw.uom && raw.uom != '' ? String(raw.uom) : null,
412
412
  packQty: parseInt(raw.packQty || 0),
413
413
  palletQty: parseInt(raw.palletQty || 0),
414
- unitPrice: Number(raw.unitPrice || 0),
414
+ unitPrice: raw.unitPrice,
415
415
  manufactureDate: this._getStdDateStr(mfgDate),
416
416
  etaDate: this._getStdDateStr(etaDate)
417
417
  }
@@ -263,6 +263,11 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
263
263
 
264
264
  async _getValidatedArrivalNoticeItems(rawArrivalNotices, bizplaceId) {
265
265
  try {
266
+ rawArrivalNotices.map(raw => {
267
+ if (raw.unitPrice) {
268
+ raw.unitPrice = parseFloat(raw.unitPrice)
269
+ }
270
+ })
266
271
  const response = await client.query({
267
272
  query: gql`
268
273
  query validateBulkArrivalNotices($rawArrivalNotices: [NewArrivalNotice!], $bizplaceId: String!) {
@@ -299,9 +304,21 @@ class ValidateGanPopup extends localize(i18next)(LitElement) {
299
304
  `,
300
305
  variables: { rawArrivalNotices, bizplaceId }
301
306
  })
302
-
303
307
  if (!response.errors) {
304
308
  this.records = response.data.validateBulkArrivalNotices
309
+ this.records.map(record => {
310
+ if (record.unitPrice) {
311
+ record.unitPrice = record.unitPrice.toFixed(2)
312
+ }
313
+ if (record.unitPrice < 0) {
314
+ if (record.unitPrice == -1) {
315
+ record.unitPrice = 'negative value'
316
+ }
317
+ if (record.unitPrice == -2) {
318
+ record.unitPrice = 'not a number'
319
+ }
320
+ }
321
+ })
305
322
  }
306
323
  } catch (e) {
307
324
  console.error(e)
@@ -480,7 +480,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
480
480
  if (data?.length > 0) {
481
481
  filters.push({
482
482
  name: 'id',
483
- value: data.map(record => record.inventory.id),
483
+ value: data.map(record => record?.inventory?.id),
484
484
  operator: 'notin'
485
485
  })
486
486
  }
@@ -525,7 +525,7 @@ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
525
525
  response.data.inventoriesByPallet.items.map(item => {
526
526
  return {
527
527
  ...item,
528
- location: item.location.name
528
+ location: item?.location?.name
529
529
  }
530
530
  }) || []
531
531
  }
@@ -1,9 +1,16 @@
1
1
  import '@things-factory/grist-ui'
2
2
 
3
3
  import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit-element'
4
+ import {
5
+ css,
6
+ html,
7
+ LitElement
8
+ } from 'lit-element'
5
9
 
6
- import { i18next, localize } from '@things-factory/i18n-base'
10
+ import {
11
+ i18next,
12
+ localize
13
+ } from '@things-factory/i18n-base'
7
14
  import { client } from '@things-factory/shell'
8
15
  import { ScrollbarStyles } from '@things-factory/styles'
9
16
  import { isMobileDevice } from '@things-factory/utils'
@@ -183,6 +190,12 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
183
190
  name: 'uomValue',
184
191
  header: i18next.t('field.uom_value'),
185
192
  width: 120
193
+ },
194
+ {
195
+ type: 'float',
196
+ name: 'costPrice',
197
+ header: i18next.t('field.unit_cost'),
198
+ width: 120
186
199
  }
187
200
  ]
188
201
  }
@@ -208,6 +221,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
208
221
  packingSize
209
222
  uom
210
223
  uomValue
224
+ costPrice
211
225
  product {
212
226
  id
213
227
  name
@@ -215,6 +229,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
215
229
  brand
216
230
  description
217
231
  type
232
+ costPrice
218
233
  }
219
234
  }
220
235
  total
@@ -229,6 +244,13 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
229
244
  total: response.data.productDetails.total || 0,
230
245
  records:
231
246
  response.data.productDetails.items.map(item => {
247
+ if (item.costPrice) {
248
+ item.costPrice = item.costPrice.toFixed(2)
249
+ }
250
+ if (item.costPrice == 0 || item.costPrice == null) {
251
+ item.costPrice = 0
252
+ item.costPrice == item.costPrice.toFixed(2)
253
+ }
232
254
  return {
233
255
  ...item,
234
256
  productName: item.product.name,
@@ -236,7 +258,8 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
236
258
  sku: item.product.sku,
237
259
  brand: item.product.brand,
238
260
  name: item.name,
239
- description: item.product.description
261
+ description: item.product.description,
262
+ costPrice: parseFloat(item.costPrice).toFixed(2)
240
263
  }
241
264
  }) || []
242
265
  }
@@ -255,6 +278,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
255
278
  productName: `${record.name}(${record.description}(${record.sku}))`,
256
279
  isError: false,
257
280
  productBrand: record.brand,
281
+ unitPrice: parseFloat(record.costPrice).toFixed(2),
258
282
  product: {
259
283
  id: record.productId,
260
284
  name: record.name,
@@ -262,7 +286,8 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
262
286
  packingType: record.packingType,
263
287
  packingSize: record.packingSize,
264
288
  primaryUnit: record.uom,
265
- primaryValue: record.uomValue
289
+ primaryValue: record.uomValue,
290
+ costPrice: parseFloat(record.costPrice).toFixed(2)
266
291
  }
267
292
  }
268
293
  })
@@ -284,6 +309,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
284
309
  productName: `${selectedProduct.name}(${selectedProduct.description}(${selectedProduct.sku}))`,
285
310
  isError: false,
286
311
  productBrand: selectedProduct.brand,
312
+ unitPrice: parseFloat(selectedProduct.costPrice).toFixed(2),
287
313
  product: {
288
314
  id: selectedProduct.productId,
289
315
  name: selectedProduct.name,
@@ -291,7 +317,8 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
291
317
  packingType: selectedProduct.packingType,
292
318
  packingSize: selectedProduct.packingSize,
293
319
  primaryUnit: selectedProduct.uom,
294
- primaryValue: selectedProduct.uomValue
320
+ primaryValue: selectedProduct.uomValue,
321
+ costPrice: parseFloat(selectedProduct.costPrice).toFixed(2)
295
322
  }
296
323
  }
297
324
  })
@@ -313,6 +340,7 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
313
340
  uomValue: itm.uomValue,
314
341
  productName: `${itm.name}(${itm.description}(${itm.sku}))`,
315
342
  isError: false,
343
+ unitPrice: parseFloat(itm.costPrice).toFixed(2),
316
344
  productBrand: itm.brand,
317
345
  product: {
318
346
  id: itm.productId,
@@ -321,7 +349,8 @@ class SelectProductPopup extends localize(i18next)(LitElement) {
321
349
  packingType: itm.packingType,
322
350
  packingSize: itm.packingSize,
323
351
  primaryUnit: itm.uom,
324
- primaryValue: itm.uomValue
352
+ primaryValue: itm.uomValue,
353
+ costPrice: parseFloat(itm.costPrice).costPrice
325
354
  }
326
355
  }
327
356
  })
@@ -0,0 +1,30 @@
1
+ export const ADJUSTMENT_CODE = {
2
+ AC01: {
3
+ name: 'AC-01: LOST INVENTORY',
4
+ value: 'AC-01: LOST INVENTORY'
5
+ },
6
+ AC02: {
7
+ name: 'AC-02: DAMAGE',
8
+ value: 'AC-02: DAMAGE'
9
+ },
10
+ AC03: {
11
+ name: 'AC-03: SHELF LIFE',
12
+ value: 'AC-03: SHELF LIFE'
13
+ },
14
+ AC04: {
15
+ name: 'AC-04: STOCK NUMBER CHANGE',
16
+ value: 'AC-04: STOCK NUMBER CHANGE'
17
+ },
18
+ AC05: {
19
+ name: 'AC-05: OWNERSHIP CHANGE',
20
+ value: 'AC-05: OWNERSHIP CHANGE'
21
+ },
22
+ AC06: {
23
+ name: 'AC-06: TRANSFER',
24
+ value: 'AC-06: TRANSFER'
25
+ },
26
+ AC07: {
27
+ name: 'AC-07: OTHERS',
28
+ value: 'AC-07: OTHERS'
29
+ }
30
+ }
@@ -17,3 +17,4 @@ export * from './pallet'
17
17
  export * from './platform'
18
18
  export * from './group-type'
19
19
  export * from './tote'
20
+ export * from './adjustment-code'
@@ -48,8 +48,8 @@ export const ORDER_STATUS = {
48
48
  INTRANSIT: { name: 'order_status_intransit', value: 'INTRANSIT' },
49
49
  ARRIVED: { name: 'order_status_arrived', value: 'ARRIVED' },
50
50
  RECEIVED: { name: 'order_status_received', value: 'RECEIVED' },
51
- READY_TO_UNLOAD: { name: 'ready_to_unload', value: 'READY_TO_UNLOAD' },
52
- PUTTING_AWAY: { name: 'putting_away', value: 'PUTTING_AWAY' },
51
+ READY_TO_UNLOAD: { name: 'order_status_ready_to_unload', value: 'READY_TO_UNLOAD' },
52
+ PUTTING_AWAY: { name: 'order_status_putting_away', value: 'PUTTING_AWAY' },
53
53
  PROCESSING: { name: 'order_status_processing', value: 'PROCESSING' },
54
54
  DONE: { name: 'order_status_done', value: 'DONE' },
55
55
  COLLECTING: { name: 'order_status_collecting', value: 'COLLECTING' },
@@ -64,7 +64,8 @@ export const ORDER_STATUS = {
64
64
  LOADING: { name: 'order_status_loading', value: 'LOADING' },
65
65
  READY_TO_DISPATCH: { name: 'order_status_ready_to_dispatch', value: 'READY_TO_DISPATCH' },
66
66
  READY_TO_EXECUTE: { name: 'order_status_ready_to_execute', value: 'READY_TO_EXECUTE' },
67
- READY_TO_SEND: { name: 'order_status_ready_to_send', value: 'READY_TO_SEND' }
67
+ READY_TO_SEND: { name: 'order_status_ready_to_send', value: 'READY_TO_SEND' },
68
+ OBSOLETE: { name: 'order_status_obsolete', value: 'OBSOLETE' }
68
69
  }
69
70
 
70
71
  export const MANIFEST_STATUS = {
@@ -123,7 +124,8 @@ export const ORDER_INVENTORY_STATUS = {
123
124
  TERMINATED: { name: 'inventory_status_terminated', value: 'TERMINATED' },
124
125
  DONE: { name: 'inventory_status_done', value: 'DONE' },
125
126
  CANCELLED: { name: 'inventory_status_cancelled', value: 'CANCELLED' },
126
- PENDING_CANCEL: { name: 'inventory_status_pending_cancel', value: 'PENDING_CANCEL' }
127
+ PENDING_CANCEL: { name: 'inventory_status_pending_cancel', value: 'PENDING_CANCEL' },
128
+ OBSOLETE: { name: 'inventory_status_obsolete', value: 'OBSOLETE' }
127
129
  }
128
130
 
129
131
  export const ORDER_VAS_STATUS = {
@@ -121,6 +121,14 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
121
121
  return this.shadowRoot.querySelector('search-form')
122
122
  }
123
123
 
124
+ get _fromDateInput() {
125
+ return this.searchForm.shadowRoot.querySelector('input[name=fromDate]')
126
+ }
127
+
128
+ get _toDateInput() {
129
+ return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
130
+ }
131
+
124
132
  async pageInitialized() {
125
133
  this._selectedInventoryChange = null
126
134
  this._lockedPallet = []
@@ -133,6 +141,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
133
141
  { column: 'packingType', name: 'Packing Type' },
134
142
  { column: 'packingSize', name: 'Packing Size' },
135
143
  { column: 'bizplace', name: 'Customer' },
144
+ { column: 'sku', name: 'SKU' },
136
145
  { column: 'product', name: 'Product' },
137
146
  { column: 'location', name: 'Location' },
138
147
  { column: 'qty', name: 'Quantity' },
@@ -141,6 +150,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
141
150
  { column: 'expirationDate', name: 'Exp. Date' },
142
151
  { column: 'manufactureDate', name: 'Mfg. Date' },
143
152
  { column: 'unitCost', name: 'Unit Cost' },
153
+ { column: 'adjustmentCode', name: 'Adjustment Code' },
154
+ { column: 'adjustmentNote', name: 'Note' },
144
155
  { column: 'inventoryItemChange', name: 'Inventory Item Changes' },
145
156
  { column: 'status', name: 'Status' }
146
157
  ]
@@ -182,6 +193,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
182
193
  break
183
194
  }
184
195
 
196
+ compareData.sku = compareData?.product?.sku
197
+
185
198
  if (compareData == null) {
186
199
  this._compareColumn.map(item => {
187
200
  if (record[item.column]) {
@@ -361,6 +374,38 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
361
374
  })
362
375
  ],
363
376
  props: { searchOper: 'eq' }
377
+ },
378
+ {
379
+ label: i18next.t('field.from_date'),
380
+ name: 'fromDate',
381
+ type: 'date',
382
+ props: {
383
+ searchOper: 'eq',
384
+ max: new Date().toISOString().split('T')[0]
385
+ },
386
+ attrs: ['custom'],
387
+ value: (() => {
388
+ let date = new Date()
389
+ date.setMonth(date.getMonth() - 1)
390
+ return date.toISOString().split('T')[0]
391
+ })(),
392
+ handlers: { change: this._modifyDateRange.bind(this) }
393
+ },
394
+ {
395
+ label: i18next.t('field.to_date'),
396
+ name: 'toDate',
397
+ type: 'date',
398
+ props: {
399
+ searchOper: 'eq',
400
+ min: (() => {
401
+ let date = new Date()
402
+ date.setMonth(date.getMonth() - 1)
403
+ return date.toISOString().split('T')[0]
404
+ })(),
405
+ max: new Date().toISOString().split('T')[0]
406
+ },
407
+ attrs: ['custom'],
408
+ value: new Date().toISOString().split('T')[0]
364
409
  }
365
410
  ]
366
411
  }
@@ -393,6 +438,9 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
393
438
  expirationDate
394
439
  manufactureDate
395
440
  unitCost
441
+ adjustmentCode
442
+ adjustmentNote
443
+ sku
396
444
  bizplace {
397
445
  id
398
446
  name
@@ -401,6 +449,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
401
449
  product {
402
450
  id
403
451
  name
452
+ sku
404
453
  description
405
454
  type
406
455
  }
@@ -424,6 +473,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
424
473
  product {
425
474
  id
426
475
  name
476
+ sku
427
477
  description
428
478
  type
429
479
  }
@@ -438,6 +488,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
438
488
  expirationDate
439
489
  manufactureDate
440
490
  unitCost
491
+ adjustmentCode
492
+ adjustmentNote
441
493
  }
442
494
  lastInventoryHistory {
443
495
  batchId
@@ -452,6 +504,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
452
504
  }
453
505
  product {
454
506
  id
507
+ sku
455
508
  name
456
509
  description
457
510
  type
@@ -531,6 +584,20 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
531
584
  }
532
585
  }
533
586
 
587
+ _modifyDateRange(e) {
588
+ const fromDate = e.currentTarget.value
589
+
590
+ if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
591
+
592
+ let min = new Date(fromDate)
593
+ let today = new Date()
594
+ today.setHours(0, 0, 0, 0)
595
+
596
+ min = min.toISOString().split('T')[0]
597
+
598
+ this._toDateInput.min = min
599
+ }
600
+
534
601
  async _fetchPartners() {
535
602
  const response = await client.query({
536
603
  query: gql`
@@ -10,7 +10,6 @@ import { css, html } from 'lit-element'
10
10
  import { connect } from 'pwa-helpers/connect-mixin'
11
11
 
12
12
  import { DirectPrinter } from '@things-factory/barcode-base'
13
- import { getCodeByName } from '@things-factory/code-base'
14
13
  import { i18next, localize } from '@things-factory/i18n-base'
15
14
  import { openPopup } from '@things-factory/layout-base'
16
15
  import { client, CustomAlert, PageView, store } from '@things-factory/shell'
@@ -18,8 +17,12 @@ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
18
17
  import { isMobileDevice } from '@things-factory/utils'
19
18
 
20
19
  import { fetchPageSettings } from '../../util/index'
21
-
22
- import { CARTON_LABEL_SETTING_KEY, INVENTORY_ITEM_CHANGE_TYPE, PALLET_LABEL_SETTING_KEY } from '../constants'
20
+ import {
21
+ ADJUSTMENT_CODE,
22
+ CARTON_LABEL_SETTING_KEY,
23
+ INVENTORY_ITEM_CHANGE_TYPE,
24
+ PALLET_LABEL_SETTING_KEY
25
+ } from '../constants'
23
26
 
24
27
  class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
25
28
  static get styles() {
@@ -323,6 +326,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
323
326
  { name: 'packingType', header: i18next.t('field.packing_type'), width: 200 },
324
327
  { name: 'packingSize', header: i18next.t('field.packing_size'), width: 150 },
325
328
  { name: 'uom', header: i18next.t('field.uom'), width: 150 },
329
+ { name: 'costPrice', header: i18next.t('field.unit_cost'), width: 150 },
326
330
  {
327
331
  name: 'isRequireSerialNumberScanningInbound',
328
332
  header: i18next.t('field.require_serial_number_scanning_inbound'),
@@ -479,6 +483,13 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
479
483
  sortable: true,
480
484
  width: 120
481
485
  },
486
+ {
487
+ type: 'boolean',
488
+ name: 'obsolete',
489
+ header: i18next.t('field.obsolete'),
490
+ record: { editable: false },
491
+ width: 80
492
+ },
482
493
  {
483
494
  type: 'date',
484
495
  name: 'expirationDate',
@@ -530,6 +541,42 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
530
541
  },
531
542
  width: 80
532
543
  },
544
+ {
545
+ type: 'select',
546
+ name: 'adjustmentCode',
547
+ header: i18next.t('field.adjustment_code'),
548
+ record: {
549
+ editable: true,
550
+ options: [
551
+ '',
552
+ ...Object.values(ADJUSTMENT_CODE)
553
+ .map(ac => ac.value)
554
+ .sort()
555
+ ]
556
+ },
557
+ imex: {
558
+ header: i18next.t('field.adjustment_code'),
559
+ key: 'adjustmentCode',
560
+ width: 30,
561
+ type: 'array',
562
+ arrData: Object.values(ADJUSTMENT_CODE).map(ac => {
563
+ return {
564
+ name: ac.name
565
+ }
566
+ })
567
+ },
568
+ sortable: true,
569
+ width: 200
570
+ },
571
+ {
572
+ type: 'string',
573
+ name: 'adjustmentNote',
574
+ header: i18next.t('field.adjustment_note'),
575
+ imex: { header: i18next.t('field.adjustment_note'), key: 'adjustmentNote', width: 30, type: 'string' },
576
+ record: { editable: true },
577
+ sortable: true,
578
+ width: 200
579
+ },
533
580
  {
534
581
  type: 'datetime',
535
582
  name: 'updatedAt',
@@ -574,6 +621,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
574
621
  uomValue
575
622
  manufactureDate
576
623
  serialNumbers
624
+ obsolete
577
625
  bizplace {
578
626
  id
579
627
  name
@@ -591,9 +639,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
591
639
  type
592
640
  isRequireSerialNumberScanningOutbound
593
641
  isRequireSerialNumberScanningInbound
642
+ costPrice
594
643
  }
595
644
  productDetail {
596
645
  id
646
+ costPrice
597
647
  }
598
648
  qty
599
649
  lockedQty
@@ -622,6 +672,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
622
672
  orderProductRemark
623
673
  arrivalNoticeRefNo
624
674
  arrivalNoticeNo
675
+ adjustmentCode
676
+ adjustmentNote
625
677
  }
626
678
  total
627
679
  }
@@ -649,7 +701,10 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
649
701
  expirationDate
650
702
  manufactureDate
651
703
  unitCost
704
+ adjustmentCode
705
+ adjustmentNote
652
706
  serialNumbers
707
+ obsolete
653
708
  bizplace {
654
709
  id
655
710
  name
@@ -662,9 +717,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
662
717
  name
663
718
  description
664
719
  productInformation
720
+ costPrice
665
721
  }
666
722
  productDetail {
667
723
  id
724
+ costPrice
668
725
  }
669
726
  qty
670
727
  lockedQty
@@ -701,6 +758,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
701
758
  ...item,
702
759
  sku: item.product.sku,
703
760
  brand: item.product.brand,
761
+ unitPrice: parseFloat(item.product.unitPrice).toFixed(2),
704
762
  lockedQty: item.lockedQty || 0,
705
763
  remainQty: item.qty - (item.lockedQty || 0)
706
764
  }
@@ -762,7 +820,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
762
820
 
763
821
  switch (e.detail.column.name) {
764
822
  case 'batchId':
765
- if(e.detail.after == '' || e.detail.after == null || e.detail.after.toString() == NaN.toString()){
823
+ if (e.detail.after == '' || e.detail.after == null || e.detail.after.toString() == NaN.toString()) {
766
824
  item._data.records[e.detail.row].batchId = e.detail.before
767
825
  this.showToast({ level: 'error', message: i18next.t('text.invalid_batch_no') })
768
826
  }
@@ -802,13 +860,32 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
802
860
  this.showToast({ message: i18next.t('text.invalid_manufacture_date') })
803
861
  }
804
862
  break
863
+ case 'adjustmentCode':
864
+ if (e.detail.after == '' || e.detail.after == null || e.detail.after.toString() == NaN.toString()) {
865
+ item._data.records[e.detail.row].adjustmentCode = e.detail.before
866
+ this.showToast({ level: 'error', message: i18next.t('text.invalid_adjustment_code') })
867
+ }
868
+ break
869
+ case 'adjustmentNote':
870
+ if (e.detail.after == '' || e.detail.after == null || e.detail.after.toString() == NaN.toString()) {
871
+ item._data.records[e.detail.row].adjustmentNote = e.detail.before
872
+ this.showToast({ level: 'error', message: i18next.t('text.invalid_adjustment_note') })
873
+ }
874
+ break
805
875
  case 'product':
806
876
  item._data.records[e.detail.row].uom = e.detail.after?.uom ? e.detail.after.uom : ''
807
877
  item._data.records[e.detail.row].packingType = e.detail.after?.packingType ? e.detail.after.packingType : ''
808
878
  item._data.records[e.detail.row].packingSize = e.detail.after?.packingSize ? e.detail.after.packingSize : 1
809
879
  item._data.records[e.detail.row].brand = e.detail.after?.brand ? e.detail.after.brand : ''
810
880
  item._data.records[e.detail.row].sku = e.detail.after?.sku ? e.detail.after.sku : ''
881
+
882
+ if (e.detail.before == undefined) {
883
+ item._data.records[e.detail.row].unitCost = e.detail.after?.costPrice ? e.detail.after.costPrice : undefined
884
+ } else {
885
+ item._data.records[e.detail.row].unitCost
886
+ }
811
887
  break
888
+
812
889
  case 'bizplace':
813
890
  item._data.records[e.detail.row].uom = ''
814
891
  item._data.records[e.detail.row].packingType = ''
@@ -886,7 +963,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
886
963
  delete row.productUomValue
887
964
  delete row.inventoryItemCount
888
965
 
889
- if (new Date(row.expirationDate) < new Date()){
966
+ if (new Date(row.expirationDate) < new Date()) {
890
967
  throw new Error(i18next.t('text.invalid_expiration_date'))
891
968
  }
892
969
 
@@ -898,6 +975,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
898
975
  !row.batchId ||
899
976
  !row.qty ||
900
977
  !row.uomValue ||
978
+ !row.adjustmentCode ||
979
+ !row.adjustmentNote ||
901
980
  !row.uom ||
902
981
  row?.uom.trim() == ''
903
982
  ) {
@@ -911,7 +990,9 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
911
990
  (row.hasOwnProperty('uom') && row.uom?.trim() == '') ||
912
991
  (row.hasOwnProperty('packingType') && row.packingType?.trim() == '') ||
913
992
  (row.hasOwnProperty('unitCost') && (row.unitCost == null || row.unitCost < 0)) ||
914
- (row.hasOwnProperty('packingSize') && (row.packingSize == null || row.packingSize < 0))
993
+ (row.hasOwnProperty('packingSize') && (row.packingSize == null || row.packingSize < 0)) ||
994
+ (row.hasOwnProperty('adjustmentCode') && row.adjustmentCode?.trim() == '') ||
995
+ (row.hasOwnProperty('adjustmentNote') && row.adjustmentNote?.trim() == '')
915
996
  ) {
916
997
  throw new Error(i18next.t('text.empty_value_in_list'))
917
998
  }
@@ -932,7 +1013,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
932
1013
  return row
933
1014
  })
934
1015
 
935
- if (patches.length == 0){
1016
+ if (patches.length == 0) {
936
1017
  this.showToast({ message: i18next.t('text.nothing_updated') })
937
1018
  }
938
1019
 
@@ -993,11 +1074,17 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
993
1074
  if (new Date(itm?.manufactureDate) > new Date()) {
994
1075
  throw new Error(i18next.t('text.invalid_manufacture_date'))
995
1076
  }
996
- if (itm.expirationDate != null){
997
- if (new Date(itm.expirationDate) < new Date()){
998
- throw new Error(i18next.t('text.invalid_expiration_date'))
1077
+ if (itm.expirationDate != null) {
1078
+ if (new Date(itm.expirationDate) < new Date()) {
1079
+ throw new Error(i18next.t('text.invalid_expiration_date'))
999
1080
  }
1000
1081
  }
1082
+ if (itm?.adjustmentCode?.trim() == '') {
1083
+ throw new Error(i18next.t('text.invalid_adjustment_code'))
1084
+ }
1085
+ if (itm?.adjustmentNote?.trim() == '') {
1086
+ throw new Error(i18next.t('text.invalid_adjustment_note'))
1087
+ }
1001
1088
 
1002
1089
  if (itm.cuFlag == '+') {
1003
1090
  if (
@@ -1008,7 +1095,9 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1008
1095
  !itm.qty ||
1009
1096
  !itm.uomValue ||
1010
1097
  !itm.uom ||
1011
- !itm.packingType
1098
+ !itm.packingType ||
1099
+ !itm.adjustmentCode ||
1100
+ !itm.adjustmentNote
1012
1101
  ) {
1013
1102
  throw new Error(i18next.t('text.empty_value_in_list'))
1014
1103
  }
@@ -1027,7 +1116,12 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1027
1116
  itm.qty = parseInt(itm.qty)
1028
1117
  itm.packingSize = parseFloat(itm.packingSize)
1029
1118
  itm.uomValue = parseFloat(itm.uomValue)
1030
- itm.unitCost = parseFloat(itm.unitCost)
1119
+ if (itm.unitCost == null && itm.unitCost != 0) {
1120
+ itm.unitCost = null
1121
+ }
1122
+ if (itm.unitCost != null) {
1123
+ itm.unitCost = parseFloat(itm.unitCost.toFixed(2))
1124
+ }
1031
1125
 
1032
1126
  //if user repic location after import
1033
1127
  if (itm.location.zone || itm.location.row || itm.location.column) {
@@ -188,6 +188,12 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
188
188
  action: () => history.back(),
189
189
  ...CommonButtonStyles.back
190
190
  }
191
+ //uncomment this for testing only
192
+ // {
193
+ // title: i18next.t('button.inspect_changes'),
194
+ // action: this.openApproveProductPopup.bind(this),
195
+ // ...CommonButtonStyles.approve
196
+ // }
191
197
  ]
192
198
 
193
199
  if (this._status === ORDER_STATUS.PENDING.value) {
@@ -1016,6 +1022,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1016
1022
  this.setProductGristConfig()
1017
1023
  this.productData = {
1018
1024
  records: orderProducts.map(record => {
1025
+ record.unitPrice = record.unitPrice.toFixed(2)
1019
1026
  return {
1020
1027
  ...record,
1021
1028
  productSku: record.product.sku,