Transactions
This commit is contained in:
parent
e136d9a270
commit
524e501751
|
|
@ -119,6 +119,7 @@ class EntityAction extends EnumClass {
|
||||||
static const EntityAction accept = _$accept;
|
static const EntityAction accept = _$accept;
|
||||||
static const EntityAction addToInventory = _$addToInventory;
|
static const EntityAction addToInventory = _$addToInventory;
|
||||||
static const EntityAction convertToExpense = _$convertToExpense;
|
static const EntityAction convertToExpense = _$convertToExpense;
|
||||||
|
static const EntityAction convertToPayment = _$convertToPayment;
|
||||||
static const EntityAction merge = _$merge;
|
static const EntityAction merge = _$merge;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,8 @@ const EntityAction _$accept = const EntityAction._('accept');
|
||||||
const EntityAction _$addToInventory = const EntityAction._('addToInventory');
|
const EntityAction _$addToInventory = const EntityAction._('addToInventory');
|
||||||
const EntityAction _$convertToExpense =
|
const EntityAction _$convertToExpense =
|
||||||
const EntityAction._('convertToExpense');
|
const EntityAction._('convertToExpense');
|
||||||
|
const EntityAction _$convertToPayment =
|
||||||
|
const EntityAction._('convertToPayment');
|
||||||
const EntityAction _$merge = const EntityAction._('merge');
|
const EntityAction _$merge = const EntityAction._('merge');
|
||||||
|
|
||||||
EntityAction _$valueOf(String name) {
|
EntityAction _$valueOf(String name) {
|
||||||
|
|
@ -227,6 +229,8 @@ EntityAction _$valueOf(String name) {
|
||||||
return _$addToInventory;
|
return _$addToInventory;
|
||||||
case 'convertToExpense':
|
case 'convertToExpense':
|
||||||
return _$convertToExpense;
|
return _$convertToExpense;
|
||||||
|
case 'convertToPayment':
|
||||||
|
return _$convertToPayment;
|
||||||
case 'merge':
|
case 'merge':
|
||||||
return _$merge;
|
return _$merge;
|
||||||
default:
|
default:
|
||||||
|
|
@ -305,6 +309,7 @@ final BuiltSet<EntityAction> _$values =
|
||||||
_$accept,
|
_$accept,
|
||||||
_$addToInventory,
|
_$addToInventory,
|
||||||
_$convertToExpense,
|
_$convertToExpense,
|
||||||
|
_$convertToPayment,
|
||||||
_$merge,
|
_$merge,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/invoice_model.dart';
|
import 'package:invoiceninja_flutter/data/models/invoice_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/buttons/elevated_button.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/search_text.dart';
|
import 'package:invoiceninja_flutter/ui/app/search_text.dart';
|
||||||
|
|
@ -7,6 +9,7 @@ import 'package:invoiceninja_flutter/ui/invoice/invoice_list_item.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/transaction/view/transaction_view_vm.dart';
|
import 'package:invoiceninja_flutter/ui/transaction/view/transaction_view_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/view_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/view_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/icons.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
class TransactionView extends StatefulWidget {
|
class TransactionView extends StatefulWidget {
|
||||||
|
|
@ -136,6 +139,7 @@ class __MatchInvoicesState extends State<_MatchInvoices> {
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -165,26 +169,45 @@ class __MatchInvoicesState extends State<_MatchInvoices> {
|
||||||
),
|
),
|
||||||
ListDivider(),
|
ListDivider(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
separatorBuilder: (context, index) => ListDivider(),
|
separatorBuilder: (context, index) => ListDivider(),
|
||||||
itemCount: _invoices.length,
|
itemCount: _invoices.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
final invoice = _invoices[index];
|
final invoice = _invoices[index];
|
||||||
return InvoiceListItem(
|
return InvoiceListItem(
|
||||||
invoice: invoice,
|
invoice: invoice,
|
||||||
showCheck: true,
|
showCheck: true,
|
||||||
isChecked: _selectedInvoices.contains(invoice),
|
isChecked: _selectedInvoices.contains(invoice),
|
||||||
onTap: () => setState(() {
|
onTap: () => setState(() {
|
||||||
if (_selectedInvoices.contains(invoice)) {
|
if (_selectedInvoices.contains(invoice)) {
|
||||||
_selectedInvoices.remove(invoice);
|
_selectedInvoices.remove(invoice);
|
||||||
} else {
|
} else {
|
||||||
_selectedInvoices.add(invoice);
|
_selectedInvoices.add(invoice);
|
||||||
}
|
}
|
||||||
updateInvoiceList();
|
updateInvoiceList();
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
ListDivider(),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20,
|
||||||
|
bottom: 20,
|
||||||
|
right: 20,
|
||||||
|
top: 4,
|
||||||
|
),
|
||||||
|
child: AppButton(
|
||||||
|
label: localization.convertToPayment,
|
||||||
|
onPressed: _selectedInvoices.length == 0
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
|
//
|
||||||
|
},
|
||||||
|
iconData: getEntityActionIcon(EntityAction.convertToExpense),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'convert_to_payment': 'Convert to Payment',
|
||||||
'deposit': 'Deposit',
|
'deposit': 'Deposit',
|
||||||
'withdrawal': 'Withdrawal',
|
'withdrawal': 'Withdrawal',
|
||||||
'deposits': 'Deposits',
|
'deposits': 'Deposits',
|
||||||
|
|
@ -87332,6 +87333,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['withdrawals'] ??
|
_localizedValues[localeCode]['withdrawals'] ??
|
||||||
_localizedValues['en']['withdrawals'];
|
_localizedValues['en']['withdrawals'];
|
||||||
|
|
||||||
|
String get convertToPayment =>
|
||||||
|
_localizedValues[localeCode]['convert_to_payment'] ??
|
||||||
|
_localizedValues['en']['convert_to_payment'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ IconData getEntityActionIcon(EntityAction entityAction) {
|
||||||
case EntityAction.convertToInvoice:
|
case EntityAction.convertToInvoice:
|
||||||
case EntityAction.convertToExpense:
|
case EntityAction.convertToExpense:
|
||||||
case EntityAction.convertToProject:
|
case EntityAction.convertToProject:
|
||||||
|
case EntityAction.convertToPayment:
|
||||||
return Icons.content_copy;
|
return Icons.content_copy;
|
||||||
case EntityAction.approve:
|
case EntityAction.approve:
|
||||||
case EntityAction.accept:
|
case EntityAction.accept:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue