Bei Lieferanschrift-Drop-Down auch die Straße und den Ort anzeigen.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 1 Sep 2008 08:50:59 +0000 (08:50 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 1 Sep 2008 08:50:59 +0000 (08:50 +0000)
SL/CT.pm
bin/mozilla/ct.pl

index a82620d..3252fe8 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -155,8 +155,9 @@ sub populate_drop_down_boxes {
 
   # get shipto address
   $query =
-    qq|SELECT shipto_id, shiptoname, shiptodepartment_1 | .
-    qq|FROM shipto WHERE (trans_id = ?) AND (module = 'CT')|;
+    qq|SELECT shipto_id, shiptoname, shiptodepartment_1, shiptostreet, shiptocity
+       FROM shipto
+       WHERE (trans_id = ?) AND (module = 'CT')|;
   $form->{SHIPTO} = selectall_hashref_query($form, $dbh, $query, $form->{id});
 
   # get contacts
index 3b8a459..928a6ef 100644 (file)
@@ -273,7 +273,7 @@ sub form_header {
   $form->{is_admin}       = $myconfig{role} eq 'admin';
   $form->{is_customer}    = $form->{db}     eq 'customer';
   $form->{salesman_label} = sub { $_[0]->{name} ne "" ? $_[0]->{name} : $_[0]->{login} };
-  $form->{shipto_label}   = sub { "$_[0]->{shiptoname} $_[0]->{shiptodepartment_1}" };
+  $form->{shipto_label}   = sub { my $s = shift(@_); join('; ', grep { $_ } map { $s->{"shipto$_"} } qw(name department_1 street city)) || ' ' };
   $form->{contacts_label} = sub { join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname} };
   $form->{taxzone_id}     = 0                                                               if !$form->{id};
   $form->{jsscript}       = 1;