Fix clearing expense client

This commit is contained in:
Hillel Coren 2023-11-29 17:28:42 +02:00
parent 9e1e3db08c
commit bbc4a2feb5
1 changed files with 6 additions and 4 deletions

View File

@ -176,11 +176,13 @@ class ExpenseEditDetailsState extends State<ExpenseEditDetails> {
entityList: memoizedDropdownClientList(clientState.map,
clientState.list, state.userState.map, state.staticState),
onSelected: (client) {
final currencyId =
(client as ClientEntity).settings.currencyId ??
String currencyId = '';
if (client != null) {
currencyId = (client as ClientEntity).settings.currencyId ??
company.currencyId;
}
viewModel.onChanged!(expense.rebuild((b) => b
..clientId = client.id
..clientId = client?.id ?? ''
..invoiceCurrencyId = currencyId));
},
onAddPressed: (completer) {