Add invoice/quote product columns
This commit is contained in:
parent
3a1bd6b76c
commit
b86f90b869
|
|
@ -78,7 +78,8 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
final state = widget.viewModel.state;
|
final viewModel = widget.viewModel;
|
||||||
|
final state = viewModel.state;
|
||||||
final settingsUIState = state.settingsUIState;
|
final settingsUIState = state.settingsUIState;
|
||||||
_focusNode = FocusScopeNode();
|
_focusNode = FocusScopeNode();
|
||||||
|
|
||||||
|
|
@ -88,6 +89,10 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
||||||
tabs++;
|
tabs++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (viewModel.settings.syncInvoiceQuoteColumns == false) {
|
||||||
|
tabs++;
|
||||||
|
}
|
||||||
|
|
||||||
[
|
[
|
||||||
EntityType.invoice,
|
EntityType.invoice,
|
||||||
EntityType.quote,
|
EntityType.quote,
|
||||||
|
|
@ -184,6 +189,10 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
||||||
localization.vendorDetails,
|
localization.vendorDetails,
|
||||||
if (company.isModuleEnabled(EntityType.purchaseOrder))
|
if (company.isModuleEnabled(EntityType.purchaseOrder))
|
||||||
localization.purchaseOrderDetails,
|
localization.purchaseOrderDetails,
|
||||||
|
if (settings.syncInvoiceQuoteColumns == false) ...[
|
||||||
|
localization.invoiceProductColumns,
|
||||||
|
localization.quoteProductColumns,
|
||||||
|
] else
|
||||||
localization.productColumns,
|
localization.productColumns,
|
||||||
if (company.isModuleEnabled(EntityType.task)) localization.taskColumns,
|
if (company.isModuleEnabled(EntityType.task)) localization.taskColumns,
|
||||||
localization.totalFields,
|
localization.totalFields,
|
||||||
|
|
@ -1076,6 +1085,53 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (settings.syncInvoiceQuoteColumns == false)
|
||||||
|
Expanded(
|
||||||
|
child: FormCard(
|
||||||
|
child: MultiSelectList(
|
||||||
|
options: [
|
||||||
|
ProductItemFields.item,
|
||||||
|
ProductItemFields.description,
|
||||||
|
if (company.enableProductQuantity)
|
||||||
|
ProductItemFields.quantity,
|
||||||
|
ProductItemFields.unitCost,
|
||||||
|
if (company.hasItemTaxes) ...[
|
||||||
|
ProductItemFields.tax,
|
||||||
|
ProductItemFields.taxAmount,
|
||||||
|
],
|
||||||
|
if (company.enableProductDiscount)
|
||||||
|
ProductItemFields.discount,
|
||||||
|
ProductItemFields.lineTotal,
|
||||||
|
ProductItemFields.custom1,
|
||||||
|
ProductItemFields.custom2,
|
||||||
|
ProductItemFields.custom3,
|
||||||
|
ProductItemFields.custom4,
|
||||||
|
ProductItemFields.grossLineTotal,
|
||||||
|
].map((field) => '\$product.$field').toList(),
|
||||||
|
defaultSelected: [
|
||||||
|
ProductItemFields.item,
|
||||||
|
ProductItemFields.description,
|
||||||
|
ProductItemFields.unitCost,
|
||||||
|
if (company.enableProductQuantity)
|
||||||
|
ProductItemFields.quantity,
|
||||||
|
if (company.enableProductDiscount)
|
||||||
|
ProductItemFields.discount,
|
||||||
|
if (company.hasItemTaxes) ProductItemFields.tax,
|
||||||
|
ProductItemFields.lineTotal,
|
||||||
|
].map((field) => '\$product.$field').toList(),
|
||||||
|
selected: settings
|
||||||
|
.getFieldsForSection(kPdfFieldsProductColumns),
|
||||||
|
onSelected: (values) {
|
||||||
|
viewModel.onSettingsChanged(
|
||||||
|
settings.setFieldsForSection(
|
||||||
|
kPdfFieldsProductColumns, values));
|
||||||
|
},
|
||||||
|
addTitle: localization.addField,
|
||||||
|
liveChanges: true,
|
||||||
|
prefix: 'product_quote',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
if (company.isModuleEnabled(EntityType.task))
|
if (company.isModuleEnabled(EntityType.task))
|
||||||
FormCard(
|
FormCard(
|
||||||
isLast: true,
|
isLast: true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue