@things-factory/operato-wms 4.3.246 → 4.3.247

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.
@@ -504,7 +504,7 @@ class CreateVasOrder extends localize(i18next)(PageView) {
504
504
  this._selectedVasRecord = null
505
505
  this._selectedVasRecordIdx = null
506
506
  navigate(`vas_order_detail/${response.data.generateVasOrder.name}`)
507
- this._showToast({ message: i18next.t('vas_order_created') })
507
+ this._showToast({ message: i18next.t('text.vas_order_created') })
508
508
  }
509
509
  } catch (e) {
510
510
  this._showToast(e)
@@ -157,7 +157,7 @@ class SelectVasPopup extends localize(i18next)(LitElement) {
157
157
  return this.shadowRoot.querySelector('search-form')
158
158
  }
159
159
 
160
- async fetchVas({ page, limit, sorters = [] }) {
160
+ async fetchVas({ page, limit, sorters = [{ name: 'name' }] }) {
161
161
  let filters = await this.searchForm.getQueryFilters()
162
162
 
163
163
  if (this.type) filters = [...filters, { name: 'type', operator: 'eq', value: this.type }]
@@ -669,7 +669,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
669
669
  this.pickedProductData = { records: this.sortByNameField(this.pickedProductData) }
670
670
 
671
671
  // causes grist unable to display data
672
- // this.pageInitialized()
672
+ this.pageInitialized()
673
673
  // causes grist unable to display data
674
674
  } else {
675
675
  throw new Error(response.errors[0])
@@ -162,7 +162,8 @@ class WorksheetLoading extends localize(i18next)(PageView) {
162
162
  .config=${this.config}
163
163
  .data="${this.data}"
164
164
  ></data-grist>
165
-
165
+ <!-- hides vas Grist -->
166
+ <!--
166
167
  ${this.vasData?.records
167
168
  ? html`
168
169
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
@@ -173,7 +174,7 @@ class WorksheetLoading extends localize(i18next)(PageView) {
173
174
  .data="${this.vasData}"
174
175
  ></data-grist>
175
176
  `
176
- : ''}
177
+ : ''} -->
177
178
  </div>
178
179
  `
179
180
  }
@@ -199,7 +200,9 @@ class WorksheetLoading extends localize(i18next)(PageView) {
199
200
  pageInitialized() {
200
201
  this.preConfig = {
201
202
  rows: { appendable: false },
202
- list: { fields: ['batchId', 'palletId', 'product', 'packingType', 'releaseQty', 'batchIdRef', 'status'] },
203
+ list: {
204
+ fields: ['batchId', 'palletId', 'product', 'packingType', 'releaseQty', 'pickedQty', 'batchIdRef', 'status']
205
+ },
203
206
  pagination: { infinite: true },
204
207
  columns: [
205
208
  { type: 'gutter', gutterName: 'sequence' },
@@ -254,6 +257,12 @@ class WorksheetLoading extends localize(i18next)(PageView) {
254
257
  {
255
258
  type: 'integer',
256
259
  name: 'releaseQty',
260
+ header: i18next.t('field.release_qty'),
261
+ width: 60
262
+ },
263
+ {
264
+ type: 'integer',
265
+ name: 'pickedQty',
257
266
  header: i18next.t('field.picked_qty'),
258
267
  width: 60
259
268
  },
@@ -412,6 +421,7 @@ class WorksheetLoading extends localize(i18next)(PageView) {
412
421
  description
413
422
  targetInventory {
414
423
  releaseQty
424
+ pickedQty
415
425
  product {
416
426
  sku
417
427
  brand
@@ -465,6 +475,7 @@ class WorksheetLoading extends localize(i18next)(PageView) {
465
475
  productSku: worksheetDetail.targetInventory.product.sku,
466
476
  productBrand: worksheetDetail.targetInventory.product.brand,
467
477
  releaseQty: worksheetDetail.targetInventory.releaseQty,
478
+ pickedQty: worksheetDetail.targetInventory.pickedQty,
468
479
  packingType: worksheetDetail.targetInventory.inventory.packingType
469
480
  }
470
481
  })
@@ -296,7 +296,8 @@ class WorksheetPicking extends localize(i18next)(PageView) {
296
296
  .data="${this.worksheetDetailData}"
297
297
  ></data-grist>
298
298
 
299
- ${this.vasData?.records
299
+ <!-- vas data -->
300
+ <!-- ${this.vasData?.records
300
301
  ? html`
301
302
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
302
303
  <data-grist
@@ -306,7 +307,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
306
307
  .data="${this.vasData}"
307
308
  ></data-grist>
308
309
  `
309
- : ''}
310
+ : ''} -->
310
311
  </div>
311
312
  </div>
312
313
  `
@@ -463,6 +464,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
463
464
  'packingType',
464
465
  'location',
465
466
  'releaseQty',
467
+ 'pickedQty',
466
468
  'batchIdRef',
467
469
  'status'
468
470
  ]
@@ -525,6 +527,12 @@ class WorksheetPicking extends localize(i18next)(PageView) {
525
527
  header: i18next.t('field.release_qty'),
526
528
  width: 60
527
529
  },
530
+ {
531
+ type: 'integer',
532
+ name: 'pickedQty',
533
+ header: i18next.t('field.picked_qty'),
534
+ width: 60
535
+ },
528
536
  {
529
537
  type: 'string',
530
538
  name: 'releaseUomValueWithUom',
@@ -711,6 +719,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
711
719
  packingSize
712
720
  uom
713
721
  releaseQty
722
+ pickedQty
714
723
  releaseUomValue
715
724
  inventory {
716
725
  qty
@@ -1003,6 +1012,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1003
1012
  batchId
1004
1013
  batchIdRef
1005
1014
  releaseQty
1015
+ pickedQty
1006
1016
  releaseUomValue
1007
1017
  product {
1008
1018
  sku
@@ -1083,13 +1093,18 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1083
1093
  productSku: wsd.targetInventory.inventory.product.sku,
1084
1094
  productBrand: wsd.targetInventory.inventory.product.brand,
1085
1095
  releaseQty: wsd.targetInventory.releaseQty,
1096
+ pickedQty: wsd.targetInventory.pickedQty,
1086
1097
  releaseUomValue: wsd.targetInventory.releaseUomValue,
1087
1098
  releaseUomValueWithUom:
1088
1099
  wsd.targetInventory.releaseUomValue.toFixed(2) + ' ' + wsd.targetInventory.inventory.uom,
1089
1100
  availableQty:
1090
- wsd.targetInventory.inventory.qty -
1091
- wsd.targetInventory.inventory.lockedQty +
1092
- wsd.targetInventory.releaseQty
1101
+ orderVass.length == 0
1102
+ ? wsd.targetInventory.inventory.qty -
1103
+ wsd.targetInventory.inventory.lockedQty +
1104
+ wsd.targetInventory.releaseQty
1105
+ : wsd.targetInventory.inventory.qty -
1106
+ wsd.targetInventory.inventory.lockedQty +
1107
+ wsd.targetInventory.pickedQty
1093
1108
  }
1094
1109
 
1095
1110
  if (wsd.targetInventory?.inventory) {
@@ -112,15 +112,10 @@ class VasReport extends connect(store)(localize(i18next)(PageView)) {
112
112
  searchOper: 'eq',
113
113
  max: new Date().toISOString().split('T')[0]
114
114
  },
115
- // value: (() => {
116
- // let date = new Date()
117
- // date.setMonth(date.getMonth() - 1)
118
- // return date.toISOString().split('T')[0]
119
- // })(),
120
115
  handlers: { change: this._modifyDateRange.bind(this) }
121
116
  },
122
117
  {
123
- lable: i18next.t('field.completion_vas_to_date'),
118
+ label: i18next.t('field.completion_vas_to_date'),
124
119
  name: 'toDate',
125
120
  type: 'date',
126
121
  props: {
@@ -131,20 +126,19 @@ class VasReport extends connect(store)(localize(i18next)(PageView)) {
131
126
  return date.toISOString().split('T')[0]
132
127
  })(),
133
128
  max: new Date().toISOString().split('T')[0]
134
- }//,
135
- // value: new Date().toISOString().split('T')[0]
129
+ }
136
130
  },
137
131
  {
138
132
  label: i18next.t('field.product_info'),
139
133
  name: 'productInfo',
140
134
  type: 'string',
141
- props: { searchOper: 'in' }
135
+ props: { searchOper: 'i_like' }
142
136
  },
143
137
  {
144
138
  label: i18next.t('field.order_no'),
145
139
  name: 'orderNo',
146
140
  type: 'string',
147
- props: { searchOper: 'in' }
141
+ props: { searchOper: 'i_like' }
148
142
  }
149
143
  ]
150
144
  }
