|
|
|
@@ -422,8 +422,8 @@ return result |
|
|
|
il.expiryDate |
|
|
|
ORDER BY |
|
|
|
it.code, |
|
|
|
il.lotNo, |
|
|
|
deliveryDate |
|
|
|
deliveryDate, |
|
|
|
il.lotNo |
|
|
|
""".trimIndent() |
|
|
|
|
|
|
|
val result = jdbcDao.queryForList(sql, args) |
|
|
|
@@ -807,6 +807,15 @@ fun searchMaterialStockOutTraceabilityReport( |
|
|
|
FORMAT(ROUND(SUM(COALESCE(agg.cumStockIn, 0)) OVER w_item, 0), 0) as totalCumStockIn, |
|
|
|
FORMAT(ROUND(SUM(COALESCE(agg.cumStockOut, 0)) OVER w_item, 0), 0) as totalCumStockOut, |
|
|
|
FORMAT(ROUND(SUM(COALESCE(agg.currentBalance, 0)) OVER w_item, 0), 0) as totalCurrentBalance, |
|
|
|
FORMAT(ROUND(COALESCE(agg.cumStockOutMiss, 0), 0), 0) as misInputAndLost, |
|
|
|
FORMAT(ROUND(COALESCE(agg.cumStockOutBad, 0), 0), 0) as defectiveGoods, |
|
|
|
FORMAT(ROUND(COALESCE(agg.cumStockOutAdjStockTake, 0), 0), 0) as variance, |
|
|
|
CASE |
|
|
|
WHEN agg.lastInDate IS NULL AND agg.lastOutDate IS NULL THEN '' |
|
|
|
WHEN agg.lastInDate IS NULL THEN DATE_FORMAT(agg.lastOutDate, '%Y-%m-%d') |
|
|
|
WHEN agg.lastOutDate IS NULL THEN DATE_FORMAT(agg.lastInDate, '%Y-%m-%d') |
|
|
|
ELSE DATE_FORMAT(GREATEST(agg.lastInDate, agg.lastOutDate), '%Y-%m-%d') |
|
|
|
END as lastMovementDate, |
|
|
|
FORMAT(ROUND(COALESCE(agg.cumStockInByPO, 0), 0), 0) as cumStockInByPurchaseOrder, |
|
|
|
FORMAT(ROUND(COALESCE(agg.cumStockInByJO, 0), 0), 0) as cumStockInByJobOrder, |
|
|
|
FORMAT(ROUND(COALESCE(agg.cumStockInByStockTake, 0), 0), 0) as cumStockInByStockTake, |
|
|
|
|