From 0c525f3ba7b2b6730b8939b950e4d76dd16802a9 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Thu, 5 Jan 2006 09:34:30 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'SQL_LEDGER_2_4_4'. --- httemplate/edit/REAL_cust_pkg.cgi | 179 --------- httemplate/edit/agent.cgi | 109 ----- httemplate/edit/agent_payment_gateway.html | 64 --- httemplate/edit/agent_type.cgi | 75 ---- httemplate/edit/bulk-cust_svc.html | 97 ----- httemplate/edit/cust_bill_pay.cgi | 95 ----- httemplate/edit/cust_credit.cgi | 63 --- httemplate/edit/cust_credit_bill.cgi | 101 ----- httemplate/edit/cust_main.cgi | 439 -------------------- httemplate/edit/cust_main/billing.html | 443 -------------------- httemplate/edit/cust_main/contact.html | 125 ------ httemplate/edit/cust_main/select-country.html | 72 ---- httemplate/edit/cust_main/select-county.html | 91 ----- httemplate/edit/cust_main/select-state.html | 27 -- httemplate/edit/cust_main_county-expand.cgi | 54 --- httemplate/edit/cust_main_county.cgi | 98 ----- httemplate/edit/cust_pay.cgi | 135 ------- httemplate/edit/cust_pkg.cgi | 130 ------ httemplate/edit/cust_refund.cgi | 94 ----- httemplate/edit/msgcat.cgi | 58 --- httemplate/edit/part_bill_event.cgi | 376 ----------------- httemplate/edit/part_export.cgi | 128 ------ httemplate/edit/part_pkg.cgi | 335 ---------------- httemplate/edit/part_referral.cgi | 48 --- httemplate/edit/part_svc.cgi | 290 -------------- httemplate/edit/part_virtual_field.cgi | 92 ----- httemplate/edit/payment_gateway.html | 109 ----- httemplate/edit/prepay_credit.cgi | 56 --- httemplate/edit/process/REAL_cust_pkg.cgi | 34 -- httemplate/edit/process/addr_block/add.cgi | 20 - httemplate/edit/process/addr_block/allocate.cgi | 25 -- httemplate/edit/process/addr_block/deallocate.cgi | 24 -- httemplate/edit/process/addr_block/split.cgi | 19 - httemplate/edit/process/agent.cgi | 28 -- httemplate/edit/process/agent_payment_gateway.html | 25 -- httemplate/edit/process/agent_type.cgi | 55 --- httemplate/edit/process/bulk-cust_svc.cgi | 3 - httemplate/edit/process/cust_bill_pay.cgi | 43 -- httemplate/edit/process/cust_credit.cgi | 26 -- httemplate/edit/process/cust_credit_bill.cgi | 44 -- httemplate/edit/process/cust_main.cgi | 155 ------- .../edit/process/cust_main_county-collapse.cgi | 35 -- .../edit/process/cust_main_county-expand.cgi | 58 --- httemplate/edit/process/cust_main_county.cgi | 30 -- httemplate/edit/process/cust_pay.cgi | 42 -- httemplate/edit/process/cust_pkg.cgi | 43 -- httemplate/edit/process/cust_refund.cgi | 42 -- httemplate/edit/process/cust_svc.cgi | 30 -- httemplate/edit/process/domain_record.cgi | 34 -- httemplate/edit/process/generic.cgi | 70 ---- httemplate/edit/process/msgcat.cgi | 20 - httemplate/edit/process/part_bill_event.cgi | 54 --- httemplate/edit/process/part_export.cgi | 39 -- httemplate/edit/process/part_pkg.cgi | 61 --- httemplate/edit/process/part_referral.cgi | 28 -- httemplate/edit/process/part_svc.cgi | 3 - httemplate/edit/process/payment_gateway.html | 33 -- httemplate/edit/process/prepay_credit.cgi | 51 --- httemplate/edit/process/quick-charge.cgi | 41 -- httemplate/edit/process/quick-cust_pkg.cgi | 25 -- httemplate/edit/process/rate.cgi | 3 - httemplate/edit/process/rate_region.cgi | 51 --- httemplate/edit/process/reg_code.cgi | 44 -- httemplate/edit/process/router.cgi | 67 ---- httemplate/edit/process/svc_acct.cgi | 49 --- httemplate/edit/process/svc_acct_pop.cgi | 28 -- httemplate/edit/process/svc_broadband.cgi | 36 -- httemplate/edit/process/svc_domain.cgi | 31 -- httemplate/edit/process/svc_external.cgi | 29 -- httemplate/edit/process/svc_forward.cgi | 29 -- httemplate/edit/process/svc_www.cgi | 36 -- httemplate/edit/rate.cgi | 110 ----- httemplate/edit/rate_region.cgi | 114 ------ httemplate/edit/reg_code.cgi | 36 -- httemplate/edit/router.cgi | 77 ---- httemplate/edit/svc_acct.cgi | 446 --------------------- httemplate/edit/svc_acct_pop.cgi | 56 --- httemplate/edit/svc_broadband.cgi | 175 -------- httemplate/edit/svc_domain.cgi | 98 ----- httemplate/edit/svc_external.cgi | 105 ----- httemplate/edit/svc_forward.cgi | 177 -------- httemplate/edit/svc_www.cgi | 222 ---------- 82 files changed, 7242 deletions(-) delete mode 100755 httemplate/edit/REAL_cust_pkg.cgi delete mode 100755 httemplate/edit/agent.cgi delete mode 100644 httemplate/edit/agent_payment_gateway.html delete mode 100755 httemplate/edit/agent_type.cgi delete mode 100644 httemplate/edit/bulk-cust_svc.html delete mode 100755 httemplate/edit/cust_bill_pay.cgi delete mode 100755 httemplate/edit/cust_credit.cgi delete mode 100755 httemplate/edit/cust_credit_bill.cgi delete mode 100755 httemplate/edit/cust_main.cgi delete mode 100644 httemplate/edit/cust_main/billing.html delete mode 100644 httemplate/edit/cust_main/contact.html delete mode 100644 httemplate/edit/cust_main/select-country.html delete mode 100644 httemplate/edit/cust_main/select-county.html delete mode 100644 httemplate/edit/cust_main/select-state.html delete mode 100755 httemplate/edit/cust_main_county-expand.cgi delete mode 100755 httemplate/edit/cust_main_county.cgi delete mode 100755 httemplate/edit/cust_pay.cgi delete mode 100755 httemplate/edit/cust_pkg.cgi delete mode 100755 httemplate/edit/cust_refund.cgi delete mode 100755 httemplate/edit/msgcat.cgi delete mode 100755 httemplate/edit/part_bill_event.cgi delete mode 100644 httemplate/edit/part_export.cgi delete mode 100755 httemplate/edit/part_pkg.cgi delete mode 100755 httemplate/edit/part_referral.cgi delete mode 100755 httemplate/edit/part_svc.cgi delete mode 100644 httemplate/edit/part_virtual_field.cgi delete mode 100644 httemplate/edit/payment_gateway.html delete mode 100644 httemplate/edit/prepay_credit.cgi delete mode 100755 httemplate/edit/process/REAL_cust_pkg.cgi delete mode 100755 httemplate/edit/process/addr_block/add.cgi delete mode 100755 httemplate/edit/process/addr_block/allocate.cgi delete mode 100755 httemplate/edit/process/addr_block/deallocate.cgi delete mode 100755 httemplate/edit/process/addr_block/split.cgi delete mode 100755 httemplate/edit/process/agent.cgi delete mode 100644 httemplate/edit/process/agent_payment_gateway.html delete mode 100755 httemplate/edit/process/agent_type.cgi delete mode 100644 httemplate/edit/process/bulk-cust_svc.cgi delete mode 100755 httemplate/edit/process/cust_bill_pay.cgi delete mode 100755 httemplate/edit/process/cust_credit.cgi delete mode 100755 httemplate/edit/process/cust_credit_bill.cgi delete mode 100755 httemplate/edit/process/cust_main.cgi delete mode 100755 httemplate/edit/process/cust_main_county-collapse.cgi delete mode 100755 httemplate/edit/process/cust_main_county-expand.cgi delete mode 100755 httemplate/edit/process/cust_main_county.cgi delete mode 100755 httemplate/edit/process/cust_pay.cgi delete mode 100755 httemplate/edit/process/cust_pkg.cgi delete mode 100755 httemplate/edit/process/cust_refund.cgi delete mode 100644 httemplate/edit/process/cust_svc.cgi delete mode 100755 httemplate/edit/process/domain_record.cgi delete mode 100644 httemplate/edit/process/generic.cgi delete mode 100644 httemplate/edit/process/msgcat.cgi delete mode 100755 httemplate/edit/process/part_bill_event.cgi delete mode 100644 httemplate/edit/process/part_export.cgi delete mode 100755 httemplate/edit/process/part_pkg.cgi delete mode 100755 httemplate/edit/process/part_referral.cgi delete mode 100755 httemplate/edit/process/part_svc.cgi delete mode 100644 httemplate/edit/process/payment_gateway.html delete mode 100644 httemplate/edit/process/prepay_credit.cgi delete mode 100644 httemplate/edit/process/quick-charge.cgi delete mode 100644 httemplate/edit/process/quick-cust_pkg.cgi delete mode 100755 httemplate/edit/process/rate.cgi delete mode 100755 httemplate/edit/process/rate_region.cgi delete mode 100644 httemplate/edit/process/reg_code.cgi delete mode 100644 httemplate/edit/process/router.cgi delete mode 100755 httemplate/edit/process/svc_acct.cgi delete mode 100755 httemplate/edit/process/svc_acct_pop.cgi delete mode 100644 httemplate/edit/process/svc_broadband.cgi delete mode 100755 httemplate/edit/process/svc_domain.cgi delete mode 100755 httemplate/edit/process/svc_external.cgi delete mode 100755 httemplate/edit/process/svc_forward.cgi delete mode 100644 httemplate/edit/process/svc_www.cgi delete mode 100644 httemplate/edit/rate.cgi delete mode 100644 httemplate/edit/rate_region.cgi delete mode 100644 httemplate/edit/reg_code.cgi delete mode 100755 httemplate/edit/router.cgi delete mode 100755 httemplate/edit/svc_acct.cgi delete mode 100755 httemplate/edit/svc_acct_pop.cgi delete mode 100644 httemplate/edit/svc_broadband.cgi delete mode 100755 httemplate/edit/svc_domain.cgi delete mode 100644 httemplate/edit/svc_external.cgi delete mode 100755 httemplate/edit/svc_forward.cgi delete mode 100644 httemplate/edit/svc_www.cgi (limited to 'httemplate/edit') diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi deleted file mode 100755 index 78dd0fafa..000000000 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ /dev/null @@ -1,179 +0,0 @@ -<% - -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'); -%> - -<%= header('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'); - -%> - -
- - -<% 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 %> - - - - Package - <%= $pkg %> - - - - Comment - <%= $comment %> - - - - Order taker - <%= $otaker %> - - - - Setup date - - "> - - - - - - <%= $last_bill_or_renewed %> date - - "> - - - - - - <%= $next_bill_or_prepaid_until %> date - - "> - - - - - <% if ( $susp ) { %> - - Suspension date - <%= time2str($format, $susp) %> - - <% } %> - - - Expiration date - - "> - -
(will cancel this package when the date is reached) - - - - <% if ( $cancel ) { %> - - Cancellation date - <%= time2str($format, $cancel) %> - - <% } %> - - - - -
-
- - diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi deleted file mode 100755 index cb64ad8cd..000000000 --- a/httemplate/edit/agent.cgi +++ /dev/null @@ -1,109 +0,0 @@ -<% - -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; - -%> - -<%= header("$action Agent", menubar( - 'Main Menu' => $p, - 'View all agents' => $p. 'browse/agent.cgi', -)) %> - -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -<% } %> - -
- -Agent #<%= $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %> - -<%= &ntable("#cccccc", 2, '') %> - - - Agent - - - - - Agent type - - - - - Disable - {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; - %> - - Ticketing queue - - - - - <% } %> - - - Agent interface username - - - - - - - Agent interface password - - - - - - - -
"> -
- - diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html deleted file mode 100644 index 61d29e0e9..000000000 --- a/httemplate/edit/agent_payment_gateway.html +++ /dev/null @@ -1,64 +0,0 @@ -<% - -$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'; - -%> - -<%= header("$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') %> -<% } %> - -
- - -Use gateway -

