obj_link => sub { $self->link_to($_[0]->part) }},
qty => { text => $::locale->text('Qty'),
sub => sub { $_[0]->qty_as_number . ' ' . $_[0]->unit }},
+ missing => { text => $::locale->text('Missing qty'),
+ sub => sub { $::form->format_amount(\%::myconfig, $_[0]->qty - $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit }},
shipped_qty => { text => $::locale->text('shipped'),
sub => sub { $::form->format_amount(\%::myconfig, $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit }},
ordnumber => { text => $::locale->text('Order'),
return $self->{report}->generate_with_headers;
}
+sub make_filter_summary {
+ my ($self) = @_;
+
+ my $filter = $::form->{filter};
+ my @filter_strings;
+ push @filter_strings, $::locale->text('Search Style') . ' ' . ($filter->{searchstyle} eq 'open' ? $::locale->text('Search for undelivered parts') : $::locale->text('Search for delivered parts')) if $filter->{searchstyle} =~ /open|delivered/;
+
+ $self->{filter_summary} = join ', ', @filter_strings;
+}
+
sub link_to {
my ($self, $object, %params) = @_;
push @{ $filter->{and} }, or => [ @part_filters ] if @part_filters;
}
- if ($filter->{'reqdate:date::le'}) {
- $launder_to->{'reqdate_date__le'} = delete $filter->{'reqdate:date::le'};
- my $parsed_date = DateTime->from_lxoffice($launder_to->{'reqdate_date__le'});
- push @{ $filter->{and} }, or => [
- 'reqdate' => { le => $parsed_date },
- and => [
- 'reqdate' => undef,
- 'order.reqdate' => { le => $parsed_date },
- ]
- ] if $parsed_date;
+ for my $op (qw(le ge)) {
+ if ($filter->{"reqdate:date::$op"}) {
+ $launder_to->{"reqdate_date__$op"} = delete $filter->{"reqdate:date::$op"};
+ my $parsed_date = DateTime->from_lxoffice($launder_to->{"reqdate_date__$op"});
+ push @{ $filter->{and} }, or => [
+ 'reqdate' => { $op => $parsed_date },
+ and => [
+ 'reqdate' => undef,
+ 'order.reqdate' => { $op => $parsed_date },
+ ]
+ ] if $parsed_date;
+ }
+ }
+
+ if (my $style = delete $filter->{searchstyle}) {
+ $self->{searchstyle} = $style;
+ $launder_to->{searchstyle} = $style;
}
return $filter;
<td>[% L.input_tag('filter.description:substr::ilike', filter.description_substr__ilike, size = 20) %]</td>
</tr>
<tr>
- <th align="right">[% 'Delivery Date' | $T8 %]</th>
+ <th align="right">[% 'Delivery Date' | $T8 %] [% 'From Date' | $T8 %]</th>
+ <td>[% L.date_tag('filter.reqdate:date::ge', filter.reqdate_date__ge, cal_align = 'BR') %]</td>
+ </tr>
+ <tr>
+ <th align="right">[% 'Delivery Date' | $T8 %] [% 'To Date' | $T8 %]</th>
<td>[% L.date_tag('filter.reqdate:date::le', filter.reqdate_date__le, cal_align = 'BR') %]</td>
</tr>
<tr>
<th align="right">[% 'Customer' | $T8 %]</th>
<td>[% L.input_tag('filter.order.customer.name:substr::ilike', filter.order.customer.name_substr__ilike, size = 20) %]</td>
</tr>
+ <tr>
+ <th align="right">[% 'Customer Number' | $T8 %]</th>
+ <td>[% L.input_tag('filter.order.customer.customernumber:substr::ilike', filter.order.customer.customernumber_substr__ilike, size = 20) %]</td>
+ </tr>
<tr>
<th align="right">[% 'Type' | $T8 %]</th>
<td>