]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / LedgerTransactionAccount.java
index 53b6a65f3bca893186d73bb0710719fdab8d3fae..9706dbb5633e0d8428c98444156a942ee4cd9bd5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 package net.ktnx.mobileledger.model;
 
 import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 
 import net.ktnx.mobileledger.db.TransactionAccount;
 import net.ktnx.mobileledger.utils.Misc;
@@ -29,6 +30,7 @@ public class LedgerTransactionAccount {
     private String shortAccountName;
     private float amount;
     private boolean amountSet = false;
+    @Nullable
     private String currency;
     private String comment;
     private boolean amountValid = true;
@@ -103,6 +105,7 @@ public class LedgerTransactionAccount {
         return amountSet;
     }
     public boolean isAmountValid() { return amountValid; }
+    @Nullable
     public String getCurrency() {
         return currency;
     }
@@ -129,7 +132,7 @@ public class LedgerTransactionAccount {
         if (amountSet)
             dbo.setAmount(amount);
         dbo.setComment(comment);
-        dbo.setCurrency(currency);
+        dbo.setCurrency(Misc.nullIsEmpty(currency));
         dbo.setId(dbId);
 
         return dbo;