@things-factory/worksheet-base 4.3.827 → 4.3.828

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.
@@ -360,15 +360,15 @@ class PackingWorksheetController extends vas_worksheet_controller_1.VasWorksheet
360
360
  let updateOrderPackageItem = (await this.trxMgr.getRepository(sales_base_1.OrderPackageItem).query(`
361
361
  UPDATE order_package_items tgt
362
362
  SET
363
- packed_qty = CASE
364
- WHEN $5 = true THEN $4
365
- ELSE coalesce(tgt.packed_qty, 0) + 1
363
+ packed_qty = CASE
364
+ WHEN $5 = true THEN $4
365
+ ELSE LEAST(coalesce(tgt.packed_qty, 0) + 1, tgt.release_qty)
366
366
  END,
367
367
  updated_at = $2,
368
368
  updater_id = $3,
369
- status = CASE
369
+ status = CASE
370
370
  WHEN $5 = true AND $4 = release_qty THEN 'DONE'
371
- WHEN $5 = false AND coalesce(tgt.packed_qty, 0) + 1 = release_qty THEN 'DONE'
371
+ WHEN $5 = false AND LEAST(coalesce(tgt.packed_qty, 0) + 1, tgt.release_qty) = release_qty THEN 'DONE'
372
372
  ELSE tgt.status
373
373
  END
374
374
  WHERE id = $1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/worksheet-base",
3
- "version": "4.3.827",
3
+ "version": "4.3.828",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -46,5 +46,5 @@
46
46
  "puppeteer": "21.0.3",
47
47
  "uuid": "^9.0.0"
48
48
  },
49
- "gitHead": "a55ddfb0530459b1dbb45d55ec748368d322b89d"
49
+ "gitHead": "a86e3f4a1370adabfd4649d6ed66c9564f9228a5"
50
50
  }
@@ -470,15 +470,15 @@ export class PackingWorksheetController extends VasWorksheetController {
470
470
  `
471
471
  UPDATE order_package_items tgt
472
472
  SET
473
- packed_qty = CASE
474
- WHEN $5 = true THEN $4
475
- ELSE coalesce(tgt.packed_qty, 0) + 1
473
+ packed_qty = CASE
474
+ WHEN $5 = true THEN $4
475
+ ELSE LEAST(coalesce(tgt.packed_qty, 0) + 1, tgt.release_qty)
476
476
  END,
477
477
  updated_at = $2,
478
478
  updater_id = $3,
479
- status = CASE
479
+ status = CASE
480
480
  WHEN $5 = true AND $4 = release_qty THEN 'DONE'
481
- WHEN $5 = false AND coalesce(tgt.packed_qty, 0) + 1 = release_qty THEN 'DONE'
481
+ WHEN $5 = false AND LEAST(coalesce(tgt.packed_qty, 0) + 1, tgt.release_qty) = release_qty THEN 'DONE'
482
482
  ELSE tgt.status
483
483
  END
484
484
  WHERE id = $1