| Line 571... |
Line 571... |
| 571 |
catalogSlabPayoutMap.put(catalogId, new LinkedHashMap<>());
|
571 |
catalogSlabPayoutMap.put(catalogId, new LinkedHashMap<>());
|
| 572 |
}
|
572 |
}
|
| 573 |
AmountModel amountModel = new AmountModel();
|
573 |
AmountModel amountModel = new AmountModel();
|
| 574 |
amountModel.setAmountType(AmountType.FIXED);
|
574 |
amountModel.setAmountType(AmountType.FIXED);
|
| 575 |
amountModel.setAmount(payoutSlab.getPayoutAmount());
|
575 |
amountModel.setAmount(payoutSlab.getPayoutAmount());
|
| - |
|
576 |
amountModel.setDiscount(createOfferRequest.isDiscount());
|
| 576 |
catalogSlabPayoutMap.get(catalogId).put(payoutSlab.getOnwardsAmount(),
|
577 |
catalogSlabPayoutMap.get(catalogId).put(payoutSlab.getOnwardsAmount(),
|
| 577 |
amountModel);
|
578 |
amountModel);
|
| 578 |
}
|
579 |
}
|
| 579 |
} else if (itemCriteriaPayout.getAmountType().equals(AmountType.SLAB_FIXED)) {
|
580 |
} else if (itemCriteriaPayout.getAmountType().equals(AmountType.SLAB_FIXED)) {
|
| 580 |
for (Integer catalogId : catalogIds) {
|
581 |
for (Integer catalogId : catalogIds) {
|
| Line 582... |
Line 583... |
| 582 |
catalogSlabPayoutMap.put(catalogId, new LinkedHashMap<>());
|
583 |
catalogSlabPayoutMap.put(catalogId, new LinkedHashMap<>());
|
| 583 |
}
|
584 |
}
|
| 584 |
|
585 |
|
| 585 |
AmountModel amountModel = new AmountModel();
|
586 |
AmountModel amountModel = new AmountModel();
|
| 586 |
amountModel.setAmountType(AmountType.FIXED);
|
587 |
amountModel.setAmountType(AmountType.FIXED);
|
| - |
|
588 |
amountModel.setDiscount(createOfferRequest.isDiscount());
|
| 587 |
amountModel.setAmount(payoutSlab.getPayoutAmount() / payoutSlab.getOnwardsAmount());
|
589 |
amountModel.setAmount(payoutSlab.getPayoutAmount() / payoutSlab.getOnwardsAmount());
|
| 588 |
catalogSlabPayoutMap.get(catalogId).put(payoutSlab.getOnwardsAmount(),
|
590 |
catalogSlabPayoutMap.get(catalogId).put(payoutSlab.getOnwardsAmount(),
|
| 589 |
amountModel);
|
591 |
amountModel);
|
| 590 |
}
|
592 |
}
|
| 591 |
} else if (itemCriteriaPayout.getAmountType().equals(AmountType.PERCENTAGE)) {
|
593 |
} else if (itemCriteriaPayout.getAmountType().equals(AmountType.PERCENTAGE)) {
|
| Line 594... |
Line 596... |
| 594 |
catalogSlabPayoutMap.put(catalogId, new LinkedHashMap<>());
|
596 |
catalogSlabPayoutMap.put(catalogId, new LinkedHashMap<>());
|
| 595 |
}
|
597 |
}
|
| 596 |
AmountModel amountModel = new AmountModel();
|
598 |
AmountModel amountModel = new AmountModel();
|
| 597 |
amountModel.setAmountType(AmountType.PERCENTAGE);
|
599 |
amountModel.setAmountType(AmountType.PERCENTAGE);
|
| 598 |
amountModel.setAmount(payoutSlab.getPayoutAmount());
|
600 |
amountModel.setAmount(payoutSlab.getPayoutAmount());
|
| - |
|
601 |
amountModel.setDiscount(createOfferRequest.isDiscount());
|
| 599 |
catalogSlabPayoutMap.get(catalogId).put(payoutSlab.getOnwardsAmount(),
|
602 |
catalogSlabPayoutMap.get(catalogId).put(payoutSlab.getOnwardsAmount(),
|
| 600 |
amountModel);
|
603 |
amountModel);
|
| 601 |
}
|
604 |
}
|
| 602 |
}
|
605 |
}
|
| 603 |
}
|
606 |
}
|
| Line 808... |
Line 811... |
| 808 |
//ignore reasonably small
|
811 |
//ignore reasonably small
|
| 809 |
if (amount < Utils.DOUBLE_EPSILON) continue;
|
812 |
if (amount < Utils.DOUBLE_EPSILON) continue;
|
| 810 |
AmountModel amountModel = new AmountModel();
|
813 |
AmountModel amountModel = new AmountModel();
|
| 811 |
amountModel.setAmountType(itemCriteriaPayout.getAmountType());
|
814 |
amountModel.setAmountType(itemCriteriaPayout.getAmountType());
|
| 812 |
amountModel.setAmount(amount);
|
815 |
amountModel.setAmount(amount);
|
| - |
|
816 |
amountModel.setDiscount(createOfferRequest.isDiscount());
|
| 813 |
InventoryPayoutModel inventoryPayoutModel = priceCircularService.getPayouts(inventoryItemsMap.get(lineItemValueEntry.getKey().getInventoryItemId()));
|
817 |
InventoryPayoutModel inventoryPayoutModel = priceCircularService.getPayouts(inventoryItemsMap.get(lineItemValueEntry.getKey().getInventoryItemId()));
|
| 814 |
double rolloutAmount = inventoryPayoutModel.getRolloutAmount(amountModel);
|
818 |
double rolloutAmount = inventoryPayoutModel.getRolloutAmount(amountModel);
|
| 815 |
totalRolloutAmount += rolloutAmount;
|
819 |
totalRolloutAmount += rolloutAmount;
|
| 816 |
|
820 |
|
| 817 |
OfferPayout offerPayout = new OfferPayout(fofoId, createOfferRequest.getId(), criteriaId, amount, lineItemValueEntry.getKey().getSerialNumber(), rolloutAmount, SchemePayoutStatus.CREDITED, createOfferRequest.getDescription(), LocalDateTime.now());
|
821 |
OfferPayout offerPayout = new OfferPayout(fofoId, createOfferRequest.getId(), criteriaId, amount, lineItemValueEntry.getKey().getSerialNumber(), rolloutAmount, SchemePayoutStatus.CREDITED, createOfferRequest.getDescription(), LocalDateTime.now());
|