X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/30a3e7863b89a4d67fc843cd3f9d6819cf01a823..653ae9ea701b5c88f2ed720931c8e864a97aeaa4:/SL/RP.pm diff --git a/SL/RP.pm b/SL/RP.pm index 4d2dd4eb2..365d6e023 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -1303,6 +1303,9 @@ sub aging { $form->{todate} = $form->current_date($myconfig) unless ($form->{todate}); my $todate = conv_dateq($form->{todate}); + my $fromdate = conv_dateq($form->{fromdate}); + + my $fromwhere = ($form->{fromdate} ne "") ? " AND (transdate >= (date $fromdate)) " : ""; my $where = " 1 = 1 "; my ($name, $null); @@ -1338,7 +1341,7 @@ sub aging { AND (${arap}.storno IS FALSE) AND (${arap}.${ct}_id = ${ct}.id) AND (${ct}.id = ?) - AND (transdate <= (date $todate)) + AND (transdate <= (date $todate) $fromwhere ) ORDER BY ctid, transdate, invnumber |; @@ -1352,7 +1355,7 @@ sub aging { WHERE $where AND (a.${ct_id} = ct.id) AND ((a.paid != a.amount) OR ((a.datepaid > $todate) AND (datepaid is NOT NULL))) - AND (a.transdate <= $todate) + AND (a.transdate <= $todate $fromwhere) ORDER BY ct.name|; my $sth = prepare_execute_query($form, $dbh, $query);