From cb0b8c862de7c7ab68b172faa29167f47894627b Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 22 Sep 2010 21:22:03 +0000 Subject: customer credit limits, RT#8209 --- httemplate/edit/cust_main/billing.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index ad83778ca..aeb67b662 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -417,6 +417,18 @@ %> + + Credit limit + + + credit_limit) %><% length($cust_main->credit_limit) ? '' : ' DISABLED' %>> + credit_limit) ? '' : ' CHECKED'%>> Unlimited + + % if ( $conf->exists('voip-cust_cdr_spools') ) { -- cgit v1.2.1 From b76d8cd6704292a90d71bfea31859ed22e2fa23f Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Oct 2010 00:26:24 +0000 Subject: add lock_agentnum and lock_pkgpart parameters to new customer page, RT#9782 --- .../edit/cust_main/first_pkg/select-part_pkg.html | 4 ++- httemplate/edit/cust_main/top_misc.html | 32 ++++++++++++++++------ 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/first_pkg/select-part_pkg.html b/httemplate/edit/cust_main/first_pkg/select-part_pkg.html index 871e1cdee..20f0e1982 100644 --- a/httemplate/edit/cust_main/first_pkg/select-part_pkg.html +++ b/httemplate/edit/cust_main/first_pkg/select-part_pkg.html @@ -147,7 +147,9 @@ foreach my $part_pkg ( @part_pkg ) { $layermap{$pkgpart_svcpart} = $svcdb{$pkgpart}; } -my @options = ( '', map $pkgpart_svcpart{ $_->pkgpart }, @part_pkg ); +my @options = (); +push @options, '' unless $opt{'disable_empty'}; +push @options, map $pkgpart_svcpart{ $_->pkgpart }, @part_pkg; my %labels = ( '' => ( $opt{'empty_label'} || '(none)' ), map { $pkgpart_svcpart{ $_->pkgpart } => $_->pkg_comment } @part_pkg diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index 441a36334..a2381f368 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -8,14 +8,30 @@ %> %# agent -<% include('/elements/tr-select-agent.html', - 'curr_value' => $cust_main->agentnum, - 'label' => "${r}Agent", - 'empty_label' => 'Select agent', - 'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ), - 'viewall_right' => 'None', #override default 'View customers of all agents' - ) -%> +% if ( $cgi->param('lock_agentnum') =~ /^(\d+)$/ && $curuser->agentnum($1) ) { +% +% my $agentnum = $1; +% $cust_main->agentnum($agentnum); + + + + + Agent + <% $cust_main->agent->agent |h %> + + +% } else { + + <% include('/elements/tr-select-agent.html', + 'curr_value' => $cust_main->agentnum, + 'label' => "${r}Agent", + 'empty_label' => 'Select agent', + 'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ), + 'viewall_right' => 'None', #override default 'View customers of all agents' + ) + %> + +% } %# agent_custid % if ( $conf->exists('cust_main-edit_agent_custid') ) { -- cgit v1.2.1 From 5f3c29a2151a7054c6dd492bedcc1891e24d7620 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 11 Oct 2010 09:36:58 +0000 Subject: add lock_agentnum and lock_pkgpart parameters to new customer page, RT#9782 --- httemplate/edit/cust_main/first_pkg.html | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/first_pkg.html b/httemplate/edit/cust_main/first_pkg.html index 0de33c025..7c131eadc 100644 --- a/httemplate/edit/cust_main/first_pkg.html +++ b/httemplate/edit/cust_main/first_pkg.html @@ -1,3 +1,9 @@ +% if ( $cgi->param('lock_pkgpart') =~ /^([\d, ]+)$/ ) { + + + +% } +% % if ( @part_pkg ) {

