From e24e657067548d45e6a23ff56ee4c3ee69b5687b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 17 Sep 2015 14:22:48 +0200 Subject: [PATCH] =?utf8?q?Rechnungen=20nach=20F=C3=A4lligkeitsdatum=20sort?= =?utf8?q?ieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AR.pm | 8 ++++++++ bin/mozilla/ar.pl | 2 +- templates/webpages/ar/search.html | 14 +++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/SL/AR.pm b/SL/AR.pm index 3ee8e0d92..2a80dc0a7 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -549,6 +549,14 @@ sub ar_transactions { $where .= " AND a.transdate <= ?"; push(@values, $form->{transdateto}); } + if ($form->{duedatefrom}) { + $where .= " AND a.duedate >= ?"; + push(@values, $form->{duedatefrom}); + } + if ($form->{duedateto}) { + $where .= " AND a.duedate <= ?"; + push(@values, $form->{duedateto}); + } if ($form->{open} || $form->{closed}) { unless ($form->{open} && $form->{closed}) { $where .= " AND a.amount <> a.paid" if ($form->{open}); diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 7bcbe4c1e..88ace44fe 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -922,7 +922,7 @@ sub ar_transactions { push @columns, map { "cvar_$_->{name}" } @ct_includeable_custom_variables; my @hidden_variables = map { "l_${_}" } @columns; - push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber cusordnumber transaction_description notes project_id transdatefrom transdateto employee_id salesman_id business_id); + push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber cusordnumber transaction_description notes project_id transdatefrom transdateto duedatefrom duedateto employee_id salesman_id business_id); push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables; $href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables); diff --git a/templates/webpages/ar/search.html b/templates/webpages/ar/search.html index b43630fad..5c56e624c 100644 --- a/templates/webpages/ar/search.html +++ b/templates/webpages/ar/search.html @@ -106,8 +106,9 @@ [% END %] - [% 'From' | $T8 %] + [% 'Invoice Date' | $T8 %] + [% 'From' | $T8 %] [% L.date_tag('transdatefrom') %] [% 'Bis' | $T8 %] @@ -115,6 +116,17 @@ [% L.date_tag('transdateto') %] + + [% 'Due Date' | $T8 %] + + [% 'From' | $T8 %] + [% L.date_tag('duedatefrom') %] + + [% 'Bis' | $T8 %] + + [% L.date_tag('duedateto') %] + + [%- IF CT_CUSTOM_VARIABLES.size %] -- 2.20.1