| Line 840... |
Line 840... |
| 840 |
float itemSellingPrice = entry.getValue();
|
840 |
float itemSellingPrice = entry.getValue();
|
| 841 |
float itemMargin = itemSellingPrice - itemPurchasePrice;
|
841 |
float itemMargin = itemSellingPrice - itemPurchasePrice;
|
| 842 |
float insurancePurchasePrice = insurancePricesMap.get(entry.getValue()).getDealerPrice();
|
842 |
float insurancePurchasePrice = insurancePricesMap.get(entry.getValue()).getDealerPrice();
|
| 843 |
float insuranceSellingPrice = insuranceSerialNumberSaleAmount.get(entry.getKey());
|
843 |
float insuranceSellingPrice = insuranceSerialNumberSaleAmount.get(entry.getKey());
|
| 844 |
float insuranceMargin = insuranceSellingPrice - insurancePurchasePrice;
|
844 |
float insuranceMargin = insuranceSellingPrice - insurancePurchasePrice;
|
| 845 |
|
- |
|
| 846 |
if(insuranceMargin < (itemMargin * 30 / 100)){
|
845 |
if(insuranceMargin < (itemMargin * 30 / 100)){
|
| 847 |
invalidInsuranceMarginAmount.put(insuranceMargin, (itemMargin * 30 / 100));
|
846 |
invalidInsuranceMarginAmount.put(insuranceMargin, (itemMargin * 30 / 100));
|
| 848 |
}
|
847 |
}
|
| 849 |
}
|
848 |
}
|
| 850 |
|
849 |
|
| 851 |
if(!invalidInsuranceMarginAmount.isEmpty()){
|
850 |
if(!invalidInsuranceMarginAmount.isEmpty()){
|
| 852 |
LOGGER.error("insurance marging should be greater than equal to item profit margin insuranceMarginItemIdMargin {}", invalidInsuranceMarginAmount);
|
851 |
LOGGER.error("insurance marging should be greater than equal to item profit margin insuranceMarginItemIdMargin {}", invalidInsuranceMarginAmount);
|
| - |
|
852 |
return "error";
|
| 853 |
}
|
853 |
}
|
| 854 |
|
854 |
|
| 855 |
|
855 |
|
| 856 |
for(Map.Entry<String, Float> entry : insuranceSerialNumberItemPrice.entrySet()){
|
856 |
for(Map.Entry<String, Float> entry : insuranceSerialNumberItemPrice.entrySet()){
|
| 857 |
PolicyNumberGenerationSequence policyNumberGenerationSequence = null;
|
857 |
PolicyNumberGenerationSequence policyNumberGenerationSequence = null;
|