@@ -28,6 +34,11 @@ if ( scalar(@agents) == 1 ) { # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART $pkgpart = $agents[0]->pkgpart_hashref; $agentnum = $agents[0]->agentnum; +} elsif ( $cgi->param('lock_agentnum') =~ /^(\d+)$/ + && $FS::CurrentUser::CurrentUser->agentnum($1) ) { + $agentnum = $1; + my $agent = (grep { $_->agentnum == $agentnum } @agents)[0]; + $pkgpart = $agent->pkgpart_hashref; } else { #can't know (agent not chosen), so, allow all $agentnum = 'all'; @@ -39,9 +50,28 @@ if ( scalar(@agents) == 1 ) { } #eslaf +my @part_pkg = (); +if ( $cgi->param('lock_pkgpart') =~ /^([\d, ]+)$/ ) { + + my $lock_pkgpart = $1; + + @part_pkg = qsearch({ + 'table' => 'part_pkg', + 'hashref' => { 'disabled' => '' }, + 'extra_sql' => "AND pkgpart IN ($lock_pkgpart)", + 'order_by' => 'ORDER BY pkg', # case? + }); + +} else { + + @part_pkg = + qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case? + +} + my @first_svc = ( 'svc_acct', 'svc_phone' ); -my @part_pkg = +@part_pkg = grep { $_->svcpart(\@first_svc) && ( $pkgpart->{ $_->pkgpart } || $agentnum eq 'all' @@ -50,6 +80,6 @@ my @part_pkg = ) ) } - qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case? + @part_pkg; -- cgit v1.2.1 From eec4949e2c8f09a0b89331437186b77c4db6ff38 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 11 Oct 2010 19:00:33 +0000 Subject: external taxes support package locations RT10093 --- httemplate/edit/cust_main/bottomfixup.js | 326 +------------------------------ 1 file changed, 5 insertions(+), 321 deletions(-) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 5d06f3c04..4d9ef070d 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -20,223 +20,14 @@ function bottomfixup(what) { } //this part does USPS address correction - - // XXX should this be first and should we update the form fields that are - // displayed??? - - var cf = document.CustomerForm; - - var state_el = cf.elements['state']; - var ship_state_el = cf.elements['ship_state']; - - //address_standardize( - var cust_main = new Array( - 'company', cf.elements['company'].value, - 'address1', cf.elements['address1'].value, - 'address2', cf.elements['address2'].value, - 'city', cf.elements['city'].value, - 'state', state_el.options[ state_el.selectedIndex ].value, - 'zip', cf.elements['zip'].value, - - 'ship_company', cf.elements['ship_company'].value, - 'ship_address1', cf.elements['ship_address1'].value, - 'ship_address2', cf.elements['ship_address2'].value, - 'ship_city', cf.elements['ship_city'].value, - 'ship_state', ship_state_el.options[ ship_state_el.selectedIndex ].value, - 'ship_zip', cf.elements['ship_zip'].value - ); - - address_standardize( cust_main, update_address ); - -} - -var standardize_address; - -function update_address(arg) { - - var argsHash = eval('(' + arg + ')'); - - var changed = argsHash['address_standardized']; - var ship_changed = argsHash['ship_address_standardized']; - var error = argsHash['error']; - var ship_error = argsHash['ship_error']; - - - //yay closures - standardize_address = function () { - - var cf = document.CustomerForm; - var state_el = cf.elements['state']; - var ship_state_el = cf.elements['ship_state']; - - if ( changed ) { - cf.elements['company'].value = argsHash['new_company']; - cf.elements['address1'].value = argsHash['new_address1']; - cf.elements['address2'].value = argsHash['new_address2']; - cf.elements['city'].value = argsHash['new_city']; - setselect(cf.elements['state'], argsHash['new_state']); - cf.elements['zip'].value = argsHash['new_zip']; - } - - if ( ship_changed ) { - cf.elements['ship_company'].value = argsHash['new_ship_company']; - cf.elements['ship_address1'].value = argsHash['new_ship_address1']; - cf.elements['ship_address2'].value = argsHash['new_ship_address2']; - cf.elements['ship_city'].value = argsHash['new_ship_city']; - setselect(cf.elements['ship_state'], argsHash['new_ship_state']); - cf.elements['ship_zip'].value = argsHash['new_ship_zip']; - } - - post_standardization(); - - } - - - - if ( changed || ship_changed ) { - -% if ( $conf->exists('cust_main-auto_standardize_address') ) { - - standardize_address(); - -% } else { - - // popup a confirmation popup - - var confirm_change = - '

Confirm address standardization

' + - ''; - - if ( changed ) { - - confirm_change = confirm_change + - '' + - ''; - // + ''; - - if ( argsHash['company'] || argsHash['new_company'] ) { - confirm_change = confirm_change + - ''; - } - - confirm_change = confirm_change + - '' + - '' + - '' + - ''; - - } - - if ( ship_changed ) { - - confirm_change = confirm_change + - '' + - ''; - // + ''; - - if ( argsHash['ship_company'] || argsHash['new_ship_company'] ) { - confirm_change = confirm_change + - ''; - } - - confirm_change = confirm_change + - '' + - '' + - '' + - ''; - - } - - var addresses = 'address'; - var height = 268; - if ( changed && ship_changed ) { - addresses = 'addresses'; - height = 396; // #what - } - - confirm_change = confirm_change + - '' + - '' + - - '
Entered billing addressStandardized billing address
  
' + argsHash['company'] + - '' + argsHash['new_company'] + '
' + argsHash['address1'] + - '' + argsHash['new_address1'] + '
' + argsHash['address2'] + - '' + argsHash['new_address2'] + '
' + argsHash['city'] + ', ' + argsHash['state'] + ' ' + argsHash['zip'] + - '' + argsHash['new_city'] + ', ' + argsHash['new_state'] + ' ' + argsHash['new_zip'] + '
  
Entered service addressStandardized service address
  
' + argsHash['ship_company'] + - '' + argsHash['new_ship_company'] + '
' + argsHash['ship_address1'] + - '' + argsHash['new_ship_address1'] + '
' + argsHash['ship_address2'] + - '' + argsHash['new_ship_address2'] + '
' + argsHash['ship_city'] + ', ' + argsHash['ship_state'] + ' ' + argsHash['ship_zip'] + - '' + argsHash['new_ship_city'] + ', ' + argsHash['new_ship_state'] + ' ' + argsHash['new_ship_zip'] + '
  
' + - '' + - '' + - '' + - '
' + - '
'; - - overlib( confirm_change, CAPTION, 'Confirm address standardization', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, height, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); - -% } - - } else { - - post_standardization(); - - } - + standardize_locations(); } -function post_standardization() { - - var cf = document.CustomerForm; - -% if ( $conf->exists('enable_taxproducts') ) { - - if ( new String(cf.elements['<% $taxpre %>zip'].value).length < 10 ) - { - - var country_el = cf.elements['<% $taxpre %>country']; - var country = country_el.options[ country_el.selectedIndex ].value; - var geocode = cf.elements['geocode'].value; - - if ( country == 'CA' || country == 'US' ) { - - var state_el = cf.elements['<% $taxpre %>state']; - var state = state_el.options[ state_el.selectedIndex ].value; - - var url = "cust_main/choose_tax_location.html" + - "?data_vendor=cch-zip" + - ";city=" + cf.elements['<% $taxpre %>city'].value + - ";state=" + state + - ";zip=" + cf.elements['<% $taxpre %>zip'].value + - ";country=" + country + - ";geocode=" + geocode + - ";"; - - // popup a chooser - OLgetAJAX( url, update_geocode, 300 ); - - } else { - - cf.elements['geocode'].value = 'DEFAULT'; - post_geocode(); - - } - - } else { - - cf.elements['geocode'].value = ''; - post_geocode(); - - } - -% } else { - - post_geocode(); - -% } - -} +<% include( '/elements/standardize_locations.js', + 'callback', 'post_geocode();' + ) +%> function post_geocode() { @@ -263,102 +54,6 @@ function post_geocode() { } -function update_geocode() { - - //yay closures - set_geocode = function (what) { - - var cf = document.CustomerForm; - - //alert(what.options[what.selectedIndex].value); - var argsHash = eval('(' + what.options[what.selectedIndex].value + ')'); - cf.elements['<% $taxpre %>city'].value = argsHash['city']; - setselect(cf.elements['<% $taxpre %>state'], argsHash['state']); - cf.elements['<% $taxpre %>zip'].value = argsHash['zip']; - cf.elements['geocode'].value = argsHash['geocode']; - post_geocode(); - - } - - // popup a chooser - - overlib( OLresponseAJAX, CAPTION, 'Select tax location', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); - -} - -var set_censustract; - -function update_censustract(arg) { - - var argsHash = eval('(' + arg + ')'); - - var cf = document.CustomerForm; - - var msacode = argsHash['msacode']; - var statecode = argsHash['statecode']; - var countycode = argsHash['countycode']; - var tractcode = argsHash['tractcode']; - var error = argsHash['error']; - - var newcensus = - new String(statecode) + - new String(countycode) + - new String(tractcode).replace(/\s$/, ''); // JSON 1 workaround - - set_censustract = function () { - - cf.elements['censustract'].value = newcensus - cf.submit(); - - } - - if (error || cf.elements['censustract'].value != newcensus) { - // popup an entry dialog - - if (error) { newcensus = error; } - newcensus.replace(/.*ndefined.*/, 'Not found'); - - var choose_censustract = - '

Confirm censustract
' + - 'Map service module location
' + - 'Map zip code center

' + - ''; - - choose_censustract = choose_censustract + - '' + - '' + - '' + - ''; - - choose_censustract = choose_censustract + - '' + - '' + - - '
Entered census tractCalculated census tract
' + cf.elements['censustract'].value + - '' + newcensus + '
  
' + - '' + - '' + - '' + - '
' + - '
'; - - overlib( choose_censustract, CAPTION, 'Confirm censustract', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); - - } else { - - cf.submit(); - - } - -} - function copyelement(from, to) { if ( from == undefined ) { to.value = ''; @@ -381,19 +76,8 @@ function copyelement(from, to) { //alert(from + " (" + from.type + "): " + to.name + " => " + to.value); } -function setselect(el, value) { - - for ( var s = 0; s < el.options.length; s++ ) { - if ( el.options[s].value == value ) { - el.selectedIndex = s; - } - } - -} <%init> my $conf = new FS::Conf; -my $taxpre = $conf->exists('tax-ship_address') ? 'ship_' : ''; - -- cgit v1.2.1 From 3d301812d64b72b65c651fb8cbf81b6f9e65dc93 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 14 Oct 2010 20:45:35 +0000 Subject: restore update_censustract RT10221 --- httemplate/edit/cust_main/bottomfixup.js | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 4d9ef070d..942fc0e66 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -54,6 +54,79 @@ function post_geocode() { } +var set_censustract; + +function update_censustract(arg) { + + var argsHash = eval('(' + arg + ')'); + + var cf = document.CustomerForm; + + var msacode = argsHash['msacode']; + var statecode = argsHash['statecode']; + var countycode = argsHash['countycode']; + var tractcode = argsHash['tractcode']; + var error = argsHash['error']; + + var newcensus = + new String(statecode) + + new String(countycode) + + new String(tractcode).replace(/\s$/, ''); // JSON 1 workaround + + set_censustract = function () { + + cf.elements['censustract'].value = newcensus + cf.submit(); + + } + + if (error || cf.elements['censustract'].value != newcensus) { + // popup an entry dialog + + if (error) { newcensus = error; } + newcensus.replace(/.*ndefined.*/, 'Not found'); + + var choose_censustract = + '

Confirm censustract
' + + 'Map service module location
' + + 'Map zip code center

' + + ''; + + choose_censustract = choose_censustract + + '' + + '' + + '' + + ''; + + choose_censustract = choose_censustract + + '' + + '' + + + '
Entered census tractCalculated census tract
' + cf.elements['censustract'].value + + '' + newcensus + '
  
' + + '' + + '' + + '' + + '
' + + '
'; + + overlib( choose_censustract, CAPTION, 'Confirm censustract', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); + + } else { + + cf.submit(); + + } + +} + function copyelement(from, to) { if ( from == undefined ) { to.value = ''; -- cgit v1.2.1 From 82de9040b2d99c05060be6396bab8bd74db96f6c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 2 Nov 2010 00:28:13 +0000 Subject: fix for uumlaut problem, RT#10359 --- httemplate/edit/cust_main/contact.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index feb61db8d..99bc558c3 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -3,8 +3,8 @@ <%$r%>Contact name
(last, first) - <%$style%>> , - <%$style%>> + <%$style%>> , + <%$style%>> % if ( $conf->exists('show_ss') && !$pre ) { @@ -21,7 +21,7 @@ Company - <%$style%>> + <%$style%>> -- cgit v1.2.1 From 8d421ec3cb2697a0fcc75db12a8975a2d92cf25f Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 5 Nov 2010 18:32:57 +0000 Subject: fix more german character problems, RT#10498 --- httemplate/edit/cust_main/billing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/cust_main') diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index aeb67b662..d12198211 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -240,7 +240,7 @@ % qq!!. % % qq!Attention !. -% qq!!. +% qq!!. % % ' '. % ' '. -- cgit v1.2.1