Feature Request: Invoice vertical view

This commit is contained in:
Hillel Coren 2022-10-20 16:39:45 +03:00
parent 0a6804975f
commit ef240b27d9
2 changed files with 44 additions and 31 deletions

View File

@ -1233,6 +1233,8 @@ abstract class InvoiceEntity extends Object
bool get isRecurring => [EntityType.recurringInvoice].contains(entityType); bool get isRecurring => [EntityType.recurringInvoice].contains(entityType);
bool get isLinkedToRecurring => (recurringId ?? '').isNotEmpty;
bool get hasExchangeRate => exchangeRate != 1 && exchangeRate != 0; bool get hasExchangeRate => exchangeRate != 1 && exchangeRate != 0;
EmailTemplate get emailTemplate => isPurchaseOrder EmailTemplate get emailTemplate => isPurchaseOrder

View File

@ -806,9 +806,13 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
children: [ children: [
if (company.hasTaxes) if (company.hasTaxes)
Expanded( Expanded(
child: Tooltip(
message: localization
.inclusiveTaxes,
child: SwitchListTile( child: SwitchListTile(
dense: true, dense: true,
activeColor: Theme.of(context) activeColor:
Theme.of(context)
.colorScheme .colorScheme
.secondary, .secondary,
title: Text(localization title: Text(localization
@ -816,18 +820,24 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
value: invoice value: invoice
.usesInclusiveTaxes, .usesInclusiveTaxes,
onChanged: (value) { onChanged: (value) {
viewModel.onChanged( viewModel.onChanged(invoice
invoice.rebuild((b) => b .rebuild((b) => b
..usesInclusiveTaxes = ..usesInclusiveTaxes =
value)); value));
}, },
), ),
), ),
if (invoice.isInvoice) ),
if (invoice.isInvoice &&
invoice.isLinkedToRecurring)
Expanded( Expanded(
child: Tooltip(
message: localization
.autoBillEnabled,
child: SwitchListTile( child: SwitchListTile(
dense: true, dense: true,
activeColor: Theme.of(context) activeColor:
Theme.of(context)
.colorScheme .colorScheme
.secondary, .secondary,
title: Text(localization title: Text(localization
@ -835,13 +845,14 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
value: value:
invoice.autoBillEnabled, invoice.autoBillEnabled,
onChanged: (value) { onChanged: (value) {
viewModel.onChanged( viewModel.onChanged(invoice
invoice.rebuild((b) => b .rebuild((b) => b
..autoBillEnabled = ..autoBillEnabled =
value)); value));
}, },
), ),
), ),
),
], ],
) )
], ],