| Line 1726... |
Line 1726... |
| 1726 |
int itemId = entry.getKey();
|
1726 |
int itemId = entry.getKey();
|
| 1727 |
CustomFofoOrderItem customFofoOrderItem = entry.getValue();
|
1727 |
CustomFofoOrderItem customFofoOrderItem = entry.getValue();
|
| 1728 |
LOGGER.info("CustomFofoOrderItem -- {}", customFofoOrderItem);
|
1728 |
LOGGER.info("CustomFofoOrderItem -- {}", customFofoOrderItem);
|
| 1729 |
PriceModel priceModel = itemIdMopPriceMap.get(itemId);
|
1729 |
PriceModel priceModel = itemIdMopPriceMap.get(itemId);
|
| 1730 |
Item item = itemRepository.selectById(itemId);
|
1730 |
Item item = itemRepository.selectById(itemId);
|
| - |
|
1731 |
// Comment this as of now 11 sep 2025 as per tarun sir
|
| 1731 |
if (!MOP_VOILATED_BRANDS.contains(item.getBrand()) && (item.getCategoryId() == ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId() == ProfitMandiConstants.TABLET_CATEGORY_ID || item.getCategoryId() == ProfitMandiConstants.LED_CATEGORY_ID) && customFofoOrderItem.getSerialNumberDetails().stream().filter(x -> org.apache.commons.lang.StringUtils.isNotEmpty(x.getSerialNumber())).collect(Collectors.toList()).size() > 0) {
|
1732 |
/*if (!MOP_VOILATED_BRANDS.contains(item.getBrand()) && (item.getCategoryId() == ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId() == ProfitMandiConstants.TABLET_CATEGORY_ID || item.getCategoryId() == ProfitMandiConstants.LED_CATEGORY_ID) && customFofoOrderItem.getSerialNumberDetails().stream().filter(x -> org.apache.commons.lang.StringUtils.isNotEmpty(x.getSerialNumber())).collect(Collectors.toList()).size() > 0) {
|
| 1732 |
if (Utils.compareFloat(priceModel.getPrice(), customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount()) > 0) {
|
1733 |
if (Utils.compareFloat(priceModel.getPrice(), customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount()) > 0) {
|
| 1733 |
throw new ProfitMandiBusinessException("Selling Price for ", item.getItemDescription(), "FFORDR_1010");
|
1734 |
throw new ProfitMandiBusinessException("Selling Price for ", item.getItemDescription(), "FFORDR_1010");
|
| 1734 |
}
|
1735 |
}
|
| 1735 |
} else {
|
1736 |
} else {
|
| 1736 |
if (!MOP_VOILATED_BRANDS.contains(item.getBrand()) && priceModel.getPurchasePrice() > customFofoOrderItem.getSellingPrice()) {
|
1737 |
if (!MOP_VOILATED_BRANDS.contains(item.getBrand()) && priceModel.getPurchasePrice() > customFofoOrderItem.getSellingPrice()) {
|
| 1737 |
throw new ProfitMandiBusinessException("Selling Price", itemRepository.selectById(itemId).getItemDescription(), "Selling Price should not be less than DP");
|
1738 |
throw new ProfitMandiBusinessException("Selling Price", itemRepository.selectById(itemId).getItemDescription(), "Selling Price should not be less than DP");
|
| 1738 |
}
|
1739 |
}
|
| 1739 |
}
|
1740 |
}*/
|
| 1740 |
}
|
1741 |
}
|
| 1741 |
}
|
1742 |
}
|
| 1742 |
|
1743 |
|
| 1743 |
private void validateMopPrice(int fofoId, Map<
|
1744 |
private void validateMopPrice(int fofoId, Map<
|
| 1744 |
Integer, PriceModel> itemIdMopPriceMap, Map<Integer, CustomFofoOrderItem> itemIdCustomFofoLineItemMap) throws
|
1745 |
Integer, PriceModel> itemIdMopPriceMap, Map<Integer, CustomFofoOrderItem> itemIdCustomFofoLineItemMap) throws
|
| Line 1750... |
Line 1751... |
| 1750 |
Item item = itemRepository.selectById(customFofoOrderItem.getItemId());
|
1751 |
Item item = itemRepository.selectById(customFofoOrderItem.getItemId());
|
| 1751 |
if (!(MOP_VOILATED_BRANDS.contains(item.getBrand()) || item.getCategoryId() != ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId() != ProfitMandiConstants.TABLET_CATEGORY_ID) && customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount() < entry.getValue().getPrice()) {
|
1752 |
if (!(MOP_VOILATED_BRANDS.contains(item.getBrand()) || item.getCategoryId() != ProfitMandiConstants.MOBILE_CATEGORY_ID || item.getCategoryId() != ProfitMandiConstants.TABLET_CATEGORY_ID) && customFofoOrderItem.getSellingPrice() + customFofoOrderItem.getDiscountAmount() < entry.getValue().getPrice()) {
|
| 1752 |
invalidMopItemIdPriceMap.put(entry.getKey(), customFofoOrderItem.getSellingPrice());
|
1753 |
invalidMopItemIdPriceMap.put(entry.getKey(), customFofoOrderItem.getSellingPrice());
|
| 1753 |
}
|
1754 |
}
|
| 1754 |
}
|
1755 |
}
|
| 1755 |
|
- |
|
| - |
|
1756 |
// Comment this as of now 11 sep 2025 as per tarun sir
|
| 1756 |
if (!invalidMopItemIdPriceMap.isEmpty()) {
|
1757 |
/*if (!invalidMopItemIdPriceMap.isEmpty()) {
|
| 1757 |
LOGGER.error("Invalid itemIds selling prices{} should be greater than mop prices {}", invalidMopItemIdPriceMap, itemIdMopPriceMap);
|
1758 |
LOGGER.error("Invalid itemIds selling prices{} should be greater than mop prices {}", invalidMopItemIdPriceMap, itemIdMopPriceMap);
|
| 1758 |
throw new ProfitMandiBusinessException("invalidMopItemIdPrice", invalidMopItemIdPriceMap, "FFORDR_1010");
|
1759 |
throw new ProfitMandiBusinessException("invalidMopItemIdPrice", invalidMopItemIdPriceMap, "FFORDR_1010");
|
| 1759 |
}
|
1760 |
}*/
|
| 1760 |
|
1761 |
|
| 1761 |
}
|
1762 |
}
|
| 1762 |
|
1763 |
|
| 1763 |
private void updateInventoryItemsAndScanRecord(Set<InventoryItem> inventoryItems, int fofoId, Map<
|
1764 |
private void updateInventoryItemsAndScanRecord(Set<InventoryItem> inventoryItems, int fofoId, Map<
|
| 1764 |
Integer, Integer> inventoryItemQuantityUsed, int fofoOrderId) {
|
1765 |
Integer, Integer> inventoryItemQuantityUsed, int fofoOrderId) {
|