[freeside-commits] branch master updated. d1ef14dc43b37960ce08aae9b795b593a24cdc15

Mark Wells mark at 420.am
Tue Jun 18 23:24:31 PDT 2013


The branch, master has been updated
       via  d1ef14dc43b37960ce08aae9b795b593a24cdc15 (commit)
      from  811e59bef46fb10d713f7ed5b81183ed1293072a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d1ef14dc43b37960ce08aae9b795b593a24cdc15
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jun 18 23:24:17 2013 -0700

    fix manual entry of census tract when editing location, #23643

diff --git a/httemplate/edit/cust_location.cgi b/httemplate/edit/cust_location.cgi
index b90ba66..93ce323 100755
--- a/httemplate/edit/cust_location.cgi
+++ b/httemplate/edit/cust_location.cgi
@@ -18,6 +18,7 @@ ACTION="<% $p %>edit/process/cust_location.cgi" METHOD=POST>
 <& /elements/standardize_locations.html,
             'form'          => 'EditLocationForm',
             'callback'      => 'document.EditLocationForm.submit();',
+            'with_census'   => 1,
 &>
 </TABLE>
 
@@ -31,6 +32,10 @@ function go() {
     document.EditLocationForm.submit();
 % }
 }
+
+function submit_abort() {
+  nd(1);
+}
 </SCRIPT>
 <INPUT TYPE="button" NAME="submitButton" VALUE="Submit" onclick="go()">
 </FORM>
diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js
index e98039d..d7c3670 100644
--- a/httemplate/elements/standardize_locations.js
+++ b/httemplate/elements/standardize_locations.js
@@ -11,13 +11,13 @@ function form_address_info() {
 % if ( $billship ) {
   returnobj['same'] = cf.elements['same'].checked;
 % }
-% if ( $withfirm ) {
-% # not part of either address, really
-  returnobj['company'] = cf.elements['company'].value;
-% }
 % if ( $withcensus ) {
 % # "entered" censustract always goes with the ship_ address if there is one
-  returnobj['ship_censustract'] = cf.elements['enter_censustract'].value;
+%   if ( $billship ) {
+    returnobj['ship_censustract'] = cf.elements['enter_censustract'].value;
+%   } else { # there's only a package address, so it's just "censustract"
+    returnobj['censustract'] = cf.elements['enter_censustract'].value;
+%   }
 % }
 % for my $pre (@prefixes) {
   if ( <% $pre eq 'ship_' ? 1 : 0 %> && returnobj['same'] ) {
@@ -78,6 +78,7 @@ function standardize_locations() {
 % # censustract so that we don't ask the user to confirm it again.
 
   if ( !changed && <% $withcensus %> ) {
+%   if ( $billship ) {
     if ( address_info['same'] ) {
       cf.elements['bill_censustract'].value =
         address_info['bill_censustract'];
@@ -85,6 +86,10 @@ function standardize_locations() {
       cf.elements['ship_censustract'].value =
         address_info['ship_censustract'];
     }
+%   } else {
+      cf.elements['censustract'].value =
+        address_info['censustract'];
+%   }
   }
 
 % if ( $conf->config('address_standardize_method') ) {
@@ -176,6 +181,7 @@ function confirm_manual_address() {
 %# not much to do in this case, just confirm the censustract
 % if ( $withcensus ) {
   var cf = document.<% $formname %>;
+%   if ( $billship ) {
   if ( cf.elements['same'] && cf.elements['same'].checked ) {
     cf.elements['bill_censustract'].value =
       cf.elements['enter_censustract'].value;
@@ -183,6 +189,9 @@ function confirm_manual_address() {
     cf.elements['ship_censustract'].value =
       cf.elements['enter_censustract'].value;
   }
+%   } else {
+  cf.elements['censustract'].value = cf.elements['enter_censustract'].value;
+%   }
 % }
   post_standardization();
 }
@@ -277,12 +286,13 @@ function setselect(el, value) {
 my %opt = @_;
 my $conf = new FS::Conf;
 
-my $withfirm = $opt{'with_firm'} ? 1 : 0;
 my $withcensus = $opt{'with_census'} ? 1 : 0;
 
 my @prefixes = '';
 my $billship = $opt{'billship'} ? 1 : 0; # whether to have bill_ and ship_ prefixes
 my $taxpre = '';
+# probably should just geocode both addresses, since either one could
+# be a package address in the future
 if ($billship) {
   @prefixes = qw(bill_ ship_);
   $taxpre = $conf->exists('tax-ship_address') ? 'ship_' : 'bill_';
diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html
index 780bf96..e1fa825 100644
--- a/httemplate/elements/tr-select-cust_location.html
+++ b/httemplate/elements/tr-select-cust_location.html
@@ -209,6 +209,7 @@ Example:
              'no_bold'      => $opt{'no_bold'},
              'alt_format'   => $opt{'alt_format'},
              'enable_coords'=> 1,
+             'enable_censustract' => 1,
           )
 %>
 <SCRIPT TYPE="text/javascript">
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
index e09ba98..3973442 100644
--- a/httemplate/misc/order_pkg.html
+++ b/httemplate/misc/order_pkg.html
@@ -134,8 +134,9 @@
 % unless ( $cgi->param('lock_locationnum') ) {
 
   <& /elements/standardize_locations.html,
-                'form'       => "OrderPkgForm",
-                'callback'   => 'document.OrderPkgForm.submit();',
+                'form'        => "OrderPkgForm",
+                'callback'    => 'document.OrderPkgForm.submit();',
+                'with_census' => 1,
   &>
 
 % }
diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html
index 470fad0..ab961b7 100644
--- a/httemplate/view/cust_main/packages/location.html
+++ b/httemplate/view/cust_main/packages/location.html
@@ -65,6 +65,8 @@ sub pkg_change_location_link {
     'label'       => emt('Change location'),
     'actionlabel' => emt('Change'),
     'cust_pkg'    => $cust_pkg,
+    'width'       => 763,
+    'height'      => 380,
   );
 }
 
@@ -74,7 +76,9 @@ sub edit_location_link {
     'action'      => $p. "edit/cust_location.cgi?locationnum=$locationnum",
     'label'       => emt('Edit location'),
     'actionlabel' => emt('Edit'),
-  );
+    'width'       => 700,
+    'height'      => 355,
+   );
 }
 
 </%init>
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 78d3a88..7aad9a4 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -262,6 +262,8 @@ sub pkg_change_link {
     'label'       => emt('Change package'),
     'actionlabel' => emt('Change'),
     'cust_pkg'    => $cust_pkg,
+    'width'       => 763,
+    'height'      => 380,
   );
 }
 
@@ -275,6 +277,8 @@ sub pkg_change_location_link {
     'label'       => emt('Change location'),
     'actionlabel' => emt('Change'),
     'cust_pkg'    => $cust_pkg,
+    'width'       => 763,
+    'height'      => 380,
   );
 }
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/edit/cust_location.cgi                |    5 +++++
 httemplate/elements/standardize_locations.js     |   22 ++++++++++++++++------
 httemplate/elements/tr-select-cust_location.html |    1 +
 httemplate/misc/order_pkg.html                   |    5 +++--
 httemplate/view/cust_main/packages/location.html |    6 +++++-
 httemplate/view/cust_main/packages/package.html  |    4 ++++
 6 files changed, 34 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list