@@ -510,7 +504,14 @@ class VasReport extends connect(store)(localize(i18next)(PageView)) {
510
504
 
511
505
  return {
512
506
  header: headerSetting,
513
- data: this.report.data.records,
507
+ data: this.report.data.records.map(record => {
508
+ let date = new Date(parseInt(record.worksheet.endedAt))
509
+ return flattenObject({
510
+ ...record,
511
+ completionDate:
512
+ date.getDate().toString() + '/' + (date.getMonth() + 1).toString() + '/' + date.getFullYear().toString()
513
+ })
514
+ }),
514
515
  groups: this.report._config.rows.groups,
515
516
  totals: this.report._config.rows.totals
516
517
  }
@@ -75,8 +75,8 @@ class VasExecution extends connect(store)(localize(i18next)(PageView)) {
75
75
  <form id="info-form" class="multi-column-form">
76
76
  <fieldset>
77
77
  <legend>
78
- ${i18next.t('title.vas')}
79
- [ ${this._selectedVas?.__seq__
78
+ ${i18next.t('title.vas')} [
79
+ ${this._selectedVas?.__seq__
80
80
  ? this._selectedVas?.__seq__
81
81
  : this.data
82
82
  ? parseFloat(
@@ -327,7 +327,7 @@ class VasExecution extends connect(store)(localize(i18next)(PageView)) {
327
327
  if (i == 0) {
328
328
  wd.push({ ...wsd, targetVas: { ...wsd.targetVas, orderVasItems: wsd.targetVas.orderVasItems[i] } })
329
329
  } else {
330
- wd.push({ targetVas: { orderVasItems: wsd.targetVas.orderVasItems[i] } })
330
+ wd.push({ targetVas: { id: wsd.targetVas.id, orderVasItems: wsd.targetVas.orderVasItems[i] } })
331
331
  }
332
332
  }
333
333
  } else {
@@ -362,19 +362,24 @@ class VasExecution extends connect(store)(localize(i18next)(PageView)) {
362
362
  if (!result.value) return
363
363
 
364
364
  this.validateVas(this._selectedVas?.targetVas?.orderVasItems)
365
- let patches = this._selectedVas?.targetVas?.orderVasItems
365
+ let patches = this.data.records
366
+ .filter(d => d.targetVas.id == this._selectedVas.targetVas.id)
367
+ .map(d => {
368
+ return { id: d.targetVas.orderVasItems.id, executedAt: new Date().getTime(), cuFlag: 'M' }
369
+ })
366
370
 
367
371
  if (patches.length === 0) {
368
372
  throw new Error(i18next.t('text.nothing_changed'))
369
373
  }
370
374
 
371
- patches = [
372
- {
373
- id: patches.id,
374
- executedAt: new Date().getTime(),
375
- cuFlag: 'M'
376
- }
377
- ]
375
+ // if executed one by one not by set
376
+ // patches = [
377
+ // {
378
+ // id: patches.id,
379
+ // executedAt: new Date().getTime(),
380
+ // cuFlag: 'M'
381
+ // }
382
+ // ]
378
383
 
379
384
  const response = await client.mutate({
380
385
  mutation: gql`
@@ -439,6 +444,8 @@ class VasExecution extends connect(store)(localize(i18next)(PageView)) {
439
444
  if (!response.errors) {
440
445
  this._showToast({ message: i18next.t('text.vas_is_completed') })
441
446
  this.clearview()
447
+ this.updateContext()
448
+ this.pageInitialized()
442
449
  navigate('vas_worksheets')
443
450
  }
444
451
  } catch (e) {
@@ -450,6 +457,11 @@ class VasExecution extends connect(store)(localize(i18next)(PageView)) {
450
457
  }
451
458
 
452
459
  clearview() {
460
+ this._selectedVas = this._selectedVas?.__seq__
461
+ ? this._selectedVas?.__seq__
462
+ : this.data
463
+ ? parseFloat(this.data?.records.map(data => data.targetVas.orderVasItems.executedAt === null).indexOf(true)) + 1
464
+ : ''
453
465
  this.orderNoInput.value = ''
454
466
  this.data = {}
455
467
  }
@@ -126,7 +126,7 @@ class WorksheetRefVas extends localize(i18next)(PageView) {
126
126
  ? html` <label>${i18next.t('label.arrival_notice')}</label>
127
127
  <input readonly value="${this.formData.orderNo}" />`
128
128
  : this.formData.orderType === ORDER_TYPES.RELEASE_OF_GOODS.value
129
- ? html` <label>${i18next.t('label.release_goods')}</label>
129
+ ? html` <label>${i18next.t('label.release_good_no')}</label>
130
130
  <input readonly value="${this.formData.orderNo}" />`
131
131
  : ''}
132
132
  <!-- TODO: Showing reference order number -->
@@ -173,7 +173,7 @@ class WorksheetRefVas extends localize(i18next)(PageView) {
173
173
  rows: { appendable: false, handlers: { click: this.taskGristClickHandler.bind(this) } },
174
174
  list: {
175
175
  fields: [
176
- 'targetBatchId',
176
+ 'batchId',
177
177
  'packingType',
178
178
  'uomValue',
179
179
  'newSku',
@@ -196,7 +196,7 @@ class WorksheetRefVas extends localize(i18next)(PageView) {
196
196
  },
197
197
  {
198
198
  type: 'string',
199
- name: 'targetBatchId',
199
+ name: 'batchId',
200
200
  header: i18next.t('field.batch_no'),
201
201
  record: { align: 'center' },
202
202
  width: 100
@@ -226,7 +226,7 @@ class WorksheetRefVas extends localize(i18next)(PageView) {
226
226
  width: 80
227
227
  },
228
228
  {
229
- type: 'object',
229
+ type: 'string',
230
230
  name: 'vas',
231
231
  header: i18next.t('field.vas'),
232
232
  width: 250
@@ -326,17 +326,14 @@ class WorksheetRefVas extends localize(i18next)(PageView) {
326
326
  description
327
327
  sku
328
328
  }
329
- newProductDetail {
330
- packingType
331
- uomValue
332
- }
329
+ newPackingType
330
+ newUomValue
333
331
  orderVasItems {
334
332
  vas {
335
333
  name
336
334
  description
337
335
  operationGuide
338
336
  }
339
- vasQty
340
337
  }
341
338
  status
342
339
  remark
@@ -382,20 +379,35 @@ class WorksheetRefVas extends localize(i18next)(PageView) {
382
379
  return formData
383
380
  }
384
381
 
385
- formatTaskData() {
382
+ formatTaskData() {
386
383
  return {
387
- records: this.worksheet.worksheetDetails.map(wsd => {
388
- return {
384
+ records: this.worksheet.worksheetDetails.reduce((acc, wsd) => {
385
+ acc.push({
389
386
  ...wsd.targetVas,
390
387
  bufferLocation: this.worksheet.bufferLocation,
391
388
  sku: wsd.targetVas.product.sku,
392
389
  newSku: wsd.targetVas.newProduct?.sku,
393
- newPackingType: wsd.targetVas.newProductDetail?.packingType,
394
- newUomValue: wsd.targetVas.newProductDetail?.uomValue,
395
390
  description: wsd.description,
396
391
  issue: wsd.issue
397
- }
398
- })
392
+ })
393
+
394
+ wsd.targetVas.orderVasItems.forEach((item, idx) => {
395
+ if (idx == 0) {
396
+ acc[acc.length - 1] = {
397
+ ...acc[acc.length - 1],
398
+ vas: item.vas.name,
399
+ // newSku: item.newProduct?.sku
400
+ }
401
+ } else {
402
+ acc.push({
403
+ vas: item.vas.name,
404
+ // newSku: item.newProduct?.sku
405
+ })
406
+ }
407
+ })
408
+
409
+ return acc
410
+ }, [])
399
411
  }
400
412
  }
401
413
 
@@ -21,30 +21,32 @@ exports.vasReport = {
21
21
  await (0, utils_1.rawProductsQuery)(tx, params, bizplace);
22
22
  let extraQueryFilter = '';
23
23
  if (productInfo) {
24
- extraQueryFilter = `${extraQueryFilter} and old_product_name like '%${productInfo.value}%'
25
- or sku like '%${productInfo.value}%'
26
- or old_p_description like '%${productInfo.value}%'
27
- or old_p_brand like '%${productInfo.value}%'
28
- or old_p_brand_sku like '%${productInfo.value}%'
29
- or new_product_name like '%${productInfo.value}%'
30
- or new_sku like '%${productInfo.value}%'
31
- or new_p_description like '%${productInfo.value}%'
32
- or new_p_brand like '%${productInfo.value}%'
33
- or new_p_brand_sku like '%${productInfo.value}%' `;
24
+ extraQueryFilter = `${extraQueryFilter} and (
25
+ old_product_name ilike '%${productInfo.value}%'
26
+ or sku ilike '%${productInfo.value}%'
27
+ or old_p_description ilike '%${productInfo.value}%'
28
+ or old_p_brand ilike '%${productInfo.value}%'
29
+ or old_p_brand_sku ilike '%${productInfo.value}%'
30
+ or new_product_name ilike '%${productInfo.value}%'
31
+ or new_sku ilike '%${productInfo.value}%'
32
+ or new_p_description ilike '%${productInfo.value}%'
33
+ or new_p_brand ilike '%${productInfo.value}%'
34
+ or new_p_brand_sku ilike '%${productInfo.value}%'
35
+ ) `;
34
36
  }
35
37
  if (orderNo) {
36
- extraQueryFilter = `${extraQueryFilter} and order_no like '%${orderNo.value}%' `;
38
+ extraQueryFilter = `${extraQueryFilter} and order_no ilike '%${orderNo.value}%' `;
37
39
  }
38
40
  if (fromDate) {
39
- extraQueryFilter = `${extraQueryFilter} and w.ended_at >= '%${fromDate.value}%' `;
41
+ extraQueryFilter = `${extraQueryFilter} and completion_date >= '%${fromDate.value}%' `;
40
42
  }
41
43
  if (toDate) {
42
- extraQueryFilter = `${extraQueryFilter} and w.ended_at <= '%${toDate.value}%' `;
44
+ extraQueryFilter = `${extraQueryFilter} and completion_date <= '%${toDate.value}%' `;
43
45
  }
44
46
  await tx.query(`
45
47
  create temp table temp_vas_order_report on commit drop as (
46
48
  select * from (
47
- select distinct b.name as "company", rg.name as "order_no", rg.ref_no as "ref_no", p1.sku as "sku", ov.batch_id as "batch_no", ov.packing_type as "packing_type", ov.uom as "uom", ov.uom_value as "uom_value", oi.release_qty as "release_qty",
49
+ select distinct b.name as "company", rg.name as "order_no", rg.ref_no as "ref_no", p1.sku as "sku", ov.batch_id as "batch_no", ov.packing_type as "packing_type", ov.uom as "uom", ov.uom_value as "uom_value", op.release_qty as "release_qty",
48
50
  v.name as "vas", ovi.vas_qty as "vas_qty", p2.sku as "new_sku", ov.new_packing_type as "new_packing_type", ov.new_uom as "new_uom", ov.output_qty as "output_qty", ov.new_uom_value as "new_uom_value", w.ended_at as "completion_date",
49
51
  p1.name as "old_product_name", p1.description as "old_p_description", p1.brand as "old_p_brand", p1.brand_sku as "old_p_brand_sku",
50
52
  p2.name as "new_product_name", p2.description as "new_p_description", p2.brand as "new_p_brand", p2.brand_sku as "new_p_brand_sku"
@@ -52,12 +54,12 @@ exports.vasReport = {
52
54
  left join bizplaces b on ov.bizplace_id = b.id
53
55
  inner join release_goods rg on ov.release_good_id = rg.id
54
56
  inner join products p1 on ov.product_id = p1.id
55
- left join order_inventories oi on ov.release_good_id = oi.release_good_id
57
+ left join order_products op on ov.release_good_id = op.release_good_id and ov.product_id = op.product_id and ov.batch_id = op.batch_id
56
58
  inner join order_vas_items ovi on ov.id = ovi.order_vas_id
57
59
  inner join vass v on ovi.vas_id = v.id
58
60
  left join products p2 on ov.new_product_id = p2.id
59
61
  inner join worksheets w on ov.release_good_id = w.release_good_id
60
- where b.id = $1 and w.type = 'VAS' and oi.status <> 'TERMINATED' and oi.status <> 'CANCELLED'
62
+ where b.id = $1 and w.type = 'VAS'
61
63
  ) src
62
64
  where 1=1
63
65
  ${extraQueryFilter}
@@ -68,8 +70,7 @@ exports.vasReport = {
68
70
  `);
69
71
  const result = await tx.query(`
70
72
  select * from temp_vas_order_report
71
- offset $1 limit $2
72
- `, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
73
+ `);
73
74
  let items = result.map(item => {
74
75
  let data = {
75
76
  bizplace: {
@@ -1 +1 @@
1
- {"version":3,"file":"vas-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/vas-report.ts"],"names":[],"mappings":";;;AAEA,uDAAmD;AAGnD,0CAA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AM;qBACnB;oBACD,QAAQ,EAAE;wBACR,OAAO,EAAE,IAAI,CAAC,QAAQ;wBACtB,WAAW,EAAE,IAAI,CAAC,YAAY;wBAC9B,GAAG,EAAE,IAAI,CAAC,GAAG;wBACb,QAAQ,EAAE,IAAI,CAAC,SAAS;wBACxB,cAAc,EAAE,IAAI,CAAC,gBAAgB;wBACrC,MAAM,EAAE,IAAI,CAAC,OAAO;wBACpB,WAAW,EAAE,IAAI,CAAC,aAAa;wBAC/B,SAAS,EAAE,IAAI,CAAC,UAAU;wBAC1B,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;wBAC1B,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE;qBAClC;oBACD,YAAY,EAAE;wBACZ,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;wBACvB,MAAM,EAAE,IAAI,CAAC,OAAO;qBACrB;oBACD,cAAc,EAAE;wBACd,UAAU,EAAE,IAAI,CAAC,WAAW;qBAC7B;oBACD,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI,CAAC,eAAe;qBAC9B;iBACF,CAAA;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"vas-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/vas-report.ts"],"names":[],"mappings":";;;AAEA,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,SAAS,GAAG;IACvB,KAAK,CAAC,SAAS,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACrD,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IA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AAI,CAAC,UAAU;wBAC1B,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;wBAC1B,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE;qBAClC;oBACD,YAAY,EAAE;wBACZ,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;wBACvB,MAAM,EAAE,IAAI,CAAC,OAAO;qBACrB;oBACD,cAAc,EAAE;wBACd,UAAU,EAAE,IAAI,CAAC,WAAW;qBAC7B;oBACD,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI,CAAC,eAAe;qBAC9B;iBACF,CAAA;gBAED,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.246",
3
+ "version": "4.3.247",
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.237",
92
92
  "@things-factory/product-base": "^4.3.237",
93
93
  "@things-factory/resource-ui": "^4.3.239",
94
- "@things-factory/sales-ui": "^4.3.246",
94
+ "@things-factory/sales-ui": "^4.3.247",
95
95
  "@things-factory/scene-data-transform": "^4.3.237",
96
96
  "@things-factory/scene-excel": "^4.3.237",
97
97
  "@things-factory/scene-firebase": "^4.3.227",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.237",
109
109
  "@things-factory/tutorial-ui": "^4.3.237",
110
110
  "@things-factory/warehouse-base": "^4.3.246",
111
- "@things-factory/worksheet-base": "^4.3.246"
111
+ "@things-factory/worksheet-base": "^4.3.247"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.227",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "7e218f27deddcbd2c4585870c45f06cd889f74d3"
120
+ "gitHead": "1d7ff6cba871a66a8edceba43299d3c7517c62f3"
121
121
  }
@@ -25,35 +25,37 @@ export const vasReport = {
25
25
 
26
26
  let extraQueryFilter = ''
27
27
  if (productInfo) {
28
- extraQueryFilter = `${extraQueryFilter} and old_product_name like '%${productInfo.value}%'
29
- or sku like '%${productInfo.value}%'
30
- or old_p_description like '%${productInfo.value}%'
31
- or old_p_brand like '%${productInfo.value}%'
32
- or old_p_brand_sku like '%${productInfo.value}%'
33
- or new_product_name like '%${productInfo.value}%'
34
- or new_sku like '%${productInfo.value}%'
35
- or new_p_description like '%${productInfo.value}%'
36
- or new_p_brand like '%${productInfo.value}%'
37
- or new_p_brand_sku like '%${productInfo.value}%' `
28
+ extraQueryFilter = `${extraQueryFilter} and (
29
+ old_product_name ilike '%${productInfo.value}%'
30
+ or sku ilike '%${productInfo.value}%'
31
+ or old_p_description ilike '%${productInfo.value}%'
32
+ or old_p_brand ilike '%${productInfo.value}%'
33
+ or old_p_brand_sku ilike '%${productInfo.value}%'
34
+ or new_product_name ilike '%${productInfo.value}%'
35
+ or new_sku ilike '%${productInfo.value}%'
36
+ or new_p_description ilike '%${productInfo.value}%'
37
+ or new_p_brand ilike '%${productInfo.value}%'
38
+ or new_p_brand_sku ilike '%${productInfo.value}%'
39
+ ) `
38
40
  }
39
41
 
40
42
  if (orderNo) {
41
- extraQueryFilter = `${extraQueryFilter} and order_no like '%${orderNo.value}%' `
43
+ extraQueryFilter = `${extraQueryFilter} and order_no ilike '%${orderNo.value}%' `
42
44
  }
43
45
 
44
46
  if (fromDate) {
45
- extraQueryFilter = `${extraQueryFilter} and w.ended_at >= '%${fromDate.value}%' `
47
+ extraQueryFilter = `${extraQueryFilter} and completion_date >= '%${fromDate.value}%' `
46
48
  }
47
49
 
48
50
  if (toDate) {
49
- extraQueryFilter = `${extraQueryFilter} and w.ended_at <= '%${toDate.value}%' `
51
+ extraQueryFilter = `${extraQueryFilter} and completion_date <= '%${toDate.value}%' `
50
52
  }
51
53
 
52
54
  await tx.query(
53
55
  `
54
56
  create temp table temp_vas_order_report on commit drop as (
55
57
  select * from (
56
- select distinct b.name as "company", rg.name as "order_no", rg.ref_no as "ref_no", p1.sku as "sku", ov.batch_id as "batch_no", ov.packing_type as "packing_type", ov.uom as "uom", ov.uom_value as "uom_value", oi.release_qty as "release_qty",
58
+ select distinct b.name as "company", rg.name as "order_no", rg.ref_no as "ref_no", p1.sku as "sku", ov.batch_id as "batch_no", ov.packing_type as "packing_type", ov.uom as "uom", ov.uom_value as "uom_value", op.release_qty as "release_qty",
57
59
  v.name as "vas", ovi.vas_qty as "vas_qty", p2.sku as "new_sku", ov.new_packing_type as "new_packing_type", ov.new_uom as "new_uom", ov.output_qty as "output_qty", ov.new_uom_value as "new_uom_value", w.ended_at as "completion_date",
58
60
  p1.name as "old_product_name", p1.description as "old_p_description", p1.brand as "old_p_brand", p1.brand_sku as "old_p_brand_sku",
59
61
  p2.name as "new_product_name", p2.description as "new_p_description", p2.brand as "new_p_brand", p2.brand_sku as "new_p_brand_sku"
@@ -61,12 +63,12 @@ export const vasReport = {
61
63
  left join bizplaces b on ov.bizplace_id = b.id
62
64
  inner join release_goods rg on ov.release_good_id = rg.id
63
65
  inner join products p1 on ov.product_id = p1.id
64
- left join order_inventories oi on ov.release_good_id = oi.release_good_id
66
+ left join order_products op on ov.release_good_id = op.release_good_id and ov.product_id = op.product_id and ov.batch_id = op.batch_id
65
67
  inner join order_vas_items ovi on ov.id = ovi.order_vas_id
66
68
  inner join vass v on ovi.vas_id = v.id
67
69
  left join products p2 on ov.new_product_id = p2.id
68
70
  inner join worksheets w on ov.release_good_id = w.release_good_id
69
- where b.id = $1 and w.type = 'VAS' and oi.status <> 'TERMINATED' and oi.status <> 'CANCELLED'
71
+ where b.id = $1 and w.type = 'VAS'
70
72
  ) src
71
73
  where 1=1
72
74
  ${extraQueryFilter}
@@ -82,9 +84,7 @@ export const vasReport = {
82
84
  const result: any = await tx.query(
83
85
  `
84
86
  select * from temp_vas_order_report
85
- offset $1 limit $2
86
- `,
87
- [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]
87
+ `
88
88
  )
89
89
 
90
90
  let items = result.map(item => {
@@ -1110,6 +1110,7 @@
1110
1110
  "release_order_updated": "release order updated",
1111
1111
  "release_orders_requests": "release orders requests",
1112
1112
  "selected_qty_is_more_than_expected": "selected qty is more than expected",
1113
+ "text. vas_order_created": "vas order created",
1113
1114
  "text.12_months": "12 months",
1114
1115
  "text.3_months": "3 months",
1115
1116
  "text.6_months": "6 months",
@@ -1262,6 +1263,7 @@
1262
1263
  "text.driver_is_not_selected": "driver is not selected",
1263
1264
  "text.duplicate_entry_in_vas_details": "duplicate entry in vas details",
1264
1265
  "text.duplicated_romoval_on_same_sn": "duplicated removal on same serial no",
1266
+ "text.duplicated_value_field": "duplicated value ({field})",
1265
1267
  "text.duplicated_vas_on_same_batch": "duplicated vas on same batch",
1266
1268
  "text.edit_add_order_product": "edit add order product",
1267
1269
  "text.edited_batch_no_have_been_processed": "edited batch no have been processed",
@@ -1563,6 +1565,8 @@
1563
1565
  "text.shipping_order_form_invalid": "shipping order form invalid",
1564
1566
  "text.signed": "signed in",
1565
1567
  "text.single_picking": "single picking",
1568
+ "text.sku_has_vas_changing_sku_will_need_user_to_reenter_vas_information": "SKU has vas. Changing this SKU will need user to reenter vas information",
1569
+ "text.sku_has_vas_releaseQty_less_than_qty_for_vas_changing_will_require_user_to_reenter_vas_information": "SKU has vas. release Qty is lesser than Qty for vas changing will require user to reenter vas information",
1566
1570
  "text.sku_is_required": "sku is required",
1567
1571
  "text.sorting_is_completed": "sorting is completed",
1568
1572
  "text.status_field_is_empty": "status field is empty",
@@ -1732,6 +1736,7 @@
1732
1736
  "title.daily_collection_report": "daily collection report",
1733
1737
  "title.daily_order_inventory_report": "daily order inventory report",
1734
1738
  "title.date_inventory_report": "{state.text} Inventory Report",
1739
+ "title.date_vas_report": "{state.text} Vas Report",
1735
1740
  "title.delivery_information": "delivery information",
1736
1741
  "title.delivery_order_summary": "delivery order summary",
1737
1742
  "title.delivery_order": "delivery order",
@@ -2018,6 +2023,5 @@
2018
2023
  "title.worksheet_unloading_return": "worksheet unloading return",
2019
2024
  "title.worksheet_unloading": "worksheet unloading",
2020
2025
  "title.worksheet_vas": "worksheet vas",
2021
- "title.worksheet": "worksheet",
2022
- "vas_order_created": "vas order created"
2026
+ "title.worksheet": "worksheet"
2023
2027
  }