diff --git a/src/main/java/com/ffii/fpsms/modules/common/scheduler/service/SchedulerService.kt b/src/main/java/com/ffii/fpsms/modules/common/scheduler/service/SchedulerService.kt index d31edb2..4ce2b78 100644 --- a/src/main/java/com/ffii/fpsms/modules/common/scheduler/service/SchedulerService.kt +++ b/src/main/java/com/ffii/fpsms/modules/common/scheduler/service/SchedulerService.kt @@ -152,7 +152,7 @@ open class SchedulerService( commonSchedule( scheduledPostCompletedDnGrn, SettingNames.SCHEDULE_POST_COMPLETED_DN_GRN, - "0 37 0 * * *", + "0 57 0 * * *", { getPostCompletedDnAndProcessGrn(receiptDate = getPostCompletedDnGrnReceiptDate()) } ) } diff --git a/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt b/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt index bd9f9cc..51f25d4 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt @@ -552,8 +552,7 @@ open class StockInLineService( val totalQtyM18 = silList.sumOf { it.acceptedQtyM18?.let { qty -> BigDecimal.valueOf(qty.toLong()) } ?: BigDecimal.ZERO } - val unitIdM18 = pol.uomM18?.m18Id?.toInt() - ?: throw IllegalStateException("Missing uomIdM18 mapping for POL id=${pol.id}, PO=${po.code}") + val unitIdFromDataLog = (pol.m18DataLog?.dataLog?.get("unitId") as? Number)?.toLong()?.toInt() val itemName = (sil.item?.name ?: pol.item?.name).orEmpty() // always non-null for M18 bDesc/bDesc_en GoodsReceiptNoteAntValue( sourceType = "po", @@ -561,7 +560,7 @@ open class StockInLineService( sourceLot = pol.m18Lot ?: "", proId = (sil.item?.m18Id ?: pol.item?.m18Id ?: 0L).toInt(), locId = 155, - unitId = unitIdM18, + unitId = unitIdFromDataLog ?: (pol.uomM18?.m18Id ?: 0L).toInt(), qty = totalQtyM18.toDouble(), up = pol.up?.toDouble() ?: 0.0, amt = CommonUtils.getAmt(