From aab626748ac82bb9c9c04e7d23c717ce2468fea3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 19 Mar 2021 13:57:24 +0100 Subject: [PATCH] =?utf8?q?Mahnbericht:=20Nach=20Mahnungsnummer=20filtern?= =?utf8?q?=20k=C3=B6nnen=20und=20diese=20Anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DN.pm | 6 ++++++ bin/mozilla/dn.pl | 14 +++++++++----- templates/webpages/dunning/search.html | 5 +++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/SL/DN.pm b/SL/DN.pm index f3969fc11..e9aa1ecf2 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -737,6 +737,11 @@ sub get_dunning { push(@values, like($form->{$key})); } + if ($form->{dunning_id}) { + $where .= qq| AND da.dunning_id = ?|; + push(@values, conv_i($form->{dunning_id})); + } + if ($form->{dunning_level}) { $where .= qq| AND a.dunning_config_id = ?|; push(@values, conv_i($form->{dunning_level})); @@ -787,6 +792,7 @@ sub get_dunning { 'duedate' => [ qw(a.duedate a.invnumber) ], 'dunning_date' => [ qw(dunning_date da.dunning_id a.invnumber) ], 'dunning_duedate' => [ qw(dunning_duedate da.dunning_id a.invnumber) ], + 'dunning_id' => [ qw(dunning_id a.invnumber) ], 'salesman' => [ qw(salesman) ], ); diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 9422da3f9..bc6798c6f 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -34,6 +34,8 @@ use POSIX qw(strftime); +use List::MoreUtils qw(none); + use SL::IS; use SL::DN; use SL::DB::Department; @@ -337,7 +339,7 @@ sub show_dunning { $main::auth->assert('dunning_edit'); - my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber + my @filter_field_list = qw(customer_id customer dunning_id dunning_level department_id invnumber ordnumber transdatefrom transdateto dunningfrom dunningto notes showold l_salesman salesman_id); report_generator_set_default_sort('customername', 1); @@ -375,6 +377,7 @@ sub show_dunning { 'transdate' => { 'text' => $locale->text('Invdate') }, 'duedate' => { 'text' => $locale->text('Invoice Duedate') }, 'amount' => { 'text' => $locale->text('Amount') }, + 'dunning_id' => { 'text' => $locale->text('Dunning number') }, 'dunning_date' => { 'text' => $locale->text('Dunning Date') }, 'dunning_duedate' => { 'text' => $locale->text('Dunning Duedate') }, 'fee' => { 'text' => $locale->text('Total Fees') }, @@ -384,7 +387,7 @@ sub show_dunning { ); $report->set_columns(%column_defs); - $report->set_column_order(qw(checkbox dunning_description customername language invnumber transdate + $report->set_column_order(qw(checkbox dunning_description dunning_id customername language invnumber transdate duedate amount dunning_date dunning_duedate fee interest salesman)); $report->set_sort_indicator($form->{sort}, $form->{sortdir}); @@ -392,12 +395,12 @@ sub show_dunning { my $print_url = sub { build_std_url('action=print_dunning', 'format=pdf', 'media=screen', 'dunning_id='.$_[0]->{dunning_id}, 'language_id=' . $_[0]->{language_id}) }; my $sort_url = build_std_url('action=show_dunning', grep { $form->{$_} } @filter_field_list); - foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate salesman)) { + foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate salesman dunning_id)) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $sort_url . "&sort=$name&sortdir=$sortdir"; } - my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest salesman); + my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest salesman dunning_id); my ($current_dunning_rows, $previous_dunning_id, $first_row_for_dunning); @@ -423,12 +426,13 @@ sub show_dunning { my $row = { }; foreach my $column (keys %{ $ref }) { $row->{$column} = { - 'data' => $first_row_for_dunning || (($column ne 'dunning_description') && ($column ne 'customername')) ? $ref->{$column} : '', + 'data' => $first_row_for_dunning || (none { $_ eq $column } qw(dunning_description customername dunning_id)) ? $ref->{$column} : '', 'align' => $alignment{$column}, 'link' => ( $column eq 'invnumber' ? $edit_url->($ref) : $column eq 'dunning_description' ? $print_url->($ref) + : $column eq 'dunning_id' ? $print_url->($ref) : ''), }; } diff --git a/templates/webpages/dunning/search.html b/templates/webpages/dunning/search.html index 6145f789d..0f850b243 100644 --- a/templates/webpages/dunning/search.html +++ b/templates/webpages/dunning/search.html @@ -47,6 +47,11 @@ + + [% 'Dunning number' | $T8 %] + + + [% 'Order Number' | $T8 %] -- 2.20.1