| Line 95... |
Line 95... |
| 95 |
cartItem.setQuantity(fofoBulkOrderModel.getQuantity());
|
95 |
cartItem.setQuantity(fofoBulkOrderModel.getQuantity());
|
| 96 |
cartItem.setItemId(fofoBulkOrderModel.getItemId());
|
96 |
cartItem.setItemId(fofoBulkOrderModel.getItemId());
|
| 97 |
boolean isPriceZero = fofoBulkOrderModel.getItemPrice() == 0.0;
|
97 |
boolean isPriceZero = fofoBulkOrderModel.getItemPrice() == 0.0;
|
| 98 |
TagListing tagListing = tagListingRepository.selectByItemId(fofoBulkOrderModel.getItemId());
|
98 |
TagListing tagListing = tagListingRepository.selectByItemId(fofoBulkOrderModel.getItemId());
|
| 99 |
double itemSellingPrice = tagListing.getSellingPrice();
|
99 |
double itemSellingPrice = tagListing.getSellingPrice();
|
| 100 |
double itemMrp = tagListing.getMrp();
|
- |
|
| 101 |
double customSellingPrice = fofoBulkOrderModel.getItemPrice();
|
100 |
double customSellingPrice = fofoBulkOrderModel.getItemPrice();
|
| 102 |
int itemId = cartItem.getItemId();
|
101 |
int itemId = cartItem.getItemId();
|
| 103 |
if (isPriceZero) {
|
102 |
if (isPriceZero) {
|
| 104 |
cartItem.setSellingPrice(itemSellingPrice);
|
103 |
cartItem.setSellingPrice(itemSellingPrice);
|
| 105 |
} else {
|
104 |
} else {
|
| 106 |
if (customSellingPrice <= itemMrp) {
|
105 |
if (customSellingPrice <= tagListing.getMrp() || customSellingPrice <= tagListing.getMop()) {
|
| 107 |
cartItem.setSellingPrice(customSellingPrice);
|
106 |
cartItem.setSellingPrice(customSellingPrice);
|
| 108 |
approvalNotRequired = false;
|
107 |
approvalNotRequired = false;
|
| 109 |
|
108 |
|
| 110 |
} else {
|
109 |
} else {
|
| 111 |
throw new ProfitMandiBusinessException("Given price is greater than selling price for item Id - ", itemId, " it should be less or equal of DP");
|
110 |
throw new ProfitMandiBusinessException("Given price is greater than selling price for item Id - ", itemId, " it should be less or equal of DP");
|