Subversion Repositories SmartDukaan

Rev

Rev 24712 | Rev 24714 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24712 Rev 24713
Line 214... Line 214...
214
					LOGGER.info("Cannot find in Invoice {} item {}", purchase.getPurchaseReference(),
214
					LOGGER.info("Cannot find in Invoice {} item {}", purchase.getPurchaseReference(),
215
							itemQtyEntry.getKey());
215
							itemQtyEntry.getKey());
216
					continue;
216
					continue;
217
				}
217
				}
218
				int ourSale = ourSaleItemQtyMap.get(itemQtyEntry.getKey());
218
				int ourSale = ourSaleItemQtyMap.get(itemQtyEntry.getKey());
219
				if (itemQtyEntry.getValue() - ourSale > 0) {
219
				int quantityToReduce = itemQtyEntry.getValue() - ourSale;
220
					int quantityToReduce = itemQtyEntry.getValue() - ourSale;
220
				if (quantityToReduce > 0) {
221
					List<InventoryItem> itemIis = itemIdInventoryMap.get(itemQtyEntry.getKey());
221
					List<InventoryItem> itemIis = itemIdInventoryMap.get(itemQtyEntry.getKey());
222
					if (itemIdInventoryMap != null) {
222
					if (itemIdInventoryMap != null) {
223
						for (InventoryItem ii : itemIis) {
223
						for (InventoryItem ii : itemIis) {
224
							if (ii.getGoodQuantity() >= quantityToReduce
224
							if (ii.getGoodQuantity() >= quantityToReduce
225
									&& ii.getInitialQuantity() >= quantityToReduce) {
225
									&& ii.getInitialQuantity() >= quantityToReduce) {
226
								LOGGER.info("Invoice {} item {} can be reduced to {}", purchase.getPurchaseReference(),
226
								LOGGER.info("Invoice {} item {} can be reduced to {}", purchase.getPurchaseReference(),
227
										ii.getItemId(), ii.getGoodQuantity() - quantityToReduce);
227
										ii.getId(), ii.getGoodQuantity() - quantityToReduce);
228
							}
228
							}
229
						}
229
						}
230
					}
230
					}
231
				}
231
				}
232
			}
232
			}