From 7fc3485bb755bff8e2c0900f13991e0f1de0366e Mon Sep 17 00:00:00 2001 From: JeanGarf Date: Wed, 10 Jun 2020 22:36:41 +0200 Subject: [PATCH] #876 - Set amount to 0 if text field is empty --- .../ui/transaction/TransactionFormFragment.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/org/gnucash/android/ui/transaction/TransactionFormFragment.java b/app/src/main/java/org/gnucash/android/ui/transaction/TransactionFormFragment.java index a5f9b91e0..a5dc76b1b 100644 --- a/app/src/main/java/org/gnucash/android/ui/transaction/TransactionFormFragment.java +++ b/app/src/main/java/org/gnucash/android/ui/transaction/TransactionFormFragment.java @@ -869,6 +869,18 @@ private List extractSplitsFromView() { BigDecimal amountBigD = mAmountEditText.getValue(); + if (amountBigD != null) { + // Amount is null + + // RAF + + } else { + // Amount is not null + + // init to 0 + amountBigD=new BigDecimal(0); + } + String baseCurrencyCode = mTransactionsDbAdapter.getAccountCurrencyCode(mAccountUID); // Store signed amount