Revision 0bf218ff
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
2373 | 2373 |
my $options = ref $key eq 'HASH' ? $key : { key => $key }; |
2374 | 2374 |
$options->{key} ||= "all_customers"; |
2375 | 2375 |
my $limit_clause = "LIMIT $options->{limit}" if $options->{limit}; |
2376 |
my $where = $options->{business_is_salesman} ? qq| AND business_id IN (SELECT id FROM business WHERE salesman)| : ''; |
|
2377 | 2376 |
|
2378 |
my $query = qq|SELECT * FROM customer WHERE NOT obsolete $where ORDER BY name $limit_clause|; |
|
2377 |
my @where; |
|
2378 |
push @where, qq|business_id IN (SELECT id FROM business WHERE salesman)| if $options->{business_is_salesman}; |
|
2379 |
push @where, qq|NOT obsolete| if !$options->{with_obsolete}; |
|
2380 |
my $where_str = @where ? "WHERE " . join(" AND ", map { "($_)" } @where) : ''; |
|
2381 |
|
|
2382 |
my $query = qq|SELECT * FROM customer $where_str ORDER BY name $limit_clause|; |
|
2379 | 2383 |
$self->{ $options->{key} } = selectall_hashref_query($self, $dbh, $query); |
2380 | 2384 |
|
2381 | 2385 |
$main::lxdebug->leave_sub(); |
bin/mozilla/ct.pl | ||
---|---|---|
289 | 289 |
taxzones => "ALL_TAXZONES"); |
290 | 290 |
$form->get_pricegroup(\%myconfig, { all => 1 }); |
291 | 291 |
|
292 |
$form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter; |
|
292 |
$form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1, with_obsolete => 1 }) if $::vertreter;
|
|
293 | 293 |
|
294 | 294 |
$form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES}; |
295 | 295 |
$form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; |
Auch abrufbar als: Unified diff
Im Vertretermodus auch ungültige Vertreter in Vertreterauswahl anzeigen