diff --git a/lib/redux/company_gateway/company_gateway_actions.dart b/lib/redux/company_gateway/company_gateway_actions.dart index a8c141068..641559a6a 100644 --- a/lib/redux/company_gateway/company_gateway_actions.dart +++ b/lib/redux/company_gateway/company_gateway_actions.dart @@ -234,6 +234,18 @@ class FilterCompanyGatewaysByCustom2 implements PersistUI { final String value; } +class FilterCompanyGatewaysByCustom3 implements PersistUI { + FilterCompanyGatewaysByCustom3(this.value); + + final String value; +} + +class FilterCompanyGatewaysByCustom4 implements PersistUI { + FilterCompanyGatewaysByCustom4(this.value); + + final String value; +} + class FilterCompanyGatewaysByEntity implements PersistUI { FilterCompanyGatewaysByEntity({this.entityId, this.entityType}); diff --git a/lib/redux/document/document_actions.dart b/lib/redux/document/document_actions.dart index 573131d8d..05afc1ca4 100644 --- a/lib/redux/document/document_actions.dart +++ b/lib/redux/document/document_actions.dart @@ -224,6 +224,18 @@ class FilterDocumentsByCustom2 implements PersistUI { final String value; } +class FilterDocumentsByCustom3 implements PersistUI { + FilterDocumentsByCustom3(this.value); + + final String value; +} + +class FilterDocumentsByCustom4 implements PersistUI { + FilterDocumentsByCustom4(this.value); + + final String value; +} + class FilterDocumentsByEntity implements PersistUI { FilterDocumentsByEntity({this.entityId, this.entityType}); diff --git a/lib/redux/expense/expense_actions.dart b/lib/redux/expense/expense_actions.dart index 93170cae1..36fb20943 100644 --- a/lib/redux/expense/expense_actions.dart +++ b/lib/redux/expense/expense_actions.dart @@ -238,6 +238,18 @@ class FilterExpensesByCustom2 implements PersistUI { final String value; } +class FilterExpensesByCustom3 implements PersistUI { + FilterExpensesByCustom3(this.value); + + final String value; +} + +class FilterExpensesByCustom4 implements PersistUI { + FilterExpensesByCustom4(this.value); + + final String value; +} + class FilterExpensesByEntity implements PersistUI { FilterExpensesByEntity({this.entityId, this.entityType}); diff --git a/lib/redux/expense/expense_reducer.dart b/lib/redux/expense/expense_reducer.dart index 5acbbda36..862209dd8 100644 --- a/lib/redux/expense/expense_reducer.dart +++ b/lib/redux/expense/expense_reducer.dart @@ -50,6 +50,8 @@ final expenseListReducer = combineReducers([ TypedReducer(_filterExpenses), TypedReducer(_filterExpensesByCustom1), TypedReducer(_filterExpensesByCustom2), + TypedReducer(_filterExpensesByCustom3), + TypedReducer(_filterExpensesByCustom4), TypedReducer(_filterExpensesByClient), TypedReducer(_startListMultiselect), TypedReducer(_addToListMultiselect), @@ -85,6 +87,26 @@ ListUIState _filterExpensesByCustom2( } } +ListUIState _filterExpensesByCustom3( + ListUIState expenseListState, FilterExpensesByCustom3 action) { + if (expenseListState.custom3Filters.contains(action.value)) { + return expenseListState + .rebuild((b) => b..custom3Filters.remove(action.value)); + } else { + return expenseListState.rebuild((b) => b..custom3Filters.add(action.value)); + } +} + +ListUIState _filterExpensesByCustom4( + ListUIState expenseListState, FilterExpensesByCustom4 action) { + if (expenseListState.custom4Filters.contains(action.value)) { + return expenseListState + .rebuild((b) => b..custom4Filters.remove(action.value)); + } else { + return expenseListState.rebuild((b) => b..custom4Filters.add(action.value)); + } +} + ListUIState _filterExpensesByState( ListUIState expenseListState, FilterExpensesByState action) { if (expenseListState.stateFilters.contains(action.state)) { diff --git a/lib/redux/invoice/invoice_actions.dart b/lib/redux/invoice/invoice_actions.dart index b4fcda032..8d681ba36 100644 --- a/lib/redux/invoice/invoice_actions.dart +++ b/lib/redux/invoice/invoice_actions.dart @@ -358,6 +358,18 @@ class FilterInvoicesByCustom2 implements PersistUI { final String value; } +class FilterInvoicesByCustom3 implements PersistUI { + FilterInvoicesByCustom3(this.value); + + final String value; +} + +class FilterInvoicesByCustom4 implements PersistUI { + FilterInvoicesByCustom4(this.value); + + final String value; +} + void handleInvoiceAction(BuildContext context, List invoices, EntityAction action) async { assert( diff --git a/lib/redux/invoice/invoice_reducer.dart b/lib/redux/invoice/invoice_reducer.dart index 9d960d132..34645f799 100644 --- a/lib/redux/invoice/invoice_reducer.dart +++ b/lib/redux/invoice/invoice_reducer.dart @@ -132,6 +132,8 @@ final invoiceListReducer = combineReducers([ TypedReducer(_filterInvoices), TypedReducer(_filterInvoicesByCustom1), TypedReducer(_filterInvoicesByCustom2), + TypedReducer(_filterInvoicesByCustom3), + TypedReducer(_filterInvoicesByCustom4), TypedReducer(_startListMultiselect), TypedReducer(_addToListMultiselect), TypedReducer( @@ -159,6 +161,27 @@ ListUIState _filterInvoicesByCustom2( } } +ListUIState _filterInvoicesByCustom3( + ListUIState invoiceListState, FilterInvoicesByCustom3 action) { + if (invoiceListState.custom3Filters.contains(action.value)) { + return invoiceListState + .rebuild((b) => b..custom3Filters.remove(action.value)); + } else { + return invoiceListState.rebuild((b) => b..custom3Filters.add(action.value)); + } +} + + +ListUIState _filterInvoicesByCustom4( + ListUIState invoiceListState, FilterInvoicesByCustom4 action) { + if (invoiceListState.custom4Filters.contains(action.value)) { + return invoiceListState + .rebuild((b) => b..custom4Filters.remove(action.value)); + } else { + return invoiceListState.rebuild((b) => b..custom4Filters.add(action.value)); + } +} + ListUIState _filterInvoicesByState( ListUIState invoiceListState, FilterInvoicesByState action) { if (invoiceListState.stateFilters.contains(action.state)) { diff --git a/lib/redux/payment/payment_actions.dart b/lib/redux/payment/payment_actions.dart index b6280cfdf..360e9e611 100644 --- a/lib/redux/payment/payment_actions.dart +++ b/lib/redux/payment/payment_actions.dart @@ -245,6 +245,18 @@ class FilterPaymentsByCustom2 implements PersistUI { final String value; } +class FilterPaymentsByCustom3 implements PersistUI { + FilterPaymentsByCustom3(this.value); + + final String value; +} + +class FilterPaymentsByCustom4 implements PersistUI { + FilterPaymentsByCustom4(this.value); + + final String value; +} + class FilterPaymentsByEntity implements PersistUI { FilterPaymentsByEntity({this.entityId, this.entityType}); diff --git a/lib/redux/payment/payment_reducer.dart b/lib/redux/payment/payment_reducer.dart index cad7e9b25..5783e5b3f 100644 --- a/lib/redux/payment/payment_reducer.dart +++ b/lib/redux/payment/payment_reducer.dart @@ -49,6 +49,8 @@ final paymentListReducer = combineReducers([ TypedReducer(_filterPayments), TypedReducer(_filterPaymentsByCustom1), TypedReducer(_filterPaymentsByCustom2), + TypedReducer(_filterPaymentsByCustom3), + TypedReducer(_filterPaymentsByCustom4), TypedReducer(_filterPaymentsByEntity), TypedReducer(_startListMultiselect), TypedReducer(_addToListMultiselect), @@ -84,6 +86,26 @@ ListUIState _filterPaymentsByCustom2( } } +ListUIState _filterPaymentsByCustom3( + ListUIState paymentListState, FilterPaymentsByCustom3 action) { + if (paymentListState.custom3Filters.contains(action.value)) { + return paymentListState + .rebuild((b) => b..custom3Filters.remove(action.value)); + } else { + return paymentListState.rebuild((b) => b..custom3Filters.add(action.value)); + } +} + +ListUIState _filterPaymentsByCustom4( + ListUIState paymentListState, FilterPaymentsByCustom4 action) { + if (paymentListState.custom4Filters.contains(action.value)) { + return paymentListState + .rebuild((b) => b..custom4Filters.remove(action.value)); + } else { + return paymentListState.rebuild((b) => b..custom4Filters.add(action.value)); + } +} + ListUIState _filterPaymentsByState( ListUIState paymentListState, FilterPaymentsByState action) { if (paymentListState.stateFilters.contains(action.state)) { diff --git a/lib/redux/task/task_actions.dart b/lib/redux/task/task_actions.dart index c90f2decf..a4a12940d 100644 --- a/lib/redux/task/task_actions.dart +++ b/lib/redux/task/task_actions.dart @@ -269,6 +269,18 @@ class FilterTasksByCustom2 implements PersistUI { final String value; } +class FilterTasksByCustom3 implements PersistUI { + FilterTasksByCustom3(this.value); + + final String value; +} + +class FilterTasksByCustom4 implements PersistUI { + FilterTasksByCustom4(this.value); + + final String value; +} + class FilterTasksByEntity implements PersistUI { FilterTasksByEntity({this.entityId, this.entityType}); diff --git a/lib/redux/vendor/vendor_actions.dart b/lib/redux/vendor/vendor_actions.dart index 870834186..2043a63a9 100644 --- a/lib/redux/vendor/vendor_actions.dart +++ b/lib/redux/vendor/vendor_actions.dart @@ -260,6 +260,18 @@ class FilterVendorsByCustom2 implements PersistUI { final String value; } +class FilterVendorsByCustom3 implements PersistUI { + FilterVendorsByCustom3(this.value); + + final String value; +} + +class FilterVendorsByCustom4 implements PersistUI { + FilterVendorsByCustom4(this.value); + + final String value; +} + class FilterVendorsByEntity implements PersistUI { FilterVendorsByEntity({this.entityId, this.entityType}); diff --git a/lib/redux/vendor/vendor_reducer.dart b/lib/redux/vendor/vendor_reducer.dart index 951f320ab..8604ea5b4 100644 --- a/lib/redux/vendor/vendor_reducer.dart +++ b/lib/redux/vendor/vendor_reducer.dart @@ -93,6 +93,8 @@ final vendorListReducer = combineReducers([ TypedReducer(_filterVendors), TypedReducer(_filterVendorsByCustom1), TypedReducer(_filterVendorsByCustom2), + TypedReducer(_filterVendorsByCustom3), + TypedReducer(_filterVendorsByCustom4), TypedReducer(_filterVendorsByClient), TypedReducer(_startListMultiselect), TypedReducer(_addToListMultiselect), @@ -128,6 +130,26 @@ ListUIState _filterVendorsByCustom2( } } +ListUIState _filterVendorsByCustom3(ListUIState vendorListState, + FilterVendorsByCustom3 action) { + if (vendorListState.custom3Filters.contains(action.value)) { + return vendorListState + .rebuild((b) => b..custom3Filters.remove(action.value)); + } else { + return vendorListState.rebuild((b) => b..custom3Filters.add(action.value)); + } +} + +ListUIState _filterVendorsByCustom4( + ListUIState vendorListState, FilterVendorsByCustom4 action) { + if (vendorListState.custom4Filters.contains(action.value)) { + return vendorListState + .rebuild((b) => b..custom4Filters.remove(action.value)); + } else { + return vendorListState.rebuild((b) => b..custom4Filters.add(action.value)); + } +} + ListUIState _filterVendorsByState( ListUIState vendorListState, FilterVendorsByState action) { if (vendorListState.stateFilters.contains(action.state)) { diff --git a/lib/ui/company_gateway/company_gateway_screen.dart b/lib/ui/company_gateway/company_gateway_screen.dart index 98046f5dd..758bb8854 100644 --- a/lib/ui/company_gateway/company_gateway_screen.dart +++ b/lib/ui/company_gateway/company_gateway_screen.dart @@ -87,6 +87,10 @@ class CompanyGatewayScreen extends StatelessWidget { store.dispatch(FilterCompanyGatewaysByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterCompanyGatewaysByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterCompanyGatewaysByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterCompanyGatewaysByCustom4(value)), onSelectedState: (EntityState state, value) { store.dispatch(FilterCompanyGatewaysByState(state)); }, diff --git a/lib/ui/document/document_screen.dart b/lib/ui/document/document_screen.dart index e58122e10..2862d570a 100644 --- a/lib/ui/document/document_screen.dart +++ b/lib/ui/document/document_screen.dart @@ -95,6 +95,10 @@ class DocumentScreen extends StatelessWidget { store.dispatch(FilterDocumentsByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterDocumentsByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterDocumentsByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterDocumentsByCustom4(value)), sortFields: [ DocumentFields.updatedAt, ], diff --git a/lib/ui/expense/expense_screen.dart b/lib/ui/expense/expense_screen.dart index 34721af3e..ccef70284 100644 --- a/lib/ui/expense/expense_screen.dart +++ b/lib/ui/expense/expense_screen.dart @@ -95,10 +95,18 @@ class ExpenseScreen extends StatelessWidget { excludeBlank: true), customValues2: company.getCustomFieldValues(CustomFieldType.expense2, excludeBlank: true), + customValues3: company.getCustomFieldValues(CustomFieldType.expense3, + excludeBlank: true), + customValues4: company.getCustomFieldValues(CustomFieldType.expense4, + excludeBlank: true), onSelectedCustom1: (value) => store.dispatch(FilterExpensesByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterExpensesByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterExpensesByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterExpensesByCustom4(value)), sortFields: [ ExpenseFields.publicNotes, ExpenseFields.expenseDate, diff --git a/lib/ui/invoice/invoice_screen.dart b/lib/ui/invoice/invoice_screen.dart index 75a77724c..22241688b 100644 --- a/lib/ui/invoice/invoice_screen.dart +++ b/lib/ui/invoice/invoice_screen.dart @@ -109,10 +109,18 @@ class InvoiceScreen extends StatelessWidget { excludeBlank: true), customValues2: company.getCustomFieldValues(CustomFieldType.invoice2, excludeBlank: true), + customValues3: company.getCustomFieldValues(CustomFieldType.invoice3, + excludeBlank: true), + customValues4: company.getCustomFieldValues(CustomFieldType.invoice4, + excludeBlank: true), onSelectedCustom1: (value) => store.dispatch(FilterInvoicesByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterInvoicesByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterInvoicesByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterInvoicesByCustom4(value)), statuses: [ InvoiceStatusEntity().rebuild( (b) => b diff --git a/lib/ui/payment/payment_screen.dart b/lib/ui/payment/payment_screen.dart index 487bf998d..bd9ff7828 100644 --- a/lib/ui/payment/payment_screen.dart +++ b/lib/ui/payment/payment_screen.dart @@ -90,6 +90,10 @@ class PaymentScreen extends StatelessWidget { store.dispatch(FilterPaymentsByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterPaymentsByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterPaymentsByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterPaymentsByCustom4(value)), sortFields: [ PaymentFields.paymentDate, PaymentFields.amount, diff --git a/lib/ui/task/task_screen.dart b/lib/ui/task/task_screen.dart index 9e6437d38..d4dd898bd 100644 --- a/lib/ui/task/task_screen.dart +++ b/lib/ui/task/task_screen.dart @@ -94,10 +94,18 @@ class TaskScreen extends StatelessWidget { excludeBlank: true), customValues2: company.getCustomFieldValues(CustomFieldType.task2, excludeBlank: true), + customValues3: company.getCustomFieldValues(CustomFieldType.task3, + excludeBlank: true), + customValues4: company.getCustomFieldValues(CustomFieldType.task4, + excludeBlank: true), onSelectedCustom1: (value) => store.dispatch(FilterTasksByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterTasksByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterTasksByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterTasksByCustom4(value)), sortFields: [ TaskFields.description, TaskFields.duration, diff --git a/lib/ui/vendor/vendor_screen.dart b/lib/ui/vendor/vendor_screen.dart index dbd1c59f8..4c2fba918 100644 --- a/lib/ui/vendor/vendor_screen.dart +++ b/lib/ui/vendor/vendor_screen.dart @@ -91,10 +91,18 @@ class VendorScreen extends StatelessWidget { excludeBlank: true), customValues2: company.getCustomFieldValues(CustomFieldType.vendor2, excludeBlank: true), + customValues3: company.getCustomFieldValues(CustomFieldType.vendor3, + excludeBlank: true), + customValues4: company.getCustomFieldValues(CustomFieldType.vendor4, + excludeBlank: true), onSelectedCustom1: (value) => store.dispatch(FilterVendorsByCustom1(value)), onSelectedCustom2: (value) => store.dispatch(FilterVendorsByCustom2(value)), + onSelectedCustom3: (value) => + store.dispatch(FilterVendorsByCustom3(value)), + onSelectedCustom4: (value) => + store.dispatch(FilterVendorsByCustom4(value)), sortFields: [ VendorFields.name, VendorFields.updatedAt,