Add optional setting to auto-fill a new invoice's item column
This commit is contained in:
parent
c12359b5ff
commit
528b7862e3
|
|
@ -73,8 +73,7 @@ InvoiceItemEntity convertTaskToInvoiceItem({
|
||||||
notes += hoursStr;
|
notes += hoursStr;
|
||||||
}
|
}
|
||||||
notes += lineBreak;
|
notes += lineBreak;
|
||||||
if (time.description.isNotEmpty &&
|
if (time.description.isNotEmpty && company.invoiceTaskItemDescription) {
|
||||||
(true || company.invoiceTaskItemDescription)) {
|
|
||||||
notes += time.description + lineBreak;
|
notes += time.description + lineBreak;
|
||||||
}
|
}
|
||||||
} else if (company.invoiceTaskDatelog) {
|
} else if (company.invoiceTaskDatelog) {
|
||||||
|
|
@ -95,8 +94,7 @@ InvoiceItemEntity convertTaskToInvoiceItem({
|
||||||
notes += hoursStr;
|
notes += hoursStr;
|
||||||
}
|
}
|
||||||
notes += lineBreak;
|
notes += lineBreak;
|
||||||
if (time.description.isNotEmpty &&
|
if (time.description.isNotEmpty && company.invoiceTaskItemDescription) {
|
||||||
(true || company.invoiceTaskItemDescription)) {
|
|
||||||
notes += time.description + lineBreak;
|
notes += time.description + lineBreak;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,14 +178,6 @@ class _TaskSettingsState extends State<TaskSettings> {
|
||||||
onChanged: (value) => viewModel.onCompanyChanged(
|
onChanged: (value) => viewModel.onCompanyChanged(
|
||||||
company.rebuild((b) => b..invoiceTaskHours = value)),
|
company.rebuild((b) => b..invoiceTaskHours = value)),
|
||||||
),
|
),
|
||||||
SwitchListTile(
|
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
|
||||||
title: Text(localization.invoiceTaskProject),
|
|
||||||
value: company.invoiceTaskProject,
|
|
||||||
subtitle: Text(localization.invoiceTaskProjectHelp),
|
|
||||||
onChanged: (value) => viewModel.onCompanyChanged(
|
|
||||||
company.rebuild((b) => b..invoiceTaskProject = value)),
|
|
||||||
),
|
|
||||||
if (false && settings.showTaskItemDescription == true)
|
if (false && settings.showTaskItemDescription == true)
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
activeColor: Theme.of(context).colorScheme.secondary,
|
activeColor: Theme.of(context).colorScheme.secondary,
|
||||||
|
|
@ -195,6 +187,32 @@ class _TaskSettingsState extends State<TaskSettings> {
|
||||||
onChanged: (value) => viewModel.onCompanyChanged(company
|
onChanged: (value) => viewModel.onCompanyChanged(company
|
||||||
.rebuild((b) => b..invoiceTaskItemDescription = value)),
|
.rebuild((b) => b..invoiceTaskItemDescription = value)),
|
||||||
),
|
),
|
||||||
|
SwitchListTile(
|
||||||
|
activeColor: Theme.of(context).colorScheme.secondary,
|
||||||
|
title: Text(localization.invoiceTaskProject),
|
||||||
|
value: company.invoiceTaskProject,
|
||||||
|
subtitle: Text(localization.invoiceTaskProjectHelp),
|
||||||
|
onChanged: (value) => viewModel.onCompanyChanged(
|
||||||
|
company.rebuild((b) => b..invoiceTaskProject = value)),
|
||||||
|
),
|
||||||
|
if (company.invoiceTaskProject)
|
||||||
|
AppDropdownButton<bool>(
|
||||||
|
labelText: localization.location,
|
||||||
|
value: company.invoiceTaskProjectHeader,
|
||||||
|
onChanged: (dynamic value) {
|
||||||
|
viewModel.onCompanyChanged(company.rebuild(
|
||||||
|
(b) => b..invoiceTaskProjectHeader = value));
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.service),
|
||||||
|
value: true,
|
||||||
|
),
|
||||||
|
DropdownMenuItem(
|
||||||
|
child: Text(localization.description),
|
||||||
|
value: false,
|
||||||
|
),
|
||||||
|
]),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,10 @@ 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
|
||||||
|
'location': 'Location',
|
||||||
'invoice_task_item_description': 'Invoice Task Item Description',
|
'invoice_task_item_description': 'Invoice Task Item Description',
|
||||||
'invoice_task_item_description_help': 'Add the item description to the invoice line items',
|
'invoice_task_item_description_help':
|
||||||
|
'Add the item description to the invoice line items',
|
||||||
'next_send_time': 'Next Send Time',
|
'next_send_time': 'Next Send Time',
|
||||||
'uploaded_certificate': 'Successfully uploaded certificate',
|
'uploaded_certificate': 'Successfully uploaded certificate',
|
||||||
'certificate_set': 'Certificate set',
|
'certificate_set': 'Certificate set',
|
||||||
|
|
@ -102515,6 +102517,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['invoice_task_item_description_help'] ??
|
_localizedValues[localeCode]['invoice_task_item_description_help'] ??
|
||||||
_localizedValues['en']['invoice_task_item_description_help'];
|
_localizedValues['en']['invoice_task_item_description_help'];
|
||||||
|
|
||||||
|
String get location =>
|
||||||
|
_localizedValues[localeCode]['location'] ??
|
||||||
|
_localizedValues['en']['location'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue