| Line 1130... |
Line 1130... |
| 1130 |
for (Map.Entry<Integer, CustomFofoOrderItem> entry : itemIdCustomFofoLineItemMap.entrySet()) {
|
1130 |
for (Map.Entry<Integer, CustomFofoOrderItem> entry : itemIdCustomFofoLineItemMap.entrySet()) {
|
| 1131 |
int itemId = entry.getKey();
|
1131 |
int itemId = entry.getKey();
|
| 1132 |
CustomFofoOrderItem customFofoOrderItem = entry.getValue();
|
1132 |
CustomFofoOrderItem customFofoOrderItem = entry.getValue();
|
| 1133 |
PriceModel priceModel = itemIdMopPriceMap.get(itemId);
|
1133 |
PriceModel priceModel = itemIdMopPriceMap.get(itemId);
|
| 1134 |
if(customFofoOrderItem.getSerialNumberDetails().size() > 0) {
|
1134 |
if(customFofoOrderItem.getSerialNumberDetails().size() > 0) {
|
| 1135 |
if(priceModel.getPrice() < customFofoOrderItem.getSellingPrice()) {
|
1135 |
if(priceModel.getPrice() > customFofoOrderItem.getSellingPrice()) {
|
| 1136 |
throw new ProfitMandiBusinessException("Selling Price", itemRepository.selectById(itemId).getItemDescription(), "FFORDR_1010");
|
1136 |
throw new ProfitMandiBusinessException("Selling Price", itemRepository.selectById(itemId).getItemDescription(), "FFORDR_1010");
|
| 1137 |
}
|
1137 |
}
|
| 1138 |
} else {
|
1138 |
} else {
|
| 1139 |
if(priceModel.getPurchasePrice() < customFofoOrderItem.getSellingPrice()) {
|
1139 |
if(priceModel.getPurchasePrice() > customFofoOrderItem.getSellingPrice()) {
|
| 1140 |
throw new ProfitMandiBusinessException("Selling Price", itemRepository.selectById(itemId).getItemDescription(), "Selling Price should not be less than DP");
|
1140 |
throw new ProfitMandiBusinessException("Selling Price", itemRepository.selectById(itemId).getItemDescription(), "Selling Price should not be less than DP");
|
| 1141 |
}
|
1141 |
}
|
| 1142 |
}
|
1142 |
}
|
| 1143 |
}
|
1143 |
}
|
| 1144 |
}
|
1144 |
}
|
| Line 1162... |
Line 1162... |
| 1162 |
LOGGER.error("Invalid itemIds selling prices{} should be greater than mop prices {}",
|
1162 |
LOGGER.error("Invalid itemIds selling prices{} should be greater than mop prices {}",
|
| 1163 |
invalidMopItemIdPriceMap, itemIdMopPriceMap);
|
1163 |
invalidMopItemIdPriceMap, itemIdMopPriceMap);
|
| 1164 |
throw new ProfitMandiBusinessException("invalidMopItemIdPrice", invalidMopItemIdPriceMap, "FFORDR_1010");
|
1164 |
throw new ProfitMandiBusinessException("invalidMopItemIdPrice", invalidMopItemIdPriceMap, "FFORDR_1010");
|
| 1165 |
}
|
1165 |
}
|
| 1166 |
|
1166 |
|
| 1167 |
if (!invalidMopItemIdPriceMap.isEmpty()) {
|
1167 |
if (!invalidDiscountAmountMap.isEmpty()) {
|
| 1168 |
LOGGER.error("Invalid itemIds discount amounts {} should be less than maxDiscount prices {}",
|
1168 |
LOGGER.error("Invalid itemIds discount amounts {} should be less than maxDiscount prices {}",
|
| 1169 |
invalidDiscountAmountMap, itemIdMopPriceMap);
|
1169 |
invalidDiscountAmountMap, itemIdMopPriceMap);
|
| 1170 |
throw new ProfitMandiBusinessException("invalidMopItemIdPrice", invalidDiscountAmountMap, "FFORDR_1011");
|
1170 |
throw new ProfitMandiBusinessException("invalidMopItemIdPrice", invalidDiscountAmountMap, "FFORDR_1011");
|
| 1171 |
}
|
1171 |
}
|
| 1172 |
}
|
1172 |
}
|