Skip to content

Commit

Permalink
split should use absolute value
Browse files Browse the repository at this point in the history
  • Loading branch information
fefe982 committed Oct 17, 2015
1 parent a60b3c7 commit c2179ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,15 @@ private List<Split> extractSplitsFromView(){
BigDecimal amountBigDecimal = viewHolder.splitAmountEditText.getValue();

String currencyCode = mAccountsDbAdapter.getCurrencyCode(mAccountUID);
Money valueAmount = new Money(amountBigDecimal, Currency.getInstance(currencyCode));
Money valueAmount = new Money(amountBigDecimal.abs(), Currency.getInstance(currencyCode));

String accountUID = mAccountsDbAdapter.getUID(viewHolder.accountsSpinner.getSelectedItemId());
Split split = new Split(valueAmount, accountUID);
split.setMemo(viewHolder.splitMemoEditText.getText().toString());
split.setType(viewHolder.splitTypeButton.getTransactionType());
split.setUID(viewHolder.splitUidTextView.getText().toString().trim());
if (viewHolder.quantity != null)
split.setQuantity(viewHolder.quantity);
split.setQuantity(viewHolder.quantity.absolute());
splitList.add(split);
}
return splitList;
Expand Down

0 comments on commit c2179ce

Please sign in to comment.