From c49684f8b604a4318679d3a6828f0ffaafdfe2d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 21 Feb 2022 12:52:31 +0100 Subject: [PATCH] =?utf8?q?Buchungsjournal:=20Vorgangsbezeichnung=20anzeige?= =?utf8?q?n=20und=20danach=20filtern=20k=C3=B6nnen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/GL.pm | 17 ++++++++++++++--- bin/mozilla/gl.pl | 10 ++++++---- templates/webpages/gl/search.html | 6 ++++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/SL/GL.pm b/SL/GL.pm index 4edd9f1f3..be1d0871a 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -301,6 +301,15 @@ sub all_transactions { push(@apvalues, like($form->{notes})); } + if (trim($form->{transaction_description})) { + $glwhere .= " AND g.transaction_description ILIKE ?"; + $arwhere .= " AND a.transaction_description ILIKE ?"; + $apwhere .= " AND a.transaction_description ILIKE ?"; + push(@glvalues, like($form->{transaction_description})); + push(@arvalues, like($form->{transaction_description})); + push(@apvalues, like($form->{transaction_description})); + } + if ($form->{accno}) { $glwhere .= " AND c.accno = '$form->{accno}'"; $arwhere .= " AND c.accno = '$form->{accno}'"; @@ -364,11 +373,13 @@ sub all_transactions { 'description' => [ qw(lower_description id) ], 'accno' => [ qw(accno transdate id) ], 'department' => [ qw(department transdate id) ], + 'transaction_description' => [ qw(lower_transaction_description id) ], ); my %lowered_columns = ( 'reference' => { 'gl' => 'g.reference', 'arap' => 'a.invnumber', }, 'source' => { 'gl' => 'ac.source', 'arap' => 'ac.source', }, 'description' => { 'gl' => 'g.description', 'arap' => 'ct.name', }, + 'transaction_description' => { 'gl' => 'g.transaction_description', 'arap' => 'a.transaction_description', }, ); # sortdir = sort direction (ascending or descending) @@ -389,7 +400,7 @@ sub all_transactions { ac.acc_trans_id, g.id, 'gl' AS type, FALSE AS invoice, g.reference, ac.taxkey, c.link, g.description, ac.transdate, ac.gldate, ac.source, ac.trans_id, ac.amount, c.accno, g.notes, t.chart_id, - d.description AS department, + d.description AS department, g.transaction_description, CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee $project_columns $gl_globalproject_columns $columns_for_sorting{gl} @@ -407,7 +418,7 @@ sub all_transactions { SELECT ac.acc_trans_id, a.id, 'ar' AS type, a.invoice, a.invnumber, ac.taxkey, c.link, ct.name, ac.transdate, ac.gldate, ac.source, ac.trans_id, ac.amount, c.accno, a.notes, t.chart_id, - d.description AS department, + d.description AS department, a.transaction_description, CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee $project_columns $arap_globalproject_columns $columns_for_sorting{arap} @@ -427,7 +438,7 @@ sub all_transactions { SELECT ac.acc_trans_id, a.id, 'ap' AS type, a.invoice, a.invnumber, ac.taxkey, c.link, ct.name, ac.transdate, ac.gldate, ac.source, ac.trans_id, ac.amount, c.accno, a.notes, t.chart_id, - d.description AS department, + d.description AS department, a.transaction_description, CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee $project_columns $arap_globalproject_columns $columns_for_sorting{arap} diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 64632e0e3..fa3aada7e 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -428,14 +428,14 @@ sub generate_report { my @columns = qw( transdate gldate id reference description - notes source doccnt debit debit_accno + notes transaction_description source doccnt debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno balance projectnumbers department employee ); # add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table - my @hidden_variables = qw(accno source reference description notes project_id datefrom dateto employee_id datesort category l_subtotal department_id); + my @hidden_variables = qw(accno source reference description notes project_id datefrom dateto employee_id datesort category l_subtotal department_id transaction_description); push @hidden_variables, map { "l_${_}" } @columns; my $employee = $form->{employee_id} ? SL::DB::Employee->new(id => $form->{employee_id})->load->name : ''; @@ -446,6 +446,7 @@ sub generate_report { push @options, $locale->text('Reference') . " : $form->{reference}" if ($form->{reference}); push @options, $locale->text('Description') . " : $form->{description}" if ($form->{description}); push @options, $locale->text('Notes') . " : $form->{notes}" if ($form->{notes}); + push @options, $locale->text('Transaction description') . " : $form->{transaction_description}" if $form->{transaction_description}; push @options, $locale->text('Employee') . " : $employee" if $employee; my $datesorttext = $form->{datesort} eq 'transdate' ? $locale->text('Transdate') : $locale->text('Gldate'); push @date_options, "$datesorttext" if ($form->{datesort} and ($form->{datefrom} or $form->{dateto})); @@ -492,9 +493,10 @@ sub generate_report { 'projectnumbers' => { 'text' => $locale->text('Project Numbers'), }, 'department' => { 'text' => $locale->text('Department'), }, 'employee' => { 'text' => $locale->text('Employee'), }, + 'transaction_description' => { 'text' => $locale->text('Transaction description'), }, ); - foreach my $name (qw(id transdate gldate reference description debit_accno credit_accno debit_tax_accno credit_tax_accno department)) { + foreach my $name (qw(id transdate gldate reference description debit_accno credit_accno debit_tax_accno credit_tax_accno department transaction_description)) { my $sortname = $name =~ m/accno/ ? 'accno' : $name; my $sortdir = $sortname eq $form->{sort} ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $callback . "&sort=$sortname&sortdir=$sortdir"; @@ -582,7 +584,7 @@ sub generate_report { $row->{balance}->{data} = $data; $row->{projectnumbers}->{data} = join ", ", sort { lc($a) cmp lc($b) } keys %{ $ref->{projectnumbers} }; - map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes gldate employee department); + map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes gldate employee department transaction_description); map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source); diff --git a/templates/webpages/gl/search.html b/templates/webpages/gl/search.html index b7c8e7c04..e7e1d5b3c 100644 --- a/templates/webpages/gl/search.html +++ b/templates/webpages/gl/search.html @@ -34,6 +34,10 @@ [% 'Notes' | $T8 %] + + [% 'Transaction description' | $T8 %] + [% L.input_tag("transaction_description", "", size=40) %] + [% 'Project Number' | $T8 %] [% L.select_tag('project_id', ALL_PROJECTS, title_key = 'projectnumber', with_empty = 1) %] @@ -104,6 +108,8 @@ [% 'Project Number' | $T8 %] [% 'Employee' | $T8 %] + + [% 'Transaction description' | $T8 %] -- 2.20.1