[freeside-commits] freeside/httemplate/elements tr-select-cust_location.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Sun Jan 18 22:36:27 PST 2009


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv25806/httemplate/elements

Modified Files:
	tr-select-cust_location.html 
Log Message:
default service location is cust_main ship_ address when present!  RT#4499

Index: tr-select-cust_location.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-cust_location.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tr-select-cust_location.html	10 Jan 2009 23:56:59 -0000	1.2
+++ tr-select-cust_location.html	19 Jan 2009 06:36:25 -0000	1.3
@@ -42,16 +42,16 @@
     } else {
 
       if ( locationnum == 0 ) {
-        what.form.address1.value = <% $cust_main->address1 |js_string %>;
-        what.form.address2.value = <% $cust_main->address2 |js_string %>;
-        what.form.city.value = <% $cust_main->city |js_string %>;
-        what.form.zip.value = <% $cust_main->zip |js_string %>;
+        what.form.address1.value = <% $cust_main->get($prefix.'address1') |js_string %>;
+        what.form.address2.value = <% $cust_main->get($prefix.'address2') |js_string %>;
+        what.form.city.value = <% $cust_main->get($prefix.'city') |js_string %>;
+        what.form.zip.value = <% $cust_main->get($prefix.'zip') |js_string %>;
 
-        changeSelect(what.form.country, <% $cust_main->country | js_string %> );
+        changeSelect(what.form.country, <% $cust_main->get($prefix.'country') | js_string %> );
 
         country_changed( what.form.country,
-                         fix_state_factory( <% $cust_main->state | js_string %>,
-                                            <% $cust_main->county | js_string %>
+                         fix_state_factory( <% $cust_main->get($prefix.'state') | js_string %>,
+                                            <% $cust_main->get($prefix.'county') | js_string %>
                                           )
                        );
 
@@ -158,6 +158,8 @@
 my $cgi       = $opt{'cgi'};
 my $cust_main = $opt{'cust_main'};
 
+my $prefix = length($cust_main->ship_last) ? 'ship_' : '';
+
 $cgi->param('locationnum') =~ /^(\-?\d*)$/ or die "illegal locationnum";
 my $locationnum = $1;
 my $cust_location;
@@ -169,7 +171,7 @@
   if ( $locationnum == -1 ) {
     $cust_location->$_( $cgi->param($_) ) foreach @location_fields;
   } else {
-    $cust_location->$_( $cust_main->$_() ) foreach @location_fields;
+    $cust_location->$_( $cust_main->get($prefix.$_) foreach @location_fields;
   }
 }
 



More information about the freeside-commits mailing list