Skip to content

Commit

Permalink
Merge pull request #285 from enrique-lozano/fix/281
Browse files Browse the repository at this point in the history
No amount and title when editing an item in category for 'Both'
  • Loading branch information
enrique-lozano authored Dec 30, 2024
2 parents 1a6ed65 + 4213458 commit ae6e3e3
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions lib/app/transactions/form/transaction_form.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,25 +367,13 @@ class _TransactionFormPageState extends State<TransactionFormPage>
}

fillForm(MoneyTransaction transaction) async {
setState(() {
fromAccount = transaction.account;
transferAccount = transaction.receivingAccount;
date = transaction.date;
status = transaction.status;
selectedCategory = transaction.category;
recurrentRule = transaction.recurrentInfo;

if (selectedCategory != null &&
selectedCategory!.type == CategoryType.B) {
if (transaction.value < 0) {
selectedCategory!.type = CategoryType.E;
} else {
selectedCategory!.type = CategoryType.I;
}
}

tags = [...transaction.tags];
});
fromAccount = transaction.account;
transferAccount = transaction.receivingAccount;
date = transaction.date;
status = transaction.status;
selectedCategory = transaction.category;
recurrentRule = transaction.recurrentInfo;
tags = [...transaction.tags];

notesController.text = transaction.notes ?? '';
titleController.text = transaction.title ?? '';
Expand All @@ -398,6 +386,8 @@ class _TransactionFormPageState extends State<TransactionFormPage>

valueInDestinyController.text =
transaction.valueInDestiny?.abs().toString() ?? '';

setState(() {});
}

Widget buildValueInDestinyFormField() {
Expand Down

0 comments on commit ae6e3e3

Please sign in to comment.