Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20231214 feat ap erfassungsdatum filtern sortieren #243

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions SL/AP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
18 changes: 10 additions & 8 deletions bin/mozilla/ap.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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}) {
Expand Down
4 changes: 4 additions & 0 deletions templates/design40_webpages/ap/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ <h1>[% title %]</h1>
<th>[% 'Date Paid' | $T8 %]</th>
<td><span class="wi-date">[% L.date_tag('datepaidfrom') %] [% 'Bis' | $T8 %] [% L.date_tag('datepaidto') %]</span></td>
</tr>
<tr>
<th>[% 'Insert Date' | $T8 %]</th>
<td><span class="wi-date">[% L.date_tag('insertdatefrom') %] [% 'Bis' | $T8 %] [% L.date_tag('insertdateto') %] </span></td>
</tr>
<tr>
<th>[% 'Invoice Number' | $T8 %]</th>
<td>[% L.input_tag("invnumber", "", class="wi-normal") %]</td>
Expand Down
28 changes: 18 additions & 10 deletions templates/webpages/ap/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ <h1>[% title %]</h1>
<th align=right>[% 'Vendor' | $T8 %]</th>
<td>[% L.input_tag("vendor", vendor, style=style, class="initial_focus") %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Contact Person' | $T8 %]</th>
<td>[% L.input_tag("cp_name", '', style=style) %]</td>
</tr>
<tr>
<th align="right" nowrap>[% 'Contact Person' | $T8 %]</th>
<td>[% L.input_tag("cp_name", '', style=style) %]</td>
</tr>
<tr>
<th align=right nowrap>[% 'Department' | $T8 %]</th>
<td>[% L.select_tag('department_id', ALL_DEPARTMENTS, title_key = 'description', with_empty = 1, style=style) %]</td>
Expand Down Expand Up @@ -63,24 +63,32 @@ <h1>[% title %]</h1>
[% L.date_tag('transdatefrom') %]
[% 'Bis' | $T8 %]
[% L.date_tag('transdateto') %]
</td>
</tr>
</td>
</tr>
<tr>
<th align=right nowrap>[% 'Due Date' | $T8 %]</th>
<td>
[% L.date_tag('duedatefrom') %]
[% 'Bis' | $T8 %]
[% L.date_tag('duedateto') %]
</td>
</tr>
</td>
</tr>
<tr>
<th align=right nowrap>[% 'Date Paid' | $T8 %]</th>
<td>
[% L.date_tag('datepaidfrom') %]
[% 'Bis' | $T8 %]
[% L.date_tag('datepaidto') %]
</td>
</tr>
</td>
</tr>
<tr>
<th align=right nowrap>[% 'Insert Date' | $T8 %]</th>
<td>
[% L.date_tag('insertdatefrom') %]
[% 'Bis' | $T8 %]
[% L.date_tag('insertdateto') %]
</td>
</tr>
</table>
</td>
</tr>
Expand Down