qq| ex.$rate AS exchangerate, | .
qq| pr.projectnumber AS globalprojectnumber, | .
qq| e.name AS employee, s.name AS salesman, | .
- qq| ct.${vc}number AS vcnumber, ct.country, ct.ustid | .
+ qq| ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id | .
$periodic_invoices_columns .
qq|FROM oe o | .
qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | .
push @values, "%" . $form->{"projectnumber"} . "%", "%" . $form->{"projectnumber"} . "%" ;
}
+ if ($form->{"business_id"}) {
+ $query .= " AND ct.business_id = ?";
+ push(@values, $form->{"business_id"});
+ }
+
if ($form->{"${vc}_id"}) {
$query .= " AND o.${vc}_id = ?";
push(@values, $form->{"${vc}_id"});
$form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
$form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 },
"departments" => "ALL_DEPARTMENTS",
- "$form->{vc}s" => "ALL_VC");
+ "$form->{vc}s" => "ALL_VC",
+ "business_types" => "ALL_BUSINESS_TYPES");
$form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
# constants and subs for template
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber
transaction_description transdatefrom transdateto type vc employee_id salesman_id
- reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive);
+ reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive
+ business_id);
my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables);
push @options, $locale->text('Not delivered') if $form->{notdelivered};
push @options, $locale->text('Periodic invoices active') if $form->{periodic_invoices_actibe};
+ if ($form->{business_id}) {
+ my $vc_type_label = $form->{vc} eq 'customer' ? $locale->text('Customer type') : $locale->text('Vendor type');
+ push @options, $vc_type_label . " : " . SL::DB::Business->new(id => $form->{business_id})->load->description;
+ }
+
$report->set_options('top_info_text' => join("\n", @options),
'raw_top_info_text' => $form->parse_html_template('oe/orders_top'),
'raw_bottom_info_text' => $form->parse_html_template('oe/orders_bottom', { 'SHOW_CONTINUE_BUTTON' => $allow_multiple_orders }),
[%- USE L %]
[%- SET vclabel = vc == 'customer' ? LxERP.t8('Customer') : LxERP.t8('Vendor') %]
[%- SET vcnumberlabel = vc == 'customer' ? LxERP.t8('Customer Number') : LxERP.t8('Vendor Number') %]
+[%- SET vctypelabel = vc == 'customer' ? LxERP.t8('Customer type') : LxERP.t8('Vendor type') %]
<form method="post" action="oe.pl">
-%]
</td>
</tr>
+ [%- UNLESS ALL_BUSINESS_TYPES.size == 0 %]
+ <tr>
+ <th align="right" nowrap>[% vctypelabel %]</th>
+ <td colspan="3">
+ [% L.select_tag('business_id', ALL_BUSINESS_TYPES, title_key = 'description', with_empty = 1, style='width:250px') %]
+ </td>
+ </tr>
+ [%- END %]
<tr>
<th align="right">[% IF is_order %][% 'Order Date' | $T8 %][% ELSE %][% 'Quotation Date' | $T8 %][% END %] [% 'From' | $T8 %]</th>
<td>