diff --git a/SL/AP.pm b/SL/AP.pm index 3b0e8e239a..1bb8b25c41 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -697,6 +697,14 @@ sub ap_transactions { $where .= " AND a.datepaid <= ?"; push(@values, trim($form->{datepaidto})); } + if ($form->{insertdatefrom}) { + $where .= " AND a.itime >= ?"; + push(@values, trim($form->{insertdatefrom})); + } + if ($form->{insertdateto}) { + $where .= " AND a.itime <= ?"; + push(@values, trim($form->{insertdateto})); + } if ($form->{open} || $form->{closed}) { unless ($form->{open} && $form->{closed}) { $where .= " AND a.amount <> a.paid" if ($form->{open}); diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index c6fa3aa735..50ff919483 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -1161,7 +1161,7 @@ sub ap_transactions { push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto duedatefrom duedateto datepaidfrom datepaidto parts_partnumber parts_description department_id taxzone_id payment_id - fulltext); + fulltext insertdatefrom insertdateto); my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables); @@ -1196,7 +1196,7 @@ sub ap_transactions { 'items' => { 'text' => $locale->text('Positions'), }, ); - foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description direct_debit department taxzone)) { + foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description direct_debit department taxzone insertdate)) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; } @@ -1230,12 +1230,14 @@ sub ap_transactions { push @options, $locale->text('Part Description') . " : $form->{parts_description}" if $form->{parts_description}; push @options, $locale->text('Part Number') . " : $form->{parts_partnumber}" if $form->{parts_partnumber}; push @options, $locale->text('Full Text') . " : $form->{fulltext}" if ($form->{fulltext}); - push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1) if ($form->{transdatefrom}); - push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1) if ($form->{transdateto}); - push @options, $locale->text('Due Date') . " " . $locale->text('from') . " " . $locale->date(\%myconfig, $form->{duedatefrom}, 1) if ($form->{duedatefrom}); - push @options, $locale->text('Due Date') . " " . $locale->text('to') . " " . $locale->date(\%myconfig, $form->{duedateto}, 1) if ($form->{duedateto}); - push @options, $locale->text('Date Paid') . " " . $locale->text('from') . " " . $locale->date(\%myconfig, $form->{datepaidfrom}, 1) if ($form->{datepaidfrom}); - push @options, $locale->text('Date Paid') . " " . $locale->text('to') . " " . $locale->date(\%myconfig, $form->{datepaidto}, 1) if ($form->{datepaidto}); + push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1) if ($form->{transdatefrom}); + push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1) if ($form->{transdateto}); + push @options, $locale->text('Due Date') . " " . $locale->text('from') . " " . $locale->date(\%myconfig, $form->{duedatefrom}, 1) if ($form->{duedatefrom}); + push @options, $locale->text('Due Date') . " " . $locale->text('to') . " " . $locale->date(\%myconfig, $form->{duedateto}, 1) if ($form->{duedateto}); + push @options, $locale->text('Date Paid') . " " . $locale->text('from') . " " . $locale->date(\%myconfig, $form->{datepaidfrom}, 1) if ($form->{datepaidfrom}); + push @options, $locale->text('Date Paid') . " " . $locale->text('to') . " " . $locale->date(\%myconfig, $form->{datepaidto}, 1) if ($form->{datepaidto}); + push @options, $locale->text('Insert Date') . " " . $locale->text('from') . " " . $locale->date(\%myconfig, $form->{insertdatefrom}, 1) if ($form->{insertdatefrom}); + push @options, $locale->text('Insert Date') . " " . $locale->text('to') . " " . $locale->date(\%myconfig, $form->{insertdateto}, 1) if ($form->{insertdateto}); push @options, $locale->text('Open') if ($form->{open}); push @options, $locale->text('Closed') if ($form->{closed}); if ($form->{payment_id}) { diff --git a/templates/design40_webpages/ap/search.html b/templates/design40_webpages/ap/search.html index 428bf55ffb..8fa03aeff0 100644 --- a/templates/design40_webpages/ap/search.html +++ b/templates/design40_webpages/ap/search.html @@ -62,6 +62,10 @@

[% title %]

[% 'Date Paid' | $T8 %] [% L.date_tag('datepaidfrom') %] [% 'Bis' | $T8 %] [% L.date_tag('datepaidto') %] + + [% 'Insert Date' | $T8 %] + [% L.date_tag('insertdatefrom') %] [% 'Bis' | $T8 %] [% L.date_tag('insertdateto') %] + [% 'Invoice Number' | $T8 %] [% L.input_tag("invnumber", "", class="wi-normal") %] diff --git a/templates/webpages/ap/search.html b/templates/webpages/ap/search.html index cca318f64d..10dd390cd8 100644 --- a/templates/webpages/ap/search.html +++ b/templates/webpages/ap/search.html @@ -14,10 +14,10 @@

[% title %]

[% 'Vendor' | $T8 %] [% L.input_tag("vendor", vendor, style=style, class="initial_focus") %] - - [% 'Contact Person' | $T8 %] - [% L.input_tag("cp_name", '', style=style) %] - + + [% 'Contact Person' | $T8 %] + [% L.input_tag("cp_name", '', style=style) %] + [% 'Department' | $T8 %] [% L.select_tag('department_id', ALL_DEPARTMENTS, title_key = 'description', with_empty = 1, style=style) %] @@ -63,24 +63,32 @@

[% title %]

[% L.date_tag('transdatefrom') %] [% 'Bis' | $T8 %] [% L.date_tag('transdateto') %] - - + + [% 'Due Date' | $T8 %] [% L.date_tag('duedatefrom') %] [% 'Bis' | $T8 %] [% L.date_tag('duedateto') %] - - + + [% 'Date Paid' | $T8 %] [% L.date_tag('datepaidfrom') %] [% 'Bis' | $T8 %] [% L.date_tag('datepaidto') %] - - + + + + [% 'Insert Date' | $T8 %] + + [% L.date_tag('insertdatefrom') %] + [% 'Bis' | $T8 %] + [% L.date_tag('insertdateto') %] + +