|
@@ -102,7 +102,7 @@ open class ProductionScheduleService( |
|
|
// BigDecimal.ONE |
|
|
// BigDecimal.ONE |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
val proportion = BigDecimal(line.prodQty).divide(bm.bom?.outputQty ?: BigDecimal.ONE, 2, RoundingMode.HALF_UP) |
|
|
|
|
|
|
|
|
val proportion = BigDecimal(line.prodQty).divide(bm.bom?.outputQty ?: BigDecimal.ONE, 5, RoundingMode.HALF_UP) |
|
|
val demandQty = bm.qty?.times(proportion) ?: zero |
|
|
val demandQty = bm.qty?.times(proportion) ?: zero |
|
|
val saleUnit = bm.item?.id?.let { itemUomService.findSalesUnitByItemId(it) } |
|
|
val saleUnit = bm.item?.id?.let { itemUomService.findSalesUnitByItemId(it) } |
|
|
|
|
|
|
|
@@ -189,7 +189,7 @@ open class ProductionScheduleService( |
|
|
// BigDecimal.ONE |
|
|
// BigDecimal.ONE |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
val proportion = BigDecimal(line.prodQty).divide(bm.bom?.outputQty ?: BigDecimal.ONE, 2, RoundingMode.HALF_UP) |
|
|
|
|
|
|
|
|
val proportion = BigDecimal(line.prodQty).divide(bm.bom?.outputQty ?: BigDecimal.ONE, 5, RoundingMode.HALF_UP) |
|
|
val demandQty = bm.qty?.times(proportion) ?: zero |
|
|
val demandQty = bm.qty?.times(proportion) ?: zero |
|
|
val saleUnit = bm.item?.id?.let { itemUomService.findSalesUnitByItemId(it) } |
|
|
val saleUnit = bm.item?.id?.let { itemUomService.findSalesUnitByItemId(it) } |
|
|
|
|
|
|
|
@@ -314,7 +314,7 @@ open class ProductionScheduleService( |
|
|
val prodScheduleLine = request.id.let { productionScheduleLineRepository.findById(it).getOrNull() } ?: throw NoSuchElementException() |
|
|
val prodScheduleLine = request.id.let { productionScheduleLineRepository.findById(it).getOrNull() } ?: throw NoSuchElementException() |
|
|
val bom = prodScheduleLine.item.id?.let { bomService.findByItemId(it) } |
|
|
val bom = prodScheduleLine.item.id?.let { bomService.findByItemId(it) } |
|
|
val approver = SecurityUtils.getUser().getOrNull() |
|
|
val approver = SecurityUtils.getUser().getOrNull() |
|
|
val proportion = request.demandQty.divide(bom?.outputQty ?: BigDecimal.ONE, 2, RoundingMode.HALF_UP) |
|
|
|
|
|
|
|
|
val proportion = request.demandQty.divide(bom?.outputQty ?: BigDecimal.ONE, 5, RoundingMode.HALF_UP) |
|
|
|
|
|
|
|
|
// Update Prod Schedule Line Prod qty |
|
|
// Update Prod Schedule Line Prod qty |
|
|
prodScheduleLine.apply { |
|
|
prodScheduleLine.apply { |
|
|