From 5d00b2c0f1643d39e051ff17576c16457d0eeb97 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 8 Feb 2022 12:35:01 +0200 Subject: [PATCH] Suppot tracking vendor on invoice --- lib/redux/expense/expense_actions.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/redux/expense/expense_actions.dart b/lib/redux/expense/expense_actions.dart index 929da91dc..622a61c5e 100644 --- a/lib/redux/expense/expense_actions.dart +++ b/lib/redux/expense/expense_actions.dart @@ -281,8 +281,12 @@ void handleExpenseAction( }); String projectId = ''; + String vendorId = ''; for (var each in availableExpenses) { final expense = each as ExpenseEntity; + if (expense.vendorId.isNotEmpty) { + vendorId = expense.vendorId; + } if (expense.projectId.isNotEmpty) { if (projectId.isEmpty && state.projectState.get(expense.projectId).clientId == client.id) { @@ -303,7 +307,8 @@ void handleExpenseAction( entity: InvoiceEntity(state: state, client: client).rebuild( (b) => b ..lineItems.addAll(items) - ..projectId = projectId, + ..projectId = projectId + ..vendorId = vendorId, ), ); }