From 4aa9760e3d155fccea859b2c56f75946c12633f9 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Sat, 10 Aug 2019 17:05:57 +0200 Subject: [PATCH] Mahnungen erzeugen - nach Abteilung filtern und anzeigen --- SL/DN.pm | 7 +++++++ bin/mozilla/dn.pl | 5 ++++- doc/changelog | 4 ++++ templates/webpages/dunning/add.html | 11 ++++++++++- templates/webpages/dunning/show_invoices.html | 2 ++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/SL/DN.pm b/SL/DN.pm index 5d0ee14a5..4c8001ac8 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -534,6 +534,11 @@ sub get_invoices { push(@values, like($form->{customer})); } + if ($form->{department_id}) { + $where .= qq| AND (a.department_id = ?)|; + push(@values, $form->{department_id}); + } + my %columns = ( "ordnumber" => "a.ordnumber", "invnumber" => "a.invnumber", @@ -573,6 +578,7 @@ sub get_invoices { ct.name AS customername, a.customer_id, a.duedate, a.amount - a.paid AS open_amount, a.direct_debit, + dep.description as departmentname, cfg.dunning_description, cfg.dunning_level, @@ -590,6 +596,7 @@ sub get_invoices { FROM ar a LEFT JOIN customer ct ON (a.customer_id = ct.id) + LEFT JOIN department dep ON (a.department_id = dep.id) LEFT JOIN dunning_config cfg ON (a.dunning_config_id = cfg.id) LEFT JOIN dunning_config nextcfg ON (nextcfg.id = diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index c16f6c34c..0b2b27c58 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -103,8 +103,10 @@ sub add { DN->get_config(\%myconfig, \%$form); + $form->get_lists("departments" => "ALL_DEPARTMENTS"); + $form->{SHOW_DUNNING_LEVEL_SELECTION} = $form->{DUNNING} && scalar @{ $form->{DUNNING} }; - $form->{SHOW_DEPARTMENT_SELECTION} = $form->{all_departments} && scalar @{ $form->{all_departments} || [] }; + $form->{SHOW_DEPARTMENT_SELECTION} = $form->{ALL_DEPARTMENTS} && scalar @{ $form->{ALL_DEPARTMENTS} || [] }; $form->{title} = $locale->text('Start Dunning Process'); @@ -362,6 +364,7 @@ sub show_dunning { 'checkbox' => { 'text' => '', 'visible' => 'HTML' }, 'dunning_description' => { 'text' => $locale->text('Dunning Level') }, 'customername' => { 'text' => $locale->text('Customername') }, + 'departmentname' => { 'text' => $locale->text('Department') }, 'language' => { 'text' => $locale->text('Language') }, 'invnumber' => { 'text' => $locale->text('Invnumber') }, 'transdate' => { 'text' => $locale->text('Invdate') }, diff --git a/doc/changelog b/doc/changelog index 2762eaadc..975751951 100644 --- a/doc/changelog +++ b/doc/changelog @@ -14,6 +14,10 @@ Mittelgroße neue Features: - Part Controller - neuer Tab mit Lagerinformationen - was ist wo gelagert +Kleinere neue Features und Detailverbesserungen: + +- Mahnungen nach Abteilung filtern + 2019-08-07 - Release 3.5.4 diff --git a/templates/webpages/dunning/add.html b/templates/webpages/dunning/add.html index ab1c44a28..1451e02fd 100644 --- a/templates/webpages/dunning/add.html +++ b/templates/webpages/dunning/add.html @@ -1,4 +1,4 @@ -[%- USE T8 %] +[%- USE T8 %][%- USE L %] [% USE HTML %]

[% title %]

@@ -12,6 +12,15 @@ + [% IF SHOW_DEPARTMENT_SELECTION %] + + [% 'Department' | $T8 %] + + [% L.select_tag('department_id', ALL_DEPARTMENTS, title_key = 'description', with_empty = 1, style=style) %] + + + [% END %] + [% IF SHOW_DUNNING_LEVEL_SELECTION %] [% 'Next Dunning Level' | $T8 %] diff --git a/templates/webpages/dunning/show_invoices.html b/templates/webpages/dunning/show_invoices.html index 51fbb32b6..8036ade97 100644 --- a/templates/webpages/dunning/show_invoices.html +++ b/templates/webpages/dunning/show_invoices.html @@ -30,6 +30,7 @@ [% 'Customername' | $T8 %] + [% 'Department' | $T8 %] [% 'Language' | $T8 %] [% 'Invno.' | $T8 %] [% 'Invdate' | $T8 %] @@ -63,6 +64,7 @@ [% HTML.escape(row.customername) %] + [% HTML.escape(row.departmentname) %] [% HTML.escape(row.language) %] -- 2.20.1