X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAP.pm;h=fce222dc073386019fec8e86982b99c564bfee3e;hb=738c240ad3a167dd3013ef01f0892b5589fd7d9a;hp=aaf2d5e6e4293ed5b25c393b72e0119ea1478659;hpb=e9e28dd26de569ab7b721560d84ea8ddb0c1dda1;p=kivitendo-erp.git diff --git a/SL/AP.pm b/SL/AP.pm index aaf2d5e6e..fce222dc0 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -46,7 +46,7 @@ sub post_transaction { $main::lxdebug->enter_sub(); my ($self, $myconfig, $form, $provided_dbh, $payments_only) = @_; - + my $rc = 0; # return code auf false setzen # connect to database my $dbh = $provided_dbh ? $provided_dbh : $form->dbconnect_noauto($myconfig); @@ -54,6 +54,7 @@ sub post_transaction { my $exchangerate = 0; $form->{defaultcurrency} = $form->get_default_currency($myconfig); + delete $form->{currency} unless $form->{defaultcurrency}; ($null, $form->{department_id}) = split(/--/, $form->{department}); $form->{department_id} *= 1; @@ -356,12 +357,13 @@ sub post_transaction { IO->set_datepaid(table => 'ap', id => $form->{id}, dbh => $dbh); - my $rc = 1; if (!$provided_dbh) { $dbh->commit(); $dbh->disconnect(); } + $rc = 1; # Den return-code auf true setzen, aber nur falls beim commit alles i.O. ist + $main::lxdebug->leave_sub(); return $rc; @@ -586,11 +588,9 @@ sub post_payment { $self->setup_form($form); - ($form->{defaultcurrency}) = selectrow_query($form, $dbh, qq|SELECT curr FROM defaults|); - $form->{defaultcurrency} = (split m/:/, $form->{defaultcurrency})[0]; - $form->{currency} = $form->{defaultcurrency} if ($form->{defaultcurrency} && ($form->{currency} =~ m/^\s*$/)); - - $form->{exchangerate} = $form->format_amount($myconfig, $form->{exchangerate}); + $form->{exchangerate} = $form->format_amount($myconfig, $form->{exchangerate}); + $form->{defaultcurrency} = $form->get_default_currency($myconfig); + delete $form->{currency} unless $form->{defaultcurrency}; # Get the AP accno. $query =