| Line 212... |
Line 212... |
| 212 |
continue;
|
212 |
continue;
|
| 213 |
}
|
213 |
}
|
| 214 |
int ourSale = ourSaleItemQtyMap.get(itemQtyEntry.getKey());
|
214 |
int ourSale = ourSaleItemQtyMap.get(itemQtyEntry.getKey());
|
| 215 |
if(itemQtyEntry.getValue() - ourSale > 0) {
|
215 |
if(itemQtyEntry.getValue() - ourSale > 0) {
|
| 216 |
int quantityToReduce = itemQtyEntry.getValue() - ourSale;
|
216 |
int quantityToReduce = itemQtyEntry.getValue() - ourSale;
|
| 217 |
List<InventoryItem> itemIis = itemIdInventoryMap.get(itemQtyEntry);
|
217 |
List<InventoryItem> itemIis = itemIdInventoryMap.get(itemQtyEntry.getKey());
|
| 218 |
for(InventoryItem ii : itemIis) {
|
218 |
for(InventoryItem ii : itemIis) {
|
| 219 |
if(ii.getGoodQuantity() >= quantityToReduce && ii.getInitialQuantity() > quantityToReduce) {
|
219 |
if(ii.getGoodQuantity() >= quantityToReduce && ii.getInitialQuantity() > quantityToReduce) {
|
| 220 |
LOGGER.info("Invoice {} item {} can be reduced to {}", purchase.getPurchaseReference(), ii.getItemId(), ii.getGoodQuantity() - quantityToReduce);
|
220 |
LOGGER.info("Invoice {} item {} can be reduced to {}", purchase.getPurchaseReference(), ii.getItemId(), ii.getGoodQuantity() - quantityToReduce);
|
| 221 |
}
|
221 |
}
|
| 222 |
}
|
222 |
}
|