From e8966d209fcc8cda8c402cb0bab2a58f61b5922c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 8 Nov 2013 12:17:41 +0100 Subject: [PATCH] Erfassungsdatum bei Verkaufs-Lieferscheinen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In der Maske anzeigen; im Bericht anzeigen und danach filtern. Übernahme aus Kundenprojekt. --- SL/DO.pm | 15 +++++++++++++-- bin/mozilla/do.pl | 14 ++++++++++++-- templates/webpages/do/form_header.html | 7 +++++++ templates/webpages/do/search.html | 19 +++++++++++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/SL/DO.pm b/SL/DO.pm index 80b1ae352..eb74e26c7 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -69,7 +69,7 @@ sub transactions { dord.transdate, dord.reqdate, ct.${vc}number, ct.name, dord.${vc}_id, dord.globalproject_id, dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia, - dord.transaction_description, + dord.transaction_description, dord.itime::DATE AS insertdate, pr.projectnumber AS globalprojectnumber, dep.description AS department, e.name AS employee, @@ -163,6 +163,16 @@ sub transactions { push @values, conv_date($form->{reqdateto}); } + if($form->{insertdatefrom}) { + push @where, qq|dord.itime::DATE >= ?|; + push@values, conv_date($form->{insertdatefrom}); + } + + if($form->{insertdateto}) { + push @where, qq|dord.itime::DATE <= ?|; + push @values, conv_date($form->{insertdateto}); + } + if (@where) { $query .= " WHERE " . join(" AND ", map { "($_)" } @where); } @@ -179,6 +189,7 @@ sub transactions { "shipvia" => "dord.shipvia", "transaction_description" => "dord.transaction_description", "department" => "lower(dep.description)", + "insertdate" => "dord.itime", ); my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; @@ -673,7 +684,7 @@ sub retrieve { dord.shipto_id, dord.globalproject_id, dord.delivered, dord.transaction_description, dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency, - dord.delivery_term_id + dord.delivery_term_id, dord.itime::DATE AS insertdate FROM delivery_orders dord JOIN ${vc} cv ON (dord.${vc}_id = cv.id) LEFT JOIN employee e ON (dord.employee_id = e.id) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 6b37b6cb8..67819fbc9 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -369,6 +369,8 @@ sub update_delivery_order { set_headings($form->{"id"} ? "edit" : "add"); + $form->{insertdate} = SL::DB::DeliveryOrder->new(id => $form->{id})->load->itime_as_date if $form->{id}; + $form->{update} = 1; my $payment_id; @@ -532,6 +534,7 @@ sub orders { shipvia globalprojectnumber transaction_description department open delivered + insertdate ); $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}); @@ -546,7 +549,8 @@ sub orders { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber serialnumber cusordnumber transaction_description transdatefrom transdateto reqdatefrom reqdateto - type vc employee_id salesman_id project_id); + type vc employee_id salesman_id project_id + insertdatefrom insertdateto); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -568,9 +572,10 @@ sub orders { 'open' => { 'text' => $locale->text('Open'), }, 'delivered' => { 'text' => $locale->text('Delivered'), }, 'department' => { 'text' => $locale->text('Department'), }, + 'insertdate' => { 'text' => $locale->text('Insert Date'), }, ); - foreach my $name (qw(id transdate reqdate donumber ordnumber name employee salesman shipvia transaction_description department)) { + foreach my $name (qw(id transdate reqdate donumber ordnumber name employee salesman shipvia transaction_description department insertdate)) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; } @@ -621,6 +626,11 @@ sub orders { push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{reqdatefrom}, 1) if $form->{reqdatefrom}; push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{reqdateto}, 1) if $form->{reqdateto}; }; + if ( $form->{insertdatefrom} or $form->{insertdateto} ) { + push @options, $locale->text('Insert Date'); + push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{insertdatefrom}, 1) if $form->{insertdatefrom}; + push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{insertdateto}, 1) if $form->{insertdateto}; + }; if ($form->{open}) { push @options, $locale->text('Open'); } diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html index 9b4e9f26f..2a28853d5 100644 --- a/templates/webpages/do/form_header.html +++ b/templates/webpages/do/form_header.html @@ -314,6 +314,13 @@ + [%- IF is_customer %] + + [% 'Insert Date' | $T8 %] + [% insertdate %] + + [%- END %] + [% 'Project Number' | $T8 %] diff --git a/templates/webpages/do/search.html b/templates/webpages/do/search.html index e84bbf3e4..ae86cb240 100644 --- a/templates/webpages/do/search.html +++ b/templates/webpages/do/search.html @@ -130,6 +130,19 @@ + [%- IF is_customer %] + + [% 'Insert Date' | $T8 %] [% 'From' | $T8 %] + + [% L.date_tag('insertdatefrom') %] + + [% 'Bis' | $T8 %] + + [% L.date_tag('insertdateto') %] + + + [%- END %] + [% 'Include in Report' | $T8 %] @@ -188,6 +201,12 @@ + [% IF is_customer %] + + + + + [%- END %] -- 2.20.1