From 2391833dbbf3be1eb1822485171727a06da69475 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 11 Mar 2022 18:20:18 +0100 Subject: [PATCH] =?utf8?q?Rechnungsbericht=20VK=20und=20EK=20nach=20Steuer?= =?utf8?q?zone=20filtern=20k=C3=B6nnen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AP.pm | 4 ++++ SL/AR.pm | 6 +++--- bin/mozilla/ap.pl | 4 +++- bin/mozilla/ar.pl | 3 ++- templates/webpages/ap/search.html | 4 ++++ templates/webpages/ar/search.html | 4 ++++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index a02d6ffd4..9f34d9970 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -618,6 +618,10 @@ sub ap_transactions { $where .= " AND a.ordnumber ILIKE ?"; push(@values, like($form->{ordnumber})); } + if ($form->{taxzone_id}) { + $where .= " AND a.taxzone_id = ?"; + push(@values, $form->{taxzone_id}); + } if ($form->{transaction_description}) { $where .= " AND a.transaction_description ILIKE ?"; push(@values, like($form->{transaction_description})); diff --git a/SL/AR.pm b/SL/AR.pm index 148edd2d3..73c57867b 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -573,9 +573,9 @@ sub ar_transactions { $where .= " AND c.business_id = ?"; push(@values, $business_id); } - if ($form->{department_id}) { - $where .= " AND a.department_id = ?"; - push(@values, $form->{department_id}); + if ($form->{taxzone_id}) { + $where .= " AND a.taxzone_id = ?"; + push(@values, $form->{taxzone_id}); } foreach my $column (qw(invnumber ordnumber cusordnumber notes transaction_description shipvia shippingpoint)) { if ($form->{$column}) { diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 58f8cc535..9f2d4d957 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -987,6 +987,8 @@ sub search { $form->{title} = $locale->text('Vendor Invoices & AP Transactions'); $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; + $::form->{ALL_TAXZONES} = SL::DB::Manager::TaxZone ->get_all_sorted; + # constants and subs for template $form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; @@ -1044,7 +1046,7 @@ sub ap_transactions { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto - parts_partnumber parts_description department_id); + parts_partnumber parts_description department_id taxzone_id); my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables); diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index a73ec81b4..a3205b0f7 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -964,6 +964,7 @@ sub search { $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]); $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; $form->{ALL_BUSINESS_TYPES} = SL::DB::Manager::Business->get_all_sorted; + $form->{ALL_TAXZONES} = SL::DB::Manager::TaxZone ->get_all_sorted; $form->{CT_CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT'); ($form->{CT_CUSTOM_VARIABLES_FILTER_CODE}, @@ -1039,7 +1040,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 show_marked_as_closed show_not_mailed - shippingpoint shipvia); + shippingpoint shipvia taxzone_id); push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables; $href = $params{want_binary_pdf} ? '' : build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables); diff --git a/templates/webpages/ap/search.html b/templates/webpages/ap/search.html index 59f4b371c..c96506805 100644 --- a/templates/webpages/ap/search.html +++ b/templates/webpages/ap/search.html @@ -29,6 +29,10 @@ [% 'Order Number' | $T8 %] [% L.input_tag("ordnumber", "", style=style) %] + + [% 'Steuersatz' | $T8 %] + [% L.select_tag('taxzone_id', ALL_TAXZONES, with_empty=1, title_key='description', style=style) %] + [% 'Transaction description' | $T8 %] [% L.input_tag("transaction_description", "", style=style) %] diff --git a/templates/webpages/ar/search.html b/templates/webpages/ar/search.html index 66049642e..d396db3ad 100644 --- a/templates/webpages/ar/search.html +++ b/templates/webpages/ar/search.html @@ -42,6 +42,10 @@ [% 'Salesman' | $T8 %] [% L.select_tag('salesman_id', ALL_EMPLOYEES, title_key = 'safe_name', with_empty = 1, style=style) %] + + [% 'Steuersatz' | $T8 %] + [% L.select_tag('taxzone_id', ALL_TAXZONES, with_empty=1, title_key='description', style=style) %] + [% 'Transaction description' | $T8 %] [% L.input_tag("transaction_description", "", style=style) %] -- 2.20.1