Browse Source

update

master
MSI\derek 3 weeks ago
parent
commit
600f5d801a
2 changed files with 5 additions and 3 deletions
  1. +3
    -1
      src/main/java/com/ffii/fpsms/modules/purchaseOrder/service/PurchaseOrderService.kt
  2. +2
    -2
      src/main/java/com/ffii/fpsms/modules/stock/service/SuggestedPickLotService.kt

+ 3
- 1
src/main/java/com/ffii/fpsms/modules/purchaseOrder/service/PurchaseOrderService.kt View File

@@ -245,7 +245,9 @@ open class PurchaseOrderService(


val po = purchaseOrderRepository.findById(id).orElseThrow() val po = purchaseOrderRepository.findById(id).orElseThrow()
if (unfinishedLines.isEmpty()) { if (unfinishedLines.isEmpty()) {
val stockInLines = stockInLineRepository.findAllByPurchaseOrderIdAndDeletedFalse(po.id).orElseThrow()
val stockInLines = stockInLineRepository.findAllByPurchaseOrderIdAndDeletedFalse(po.id!!).orElseThrow().filter {
it.status == StockInLineStatus.COMPLETE.status
}
po.apply { po.apply {
status = PurchaseOrderStatus.COMPLETED status = PurchaseOrderStatus.COMPLETED
} }


+ 2
- 2
src/main/java/com/ffii/fpsms/modules/stock/service/SuggestedPickLotService.kt View File

@@ -71,7 +71,7 @@ open class SuggestedPickLotService(
val suggestedList: MutableList<SuggestedPickLot> = mutableListOf() val suggestedList: MutableList<SuggestedPickLot> = mutableListOf()
val holdQtyMap: MutableMap<Long?, BigDecimal?> = request.holdQtyMap val holdQtyMap: MutableMap<Long?, BigDecimal?> = request.holdQtyMap


// get current inventory lot line qty & grouped by item Id
// get current inventory lot line qty & grouped by item id
val availableInventoryLotLines = inventoryLotLineService val availableInventoryLotLines = inventoryLotLineService
.allInventoryLotLinesByItemIdIn(itemIds) .allInventoryLotLinesByItemIdIn(itemIds)
.filter { it.status == InventoryLotLineStatus.AVAILABLE.value } .filter { it.status == InventoryLotLineStatus.AVAILABLE.value }
@@ -182,6 +182,6 @@ open class SuggestedPickLotService(
} }


open fun saveAll(request: List<SuggestedPickLot>): List<SuggestedPickLot> { open fun saveAll(request: List<SuggestedPickLot>): List<SuggestedPickLot> {
return suggestedPickLotRepository.saveAll(request)
return suggestedPickLotRepository.saveAllAndFlush(request)
} }
} }

Loading…
Cancel
Save