| Line 237... |
Line 237... |
| 237 |
if (quantityToReduce > 0) {
|
237 |
if (quantityToReduce > 0) {
|
| 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() > 0) {
|
| 243 |
List<ScanRecord> scanRecords = scanRecordRepository.selectByInventoryItemId(ii.getId());
|
243 |
List<ScanRecord> scanRecords = scanRecordRepository.selectByInventoryItemId(ii.getId());
|
| 244 |
for (ScanRecord scanRecord : scanRecords) {
|
244 |
for (ScanRecord scanRecord : scanRecords) {
|
| 245 |
if (scanRecord.getType().equals(ScanType.PURCHASE)) {
|
245 |
if (scanRecord.getType().equals(ScanType.PURCHASE)) {
|
| 246 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
246 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
| 247 |
.selectByItemIdAndFofoId(itemQtyEntry.getKey(), purchase.getFofoId());
|
247 |
.selectByItemIdAndFofoId(itemQtyEntry.getKey(), purchase.getFofoId());
|