- -for -

- -(optional) when invoice contains only items of taxclass -

- - -
- - diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi deleted file mode 100755 index 5addbbd4c..000000000 --- a/httemplate/edit/agent_type.cgi +++ /dev/null @@ -1,75 +0,0 @@ -<% - -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'; - -%> - -<%= header("$action Agent Type", menubar( - 'Main Menu' => "$p", - 'View all agent types' => "${p}browse/agent_type.cgi", -)) -%> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -<% } %> - -
- -Agent Type #<%= $agent_type->typenum || "(NEW)" %> -

- -Agent Type - -

- -Select which packages agents of this type may sell to customers
- -<% foreach my $part_pkg ( - qsearch({ 'table' => 'part_pkg', - 'hashref' => { 'disabled' => '' }, - 'select' => 'part_pkg.*', - 'addl_from' => 'LEFT JOIN type_pkgs USING ( pkgpart )', - 'extra_sql' => ( $agent_type->typenum - ? 'OR typenum = '. $agent_type->typenum - : '' - ), - }) - ) { -%> - -
- $agent_type->typenum, - 'pkgpart' => $part_pkg->pkgpart, - }) - ? 'CHECKED ' - : '' - %> VALUE="ON"> - - <%= $part_pkg->pkgpart %>: - <%= $part_pkg->pkg %> - <%= $part_pkg->comment %> - <%= $part_pkg->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> - -<% } %> - -

