From 0ffbbd4476e586b38a3de200760c8f8f4120c25a Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Tue, 13 Oct 2026 11:32:10 +0800 Subject: [PATCH] fix lot line outqty =null to 0 when create lot line outqty defualt 0 --- .../fpsms/modules/stock/service/StockInLineService.kt | 1 + .../01_update_lot_line_outQty_null.sql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/main/resources/db/changelog/changes/20261013_update_lot_line_outQty_null/01_update_lot_line_outQty_null.sql diff --git a/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt b/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt index 6ac0166e..37e9aa15 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt @@ -540,6 +540,7 @@ open class StockInLineService( this.inventoryLot = stockInLine.inventoryLot this.warehouse = warehouse this.inQty = convertedBaseQty + this.outQty = BigDecimal.ZERO this.status = InventoryLotLineStatus.AVAILABLE this.stockUom = stockItemUom ?: throw ResponseStatusException( diff --git a/src/main/resources/db/changelog/changes/20261013_update_lot_line_outQty_null/01_update_lot_line_outQty_null.sql b/src/main/resources/db/changelog/changes/20261013_update_lot_line_outQty_null/01_update_lot_line_outQty_null.sql new file mode 100644 index 00000000..e0507b7b --- /dev/null +++ b/src/main/resources/db/changelog/changes/20261013_update_lot_line_outQty_null/01_update_lot_line_outQty_null.sql @@ -0,0 +1,8 @@ +--liquibase formatted sql + +--changeset fpsms:update_lot_line_outQty_null_v2 +--comment: Update inventory lot line outQty to 0 if it is null +UPDATE inventory_lot_line +SET outQty = 0 +WHERE outQty IS NULL + AND deleted = 0;