$main::auth->assert('vendor_invoice_edit');
-# map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
-
&check_name('vendor');
+ if (!$form->{forex}) { # read exchangerate from input field (not hidden)
+ $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate});
+ }
$form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell');
$form->{exchangerate} = $form->{forex} if $form->{forex};