push(@values, conv_i($form->{business_id}));
}
+ if ($form->{salesman_id}) {
+ $where .= qq| AND (ct.salesman_id = ?)|;
+ push(@values, conv_i($form->{salesman_id}));
+ }
+
# Nur Kunden finden, bei denen ich selber der Verkäufer bin
# Gilt nicht für Lieferanten
if ($cv eq 'customer' && !$main::auth->assert('customer_vendor_all_edit', 1)) {
$form->{IS_CUSTOMER} = $form->{db} eq 'customer';
- $form->get_lists("business_types" => "ALL_BUSINESS_TYPES");
+ $form->get_lists("business_types" => "ALL_BUSINESS_TYPES",
+ "salesmen" => "ALL_SALESMEN");
$form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
$form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT');
push @options, $label . " : " . $business->description;
}
}
+ if ($form->{salesman_id}) {
+ my $salesman = SL::DB::Manager::Employee->find_by(id => $form->{salesman_id});
+ if ($salesman) {
+ push @options, $locale->text('Salesman') . " : " . $salesman->name;
+ }
+ }
my @columns = (
'id', 'name', "$form->{db}number", 'contact', 'phone', 'discount',
my @hidden_variables = ( qw(
db status obsolete name contact email cp_name addr_street addr_zipcode
- addr_city addr_country business_id
+ addr_city addr_country business_id salesman_id
), "$form->{db}number",
map({ "cvar_$_->{name}" } @searchable_custom_variables),
map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)),
</tr>
[% END %]
+ [% IF IS_CUSTOMER && ALL_SALESMEN.size %]
+ <tr>
+ <th align="right" nowrap>[% 'Salesman' | $T8 %]</th>
+ <td>
+ [% L.select_tag('salesman_id', ALL_SALESMEN, title_key = 'name', with_empty = 1) %]
+ </td>
+ </tr>
+ [% END %]
+
[% CUSTOM_VARIABLES_FILTER_CODE %]
<tr>