| Line 244... |
Line 244... |
| 244 |
if (scanRecord.getType().equals(ScanType.PURCHASE)) {
|
244 |
if (scanRecord.getType().equals(ScanType.PURCHASE)) {
|
| 245 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
245 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
| 246 |
.selectByItemIdAndFofoId(itemQtyEntry.getKey(), purchase.getFofoId());
|
246 |
.selectByItemIdAndFofoId(itemQtyEntry.getKey(), purchase.getFofoId());
|
| 247 |
scanRecord.setQuantity(scanRecord.getQuantity() - ii.getGoodQuantity());
|
247 |
scanRecord.setQuantity(scanRecord.getQuantity() - ii.getGoodQuantity());
|
| 248 |
ii.setInitialQuantity(ii.getInitialQuantity() - ii.getBadQuantity());
|
248 |
ii.setInitialQuantity(ii.getInitialQuantity() - ii.getBadQuantity());
|
| - |
|
249 |
quantityToReduce = quantityToReduce - ii.getGoodQuantity();
|
| 249 |
ii.setGoodQuantity(0);
|
250 |
ii.setGoodQuantity(0);
|
| 250 |
cis.setAvailability(cis.getAvailability() - ii.getGoodQuantity());
|
251 |
cis.setAvailability(cis.getAvailability() - ii.getGoodQuantity());
|
| 251 |
purchase.setUnfullfilledNonSerializedQuantity(
|
252 |
purchase.setUnfullfilledNonSerializedQuantity(
|
| 252 |
purchase.getUnfullfilledNonSerializedQuantity() + quantityToReduce);
|
253 |
purchase.getUnfullfilledNonSerializedQuantity() + quantityToReduce);
|
| 253 |
quantityToReduce = quantityToReduce - ii.getGoodQuantity();
|
- |
|
| 254 |
LOGGER.info("Rectified {}, {}, {}, {}, {}, {}",
|
254 |
LOGGER.info("Rectified {}, {}, {}, {}, {}, {}",
|
| 255 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
255 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
| 256 |
ii.getInitialQuantity(), ii.getGoodQuantity(),
|
256 |
ii.getInitialQuantity(), ii.getGoodQuantity(),
|
| 257 |
quantityToReduce);
|
257 |
quantityToReduce);
|
| 258 |
break;
|
258 |
break;
|