|
|
@@ -91,11 +91,17 @@ open class StockInLineService( |
|
|
|
message = "stock in line id is null", |
|
|
|
errorPosition = null, |
|
|
|
) |
|
|
|
if (stockInLine.expiryDate != null && request.expiryDate == null) { |
|
|
|
request.apply { |
|
|
|
expiryDate = stockInLine.expiryDate |
|
|
|
} |
|
|
|
} |
|
|
|
// return list of stock in line, update data grid with the list |
|
|
|
if (request.acceptedQty.compareTo(stockInLine.acceptedQty) == 0) { |
|
|
|
var savedInventoryLot: InventoryLot? = null |
|
|
|
if (request.status == StockInLineStatus.RECEIVED.status) { |
|
|
|
if (request.expiryDate == null) { |
|
|
|
println("trigger1?") |
|
|
|
return MessageResponse( |
|
|
|
id = null, |
|
|
|
code = null, |
|
|
@@ -107,13 +113,15 @@ open class StockInLineService( |
|
|
|
} |
|
|
|
savedInventoryLot = saveInventoryLotWhenStockIn(request = request, stockInLine = stockInLine) |
|
|
|
} |
|
|
|
// if (request.status == StockInLineStatus.RECEIVED.status) { |
|
|
|
// } |
|
|
|
stockInLine.apply { |
|
|
|
// user = null |
|
|
|
productionDate = request.productionDate?.atStartOfDay() // maybe need to change the request to LocalDateTime |
|
|
|
productLotNo = request.productLotNo |
|
|
|
receiptDate = request.receiptDate?.atStartOfDay() |
|
|
|
status = request.status |
|
|
|
expiryDate = request.expiryDate |
|
|
|
expiryDate = stockInLine.expiryDate ?: request.expiryDate |
|
|
|
lotNo = savedInventoryLot?.lotNo |
|
|
|
} |
|
|
|
val savedStockInLine = saveAndFlush(stockInLine) |
|
|
@@ -173,7 +181,7 @@ open class StockInLineService( |
|
|
|
acceptedQty = request.acceptedQty |
|
|
|
status = request.status |
|
|
|
lotNo = savedInventoryLot?.lotNo |
|
|
|
expiryDate = request.expiryDate |
|
|
|
expiryDate = stockInLine.expiryDate ?: request.expiryDate |
|
|
|
productLotNo = request.productLotNo |
|
|
|
} |
|
|
|
|
|
|
|