X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/df5d9efd810efd8bd01349d22e3fd4f356cc99ac..d934ce3611:/SL/RP.pm diff --git a/SL/RP.pm b/SL/RP.pm index f98d47561..072c54bd4 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -211,6 +211,13 @@ sub get_accounts { $sth->finish; + # if l_ob is selected l_cb is always ignored + if ( $form->{l_ob} ) { + $where .= ' AND ac.ob_transaction is true ' + } elsif ( not $form->{l_cb} ) { + $where .= ' AND ac.cb_transaction is false '; + }; + if ($fromdate) { $fromdate = conv_dateq($fromdate); if ($form->{method} eq 'cash') { @@ -464,6 +471,8 @@ sub get_accounts_g { my $inwhere = ""; my $item; + $where .= ' AND ac.cb_transaction is false ' unless $form->{l_cb}; + if ($fromdate) { $fromdate = conv_dateq($fromdate); if ($form->{method} eq 'cash') { @@ -512,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)