Преглед на файлове

Stock Adj fix

production
kelvin.yau преди 3 дни
родител
ревизия
5be61f895d
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. +5
    -2
      src/main/java/com/ffii/fpsms/modules/stock/service/StockAdjustmentService.kt

+ 5
- 2
src/main/java/com/ffii/fpsms/modules/stock/service/StockAdjustmentService.kt Целия файл

@@ -66,11 +66,14 @@ open class StockAdjustmentService(
if (diff.compareTo(BigDecimal.ZERO) == 0) continue // Branch 1: no change

if (diff.compareTo(BigDecimal.ZERO) > 0) {
// Branch 2 (qty up): createStockIn
// Branch 2 (qty up): increase inQty on the same lot line; new StockIn/StockInLine for audit only
val inventoryLotLine = inventoryLotLineRepository.findById(current.id)
.orElseThrow { IllegalArgumentException("InventoryLotLine not found: ${current.id}") }
val stockInRequest = buildStockInRequestFromExistingLotLine(inventoryLotLine, diff)
val stockInLine = stockInLineService.createStockIn(stockInRequest)
val stockInLine = stockInLineService.createStockInForExistingInventoryLotLine(
stockInRequest,
inventoryLotLine
)
saveAdjustmentRecordForStockIn(stockInLine)
} else {
// Branch 3 (qty down): adjustment outbound only (not pick createStockOut)


Зареждане…
Отказ
Запис