Transactions
This commit is contained in:
parent
a01f4addfd
commit
f670db3b66
|
|
@ -78,11 +78,11 @@ abstract class TransactionEntity extends Object
|
||||||
bankAccountId: '',
|
bankAccountId: '',
|
||||||
category: '',
|
category: '',
|
||||||
currencyId: '',
|
currencyId: '',
|
||||||
date: '',
|
date: convertDateTimeToSqlDate(),
|
||||||
description: '',
|
description: '',
|
||||||
expenseId: '',
|
expenseId: '',
|
||||||
invoiceId: '',
|
invoiceId: '',
|
||||||
baseType: '',
|
baseType: TYPE_DEPOSIT,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/forms/app_dropdown_button.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/forms/date_picker.dart';
|
import 'package:invoiceninja_flutter/ui/app/forms/date_picker.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/transaction/edit/transaction_edit_vm.dart';
|
import 'package:invoiceninja_flutter/ui/transaction/edit/transaction_edit_vm.dart';
|
||||||
|
|
@ -104,12 +106,23 @@ class _TransactionEditState extends State<TransactionEdit> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FormCard(
|
FormCard(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
DecoratedFormField(
|
AppDropdownButton<String>(
|
||||||
label: localization.amount,
|
labelText: localization.type,
|
||||||
keyboardType:
|
value: transaction.baseType,
|
||||||
TextInputType.numberWithOptions(decimal: true),
|
onChanged: (dynamic value) {
|
||||||
controller: _amountController,
|
viewModel.onChanged(
|
||||||
|
transaction.rebuild((b) => b..baseType = value));
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.deposit),
|
||||||
|
value: TransactionEntity.TYPE_DEPOSIT,
|
||||||
),
|
),
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.withdrawal),
|
||||||
|
value: TransactionEntity.TYPE_WITHDRAWL,
|
||||||
|
),
|
||||||
|
]),
|
||||||
DatePicker(
|
DatePicker(
|
||||||
labelText: localization.date,
|
labelText: localization.date,
|
||||||
onSelected: (date, _) {
|
onSelected: (date, _) {
|
||||||
|
|
@ -117,6 +130,13 @@ class _TransactionEditState extends State<TransactionEdit> {
|
||||||
transaction.rebuild((b) => b..date = date));
|
transaction.rebuild((b) => b..date = date));
|
||||||
},
|
},
|
||||||
selectedDate: transaction.date),
|
selectedDate: transaction.date),
|
||||||
|
DecoratedFormField(
|
||||||
|
autofocus: transaction.isNew,
|
||||||
|
label: localization.amount,
|
||||||
|
keyboardType:
|
||||||
|
TextInputType.numberWithOptions(decimal: true),
|
||||||
|
controller: _amountController,
|
||||||
|
),
|
||||||
DecoratedFormField(
|
DecoratedFormField(
|
||||||
label: localization.description,
|
label: localization.description,
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue