use Clone qw(clone);
use SL::DB::OrderItem;
+use SL::DB::Business;
use SL::Controller::Helper::GetModels;
use SL::Controller::Helper::ReportGenerator;
use SL::Locale::String;
$self->prepare_report;
my $orderitems = $self->models->get;
+ $self->{all_businesses} = SL::DB::Manager::Business->get_all_sorted;
- $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems);
+ $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems);
}
# private functions
my $filter = $::form->{filter} || {};
my @filter_strings;
+ my $business = SL::DB::Business->new(id => $filter->{order}{customer}{"business_id"})->load->description if $filter->{order}{customer}{"business_id"};
my @filters = (
- [ $filter->{order}{"ordnumber:substr::ilike"}, $::locale->text('Number') ],
- [ $filter->{part}{"partnumber:substr::ilike"}, $::locale->text('Part Number') ],
- [ $filter->{"description:substr::ilike"}, $::locale->text('Part Description') ],
- [ $filter->{"reqdate:date::ge"}, $::locale->text('Delivery Date') . " " . $::locale->text('From Date') ],
- [ $filter->{"reqdate:date::le"}, $::locale->text('Delivery Date') . " " . $::locale->text('To Date') ],
- [ $filter->{"qty:number"}, $::locale->text('Quantity') ],
- [ $filter->{order}{vendor}{"name:substr::ilike"}, $::locale->text('Vendor') ],
- [ $filter->{order}{vendor}{"vendornumber:substr::ilike"}, $::locale->text('Vendor Number') ],
- [ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ],
- [ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ],
+ [ $filter->{order}{"ordnumber:substr::ilike"}, $::locale->text('Number') ],
+ [ $filter->{order}{globalproject}{"projectnumber:substr::ilike"}, $::locale->text('Document Project Number') ],
+ [ $filter->{part}{"partnumber:substr::ilike"}, $::locale->text('Part Number') ],
+ [ $filter->{"description:substr::ilike"}, $::locale->text('Part Description') ],
+ [ $filter->{"reqdate:date::ge"}, $::locale->text('Delivery Date') . " " . $::locale->text('From Date') ],
+ [ $filter->{"reqdate:date::le"}, $::locale->text('Delivery Date') . " " . $::locale->text('To Date') ],
+ [ $filter->{"qty:number"}, $::locale->text('Quantity') ],
+ [ $filter->{order}{vendor}{"name:substr::ilike"}, $::locale->text('Vendor') ],
+ [ $filter->{order}{vendor}{"vendornumber:substr::ilike"}, $::locale->text('Vendor Number') ],
+ [ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ],
+ [ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ],
+ [ $business, $::locale->text('Customer type') ],
);
my %flags = (
<th align="right">[% 'Number' | $T8 %]</th>
<td>[% L.input_tag('filter.order.ordnumber:substr::ilike', filter.order.ordnumber_substr__ilike, size = 20) %]</td>
</tr>
+ <tr>
+ <th align="right">[% 'Document Project Number' | $T8 %]</th>
+ <td>[% L.input_tag('filter.order.globalproject.projectnumber:substr::ilike', filter.order.globalproject.projectnumber_substr__ilike, size = 20) %]</td>
+ </tr>
<tr>
<th align="right">[% 'Part Number' | $T8 %]</th>
<td>[% L.input_tag('filter.part.partnumber:substr::ilike', filter.part.partnumber_substr__ilike, size = 20) %]</td>
<td>[% L.input_tag('filter.order.vendor.vendornumber:substr::ilike', filter.order.vendor.vendornumber_substr__ilike, size = 20) %]</td>
</tr>
[% END %]
+ <tr>
+ <th align="right">[% 'Customer type' | $T8 %]</th>
+ <td>
+ [% L.select_tag('filter.order.customer.business_id', SELF.all_businesses,
+ default => filter.order.customer.business_id,
+ title_key => 'description',
+ value_key => 'id',
+ with_empty => 1,
+ style => 'width: 200px') %]
+ </td>
+ </tr>
<tr>
<th align="right">[% 'Type' | $T8 %]</th>
<td>