- -"> - -
- - diff --git a/httemplate/edit/bulk-cust_svc.html b/httemplate/edit/bulk-cust_svc.html deleted file mode 100644 index 332b5b67c..000000000 --- a/httemplate/edit/bulk-cust_svc.html +++ /dev/null @@ -1,97 +0,0 @@ -<%= header( 'Bulk customer service change', - menubar( - 'Main Menu' => $p, - ), - ) -%> - - - - - -<%= include('/elements/progress-init.html', - 'OneTrueForm', - [qw( old_svcpart new_svcpart pkgpart )], - 'process/bulk-cust_svc.cgi', - $p.'browse/part_svc.cgi', - ) -%> - -
- -<% - $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 deleted file mode 100755 index 24bce308a..000000000 --- a/httemplate/edit/cust_bill_pay.cgi +++ /dev/null @@ -1,95 +0,0 @@ - -<% - -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); - -print header("Apply Payment", ''); -print qq!Error: !, $cgi->param('error'), - "

" - if $cgi->param('error'); -print < -END - -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); -die "payment $paynum not found!" unless $cust_pay; - -my $unapplied = $cust_pay->unapplied; - -print "Payment # $paynum". - qq!!. - '
Date: '. time2str("%D", $cust_pay->_date). ''. - '
Amount: $'. $cust_pay->paid. ''. - "
Unapplied amount: \$$unapplied" - ; - -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); - -print < -function changed(what) { - cust_bill = what.options[what.selectedIndex].value; -END - -foreach my $cust_bill ( @cust_bill ) { - my $invnum = $cust_bill->invnum; - my $changeto = $cust_bill->owed < $unapplied - ? $cust_bill->owed - : $unapplied; - print < -END - -print qq!
Invoice #"; - -print qq!
Amount \$!; - -print < - -END - -print < - - -END - -%> diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi deleted file mode 100755 index aae0df2fc..000000000 --- a/httemplate/edit/cust_credit.cgi +++ /dev/null @@ -1,63 +0,0 @@ - -<% - -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); - -print header("Post Credit", ''); -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print <config('countrydefault')); -
- - - - - - -END - -print '

Credit'. ntable("#cccccc", 2). - 'Date'. - time2str("%D",$_date). ''; - -print qq!Amount\$!; - -#print qq! Also post refund!; - -print qq!Reason!; - -print qq!Auto-apply
to invoices!; - -print < -
- - - - -END - -%> diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi deleted file mode 100755 index 1a97e1312..000000000 --- a/httemplate/edit/cust_credit_bill.cgi +++ /dev/null @@ -1,101 +0,0 @@ - -<% - -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); - -print header("Apply Credit", ''); -print qq!Error: !, $cgi->param('error'), - "

" - if $cgi->param('error'); -print < -END - -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -die "credit $crednum not found!" unless $cust_credit; - -my $credited = $cust_credit->credited; - -print "Credit # $crednum". - qq!!. - '
Date: '. time2str("%D", $cust_credit->_date). ''. - '
Amount: $'. $cust_credit->amount. ''. - "
Unapplied amount: \$$credited". - '
Reason: '. $cust_credit->reason. '' - ; - -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); - -print < -function changed(what) { - cust_bill = what.options[what.selectedIndex].value; -END - -foreach my $cust_bill ( @cust_bill ) { - my $invnum = $cust_bill->invnum; - my $changeto = $cust_bill->owed < $cust_credit->credited - ? $cust_bill->owed - : $cust_credit->credited; - print < -END - -print qq!
Invoice #"; - -print qq!
Amount \$!; - -print < - -END - -print < - - -END - -%> diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi deleted file mode 100755 index 144d5405c..000000000 --- a/httemplate/edit/cust_main.cgi +++ /dev/null @@ -1,439 +0,0 @@ -<% - - #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'; - -%> - - - -<%= header("Customer $action", '', ' onUnload="myclose()"') %> - -<% if ( $error ) { %> -Error: <%= $error %> -<% } %> - -
- -Customer # <%= $custnum ? "$custnum" : " (NEW)" %> - - - -<% - -my $r = qq!* !; - -my %agent_search = dbdef->table('agent')->column('disabled') - ? ( 'disabled' => '' ) : (); -my @agents = qsearch( 'agent', \%agent_search ); -#die "No agents created!" unless @agents; -eidiot "You have not created any agents (or all agents are disabled). You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; -my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first - -%> - -<% if ( scalar(@agents) == 1 ) { %> - -<% } else { %> -

<%=$r%>Agent -<% } %> - - - -<% -my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; -if ( $custnum && ! $conf->exists('editreferrals') ) { -%> - - - -<% - } else { - - my(@referrals) = qsearch('part_referral',{}); - if ( scalar(@referrals) == 0 ) { - eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources."; - } elsif ( scalar(@referrals) == 1 ) { - $refnum ||= $referrals[0]->refnum; -%> - - - -<% } else { %> - -

<%=$r%>Advertising source - -<% } %> - -<% } %> - - - -<% -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 %> - - -<% } elsif ( ! $conf->exists('disable_customer_referrals') ) { %> - -

Referring customer number: - - -<% } else { %> - - - -<% } %> - - - -

