X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FLedgerTransaction.java;h=252b32f41ed7f1fe1ae8fbad7afbefde7c7127e7;hp=1685c1a7fa763af0647e36a504b5446bf41d1f34;hb=43893dc20e2552b711e85b453fa939efbc8bbbc2;hpb=1c42b2e42a6fe3fe2aaae3ad3480d924db75f4ba diff --git a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java index 1685c1a7..252b32f4 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java @@ -31,8 +31,7 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.Comparator; import java.util.Date; - -import static net.ktnx.mobileledger.utils.Logger.debug; +import java.util.GregorianCalendar; public class LedgerTransaction { private static final String DIGEST_TYPE = "SHA-256"; @@ -68,7 +67,7 @@ public class LedgerTransaction { dataLoaded = false; } public LedgerTransaction(Integer id, Date date, String description) { - this(id, date, description, Data.profile.get()); + this(id, date, description, Data.profile.getValue()); } public LedgerTransaction(Date date, String description) { this(null, date, description); @@ -203,7 +202,11 @@ public class LedgerTransaction { } result.setTpostings(postings); - result.setTdate(Globals.formatIsoDate(date)); + Date transactionDate = date; + if (transactionDate == null) { + transactionDate = new GregorianCalendar().getTime(); + } + result.setTdate(Globals.formatIsoDate(transactionDate)); result.setTdate2(null); result.setTindex(1); result.setTdescription(description);