| Line 958... |
Line 958... |
| 958 |
int lineItemsValue = serialNumberMap.values().stream().collect(Collectors.summingInt(x -> x.getUnitPrice().intValue()));
|
958 |
int lineItemsValue = serialNumberMap.values().stream().collect(Collectors.summingInt(x -> x.getUnitPrice().intValue()));
|
| 959 |
LOGGER.info("lineItemsValue - {}, totalValue - {}", lineItemsValue, totalValue);
|
959 |
LOGGER.info("lineItemsValue - {}, totalValue - {}", lineItemsValue, totalValue);
|
| 960 |
for (Map.Entry<String, LineItem> entry : serialNumberMap.entrySet()) {
|
960 |
for (Map.Entry<String, LineItem> entry : serialNumberMap.entrySet()) {
|
| 961 |
LOGGER.info("Serial no - {}", entry.getKey());
|
961 |
LOGGER.info("Serial no - {}", entry.getKey());
|
| 962 |
LineItem lineItem = entry.getValue();
|
962 |
LineItem lineItem = entry.getValue();
|
| 963 |
if (AmountType.PERCENTAGE.equals(itemCriteriaPayout.getAmountType())) {
|
- |
|
| 964 |
float percentageAmount = currentSlab.getPayoutAmount();
|
- |
|
| 965 |
amount = entry.getValue().getUnitPrice() * (percentageAmount / 100);
|
- |
|
| 966 |
} else if (AmountType.SLAB_FIXED.equals(itemCriteriaPayout.getAmountType())) {
|
963 |
if (AmountType.SLAB_FIXED.equals(itemCriteriaPayout.getAmountType())) {
|
| 967 |
float totalAmount = currentSlab.getPayoutAmount();
|
964 |
float totalAmount = currentSlab.getPayoutAmount();
|
| 968 |
amount = Math.round((totalAmount / totalValue) * lineItem.getUnitPrice());
|
965 |
amount = Math.round((totalAmount / totalValue) * lineItem.getUnitPrice());
|
| 969 |
LOGGER.info("Serial no - {}, unitPrice - {}, amount - {}", entry.getKey(), lineItem.getUnitPrice(), amount);
|
966 |
LOGGER.info("Serial no - {}, unitPrice - {}, amount - {}", entry.getKey(), lineItem.getUnitPrice(), amount);
|
| 970 |
} else {
|
967 |
} else {
|
| 971 |
//per unit amount
|
968 |
//per unit amount
|