-Billing address -<%= include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %> - - - -<% 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($_) ); - } - } -%> - -
-Service address -(>same as billing address) -<%= include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %> - -<% } %> - - - -<%= include( 'cust_main/billing.html', $cust_main, - 'invoicing_list' => \@invoicing_list, - ) -%> - - - - - -<% 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' - ) { -%> - -<% } %> - -
Comments -<%= &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; - if ( scalar(@agents) == 1 ) { - # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART - my($agent)=qsearchs('agent',{'agentnum'=> $agentnum }); - $pkgpart = $agent->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 - print "
First package", &ntable("#cccccc"), - qq!"; - - #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; - print <Username - -Password - -(blank to generate) -END - - print 'Access number' - . - &FS::svc_acct_pop::popselector($popnum). - '' - ; - } -} - -my $otaker = $cust_main->otaker; -print qq!!, - qq!

!, - "", -; - -%> diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html deleted file mode 100644 index 96f777baa..000000000 --- a/httemplate/edit/cust_main/billing.html +++ /dev/null @@ -1,443 +0,0 @@ -<% - -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 )) { %> - - - - <% } %> - - <% - #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!* !; - -%> - -
Billing information - <%= &ntable("#cccccc") %> - - - <%=$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
 
 
 
 
 
 
', - - ); - - - 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") %> - -   - - - tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt - - - - exists('disablepostalinvoicedefault') - && ! $cust_main->custnum - ) - || grep { $_ eq 'POST' } @invoicing_list ) - - ? 'CHECKED' - : '' - - %>> Postal mail invoice - - - - - - > Fax invoice - - - - - - Email invoice - - - - - -
- - <%= $r %> required fields - -<% } %> - diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html deleted file mode 100644 index e0cd06f56..000000000 --- a/httemplate/edit/cust_main/contact.html +++ /dev/null @@ -1,125 +0,0 @@ -<% - -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) - - > , - > - - -<% if ( $conf->exists('show_ss') && !$pre ) { %> - SS# - -<% } elsif ( !$pre ) { %> - -<% } %> - - - - - Company - - > - - - - - <%=$r%>Address - - > - - - - -   - - > - - - - - <%=$r%>City - - > - - <%=$r%>State - - <%= include('select-county.html', %select_hash ) %> - <%= include('select-state.html', %select_hash ) %> - - <%=$r%>Zip - - > - - - - - <%=$r%>Country - <%= include('select-country.html', %select_hash ) %> - - - - <%= $daytime_label %> - - > - - - - - <%= $night_label %> - - > - - - - - Fax - - > - - - - -<%=$r%>required fields
- diff --git a/httemplate/edit/cust_main/select-country.html b/httemplate/edit/cust_main/select-country.html deleted file mode 100644 index 014effd66..000000000 --- a/httemplate/edit/cust_main/select-country.html +++ /dev/null @@ -1,72 +0,0 @@ -<% - - 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' ], - ) -%> - - - - - diff --git a/httemplate/edit/cust_main/select-county.html b/httemplate/edit/cust_main/select-county.html deleted file mode 100644 index 3de380b31..000000000 --- a/httemplate/edit/cust_main/select-county.html +++ /dev/null @@ -1,91 +0,0 @@ -<% - - my %opt = @_; - foreach my $opt (qw( county state country prefix onchange disabled )) { - $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); - } - - my $sql = "SELECT COUNT(*) FROM cust_main_county". - " WHERE county IS NOT NULL AND county != ''"; - my $sth = dbh->prepare($sql) or die dbh->errstr; - $sth->execute or die $sth->errstr; - my $countyflag = $sth->fetchrow_arrayref->[0]; - -%> - -<% if ( $countyflag ) { %> - - <%= include('/elements/xmlhttp.html', - 'url' => $p.'misc/counties.cgi', - 'subs' => [ $opt{'prefix'}. 'get_counties' ], - ) -%> - - - - - -<% } else { %> - - - - - -<% } %> diff --git a/httemplate/edit/cust_main/select-state.html b/httemplate/edit/cust_main/select-state.html deleted file mode 100644 index 98e685ab8..000000000 --- a/httemplate/edit/cust_main/select-state.html +++ /dev/null @@ -1,27 +0,0 @@ -<% - - my %opt = @_; - foreach my $opt (qw( county state country prefix onchange disabled )) { - $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); - } - -%> - - - diff --git a/httemplate/edit/cust_main_county-expand.cgi b/httemplate/edit/cust_main_county-expand.cgi deleted file mode 100755 index 9f314a457..000000000 --- a/httemplate/edit/cust_main_county-expand.cgi +++ /dev/null @@ -1,54 +0,0 @@ - -<% - -my($taxnum, $delim, $expansion, $taxclass ); -my($query) = $cgi->keywords; -if ( $cgi->param('error') ) { - $taxnum = $cgi->param('taxnum'); - $delim = $cgi->param('delim'); - $expansion = $cgi->param('expansion'); - $taxclass = $cgi->param('taxclass'); -} else { - $query =~ /^(taxclass)?(\d+)$/ - or die "Illegal taxnum (query $query)"; - $taxclass = $1 ? 'taxclass' : ''; - $taxnum = $2; - $delim = 'n'; - $expansion = ''; -} - -my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die "cust_main_county.taxnum $taxnum not found"; -die "Can't expand entry!" if $cust_main_county->getfield('county'); - -my $p1 = popurl(1); -print header("Tax Rate (expand)", menubar( - 'Main Menu' => popurl(2), -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print < - - - Separate by -END -print 'line (broken on some browsers) or', - 'whitespace.'; -print < -
- - - - -END - -%> diff --git a/httemplate/edit/cust_main_county.cgi b/httemplate/edit/cust_main_county.cgi deleted file mode 100755 index 4bcfcbe9b..000000000 --- a/httemplate/edit/cust_main_county.cgi +++ /dev/null @@ -1,98 +0,0 @@ - -<% - -print header("Edit tax rates", menubar( - 'Main Menu' => popurl(2), -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!
!, &table(), < - Country - State - County - Taxclass
(per-package classification) -END - -if ( dbdef->table('cust_main_county')->column('taxname') ) { - print 'Tax name
(printed on invoices)'; -} - -print <Tax - Exempt
per
month -END - -if ( dbdef->table('cust_main_county')->column('setuptax') ) { - print 'Setup
fee
exempt'; -} -if ( dbdef->table('cust_main_county')->column('recurtax') ) { - print 'Recurring
fee
exempt'; -} - -print ''; - -foreach my $cust_main_county ( sort { $a->country cmp $b->country - or $a->state cmp $b->state - or $a->county cmp $b->county - } qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; - print < - $hashref->{country} -END - - print "{state} - ? ' BGCOLOR="#ffffff">'.$hashref->{state} - : ' BGCOLOR="#cccccc">(ALL)' - , ""; - - print "{county} - ? ' BGCOLOR="#ffffff">'. $hashref->{county} - : ' BGCOLOR="#cccccc">(ALL)' - , ""; - - print "{taxclass} - ? ' BGCOLOR="#ffffff">'. $hashref->{taxclass} - : ' BGCOLOR="#cccccc">(ALL)' - , ""; - - print qq!! - if dbdef->table('cust_main_county')->column('taxname'); - - print qq!
%
!; - print qq!
\$
!; - - print qq!{setuptax} =~ /^Y$/i ? ' CHECKED' : '' ). - '>' - if dbdef->table('cust_main_county')->column('setuptax'); - - print qq!{recurtax} =~ /^Y$/i ? ' CHECKED' : '' ). - '>' - if dbdef->table('cust_main_county')->column('recurtax'); - - print ''; - -} - -print < - - - - - -END - -%> diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi deleted file mode 100755 index 0370ab726..000000000 --- a/httemplate/edit/cust_pay.cgi +++ /dev/null @@ -1,135 +0,0 @@ -<% - -my $conf = new FS::Conf; - -my %payby = ( - 'BILL' => 'Check', - 'CASH' => 'Cash', - 'WEST' => 'Western Union', - 'MCRD' => 'Manual credit card', -); - -my($link, $linknum, $paid, $payby, $payinfo, $quickpay, $_date); -if ( $cgi->param('error') ) { - $link = $cgi->param('link'); - $linknum = $cgi->param('linknum'); - $paid = $cgi->param('paid'); - $payby = $cgi->param('payby'); - $payinfo = $cgi->param('payinfo'); - $quickpay = $cgi->param('quickpay'); - $_date = $cgi->param('_date') ? str2time($cgi->param('_date')) : time; -} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) { - $link = 'custnum'; - $linknum = $1; - $paid = ''; - $payby = $cgi->param('payby') || 'BILL'; - $payinfo = ''; - $quickpay = $cgi->param('quickpay'); - $_date = time; -} elsif ( $cgi->param('invnum') =~ /^(\d+)$/ ) { - $link = 'invnum'; - $linknum = $1; - $paid = ''; - $payby = $cgi->param('payby') || 'BILL'; - $payinfo = ""; - $quickpay = ''; - $_date = time; -} else { - die "illegal query ". $cgi->keywords; -} - -my $paybatch = "webui-$_date-$$-". rand() * 2**32; - -my $title = 'Post '. $payby{$payby}. ' payment'; -$title .= " against Invoice #$linknum" if $link eq 'invnum'; - -%> - -<%= header($title, '') %> - -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -

-<% } %> - -<%= ntable("#cccccc",2) %> - - - - - - -
- - - - -<% -my $money_char = $conf->config('money_char') || '$'; -my $custnum; -if ( $link eq 'invnum' ) { - my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } ) - or die "unknown invnum $linknum"; - $custnum = $cust_bill->custnum; -} elsif ( $link eq 'custnum' ) { - $custnum = $linknum; -} -%> - -<%= small_custview($custnum, $conf->config('countrydefault')) %> - - - -

