|
|
|
@@ -350,14 +350,14 @@ open class StockInLineService( |
|
|
|
// TODO: check all status to prevent reverting progress due to multiple users access to the same po? |
|
|
|
// return list of stock in line, update data grid with the list |
|
|
|
stockInLine.apply { |
|
|
|
this.productionDate = request.productionDate?.atStartOfDay() // maybe need to change the request to LocalDateTime |
|
|
|
this.productLotNo = request.productLotNo |
|
|
|
this.dnNo = request.dnNo |
|
|
|
this.dnDate = request.dnDate?.atStartOfDay() |
|
|
|
this.productionDate = request.productionDate?.atStartOfDay() ?: this.productionDate// maybe need to change the request to LocalDateTime |
|
|
|
this.productLotNo = request.productLotNo ?: this.productLotNo |
|
|
|
this.dnNo = request.dnNo ?: this.dnNo |
|
|
|
this.dnDate = request.dnDate?.atStartOfDay() ?: this.dnDate |
|
|
|
this.acceptedQty = request.acceptedQty |
|
|
|
this.demandQty = request.acceptQty |
|
|
|
this.invoiceNo = request.invoiceNo |
|
|
|
this.receiptDate = request.receiptDate?.atStartOfDay() |
|
|
|
this.receiptDate = request.receiptDate?.atStartOfDay() ?: this.receiptDate |
|
|
|
// this.status = request.status |
|
|
|
this.expiryDate = stockInLine.expiryDate ?: request.expiryDate |
|
|
|
this.remarks = stockInLine.remarks ?: request.remarks |
|
|
|
@@ -378,7 +378,8 @@ open class StockInLineService( |
|
|
|
BigDecimal.ONE |
|
|
|
} |
|
|
|
|
|
|
|
if (inventoryLotLines.sumOf { it.inQty ?: BigDecimal.ZERO } >= request.acceptQty?.times(ratio)) { |
|
|
|
// if (inventoryLotLines.sumOf { it.inQty ?: BigDecimal.ZERO } >= request.acceptQty?.times(ratio)) { |
|
|
|
if (request.inventoryLotLines?.isEmpty() == true) { // Clicked proceed in PO Modal -- TODO improve |
|
|
|
stockInLine.apply { |
|
|
|
this.status = if (request.acceptQty?.compareTo(request.acceptedQty) == 0) |
|
|
|
StockInLineStatus.COMPLETE.status else StockInLineStatus.PARTIALLY_COMPLETE.status |
|
|
|
|