Revision 87e190b4
Von Jan Büren vor fast 16 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
302 | 302 |
qq|terms = ?, | . |
303 | 303 |
qq|business_id = ?, | . |
304 | 304 |
qq|taxnumber = ?, | . |
305 |
qq|sic_code = ?, | . |
|
306 | 305 |
qq|language = ?, | . |
307 | 306 |
qq|account_number = ?, | . |
308 | 307 |
qq|bank_code = ?, | . |
... | ... | |
317 | 316 |
qq|taxzone_id = ?, | . |
318 | 317 |
qq|user_password = ?, | . |
319 | 318 |
qq|c_vendor_id = ?, | . |
320 |
qq|klass = ? | . |
|
319 |
qq|klass = ?, | . |
|
320 |
qq|v_customer_id = ? | . |
|
321 | 321 |
qq|WHERE id = ?|; |
322 | 322 |
my @values = ( |
323 | 323 |
$form->{customernumber}, |
... | ... | |
342 | 342 |
conv_i($form->{terms}), |
343 | 343 |
conv_i($form->{business}), |
344 | 344 |
$form->{taxnumber}, |
345 |
$form->{sic}, |
|
346 | 345 |
$form->{language}, |
347 | 346 |
$form->{account_number}, |
348 | 347 |
$form->{bank_code}, |
... | ... | |
358 | 357 |
$form->{user_password}, |
359 | 358 |
$form->{c_vendor_id}, |
360 | 359 |
conv_i($form->{klass}), |
360 |
$form->{v_customer_id}, |
|
361 | 361 |
$form->{id} |
362 | 362 |
); |
363 | 363 |
do_query( $form, $dbh, $query, @values ); |
... | ... | |
509 | 509 |
qq| creditlimit = ?, | . |
510 | 510 |
qq| business_id = ?, | . |
511 | 511 |
qq| taxnumber = ?, | . |
512 |
qq| sic_code = ?, | . |
|
513 | 512 |
qq| language = ?, | . |
514 | 513 |
qq| account_number = ?, | . |
515 | 514 |
qq| bank_code = ?, | . |
... | ... | |
547 | 546 |
$form->{creditlimit}, |
548 | 547 |
conv_i($form->{business}), |
549 | 548 |
$form->{taxnumber}, |
550 |
$form->{sic}, |
|
551 | 549 |
$form->{language}, |
552 | 550 |
$form->{account_number}, |
553 | 551 |
$form->{bank_code}, |
... | ... | |
685 | 683 |
my @values; |
686 | 684 |
|
687 | 685 |
my %allowed_sort_columns = |
688 |
map({ $_, 1 } qw(id customernumber vendornumber name address contact phone fax email
|
|
689 |
taxnumber sic_code business invnumber ordnumber quonumber));
|
|
686 |
map({ $_, 1 } qw(id customernumber vendornumber name contact phone fax email |
|
687 |
taxnumber business invnumber ordnumber quonumber)); |
|
690 | 688 |
$sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name"; |
691 | 689 |
$form->{sort} = $sortorder; |
692 | 690 |
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; |
693 | 691 |
|
694 |
if ($sortorder eq "address") { |
|
695 |
$sortorder = "lower(country) ${sortdir}, lower(city) ${sortdir}, lower(street) ${sortdir}"; |
|
696 |
} elsif ($sortorder ne 'id') { |
|
692 |
if ($sortorder ne 'id') { |
|
697 | 693 |
$sortorder = "lower($sortorder) ${sortdir}"; |
698 | 694 |
} else { |
699 | 695 |
$sortorder .= " ${sortdir}"; |
... | ... | |
711 | 707 |
} |
712 | 708 |
} |
713 | 709 |
|
710 |
if ($form->{cp_name}) { |
|
711 |
$where .= " AND ct.id IN (SELECT cp_cv_id FROM contacts WHERE lower(cp_name) LIKE lower(?))"; |
|
712 |
push @values, '%' . $form->{cp_name} . '%'; |
|
713 |
} |
|
714 |
|
|
715 |
if ($form->{addr_city}) { |
|
716 |
$where .= " AND ((lower(ct.city) LIKE lower(?)) |
|
717 |
OR |
|
718 |
(ct.id IN ( |
|
719 |
SELECT trans_id |
|
720 |
FROM shipto |
|
721 |
WHERE (module = 'CT') |
|
722 |
AND (lower(shiptocity) LIKE lower(?)) |
|
723 |
)) |
|
724 |
)"; |
|
725 |
push @values, ('%' . $form->{addr_city} . '%') x 2; |
|
726 |
} |
|
727 |
|
|
714 | 728 |
if ( $form->{status} eq 'orphaned' ) { |
715 | 729 |
$where .= |
716 | 730 |
qq| AND ct.id NOT IN | . |
... | ... | |
749 | 763 |
$where .= qq| AND ($cvar_where)|; |
750 | 764 |
push @values, @cvar_values; |
751 | 765 |
} |
752 |
|
|
766 |
# Um nach Straße in der Berichtsmaske zu suchen ... jb 13.11.2008 |
|
767 |
if ($form->{addr_street}) { |
|
768 |
$where .= qq| AND (street ILIKE ?)|; |
|
769 |
push @values, ('%' . $form->{addr_street} . '%'); |
|
770 |
} |
|
771 |
|
|
772 |
# Um nach PLZ in der Berichtsmaske zu suchen ... jb 13.11.2008 |
|
773 |
if ($form->{addr_zipcode}) { |
|
774 |
$where .= qq| AND (zipcode ILIKE ?)|; |
|
775 |
push @values, ($form->{addr_zipcode} . '%'); |
|
776 |
} |
|
753 | 777 |
my $query = |
754 | 778 |
qq|SELECT ct.*, b.description AS business | . |
755 | 779 |
qq|FROM $cv ct | . |
... | ... | |
815 | 839 |
$query .= qq| ORDER BY $sortorder|; |
816 | 840 |
|
817 | 841 |
$form->{CT} = selectall_hashref_query($form, $dbh, $query, @values); |
818 |
map({ my $ref = $_; $ref->{address} = join(" ", map({ $ref->{$_} } qw(street zipcode city country))); } |
|
819 |
@{ $form->{CT} }); |
|
820 | 842 |
|
821 | 843 |
$main::lxdebug->leave_sub(); |
822 | 844 |
} |
Auch abrufbar als: Unified diff
Stammdaten
> Berichte -> Kunden -> Suchfeld | Das zusammengefasst Adressfeld (Straße PLZ Ort) wieder in die Einzelkomponenten aufgeteilt. Zusätzlich die Suche um den Nachnamen des Ansprechpartners ergänzt. Die 'In Bericht aufnehmen'-Felder um Straße, PLZ, Ort zusammenhängend rechts ergänzt. Das unnötige SIC-Ankreuzfeld rausgeworfen, überhaupt alle sic_code-Einträge entrümpelt und wo wir schon mal dabei sind auch gleich die Tabellen in der DB gelöscht bzw. angepasst (hoffentlich vermisst die keiner ... ;)). Im Bonuslevel noch einen fehlerhaften HTML-div-Tag in der Suchmaske entsorgt.