|
|
@@ -680,6 +680,17 @@ open class StockInLineService( |
|
|
} else { |
|
|
} else { |
|
|
requestQty ?: this.acceptedQty |
|
|
requestQty ?: this.acceptedQty |
|
|
} |
|
|
} |
|
|
|
|
|
} else if (request.qcAccept == true && this.status == StockInLineStatus.ESCALATED.status) { |
|
|
|
|
|
// Case: line was escalated (QC decision 3), handler resolves with decision 1 (accept). |
|
|
|
|
|
// Use 揀收數量 (acceptQty) for put away instead of keeping original received qty. |
|
|
|
|
|
val requestQty = request.acceptQty ?: request.acceptedQty |
|
|
|
|
|
if (requestQty != null) { |
|
|
|
|
|
this.acceptedQty = if (this.purchaseOrderLine != null && this.item?.id != null) { |
|
|
|
|
|
itemUomService.convertPurchaseQtyToStockQty(this.item!!.id!!, requestQty) |
|
|
|
|
|
} else { |
|
|
|
|
|
requestQty |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
// Set demandQty based on source |
|
|
// Set demandQty based on source |
|
|
if (this.jobOrder != null && this.jobOrder?.bom != null) { |
|
|
if (this.jobOrder != null && this.jobOrder?.bom != null) { |
|
|
|