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,40 +806,51 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
children: [ children: [
if (company.hasTaxes) if (company.hasTaxes)
Expanded( Expanded(
child: SwitchListTile( child: Tooltip(
dense: true, message: localization
activeColor: Theme.of(context) .inclusiveTaxes,
.colorScheme child: SwitchListTile(
.secondary, dense: true,
title: Text(localization activeColor:
.inclusiveTaxes), Theme.of(context)
value: invoice .colorScheme
.usesInclusiveTaxes, .secondary,
onChanged: (value) { title: Text(localization
viewModel.onChanged( .inclusiveTaxes),
invoice.rebuild((b) => b value: invoice
..usesInclusiveTaxes = .usesInclusiveTaxes,
value)); onChanged: (value) {
}, viewModel.onChanged(invoice
.rebuild((b) => b
..usesInclusiveTaxes =
value));
},
),
), ),
), ),
if (invoice.isInvoice) if (invoice.isInvoice &&
invoice.isLinkedToRecurring)
Expanded( Expanded(
child: SwitchListTile( child: Tooltip(
dense: true, message: localization
activeColor: Theme.of(context) .autoBillEnabled,
.colorScheme child: SwitchListTile(
.secondary, dense: true,
title: Text(localization activeColor:
.autoBillEnabled), Theme.of(context)
value: .colorScheme
invoice.autoBillEnabled, .secondary,
onChanged: (value) { title: Text(localization
viewModel.onChanged( .autoBillEnabled),
invoice.rebuild((b) => b value:
..autoBillEnabled = invoice.autoBillEnabled,
value)); onChanged: (value) {
}, viewModel.onChanged(invoice
.rebuild((b) => b
..autoBillEnabled =
value));
},
),
), ),
), ),
], ],