|
|
|
@@ -158,6 +158,14 @@ open class StockInLineService( |
|
|
|
itemNo = item.code |
|
|
|
this.stockIn = stockIn |
|
|
|
acceptedQty = request.acceptedQty |
|
|
|
// Set demandQty based on source |
|
|
|
if (jo != null && jo?.bom != null) { |
|
|
|
// For job orders, demandQty comes from BOM's outputQty |
|
|
|
this.demandQty = jo?.bom?.outputQty |
|
|
|
} else if (pol != null) { |
|
|
|
// For purchase orders, demandQty comes from PurchaseOrderLine's qty |
|
|
|
this.demandQty = pol.qty |
|
|
|
} |
|
|
|
dnNo = request.dnNo |
|
|
|
receiptDate = request.receiptDate?.atStartOfDay() ?: LocalDateTime.now() |
|
|
|
productLotNo = request.productLotNo |
|
|
|
@@ -391,12 +399,20 @@ 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() ?: this.productionDate// maybe need to change the request to LocalDateTime |
|
|
|
this.productionDate = request.productionDate?.atStartOfDay() ?: this.productionDate |
|
|
|
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.acceptedQty = request.acceptQty ?: request.acceptedQty ?: this.acceptedQty |
|
|
|
// Set demandQty based on source |
|
|
|
if (this.jobOrder != null && this.jobOrder?.bom != null) { |
|
|
|
// For job orders, demandQty comes from BOM's outputQty |
|
|
|
this.demandQty = this.jobOrder?.bom?.outputQty ?: this.demandQty |
|
|
|
} else if (this.purchaseOrderLine != null) { |
|
|
|
// For purchase orders, demandQty comes from PurchaseOrderLine's qty |
|
|
|
this.demandQty = this.purchaseOrderLine?.qty ?: this.demandQty |
|
|
|
} |
|
|
|
// Don't overwrite demandQty with acceptQty from QC form |
|
|
|
this.invoiceNo = request.invoiceNo |
|
|
|
this.receiptDate = request.receiptDate?.atStartOfDay() ?: this.receiptDate |
|
|
|
// this.status = request.status |
|
|
|
|