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/misc/batch-cust_pay.html | 396 --------------------- httemplate/misc/bill.cgi | 38 -- httemplate/misc/cancel-unaudited.cgi | 34 -- httemplate/misc/cancel_pkg.cgi | 15 - httemplate/misc/catchall.cgi | 133 ------- httemplate/misc/change_pkg.cgi | 66 ---- httemplate/misc/counties.cgi | 17 - httemplate/misc/cust_main-cancel.cgi | 22 -- httemplate/misc/cust_main-import.cgi | 51 --- httemplate/misc/cust_main-import_charges.cgi | 14 - httemplate/misc/delete-cust_credit.cgi | 16 - httemplate/misc/delete-cust_pay.cgi | 16 - httemplate/misc/delete-customer.cgi | 60 ---- httemplate/misc/delete-domain_record.cgi | 15 - httemplate/misc/delete-part_export.cgi | 15 - httemplate/misc/download-batch.cgi | 16 - httemplate/misc/dump.cgi | 19 - httemplate/misc/email-invoice.cgi | 17 - httemplate/misc/email_invoice_events.cgi | 6 - httemplate/misc/email_invoices.cgi | 6 - httemplate/misc/expire_pkg.cgi | 55 --- httemplate/misc/fax-invoice.cgi | 17 - httemplate/misc/fax_invoice_events.cgi | 6 - httemplate/misc/fax_invoices.cgi | 6 - httemplate/misc/link.cgi | 74 ---- httemplate/misc/meta-import.cgi | 64 ---- httemplate/misc/payment.cgi | 209 ----------- httemplate/misc/print-invoice.cgi | 17 - httemplate/misc/print_invoice_events.cgi | 6 - httemplate/misc/print_invoices.cgi | 6 - httemplate/misc/process/batch-cust_pay.cgi | 42 --- httemplate/misc/process/catchall.cgi | 33 -- httemplate/misc/process/cust_main-import.cgi | 30 -- .../misc/process/cust_main-import_charges.cgi | 26 -- httemplate/misc/process/delete-customer.cgi | 29 -- httemplate/misc/process/expire_pkg.cgi | 25 -- httemplate/misc/process/link.cgi | 76 ---- httemplate/misc/process/meta-import.cgi | 178 --------- httemplate/misc/process/payment.cgi | 148 -------- httemplate/misc/queue.cgi | 47 --- httemplate/misc/states.cgi | 16 - httemplate/misc/susp_pkg.cgi | 15 - httemplate/misc/unapply-cust_credit.cgi | 18 - httemplate/misc/unapply-cust_pay.cgi | 18 - httemplate/misc/unprovision.cgi | 29 -- httemplate/misc/unsusp_pkg.cgi | 15 - httemplate/misc/unvoid-cust_pay_void.cgi | 16 - httemplate/misc/upload-batch.cgi | 30 -- httemplate/misc/void-cust_pay.cgi | 16 - httemplate/misc/whois.cgi | 25 -- httemplate/misc/xmlhttp-cust_main-search.cgi | 21 -- httemplate/misc/xmlrpc.cgi | 17 - 52 files changed, 2302 deletions(-) delete mode 100644 httemplate/misc/batch-cust_pay.html delete mode 100755 httemplate/misc/bill.cgi delete mode 100755 httemplate/misc/cancel-unaudited.cgi delete mode 100755 httemplate/misc/cancel_pkg.cgi delete mode 100755 httemplate/misc/catchall.cgi delete mode 100755 httemplate/misc/change_pkg.cgi delete mode 100644 httemplate/misc/counties.cgi delete mode 100755 httemplate/misc/cust_main-cancel.cgi delete mode 100644 httemplate/misc/cust_main-import.cgi delete mode 100644 httemplate/misc/cust_main-import_charges.cgi delete mode 100755 httemplate/misc/delete-cust_credit.cgi delete mode 100755 httemplate/misc/delete-cust_pay.cgi delete mode 100755 httemplate/misc/delete-customer.cgi delete mode 100755 httemplate/misc/delete-domain_record.cgi delete mode 100755 httemplate/misc/delete-part_export.cgi delete mode 100644 httemplate/misc/download-batch.cgi delete mode 100644 httemplate/misc/dump.cgi delete mode 100755 httemplate/misc/email-invoice.cgi delete mode 100644 httemplate/misc/email_invoice_events.cgi delete mode 100644 httemplate/misc/email_invoices.cgi delete mode 100755 httemplate/misc/expire_pkg.cgi delete mode 100755 httemplate/misc/fax-invoice.cgi delete mode 100644 httemplate/misc/fax_invoice_events.cgi delete mode 100644 httemplate/misc/fax_invoices.cgi delete mode 100755 httemplate/misc/link.cgi delete mode 100644 httemplate/misc/meta-import.cgi delete mode 100644 httemplate/misc/payment.cgi delete mode 100755 httemplate/misc/print-invoice.cgi delete mode 100644 httemplate/misc/print_invoice_events.cgi delete mode 100644 httemplate/misc/print_invoices.cgi delete mode 100644 httemplate/misc/process/batch-cust_pay.cgi delete mode 100755 httemplate/misc/process/catchall.cgi delete mode 100644 httemplate/misc/process/cust_main-import.cgi delete mode 100644 httemplate/misc/process/cust_main-import_charges.cgi delete mode 100755 httemplate/misc/process/delete-customer.cgi delete mode 100755 httemplate/misc/process/expire_pkg.cgi delete mode 100755 httemplate/misc/process/link.cgi delete mode 100644 httemplate/misc/process/meta-import.cgi delete mode 100644 httemplate/misc/process/payment.cgi delete mode 100644 httemplate/misc/queue.cgi delete mode 100644 httemplate/misc/states.cgi delete mode 100755 httemplate/misc/susp_pkg.cgi delete mode 100755 httemplate/misc/unapply-cust_credit.cgi delete mode 100755 httemplate/misc/unapply-cust_pay.cgi delete mode 100755 httemplate/misc/unprovision.cgi delete mode 100755 httemplate/misc/unsusp_pkg.cgi delete mode 100755 httemplate/misc/unvoid-cust_pay_void.cgi delete mode 100644 httemplate/misc/upload-batch.cgi delete mode 100755 httemplate/misc/void-cust_pay.cgi delete mode 100644 httemplate/misc/whois.cgi delete mode 100644 httemplate/misc/xmlhttp-cust_main-search.cgi delete mode 100644 httemplate/misc/xmlrpc.cgi (limited to 'httemplate/misc') diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html deleted file mode 100644 index 20cc89045..000000000 --- a/httemplate/misc/batch-cust_pay.html +++ /dev/null @@ -1,396 +0,0 @@ -<%= header( 'Quick payment entry', - menubar( - 'Main Menu' => $p, #popurl(1), - 'Old-style quick payment entry' => - $p. 'search/cust_main-quickpay.html', - ), - ( $cgi->param('error') ? '' : 'onload="addRow()"' ), - ) -%> - -<% if ( $cgi->param('error') ) { %> - <%= $cgi->param('error') %>

-<% } %> - - -
- - - - - - - - - - - - - - - -<% my $row = 0; - if ( $cgi->param('error') ) { - my $param = $cgi->Vars; -%> - - <% for ( $row = 0; exists($param->{"custnum$row"}); $row++ ) { %> - - - - - - - - - - - - - - - - <% } %> - -<% } %> - -
Cust #CustomerAmountCheck #
- " rownum="<%= $row %>"> - - - " rownum="<%= $row %>"> - - - - - $" > - - " > - - <% if ( $param->{"error$row"} ) { %> - Error: <%= $param->{"error$row"} %> - <% } %> -
- - - -
- - -
- - -<%= include('/elements/xmlhttp.html', - 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', - 'subs' => [qw( custnum_search smart_search )], - ) -%> - - - - - diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi deleted file mode 100755 index 44d85b880..000000000 --- a/httemplate/misc/bill.cgi +++ /dev/null @@ -1,38 +0,0 @@ -<% - -#untaint custnum -my($query) = $cgi->keywords; -$query =~ /^(\d*)$/; -my $custnum = $1; -my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); -die "Can't find customer!\n" unless $cust_main; - -my $error = $cust_main->bill( -# 'time'=>$time - ); -#&eidiot($error) if $error; - -unless ( $error ) { - $cust_main->apply_payments; - $cust_main->apply_credits; - - $error = $cust_main->collect( - # 'invoice-time'=>$time, - #'batch_card'=> 'yes', - #'batch_card'=> 'no', - #'report_badcard'=> 'yes', - #'retry_card' => 'yes', - 'retry' => 'yes', - ); -} -#&eidiot($error) if $error; - -if ( $error ) { -%> - -<% - &idiot($error); -} else { - print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); -} -%> diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi deleted file mode 100755 index 43e439b58..000000000 --- a/httemplate/misc/cancel-unaudited.cgi +++ /dev/null @@ -1,34 +0,0 @@ -<% - -my $dbh = dbh; - -#untaint svcnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; - -#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -#die "Unknown svcnum!" unless $svc_acct; - -my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "Unknown svcnum!" unless $cust_svc; -my $cust_pkg = $cust_svc->cust_pkg; -if ( $cust_pkg ) { - &eidiot( 'This account has already been audited. Cancel the '. - qq!'. - 'package instead.'); -} - -my $error = $cust_svc->cancel; - -if ( $error ) { - %> - -<% - &eidiot($error); -} else { - print $cgi->redirect(popurl(2)); -} - -%> diff --git a/httemplate/misc/cancel_pkg.cgi b/httemplate/misc/cancel_pkg.cgi deleted file mode 100755 index 0487677df..000000000 --- a/httemplate/misc/cancel_pkg.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint pkgnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -my $error = $cust_pkg->cancel; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/catchall.cgi b/httemplate/misc/catchall.cgi deleted file mode 100755 index 3402b61e6..000000000 --- a/httemplate/misc/catchall.cgi +++ /dev/null @@ -1,133 +0,0 @@ - -<% - -my $conf = new FS::Conf; - -my($svc_domain, $svcnum, $pkgnum, $svcpart, $part_svc); -if ( $cgi->param('error') ) { - $svc_domain = new FS::svc_domain ( { - map { $_, scalar($cgi->param($_)) } fields('svc_domain') - } ); - $svcnum = $svc_domain->svcnum; - $pkgnum = $cgi->param('pkgnum'); - $svcpart = $cgi->param('svcpart'); - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; -} else { - my($query) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { #editing - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - } else { - - die "Invalid (svc_domain) svcnum!"; - - } -} - -my %email; -if ($pkgnum) { - - #find all possible user svcnums (and emails) - - #starting with that currently attached - if ($svc_domain->catchall) { - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_domain->catchall}); - $email{$svc_domain->catchall} = $svc_acct->email; - } - - #and including the rest for this customer - my($u_part_svc,@u_acct_svcparts); - foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) { - push @u_acct_svcparts,$u_part_svc->getfield('svcpart'); - } - - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - my($custnum)=$cust_pkg->getfield('custnum'); - my($i_cust_pkg); - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding - #record(s) in cust_svc ( for this - #pkgnum ! ) - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $email{$svc_acct->getfield('svcnum')}=$svc_acct->email; - } - } - } - -} else { - - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_domain->catchall}); - $email{$svc_domain->catchall} = $svc_acct->email; -} - -# add an absence of a catchall -$email{''} = "(none)"; - -my $p1 = popurl(1); -print header("Domain Catchall Edit", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!
!; - -#display - - #formatting - print "
";
-
-#svcnum
-print qq!!;
-print qq!Service #!, $svcnum ? $svcnum : " (NEW)", "";
-
-#pkgnum
-print qq!!;
- 
-#svcpart
-print qq!!;
-
-my($domain,$catchall)=(
-  $svc_domain->domain,
-  $svc_domain->catchall,
-);
-
-print qq!!;
-
-#catchall
-print qq!\n\nMail to (anything)@$domain forwards to ";
-
-	#formatting
-	print "
\n"; - -print qq!
!; - -print < - - -END - -%> diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi deleted file mode 100755 index 5346fd9d8..000000000 --- a/httemplate/misc/change_pkg.cgi +++ /dev/null @@ -1,66 +0,0 @@ - -<% - -my $pkgnum; -if ( $cgi->param('error') ) { - #$custnum = $cgi->param('custnum'); - #%remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg'); - $pkgnum = ($cgi->param('remove_pkg'))[0]; -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - #$custnum = $1; - $pkgnum = $1; - #%remove_pkg = (); -} - -my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } ) - or die "unknown pkgnum $pkgnum"; -my $custnum = $cust_pkg->custnum; - -my $conf = new FS::Conf; - -my $p1 = popurl(1); - -my $cust_main = $cust_pkg->cust_main - or die "can't get cust_main record for custnum ". $cust_pkg->custnum. - " ( pkgnum ". cust_pkg->pkgnum. ")"; -my $agent = $cust_main->agent; - -print header("Change Package", menubar( - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - 'Main Menu' => $p, -)); - -print qq!Error: !, $cgi->param('error'), - "

" - if $cgi->param('error'); - -my $part_pkg = $cust_pkg->part_pkg; - -print small_custview( $cust_main, $conf->config('countrydefault') ). - qq!!. - qq!!. - qq!!. - '
Current package: '. $part_pkg->pkg. ' - '. $part_pkg->comment. - qq!
New package: - - - -END -%> diff --git a/httemplate/misc/counties.cgi b/httemplate/misc/counties.cgi deleted file mode 100644 index 80ae616c9..000000000 --- a/httemplate/misc/counties.cgi +++ /dev/null @@ -1,17 +0,0 @@ -<% - - my( $state, $country ) = $cgi->param('arg'); - - my @counties = - sort - map { s/[\n\r]//g; $_; } - map { $_->county; } - qsearch( 'cust_main_county', - { 'state' => $state, - 'country' => $country, - }, - ) - ; - - -%>[ <%= join(', ', map { qq("$_") } @counties) %> ] diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi deleted file mode 100755 index 519e6c2b2..000000000 --- a/httemplate/misc/cust_main-cancel.cgi +++ /dev/null @@ -1,22 +0,0 @@ -<% - -my $custnum; -my $ban = ''; -if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { - $custnum = $1; - $ban = $cgi->param('ban'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ || die "Illegal custnum"; - $custnum = $1; -} - -my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - -my @errors = $cust_main->cancel( 'ban' => $ban ); -eidiot(join(' / ', @errors)) if scalar(@errors); - -#print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum); -print $cgi->redirect($p); - -%> diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi deleted file mode 100644 index 6b36f478d..000000000 --- a/httemplate/misc/cust_main-import.cgi +++ /dev/null @@ -1,51 +0,0 @@ - -<%= header('Batch Customer Import') %> -
-Import a CSV file containing customer records.

-Default file format is CSV, with the following field order: cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments

- -<% - #false laziness with edit/cust_main.cgi - my @agents = qsearch( 'agent', {} ); - die "No agents created!" unless @agents; - my $agentnum = $agents[0]->agentnum; #default to first - - if ( scalar(@agents) == 1 ) { -%> - -<% } else { %> -

Agent

-<% } %> - -<% - my @referrals = qsearch('part_referral',{}); - die "No advertising sources created!" unless @referrals; - my $refnum = $referrals[0]->refnum; #default to first - - if ( scalar(@referrals) == 1 ) { -%> - -<% } else { %> -

Advertising source

-<% } %> - - First package:

- - CSV Filename:

- -
- - - diff --git a/httemplate/misc/cust_main-import_charges.cgi b/httemplate/misc/cust_main-import_charges.cgi deleted file mode 100644 index 0822b9eb6..000000000 --- a/httemplate/misc/cust_main-import_charges.cgi +++ /dev/null @@ -1,14 +0,0 @@ - -<%= header('Batch Customer Charge') %> -
-Import a CSV file containing customer charges.

-Default file format is CSV, with the following field order: custnum, amount, description

-If amount is negative, a credit will be applied instead.

-

- - CSV Filename:

- -
- - - diff --git a/httemplate/misc/delete-cust_credit.cgi b/httemplate/misc/delete-cust_credit.cgi deleted file mode 100755 index 30de04d27..000000000 --- a/httemplate/misc/delete-cust_credit.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - -#untaint crednum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal crednum"; -my $crednum = $1; - -my $cust_credit = qsearchs('cust_credit',{'crednum'=>$crednum}); -my $custnum = $cust_credit->custnum; - -my $error = $cust_credit->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/delete-cust_pay.cgi b/httemplate/misc/delete-cust_pay.cgi deleted file mode 100755 index 3efd918ab..000000000 --- a/httemplate/misc/delete-cust_pay.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - -#untaint paynum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal paynum"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay',{'paynum'=>$paynum}); -my $custnum = $cust_pay->custnum; - -my $error = $cust_pay->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi deleted file mode 100755 index 430231737..000000000 --- a/httemplate/misc/delete-customer.cgi +++ /dev/null @@ -1,60 +0,0 @@ - -<% - -my $conf = new FS::Conf; -die "Customer deletions not enabled" unless $conf->exists('deletecustomers'); - -my($custnum, $new_custnum); -if ( $cgi->param('error') ) { - $custnum = $cgi->param('custnum'); - $new_custnum = $cgi->param('new_custnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ or die "Illegal query: $query"; - $custnum = $1; - $new_custnum = ''; -} -my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } ) - or die "Customer not found: $custnum"; - -print header('Delete customer'); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print - qq!
!, - qq!!; - -if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) { - print "Move uncancelled packages to customer number ", - qq!

!; -} - -print <completely remove all traces of this customer record. This -is not what you want if this is a real customer who has simply -canceled service with you. For that, cancel all of the customer's packages. -(you can optionally hide cancelled customers with the hidecancelledcustomers configuration option) -
-
Are you absolutely sure you want to delete this customer? -
- -END - -#Deleting a customer you have financial records on (i.e. credits) is -#typically considered fraudulant bookkeeping. Remember, deleting -#customers should ONLY be used for completely bogus records. You should -#NOT delete real customers who simply discontinue service. -# -#For real customers who simply discontinue service, cancel all of the -#customer's packages. Customers with all cancelled packages are not -#billed. There is no need to take further action to prevent billing on -#customers with all cancelled packages. -# -#Also see the "hidecancelledcustomers" and "hidecancelledpackages" -#configuration options, which will allow you to surpress the display of -#cancelled customers and packages, respectively. - -%> diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi deleted file mode 100755 index dcc2d5022..000000000 --- a/httemplate/misc/delete-domain_record.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint recnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal recnum"; -my $recnum = $1; - -my $domain_record = qsearchs('domain_record',{'recnum'=>$recnum}); - -my $error = $domain_record->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum); - -%> diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi deleted file mode 100755 index 7c4ab8b9d..000000000 --- a/httemplate/misc/delete-part_export.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint exportnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal exportnum"; -my $exportnum = $1; - -my $part_export = qsearchs('part_export',{'exportnum'=>$exportnum}); - -my $error = $part_export->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "browse/part_export.cgi"); - -%> diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi deleted file mode 100644 index 306ef5d63..000000000 --- a/httemplate/misc/download-batch.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - -#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes -http_header('Content-Type' => 'text/plain' ); - -for my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } - qsearch('cust_pay_batch', {} ) -) { - -$cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; -my( $mon, $y ) = ( $2, $1 ); -$mon = "0$mon" if $mon < 10; -my $exp = "$mon$y"; - -%>,,,,<%= $cust_pay_batch->cardnum %>,<%= $exp %>,<%= $cust_pay_batch->amount %>,<%= $cust_pay_batch->paybatchnum %> -<% } %> diff --git a/httemplate/misc/dump.cgi b/httemplate/misc/dump.cgi deleted file mode 100644 index dc1323bb3..000000000 --- a/httemplate/misc/dump.cgi +++ /dev/null @@ -1,19 +0,0 @@ -<% - if ( driver_name =~ /^Pg$/ ) { - my $dbname = (split(':', datasrc))[2]; - if ( $dbname =~ /[;=]/ ) { - my %elements = map { /^(\w+)=(.*)$/; $1=>$2 } split(';', $dbname); - $dbname = $elements{'dbname'}; - } - open(DUMP,"pg_dump $dbname |"); - } else { - eidiot "don't (yet) know how to dump ". driver_name. " databases\n"; - } - - http_header('Content-Type' => 'text/plain' ); - - while () { - print $_; - } - close DUMP; -%> diff --git a/httemplate/misc/email-invoice.cgi b/httemplate/misc/email-invoice.cgi deleted file mode 100755 index ad9ba1abb..000000000 --- a/httemplate/misc/email-invoice.cgi +++ /dev/null @@ -1,17 +0,0 @@ -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $template = $2; -my $invnum = $3; -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - -$cust_bill->email($template); - -my $custnum = $cust_bill->getfield('custnum'); - -print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); - -%> diff --git a/httemplate/misc/email_invoice_events.cgi b/httemplate/misc/email_invoice_events.cgi deleted file mode 100644 index 12d58d608..000000000 --- a/httemplate/misc/email_invoice_events.cgi +++ /dev/null @@ -1,6 +0,0 @@ -<% - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reemail'; -$server->process; - -%> diff --git a/httemplate/misc/email_invoices.cgi b/httemplate/misc/email_invoices.cgi deleted file mode 100644 index 0a3978395..000000000 --- a/httemplate/misc/email_invoices.cgi +++ /dev/null @@ -1,6 +0,0 @@ -<% - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill::process_reemail'; -$server->process; - -%> diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi deleted file mode 100755 index b59674a69..000000000 --- a/httemplate/misc/expire_pkg.cgi +++ /dev/null @@ -1,55 +0,0 @@ - -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $pkgnum = $1; - -#get package record -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "Unknown pkgnum $pkgnum" unless $cust_pkg; -my $part_pkg = $cust_pkg->part_pkg; - -my $custnum = $cust_pkg->getfield('custnum'); - -my $date = $cust_pkg->expire ? time2str('%D', $cust_pkg->expire) : ''; - -%> - -<%= header('Expire package', menubar( - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - 'Main Menu' => popurl(2) -)) %> - - - - - - -<%= $pkgnum %>: <%= $part_pkg->pkg. ' - '. $part_pkg->comment %> - -
- - - - - - -
Cancel package on - -
m/d/y -
- - - - -
- - diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi deleted file mode 100755 index 94fee2cf2..000000000 --- a/httemplate/misc/fax-invoice.cgi +++ /dev/null @@ -1,17 +0,0 @@ -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $template = $2; -my $invnum = $3; -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - -$cust_bill->fax($template); - -my $custnum = $cust_bill->getfield('custnum'); - -print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); - -%> diff --git a/httemplate/misc/fax_invoice_events.cgi b/httemplate/misc/fax_invoice_events.cgi deleted file mode 100644 index a8ded0550..000000000 --- a/httemplate/misc/fax_invoice_events.cgi +++ /dev/null @@ -1,6 +0,0 @@ -<% - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_refax'; -$server->process; - -%> diff --git a/httemplate/misc/fax_invoices.cgi b/httemplate/misc/fax_invoices.cgi deleted file mode 100644 index f16ba8b5e..000000000 --- a/httemplate/misc/fax_invoices.cgi +++ /dev/null @@ -1,6 +0,0 @@ -<% - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill::process_refax'; -$server->process; - -%> diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi deleted file mode 100755 index 18cd378d3..000000000 --- a/httemplate/misc/link.cgi +++ /dev/null @@ -1,74 +0,0 @@ - -<% - -my %link_field = ( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', -); - -my %link_field2 = ( - 'svc_acct' => { label => 'Domain', - field => 'domsvc', - type => 'select', - select_table => 'svc_domain', - select_key => 'svcnum', - select_label => 'domain' - }, -); - -my($query) = $cgi->keywords; -my($pkgnum, $svcpart) = ('', ''); -foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my $svc = $part_svc->getfield('svc'); -my $svcdb = $part_svc->getfield('svcdb'); -my $link_field = $link_field{$svcdb}; -my $link_field2 = $link_field2{$svcdb}; - -%> - -<%= header("Link to existing $svc") %> -
- -<% if ( $link_field ) { %> - - - <%= $link_field %> of existing service: -
- <% if ( $link_field2 ) { %> - - <%= $link_field2->{'label'} %> of existing service: - <% if ( $link_field2->{'type'} eq 'select' ) { %> - <% if ( $link_field2->{'select_table'} ) { %> - - <% } else { %> - Don't know how to process secondary link field for <%= $svcdb %> - (type=>select but no select_table) - <% } %> - <% } else { %> - Don't know how to process secondary link field for <%= $svcdb %> - (unknown type <%= $link_field2->{'type'} %>) - <% } %> -
- <% } %> -<% } else { %> - Service # of existing service: -<% } %> - - - -
-
- - diff --git a/httemplate/misc/meta-import.cgi b/httemplate/misc/meta-import.cgi deleted file mode 100644 index 2f3b7380d..000000000 --- a/httemplate/misc/meta-import.cgi +++ /dev/null @@ -1,64 +0,0 @@ - -<%= header('Import') %> -
-Import data from a DBI data source

- -<% - #false laziness with edit/cust_main.cgi - my @agents = qsearch( 'agent', {} ); - die "No agents created!" unless @agents; - my $agentnum = $agents[0]->agentnum; #default to first - - if ( scalar(@agents) == 1 ) { -%> - -<% } else { %> -

Agent

-<% } %> - -<% - my @referrals = qsearch('part_referral',{}); - die "No advertising sources created!" unless @referrals; - my $refnum = $referrals[0]->refnum; #default to first - - if ( scalar(@referrals) == 1 ) { -%> - -<% } else { %> -

Advertising source

-<% } %> - - First package:

- - - - - - - - - - - - - - -
DBI data source:
DBI username:
DBI password:
- - -
- - - diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi deleted file mode 100644 index d4fb4a2be..000000000 --- a/httemplate/misc/payment.cgi +++ /dev/null @@ -1,209 +0,0 @@ -<% - my %type = ( 'CARD' => 'credit card', - 'CHEK' => 'electronic check (ACH)', - ); - - $cgi->param('payby') =~ /^(CARD|CHEK)$/ - or die "unknown payby ". $cgi->param('payby'); - my $payby = $1; - - $cgi->param('custnum') =~ /^(\d+)$/ - or die "illegal custnum ". $cgi->param('custnum'); - my $custnum = $1; - - my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } ); - die "unknown custnum $custnum" unless $cust_main; - - my $balance = $cust_main->balance; - - my $payinfo = ''; - - #false laziness w/selfservice make_payment.html shortcut for one-country - my $conf = new FS::Conf; - my %states = map { $_->state => 1 } - qsearch('cust_main_county', { - 'country' => $conf->config('countrydefault') || 'US' - } ); - my @states = sort { $a cmp $b } keys %states; - - my $paybatch = "webui-payment-". time. "-$$-". rand() * 2**32; - -%> -<%= include( '/elements/header.html', "Process $type{$payby} payment" ) %> -<%= include( '/elements/small_custview.html', $cust_main ) %> -
- - - - -<% #include( '/elements/table.html', '#cccccc' ) %> -<%= ntable('#cccccc') %> - - Payment amount - -
- $"> -
- - -<% if ( $payby eq 'CARD' ) { - my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' ); - my $payname = $cust_main->first. ' '. $cust_main->getfield('last'); - my $address1 = $cust_main->address1; - my $address2 = $cust_main->address2; - my $city = $cust_main->city; - my $state = $cust_main->state; - my $zip = $cust_main->zip; - if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { - $payinfo = $cust_main->payinfo; - $paycvv = $cust_main->paycvv; - ( $month, $year ) = $cust_main->paydate_monthyear; - $payname = $cust_main->payname if $cust_main->payname; - } -%> - - Card number - - - - - - - - - -
- Exp. - - / - -
- - - - CVV2 - - (help) - - - - Exact name on card - - - Card billing address - - - - - Address line 2 - - - - - City - - - - - - - - - -
- - State - - Zip - -
- - - -<% } elsif ( $payby eq 'CHEK' ) { - my( $payinfo1, $payinfo2, $payname, $ss ) = ( '', '', '', '' ); - if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { - $cust_main->payinfo =~ /^(\d+)\@(\d+)$/ - or die "unparsable payinfo ". $cust_main->payinfo; - ($payinfo1, $payinfo2) = ($1, $2); - $payname = $cust_main->payname; - $ss = $cust_main->ss; - } -%> - - - - Account number - - - - ABA/Routing number - - - (help) - - - - Bank name - - - - - Account holder
- Social security or tax ID # - - - - -<% } %> - - - - - Remember this information - - - - payby ne 'DCRD' ) || ( $payby eq 'CHEK' && $cust_main->payby eq 'CHEK' ) ) ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> - Charge future payments to this <%= $type{$payby} %> automatically - - - -
- -
- - diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi deleted file mode 100755 index 6a4c2d7f1..000000000 --- a/httemplate/misc/print-invoice.cgi +++ /dev/null @@ -1,17 +0,0 @@ -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $template = $2; -my $invnum = $3; -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - -$cust_bill->print($template); - -my $custnum = $cust_bill->getfield('custnum'); - -print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); - -%> diff --git a/httemplate/misc/print_invoice_events.cgi b/httemplate/misc/print_invoice_events.cgi deleted file mode 100644 index c6a7885a4..000000000 --- a/httemplate/misc/print_invoice_events.cgi +++ /dev/null @@ -1,6 +0,0 @@ -<% - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reprint'; -$server->process; - -%> diff --git a/httemplate/misc/print_invoices.cgi b/httemplate/misc/print_invoices.cgi deleted file mode 100644 index d7b271c37..000000000 --- a/httemplate/misc/print_invoices.cgi +++ /dev/null @@ -1,6 +0,0 @@ -<% - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill::process_reprint'; -$server->process; - -%> diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi deleted file mode 100644 index 12d72e8a0..000000000 --- a/httemplate/misc/process/batch-cust_pay.cgi +++ /dev/null @@ -1,42 +0,0 @@ -<% - my $param = $cgi->Vars; - - #my $paybatch = $param->{'paybatch'}; - my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); - - my @cust_pay = (); - #my $row = 0; - #while ( exists($param->{"custnum$row"}) ) { - for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) { - push @cust_pay, new FS::cust_pay { - 'custnum' => $param->{"custnum$row"}, - 'paid' => $param->{"paid$row"}, - 'payby' => 'BILL', - 'payinfo' => $param->{"payinfo$row"}, - 'paybatch' => $paybatch, - } - if $param->{"custnum$row"} - || $param->{"paid$row"} - || $param->{"payinfo$row"}; - #$row++; - } - - my @errors = FS::cust_pay->batch_insert(@cust_pay); - my $num_errors = scalar(grep $_, @errors); - - if ( $num_errors ) { - - $cgi->param('error', "$num_errors error". ($num_errors>1 ? 's' : ''). - ' - Batch not processed, correct and resubmit' - ); - - my $erow=0; - $cgi->param('error'. $erow++, shift @errors) while @errors; - - %><%= $cgi->redirect($p.'batch-cust_pay.html?'. $cgi->query_string) - - %><% } else { - - %><%= $cgi->redirect(popurl(3). "search/cust_pay.cgi?magic=paybatch;paybatch=$paybatch") %> - - <% } %> diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi deleted file mode 100755 index 44a63f9f8..000000000 --- a/httemplate/misc/process/catchall.cgi +++ /dev/null @@ -1,33 +0,0 @@ -<% - -$FS::svc_domain::whois_hack=1; - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum =$1; - -my $old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum; - -my $new = new FS::svc_domain ( { - map { - ($_, scalar($cgi->param($_))); - } ( fields('svc_domain'), qw( pkgnum svcpart ) ) -} ); - -$new->setfield('action' => 'M'); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "catchall.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); -} - -%> diff --git a/httemplate/misc/process/cust_main-import.cgi b/httemplate/misc/process/cust_main-import.cgi deleted file mode 100644 index 9e1adce54..000000000 --- a/httemplate/misc/process/cust_main-import.cgi +++ /dev/null @@ -1,30 +0,0 @@ -<% - - my $fh = $cgi->upload('csvfile'); - #warn $cgi; - #warn $fh; - - my $error = defined($fh) - ? FS::cust_main::batch_import( { - filehandle => $fh, - agentnum => scalar($cgi->param('agentnum')), - refnum => scalar($cgi->param('refnum')), - pkgpart => scalar($cgi->param('pkgpart')), - 'fields' => [qw( cust_pkg.setup dayphone first last address1 address2 - city state zip comments )], - } ) - : 'No file'; - - if ( $error ) { - %> - - <% - eidiot($error); -# $cgi->param('error', $error); -# print $cgi->redirect( "${p}cust_main-import.cgi - } else { - %> - - <%= header('Import sucessful') %> <% - } -%> diff --git a/httemplate/misc/process/cust_main-import_charges.cgi b/httemplate/misc/process/cust_main-import_charges.cgi deleted file mode 100644 index 14df1bd8d..000000000 --- a/httemplate/misc/process/cust_main-import_charges.cgi +++ /dev/null @@ -1,26 +0,0 @@ -<% - - my $fh = $cgi->upload('csvfile'); - #warn $cgi; - #warn $fh; - - my $error = defined($fh) - ? FS::cust_main::batch_charge( { - filehandle => $fh, - 'fields' => [qw( custnum amount pkg )], - } ) - : 'No file'; - - if ( $error ) { - %> - - <% - eidiot($error); -# $cgi->param('error', $error); -# print $cgi->redirect( "${p}cust_main-import_charges.cgi - } else { - %> - - <%= header('Import sucessful') %> <% - } -%> diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi deleted file mode 100755 index 16bdbaea8..000000000 --- a/httemplate/misc/process/delete-customer.cgi +++ /dev/null @@ -1,29 +0,0 @@ -<% - -my $conf = new FS::Conf; -die "Customer deletions not enabled" unless $conf->exists('deletecustomers'); - -$cgi->param('custnum') =~ /^(\d+)$/; -my $custnum = $1; -my $new_custnum; -if ( $cgi->param('new_custnum') ) { - $cgi->param('new_custnum') =~ /^(\d+)$/ - or die "Illegal new customer number: ". $cgi->param('new_custnum'); - $new_custnum = $1; -} else { - $new_custnum = ''; -} -my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } ) - or die "Customer not found: $custnum"; - -my $error = $cust_main->delete($new_custnum); - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "delete-customer.cgi?". $cgi->query_string ); -} elsif ( $new_custnum ) { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$new_custnum"); -} else { - print $cgi->redirect(popurl(3)); -} -%> diff --git a/httemplate/misc/process/expire_pkg.cgi b/httemplate/misc/process/expire_pkg.cgi deleted file mode 100755 index dc35592ce..000000000 --- a/httemplate/misc/process/expire_pkg.cgi +++ /dev/null @@ -1,25 +0,0 @@ -<% - -#untaint date & pkgnum - -my $date; -if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $cust_pkg->hash; -$hash{expire}=$date; -my $new = new FS::cust_pkg ( \%hash ); -my $error = $new->replace($cust_pkg); -&eidiot($error) if $error; - -print $cgi->redirect(popurl(3). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi deleted file mode 100755 index c3d79e22c..000000000 --- a/httemplate/misc/process/link.cgi +++ /dev/null @@ -1,76 +0,0 @@ -<% - -my $DEBUG = 0; - -$cgi->param('pkgnum') =~ /^(\d+)$/; -my $pkgnum = $1; -$cgi->param('svcpart') =~ /^(\d+)$/; -my $svcpart = $1; -$cgi->param('svcnum') =~ /^(\d*)$/; -my $svcnum = $1; - -unless ( $svcnum ) { - my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); - my $svcdb = $part_svc->getfield('svcdb'); - $cgi->param('link_field') =~ /^(\w+)$/; - my $link_field = $1; - my %search = ( $link_field => $cgi->param('link_value') ); - if ( $cgi->param('link_field2') =~ /^(\w+)$/ ) { - $search{$1} = $cgi->param('link_value2'); - } - - my @svc_x = ( sort { ($a->cust_svc->pkgnum > 0) <=> ($b->cust_svc->pkgnum > 0) - or ($b->cust_svc->svcpart == $svcpart) - <=> ($a->cust_svc->svcpart == $svcpart) - } - qsearch( $svcdb, \%search ) - ); - - if ( $DEBUG ) { - warn scalar(@svc_x). " candidate accounts found for linking ". - "(svcpart $svcpart):\n"; - foreach my $svc_x ( @svc_x ) { - warn " ". $svc_x->email. - " (svcnum ". $svc_x->svcnum. ",". - " pkgnum ". $svc_x->cust_svc->pkgnum. ",". - " svcpart ". $svc_x->cust_svc->svcpart. ")\n"; - } - } - - my $svc_x = $svc_x[0]; - - eidiot("$link_field not found!") unless $svc_x; - - $svcnum = $svc_x->svcnum; - -} - -my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "svcnum not found!" unless $old; -my $conf = new FS::Conf; -my($error, $new); -if ( $old->pkgnum && ! $conf->exists('legacy_link-steal') ) { - $error = "svcnum $svcnum already linked to package ". $old->pkgnum; -} else { - $new = new FS::cust_svc ({ - 'svcnum' => $svcnum, - 'pkgnum' => $pkgnum, - 'svcpart' => $svcpart, - }); - - $error = $new->replace($old); -} - -unless ($error) { - #no errors, so let's view this customer. - my $custnum = $new->cust_pkg->custnum; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum". - "#cust_pkg$pkgnum" ); -} else { -%> - -<% - idiot($error); -} - -%> diff --git a/httemplate/misc/process/meta-import.cgi b/httemplate/misc/process/meta-import.cgi deleted file mode 100644 index 59d236f64..000000000 --- a/httemplate/misc/process/meta-import.cgi +++ /dev/null @@ -1,178 +0,0 @@ - -<%= header('Map tables') %> - - - -
- -<% - #use DBIx::DBSchema; - my $schema = new_native DBIx::DBSchema - map { $cgi->param($_) } qw( data_source username password ); - foreach my $field (qw( data_source username password )) { %> - VALUE="<%= $cgi->param($field) %>"> - <% } - - my %schema; - use Tie::DxHash; - tie %schema, 'Tie::DxHash'; - if ( $cgi->param('schema') ) { - my $schema_string = $cgi->param('schema'); - %> <% - %schema = map { /^\s*(\w+)\s*=>\s*(\w+)\s*$/ - or die "guru meditation #420: $_"; - ( $1 => $2 ); - } - split( /\n/, $schema_string ); - } - - #first page - unless ( $cgi->param('magic') ) { %> - - - <%= hashmaker('schema', [ $schema->tables ], - [ grep !/^h_/, dbdef->tables ], ) %> -
- <% - - #second page - } elsif ( $cgi->param('magic') eq 'process' ) { %> - - - <% - - my %unique; - foreach my $table ( keys %schema ) { - - my @from_columns = $schema->table($table)->columns; - my @fs_columns = dbdef->table($schema{$table})->columns; - - %> - <%= hashmaker( $table.'__'.$unique{$table}++, - \@from_columns => \@fs_columns, - $table => $schema{$table}, ) %> -


