| Line 238... |
Line 238... |
| 238 |
if (ii.getGoodQuantity() >= quantityToReduce && ii.getInitialQuantity() >= quantityToReduce) {
|
238 |
if (ii.getGoodQuantity() >= quantityToReduce && ii.getInitialQuantity() >= quantityToReduce) {
|
| 239 |
LOGGER.info("Changed in inventoryItems {}, {}, {}, {}, {}, {}, {}",
|
239 |
LOGGER.info("Changed in inventoryItems {}, {}, {}, {}, {}, {}, {}",
|
| 240 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
240 |
purchase.getPurchaseReference(), ii.getId(), ii.getItemId(),
|
| 241 |
ii.getInitialQuantity(), ii.getGoodQuantity(), ii.getBadQuantity(),
|
241 |
ii.getInitialQuantity(), ii.getGoodQuantity(), ii.getBadQuantity(),
|
| 242 |
quantityToReduce);
|
242 |
quantityToReduce);
|
| 243 |
if (ii.getGoodQuantity() == quantityToReduce) {
|
243 |
if (ii.getGoodQuantity() > quantityToReduce) {
|
| 244 |
List<ScanRecord> scanRecords = scanRecordRepository.selectByInventoryItemId(ii.getId());
|
244 |
List<ScanRecord> scanRecords = scanRecordRepository.selectByInventoryItemId(ii.getId());
|
| 245 |
for (ScanRecord scanRecord : scanRecords) {
|
245 |
for (ScanRecord scanRecord : scanRecords) {
|
| 246 |
if (scanRecord.getType().equals(ScanType.PURCHASE)) {
|
246 |
if (scanRecord.getType().equals(ScanType.PURCHASE)) {
|
| 247 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
247 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
| 248 |
.selectByItemIdAndFofoId(itemQtyEntry.getKey(), purchase.getFofoId());
|
248 |
.selectByItemIdAndFofoId(itemQtyEntry.getKey(), purchase.getFofoId());
|