From db3dfa92492a68cff00f953d5992998299277267 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 15 Sep 2015 11:49:38 +0200 Subject: [PATCH] =?utf8?q?Rechnungen:=20Nach=20=C2=BBals=20geschlossen=20m?= =?utf8?q?arkiert=C2=AB=20suchen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AR.pm | 14 ++++++++++++++ bin/mozilla/ar.pl | 2 +- locale/de/all | 1 + templates/webpages/ar/search.html | 4 ++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/SL/AR.pm b/SL/AR.pm index 56f2da9df..4f150673b 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -599,6 +599,20 @@ SQL push @values, like($form->{parts_description}); } + if ($form->{show_marked_as_closed}) { + $query .= ' + LEFT JOIN ( + SELECT SUM(acc_trans.amount) AS amount, trans_id + FROM acc_trans + LEFT JOIN chart ON chart.id = chart_id + WHERE chart.link ILIKE ? + GROUP BY trans_id + ) AS paid_difference ON (paid_difference.trans_id = a.id) + '; + unshift @values, '%AR_paid%'; + $where .= ' AND COALESCE(paid_difference.amount, 0) + a.paid != 0'; + } + my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT', 'trans_id_field' => 'c.id', 'filter' => $form, diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index ec028e886..5f290f653 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -996,7 +996,7 @@ sub ar_transactions { 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 duedatefrom duedateto - employee_id salesman_id business_id parts_partnumber parts_description department_id); + employee_id salesman_id business_id parts_partnumber parts_description department_id show_marked_as_closed); push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables; $href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables); diff --git a/locale/de/all b/locale/de/all index 63aaf2416..6a050b52f 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2710,6 +2710,7 @@ $self->{texts} = { 'Show items from invoices individually' => 'Artikel aus Rechnungen anzeigen', 'Show mappings (csv_import)' => 'Spaltenzuordnungen anzeigen', 'Show old dunnings' => 'Alte Mahnungen anzeigen', + 'Show only marked as paid invoices' => 'Nur "als geschlossen markiert" zeigen', 'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...', 'Show parts' => 'Artikel anzeigen', 'Show parts longdescription (notes) in select list' => 'Langtext in Auswahlliste bei mehreren Treffern im Stammdaten-Bestand anzeigen', diff --git a/templates/webpages/ar/search.html b/templates/webpages/ar/search.html index 1c0b9e60a..f3b7aa2fc 100644 --- a/templates/webpages/ar/search.html +++ b/templates/webpages/ar/search.html @@ -64,6 +64,10 @@ [% L.select_tag("business_id", ALL_BUSINESS_TYPES, with_empty=1, title_key="description", style=style) %] [% END %] + + [% 'Show only marked as paid invoices' | $T8 %] + [% L.checkbox_tag('show_marked_as_closed') %] + [% 'Invoice Date' | $T8 %] -- 2.20.1