|
|
|
@@ -1574,7 +1574,7 @@ open fun getMissItemList(issueCategory: String = "lot_issue"): List<StockIssueRe |
|
|
|
|
|
|
|
// Get the first issue for non-aggregated fields |
|
|
|
val firstIssue = issueList.first() |
|
|
|
|
|
|
|
val (_, uomDesc) = resolveLotUomInfo(lotId) |
|
|
|
// Sum missQty for this lot (as requested: sum of missQty, not issueQty) |
|
|
|
val totalMissQty = issueList.sumOf { it.missQty ?: BigDecimal.ZERO } |
|
|
|
|
|
|
|
@@ -1596,7 +1596,9 @@ open fun getMissItemList(issueCategory: String = "lot_issue"): List<StockIssueRe |
|
|
|
pickerName = firstIssue.pickerName, |
|
|
|
handleStatus = firstIssue.handleStatus.name, |
|
|
|
handleDate = firstIssue.handleDate, |
|
|
|
handledBy = firstIssue.handledBy |
|
|
|
handledBy = firstIssue.handledBy, |
|
|
|
uomDesc = uomDesc, |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -1623,7 +1625,7 @@ open fun getBadItemList(issueCategory: String = "lot_issue"): List<StockIssueRes |
|
|
|
|
|
|
|
// Get the first issue for non-aggregated fields |
|
|
|
val firstIssue = issueList.first() |
|
|
|
|
|
|
|
val (_, uomDesc) = resolveLotUomInfo(lotId) |
|
|
|
// Sum issueQty for this lot (as requested: sum of issueQty) |
|
|
|
val totalIssueQty = issueList.sumOf { it.issueQty ?: BigDecimal.ZERO } |
|
|
|
|
|
|
|
@@ -1645,7 +1647,8 @@ open fun getBadItemList(issueCategory: String = "lot_issue"): List<StockIssueRes |
|
|
|
pickerName = firstIssue.pickerName, |
|
|
|
handleStatus = firstIssue.handleStatus.name, |
|
|
|
handleDate = firstIssue.handleDate, |
|
|
|
handledBy = firstIssue.handledBy |
|
|
|
handledBy = firstIssue.handledBy, |
|
|
|
uomDesc = uomDesc, |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -2606,7 +2609,14 @@ open fun getLotIssueDetails(lotId: Long, itemId: Long, issueType: String): LotIs |
|
|
|
} |
|
|
|
|
|
|
|
val firstIssue = issues.first() |
|
|
|
|
|
|
|
val lotLine = inventoryLotLineRepository.findById(firstIssue.lotId!!).orElse(null) |
|
|
|
val inQty = lotLine?.inQty ?: BigDecimal.ZERO |
|
|
|
val outQty = lotLine?.outQty ?: BigDecimal.ZERO |
|
|
|
val bookQty = inQty.subtract(outQty) |
|
|
|
|
|
|
|
val uom = lotLine?.stockUom?.uom |
|
|
|
val uomCode = uom?.code |
|
|
|
val uomDesc = uom?.udfudesc |
|
|
|
// Get DO/JO order codes |
|
|
|
val issueDetails = issues.map { issue -> |
|
|
|
var doOrderCode: String? = null |
|
|
|
@@ -2643,7 +2653,10 @@ open fun getLotIssueDetails(lotId: Long, itemId: Long, issueType: String): LotIs |
|
|
|
itemCode = firstIssue.itemCode, |
|
|
|
itemDescription = firstIssue.itemDescription, |
|
|
|
storeLocation = firstIssue.storeLocation, |
|
|
|
issues = issueDetails |
|
|
|
issues = issueDetails, |
|
|
|
bookQty = bookQty, |
|
|
|
|
|
|
|
uomDesc = uomDesc, |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
@@ -2970,5 +2983,16 @@ private fun checkPickOrderLineCompletion(pickOrderLineId: Long) { |
|
|
|
println("⏳ Pick order line $pickOrderLineId not completed yet - has ${unfinishedLine.size} unfinished stock out lines") |
|
|
|
} |
|
|
|
} |
|
|
|
private fun resolveLotUomInfo(lotId: Long?): Pair<String?, String?> { |
|
|
|
if (lotId == null) return Pair(null, null) |
|
|
|
|
|
|
|
val lotLine = inventoryLotLineRepository.findById(lotId).orElse(null) |
|
|
|
?: return Pair(null, null) |
|
|
|
|
|
|
|
val uom = lotLine.stockUom?.uom // ItemUom -> UomConversion |
|
|
|
val uomCode = uom?.code |
|
|
|
val uomDesc = uom?.udfudesc // 👈 你要的 udfudesc |
|
|
|
|
|
|
|
return Pair(uomCode, uomDesc) |
|
|
|
} |
|
|
|
} |