X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAR.pm;h=04af973506d0bed8d9b3d0de05c1eb7743f63cfa;hb=f97b07787db5cacc0f90338fdb3c1237262917cb;hp=7d037838cf10ae9258bd0dd062133f6e51a2360e;hpb=5dfee15a6634923410679ad91d965b2df34172a4;p=kivitendo-erp.git diff --git a/SL/AR.pm b/SL/AR.pm index 7d037838c..04af97350 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -54,6 +54,7 @@ sub post_transaction { my $dbh = $provided_dbh ? $provided_dbh : $form->dbconnect_noauto($myconfig); $form->{defaultcurrency} = $form->get_default_currency($myconfig); + delete $form->{currency} unless $form->{defaultcurrency}; # set exchangerate $form->{exchangerate} = ($form->{currency} eq $form->{defaultcurrency}) ? 1 : @@ -346,11 +347,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 AR accno (which is normally done by Form::create_links()). $query = @@ -480,6 +479,10 @@ sub ar_transactions { } } + if (!$main::auth->assert('sales_all_edit', 1)) { + $where .= " AND a.employee_id = (select id from employee where login= ?)"; + push (@values, $form->{login}); + } my @a = qw(transdate invnumber name); push @a, "employee" if $form->{l_employee}; my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';