Revision 9d60642b
Von Moritz Bunkus vor fast 15 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
2299 | 2299 |
sub _get_customers { |
2300 | 2300 |
$main::lxdebug->enter_sub(); |
2301 | 2301 |
|
2302 |
my ($self, $dbh, $key, $limit) = @_; |
|
2303 |
|
|
2304 |
$key = "all_customers" unless ($key); |
|
2305 |
my $limit_clause = "LIMIT $limit" if $limit; |
|
2302 |
my ($self, $dbh, $key) = @_; |
|
2306 | 2303 |
|
2307 |
my $query = qq|SELECT * FROM customer WHERE NOT obsolete ORDER BY name $limit_clause|; |
|
2304 |
my $options = ref $key eq 'HASH' ? $key : { key => $key }; |
|
2305 |
$options->{key} ||= "all_customers"; |
|
2306 |
my $limit_clause = "LIMIT $options->{limit}" if $options->{limit}; |
|
2307 |
my $where = $options->{business_is_salesman} ? qq| AND business_id IN (SELECT id FROM business WHERE salesman)| : ''; |
|
2308 | 2308 |
|
2309 |
$self->{$key} = selectall_hashref_query($self, $dbh, $query); |
|
2309 |
my $query = qq|SELECT * FROM customer WHERE NOT obsolete $where ORDER BY name $limit_clause|; |
|
2310 |
$self->{ $options->{key} } = selectall_hashref_query($self, $dbh, $query); |
|
2310 | 2311 |
|
2311 | 2312 |
$main::lxdebug->leave_sub(); |
2312 | 2313 |
} |
... | ... | |
2473 | 2474 |
} |
2474 | 2475 |
|
2475 | 2476 |
if($params{"customers"}) { |
2476 |
if (ref $params{"customers"} eq 'HASH') { |
|
2477 |
$self->_get_customers($dbh, $params{"customers"}{key}, $params{"customers"}{limit}); |
|
2478 |
} else { |
|
2479 |
$self->_get_customers($dbh, $params{"customers"}); |
|
2480 |
} |
|
2477 |
$self->_get_customers($dbh, $params{"customers"}); |
|
2481 | 2478 |
} |
2482 | 2479 |
|
2483 | 2480 |
if($params{"vendors"}) { |
bin/mozilla/ct.pl | ||
---|---|---|
285 | 285 |
my %myconfig = %main::myconfig; |
286 | 286 |
my $locale = $main::locale; |
287 | 287 |
|
288 |
$form->get_lists(employees => "ALL_EMPLOYEES", |
|
289 |
taxzones => "ALL_TAXZONES", |
|
290 |
business_types => { key => 'ALL_SALESMAN_BUSINESSES', salesman => 1 }); |
|
288 |
$form->get_lists(employees => "ALL_EMPLOYEES", |
|
289 |
taxzones => "ALL_TAXZONES"); |
|
291 | 290 |
$form->get_pricegroup(\%myconfig, { all => 1 }); |
292 | 291 |
|
292 |
$form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter; |
|
293 |
|
|
293 | 294 |
$form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES}; |
294 | 295 |
$form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; |
295 | 296 |
$form->{is_admin} = $myconfig{role} eq 'admin'; |
templates/webpages/ct/form_header_de.html | ||
---|---|---|
39 | 39 |
<th align="right">Vertreter</th> |
40 | 40 |
<td> |
41 | 41 |
[%- INCLUDE generic/multibox.html |
42 |
name = 'salesman_id', |
|
43 |
DATA = ALL_SALESMAN_BUSINESSES, |
|
44 |
show_empty = 1, |
|
45 |
id_key = 'id', |
|
46 |
label_key = 'description', |
|
42 |
name = 'salesman_id', |
|
43 |
DATA = ALL_SALESMAN_CUSTOMERS, |
|
44 |
id_key = 'id', |
|
45 |
label_key = 'name', |
|
47 | 46 |
-%] |
48 | 47 |
</td> |
49 | 48 |
</tr> |
... | ... | |
245 | 244 |
label_key = 'description', |
246 | 245 |
-%] |
247 | 246 |
</td> |
248 |
[%- IF is_customer && !use_vertreter %]
|
|
247 |
[%- IF is_customer && !conf_vertreter %]
|
|
249 | 248 |
<th align="right">Verk?ufer/in</th> |
250 | 249 |
<td> |
251 | 250 |
[%- INCLUDE generic/multibox.html |
templates/webpages/ct/form_header_master.html | ||
---|---|---|
39 | 39 |
<th align="right"><translate>Representative</translate></th> |
40 | 40 |
<td> |
41 | 41 |
[%- INCLUDE generic/multibox.html |
42 |
name = 'salesman_id', |
|
43 |
DATA = ALL_SALESMAN_BUSINESSES, |
|
44 |
show_empty = 1, |
|
45 |
id_key = 'id', |
|
46 |
label_key = 'description', |
|
42 |
name = 'salesman_id', |
|
43 |
DATA = ALL_SALESMAN_CUSTOMERS, |
|
44 |
id_key = 'id', |
|
45 |
label_key = 'name', |
|
47 | 46 |
-%] |
48 | 47 |
</td> |
49 | 48 |
</tr> |
... | ... | |
245 | 244 |
label_key = 'description', |
246 | 245 |
-%] |
247 | 246 |
</td> |
248 |
[%- IF is_customer && !use_vertreter %]
|
|
247 |
[%- IF is_customer && !conf_vertreter %]
|
|
249 | 248 |
<th align="right"><translate>Salesman</translate></th> |
250 | 249 |
<td> |
251 | 250 |
[%- INCLUDE generic/multibox.html |
Auch abrufbar als: Unified diff
"Vertreter" sind Kunden mit Kundentyp mit Vertreter-Flag, nicht die Kundentypen selber