diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-01-24 00:39:53 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-01-24 00:39:53 -0800 |
commit | 8d6ea7d8fddec3fd471a0e68f297d20e191c6f11 (patch) | |
tree | 9275a4f7ccaf32b07a5ba14cbe513d10e30617e1 /httemplate/edit | |
parent | f3ac48703be75c0e2aec161487057eafeb8fc74f (diff) | |
parent | 777a6997a004dc4ea99bccabe494f77f114db1a3 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 2 | ||||
-rw-r--r-- | httemplate/edit/cust_main/bottomfixup.js | 29 | ||||
-rw-r--r-- | httemplate/edit/invoice_conf.html | 32 | ||||
-rw-r--r-- | httemplate/edit/process/quick-cust_pkg.cgi | 2 |
4 files changed, 26 insertions, 39 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 480047cae..629c8081d 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -53,6 +53,8 @@ <& /elements/location.html, object => $cust_main->bill_location, prefix => 'bill_', + enable_censustract => 1, + enable_district => 1, enable_coords => 1, &> <& cust_main/after_bill_location.html, $cust_main &> diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index ecfcb3cbc..5a8835f53 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -7,7 +7,7 @@ my $company_longitude = $conf->config('company_longitude'); my @fixups = ('copy_payby_fields', 'standardize_locations'); -push @fixups, 'confirm_censustract' +push @fixups, 'confirm_censustract_bill', 'confirm_censustract_ship' if $conf->exists('cust_main-require_censustract'); my $uniqueness = $conf->config('cust_main-check_unique'); @@ -101,14 +101,17 @@ function copyelement(from, to) { } % # the value in pre+'censustract' is the confirmed censustract; if it's set, -% # do nothing here -function confirm_censustract() { +% # and the user hasn't changed it manually, skip this +function confirm_censustract(pre) { var cf = document.CustomerForm; - var pre = cf.elements['same'].checked ? 'bill_' : 'ship_'; - if ( cf.elements[pre+'censustract'].value == '' ) { + if ( cf.elements[pre+'censustract'].value == '' || + cf.elements[pre+'enter_censustract'].value != + cf.elements[pre+'censustract'].value ) + { var address_info = form_address_info(); address_info[pre+'latitude'] = cf.elements[pre+'latitude'].value; address_info[pre+'longitude'] = cf.elements[pre+'longitude'].value; + address_info['prefix'] = pre; OLpostAJAX( '<%$p%>/misc/confirm-censustract.html', 'q=' + encodeURIComponent(JSON.stringify(address_info)), @@ -121,14 +124,22 @@ function confirm_censustract() { 0); } else submit_continue(); } +function confirm_censustract_bill() { + confirm_censustract('bill_'); +} -%# called from confirm-censustract.html -function set_censustract(tract, year) { +function confirm_censustract_ship() { var cf = document.CustomerForm; - var pre = 'ship_'; if ( cf.elements['same'].checked ) { - pre = 'bill_'; + submit_continue(); + } else { + confirm_censustract('ship_'); } +} + +%# called from confirm-censustract.html +function set_censustract(tract, year, pre) { + var cf = document.CustomerForm; cf.elements[pre + 'censustract'].value = tract; cf.elements[pre + 'censusyear'].value = year; submit_continue(); diff --git a/httemplate/edit/invoice_conf.html b/httemplate/edit/invoice_conf.html index b7b3a4ebc..7122653f2 100644 --- a/httemplate/edit/invoice_conf.html +++ b/httemplate/edit/invoice_conf.html @@ -49,14 +49,8 @@ my @fields = ( 'Footer', 'Summary header', 'Return address', - 'Coupon', 'Small footer', - 'Top margin', - 'Header separation', - 'Address separation', - 'Text height', - 'Coupon height', - 'Footer separation', + 'Enable coupon', ), { type => 'columnnext' }, @@ -65,19 +59,8 @@ my @fields = ( { field => 'latexfooter', %textarea }, { field => 'latexsummary', %textarea }, { field => 'latexreturnaddress', %textarea }, - { field => 'latexcoupon', %textarea }, { field => 'latexsmallfooter', %textarea }, - { field => 'latextopmargin', size => 16 }, - { field => 'latexheadsep', size => 16 }, - { field => 'latexaddresssep', size => 16 }, - { field => 'latextextheight', size => 16 }, - { field => 'latexextracouponspace', size => 16 }, - { field => 'latexcouponfootsep', size => 16 }, - # are these still used? - #{ field => 'latexcouponamountenclosedsep', size => 16 }, - #{ field => 'latexverticalreturnaddress', type => 'checkbox' }, - #{ field => 'latexcouponaddcompanytoaddress',type => 'checkbox' }, - # logo -- implement if someone really needs it... + { field => 'with_latexcoupon', type => 'checkbox', value => 'Y' }, { type => 'columnnext' }, { type => 'title', value => 'HTML' }, @@ -104,20 +87,12 @@ my %labels = ( latexfooter latexsummary latexreturnaddress - latexcoupon + with_latexcoupon latexsmallfooter - latextopmargin - latexheadsep - latexaddresssep - latextextheight - latexextracouponspace - latexcouponfootsep htmlnotes htmlfooter htmlsummary htmlreturnaddress - logo_png - logo_eps ) ), ); @@ -211,7 +186,6 @@ sub edit_callback { or die "invoice mode $modenum not found"; $object->set('modename', $invoice_mode->modename); $object->set('agentnum', $invoice_mode->agentnum); - } sub menubar_opt_callback { diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 95c92432e..c3ab6fec3 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -134,7 +134,7 @@ my %hash = ( $hash{'custnum'} = $cust_main->custnum if $cust_main; my @cust_pkg_usageprice = (); -foreach my $quantity_param ( grep ( $cgi->param($_) && $cgi->param($_) > 0 ), +foreach my $quantity_param ( grep { $cgi->param($_) && $cgi->param($_) > 0 } grep /^usagepricenum(\d+)_quantity$/, $cgi->param ) |