Skip to content

Commit

Permalink
Inventory item batch list fetch condition modified (#53)
Browse files Browse the repository at this point in the history
* Added deleted flag condition for fetching short expiry report

* Removed itembatch list quantity check condition

---------

Co-authored-by: Devika <[email protected]>
  • Loading branch information
devikasuresh20 and Devika authored Jun 3, 2024
1 parent 3891b7c commit 428c95b
Showing 1 changed file with 7 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,38 +202,24 @@ public List<AllocateItemMap> getItemStockFromItemID(Integer facilityID, List<Ite
if (totalQty >= itemStockExit.getQuantity()) {
stock.setQuantity(stock.getQuantityInHand() - totalQty + itemStockExit.getQuantity());
break;
} else if (totalQty < itemStockExit.getQuantity()) {
logger.info("Insufficent Qty for '" + item.getItemName() + "'. Available Qty is : " + totalQty);
break;

}

}
// if (totalQty < itemStockExit.getQuantity()) {
// throw new InventoryException(
// "Insufficent Qty for '" + item.getItemName() + "'. Available Qty is : " + totalQty);
//
// }
if (totalQty < itemStockExit.getQuantity()) {
throw new InventoryException(
"Insufficent Qty for '" + item.getItemName() + "'. Available Qty is : " + totalQty);

}

List<ItemBatchList> stockBatch = itemBatchListMap.getItemStockExitMapList(itemStockList);
// if(stockBatch != null && stockBatch.size() > 0) {
for (ItemBatchList objList : stockBatch) {
if (objList.getExpiryDate() != null)
objList.setExpiresIn(calculateExpiryDateInDays(new Timestamp(objList.getExpiryDate().getTime())));
}
allocateItemMap.setItemBatchList(stockBatch);
allocateItemMapList.add(allocateItemMap);
// } else {
// ItemBatchList obj = new ItemBatchList();
// obj.setQuantity(0);
// obj.setQuantityInHand(0);
// obj.setItemID(itemID);
// obj.setFacilityID(facilityID);
//
// List<ItemBatchList> stockbatchList = new ArrayList<>();
// stockbatchList.add(obj);
// allocateItemMap.setItemBatchList(stockbatchList);
// allocateItemMapList.add(allocateItemMap);
// }


}

Expand Down

0 comments on commit 428c95b

Please sign in to comment.