my $query =
qq|SELECT dord.id, dord.donumber, dord.ordnumber, dord.cusordnumber,
dord.transdate, dord.reqdate,
- ct.${vc}number, ct.name, dord.${vc}_id, dord.globalproject_id,
+ ct.${vc}number, ct.name, ct.business_id,
+ dord.${vc}_id, dord.globalproject_id,
dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia,
dord.transaction_description, dord.itime::DATE AS insertdate,
pr.projectnumber AS globalprojectnumber,
push @values, conv_i($form->{project_id}), conv_i($form->{project_id});
}
+ if ($form->{"business_id"}) {
+ push @where, qq|ct.business_id = ?|;
+ push @values, conv_i($form->{"business_id"});
+ }
+
if ($form->{"${vc}_id"}) {
push @where, qq|dord.${vc}_id = ?|;
push @values, $form->{"${vc}_id"};
$form->{vc} = $form->{type} eq 'purchase_delivery_order' ? 'vendor' : 'customer';
- $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
- "all" => 1 },
- "departments" => "ALL_DEPARTMENTS",
- "$form->{vc}s" => "ALL_VC");
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 1 },
+ "departments" => "ALL_DEPARTMENTS",
+ "$form->{vc}s" => "ALL_VC",
+ "business_types" => "ALL_BUSINESS_TYPES");
$form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
$form->{SHOW_VC_DROP_DOWN} = $myconfig{vclimit} > scalar @{ $form->{ALL_VC} };
push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber serialnumber cusordnumber
transaction_description transdatefrom transdateto reqdatefrom reqdateto
type vc employee_id salesman_id project_id
- insertdatefrom insertdateto);
+ insertdatefrom insertdateto business_id);
my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables);
push @options, $locale->text('Order Number') . " : $form->{ordnumber}";
}
push @options, $locale->text('Serial Number') . " : $form->{serialnumber}" if $form->{serialnumber};
+ 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;
+ }
if ($form->{transaction_description}) {
push @options, $locale->text('Transaction description') . " : $form->{transaction_description}";
}
[%- SET is_customer = '0' %]
[%- END %]
+ [%- SET vctypelabel = vc == 'customer' ? LxERP.t8('Customer type') : LxERP.t8('Vendor type') %]
+
<script type="text/javascript">
$(function(){ document.Form.donumber.focus(); });
</script>
<td colspan="3"><input name="serialnumber" class="fixed_width"></td>
</tr>
+ [%- IF ALL_BUSINESS_TYPES.size %]
+ <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">[% 'Delivery Order Date' | $T8 %] [% 'From' | $T8 %]</th>
<td>