From 79616fa56b6b6ac5e0a47ef10ea6af489f9a06a7 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Mon, 16 Feb 2026 16:04:03 +0800 Subject: [PATCH] update --- .../fpsms/modules/report/service/ReportService.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ffii/fpsms/modules/report/service/ReportService.kt b/src/main/java/com/ffii/fpsms/modules/report/service/ReportService.kt index ab2e11a..84b6483 100644 --- a/src/main/java/com/ffii/fpsms/modules/report/service/ReportService.kt +++ b/src/main/java/com/ffii/fpsms/modules/report/service/ReportService.kt @@ -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,