SDF01 executor
This commit is contained in:
parent
3a36df08eb
commit
2c268d84fa
1 changed files with 11 additions and 6 deletions
|
|
@ -150,14 +150,15 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
|||
registryImdg.insert(registry);
|
||||
return registry;
|
||||
};
|
||||
|
||||
Optional<Registry> reg = findReg(stmt);
|
||||
Registry regFinal;
|
||||
Registry rgs;
|
||||
if (reg.isPresent()) {
|
||||
update.accept(reg.get());
|
||||
regFinal = reg.get();
|
||||
rgs = reg.get();
|
||||
updateReg(stmt, rgs);
|
||||
registryImdg.update(rgs);
|
||||
} else {
|
||||
regFinal = create.get();
|
||||
rgs = createRegistryByStatement(stmt, company, account);
|
||||
registryImdg.insert(rgs);
|
||||
}
|
||||
//todo
|
||||
//1. stmt.setOperationStatus в зависимости от diffBalance = 0
|
||||
|
|
@ -292,7 +293,7 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
|||
}
|
||||
}
|
||||
rgs.setCheckBalance(BigDecimalUtil.safeBD(statement.getAmount()));
|
||||
rgs.setCheckBalance(rgs.getCheckBalance().negate());
|
||||
rgs.setDiffBalance(rgs.getCheckBalance().negate());
|
||||
rgs.setBalanceDimension(BalanceDimension.MONY.getKey()); //fixme ! смотри описание и ссылка на начало html'ки
|
||||
//fixme !rgs.setSettlementCode();
|
||||
rgs.setTradingDate(statement.getSettlementDate()); //fixme ! today ?
|
||||
|
|
@ -311,6 +312,10 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
|||
case in -> r.setBalance(r.getBalance().add(s.getAmount()));
|
||||
case out -> r.setBalance(r.getBalance().subtract(s.getAmount()));
|
||||
}
|
||||
r.setCheckBalance(s.getAmount());
|
||||
BigDecimal balance = BigDecimalUtil.safeBD(r.getBalance());
|
||||
BigDecimal checkBalance = BigDecimalUtil.safeBD(r.getCheckBalance());
|
||||
r.setDiffBalance(balance.subtract(checkBalance));
|
||||
r.setUpdated(Instant.now());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue