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;