| Line 232... |
Line 232... |
| 232 |
int ourSale = ourSaleItemQtyMap.get(itemQtyEntry.getKey());
|
232 |
int ourSale = ourSaleItemQtyMap.get(itemQtyEntry.getKey());
|
| 233 |
int quantityToReduce = itemQtyEntry.getValue() - ourSale;
|
233 |
int quantityToReduce = itemQtyEntry.getValue() - ourSale;
|
| 234 |
List<InventoryItem> itemIis = itemIdInventoryMap.get(itemQtyEntry.getKey());
|
234 |
List<InventoryItem> itemIis = itemIdInventoryMap.get(itemQtyEntry.getKey());
|
| 235 |
if (itemIdInventoryMap != null) {
|
235 |
if (itemIdInventoryMap != null) {
|
| 236 |
for (InventoryItem ii : itemIis) {
|
236 |
for (InventoryItem ii : itemIis) {
|
| 237 |
if (ii.getGoodQuantity() >= quantityToReduce && ii.getInitialQuantity() >= quantityToReduce) {
|
237 |
if (quantityToReduce > 0 && ii.getInitialQuantity() >= quantityToReduce) {
|
| 238 |
LOGGER.info("Changed in inventoryItems {}, {}, {}, {}, {}, {}, {}",
|
238 |
LOGGER.info("Changed in inventoryItems {}, {}, {}, {}, {}, {}, {}",
|
| 239 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
239 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
| 240 |
ii.getInitialQuantity(), ii.getGoodQuantity(), ii.getBadQuantity(),
|
240 |
ii.getInitialQuantity(), ii.getGoodQuantity(), ii.getBadQuantity(),
|
| 241 |
quantityToReduce);
|
241 |
quantityToReduce);
|
| 242 |
if (ii.getGoodQuantity() > quantityToReduce) {
|
242 |
if (ii.getGoodQuantity() > quantityToReduce) {
|
| Line 254... |
Line 254... |
| 254 |
purchase.getUnfullfilledNonSerializedQuantity() + quantityToReduce);
|
254 |
purchase.getUnfullfilledNonSerializedQuantity() + quantityToReduce);
|
| 255 |
LOGGER.info("Rectified {}, {}, {}, {}, {}, {}, {}",
|
255 |
LOGGER.info("Rectified {}, {}, {}, {}, {}, {}, {}",
|
| 256 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
256 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
| 257 |
ii.getInitialQuantity(), ii.getGoodQuantity(), ii.getBadQuantity(),
|
257 |
ii.getInitialQuantity(), ii.getGoodQuantity(), ii.getBadQuantity(),
|
| 258 |
quantityToReduce);
|
258 |
quantityToReduce);
|
| - |
|
259 |
quantityToReduce = 0;
|
| 259 |
break;
|
260 |
break;
|
| 260 |
}
|
261 |
}
|
| 261 |
}
|
262 |
}
|
| 262 |
}
|
263 |
}
|
| 263 |
}
|
264 |
}
|