From ee517e303eef7ec2ba6ca39dc73252b539bce0da Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 27 Apr 2021 22:18:19 +0300 Subject: [PATCH] stop resetting the date when an old transaction is loaded into the form --- .../mobileledger/ui/new_transaction/NewTransactionModel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index 95444ac6..311226da 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -469,8 +469,12 @@ public class NewTransactionModel extends ViewModel { List newList = new ArrayList<>(); Item.resetIdDispenser(); + Item currentHead = items.getValue() + .get(0); TransactionHead head = new TransactionHead(tr.transaction.getDescription()); head.setComment(tr.transaction.getComment()); + if (currentHead instanceof TransactionHead) + head.setDate(((TransactionHead) currentHead).date); newList.add(head); -- 2.39.5