- <% - - } - - %> -
- <% - - #third (results) - } elsif ( $cgi->param('magic') eq 'process2' ) { - - print "
\n";
-
-    my %unique;
-    foreach my $table ( keys %schema ) {
-      ( my $spaces = $table ) =~ s/./ /g;
-      print "'$table' => { 'table' => '$schema{$table}',\n".
-            #(length($table) x ' '). "         'map'   => {\n";
-            "$spaces        'map'   => {\n";
-      my %map = map { /^\s*(\w+)\s*=>\s*(\w+)\s*$/
-                         or die "guru meditation #420: $_";
-                       ( $1 => $2 );
-                     }
-                 split( /\n/, $cgi->param($table.'__'.$unique{$table}++) );
-      foreach ( keys %map ) {
-        print "$spaces                     '$_' => '$map{$_}',\n";
-      }
-      print "$spaces                   },\n";
-      print "$spaces      },\n";
-
-    }
-    print "\n
"; - - } else { - warn "unrecognized magic: ". $cgi->param('magic'); - } - - %> -
- - - - <% - #hashmaker widget - sub hashmaker { - my($name, $from, $to, $labelfrom, $labelto) = @_; - my $fromsize = scalar(@$from); - my $tosize = scalar(@$to); - "'. - '
$labelfrom$labelto
". - qq!\n
". - qq!!. - '
'. - qq!\n
". - qq!!. - '
'. - qq!!. - '
'. - qq!!. - '
'. - "". - ''; - } - -%> diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi deleted file mode 100644 index fa0ede89c..000000000 --- a/httemplate/misc/process/payment.cgi +++ /dev/null @@ -1,148 +0,0 @@ -<% - -#some false laziness w/MyAccount::process_payment - -$cgi->param('custnum') =~ /^(\d+)$/ - or die "illegal custnum ". $cgi->param('custnum'); -my $custnum = $1; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); -die "unknown custnum $custnum" unless $cust_main; - -$cgi->param('amount') =~ /^\s*(\d*(\.\d\d)?)\s*$/ - or eidiot "illegal amount ". $cgi->param('amount'); -my $amount = $1; -eidiot "amount <= 0" unless $amount > 0; - -$cgi->param('year') =~ /^(\d+)$/ - or die "illegal year ". $cgi->param('year'); -my $year = $1; - -$cgi->param('month') =~ /^(\d+)$/ - or die "illegal month ". $cgi->param('month'); -my $month = $1; - -$cgi->param('payby') =~ /^(CARD|CHEK)$/ - or die "illegal payby ". $cgi->param('payby'); -my $payby = $1; -my %payby2bop = ( - 'CARD' => 'CC', - 'CHEK' => 'ECHECK', -); -my %payby2fields = ( - 'CARD' => [ qw( address1 address2 city state zip ) ], - 'CHEK' => [ qw( ss ) ], -); -my %type = ( 'CARD' => 'credit card', - 'CHEK' => 'electronic check (ACH)', - ); - -$cgi->param('payname') =~ /^([\w \,\.\-\']+)$/ - or eidiot gettext('illegal_name'). " payname: ". $cgi->param('payname'); -my $payname = $1; - -$cgi->param('paybatch') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ - or eidiot gettext('illegal_text'). " paybatch: ". $cgi->param('paybatch'); -my $paybatch = $1; - -my $payinfo; -my $paycvv = ''; -if ( $payby eq 'CHEK' ) { - - $cgi->param('payinfo1') =~ /^(\d+)$/ - or eidiot "illegal account number ". $cgi->param('payinfo1'); - my $payinfo1 = $1; - $cgi->param('payinfo2') =~ /^(\d+)$/ - or eidiot "illegal ABA/routing number ". $cgi->param('payinfo2'); - my $payinfo2 = $1; - $payinfo = $payinfo1. '@'. $payinfo2; - -} elsif ( $payby eq 'CARD' ) { - - $payinfo = $cgi->param('payinfo'); - $payinfo =~ s/\D//g; - $payinfo =~ /^(\d{13,16})$/ - or eidiot gettext('invalid_card'); # . ": ". $self->payinfo; - $payinfo = $1; - validate($payinfo) - or eidiot gettext('invalid_card'); # . ": ". $self->payinfo; - eidiot gettext('unknown_card_type') - if cardtype($payinfo) eq "Unknown"; - - if ( defined $cust_main->dbdef_table->column('paycvv') ) { - if ( length($cgi->param('paycvv') ) ) { - if ( cardtype($payinfo) eq 'American Express card' ) { - $cgi->param('paycvv') =~ /^(\d{4})$/ - or eidiot "CVV2 (CID) for American Express cards is four digits."; - $paycvv = $1; - } else { - $cgi->param('paycvv') =~ /^(\d{3})$/ - or eidiot "CVV2 (CVC2/CID) is three digits."; - $paycvv = $1; - } - } - } - -} else { - die "unknown payby $payby"; -} - -my $error = $cust_main->realtime_bop( $payby2bop{$payby}, $amount, - 'quiet' => 1, - 'payinfo' => $payinfo, - 'paydate' => "$year-$month-01", - 'payname' => $payname, - 'paybatch' => $paybatch, - 'paycvv' => $paycvv, - map { $_ => $cgi->param($_) } @{$payby2fields{$payby}} -); -eidiot($error) if $error; - -$cust_main->apply_payments; - -if ( $cgi->param('save') ) { - my $new = new FS::cust_main { $cust_main->hash }; - if ( $payby eq 'CARD' ) { - $new->set( 'payby' => ( $cgi->param('auto') ? 'CARD' : 'DCRD' ) ); - } elsif ( $payby eq 'CHEK' ) { - $new->set( 'payby' => ( $cgi->param('auto') ? 'CHEK' : 'DCHK' ) ); - } else { - die "unknown payby $payby"; - } - $new->set( 'payinfo' => $payinfo ); - $new->set( 'paydate' => "$year-$month-01" ); - $new->set( 'payname' => $payname ); - - #false laziness w/FS:;cust_main::realtime_bop - check both to make sure - # working correctly - my $conf = new FS::Conf; - if ( $payby eq 'CARD' && - grep { $_ eq cardtype($payinfo) } $conf->config('cvv-save') ) { - $new->set( 'paycvv' => $paycvv ); - } else { - $new->set( 'paycvv' => ''); - } - - $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}}; - - my $error = $new->replace($cust_main); - eidiot "payment processed sucessfully, but error saving info: $error" - if $error; - $cust_main = $new; -} - -#success! - -%> -<%= include( '/elements/header.html', ucfirst($type{$payby}). ' processing sucessful', - include('/elements/menubar.html', - 'Main menu' => popurl(3), - "View this customer (#$custnum)" => - popurl(3). "view/cust_main.cgi?$custnum", - ), - - ) -%> -<%= include( '/elements/small_custview.html', $cust_main ) %> - - diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi deleted file mode 100644 index ce9c8fbd3..000000000 --- a/httemplate/misc/queue.cgi +++ /dev/null @@ -1,47 +0,0 @@ -<% - -$cgi->param('action') =~ /^(new|del|(retry|remove) selected)$/ - or die "Illegal action"; -my $action = $1; - -my $job; -if ( $action eq 'new' || $action eq 'del' ) { - $cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum"; - my $jobnum = $1; - $job = qsearchs('queue', { 'jobnum' => $1 }) - or die "unknown jobnum $jobnum - ". - "it probably completed normally or was removed by another user"; -} - -if ( $action eq 'new' ) { - my %hash = $job->hash; - $hash{'status'} = 'new'; - $hash{'statustext'} = ''; - my $new = new FS::queue \%hash; - my $error = $new->replace($job); - die $error if $error; -} elsif ( $action eq 'del' ) { - my $error = $job->delete; - die $error if $error; -} elsif ( $action =~ /^(retry|remove) selected$/ ) { - foreach my $jobnum ( - map { /^jobnum(\d+)$/; $1; } grep /^jobnum\d+$/, $cgi->param - ) { - my $job = qsearchs('queue', { 'jobnum' => $jobnum }); - if ( $action eq 'retry selected' && $job ) { #new - my %hash = $job->hash; - $hash{'status'} = 'new'; - $hash{'statustext'} = ''; - my $new = new FS::queue \%hash; - my $error = $new->replace($job); - die $error if $error; - } elsif ( $action eq 'remove selected' && $job ) { #del - my $error = $job->delete; - die $error if $error; - } - } -} - -print $cgi->redirect(popurl(2). "browse/queue.cgi"); - -%> diff --git a/httemplate/misc/states.cgi b/httemplate/misc/states.cgi deleted file mode 100644 index cff2c9774..000000000 --- a/httemplate/misc/states.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - - my $country = $cgi->param('arg'); - - my @states = - sort - map { s/[\n\r]//g; $_; } - map { $_->state; } - qsearch( 'cust_main_county', - { 'country' => $country }, - 'DISTINCT ON ( state ) *', - ) - ; - - -%>[ <%= join(', ', map { qq("$_") } @states) %> ] diff --git a/httemplate/misc/susp_pkg.cgi b/httemplate/misc/susp_pkg.cgi deleted file mode 100755 index 4a19fa830..000000000 --- a/httemplate/misc/susp_pkg.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint pkgnum -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -my $error = $cust_pkg->suspend; -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/unapply-cust_credit.cgi b/httemplate/misc/unapply-cust_credit.cgi deleted file mode 100755 index c658d2acc..000000000 --- a/httemplate/misc/unapply-cust_credit.cgi +++ /dev/null @@ -1,18 +0,0 @@ -<% - -#untaint crednum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal crednum"; -my $crednum = $1; - -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -my $custnum = $cust_credit->custnum; - -foreach my $cust_credit_bill ( $cust_credit->cust_credit_bill ) { - my $error = $cust_credit_bill->delete; - eidiot($error) if $error; -} - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi deleted file mode 100755 index 28643ef6e..000000000 --- a/httemplate/misc/unapply-cust_pay.cgi +++ /dev/null @@ -1,18 +0,0 @@ -<% - -#untaint paynum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal paynum"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); -my $custnum = $cust_pay->custnum; - -foreach my $cust_bill_pay ( $cust_pay->cust_bill_pay ) { - my $error = $cust_bill_pay->delete; - eidiot($error) if $error; -} - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/unprovision.cgi b/httemplate/misc/unprovision.cgi deleted file mode 100755 index 3c92a4e2e..000000000 --- a/httemplate/misc/unprovision.cgi +++ /dev/null @@ -1,29 +0,0 @@ -<% - -my $dbh = dbh; - -#untaint svcnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; - -#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -#die "Unknown svcnum!" unless $svc_acct; - -my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "Unknown svcnum!" unless $cust_svc; - -my $custnum = $cust_svc->cust_pkg->custnum; - -my $error = $cust_svc->cancel; - -if ( $error ) { - %> - -<% - &eidiot($error); -} else { - print $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum"); -} - -%> diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi deleted file mode 100755 index 500872983..000000000 --- a/httemplate/misc/unsusp_pkg.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint pkgnum -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -my $error = $cust_pkg->unsuspend; -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/unvoid-cust_pay_void.cgi b/httemplate/misc/unvoid-cust_pay_void.cgi deleted file mode 100755 index 539cd4a23..000000000 --- a/httemplate/misc/unvoid-cust_pay_void.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - -#untaint paynum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal paynum"; -my $paynum = $1; - -my $cust_pay_void = qsearchs('cust_pay_void', { 'paynum' => $paynum } ); -my $custnum = $cust_pay_void->custnum; - -my $error = $cust_pay_void->unvoid; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/upload-batch.cgi b/httemplate/misc/upload-batch.cgi deleted file mode 100644 index 5d0150177..000000000 --- a/httemplate/misc/upload-batch.cgi +++ /dev/null @@ -1,30 +0,0 @@ -<% - - my $fh = $cgi->upload('batch_results'); - my $filename = $cgi->param('batch_results'); - $filename =~ /^(.*[\/\\])?([^\/\\]+)$/ - or die "unparsable filename: $filename\n"; - my $paybatch = $2; - - my $error = defined($fh) - ? FS::cust_pay_batch::import_results( { - 'filehandle' => $fh, - 'format' => $cgi->param('format'), - 'paybatch' => $paybatch, - } ) - : 'No file'; - - if ( $error ) { - %> - - <% - eidiot($error); -# $cgi->param('error', $error); -# print $cgi->redirect( "${p}cust_main-import.cgi - } else { - %> - - <%= header('Batch results upload sucessful') %> <% - } -%> - diff --git a/httemplate/misc/void-cust_pay.cgi b/httemplate/misc/void-cust_pay.cgi deleted file mode 100755 index 4eec60892..000000000 --- a/httemplate/misc/void-cust_pay.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - -#untaint paynum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal paynum"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay',{'paynum'=>$paynum}); -my $custnum = $cust_pay->custnum; - -my $error = $cust_pay->void; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/whois.cgi b/httemplate/misc/whois.cgi deleted file mode 100644 index dd7851dc2..000000000 --- a/httemplate/misc/whois.cgi +++ /dev/null @@ -1,25 +0,0 @@ -<% - my $svcnum = $cgi->param('svcnum'); - my $custnum = $cgi->param('custnum'); - my $domain = $cgi->param('domain'); - -%> -<%= header("Whois $domain", menubar( - ( $custnum - ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : () - ), - "View this domain (#$svcnum)" => "${p}view/svc_domain.cgi?$svcnum", - "Main menu" => $p, -)) %> -<% my $whois = eval { whois($domain) }; - if ( $@ ) { - ( $whois = $@ ) =~ s/ at \/.*Net\/Whois\/Raw\.pm line \d+.*$//s; - } else { - $whois =~ s/^\n+//; - } -%> -
<%= $whois %>
- - diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi deleted file mode 100644 index 8dbd5a4f2..000000000 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ /dev/null @@ -1,21 +0,0 @@ -<% - my $sub = $cgi->param('sub'); - - if ( $sub eq 'custnum_search' ) { - - my $custnum = $cgi->param('arg'); - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - - %>"<%= $cust_main ? $cust_main->name : '' %>" - -<% } elsif ( $sub eq 'smart_search' ) { - - my $string = $cgi->param('arg'); - my @cust_main = smart_search( 'search' => $string ); - my $return = [ map [ $_->custnum, $_->name ], @cust_main ]; - - %><%= objToJson($return) %> - -<% } %> - - diff --git a/httemplate/misc/xmlrpc.cgi b/httemplate/misc/xmlrpc.cgi deleted file mode 100644 index 53ef8fb80..000000000 --- a/httemplate/misc/xmlrpc.cgi +++ /dev/null @@ -1,17 +0,0 @@ -<% - - my $request_xml = $cgi->param('POSTDATA'); - - #$r->log_error($request_xml); - - my $fsxmlrpc = new FS::XMLRPC; - my ($error, $response_xml) = $fsxmlrpc->serve($request_xml); - - #$r->log_error($error) if $error; - - http_header('Content-Type' => 'text/xml', - 'Content-Length' => length($response_xml)); - - print $response_xml; - -%> -- cgit v1.2.1