This commit is contained in:
parent
88a45e7361
commit
95fd3012ec
1 changed files with 3 additions and 1 deletions
|
|
@ -246,6 +246,7 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
|
||||
BigDecimal quantity = quantities.get(rate.getCurrencyId());
|
||||
BigDecimal freeQuantity;
|
||||
boolean freeQuantityIsDelta = false;
|
||||
if (quantity.compareTo(BigDecimal.ZERO) <= 0 || NPR.compareTo(BigDecimal.ZERO) < 0) {
|
||||
freeQuantity = BigDecimal.ZERO;
|
||||
} else {
|
||||
|
|
@ -268,6 +269,7 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
|
||||
BigDecimal delta = posMoney.subtract(minPos.divide(rate.getValue(), RoundingMode.HALF_UP));
|
||||
if (delta.compareTo(BigDecimal.ZERO) >= 0 && delta.compareTo(quantity) <= 0) {
|
||||
freeQuantityIsDelta = true;
|
||||
freeQuantity = delta;
|
||||
} else if (delta.compareTo(BigDecimal.ZERO) < 0 || delta.compareTo(quantity) > 0) {
|
||||
freeQuantity = quantity;
|
||||
|
|
@ -279,7 +281,7 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
row.setFreeQuantity(freeQuantity);
|
||||
|
||||
log.debug("tkr = {}: Quantity[{}] = {}", tkr, rate.getCurrency(), quantity);
|
||||
log.debug("tkr = {}: FreeQuantity (delta) [{}] = {}", tkr, rate.getCurrency(), freeQuantity);
|
||||
log.debug("tkr = {}: FreeQuantity (from {}) [{}] = {}", tkr, freeQuantityIsDelta ? "delta" : "quantity", rate.getCurrency(), freeQuantity);
|
||||
log.debug("tkr = {}: LockQuantity [{}] = {}", tkr, rate.getCurrency(), lockQuantity);
|
||||
|
||||
lockValue = lockValue.add(lockQuantity.multiply(rate.getValue()));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue