From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/edit/REAL_cust_pkg.cgi | 220 +++--- httemplate/edit/access_group.html | 2 +- httemplate/edit/access_user.html | 2 +- httemplate/edit/agent.cgi | 114 +-- httemplate/edit/agent_payment_gateway.html | 86 ++- httemplate/edit/agent_type.cgi | 58 +- httemplate/edit/bulk-cust_svc.html | 96 +-- httemplate/edit/cust_bill_pay.cgi | 109 +-- httemplate/edit/cust_credit.cgi | 88 +-- httemplate/edit/cust_credit_bill.cgi | 121 +-- httemplate/edit/cust_main.cgi | 464 +++++------ httemplate/edit/cust_main/billing.html | 631 +++++++-------- httemplate/edit/cust_main/contact.html | 141 ++-- httemplate/edit/cust_main/select-country.html | 59 +- httemplate/edit/cust_main/select-county.html | 82 +- httemplate/edit/cust_main/select-state.html | 25 +- httemplate/edit/cust_main_county-expand.cgi | 105 +-- httemplate/edit/cust_main_county.cgi | 193 ++--- httemplate/edit/cust_pay.cgi | 174 +++-- httemplate/edit/cust_pkg.cgi | 210 ++--- httemplate/edit/cust_refund.cgi | 185 ++--- httemplate/edit/elements/edit.html | 298 +++---- httemplate/edit/elements/svc_Common.html | 33 +- httemplate/edit/inventory_class.html | 2 +- httemplate/edit/msgcat.cgi | 113 +-- httemplate/edit/part_bill_event.cgi | 740 +++++++++--------- httemplate/edit/part_export.cgi | 220 +++--- httemplate/edit/part_pkg.cgi | 537 ++++++------- httemplate/edit/part_referral.html | 2 +- httemplate/edit/part_svc.cgi | 853 +++++++++++---------- httemplate/edit/part_virtual_field.cgi | 115 +-- httemplate/edit/payment_gateway.html | 164 ++-- httemplate/edit/pkg_class.html | 2 +- httemplate/edit/prepay_credit.cgi | 72 +- httemplate/edit/process/REAL_cust_pkg.cgi | 67 +- httemplate/edit/process/access_group.html | 2 +- httemplate/edit/process/access_user.html | 2 +- httemplate/edit/process/addr_block/add.cgi | 39 +- httemplate/edit/process/addr_block/allocate.cgi | 49 +- httemplate/edit/process/addr_block/deallocate.cgi | 47 +- httemplate/edit/process/addr_block/split.cgi | 37 +- httemplate/edit/process/agent.cgi | 55 +- httemplate/edit/process/agent_payment_gateway.html | 51 +- httemplate/edit/process/agent_type.cgi | 71 +- httemplate/edit/process/bulk-cust_svc.cgi | 7 +- httemplate/edit/process/cust_bill_pay.cgi | 93 +-- httemplate/edit/process/cust_credit.cgi | 61 +- httemplate/edit/process/cust_credit_bill.cgi | 95 +-- httemplate/edit/process/cust_main.cgi | 305 ++++---- .../edit/process/cust_main_county-collapse.cgi | 69 +- .../edit/process/cust_main_county-expand.cgi | 115 +-- httemplate/edit/process/cust_main_county.cgi | 59 +- httemplate/edit/process/cust_pay.cgi | 98 +-- httemplate/edit/process/cust_pkg.cgi | 85 +- httemplate/edit/process/cust_refund.cgi | 83 +- httemplate/edit/process/cust_svc.cgi | 60 +- httemplate/edit/process/domain_record.cgi | 64 +- httemplate/edit/process/elements/process.html | 181 ++--- httemplate/edit/process/elements/svc_Common.html | 17 +- httemplate/edit/process/generic.cgi | 139 ++-- httemplate/edit/process/inventory_class.html | 2 +- httemplate/edit/process/msgcat.cgi | 39 +- httemplate/edit/process/part_bill_event.cgi | 105 +-- httemplate/edit/process/part_export.cgi | 77 +- httemplate/edit/process/part_pkg.cgi | 121 +-- httemplate/edit/process/part_referral.html | 2 +- httemplate/edit/process/part_svc.cgi | 7 +- httemplate/edit/process/payment_gateway.html | 65 +- httemplate/edit/process/pkg_class.html | 2 +- httemplate/edit/process/prepay_credit.cgi | 78 +- httemplate/edit/process/quick-charge.cgi | 76 +- httemplate/edit/process/quick-cust_pkg.cgi | 44 +- httemplate/edit/process/rate.cgi | 7 +- httemplate/edit/process/rate_region.cgi | 101 +-- httemplate/edit/process/reg_code.cgi | 70 +- httemplate/edit/process/router.cgi | 133 ++-- httemplate/edit/process/svc_acct.cgi | 97 +-- httemplate/edit/process/svc_acct_pop.cgi | 55 +- httemplate/edit/process/svc_broadband.cgi | 71 +- httemplate/edit/process/svc_domain.cgi | 61 +- httemplate/edit/process/svc_external.cgi | 57 +- httemplate/edit/process/svc_forward.cgi | 57 +- httemplate/edit/process/svc_phone.html | 2 +- httemplate/edit/process/svc_www.cgi | 71 +- httemplate/edit/rate.cgi | 139 ++-- httemplate/edit/rate_region.cgi | 135 ++-- httemplate/edit/reg_code.cgi | 39 +- httemplate/edit/router.cgi | 113 +-- httemplate/edit/svc_acct.cgi | 614 +++++++-------- httemplate/edit/svc_acct_pop.cgi | 109 +-- httemplate/edit/svc_broadband.cgi | 276 +++---- httemplate/edit/svc_domain.cgi | 160 ++-- httemplate/edit/svc_external.cgi | 181 ++--- httemplate/edit/svc_forward.cgi | 267 +++---- httemplate/edit/svc_phone.cgi | 2 +- httemplate/edit/svc_www.cgi | 427 ++++++----- 96 files changed, 6151 insertions(+), 5978 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 1eefcfea0..69bbb9b22 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -1,177 +1,183 @@ -<% - -my $error =''; -my $pkgnum = ''; -if ( $cgi->param('error') ) { - $error = $cgi->param('error'); - $pkgnum = $cgi->param('pkgnum'); - if ( $error eq '_bill_areyousure' ) { - my $bill = $cgi->param('bill'); - $error = "You are attempting to set the next bill date to $bill, which is - in the past. This will charge the customer for the interval - from $bill until now. Are you sure you want to do this? ". - ''; - } -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ or die "no pkgnum"; - $pkgnum = $1; -} - -#get package record -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -if ( $error ) { - #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill); - $cust_pkg->setup(str2time($cgi->param('setup'))); - $cust_pkg->bill(str2time($cgi->param('bill'))); - $cust_pkg->last_bill(str2time($cgi->param('last_bill'))); -} - -#my $custnum = $cust_pkg->getfield('custnum'); -%> - -<%= include("/elements/header.html",'Customer package - Edit dates') %> -<% -#, menubar( -# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", -# 'Main Menu' => popurl(2) -#)); -%> +% +% +%my $error =''; +%my $pkgnum = ''; +%if ( $cgi->param('error') ) { +% $error = $cgi->param('error'); +% $pkgnum = $cgi->param('pkgnum'); +% if ( $error eq '_bill_areyousure' ) { +% my $bill = $cgi->param('bill'); +% $error = "You are attempting to set the next bill date to $bill, which is +% in the past. This will charge the customer for the interval +% from $bill until now. Are you sure you want to do this? ". +% ''; +% } +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/ or die "no pkgnum"; +% $pkgnum = $1; +%} +% +%#get package record +%my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +%die "No package!" unless $cust_pkg; +%my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); +% +%if ( $error ) { +% #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill); +% $cust_pkg->setup(str2time($cgi->param('setup'))); +% $cust_pkg->bill(str2time($cgi->param('bill'))); +% $cust_pkg->last_bill(str2time($cgi->param('last_bill'))); +%} +% +%#my $custnum = $cust_pkg->getfield('custnum'); +% + + +<% include("/elements/header.html",'Customer package - Edit dates') %> +% +%#, menubar( +%# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", +%# 'Main Menu' => popurl(2) +%#)); +% + +% +% +%#print info +%my($susp,$cancel,$expire)=( +% $cust_pkg->getfield('susp'), +% $cust_pkg->getfield('cancel'), +% $cust_pkg->getfield('expire'), +%); +%my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); +%my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); +%my $otaker = $cust_pkg->getfield('otaker'); +% +% -<% - -#print info -my($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -my $otaker = $cust_pkg->getfield('otaker'); - -%>
- - -<% if ( $error ) { %> - Error: <%= $error %> -<% } %> - -<% - -#my $format = "%c %z (%Z)"; -my $format = "%m/%d/%Y %T %z (%Z)"; - -#false laziness w/view/cust_main/packages.html -#my( $billed_or_prepaid, -my( $last_bill_or_renewed, $next_bill_or_prepaid_until ); -unless ( $part_pkg->is_prepaid ) { - #$billed_or_prepaid = 'billed'; - $last_bill_or_renewed = 'Last bill'; - $next_bill_or_prepaid_until = 'Next bill'; -} else { - #$billed_or_prepaid = 'prepaid'; - $last_bill_or_renewed = 'Renewed'; - $next_bill_or_prepaid_until = 'Prepaid until'; -} - -%> - -<%= ntable("#cccccc",2) %> + +% if ( $error ) { + + Error: <% $error %> +% } +% +% +%#my $format = "%c %z (%Z)"; +%my $format = "%m/%d/%Y %T %z (%Z)"; +% +%#false laziness w/view/cust_main/packages.html +%#my( $billed_or_prepaid, +%my( $last_bill_or_renewed, $next_bill_or_prepaid_until ); +%unless ( $part_pkg->is_prepaid ) { +% #$billed_or_prepaid = 'billed'; +% $last_bill_or_renewed = 'Last bill'; +% $next_bill_or_prepaid_until = 'Next bill'; +%} else { +% #$billed_or_prepaid = 'prepaid'; +% $last_bill_or_renewed = 'Renewed'; +% $next_bill_or_prepaid_until = 'Prepaid until'; +%} +% +% + + +<% ntable("#cccccc",2) %> Package number - <%= $pkgnum %> + <% $pkgnum %> Package - <%= $pkg %> + <% $pkg %> Comment - <%= $comment %> + <% $comment %> Order taker - <%= $otaker %> + <% $otaker %> Setup date - "> + "> - <%= $last_bill_or_renewed %> date + <% $last_bill_or_renewed %> date - "> + "> - <%= $next_bill_or_prepaid_until %> date + <% $next_bill_or_prepaid_until %> date - "> + "> +% if ( $susp ) { - <% if ( $susp ) { %> Suspension date - <%= time2str($format, $susp) %> + <% time2str($format, $susp) %> - <% } %> +% } + Expiration date - "> + ">
(will cancel this package when the date is reached) +% if ( $cancel ) { - <% if ( $cancel ) { %> Cancellation date - <%= time2str($format, $cancel) %> + <% time2str($format, $cancel) %> - <% } %> +% } +
diff --git a/httemplate/edit/access_group.html b/httemplate/edit/access_group.html index d7f7667f4..d447512c2 100644 --- a/httemplate/edit/access_group.html +++ b/httemplate/edit/access_group.html @@ -1,4 +1,4 @@ -<%= include( 'elements/edit.html', +<% include( 'elements/edit.html', 'name' => 'Internal Access Group', 'table' => 'access_group', 'labels' => { diff --git a/httemplate/edit/access_user.html b/httemplate/edit/access_user.html index fb2a97196..df580a20d 100644 --- a/httemplate/edit/access_user.html +++ b/httemplate/edit/access_user.html @@ -1,4 +1,4 @@ -<%= include( 'elements/edit.html', +<% include( 'elements/edit.html', 'name' => 'Internal User', 'table' => 'access_user', 'fields' => [ diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi index 40115a932..ce514a680 100755 --- a/httemplate/edit/agent.cgi +++ b/httemplate/edit/agent.cgi @@ -1,109 +1,115 @@ -<% - -my $agent; -if ( $cgi->param('error') ) { - $agent = new FS::agent ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); -} elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); -} else { #adding - $agent = new FS::agent {}; -} -my $action = $agent->agentnum ? 'Edit' : 'Add'; -my $hashref = $agent->hashref; - -my $conf = new FS::Conf; - -%> - -<%= include("/elements/header.html","$action Agent", menubar( +% +% +%my $agent; +%if ( $cgi->param('error') ) { +% $agent = new FS::agent ( { +% map { $_, scalar($cgi->param($_)) } fields('agent') +% } ); +%} elsif ( $cgi->keywords ) { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); +%} else { #adding +% $agent = new FS::agent {}; +%} +%my $action = $agent->agentnum ? 'Edit' : 'Add'; +%my $hashref = $agent->hashref; +% +%my $conf = new FS::Conf; +% +% + + +<% include("/elements/header.html","$action Agent", menubar( 'Main Menu' => $p, 'View all agents' => $p. 'browse/agent.cgi', )) %> +% if ( $cgi->param('error') ) { + +Error: <% $cgi->param('error') %> +% } -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -<% } %> -
- -Agent #<%= $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %> + + +Agent #<% $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %> -<%= &ntable("#cccccc", 2, '') %> +<% &ntable("#cccccc", 2, '') %> Agent - + Agent type Disable - {disabled} eq 'Y' ? ' CHECKED' : '' %>> + {disabled} eq 'Y' ? ' CHECKED' : '' %>> - + - + +% if ( $conf->config('ticket_system') ) { +% my $default_queueid = $conf->config('ticket_system-default_queueid'); +% my $default_queue = FS::TicketSystem->queue($default_queueid); +% $default_queue = "(default) $default_queueid: $default_queue" +% if $default_queueid; +% my %queues = FS::TicketSystem->queues(); +% my @queueids = sort { $a <=> $b } keys %queues; +% - <% if ( $conf->config('ticket_system') ) { - my $default_queueid = $conf->config('ticket_system-default_queueid'); - my $default_queue = FS::TicketSystem->queue($default_queueid); - $default_queue = "(default) $default_queueid: $default_queue" - if $default_queueid; - my %queues = FS::TicketSystem->queues(); - my @queueids = sort { $a <=> $b } keys %queues; - %> Ticketing queue - <% } %> +% } + Agent interface username - + Agent interface password - + -
"> +
">
diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html index db4331b84..08a2fa6bf 100644 --- a/httemplate/edit/agent_payment_gateway.html +++ b/httemplate/edit/agent_payment_gateway.html @@ -1,57 +1,63 @@ -<% +% +% +%$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum"; +%my $agent = qsearchs('agent', { 'agentnum' => $1 } ); +%die "agentnum $1 not found" unless $agent; +% +%#my @agent_payment_gateway; +%if ( $cgi->param('error') ) { +%} +% +%my $action = 'Add'; +% +% -$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum"; -my $agent = qsearchs('agent', { 'agentnum' => $1 } ); -die "agentnum $1 not found" unless $agent; -#my @agent_payment_gateway; -if ( $cgi->param('error') ) { -} - -my $action = 'Add'; - -%> - -<%= include("/elements/header.html","$action payment gateway override for ". $agent->agent, menubar( +<% include("/elements/header.html","$action payment gateway override for ". $agent->agent, menubar( 'Main Menu' => $p, #'View all payment gateways' => $p. 'browse/payment_gateway.html', 'View all agents' => $p. 'browse/agent.html', )) %> +% if ( $cgi->param('error') ) { + +Error: <% $cgi->param('error') %> +% } -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -<% } %> -
- + + Use gateway

for

diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi index f5afd3a96..5438e5c3b 100755 --- a/httemplate/edit/agent_type.cgi +++ b/httemplate/edit/agent_type.cgi @@ -1,41 +1,43 @@ -<% - -my($agent_type); -if ( $cgi->param('error') ) { - $agent_type = new FS::agent_type ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); -} elsif ( $cgi->keywords ) { #editing - my( $query ) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent_type=qsearchs('agent_type',{'typenum'=>$1}); -} else { #adding - $agent_type = new FS::agent_type {}; -} -my $action = $agent_type->typenum ? 'Edit' : 'Add'; - -%><%= include("/elements/header.html","$action Agent Type", menubar( +% +% +%my($agent_type); +%if ( $cgi->param('error') ) { +% $agent_type = new FS::agent_type ( { +% map { $_, scalar($cgi->param($_)) } fields('agent') +% } ); +%} elsif ( $cgi->keywords ) { #editing +% my( $query ) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $agent_type=qsearchs('agent_type',{'typenum'=>$1}); +%} else { #adding +% $agent_type = new FS::agent_type {}; +%} +%my $action = $agent_type->typenum ? 'Edit' : 'Add'; +% +% +<% include("/elements/header.html","$action Agent Type", menubar( 'Main Menu' => "$p", 'View all agent types' => "${p}browse/agent_type.cgi", )) %> +% if ( $cgi->param('error') ) { -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -<% } %> + Error: <% $cgi->param('error') %> +% } - - -Agent Type #<%= $agent_type->typenum || "(NEW)" %> + + + +Agent Type #<% $agent_type->typenum || "(NEW)" %>
Agent Type - +

Select which packages agents of this type may sell to customers
-<%= ntable("#cccccc", 2) %> -<%= include('/elements/checkboxes-table.html', +<% ntable("#cccccc", 2) %> +<% include('/elements/checkboxes-table.html', 'source_obj' => $agent_type, 'link_table' => 'type_pkgs', 'target_table' => 'part_pkg', @@ -48,8 +50,8 @@ Select which packages agents of this type may sell to customers

-"> +">
-<%= include('/elements/footer.html') %> +<% include('/elements/footer.html') %> diff --git a/httemplate/edit/bulk-cust_svc.html b/httemplate/edit/bulk-cust_svc.html index be247ba4e..f2efc3ff9 100644 --- a/httemplate/edit/bulk-cust_svc.html +++ b/httemplate/edit/bulk-cust_svc.html @@ -1,4 +1,4 @@ -<%= include("/elements/header.html", 'Bulk customer service change', +<% include("/elements/header.html", 'Bulk customer service change', menubar( 'Main Menu' => $p, ), @@ -9,7 +9,7 @@ -<%= include('/elements/progress-init.html', +<% include('/elements/progress-init.html', 'OneTrueForm', [qw( old_svcpart new_svcpart pkgpart )], 'process/bulk-cust_svc.cgi', @@ -18,65 +18,67 @@ %>
+% +% $cgi->param('svcpart') =~ /^(\d+)$/ +% or die "illegal svcpart: ". $cgi->param('svcpart'); +% +% my $old_svcpart = $1; +% my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } ) +% or die "unknown svcpart: $old_svcpart"; +% -<% - $cgi->param('svcpart') =~ /^(\d+)$/ - or die "illegal svcpart: ". $cgi->param('svcpart'); - my $old_svcpart = $1; - my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } ) - or die "unknown svcpart: $old_svcpart"; -%> - - + Change
to new service definition
diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi index 9d3bdd8cb..2035e4b64 100755 --- a/httemplate/edit/cust_bill_pay.cgi +++ b/httemplate/edit/cust_bill_pay.cgi @@ -1,87 +1,90 @@ -<% - -my($paynum, $amount, $invnum); -if ( $cgi->param('error') ) { - $paynum = $cgi->param('paynum'); - $amount = $cgi->param('amount'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $paynum = $1; - $amount = ''; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= header("Apply Payment", '') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> +% +% +%my($paynum, $amount, $invnum); +%if ( $cgi->param('error') ) { +% $paynum = $cgi->param('paynum'); +% $amount = $cgi->param('amount'); +% $invnum = $cgi->param('invnum'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $paynum = $1; +% $amount = ''; +% $invnum = ''; +%} +% +%my $otaker = getotaker; +% +%my $p1 = popurl(1); +% +% +<% header("Apply Payment", '') %> +% if ( $cgi->param('error') ) { + + Error: <% $cgi->param('error') %>

-<% } %> - - +% } -<% -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); -die "payment $paynum not found!" unless $cust_pay; -my $unapplied = $cust_pay->unapplied; -%> + +% +%my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); +%die "payment $paynum not found!" unless $cust_pay; +% +%my $unapplied = $cust_pay->unapplied; +% -Payment #<%= $paynum %> - -
Date: <%= time2str("%D", $cust_pay->_date) %> +Payment #<% $paynum %> + -
Amount: $<%= $cust_pay->paid %> +
Date: <% time2str("%D", $cust_pay->_date) %> -
Unapplied amount: $<%= $unapplied %> +
Amount: $<% $cust_pay->paid %> -<% -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); +
Unapplied amount: $<% $unapplied %> +% +%my @cust_bill = grep $_->owed != 0, +% qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); +% +% -%>
Invoice # -
Amount $ +
Amount $
diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi index 8de627d20..c54fb8147 100755 --- a/httemplate/edit/cust_credit.cgi +++ b/httemplate/edit/cust_credit.cgi @@ -1,67 +1,69 @@ -<% - -my $conf = new FS::Conf; -my($custnum, $amount, $reason); -if ( $cgi->param('error') ) { - #$cust_credit = new FS::cust_credit ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit') - #} ); - $custnum = $cgi->param('custnum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $reason = $cgi->param('reason'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - $amount = ''; - #$refund = 'yes'; - $reason = ''; -} -my $_date = time; - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= include('/elements/header-popup.html', 'Enter Credit') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> +% +% +%my $conf = new FS::Conf; +%my($custnum, $amount, $reason); +%if ( $cgi->param('error') ) { +% #$cust_credit = new FS::cust_credit ( { +% # map { $_, scalar($cgi->param($_)) } fields('cust_credit') +% #} ); +% $custnum = $cgi->param('custnum'); +% $amount = $cgi->param('amount'); +% #$refund = $cgi->param('refund'); +% $reason = $cgi->param('reason'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $custnum = $1; +% $amount = ''; +% #$refund = 'yes'; +% $reason = ''; +%} +%my $_date = time; +% +%my $otaker = getotaker; +% +%my $p1 = popurl(1); +% +% +<% include('/elements/header-popup.html', 'Enter Credit') %> +% if ( $cgi->param('error') ) { + + Error: <% $cgi->param('error') %>

-<% } %> +% } + - + - + - + - + - + Credit -<%= ntable("#cccccc", 2) %> +<% ntable("#cccccc", 2) %> Date - <%= time2str("%D",$_date) %> + <% time2str("%D",$_date) %> Amount - $ + $ +% +%#print qq! Also post refund!; +% -<% -#print qq! Also post refund!; -%> Reason - + diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 409ea3c25..5fdc0ba18 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,94 +1,97 @@ -<% - -my($crednum, $amount, $invnum); -if ( $cgi->param('error') ) { - #$cust_credit_bill = new FS::cust_credit_bill ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') - #} ); - $crednum = $cgi->param('crednum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $crednum = $1; - $amount = ''; - #$refund = 'yes'; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= header("Apply Credit", '') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> +% +% +%my($crednum, $amount, $invnum); +%if ( $cgi->param('error') ) { +% #$cust_credit_bill = new FS::cust_credit_bill ( { +% # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') +% #} ); +% $crednum = $cgi->param('crednum'); +% $amount = $cgi->param('amount'); +% #$refund = $cgi->param('refund'); +% $invnum = $cgi->param('invnum'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $crednum = $1; +% $amount = ''; +% #$refund = 'yes'; +% $invnum = ''; +%} +% +%my $otaker = getotaker; +% +%my $p1 = popurl(1); +% +% +<% header("Apply Credit", '') %> +% if ( $cgi->param('error') ) { + + Error: <% $cgi->param('error') %>

-<% } %> - - +% } -<% -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -die "credit $crednum not found!" unless $cust_credit; -my $credited = $cust_credit->credited; -%> + +% +%my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +%die "credit $crednum not found!" unless $cust_credit; +% +%my $credited = $cust_credit->credited; +% -Credit #<%= $crednum %> - -
Date: <%= time2str("%D", $cust_credit->_date) %> +Credit #<% $crednum %> + -
Amount: $<%= $cust_credit->amount %> +
Date: <% time2str("%D", $cust_credit->_date) %> -
Unapplied amount: $<%= $credited %> +
Amount: $<% $cust_credit->amount %> -
Reason: <%= $cust_credit->reason %> +
Unapplied amount: $<% $credited %> -<% -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); +
Reason: <% $cust_credit->reason %> +% +%my @cust_bill = grep $_->owed != 0, +% qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); +% +% -%>
Invoice # -
Amount $ +
Amount $
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index c3d1804bc..dfcd0401f 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -1,160 +1,164 @@ -<% - - #for misplaced logic below - #use FS::part_pkg; - - #for false laziness below (now more properly lazy) - #use FS::svc_acct_pop; - - #for (other) false laziness below - #use FS::agent; - #use FS::type_pkgs; - -my $conf = new FS::Conf; - -#get record - -my $error = ''; -my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart); -my(@invoicing_list); -my $same = ''; -if ( $cgi->param('error') ) { - $error = $cgi->param('error'); - $cust_main = new FS::cust_main ( { - map { $_, scalar($cgi->param($_)) } fields('cust_main') - } ); - $custnum = $cust_main->custnum; - $saved_pkgpart = $cgi->param('pkgpart_svcpart') || ''; - if ( $saved_pkgpart =~ /^(\d+)_/ ) { - $saved_pkgpart = $1; - } else { - $saved_pkgpart = ''; - } - $username = $cgi->param('username'); - $password = $cgi->param('_password'); - $popnum = $cgi->param('popnum'); - @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') ); - $same = $cgi->param('same'); - $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid'); -} elsif ( $cgi->keywords ) { #editing - my( $query ) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum=$1; - $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - if ( $cust_main->dbdef_table->column('paycvv') - && length($cust_main->paycvv) ) { - my $paycvv = $cust_main->paycvv; - $paycvv =~ s/./*/g; - $cust_main->paycvv($paycvv); - } - $saved_pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; - @invoicing_list = $cust_main->invoicing_list; -} else { - $custnum=''; - $cust_main = new FS::cust_main ( {} ); - $cust_main->otaker( &getotaker ); - $cust_main->referral_custnum( $cgi->param('referral_custnum') ); - $saved_pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; - @invoicing_list = (); -} -$cgi->delete_all(); - -my $action = $custnum ? 'Edit' : 'Add'; -$action .= ": ". $cust_main->name if $custnum; +% +% +% #for misplaced logic below +% #use FS::part_pkg; +% +% #for false laziness below (now more properly lazy) +% #use FS::svc_acct_pop; +% +% #for (other) false laziness below +% #use FS::agent; +% #use FS::type_pkgs; +% +%my $conf = new FS::Conf; +% +%#get record +% +%my $error = ''; +%my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart); +%my(@invoicing_list); +%my $same = ''; +%if ( $cgi->param('error') ) { +% $error = $cgi->param('error'); +% $cust_main = new FS::cust_main ( { +% map { $_, scalar($cgi->param($_)) } fields('cust_main') +% } ); +% $custnum = $cust_main->custnum; +% $saved_pkgpart = $cgi->param('pkgpart_svcpart') || ''; +% if ( $saved_pkgpart =~ /^(\d+)_/ ) { +% $saved_pkgpart = $1; +% } else { +% $saved_pkgpart = ''; +% } +% $username = $cgi->param('username'); +% $password = $cgi->param('_password'); +% $popnum = $cgi->param('popnum'); +% @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') ); +% $same = $cgi->param('same'); +% $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid'); +%} elsif ( $cgi->keywords ) { #editing +% my( $query ) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $custnum=$1; +% $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); +% if ( $cust_main->dbdef_table->column('paycvv') +% && length($cust_main->paycvv) ) { +% my $paycvv = $cust_main->paycvv; +% $paycvv =~ s/./*/g; +% $cust_main->paycvv($paycvv); +% } +% $saved_pkgpart = 0; +% $username = ''; +% $password = ''; +% $popnum = 0; +% @invoicing_list = $cust_main->invoicing_list; +%} else { +% $custnum=''; +% $cust_main = new FS::cust_main ( {} ); +% $cust_main->otaker( &getotaker ); +% $cust_main->referral_custnum( $cgi->param('referral_custnum') ); +% $saved_pkgpart = 0; +% $username = ''; +% $password = ''; +% $popnum = 0; +% @invoicing_list = (); +%} +%$cgi->delete_all(); +% +%my $action = $custnum ? 'Edit' : 'Add'; +%$action .= ": ". $cust_main->name if $custnum; +% +%my $r = qq!* !; +% +% -my $r = qq!* !; - -%> -<%= include('/elements/header.html', +<% include('/elements/header.html', "Customer $action", '', ' onUnload="myclose()"' ) %> +% if ( $error ) { + +Error: <% $error %>

+% } -<% if ( $error ) { %> -Error: <%= $error %>

-<% } %> - -<% if ( $custnum ) { %> - Customer #<%= $custnum %> - - - <%= ucfirst($cust_main->status) %> + +% if ( $custnum ) { + + Customer #<% $custnum %> - + + <% ucfirst($cust_main->status) %>

-<% } %> +% } + -<%= &ntable("#cccccc") %> +<% &ntable("#cccccc") %> -<%= include('/elements/tr-select-agent.html', $cust_main->agentnum, +<% include('/elements/tr-select-agent.html', $cust_main->agentnum, 'label' => "${r}Agent", 'empty_label' => 'Select agent', ) %> +% +%my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; +%if ( $custnum && ! $conf->exists('editreferrals') ) { +% -<% -my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; -if ( $custnum && ! $conf->exists('editreferrals') ) { -%> - + +% } else { -<% } else { %> - <%= include('/elements/tr-select-part_referral.html') %> + <% include('/elements/tr-select-part_referral.html') %> +% } -<% } %> +% +%my $referring_cust_main = ''; +%if ( $cust_main->referral_custnum +% and $referring_cust_main = +% qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) +%) { +% -<% -my $referring_cust_main = ''; -if ( $cust_main->referral_custnum - and $referring_cust_main = - qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) -) { -%> Referring customer - <%= $cust_main->referral_custnum %>: <%= $referring_cust_main->name %> + <% $cust_main->referral_custnum %>: <% $referring_cust_main->name %> - + +% } elsif ( ! $conf->exists('disable_customer_referrals') ) { -<% } elsif ( ! $conf->exists('disable_customer_referrals') ) { %> Referring customer - <%= include('/elements/search-cust_main.html', + <% include('/elements/search-cust_main.html', 'field_name' => 'referral_custnum', ) %> +% } else { -<% } else { %> +% } -<% } %> @@ -162,18 +166,20 @@ if ( $cust_main->referral_custnum

Billing address -<%= include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %> +<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %> +% if ( defined $cust_main->dbdef_table->column('ship_last') ) { -<% if ( defined $cust_main->dbdef_table->column('ship_last') ) { %> +% +% my $checked = ''; +% my $disabled = ''; +% my $disabledselect = ''; +% unless ( $cust_main->ship_last && $same ne 'Y' ) { +% $checked = 'CHECKED'; +% $disabled = 'DISABLED style="background-color: #dddddd"'; +% foreach ( +% qw( last first company address1 address2 city county state zip country +% daytime night fax ) +% ) { +% $cust_main->set("ship_$_", $cust_main->get($_) ); +% } +% } +% -<% - my $checked = ''; - my $disabled = ''; - my $disabledselect = ''; - unless ( $cust_main->ship_last && $same ne 'Y' ) { - $checked = 'CHECKED'; - $disabled = 'DISABLED style="background-color: #dddddd"'; - foreach ( - qw( last first company address1 address2 city county state zip country - daytime night fax ) - ) { - $cust_main->set("ship_$_", $cust_main->get($_) ); - } - } -%>
Service address -(>same as billing address) -<%= include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %> +(>same as billing address) +<% include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %> +% } -<% } %> -<%= include( 'cust_main/billing.html', $cust_main, +<% include( 'cust_main/billing.html', $cust_main, 'invoicing_list' => \@invoicing_list, ) %> @@ -317,136 +327,136 @@ function copyelement(from, to) { - - -<% foreach my $hidden ( - 'custnum', 'agentnum', 'refnum', 'referral_custnum', - 'last', 'first', 'ss', 'company', - 'address1', 'address2', 'city', - 'county', 'state', 'zip', 'country', - 'daytime', 'night', 'fax', - - 'same', - - 'ship_last', 'ship_first', 'ship_company', - 'ship_address1', 'ship_address2', 'ship_city', - 'ship_county', 'ship_state', 'ship_zip', 'ship_country', - 'ship_daytime','ship_night', 'ship_fax', - - 'select', #XXX key - - 'payauto', - 'payinfo', 'payinfo1', 'payinfo2', - 'payname', 'exp_month', 'exp_year', 'paycvv', - 'paystart_month', 'paystart_year', 'payissue', - 'payip', - 'paid', - - 'tax', - 'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX', - 'spool_cdr' - ) { -%> - -<% } %> + +% foreach my $hidden ( +% 'custnum', 'agentnum', 'refnum', 'referral_custnum', +% 'last', 'first', 'ss', 'company', +% 'address1', 'address2', 'city', +% 'county', 'state', 'zip', 'country', +% 'daytime', 'night', 'fax', +% +% 'same', +% +% 'ship_last', 'ship_first', 'ship_company', +% 'ship_address1', 'ship_address2', 'ship_city', +% 'ship_county', 'ship_state', 'ship_zip', 'ship_country', +% 'ship_daytime','ship_night', 'ship_fax', +% +% 'select', #XXX key +% +% 'payauto', +% 'payinfo', 'payinfo1', 'payinfo2', +% 'payname', 'exp_month', 'exp_year', 'paycvv', +% 'paystart_month', 'paystart_year', 'payissue', +% 'payip', +% 'paid', +% +% 'tax', +% 'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX', +% 'spool_cdr' +% ) { +% + + +% } +
Comments -<%= &ntable("#cccccc") %> +<% &ntable("#cccccc") %> - + +% +% +%unless ( $custnum ) { +% # pry the wrong place for this logic. also pretty expensive +% #use FS::part_pkg; +% +% #false laziness, copied from FS::cust_pkg::order +% my $pkgpart; +% my @agents = $FS::CurrentUser::CurrentUser->agents; +% if ( scalar(@agents) == 1 ) { +% # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART +% $pkgpart = $agents[0]->pkgpart_hashref; +% } else { +% #can't know (agent not chosen), so, allow all +% my %typenum; +% foreach my $agent ( @agents ) { +% next if $typenum{$agent->typenum}++; +% #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref } +% foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround +% } +% } +% #eslaf +% +% my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } +% qsearch( 'part_pkg', { 'disabled' => '' } ); +% +% if ( @part_pkg ) { +% +% # print "

First package", &itable("#cccccc", "0 ALIGN=LEFT"), +% #apiabuse & undesirable wrapping +% +% -<% - -unless ( $custnum ) { - # pry the wrong place for this logic. also pretty expensive - #use FS::part_pkg; - - #false laziness, copied from FS::cust_pkg::order - my $pkgpart; - my @agents = $FS::CurrentUser::CurrentUser->agents; - if ( scalar(@agents) == 1 ) { - # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART - $pkgpart = $agents[0]->pkgpart_hashref; - } else { - #can't know (agent not chosen), so, allow all - my %typenum; - foreach my $agent ( @agents ) { - next if $typenum{$agent->typenum}++; - #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref } - foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround - } - } - #eslaf - - my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } - qsearch( 'part_pkg', { 'disabled' => '' } ); - - if ( @part_pkg ) { - - # print "

First package", &itable("#cccccc", "0 ALIGN=LEFT"), - #apiabuse & undesirable wrapping - - %>
First package - <%= ntable("#cccccc") %> + <% ntable("#cccccc") %> - - <% - #false laziness: (mostly) copied from edit/svc_acct.cgi - #$ulen = $svc_acct->dbdef_table->column('username')->length; - my $ulen = dbdef->table('svc_acct')->column('username')->length; - my $ulen2 = $ulen+2; - my $passwordmax = $conf->config('passwordmax') || 8; - my $pmax2 = $passwordmax + 2; - %> +% +% #false laziness: (mostly) copied from edit/svc_acct.cgi +% #$ulen = $svc_acct->dbdef_table->column('username')->length; +% my $ulen = dbdef->table('svc_acct')->column('username')->length; +% my $ulen2 = $ulen+2; +% my $passwordmax = $conf->config('passwordmax') || 8; +% my $pmax2 = $passwordmax + 2; +% + Username - MAXLENGTH=<%= $ulen %>> + MAXLENGTH=<% $ulen %>> Password - MAXLENGTH=<%= $passwordmax %>> + MAXLENGTH=<% $passwordmax %>> (blank to generate) Access number - <%= FS::svc_acct_pop::popselector($popnum) %> + <% FS::svc_acct_pop::popselector($popnum) %> - - <% } %> +% } +% } -<% } %> - +
-"> +">
-<%= include('/elements/footer.html') %> +<% include('/elements/footer.html') %> diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 790f41f00..78a2002a4 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -1,70 +1,71 @@ -<% - -my( $cust_main, %options ) = @_; -my @invoicing_list = @{ $options{'invoicing_list'} }; -my $conf = new FS::Conf; -my $payby_default = $conf->config('payby-default'); - -my @payby = grep /\w/, $conf->config('payby'); -#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) -@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; - -if ( $payby_default eq 'HIDE' ) { - - $cust_main->payby('BILL') unless $cust_main->payby; - -%> - - +% +% +%my( $cust_main, %options ) = @_; +%my @invoicing_list = @{ $options{'invoicing_list'} }; +%my $conf = new FS::Conf; +%my $payby_default = $conf->config('payby-default'); +% +%my @payby = grep /\w/, $conf->config('payby'); +%#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +%@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) +% unless @payby; +% +%if ( $payby_default eq 'HIDE' ) { +% +% $cust_main->payby('BILL') unless $cust_main->payby; +% +% + + + -
<% # XXX key %> - - <% foreach my $field (qw( payinfo payname paycvv paystart_month paystart_year payissue payip )) { %> + +% # XXX key +% foreach my $field (qw( payinfo payname paycvv paystart_month paystart_year payissue payip )) { - - <% } %> + +% } +% +% #false laziness w/elements/select-month_year.html & view/cust_main/billing.html +% my( $mon, $year ); +% my $date = $cust_main->paydate || '12-2037'; +% if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format +% ( $mon, $year ) = ( $2, $1 ); +% } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { +% ( $mon, $year ) = ( $1, $3 ); +% } else { +% die "unrecognized expiration date format: $date"; +% } +% - <% - #false laziness w/elements/select-month_year.html & view/cust_main/billing.html - my( $mon, $year ); - my $date = $cust_main->paydate || '12-2037'; - if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); - } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); - } else { - die "unrecognized expiration date format: $date"; - } - %> - - + +
- + - +
+% } else { +% +% my $r = qq!* !; +% +% -<% } else { - - my $r = qq!* !; - -%>
Billing information - <%= &ntable("#cccccc") %> + <% &ntable("#cccccc") %> - <%=$r%>Billing type + <%$r%>Billing type - - <% - - my($payby, $payinfo, $payname)=( - $cust_main->payby, - $cust_main->payinfo, - $cust_main->payname, - ); - my( $account, $aba ) = split('@', $payinfo); - - my $disabled = 'DISABLED style="background-color: #dddddd"'; - my $text_disabled = 'style="color: #999999"'; - if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) { - $disabled = 'style="background-color: #ffffff"'; - $text_disabled = 'style="color: #000000";' - } - - my %payby = ( - - 'CARD' => - - ''. - - qq!!. - qq!!. - - qq!!. - ''. - - qq!!. - '!. - '!. - - qq!!. - qq!!. - - qq!'. - - '
${r}Card number
${r}Expiration '. - - include('/elements/select-month_year.html', - 'prefix' => 'exp', - 'selected_date' => - ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ), - ). - - '
CVV2 !. - - qq!(help)!. - qq!'. - - - qq!
Start date '. - - include('/elements/select-month_year.html', - 'prefix' => 'paystart', - 'disabled' => $disabled, - 'empty_option' => 1, - 'start_year' => 2000, - 'end_year' => (localtime())[5] + 1900, - 'selected_date' => ( - ( $payby =~ /^(CARD|DCRD)$/ - && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) - ? $cust_main->paystart_month. '-'. - $cust_main->paystart_year - : '' - ) - ). - - qq! or Issue number !. - '
${r}Exact name on card
Charge future payments to this card automatically
', - - 'CHEK' => - - ''. - - qq!!. - qq!'. - - qq!!. - qq!!. - - qq!!. - qq!!. - - qq!!. - qq!!. - - qq!'. - - ''. - ''. - ''. - - '
${r}Account number
${r}ABA/Routing number !. - qq!(help)!. - qq!
${r}Bank name
Charge future payments to this electronic check automatically
 
 
 
', - - 'LECB' => - - ''. - - qq!!. - qq!!. - - qq!!. - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Phone number
 
 
 
 
 
 
', - - 'BILL' => - - ''. - - qq!!. - qq!!. - - qq!!. - qq!!. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - - '
P.O.
Attention
 
 
 
 
 
', - - 'COMP' => - - ''. - - qq!!. - qq!!. - - qq!!. - ''. - - ''. - ''. - ''. - ''. - ''. - - '
${r}Approved by
${r}Expiration '. - - include('/elements/select-month_year.html', - 'prefix' => 'exp', - 'selected_date' => - ( $payby eq 'COMP' ? $cust_main->paydate : '' ), - ). - - '
 
 
 
 
 
', - - 'CASH' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - 'WEST' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - 'MCRD' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - ); - - #this should use FS::payby - my %allopt = ( - 'CARD' => 'Credit card', - 'CHEK' => 'Electronic check', - 'LECB' => 'Phone bill billing', - 'BILL' => 'Billing', - 'CASH' => 'Cash', # initial payment, then billing', - 'WEST' => 'Western Union', # initial payment, then billing', - 'MCRD' => 'Manual credit card', # initial payment, then billing', - 'COMP' => 'Complimentary', - ); - if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types - # when editing customer - delete $allopt{$_} for qw(CASH WEST MCRD); - } - - tie my %options, 'Tie::IxHash', - map { $_ => $allopt{$_} } - grep { exists $allopt{$_} } - @payby; - - my %payby2option = ( - ( map { $_ => $_ } keys %options ), - 'DCRD' => 'CARD', - 'DCHK' => 'CHEK', - ); - - my $widget = new HTML::Widgets::SelectLayers( - 'options' => \%options, - #'form_name' => 'dummy', - #'form_action' => 'nothingyet', - #chops bottom of page in IE# 'under_position' => 'absolute', - 'html_between' => '', - 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, - 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, - ); - - %> - - <%= $widget->html %> +% +% +% my($payby, $payinfo, $payname)=( +% $cust_main->payby, +% $cust_main->payinfo, +% $cust_main->payname, +% ); +% my( $account, $aba ) = split('@', $payinfo); +% +% my $disabled = 'DISABLED style="background-color: #dddddd"'; +% my $text_disabled = 'style="color: #999999"'; +% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) { +% $disabled = 'style="background-color: #ffffff"'; +% $text_disabled = 'style="color: #000000";' +% } +% +% my %payby = ( +% +% 'CARD' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% ''. +% +% qq!!. +% '!. +% '!. +% +% qq!!. +% qq!!. +% +% qq!'. +% +% '
${r}Card number
${r}Expiration '. +% +% include('/elements/select-month_year.html', +% 'prefix' => 'exp', +% 'selected_date' => +% ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ), +% ). +% +% '
CVV2 !. +% +% qq!(help)!. +% qq!'. +% +% +% qq!
Start date '. +% +% include('/elements/select-month_year.html', +% 'prefix' => 'paystart', +% 'disabled' => $disabled, +% 'empty_option' => 1, +% 'start_year' => 2000, +% 'end_year' => (localtime())[5] + 1900, +% 'selected_date' => ( +% ( $payby =~ /^(CARD|DCRD)$/ +% && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) +% ? $cust_main->paystart_month. '-'. +% $cust_main->paystart_year +% : '' +% ) +% ). +% +% qq! or Issue number !. +% '
${r}Exact name on card
Charge future payments to this card automatically
', +% +% 'CHEK' => +% +% ''. +% +% qq!!. +% qq!'. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% qq!'. +% +% ''. +% ''. +% ''. +% +% '
${r}Account number
${r}ABA/Routing number !. +% qq!(help)!. +% qq!
${r}Bank name
Charge future payments to this electronic check automatically
 
 
 
', +% +% 'LECB' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Phone number
 
 
 
 
 
 
', +% +% 'BILL' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
P.O.
Attention
 
 
 
 
 
', +% +% 'COMP' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% ''. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Approved by
${r}Expiration '. +% +% include('/elements/select-month_year.html', +% 'prefix' => 'exp', +% 'selected_date' => +% ( $payby eq 'COMP' ? $cust_main->paydate : '' ), +% ). +% +% '
 
 
 
 
 
', +% +% 'CASH' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% 'WEST' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% 'MCRD' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% ); +% +% #this should use FS::payby +% my %allopt = ( +% 'CARD' => 'Credit card', +% 'CHEK' => 'Electronic check', +% 'LECB' => 'Phone bill billing', +% 'BILL' => 'Billing', +% 'CASH' => 'Cash', # initial payment, then billing', +% 'WEST' => 'Western Union', # initial payment, then billing', +% 'MCRD' => 'Manual credit card', # initial payment, then billing', +% 'COMP' => 'Complimentary', +% ); +% if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types +% # when editing customer +% delete $allopt{$_} for qw(CASH WEST MCRD); +% } +% +% tie my %options, 'Tie::IxHash', +% map { $_ => $allopt{$_} } +% grep { exists $allopt{$_} } +% @payby; +% +% my %payby2option = ( +% ( map { $_ => $_ } keys %options ), +% 'DCRD' => 'CARD', +% 'DCHK' => 'CHEK', +% ); +% +% my $widget = new HTML::Widgets::SelectLayers( +% 'options' => \%options, +% #'form_name' => 'dummy', +% #'form_action' => 'nothingyet', +% #chops bottom of page in IE# 'under_position' => 'absolute', +% 'html_between' => '', +% 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, +% 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, +% ); +% +% + + + <% $widget->html %>
- <%= &ntable("#cccccc") %> + <% &ntable("#cccccc") %>   - tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt + tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt - exists('disablepostalinvoicedefault') @@ -417,7 +418,7 @@ if ( $payby_default eq 'HIDE' ) { - Email invoice - + +% if ( $conf->exists('voip-cust_cdr_spools') ) { - <% if ( $conf->exists('voip-cust_cdr_spools') ) { %> - spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs + spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs - <% } else { %> - - <% } %> +% } else { + + +% } +
- <%= $r %> required fields + <% $r %> required fields +% } -<% } %> diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index 6e4f08957..a001634a2 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -1,125 +1,128 @@ -<% - -my( $cust_main, $pre, $onchange, $disabled ) = @_; -my $conf = new FS::Conf; - -#false laziness with ship state -my $countrydefault = $conf->config('countrydefault') || 'US'; -$cust_main->set($pre.'country', $countrydefault ) - unless $cust_main->get($pre.'country'); - -my $statedefault = $conf->config('statedefault') - || ($countrydefault eq 'US' ? 'CA' : ''); -$cust_main->set($pre.'state', $statedefault ) - unless $cust_main->get($pre.'state') - || $cust_main->get($pre.'country') ne $countrydefault; - -#my($county_html, $state_html, $country_html) = -# FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), -# $cust_main->get($pre.'state'), -# $cust_main->get($pre.'country'), -# $pre, -# $onchange, -# $disabled, -# ); - -my %select_hash = ( - 'county' => $cust_main->get($pre.'county'), - 'state' => $cust_main->get($pre.'state'), - 'country' => $cust_main->get($pre.'country'), - 'prefix' => $pre, - 'onchange' => $onchange, - 'disabled' => $disabled, -); - -my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; -my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; - -my $r = qq!* !; - -%> - -<%= &ntable("#cccccc") %> +% +% +%my( $cust_main, $pre, $onchange, $disabled ) = @_; +%my $conf = new FS::Conf; +% +%#false laziness with ship state +%my $countrydefault = $conf->config('countrydefault') || 'US'; +%$cust_main->set($pre.'country', $countrydefault ) +% unless $cust_main->get($pre.'country'); +% +%my $statedefault = $conf->config('statedefault') +% || ($countrydefault eq 'US' ? 'CA' : ''); +%$cust_main->set($pre.'state', $statedefault ) +% unless $cust_main->get($pre.'state') +% || $cust_main->get($pre.'country') ne $countrydefault; +% +%#my($county_html, $state_html, $country_html) = +%# FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), +%# $cust_main->get($pre.'state'), +%# $cust_main->get($pre.'country'), +%# $pre, +%# $onchange, +%# $disabled, +%# ); +% +%my %select_hash = ( +% 'county' => $cust_main->get($pre.'county'), +% 'state' => $cust_main->get($pre.'state'), +% 'country' => $cust_main->get($pre.'country'), +% 'prefix' => $pre, +% 'onchange' => $onchange, +% 'disabled' => $disabled, +%); +% +%my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; +%my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; +% +%my $r = qq!* !; +% +% + + +<% &ntable("#cccccc") %> - <%=$r%>Contact name
(last, first) + <%$r%>Contact name
(last, first) - > , - > + > , + > +% if ( $conf->exists('show_ss') && !$pre ) { -<% if ( $conf->exists('show_ss') && !$pre ) { %> SS# - -<% } elsif ( !$pre ) { %> - -<% } %> + +% } elsif ( !$pre ) { + + +% } + Company - > + > - <%=$r%>Address + <%$r%>Address - > + >   - > + > - <%=$r%>City + <%$r%>City - > + > - <%=$r%>State + <%$r%>State - <%= include('select-county.html', %select_hash ) %> - <%= include('select-state.html', %select_hash ) %> + <% include('select-county.html', %select_hash ) %> + <% include('select-state.html', %select_hash ) %> - <%=$r%>Zip + <%$r%>Zip - > + > - <%=$r%>Country - <%= include('select-country.html', %select_hash ) %> + <%$r%>Country + <% include('select-country.html', %select_hash ) %> - <%= $daytime_label %> + <% $daytime_label %> - > + > - <%= $night_label %> + <% $night_label %> - > + > Fax - > + > -<%=$r%>required fields
+<%$r%>required fields
diff --git a/httemplate/edit/cust_main/select-country.html b/httemplate/edit/cust_main/select-country.html index 3941f2f93..5467f26e9 100644 --- a/httemplate/edit/cust_main/select-country.html +++ b/httemplate/edit/cust_main/select-country.html @@ -1,16 +1,17 @@ -<% - - my %opt = @_; - foreach my $opt (qw( county state country prefix onchange disabled )) { - $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); - } - - my $conf = new FS::Conf; - my $countrydefault = $conf->config('countrydefault') || 'US'; - -%> - -<%= include('/elements/xmlhttp.html', +% +% +% my %opt = @_; +% foreach my $opt (qw( county state country prefix onchange disabled )) { +% $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); +% } +% +% my $conf = new FS::Conf; +% my $countrydefault = $conf->config('countrydefault') || 'US'; +% +% + + +<% include('/elements/xmlhttp.html', 'url' => $p.'misc/states.cgi', 'subs' => [ $opt{'prefix'}. 'get_states' ], ) @@ -24,15 +25,15 @@ what.options[length] = optionName; } - function <%= $opt{'prefix'} %>country_changed(what, callback) { + function <% $opt{'prefix'} %>country_changed(what, callback) { country = what.options[what.selectedIndex].value; - function <%= $opt{'prefix'} %>update_states(states) { + function <% $opt{'prefix'} %>update_states(states) { // blank the current state list - for ( var i = what.form.<%= $opt{'prefix'} %>state.length; i >= 0; i-- ) - what.form.<%= $opt{'prefix'} %>state.options[i] = null; + for ( var i = what.form.<% $opt{'prefix'} %>state.length; i >= 0; i-- ) + what.form.<% $opt{'prefix'} %>state.options[i] = null; // add the new states var statesArray = eval('(' + states + ')' ); @@ -40,7 +41,7 @@ var stateLabel = statesArray[s+1]; if ( stateLabel == "" ) stateLabel = '(n/a)'; - opt(what.form.<%= $opt{'prefix'} %>state, statesArray[s], stateLabel); + opt(what.form.<% $opt{'prefix'} %>state, statesArray[s], stateLabel); } //run the callback @@ -49,25 +50,25 @@ } // go get the new states - <%= $opt{'prefix'} %>get_states( country, <%= $opt{'prefix'} %>update_states ); + <% $opt{'prefix'} %>get_states( country, <% $opt{'prefix'} %>update_states ); } -> +% foreach my $country ( +% sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) +% or code2country($a) cmp code2country($b) } +% map { $_->country } +% qsearch( 'cust_main_county',{}, 'DISTINCT ON ( country ) *', ) +% ) { +% -<% foreach my $country ( - sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) - or code2country($a) cmp code2country($b) } - map { $_->country } - qsearch( 'cust_main_county',{}, 'DISTINCT ON ( country ) *', ) - ) { -%> -