| Line 671... |
Line 671... |
| 671 |
}
|
671 |
}
|
| 672 |
|
672 |
|
| 673 |
@Override
|
673 |
@Override
|
| 674 |
public float getSpecialSupportAmount(float supportAmount, PartnerType partnerType, LocalDate onDate, int catalogId, float taxRate) throws ProfitMandiBusinessException {
|
674 |
public float getSpecialSupportAmount(float supportAmount, PartnerType partnerType, LocalDate onDate, int catalogId, float taxRate) throws ProfitMandiBusinessException {
|
| 675 |
float totalMargin = this.selectPercentageScheme(partnerType, onDate, catalogId, false, 0, 0).stream().collect(Collectors.summingDouble(x -> x.getAmount())).floatValue();
|
675 |
float totalMargin = this.selectPercentageScheme(partnerType, onDate, catalogId, false, 0, 0).stream().collect(Collectors.summingDouble(x -> x.getAmount())).floatValue();
|
| 676 |
float amountToCredit = supportAmount * (1 - totalMargin / (100 + taxRate));
|
676 |
float amountToCredit = supportAmount * (1 - (totalMargin / (100 + taxRate)));
|
| 677 |
return amountToCredit;
|
677 |
return amountToCredit;
|
| 678 |
}
|
678 |
}
|
| 679 |
|
679 |
|
| 680 |
private void processSpecialSupport(FofoOrder fofoOrder, List<Scheme> supportSchemes, InventoryItem inventoryItem, PartnerType partnerType, LocalDateTime saleDate) throws ProfitMandiBusinessException {
|
680 |
private void processSpecialSupport(FofoOrder fofoOrder, List<Scheme> supportSchemes, InventoryItem inventoryItem, PartnerType partnerType, LocalDateTime saleDate) throws ProfitMandiBusinessException {
|
| 681 |
int catalogId = inventoryItem.getItem().getCatalogItemId();
|
681 |
int catalogId = inventoryItem.getItem().getCatalogItemId();
|