-Payment -<%= ntable("#cccccc", 2) %> - - Date - - "> - - - - - - Amount - <%= $money_char %> - by <%= $payby{$payby} %> - - -<% if ( $payby eq 'BILL' ) { %> - - - Check # - - - -<% } %> - - -<% if ( $link eq 'custnum' ) { %> - Auto-apply
to invoices - -<% } elsif ( $link eq 'invnum' ) { %> - Apply to - Invoice #<%= $linknum %> only - -<% } %> - - - - - - -
- -
- - diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi deleted file mode 100755 index ce1c86612..000000000 --- a/httemplate/edit/cust_pkg.cgi +++ /dev/null @@ -1,130 +0,0 @@ - -<% - -my %pkg = (); -my %comment = (); -my %all_pkg = (); -my %all_comment = (); -#foreach (qsearch('part_pkg', { 'disabled' => '' })) { -# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); -# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -#} -foreach (qsearch('part_pkg', {} )) { - $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); - next if $_->disabled; - $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -} - -my($custnum, %remove_pkg); -if ( $cgi->param('error') ) { - $custnum = $cgi->param('custnum'); - %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - %remove_pkg = (); -} - -my $p1 = popurl(1); -print header("Add/Edit Packages", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!
!; - -print qq!!; - -#current packages -my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } ); - -if (@cust_pkg) { - print < - - Pkg # - Package description - -

-END - - foreach (sort { $all_pkg{$a->getfield('pkgpart')} cmp $all_pkg{$b->getfield('pkgpart')} } @cust_pkg) { - my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') ); - my $checked = $remove_pkg{$pkgnum} ? ' CHECKED' : ''; - print < - - $pkgnum:\n - $all_pkg{$pkgpart} - $all_comment{$pkgpart} - -END - } - print qq!

!; -} - -print <
-END - -my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); -my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum }); - -my %agent_pkgs = map { ( $_->pkgpart , $all_pkg{$_->pkgpart} ) } - qsearch('type_pkgs',{'typenum'=> $agent->typenum }); - -my $count = 0; -my $pkgparts = 0; -print < - - Qty. - Package Description - -END -#foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { -foreach my $pkgpart ( sort { $agent_pkgs{$a} cmp $agent_pkgs{$b} } - keys(%agent_pkgs) ) { - $pkgparts++; - next unless exists $pkg{$pkgpart}; #skip disabled ones - #print qq!! if ( $count == 0 ); - my $value = $cgi->param("pkg$pkgpart") || 0; - print < - - $pkgpart: - $pkg{$pkgpart} - $comment{$pkgpart} - -END - $count ++ ; - #if ( $count == 2 ) { - # print qq!\n! ; - # $count = 0; - #} -} -print qq!!; - -unless ( $pkgparts ) { - my $p2 = popurl(2); - my $typenum = $agent->typenum; - my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } ); - my $atype = $agent_type->atype; - print <package definitions, or agent type -$atype not allowed to purchase -any packages.) -END -} - -#submit -print < - - - -END -%> diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi deleted file mode 100755 index 8955c7cee..000000000 --- a/httemplate/edit/cust_refund.cgi +++ /dev/null @@ -1,94 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $custnum = $cgi->param('custnum'); -my $refund = $cgi->param('refund'); -my $payby = $cgi->param('payby'); -my $reason = $cgi->param('reason'); - -my( $paynum, $cust_pay ) = ( '', '' ); -if ( $cgi->param('paynum') =~ /^(\d+)$/ ) { - $paynum = $1; - $cust_pay = qsearchs('cust_pay', { paynum=>$paynum } ) - or die "unknown payment # $paynum"; - $refund ||= $cust_pay->unrefunded; - if ( $custnum ) { - die "payment # $paynum is not for specified customer # $custnum" - unless $custnum == $cust_pay->custnum; - } else { - $custnum = $cust_pay->custnum; - } -} -die "no custnum or paynum specified!" unless $custnum; - -my $_date = time; - -my $p1 = popurl(1); - -print header('Refund '. ucfirst(lc($payby)). ' payment', ''); -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print <config('countrydefault')); -
- - - - - - - - -
-END - -if ( $cust_pay ) { - - #false laziness w/FS/FS/cust_pay.pm - my $payby = $cust_pay->payby; - my $payinfo = $cust_pay->payinfo; - $payby =~ s/^BILL$/Check/ if $payinfo; - $payby =~ s/^CHEK$/Electronic check/; - $payinfo = $cust_pay->payinfo_masked if $payby eq 'CARD'; - - print '
Payment'. ntable("#cccccc", 2). - 'Amount$'. - $cust_pay->paid. ''. - 'Date'. - time2str("%D",$cust_pay->_date). ''. - 'Method'. - ucfirst(lc($payby)). ' # '. $payinfo. ''; - #false laziness w/FS/FS/cust_main::realtime_refund_bop - if ( $cust_pay->paybatch =~ /^(\w+):(\w+)(:(\w+))?$/ ) { - my ( $processor, $auth, $order_number ) = ( $1, $2, $4 ); - print 'Processor'. - $processor. ''; - print 'Authorization'. - $auth. '' - if length($auth); - print 'Order number'. - $order_number. '' - if length($order_number); - } - print ''; -} - -print '
Refund'. ntable("#cccccc", 2). - 'Date'. - time2str("%D",$_date). ''; - -print qq!Amount\$!; - -print qq!Reason!; - -print < -
- - - - -END - -%> diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi deleted file mode 100755 index ee9b1c6b3..000000000 --- a/httemplate/edit/msgcat.cgi +++ /dev/null @@ -1,58 +0,0 @@ - -<% - -print header("Edit Message catalog", menubar( -# 'Main Menu' => $p, -)), '
'; - -print qq!Error: !. $cgi->param('error'). - '

' - if $cgi->param('error'); - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => 'en_US', - 'options' => { 'en_US'=>'en_US' }, - 'form_action' => 'process/msgcat.cgi', - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - "
Messages for locale $layer
". table(). - "Code". - "Message"; - $html .= "en_US Message" unless $layer eq 'en_US'; - $html .= ''; - - #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } - # qsearch('msgcat', { 'locale' => $layer } ) ) { - foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { - $html .= - ''. $msgcat->msgnum. ''. $msgcat->msgcode. ''. - '!; - unless ( $layer eq 'en_US' ) { - my $en_msgcat = qsearchs('msgcat', { - 'locale' => 'en_US', - 'msgcode' => $msgcat->msgcode, - } ); - $html .= ''. $en_msgcat->msg. ''; - } - $html .= ''; - } - - $html .= '
'; - - $html; - }, - -); - -print $widget->html; - -print < - - -END - -%> diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi deleted file mode 100755 index 32ca47af4..000000000 --- a/httemplate/edit/part_bill_event.cgi +++ /dev/null @@ -1,376 +0,0 @@ - -<% - -if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { - $cgi->param('eventpart', $1); -} else { - $cgi->param('eventpart', ''); -} - -my ($query) = $cgi->keywords; -my $action = ''; -my $part_bill_event = ''; -if ( $cgi->param('error') ) { - $part_bill_event = new FS::part_bill_event ( { - map { $_, scalar($cgi->param($_)) } fields('part_bill_event') - } ); -} -if ( $query && $query =~ /^(\d+)$/ ) { - $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1}); -} else { - $part_bill_event ||= new FS::part_bill_event {}; -} -$action ||= $part_bill_event->eventpart ? 'Edit' : 'Add'; -my $hashref = $part_bill_event->hashref; - -print header("$action Invoice Event Definition", menubar( - 'Main Menu' => popurl(2), - 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print '
'. - ''; -print "Invoice Event #", $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)"; - -print ntable("#cccccc",2), <Payby -After days -END - -print 'Disabled'; -print '{disabled} eq "Y"; -print '>'; -print ''; - -print 'Action'; - -#print ntable(); - -sub select_pkgpart { - my $label = shift; - my $plandata = shift; - my %selected = map { $_=>1 } split(/,\s*/, $plandata->{$label}); - qq('; -} - -sub select_agentnum { - my $plandata = shift; - #my $agentnum = $plandata->{'agentnum'}; - my %agentnums = map { $_=>1 } split(/,\s*/, $plandata->{'agentnum'}); - ''; -} - -my $conf = new FS::Conf; -my $money_char = $conf->config('money_char') || '$'; - -#this is pretty kludgy right here. -tie my %events, 'Tie::IxHash', - - 'fee' => { - 'name' => 'Late fee', - 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );', - 'html' => - 'Amount '. - '
Reason ', - 'weight' => 10, - }, - 'suspend' => { - 'name' => 'Suspend', - 'code' => '$cust_main->suspend();', - 'weight' => 10, - }, - 'suspend' => { - 'name' => 'Suspend if balance (this invoice and previous) over', - 'code' => '$cust_bill->cust_suspend_if_balance_over( %%%balanceover%%% );', - 'html' => " $money_char ". '', - 'weight' => 10, - }, - 'suspend-if-pkgpart' => { - 'name' => 'Suspend packages', - 'code' => '$cust_main->suspend_if_pkgpart(%%%if_pkgpart%%%);', - 'html' => sub { &select_pkgpart('if_pkgpart', @_) }, - 'weight' => 10, - }, - 'suspend-unless-pkgpart' => { - 'name' => 'Suspend packages except', - 'code' => '$cust_main->suspend_unless_pkgpart(%%%unless_pkgpart%%%);', - 'html' => sub { &select_pkgpart('unless_pkgpart', @_) }, - 'weight' => 10, - }, - 'cancel' => { - 'name' => 'Cancel', - 'code' => '$cust_main->cancel();', - 'weight' => 10, - }, - - 'addpost' => { - 'name' => 'Add postal invoicing', - 'code' => '$cust_main->invoicing_list_addpost(); "";', - 'weight' => 20, - }, - - 'comp' => { - 'name' => 'Pay invoice with a complimentary "payment"', - 'code' => '$cust_bill->comp();', - 'weight' => 30, - }, - - 'realtime-card' => { - 'name' => 'Run card with a Business::OnlinePayment realtime gateway', - 'code' => '$cust_bill->realtime_card();', - 'weight' => 30, - }, - - 'realtime-check' => { - 'name' => 'Run check with a Business::OnlinePayment realtime gateway', - 'code' => '$cust_bill->realtime_ach();', - 'weight' => 30, - }, - - 'realtime-lec' => { - 'name' => 'Run phone bill ("LEC") billing with a Business::OnlinePayment realtime gateway', - 'code' => '$cust_bill->realtime_lec();', - 'weight' => 30, - }, - - 'batch-card' => { - 'name' => 'Add card to the pending credit card batch', - 'code' => '$cust_bill->batch_card();', - 'weight' => 40, - }, - - 'send' => { - 'name' => 'Send invoice (email/print)', - 'code' => '$cust_bill->send();', - 'weight' => 50, - }, - - 'send_alternate' => { - 'name' => 'Send invoice (email/print) with alternate template', - 'code' => '$cust_bill->send(\'%%%templatename%%%\');', - 'html' => - '', - 'weight' => 50, - }, - - 'send_if_newest' => { - 'name' => 'Send invoice (email/print) with alternate template, if it is still the newest invoice (useful for late notices - set to 31 days or later)', - 'code' => '$cust_bill->send_if_newest(\'%%%if_newest_templatename%%%\');', - 'html' => - '', - 'weight' => 50, - }, - - 'send_agent' => { - 'name' => 'Send invoice (email/print) ', - 'code' => '$cust_bill->send(\'%%%agent_templatename%%%\', [ %%%agentnum%%% ], \'%%%agent_invoice_from%%%\');', - 'html' => sub { - ' - - - - - - - - - - - - -
only for agent(s) '. &select_agentnum(@_). '
with template - -
email From: - -
'; - }, - 'weight' => 50, - }, - - 'send_csv_ftp' => { - 'name' => 'Upload CSV invoice data to an FTP server', - 'code' => '$cust_bill->send_csv( protocol => \'ftp\', - server => \'%%%ftpserver%%%\', - username => \'%%%ftpusername%%%\', - password => \'%%%ftppassword%%%\', - dir => \'%%%ftpdir%%%\', - \'format\' => \'%%%ftpformat%%%\', - );', - 'html' => - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '
Format ("default" or "billco"): '. - ''. - ''. - '
FTP server: '. - '
FTP username: '. - ''. - '
FTP password: '. - ''. - '
FTP directory: '. - '
', - 'weight' => 50, - }, - - 'spool_csv' => { - 'name' => 'Spool CSV invoice data', - 'code' => '$cust_bill->spool_csv( - \'format\' => \'%%%spoolformat%%%\', - \'dest\' => \'%%%spooldest%%%\', - \'agent_spools\' => \'%%%spoolagent_spools%%%\', - );', - 'html' => sub { - my $plandata = shift; - - my $html = - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '
Format: '. - ''. - '
For destination: '. - ''. - '
Individual per-agent spools? {'spoolagent_spools'} ? 'CHECKED' : '' ). - '>'. - '
'; - - $html; - }, - 'weight' => 50, - }, - - 'bill' => { - 'name' => 'Generate invoices (normally only used with a Late Fee event)', - 'code' => '$cust_main->bill();', - 'weight' => 60, - }, - - 'apply' => { - 'name' => 'Apply unapplied payments and credits', - 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; "";', - 'weight' => 70, - }, - - 'collect' => { - 'name' => 'Collect on invoices (normally only used with a Late Fee and Generate Invoice events)', - 'code' => '$cust_main->collect();', - 'weight' => 80, - }, - -; - -foreach my $event ( keys %events ) { - my %plandata = map { /^(\w+) (.*)$/; ($1, $2); } - split(/\n/, $part_bill_event->plandata); - my $html = $events{$event}{html}; - if ( ref($html) eq 'CODE' ) { - $html = &{$html}(\%plandata); - } - while ( $html =~ /%%%(\w+)%%%/ ) { - my $field = $1; - $html =~ s/%%%$field%%%/$plandata{$field}/; - } - - print ntable( "#cccccc", 2). - qq!plan; - print qq!VALUE="!. $event. ":". $events{$event}{weight}. ":". - encode_entities($events{$event}{code}). - qq!">$events{$event}{name}!; - print ''. $html. '' if $html; - print qq!!; - print ''; -} - -#print ''; - -print < - -END - -print qq!!; -%> - - - - - diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi deleted file mode 100644 index b3d42bd96..000000000 --- a/httemplate/edit/part_export.cgi +++ /dev/null @@ -1,128 +0,0 @@ - -<% - -#if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) { -# $cgi->param('clone', $1); -#} else { -# $cgi->param('clone', ''); -#} - -my($query) = $cgi->keywords; -my $action = ''; -my $part_export = ''; -if ( $cgi->param('error') ) { - $part_export = new FS::part_export ( { - map { $_, scalar($cgi->param($_)) } fields('part_export') - } ); -} elsif ( $query =~ /^(\d+)$/ ) { - $part_export = qsearchs('part_export', { 'exportnum' => $1 } ); -} else { - $part_export = new FS::part_export; -} -$action ||= $part_export->exportnum ? 'Edit' : 'Add'; - -#my $exports = FS::part_export::export_info($svcdb); -my $exports = FS::part_export::export_info(); - -my %layers = map { $_ => "$_ - ". $exports->{$_}{desc} } keys %$exports; -$layers{''}=''; - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => $part_export->exporttype, - 'options' => \%layers, - 'form_name' => 'dummy', - 'form_action' => 'process/part_export.cgi', - 'form_text' => [qw( exportnum machine )], -# 'form_checkbox' => [qw()], - 'html_between' => "\n", - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - ntable("#cccccc",2); - - $html .= 'Description'. - $exports->{$layer}{notes}. '' - if $layer; - - foreach my $option ( keys %{$exports->{$layer}{options}} ) { - my $optinfo = $exports->{$layer}{options}{$option}; - die "Retreived non-ref export info option from $layer export: $optinfo" - unless ref($optinfo); - my $label = $optinfo->{label}; - my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text'; - my $value = $cgi->param($option) - || ( $part_export->exportnum && $part_export->option($option) ) - || ( (exists $optinfo->{default} && !$part_export->exportnum) - ? $optinfo->{default} - : '' - ); - $html .= qq!$label!; - if ( $type eq 'select' ) { - $html .= qq!'; - } elsif ( $type eq 'textarea' ) { - $html .= qq!'; - } elsif ( $type eq 'text' ) { - $html .= qq!'; - } elsif ( $type eq 'checkbox' ) { - $html .= qq!{$layer}{options}} ). '">'; - - $html .= ''; - - $html .= ''; - - $html; - }, -); - -%> -<%= header("$action Export", menubar( - 'Main Menu' => popurl(2), -), ' onLoad="visualize()"') -%> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -

-<% } %> - -
- - -<%= ntable("#cccccc",2) %> - - Export host - - - - - - Export - <%= $widget->html %> - - - diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi deleted file mode 100755 index 60365f628..000000000 --- a/httemplate/edit/part_pkg.cgi +++ /dev/null @@ -1,335 +0,0 @@ -<% - -if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) { - $cgi->param('clone', $1); -} else { - $cgi->param('clone', ''); -} -if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - $cgi->param('pkgnum', $1); -} else { - $cgi->param('pkgnum', ''); -} - -my ($query) = $cgi->keywords; - -my $part_pkg = ''; -if ( $cgi->param('error') ) { - $part_pkg = new FS::part_pkg ( { - map { $_, scalar($cgi->param($_)) } fields('part_pkg') - } ); -} - -my $action = ''; -my $clone_part_pkg = ''; -my $pkgpart = ''; -if ( $cgi->param('clone') ) { - $pkgpart = $cgi->param('clone'); - $action = 'Custom Pricing'; - $clone_part_pkg= qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } ); - $part_pkg ||= $clone_part_pkg->clone; - $part_pkg->disabled('Y'); #isn't sticky on errors -} elsif ( $query && $query =~ /^(\d+)$/ ) { - $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); - $pkgpart = $part_pkg->pkgpart; -} else { - unless ( $part_pkg ) { - $part_pkg = new FS::part_pkg {}; - $part_pkg->plan('flat'); - } -} -unless ( $part_pkg->plan ) { #backwards-compat - $part_pkg->plan('flat'); - $part_pkg->plandata("setup_fee=". $part_pkg->setup. "\n". - "recur_fee=". $part_pkg->recur. "\n"); -} -$action ||= $part_pkg->pkgpart ? 'Edit' : 'Add'; -my $hashref = $part_pkg->hashref; - -%> - -<%= header("$action Package Definition", menubar( - 'Main Menu' => popurl(2), - 'View all packages' => popurl(2). 'browse/part_pkg.cgi', -)) %> - -<% #), ' onLoad="visualize()"'); %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -<% } %> - - - -<%= itable('',8,1) %> - -Package information - -<%= ntable("#cccccc",2) %> - - Package Definition # - - <%= $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)" %> - - - - Package (customer-visible) - - - - - - Comment (customer-hidden) - - - - - - Promotional code - - - - - - Disable new orders - - {disabled} eq 'Y' ? ' CHECKED' : '' %> - - - - - - - -Tax information -<%= ntable("#cccccc", 2) %> - - Setup fee tax exempt - - {setuptax} eq 'Y' ? ' CHECKED' : '' %>> - - - - Recurring fee tax exempt - - {recurtax} eq 'Y' ? ' CHECKED' : '' %>> - - - -<% my $conf = new FS::Conf; %> -<% if ( $conf->exists('enable_taxclasses') ) { %> - - - Tax class - - <%= include('/elements/select-taxclass.html', $hashref->{taxclass} ) %> - - - -<% } else { %> - - <%= include('/elements/select-taxclass.html', $hashref->{taxclass} ) %> - -<% } %> - - - - - -<% - -my $thead = "\n\n". ntable('#cccccc', 2). - 'Quan.'; -$thead .= 'Primary' - if dbdef->table('pkg_svc')->column('primary_svc'); -$thead .= 'Service'; - -%> - -<%= itable('', 4, 1) %> -

Services included -<%= $thead %> - -<% - -my $where = "WHERE disabled IS NULL OR disabled = ''"; -if ( $pkgpart ) { - $where .= " OR 0 < ( SELECT quantity FROM pkg_svc - WHERE pkg_svc.svcpart = part_svc.svcpart - AND pkgpart = $pkgpart - )"; -} -my @part_svc = qsearch('part_svc', {}, '', $where); -my $q_part_pkg = $clone_part_pkg || $part_pkg; -my %pkg_svc = map { $_->svcpart => $_ } $q_part_pkg->pkg_svc; - -my @fixups = (); -my $count = 0; -my $columns = 3; -foreach my $part_svc ( @part_svc ) { - my $svcpart = $part_svc->svcpart; - my $pkg_svc = $pkg_svc{$svcpart} - || new FS::pkg_svc ( { - 'pkgpart' => $pkgpart, - 'svcpart' => $svcpart, - 'quantity' => 0, - 'primary_svc' => '', - } ); - - push @fixups, "pkg_svc$svcpart"; - -%> - - - - quantity || 0 %>"> - - - - primary_svc =~ /^Y/i ? ' CHECKED' : '' %>> - - - - <%= $part_svc->svc %> <%= $part_svc->disabled =~ /^Y/i ? ' (DISABLED' : '' %> - - - - <% $count++; - foreach ( 1 .. $columns-1 ) { - if ( $count == int( $_ * scalar(@part_svc) / $columns ) ) { - %> - <%= $thead %> - - <% } - } - %> - -<% } %> - - - -<% foreach my $f ( qw( clone pkgnum ) ) { %> - -<% } %> - - -<% - -# prolly should be in database -tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() }; - -my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); } - split("\n", ($clone_part_pkg||$part_pkg)->plandata ); -#warn join("\n", map { "$_: $plandata{$_}" } keys %plandata ). "\n"; - -tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans; - -my @form_select = (); -if ( $conf->exists('enable_taxclasses') ) { - push @form_select, 'taxclass'; -} else { - push @fixups, 'taxclass'; #hidden -} - -my @form_radio = (); -if ( dbdef->table('pkg_svc')->column('primary_svc') ) { - push @form_radio, 'pkg_svc_primary'; -} - -tie my %freq, 'Tie::IxHash', %FS::part_pkg::freq; -if ( $part_pkg->dbdef_table->column('freq')->type =~ /(int)/i ) { - delete $freq{$_} foreach grep { ! /^\d+$/ } keys %freq; -} - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => $part_pkg->plan, - 'options' => \%options, - 'form_name' => 'dummy', - 'form_action' => 'process/part_pkg.cgi', - 'form_text' => [ qw(pkg comment promo_code clone pkgnum pkgpart), - @fixups - ], - 'form_checkbox' => [ qw(setuptax recurtax disabled) ], - 'form_radio' => \@form_radio, - 'form_select' => \@form_select, - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - ntable("#cccccc",2); - $html .= ' - - Recurring fee frequency - '; - - my $href = $plans{$layer}->{'fields'}; - foreach my $field ( exists($plans{$layer}->{'fieldorder'}) - ? @{$plans{$layer}->{'fieldorder'}} - : keys %{ $href } - ) { - - $html .= ''. $href->{$field}{'name'}. ''; - - if ( ! exists($href->{$field}{'type'}) ) { - $html .= qq!!; - } elsif ( $href->{$field}{'type'} eq 'checkbox' ) { - $html .= qq!'; - } elsif ( $href->{$field}{'type'} =~ /^select/ ) { - $html .= '{$field}{'type'} eq 'select_multiple'; - $html .= qq! NAME="$field" onChange="fchanged(this)">!; - foreach my $record ( - qsearch( $href->{$field}{'select_table'}, - $href->{$field}{'select_hash'} ) - ) { - my $value = $record->getfield($href->{$field}{'select_key'}); - $html .= qq!