This commit is contained in:
parent
557b9333b5
commit
1d300c965b
3 changed files with 15 additions and 7 deletions
|
|
@ -209,7 +209,7 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
if (registry.getBalance() == null) continue;
|
||||
BigDecimal forAdd = registry.getBalance().multiply(currencyRate.getValue());
|
||||
sumValue = sumValue.add(forAdd);
|
||||
value = value.add(forAdd);
|
||||
if (forAdd.compareTo(BigDecimal.ZERO) > 0) value = value.add(forAdd);
|
||||
quantity = quantity.add(registry.getBalance());
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +340,11 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
freeQuantity = quantity;
|
||||
} else freeQuantity = BigDecimal.ZERO;
|
||||
}
|
||||
BigDecimal lockQuantity = quantity.subtract(freeQuantity);
|
||||
|
||||
BigDecimal lockQuantity;
|
||||
if (quantity.compareTo(BigDecimal.ZERO) > 0) lockQuantity = quantity.subtract(freeQuantity);
|
||||
else lockQuantity = BigDecimal.ZERO.subtract(freeQuantity);
|
||||
|
||||
row.setQuantity(quantity.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : quantity);
|
||||
row.setLockQuantity(lockQuantity);
|
||||
row.setFreeQuantity(freeQuantity);
|
||||
|
|
@ -349,8 +353,12 @@ public class KSRepLccValueReportBuilder extends CSVReportBuilder<EmptyParams, KS
|
|||
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()));
|
||||
freeValue = freeValue.add(freeQuantity.multiply(rate.getValue()));
|
||||
if (lockQuantity.compareTo(BigDecimal.ZERO) > 0) {
|
||||
lockValue = lockValue.add(lockQuantity.multiply(rate.getValue()));
|
||||
}
|
||||
if (freeQuantity.compareTo(BigDecimal.ZERO) > 0) {
|
||||
freeValue = freeValue.add(freeQuantity.multiply(rate.getValue()));
|
||||
}
|
||||
|
||||
rowsForAdd.add(row);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
"FIRMID","SESSION_ID","SESSION_DATE","ACCOUNT","TKR","SECURITYID","VALUE","DATE"
|
||||
"TRADING_CODE","2","20.01.1970T02:49:58","ACCOUNT_SYMBOL_VALUE","TKR","SECURITY_SYMBOL","22","07.07.2023"
|
||||
"TRADING_CODE","2","20.01.1970T02:49:58","ACCOUNT_SYMBOL_VALUE","TKR","SECURITY_SYMBOL","-22","23.12.2024"
|
||||
|
|
|
|||
|
|
|
@ -1,3 +1,3 @@
|
|||
"FIRM_ID","REPORT_DATE","TKR","SUM_VALUE","LOCK_VALUE","FREE_VALUE","SINGLE_LIMIT","CURRENCY","NCC_REAL_ACCOUNT","QUANTITY","LOCK_QUANTITY","FREE_QUANTITY","VALUE"
|
||||
,"12.12.2024T11:11:59","tkr","30300.00","0.00","30300.00","278460.00","EUR",,"300.00","0.00","300.00","30000.00"
|
||||
,"12.12.2024T11:11:59","tkr","30300.00","0.00","30300.00","278460.00","RUB",,"300.00","0.00","300.00","300.00"
|
||||
,"20.12.2024T14:18:00","tkr","600.00","0.00","600.00","8190.00","EUR",,"300.00","0.00","300.00","300.00"
|
||||
,"20.12.2024T14:18:00","tkr","600.00","0.00","600.00","8190.00","RUB",,"300.00","0.00","300.00","300.00"
|
||||
|
|
|
|||
|
Loading…
Add table
Reference in a new issue