diff --git a/lib/ui/app/forms/decorated_form_field.dart b/lib/ui/app/forms/decorated_form_field.dart index cd7fa0fbe..575fc7131 100644 --- a/lib/ui/app/forms/decorated_form_field.dart +++ b/lib/ui/app/forms/decorated_form_field.dart @@ -59,7 +59,7 @@ class DecoratedFormField extends StatelessWidget { Widget suffixIconButton; final hasValue = (initialValue ?? '').isNotEmpty || (controller?.text ?? '').isNotEmpty; - if (hasValue) { + if (hasValue && key == null) { if (suffixIcon == null && enabled) { suffixIconButton = IconButton( icon: Icon(Icons.clear), diff --git a/lib/ui/invoice/edit/invoice_edit_desktop.dart b/lib/ui/invoice/edit/invoice_edit_desktop.dart index 05dc87099..9fefc0466 100644 --- a/lib/ui/invoice/edit/invoice_edit_desktop.dart +++ b/lib/ui/invoice/edit/invoice_edit_desktop.dart @@ -533,10 +533,7 @@ class InvoiceEditDesktopState extends State ], ), SizedBox( - height: (client.isOld && - client.currencyId != company.currencyId) - ? 140 - : 100, + height: 125, child: TabBarView( controller: _optionTabController, children: [ @@ -591,32 +588,25 @@ class InvoiceEditDesktopState extends State ), Row( children: [ - if (client.isOld && - client.currencyId != company.currencyId) - Expanded( - child: DecoratedFormField( - key: ValueKey( - '__exchange_rate_${invoice.clientId}__'), - label: localization.exchangeRate, - initialValue: formatNumber( - invoice.exchangeRate, context, - formatNumberType: - FormatNumberType.inputMoney), - onChanged: (value) => viewModel.onChanged( - invoice.rebuild((b) => b - ..exchangeRate = - parseDouble(value))), - keyboardType: - TextInputType.numberWithOptions( - decimal: true), - onSavePressed: - widget.entityViewModel.onSavePressed, - ), - ) - else - Expanded( - child: SizedBox(), + Expanded( + child: DecoratedFormField( + key: ValueKey( + '__exchange_rate_${invoice.clientId}__'), + label: localization.exchangeRate, + initialValue: formatNumber( + invoice.exchangeRate, context, + formatNumberType: + FormatNumberType.inputMoney), + onChanged: (value) => viewModel.onChanged( + invoice.rebuild((b) => b + ..exchangeRate = parseDouble(value))), + keyboardType: + TextInputType.numberWithOptions( + decimal: true), + onSavePressed: + widget.entityViewModel.onSavePressed, ), + ), SizedBox( width: 38, ), @@ -745,6 +735,7 @@ class InvoiceEditDesktopState extends State ), ], ), + SizedBox(height: 16), ], ); } diff --git a/lib/ui/invoice/edit/invoice_edit_details.dart b/lib/ui/invoice/edit/invoice_edit_details.dart index 65124bac7..309ff1cfb 100644 --- a/lib/ui/invoice/edit/invoice_edit_details.dart +++ b/lib/ui/invoice/edit/invoice_edit_details.dart @@ -373,16 +373,15 @@ class InvoiceEditDetailsState extends State { onSelected: (value) => viewModel .onChanged(invoice.rebuild((b) => b..designId = value?.id)), ), - if (client.isOld && client.currencyId != company.currencyId) - DecoratedFormField( - key: ValueKey('__exchange_rate_${invoice.clientId}__'), - label: localization.exchangeRate, - initialValue: formatNumber(invoice.exchangeRate, context, - formatNumberType: FormatNumberType.inputAmount), - onChanged: (value) => viewModel.onChanged(invoice - .rebuild((b) => b..exchangeRate = parseDouble(value))), - keyboardType: TextInputType.numberWithOptions(decimal: true), - ), + DecoratedFormField( + key: ValueKey('__exchange_rate_${invoice.clientId}__'), + label: localization.exchangeRate, + initialValue: formatNumber(invoice.exchangeRate, context, + formatNumberType: FormatNumberType.inputAmount), + onChanged: (value) => viewModel.onChanged( + invoice.rebuild((b) => b..exchangeRate = parseDouble(value))), + keyboardType: TextInputType.numberWithOptions(decimal: true), + ), ], ), ],