projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mergefehler: orddate ist hier transdate
[kivitendo-erp.git]
/
SL
/
RP.pm
diff --git
a/SL/RP.pm
b/SL/RP.pm
index
f98d475
..
bbfb098
100644
(file)
--- a/
SL/RP.pm
+++ b/
SL/RP.pm
@@
-211,6
+211,13
@@
sub get_accounts {
$sth->finish;
$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') {
if ($fromdate) {
$fromdate = conv_dateq($fromdate);
if ($form->{method} eq 'cash') {
@@
-464,6
+471,8
@@
sub get_accounts_g {
my $inwhere = "";
my $item;
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') {
if ($fromdate) {
$fromdate = conv_dateq($fromdate);
if ($form->{method} eq 'cash') {
@@
-507,13
+516,13
@@
sub get_accounts_g {
if ($form->{method} eq 'cash') {
$query =
qq|
if ($form->{method} eq 'cash') {
$query =
qq|
- SELECT SUM( ac.amount *
+ SELECT SUM( ac.amount *
CASE WHEN COALESCE((SELECT amount FROM ar WHERE id = ac.trans_id and amount != 0 ), 0) != 0 THEN
(SELECT SUM(acc.amount) * -1
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 SUM(acc.amount) * -1
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
)
- ) AS amount, c.
pos_eur
+ / (SELECT amount FROM ar WHERE id = ac.trans_id
and amount != 0 ) ELSE 1 END
+ ) AS amount, c.
$category
FROM acc_trans ac
LEFT JOIN chart c ON (c.id = ac.chart_id)
LEFT JOIN ar ON (ar.id = ac.trans_id)
FROM acc_trans ac
LEFT JOIN chart c ON (c.id = ac.chart_id)
LEFT JOIN ar ON (ar.id = ac.trans_id)
@@
-526,7
+535,7
@@
sub get_accounts_g {
)
WHERE ac.trans_id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE 1=1 $subwhere)
)
WHERE ac.trans_id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE 1=1 $subwhere)
- GROUP BY c.
pos_eur
+ GROUP BY c.
$category
/*
SELECT SUM(ac.amount * chart_category_to_sgn(c.category)) AS amount, c.$category
/*
SELECT SUM(ac.amount * chart_category_to_sgn(c.category)) AS amount, c.$category
@@
-1228,7
+1237,7
@@
sub aging {
WHERE ((paid != amount) OR (datepaid > (date $todate) AND datepaid is not null))
AND NOT COALESCE (${arap}.storno, 'f')
AND (${arap}.${ct}_id = ${ct}.id)
WHERE ((paid != amount) OR (datepaid > (date $todate) AND datepaid is not null))
AND NOT COALESCE (${arap}.storno, 'f')
AND (${arap}.${ct}_id = ${ct}.id)
- $where_dpt
+ $where_dpt
AND (${ct}.id = ?)
AND (transdate <= (date $todate) $fromwhere )
$review_of_aging_list
AND (${ct}.id = ?)
AND (transdate <= (date $todate) $fromwhere )
$review_of_aging_list