Skip to content

Commit

Permalink
Issue XaBbl4#16: Fix show sums for selected depts
Browse files Browse the repository at this point in the history
  • Loading branch information
XaBbl4 committed Mar 28, 2020
1 parent cb0c3b3 commit e773587
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ public void onSelectionChange(int selectedCount) {

ListSumsByCabbage listSumsByCabbage = new ListSumsByCabbage();
for (SimpleDebt dept : adapterD.getSelectedDebts()) {
boolean startAmountIsPositive = dept.getStartAmount().abs().equals(dept.getStartAmount());
SumsByCabbage sumsByCabbage = new SumsByCabbage(dept.getCabbageID(),
dept.getOweMe(),
BigDecimal.ZERO.subtract(dept.getAmount()));
sumsByCabbage.setStartBalance(dept.getStartAmount());
listSumsByCabbage.getmList().add(sumsByCabbage);
dept.getOweMe().add(startAmountIsPositive ? dept.getStartAmount() : BigDecimal.ZERO),
BigDecimal.ZERO.subtract(dept.getAmount()).add(!startAmountIsPositive ? dept.getStartAmount() : BigDecimal.ZERO));
listSumsByCabbage.appendSumFact(sumsByCabbage);
}
updateSums(listSumsByCabbage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SumsByCabbage getSumsByCabbageId(long cabbageId) {
return result;
}

private void appendSumFact(SumsByCabbage input) {
public void appendSumFact(SumsByCabbage input) {
SumsByCabbage sumsByCabbage = getSumsByCabbageId(input.getCabbageId());
if (sumsByCabbage == null) {
mList.add(new SumsByCabbage(input.getCabbageId(), input.getInTrSum(), input.getOutTrSum()));
Expand Down

0 comments on commit e773587

Please sign in to comment.