Custom fields
This commit is contained in:
parent
d017399ccf
commit
7791f58e27
|
|
@ -115,11 +115,17 @@ List<String> filteredProductsSelector(
|
||||||
if (productListState.custom1Filters.isNotEmpty &&
|
if (productListState.custom1Filters.isNotEmpty &&
|
||||||
!productListState.custom1Filters.contains(product.customValue1)) {
|
!productListState.custom1Filters.contains(product.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (productListState.custom2Filters.isNotEmpty &&
|
||||||
if (productListState.custom2Filters.isNotEmpty &&
|
|
||||||
!productListState.custom2Filters.contains(product.customValue2)) {
|
!productListState.custom2Filters.contains(product.customValue2)) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (productListState.custom3Filters.isNotEmpty &&
|
||||||
|
!productListState.custom3Filters.contains(product.customValue3)) {
|
||||||
|
return false;
|
||||||
|
} else if (productListState.custom4Filters.isNotEmpty &&
|
||||||
|
!productListState.custom4Filters.contains(product.customValue4)) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,14 @@ List<String> filteredQuotesSelector(
|
||||||
} else if (quoteListState.custom2Filters.isNotEmpty &&
|
} else if (quoteListState.custom2Filters.isNotEmpty &&
|
||||||
!quoteListState.custom2Filters.contains(quote.customValue2)) {
|
!quoteListState.custom2Filters.contains(quote.customValue2)) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (quoteListState.custom3Filters.isNotEmpty &&
|
||||||
|
!quoteListState.custom3Filters.contains(quote.customValue3)) {
|
||||||
|
return false;
|
||||||
|
} else if (quoteListState.custom4Filters.isNotEmpty &&
|
||||||
|
!quoteListState.custom4Filters.contains(quote.customValue4)) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,16 +73,13 @@ List<String> filteredRecurringInvoicesSelector(
|
||||||
if (invoiceListState.custom1Filters.isNotEmpty &&
|
if (invoiceListState.custom1Filters.isNotEmpty &&
|
||||||
!invoiceListState.custom1Filters.contains(invoice.customValue1)) {
|
!invoiceListState.custom1Filters.contains(invoice.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (invoiceListState.custom2Filters.isNotEmpty &&
|
||||||
if (invoiceListState.custom2Filters.isNotEmpty &&
|
|
||||||
!invoiceListState.custom2Filters.contains(invoice.customValue2)) {
|
!invoiceListState.custom2Filters.contains(invoice.customValue2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (invoiceListState.custom3Filters.isNotEmpty &&
|
||||||
if (invoiceListState.custom3Filters.isNotEmpty &&
|
|
||||||
!invoiceListState.custom3Filters.contains(invoice.customValue3)) {
|
!invoiceListState.custom3Filters.contains(invoice.customValue3)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (invoiceListState.custom4Filters.isNotEmpty &&
|
||||||
if (invoiceListState.custom4Filters.isNotEmpty &&
|
|
||||||
!invoiceListState.custom4Filters.contains(invoice.customValue4)) {
|
!invoiceListState.custom4Filters.contains(invoice.customValue4)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -259,17 +259,17 @@ List<String> filteredTasksSelector(
|
||||||
if (taskListState.custom1Filters.isNotEmpty &&
|
if (taskListState.custom1Filters.isNotEmpty &&
|
||||||
!taskListState.custom1Filters.contains(task.customValue1)) {
|
!taskListState.custom1Filters.contains(task.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (taskListState.custom2Filters.isNotEmpty &&
|
||||||
if (taskListState.custom2Filters.isNotEmpty &&
|
|
||||||
!taskListState.custom2Filters.contains(task.customValue2)) {
|
!taskListState.custom2Filters.contains(task.customValue2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (taskListState.custom3Filters.isNotEmpty &&
|
||||||
/*
|
!taskListState.custom3Filters.contains(task.customValue3)) {
|
||||||
if (taskListState.filterEntityId != null &&
|
return false;
|
||||||
task.entityId != taskListState.filterEntityId) {
|
} else if (taskListState.custom4Filters.isNotEmpty &&
|
||||||
|
!taskListState.custom4Filters.contains(task.customValue4)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return true;
|
return true;
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,15 @@ List<String> filteredVendorsSelector(
|
||||||
if (vendorListState.custom1Filters.isNotEmpty &&
|
if (vendorListState.custom1Filters.isNotEmpty &&
|
||||||
!vendorListState.custom1Filters.contains(vendor.customValue1)) {
|
!vendorListState.custom1Filters.contains(vendor.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (vendorListState.custom2Filters.isNotEmpty &&
|
||||||
|
|
||||||
if (vendorListState.custom2Filters.isNotEmpty &&
|
|
||||||
!vendorListState.custom2Filters.contains(vendor.customValue2)) {
|
!vendorListState.custom2Filters.contains(vendor.customValue2)) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (vendorListState.custom3Filters.isNotEmpty &&
|
||||||
|
!vendorListState.custom3Filters.contains(vendor.customValue3)) {
|
||||||
|
return false;
|
||||||
|
} else if (vendorListState.custom4Filters.isNotEmpty &&
|
||||||
|
!vendorListState.custom4Filters.contains(vendor.customValue4)) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return vendor.matchesFilter(vendorListState.filter);
|
return vendor.matchesFilter(vendorListState.filter);
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,22 @@ class _ProductOverviewState extends State<ProductOverview> {
|
||||||
value: product.customValue2);
|
value: product.customValue2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (product.customValue3.isNotEmpty) {
|
||||||
|
final label3 = company.getCustomFieldLabel(CustomFieldType.product3);
|
||||||
|
fields[label3] = formatCustomValue(
|
||||||
|
context: context,
|
||||||
|
field: CustomFieldType.product3,
|
||||||
|
value: product.customValue3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (product.customValue4.isNotEmpty) {
|
||||||
|
final label4 = company.getCustomFieldLabel(CustomFieldType.product4);
|
||||||
|
fields[label4] = formatCustomValue(
|
||||||
|
context: context,
|
||||||
|
field: CustomFieldType.product4,
|
||||||
|
value: product.customValue4);
|
||||||
|
}
|
||||||
|
|
||||||
return ScrollableListView(
|
return ScrollableListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
EntityHeader(
|
EntityHeader(
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,22 @@ class _TaskOverviewState extends State<TaskOverview> {
|
||||||
value: task.customValue2);
|
value: task.customValue2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (task.customValue3.isNotEmpty) {
|
||||||
|
final label3 = company.getCustomFieldLabel(CustomFieldType.task3);
|
||||||
|
fields[label3] = formatCustomValue(
|
||||||
|
context: context,
|
||||||
|
field: CustomFieldType.task3,
|
||||||
|
value: task.customValue3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (task.customValue4.isNotEmpty) {
|
||||||
|
final label4 = company.getCustomFieldLabel(CustomFieldType.task4);
|
||||||
|
fields[label4] = formatCustomValue(
|
||||||
|
context: context,
|
||||||
|
field: CustomFieldType.task4,
|
||||||
|
value: task.customValue4);
|
||||||
|
}
|
||||||
|
|
||||||
List<Widget> _buildView() {
|
List<Widget> _buildView() {
|
||||||
final widgets = <Widget>[
|
final widgets = <Widget>[
|
||||||
EntityHeader(
|
EntityHeader(
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,22 @@ class VendorOverview extends StatelessWidget {
|
||||||
value: vendor.customValue2);
|
value: vendor.customValue2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vendor.customValue3.isNotEmpty) {
|
||||||
|
final label3 = company.getCustomFieldLabel(CustomFieldType.vendor3);
|
||||||
|
fields[label3] = formatCustomValue(
|
||||||
|
context: context,
|
||||||
|
field: CustomFieldType.vendor3,
|
||||||
|
value: vendor.customValue3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vendor.customValue4.isNotEmpty) {
|
||||||
|
final label4 = company.getCustomFieldLabel(CustomFieldType.vendor4);
|
||||||
|
fields[label4] = formatCustomValue(
|
||||||
|
context: context,
|
||||||
|
field: CustomFieldType.vendor4,
|
||||||
|
value: vendor.customValue4);
|
||||||
|
}
|
||||||
|
|
||||||
return ScrollableListView(
|
return ScrollableListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
EntityHeader(
|
EntityHeader(
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,17 @@ List<String> filteredStubsSelector(
|
||||||
if (stubListState.custom1Filters.isNotEmpty &&
|
if (stubListState.custom1Filters.isNotEmpty &&
|
||||||
!stubListState.custom1Filters.contains(stub.customValue1)) {
|
!stubListState.custom1Filters.contains(stub.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (stubListState.custom2Filters.isNotEmpty &&
|
||||||
if (stubListState.custom2Filters.isNotEmpty &&
|
|
||||||
!stubListState.custom2Filters.contains(stub.customValue2)) {
|
!stubListState.custom2Filters.contains(stub.customValue2)) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (stubListState.custom3Filters.isNotEmpty &&
|
||||||
|
!stubListState.custom3Filters.contains(stub.customValue3)) {
|
||||||
|
return false;
|
||||||
|
} else if (stubListState.custom4Filters.isNotEmpty &&
|
||||||
|
!stubListState.custom4Filters.contains(stub.customValue4)) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return stub.matchesFilter(stubListState.filter);
|
return stub.matchesFilter(stubListState.filter);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue