X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FLedgerTransactionAccount.java;h=1791cfbc5962e79b5b3c16ab4516c5e921a1765b;hp=c97b7e4a5e7afd801ab73ca4234da776c66753ed;hb=a1f5cf187a6bc2731aa1ed057d3d11fccc5de2c4;hpb=6ca003394e24fb1b47cdaa2ca31679ec6da88af0 diff --git a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java index c97b7e4a..1791cfbc 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java @@ -30,11 +30,13 @@ public class LedgerTransactionAccount { private boolean amountSet = false; private String currency; private String comment; + private boolean amountValid = true; public LedgerTransactionAccount(String accountName, float amount, String currency, String comment) { this.setAccountName(accountName); this.amount = amount; this.amountSet = true; + this.amountValid = true; this.currency = Misc.emptyIsNull(currency); this.comment = Misc.emptyIsNull(comment); } @@ -51,6 +53,7 @@ public class LedgerTransactionAccount { setComment(origin.getComment()); if (origin.isAmountSet()) setAmount(origin.getAmount()); + amountValid = origin.amountValid; currency = origin.getCurrency(); } public String getComment() { @@ -78,13 +81,19 @@ public class LedgerTransactionAccount { public void setAmount(float account_amount) { this.amount = account_amount; this.amountSet = true; + this.amountValid = true; } public void resetAmount() { this.amountSet = false; + this.amountValid = true; + } + public void invalidateAmount() { + this.amountValid = false; } public boolean isAmountSet() { return amountSet; } + public boolean isAmountValid() { return amountValid; } public String getCurrency() { return currency; }