X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FRP.pm;h=072c54bd42123ed4151035c51b09e87839dd6b05;hb=4f7b541697e2226be9a7ff9ac0dc62f8b4002544;hp=abf95beeb29b3d2898b98f5691c412277b4f46b6;hpb=e293009f4e1d70e547a479e956fd1733c24b1441;p=kivitendo-erp.git diff --git a/SL/RP.pm b/SL/RP.pm index abf95beeb..072c54bd4 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -213,9 +213,9 @@ sub get_accounts { # if l_ob is selected l_cb is always ignored if ( $form->{l_ob} ) { - $where .= ' AND ob_transaction is true ' + $where .= ' AND ac.ob_transaction is true ' } elsif ( not $form->{l_cb} ) { - $where .= ' AND cb_transaction is false '; + $where .= ' AND ac.cb_transaction is false '; }; if ($fromdate) { @@ -471,7 +471,7 @@ sub get_accounts_g { my $inwhere = ""; my $item; - $where .= ' AND cb_transaction is false ' unless $form->{l_cb}; + $where .= ' AND ac.cb_transaction is false ' unless $form->{l_cb}; if ($fromdate) { $fromdate = conv_dateq($fromdate); @@ -521,7 +521,7 @@ sub get_accounts_g { FROM acc_trans acc INNER JOIN chart c ON (acc.chart_id = c.id AND c.link LIKE '%AR_paid%') WHERE 1=1 $inwhere AND acc.trans_id = ac.trans_id) - / (SELECT amount FROM ar WHERE id = ac.trans_id) + / COALESCE((SELECT amount FROM ar WHERE id = ac.trans_id and amount != 0 ), 1) ) AS amount, c.pos_eur FROM acc_trans ac LEFT JOIN chart c ON (c.id = ac.chart_id)