From eb061f5119325e666f0dff40d4089e5c1df58e17 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Sun, 16 Mar 2008 19:58:34 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'TRIXBOX_2_6'. --- httemplate/misc/batch-cust_pay.html | 32 -- httemplate/misc/bill.cgi | 45 --- httemplate/misc/bulk_change_pkg.cgi | 59 ---- httemplate/misc/cancel-unaudited.cgi | 33 -- httemplate/misc/cancel_cust.html | 74 ---- httemplate/misc/cancel_pkg.html | 109 ------ httemplate/misc/catchall.cgi | 118 ------- httemplate/misc/cdr-import.html | 22 -- httemplate/misc/change_pkg.cgi | 70 ---- httemplate/misc/counties.cgi | 7 - httemplate/misc/cust_main-cancel.cgi | 57 --- httemplate/misc/cust_main-import.cgi | 109 ------ httemplate/misc/cust_main-import_charges.cgi | 22 -- httemplate/misc/cust_main_note-import.cgi | 207 ----------- httemplate/misc/cust_main_note-import.html | 39 --- httemplate/misc/cust_pay-import.cgi | 62 ---- httemplate/misc/delete-agent_payment_gateway.cgi | 15 - httemplate/misc/delete-cust_credit.cgi | 21 -- httemplate/misc/delete-cust_pay.cgi | 21 -- httemplate/misc/delete-cust_refund.cgi | 21 -- httemplate/misc/delete-customer.cgi | 64 ---- httemplate/misc/delete-domain_record.cgi | 20 -- httemplate/misc/delete-part_export.cgi | 20 -- httemplate/misc/disable-payment_gateway.cgi | 25 -- httemplate/misc/download-batch.cgi | 213 ------------ httemplate/misc/dump.cgi | 20 -- httemplate/misc/elements/customer-table.html | 387 --------------------- httemplate/misc/email-invoice.cgi | 19 - httemplate/misc/email_events.cgi | 9 - httemplate/misc/email_invoice_events.cgi | 9 - httemplate/misc/email_invoices.cgi | 9 - httemplate/misc/fax-invoice.cgi | 19 - httemplate/misc/fax_events.cgi | 9 - httemplate/misc/fax_invoice_events.cgi | 9 - httemplate/misc/fax_invoices.cgi | 9 - httemplate/misc/inventory_item-import.html | 23 -- httemplate/misc/link.cgi | 84 ----- httemplate/misc/meta-import.cgi | 79 ----- httemplate/misc/order_pkg.html | 62 ---- httemplate/misc/payment.cgi | 254 -------------- httemplate/misc/print-invoice.cgi | 19 - httemplate/misc/print_events.cgi | 9 - httemplate/misc/print_invoice_events.cgi | 9 - httemplate/misc/print_invoices.cgi | 9 - httemplate/misc/process/batch-cust_pay.cgi | 47 --- httemplate/misc/process/bulk_change_pkg.cgi | 56 --- httemplate/misc/process/cancel_pkg.html | 79 ----- httemplate/misc/process/catchall.cgi | 35 -- httemplate/misc/process/cdr-import.html | 22 -- httemplate/misc/process/cust_main-import.cgi | 28 -- .../misc/process/cust_main-import_charges.cgi | 23 -- httemplate/misc/process/cust_main_note-import.cgi | 82 ----- httemplate/misc/process/cust_pay-import.cgi | 21 -- httemplate/misc/process/delete-customer.cgi | 33 -- httemplate/misc/process/inventory_item-import.html | 22 -- httemplate/misc/process/link.cgi | 72 ---- httemplate/misc/process/meta-import.cgi | 190 ---------- httemplate/misc/process/payment.cgi | 183 ---------- httemplate/misc/process/recharge_svc.html | 92 ----- httemplate/misc/process/timeworked.html | 57 --- httemplate/misc/queue.cgi | 49 --- httemplate/misc/recharge_svc.html | 105 ------ httemplate/misc/states.cgi | 7 - httemplate/misc/svc_acct-domains.cgi | 31 -- httemplate/misc/timeworked.html | 135 ------- httemplate/misc/unapply-cust_credit.cgi | 20 -- httemplate/misc/unapply-cust_pay.cgi | 20 -- httemplate/misc/unprovision.cgi | 26 -- httemplate/misc/unsusp_pkg.cgi | 20 -- httemplate/misc/unvoid-cust_pay_void.cgi | 21 -- httemplate/misc/upload-batch.cgi | 36 -- httemplate/misc/void-cust_pay.cgi | 26 -- httemplate/misc/whois.cgi | 27 -- httemplate/misc/xmlhttp-cust_main-search.cgi | 22 -- httemplate/misc/xmlrpc.cgi | 18 - 75 files changed, 4137 deletions(-) delete mode 100644 httemplate/misc/batch-cust_pay.html delete mode 100755 httemplate/misc/bill.cgi delete mode 100755 httemplate/misc/bulk_change_pkg.cgi delete mode 100755 httemplate/misc/cancel-unaudited.cgi delete mode 100644 httemplate/misc/cancel_cust.html delete mode 100755 httemplate/misc/cancel_pkg.html delete mode 100755 httemplate/misc/catchall.cgi delete mode 100644 httemplate/misc/cdr-import.html 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 100644 httemplate/misc/cust_main_note-import.cgi delete mode 100644 httemplate/misc/cust_main_note-import.html delete mode 100644 httemplate/misc/cust_pay-import.cgi delete mode 100644 httemplate/misc/delete-agent_payment_gateway.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-cust_refund.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/disable-payment_gateway.cgi delete mode 100644 httemplate/misc/download-batch.cgi delete mode 100644 httemplate/misc/dump.cgi delete mode 100644 httemplate/misc/elements/customer-table.html delete mode 100755 httemplate/misc/email-invoice.cgi delete mode 100644 httemplate/misc/email_events.cgi delete mode 100644 httemplate/misc/email_invoice_events.cgi delete mode 100644 httemplate/misc/email_invoices.cgi delete mode 100755 httemplate/misc/fax-invoice.cgi delete mode 100644 httemplate/misc/fax_events.cgi delete mode 100644 httemplate/misc/fax_invoice_events.cgi delete mode 100644 httemplate/misc/fax_invoices.cgi delete mode 100644 httemplate/misc/inventory_item-import.html delete mode 100755 httemplate/misc/link.cgi delete mode 100644 httemplate/misc/meta-import.cgi delete mode 100644 httemplate/misc/order_pkg.html delete mode 100644 httemplate/misc/payment.cgi delete mode 100755 httemplate/misc/print-invoice.cgi delete mode 100644 httemplate/misc/print_events.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/bulk_change_pkg.cgi delete mode 100755 httemplate/misc/process/cancel_pkg.html delete mode 100755 httemplate/misc/process/catchall.cgi delete mode 100644 httemplate/misc/process/cdr-import.html delete mode 100644 httemplate/misc/process/cust_main-import.cgi delete mode 100644 httemplate/misc/process/cust_main-import_charges.cgi delete mode 100644 httemplate/misc/process/cust_main_note-import.cgi delete mode 100644 httemplate/misc/process/cust_pay-import.cgi delete mode 100755 httemplate/misc/process/delete-customer.cgi delete mode 100644 httemplate/misc/process/inventory_item-import.html 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 100755 httemplate/misc/process/recharge_svc.html delete mode 100644 httemplate/misc/process/timeworked.html delete mode 100644 httemplate/misc/queue.cgi delete mode 100755 httemplate/misc/recharge_svc.html delete mode 100644 httemplate/misc/states.cgi delete mode 100644 httemplate/misc/svc_acct-domains.cgi delete mode 100755 httemplate/misc/timeworked.html 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 84889399d..000000000 --- a/httemplate/misc/batch-cust_pay.html +++ /dev/null @@ -1,32 +0,0 @@ -<% include('/elements/header.html', 'Quick payment entry') %> - -<% include('/elements/error.html') %> - -
- - - -<% include( "elements/customer-table.html", - header => [ '', 'Amount', 'Check #', '' ], - fields => [ sub {'$'}, 'paid', 'payinfo', 'error', ], - types => [ 'immutable', '', '', 'immutable', ], - sizes => [ 0, 8, 10, 0, ], - param => { () }, - ) %> - - - -
- - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Post payment batch'); - - diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi deleted file mode 100755 index 3c3c48c54..000000000 --- a/httemplate/misc/bill.cgi +++ /dev/null @@ -1,45 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -<% $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum") %> -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Bill customer now'); - -#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 $conf = new FS::Conf; - -my $error = $cust_main->bill( -# 'time'=>$time - ); - -unless ( $error ) { - $error = $cust_main->apply_payments_and_credits - || $cust_main->collect( - #'invoice-time'=>$time, - #'batch_card'=> 'yes', - #'batch_card'=> 'no', - #'report_badcard'=> 'yes', - #'retry_card' => 'yes', - - 'retry' => 'yes', - - #this is used only by cust_main::batch_card - #need to pick & create an actual config - #value if we're going to turn this on - #("realtime-backend" doesn't exist, - # "backend-realtime" is for something - # entirely different) - #'realtime' => $conf->exists('realtime-backend'), - ); -} - - diff --git a/httemplate/misc/bulk_change_pkg.cgi b/httemplate/misc/bulk_change_pkg.cgi deleted file mode 100755 index 93349859d..000000000 --- a/httemplate/misc/bulk_change_pkg.cgi +++ /dev/null @@ -1,59 +0,0 @@ -<% include('/elements/header-popup.html', "Change Packages") %> - -% if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') %> -

-% } - -
- - -% for my $param (qw(agentnum magic status classnum pkgpart)) { - -% } -% -% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { -% - "> - "> - "> - "> -% } - -<% ntable('#cccccc') %> - - - New package: - <% include('/elements/select-table.html', - 'table' => 'part_pkg', - 'name_col' => 'pkg', - 'empty_label' => 'Select package', - 'label_callback' => sub { $_[0]->pkgpart. ': '. - $_[0]->pkg. ' - '. - $_[0]->comment; - }, - 'element_name' => 'new_pkgpart', - 'curr_value' => ( $cgi->param('error') - ? scalar($cgi->param('new_pkgpart')) - : '' - ), - ) - %> - - - - - -
- - -
- - - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages'); - - diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi deleted file mode 100755 index 4919c6632..000000000 --- a/httemplate/misc/cancel-unaudited.cgi +++ /dev/null @@ -1,33 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -<% $cgi->redirect(popurl(2)) %> -%} - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unprovision customer service') - && $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services'); - -#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 ) { - errorpage( 'This account has already been audited. Cancel the '. - qq!'. - 'package instead.'); -} - -my $error = $cust_svc->cancel; - - diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html deleted file mode 100644 index bb4e1904a..000000000 --- a/httemplate/misc/cancel_cust.html +++ /dev/null @@ -1,74 +0,0 @@ -<% include('/elements/header-popup.html', 'Cancel customer' ) %> - -<% include('/elements/error.html') %> - -
- - - -

Permanently delete all services and cancel this customer? - - <% $ban %> - -

- -<% ntable("#cccccc", 2) %> - -<% include('/elements/tr-select-reason.html', - 'field' => 'reasonnum', - 'reason_class' => 'C', - #XXX these need to be sticky on errors too... - #'curr_value' => '', - 'control_button' => 'document.cust_cancel_popup.submit', - ) -%> - - - -
-

-          - -

- - - -<%init> - -my($custnum, $reasonnum, $submit, $cust_main, $curuser, $class); -if ( $cgi->param('error') ) { - $custnum = $cgi->param('custnum'); - $reasonnum = $cgi->param('reasonnum'); -} else { - my( $query ) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { - $custnum = $1; - } else { - die "illegal query ". $cgi->keywords; - } -} - -$curuser = $FS::CurrentUser::CurrentUser; - -die "access denied" unless $curuser->access_right('Cancel customer'); - -$cust_main = qsearchs( { - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $custnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -} ); -die "No customer # $custnum" unless $cust_main; - -my $ban = ''; -if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { - $ban = '

'. - ' Ban this customer\'s '; - if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { - $ban .= 'credit card'; - } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { - $ban .= 'ACH account'; - } -} - - - diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html deleted file mode 100755 index 8dffba72e..000000000 --- a/httemplate/misc/cancel_pkg.html +++ /dev/null @@ -1,109 +0,0 @@ -%# if ( $link eq 'popup' ) { - <% include('/elements/header-popup.html', $title ) %> -%# } else { -%# <% include("/elements/header.html", $title, '') %> -%# } - - - - - - -<% include('/elements/error.html') %> - -

- - - - -

-<% ucfirst($method) . " $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %> -<% ntable("#cccccc", 2) %> - -% if ($method eq 'expire' || $method eq 'adjourn') { - - <% $submit =~ /^(\w*)\s/ %> package on - - -
m/d/y - - - -%} -% - -<% include('/elements/tr-select-reason.html', - 'field' => 'reasonnum', - 'reason_class' => $class, - 'curr_value' => $reasonnum, - 'control_button' => 'document.sc_popup.submit', - ) -%> - - - -
- - -
- - - -<%init> - -my $date = time2str("%m/%d/%Y", time); - -my($pkgnum, $reasonnum); -if ( $cgi->param('error') ) { - $pkgnum = $cgi->param('pkgnum'); - $reasonnum = $cgi->param('reasonnum'); - $date = $cgi->param('date'); -} elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - $pkgnum = $1; - $reasonnum = ''; -} else { - die "illegal query ". $cgi->keywords; -} - -$cgi->param('method') =~ /^(\w+)$/ or die 'illegal method'; -my $method = $1; - -my($class, $submit, $right); -if ($method eq 'cancel') { - $class = 'C'; - $submit = 'Cancel Now'; - $right = 'Cancel customer package immediately'; -} elsif ($method eq 'expire') { - $class = 'C'; - $submit = 'Cancel Later'; - $right = 'Cancel customer package later'; -} elsif ($method eq 'suspend') { - $class = 'S'; - $submit = 'Suspend Now'; - $right = 'Suspend customer package'; -} elsif ($method eq 'adjourn') { - $class = 'S'; - $submit = "Suspend Later"; - $right = 'Suspend customer package later'; -} else { - die 'illegal query (unknown method param)'; -} - -my $curuser = $FS::CurrentUser::CurrentUser; -die "access denied" unless $curuser->access_right($right); - -my $title = ucfirst($method) . ' Package'; - -my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum}) - or die "Unknown pkgnum: $pkgnum"; - -my $part_pkg = $cust_pkg->part_pkg; - - diff --git a/httemplate/misc/catchall.cgi b/httemplate/misc/catchall.cgi deleted file mode 100755 index 240f34d0e..000000000 --- a/httemplate/misc/catchall.cgi +++ /dev/null @@ -1,118 +0,0 @@ -<% include('/elements/header.html', 'Domain Catchall Edit') %> - -<% include('/elements/error.html') %> - -
- - -Service #<% $svcnum ? $svcnum : ' (NEW)' |h %> -

- - - - - -% my $domain = $svc_domain->domain; -% my $catchall = $svc_domain->catchall; - - - -Mail to (anything)@<% $domain |h %> forwards to -

- - - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Edit domain catchall'); - -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); - - diff --git a/httemplate/misc/cdr-import.html b/httemplate/misc/cdr-import.html deleted file mode 100644 index 60f619e81..000000000 --- a/httemplate/misc/cdr-import.html +++ /dev/null @@ -1,22 +0,0 @@ -<% include("/elements/header.html",'Call Detail Record Import') %> -
-Import a CSV file containing Call Detail Records (CDRs).

-CDR Format:

- -Filename:

- - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - - diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi deleted file mode 100755 index d6a24fb32..000000000 --- a/httemplate/misc/change_pkg.cgi +++ /dev/null @@ -1,70 +0,0 @@ -<% include('/elements/header-popup.html', "Change Package") %> - -<% include('/elements/error.html') %> - -
- - - - -<% ntable('#cccccc') %> - - - Current package:  - - <% $part_pkg->pkgpart %>: <% $part_pkg->pkg %> - <% $part_pkg->comment %> - - - - - New package: - <% include('/elements/select-cust-part_pkg.html', - 'cust_main' => $cust_main, - 'element_name' => 'new_pkgpart', - 'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart, - 'curr_value' => ( $cgi->param('error') - ? scalar($cgi->param('new_pkgpart')) - : '' - ), - ) - %> - - - - - -
- - -
- - - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Change customer package'); - -my $pkgnum; -if ( $cgi->param('error') ) { - $pkgnum = ($cgi->param('remove_pkg'))[0]; -} else { - $pkgnum = $cgi->param('pkgnum'); -} -$pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum"; -$pkgnum = $1; - -my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } ) - or die "unknown pkgnum $pkgnum"; -my $custnum = $cust_pkg->custnum; - -my $conf = new FS::Conf; - -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; - -my $part_pkg = $cust_pkg->part_pkg; - - diff --git a/httemplate/misc/counties.cgi b/httemplate/misc/counties.cgi deleted file mode 100644 index c022a27d9..000000000 --- a/httemplate/misc/counties.cgi +++ /dev/null @@ -1,7 +0,0 @@ -[ <% join(', ', map { qq("$_") } @counties) %> ] -<%init> - -my( $state, $country ) = $cgi->param('arg'); -my @counties = counties($state, $country); - - diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi deleted file mode 100755 index 009a7d41b..000000000 --- a/httemplate/misc/cust_main-cancel.cgi +++ /dev/null @@ -1,57 +0,0 @@ -<% header("Customer cancelled") %> - - - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Cancel customer'); - -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; -} - -#false laziness w/process/cancel_pkg.html - -#untaint reasonnum -my $reasonnum = $cgi->param('reasonnum'); -$reasonnum =~ /^(-?\d+)$/ || die "Illegal reasonnum"; -$reasonnum = $1; - -if ($reasonnum == -1) { - $reasonnum = { - 'typenum' => scalar( $cgi->param('newreasonnumT') ), - 'reason' => scalar( $cgi->param('newreasonnum' ) ), - }; -} - -#eslaf - -my $cust_main = qsearchs( { - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $custnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -} ); - -warn "cancelling $cust_main"; -my @errors = $cust_main->cancel( - 'ban' => $ban, - 'reason' => $reasonnum, -); -my $error = join(' / ', @errors) if scalar(@errors); - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(1). "cancel_cust.html?". $cgi->query_string ); -} - - diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi deleted file mode 100644 index 84da38611..000000000 --- a/httemplate/misc/cust_main-import.cgi +++ /dev/null @@ -1,109 +0,0 @@ -<% include("/elements/header.html",'Batch Customer Import') %> - -Import a CSV file containing customer records. -

- -
- -<% &ntable("#cccccc", 2) %> - -<% include('/elements/tr-select-agent.html', - #'curr_value' => '', #$agentnum, - 'label' => "Agent", - 'empty_label' => 'Select agent', - ) -%> - - - Format - - - - - - - CSV filename - - -% #include('/elements/tr-select-part_referral.html') -% - - - - - - - - -
- -
- - - -Extended file format is CSV, with the following field order: agent_custid, refnum<%$req%>, last<%$req%>, first<%$req%>, address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country, daytime, night, ship_last, ship_first, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo<%$req%>, paycvv, paydate<%$req%>, invoicing_list, pkgpart, username, _password -

- -Extended plus company file format is CSV, with the following field order: agent_custid, refnum<%$req%>, last<%$req%>, first<%$req%>, company, address1<%$req%>, address2, city<%$req%>, state<%$req%>, zip<%$req%>, country, daytime, night, ship_last, ship_first, ship_company, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo<%$req%>, paycvv, paydate<%$req%>, invoicing_list, pkgpart, username, _password -

- -<%$req%> Required fields -

- -Field information: - - - -
- -<% include('/elements/footer.html') %> - -<%once> - -my $req = qq!*!; - - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - - diff --git a/httemplate/misc/cust_main-import_charges.cgi b/httemplate/misc/cust_main-import_charges.cgi deleted file mode 100644 index 3801929e8..000000000 --- a/httemplate/misc/cust_main-import_charges.cgi +++ /dev/null @@ -1,22 +0,0 @@ -<% include('/elements/header.html', '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:

- - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - - diff --git a/httemplate/misc/cust_main_note-import.cgi b/httemplate/misc/cust_main_note-import.cgi deleted file mode 100644 index b93c5c1cc..000000000 --- a/httemplate/misc/cust_main_note-import.cgi +++ /dev/null @@ -1,207 +0,0 @@ -<% include("/elements/header.html", 'Batch Customer Note Import') %> -% - -
- - - - -<% include('/elements/xmlhttp.html', - 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', - 'subs' => [qw( custnum_search )], - ) -%> - -% my $fh = $cgi->upload('csvfile'); -% my $csv = new Text::CSV_XS; -% my $skip_fuzzies = $cgi->param('fuzzies') ? 0 : 1; -% -% if ( defined($fh) ) { - - - - - - - - -% my $agentnum => scalar($cgi->param('agentnum')), -% my $line; -% my $row = 0; -% while ( defined($line=<$fh>) ) { -% $line =~ s/(\S*)\s*$/$1/; -% $line =~ s/^(.*)(#!).*/$1/; -% -% $csv->parse($line) or die "can't parse line: " . $csv->error_input(); -% my $custnum = 0; -% my @values = $csv->fields(); -% my $last = shift @values; -% if ($last =~ /^\s*(\d+)\s*$/ ) { -% $custnum = $1; -% $last = shift @values; -% } -% my $first = shift @values; -% my $note = join ' ', @values; -% next unless ( $last || $first || $note ); -% my @cust_main = (); -% warn "searching for: $last, $first" if ($first || $last); -% if ($custnum) { -% @cust_main = qsearch('cust_main', { 'custnum' => $custnum }); -% } else { -% @cust_main = FS::cust_main::smart_search( -% 'search' => "$last, $first", -% 'no_fuzzy_on_exact' => $skip_fuzzies, -% ) -% if ($first || $last); -% } -% - - - - - - - -% $row++; -% } -
Cust #CustomerLastFirstNote to be added
- - - - - - - - <% $first %> - - - <% $last %> - - - <% $note %> - -
- - - Preview mode -% } else { - No file supplied -% } - -
- - - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - - diff --git a/httemplate/misc/cust_main_note-import.html b/httemplate/misc/cust_main_note-import.html deleted file mode 100644 index d8fefa732..000000000 --- a/httemplate/misc/cust_main_note-import.html +++ /dev/null @@ -1,39 +0,0 @@ -<% include("/elements/header.html",'Batch Customer Note Import') %> - -
- -Import a CSV file containing customer notes records. -

- -File format is CSV, with the following field order: [custnum,] last, first, notefield1, notefield2, notefield3... -
-The optional custnum field is identified by being numeric. -Anything after the character sequence #! is ignored. -

- -<% &ntable("#cccccc") %> - - - CSV filename - - - - Include additional possibilites when exact match is found - - - - -

- - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - - - diff --git a/httemplate/misc/cust_pay-import.cgi b/httemplate/misc/cust_pay-import.cgi deleted file mode 100644 index 849a25bea..000000000 --- a/httemplate/misc/cust_pay-import.cgi +++ /dev/null @@ -1,62 +0,0 @@ -<% include("/elements/header.html",'Batch Payment Import') %> - -Import a CSV file containing customer payments. -

- -
- -<% &ntable("#cccccc", 2) %> - -<% include('/elements/tr-select-agent.html', - #'curr_value' => '', #$agentnum, - 'label' => "Agent", - 'empty_label' => 'Select agent', - ) -%> - - - Format - - - - - - - CSV filename - - - - - - - -
- -
- -Simple file format is CSV, with the following field order: custnum, agent_custid, amount, checknum -

- - - -Field information: - - - -
- -<% include('/elements/footer.html') %> diff --git a/httemplate/misc/delete-agent_payment_gateway.cgi b/httemplate/misc/delete-agent_payment_gateway.cgi deleted file mode 100644 index 20a202e0e..000000000 --- a/httemplate/misc/delete-agent_payment_gateway.cgi +++ /dev/null @@ -1,15 +0,0 @@ -% die "you don't have the 'Configuration' access right" -% unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -% -% my($query) = $cgi->keywords; -% $query =~ /^(\d+)$/ || die "Illegal agentgatewaynum"; -% my $agentgatewaynum = $1; -% -% my $agent_payment_gateway = qsearchs('agent_payment_gateway', { -% 'agentgatewaynum' => $agentgatewaynum, -% }); -% -% my $error = $agent_payment_gateway->delete; -% errorpage($error) if $error; -% -% print $cgi->redirect($p. "browse/agent.cgi"); diff --git a/httemplate/misc/delete-cust_credit.cgi b/httemplate/misc/delete-cust_credit.cgi deleted file mode 100755 index 03eb47299..000000000 --- a/httemplate/misc/delete-cust_credit.cgi +++ /dev/null @@ -1,21 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Delete credit'); - -#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; - - diff --git a/httemplate/misc/delete-cust_pay.cgi b/httemplate/misc/delete-cust_pay.cgi deleted file mode 100755 index 38e7e4ba1..000000000 --- a/httemplate/misc/delete-cust_pay.cgi +++ /dev/null @@ -1,21 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Delete payment'); - -#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; - - diff --git a/httemplate/misc/delete-cust_refund.cgi b/httemplate/misc/delete-cust_refund.cgi deleted file mode 100755 index 983a79da5..000000000 --- a/httemplate/misc/delete-cust_refund.cgi +++ /dev/null @@ -1,21 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Delete refund'); - -#untaint refundnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal refundnum"; -my $refundnum = $1; - -my $cust_refund = qsearchs('cust_refund',{'refundnum'=>$refundnum}); -my $custnum = $cust_refund->custnum; - -my $error = $cust_refund->delete; - - diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi deleted file mode 100755 index 17b7bda5e..000000000 --- a/httemplate/misc/delete-customer.cgi +++ /dev/null @@ -1,64 +0,0 @@ -<% include('/elements/header.html', 'Delete customer') %> - -<% include('/elements/error.html') %> - -
- - -%if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) { - Move uncancelled packages to customer number -

-%} - -This will 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? -
-
- -<% include('/elements/footer.html') %> - -%#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. - -<%init> - -my $conf = new FS::Conf; -die "Customer deletions not enabled in configuration" - unless $conf->exists('deletecustomers'); - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Delete customer'); - -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( { - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $custnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -} ) - or die 'Unknown custnum'; - -<%/init> diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi deleted file mode 100755 index 08eedde5f..000000000 --- a/httemplate/misc/delete-domain_record.cgi +++ /dev/null @@ -1,20 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum) %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice'); - -#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; - - diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi deleted file mode 100755 index 52404e0c4..000000000 --- a/httemplate/misc/delete-part_export.cgi +++ /dev/null @@ -1,20 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "browse/part_export.cgi") %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -#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; - - diff --git a/httemplate/misc/disable-payment_gateway.cgi b/httemplate/misc/disable-payment_gateway.cgi deleted file mode 100644 index 13e1f92bc..000000000 --- a/httemplate/misc/disable-payment_gateway.cgi +++ /dev/null @@ -1,25 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -%#<% $cgi->redirect(popurl(2). "browse/payment_gateway.html?showdiabled=$showdisabled") %> -<% $cgi->redirect(popurl(2). "browse/payment_gateway.html") %> -%} -<%init> - -die "access deined" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -#my $showdisabled = 0; -#$cgi->param('showdisabled') =~ /^(\d+)$/ and $showdisabled = $1; - -#$cgi->param('gatewaynum') =~ /^(\d+)$/ or die 'illegal gatewaynum'; -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ or die 'illegal gatewaynum'; -my $gatewaynum = $1; - -my $payment_gateway = - qsearchs('payment_gateway', { 'gatewaynum' => $gatewaynum } ); - -my $error = $payment_gateway->disable; - - diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi deleted file mode 100644 index 57905daf9..000000000 --- a/httemplate/misc/download-batch.cgi +++ /dev/null @@ -1,213 +0,0 @@ -%if ($format eq "BoM") { -% -% my($origid,$datacenter,$typecode,$shortname,$longname,$mybank,$myacct) = -% $conf->config("batchconfig-$format"); -% -<% sprintf( "A%10s%04u%06u%05u%54s\n",$origid,$pay_batch->batchnum,$jdate,$datacenter,""). - sprintf( "XD%03u%06u%-15s%-30s%09u%-12s \n",$typecode,$jdate,$shortname,$longname,$mybank,$myacct ) - %> -% -%}elsif ($format eq "PAP"){ -% -% my($origid,$datacenter,$typecode,$shortname,$longname,$mybank,$myacct) = -% $conf->config("batchconfig-$format"); -% -<% sprintf( "H%10sD%3s%06u%-15s%09u%-12s%04u%19s\n",$origid,$typecode,$cdate,$shortname,$mybank,$myacct,$pay_batch->batchnum,"") %> -% -% -%}elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){ -%# 1; -%}elsif ($format eq "csv-chase_canada-E-xactBatch"){ -% -% my($origid) = $conf->config("batchconfig-$format"); -<% sprintf( '$$E-xactBatchFileV1.0$$%s:%03u$$%s',$sdate,$pay_batch->batchnum, $origid) - %> -% -%}elsif ($format eq "ach-spiritone"){ -%# 1; -%}else{ -% die "Unknown format for batch in batchconfig. \n"; -%} -% -% -%for my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } -% qsearch('cust_pay_batch', -% {'batchnum'=>$pay_batch->batchnum} ) -%) { -% -% $cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; -% my( $mon, $y ) = ( $2, $1 ); -% if ( $conf->exists('batch-increment_expiration') ) { -% my( $curmon, $curyear ) = (localtime(time))[4,5]; -% $curmon++; $curyear-=100; -% $y++ while $y < $curyear || ( $y == $curyear && $mon < $curmon ); -% } -% $mon = "0$mon" if $mon =~ /^\d$/; -% $y = "0$y" if $y =~ /^\d$/; -% my $exp = "$mon$y"; -% -% if ( $first_download ) { -% my $balance = $cust_pay_batch->cust_main->balance; -% if ( $balance <= 0 ) { -% my $error = $cust_pay_batch->delete; -% if ( $error ) { -% $dbh->rollback or die $dbh->errstr if $oldAutoCommit; -% die $error; -% } -% next; -% } elsif ( $balance < $cust_pay_batch->amount ) { -% $cust_pay_batch->amount($balance); -% my $error = $cust_pay_batch->replace; -% if ( $error ) { -% $dbh->rollback or die $dbh->errstr if $oldAutoCommit; -% die $error; -% } -% #} elsif ( $balance > $cust_pay_batch->amount ) { -% } -% } -% -% $batchcount++; -% $batchtotal += $cust_pay_batch->amount; -% -% if ($format eq "BoM") { -% -% my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo ); -% -<% sprintf( "D%010.0f%09u%-12s%-29s%-19s\n",$cust_pay_batch->amount*100,$aba,$account,$cust_pay_batch->payname,$cust_pay_batch->paybatchnum) %> -% -% -% } elsif ($format eq "PAP"){ -% -% my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo ); -% -<% sprintf( "D%-23s%06u%-19s%09u%-12s%010.0f\n",$cust_pay_batch->payname,$cdate,$cust_pay_batch->paybatchnum,$aba,$account,$cust_pay_batch->amount*100) %> -% -% -% } elsif ($format eq "csv-td_canada_trust-merchant_pc_batch") { -% -% -,,,,<% $cust_pay_batch->payinfo %>,<% $exp %>,<% $cust_pay_batch->amount %>,<% $cust_pay_batch->paybatchnum %> -% -% -% } elsif ($format eq "csv-chase_canada-E-xactBatch"){ -% -% my $payname=$cust_pay_batch->payname; $payname =~ tr/",/ /; #payinfo too? :P -<% $cust_pay_batch->paybatchnum %>,<% $cust_pay_batch->custnum %>,<% $cust_pay_batch->invnum %>,"<% $payname %>",00,<% $cust_pay_batch->payinfo %>,<% $cust_pay_batch->amount %>,<% $exp %>,, -% -% -% }elsif ($format eq "ach-spiritone"){ -% -% my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo ); -% my $payname=$cust_pay_batch->first. " ". $cust_pay_batch->last; -% $payname =~ tr/",/ /; #payinfo too? -% my $batchline = qq!"$payname","!.$cust_pay_batch->paybatchnum. -% qq!","$aba","$account","27","!.$cust_pay_batch->amount. -% qq!","27","0.00"!; -% push @batchlines, $batchline; -<% $batchline %> -% -% } else { -% die "I'm already dead, but you did not know that.\n"; -% } -% -%} -% -%if ($format eq "BoM") { -% -% -<% sprintf( "YD%08u%014.0f%56s\n",$batchcount,$batchtotal*100,"" ). - sprintf( "Z%014u%05u%014u%05u%41s\n",$batchtotal*100,$batchcount,"0","0","" ) %> -% -% -%} elsif ($format eq "PAP"){ -% -% -<% sprintf( "T%08u%014.0f%57s\n",$batchcount,$batchtotal*100,"" ) %> -% -% -%} elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){ -% #1; -%} elsif ($format eq "csv-chase_canada-E-xactBatch"){ -% #1; -%} elsif ($format eq "ach-spiritone"){ -% #1; -%} else { -% die "I'm already dead (again), but you did not know that.\n"; -%} -% -<%init> - -my $conf=new FS::Conf; - -#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes -http_header('Content-Type' => 'text/plain' ); - -my $batchnum; -if ( $cgi->param('batchnum') =~ /^(\d+)$/ ) { - $batchnum = $1; -} else { - die "No batch number (bad URL) \n"; -} - -my $format; -if ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) { - $format = $1; -} else { - $format = $conf->config('batch-default_format'); -} - -my $autopost; -if ( $format eq 'ach-spiritone' ) { - $autopost = 1; -}else{ - $autopost = 0; -} - -my $oldAutoCommit = $FS::UID::AutoCommit; -local $FS::UID::AutoCommit = 0; -my $dbh = dbh; - -my $pay_batch = qsearchs('pay_batch', {'batchnum'=>$batchnum, 'status'=>'O'} ); -my $first_download = 1; -unless ($pay_batch) { - $pay_batch = qsearchs('pay_batch', {'batchnum'=>$batchnum, 'status'=>'I'} ) - if $FS::CurrentUser::CurrentUser->access_right('Reprocess batches'); - $first_download = 0; -} -die "No pending batch. \n" unless $pay_batch; - -my $error = $pay_batch->set_status('I'); -die "error updating batch status: $error\n" if $error; - -my $batchtotal=0; -my $batchcount=0; - -my (@date)=localtime($pay_batch->download); -my $jdate = sprintf("%03d", $date[5] % 100).sprintf("%03d", $date[7] + 1); -my $cdate = sprintf("%02d", $date[3]).sprintf("%02d", $date[4] + 1). - sprintf("%02d", $date[5] % 100); -my $sdate = sprintf("%02d", $date[5] % 100).'/'.sprintf("%02d", $date[4] + 1). - '/'.sprintf("%02d", $date[3]); - -my @batchlines = (); - -<%cleanup> -if ($autopost) { - my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc; - my $fh = new File::Temp( - TEMPLATE => 'paybatch.'. $batchnum .'.XXXXXXXX', - DIR => $dir, - ) or die "can't open temp file: $!\n"; - - print $fh map{ "$_\n" } @batchlines; - seek $fh, 0, 0; - - $error = $pay_batch->import_results( 'filehandle' => $fh, - 'format' => $format, - ); - die $error if $error; -} - -$dbh->commit or die $dbh->errstr if $oldAutoCommit; - - diff --git a/httemplate/misc/dump.cgi b/httemplate/misc/dump.cgi deleted file mode 100644 index 3b60b20ef..000000000 --- a/httemplate/misc/dump.cgi +++ /dev/null @@ -1,20 +0,0 @@ -% die "access denied" -% unless $FS::CurrentUser::CurrentUser->access_right('Export'); -% -% 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 { -% errorpage("don't (yet) know how to dump ". driver_name. " databases"); -% } -% -% http_header('Content-Type' => 'text/plain' ); -% -% while () { -% print $_; -% } -% close DUMP; diff --git a/httemplate/misc/elements/customer-table.html b/httemplate/misc/elements/customer-table.html deleted file mode 100644 index fc298b03e..000000000 --- a/httemplate/misc/elements/customer-table.html +++ /dev/null @@ -1,387 +0,0 @@ -% # options example... -% # -% # #listrefs... -% # 'header' => [ '#', 'Item' ], -% # 'fields' => [ -% # 'column', -% # sub { my ($row,$param) = @_; $param->{"column$row"}; }, -% # ], -% # 'sizes' => [], # sizes ignored for immutable -% # 'types' => ['immutable', ''], # immutable or ''/text -% # 'param' => { column0 => 1 }, # preset column of row 0 to 1 -% # - - - - - - - - -% foreach my $header ( @{$opt{header}} ) { - -% } - -% my $row = 0; -% for ( $row = 0; exists($param->{"custnum$row"}); $row++ ) { - - - - - - - -% my $col = 0; -% foreach my $field ( @{$opt{fields}} ) { -% my $value; -% if ( ref($field) eq 'CODE' ) { -% $value = &{$field}($row,$param); -% } else { -% $value = $param->{"$field$row"}; -% } -% my $name = (ref($field) eq 'CODE') ? "column${col}_$row" : "$field$row"; -% my $size = $sizes->[$col] || 10; - -% $col++; -% } - - -% } - - -
Cust #Customer<% $header %>
- " rownum="<% $row %>"> - - - " rownum="<% $row %>"> - - - - -% if (! $types->[$col] || $types->[$col] eq 'text') { - -% } elsif ($types->[$col] eq 'immutable') { - <% $value %> - -% } else { - Cannot represent unknown type: <% $types->[$col] %> -% } -
- -<% include('/elements/xmlhttp.html', - 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', - 'subs' => [qw( custnum_search smart_search )], - ) -%> - - - -<%init> - -my(%opt) = @_; - -$opt{prefix} = '' unless defined $opt{prefix}; -$opt{prefix} .= '_' if $opt{prefix}; - -my $types = $opt{'types'} ? [ @{$opt{'types'}} ] : []; -my $sizes = $opt{'sizes'} ? [ @{$opt{'sizes'}} ] : []; - -my $param = $opt{param}; -$param = $cgi->Vars if $cgi->param('error'); - - diff --git a/httemplate/misc/email-invoice.cgi b/httemplate/misc/email-invoice.cgi deleted file mode 100755 index 269722f67..000000000 --- a/httemplate/misc/email-invoice.cgi +++ /dev/null @@ -1,19 +0,0 @@ -<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -#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'); - - diff --git a/httemplate/misc/email_events.cgi b/httemplate/misc/email_events.cgi deleted file mode 100644 index e7a0e77f8..000000000 --- a/httemplate/misc/email_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_event::process_reemail', $cgi; - - diff --git a/httemplate/misc/email_invoice_events.cgi b/httemplate/misc/email_invoice_events.cgi deleted file mode 100644 index d65fe172b..000000000 --- a/httemplate/misc/email_invoice_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reemail', $cgi; - - diff --git a/httemplate/misc/email_invoices.cgi b/httemplate/misc/email_invoices.cgi deleted file mode 100644 index 78ca0f67d..000000000 --- a/httemplate/misc/email_invoices.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill::process_reemail', $cgi; - - diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi deleted file mode 100755 index e2e6db095..000000000 --- a/httemplate/misc/fax-invoice.cgi +++ /dev/null @@ -1,19 +0,0 @@ -<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -#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'); - - diff --git a/httemplate/misc/fax_events.cgi b/httemplate/misc/fax_events.cgi deleted file mode 100644 index 39cba0707..000000000 --- a/httemplate/misc/fax_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_event::process_refax', $cgi; - - diff --git a/httemplate/misc/fax_invoice_events.cgi b/httemplate/misc/fax_invoice_events.cgi deleted file mode 100644 index 05420eeca..000000000 --- a/httemplate/misc/fax_invoice_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_refax', $cgi; - - diff --git a/httemplate/misc/fax_invoices.cgi b/httemplate/misc/fax_invoices.cgi deleted file mode 100644 index a843523db..000000000 --- a/httemplate/misc/fax_invoices.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill::process_refax', $cgi; - - diff --git a/httemplate/misc/inventory_item-import.html b/httemplate/misc/inventory_item-import.html deleted file mode 100644 index f3636c0e7..000000000 --- a/httemplate/misc/inventory_item-import.html +++ /dev/null @@ -1,23 +0,0 @@ -<% include("/elements/header.html", $inventory_class->classname. 's') %> - -
- -Import a file containing <% $inventory_class->classname %>s, one per line.

- -Filename:

- - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -$cgi->param =~ /^(\d+)$/ or errorpage("illegal classnum"); -my $classnum = $1; -my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } ); - - diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi deleted file mode 100755 index 748eaa15f..000000000 --- a/httemplate/misc/link.cgi +++ /dev/null @@ -1,84 +0,0 @@ -<% include("/elements/header.html","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: -% } - - - - -
-
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services'); - -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' - }, -); - -$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum'; -my $pkgnum = $1; -$cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart'; -my $svcpart = $1; - -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}; - - diff --git a/httemplate/misc/meta-import.cgi b/httemplate/misc/meta-import.cgi deleted file mode 100644 index 5b3470c06..000000000 --- a/httemplate/misc/meta-import.cgi +++ /dev/null @@ -1,79 +0,0 @@ -<% include('/elements/header.html', '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:
- - -
- -<% include('/elements/footer.html') %> - -<%init> - -#there's no ACL for this... haven't used in ages -die 'meta-import not enabled; remove this if you want to use it'; - - diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html deleted file mode 100644 index 05cd99cc5..000000000 --- a/httemplate/misc/order_pkg.html +++ /dev/null @@ -1,62 +0,0 @@ -<% include('/elements/header-popup.html', 'Order new package' ) %> - - - -
- - - -<% ntable("#cccccc", 2) %> - - Package - - <% include('/elements/select-cust-part_pkg.html', - 'cust_main' => $cust_main, - 'onchange' => 'enable_order_pkg', - ) - %> - - - -% if ( $conf->exists('pkg_referral') ) { - <% include('/elements/tr-select-part_referral.html', - 'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum, - 'disable_empty' => 1, - 'multiple' => $conf->exists('pkg_referral-multiple'), - ) - %> -% } - - - -
- - -
- - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Order customer package'); - -my $conf = new FS::Conf; - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $custnum = $1; -my $cust_main = qsearchs({ - 'table' => 'cust_main', - 'hashref' => { 'custnum' => $custnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -}); - - diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi deleted file mode 100644 index f99f2f068..000000000 --- a/httemplate/misc/payment.cgi +++ /dev/null @@ -1,254 +0,0 @@ -<% include( '/elements/header.html', "Process $type{$payby} payment" ) %> -<% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %> -
- - - - - - - - - -% #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->paymask; -% $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, $paytype, $paystate, -% $stateid, $stateid_state ) -% = ( '', '', '', '', '', '', '', '' ); -% if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { -% $cust_main->paymask =~ /^([\dx]+)\@([\dx]+)$/i -% or die "unparsable payinfo ". $cust_main->payinfo; -% ($payinfo1, $payinfo2) = ($1, $2); -% $payname = $cust_main->payname; -% $ss = $cust_main->ss; -% $paytype = $cust_main->getfield('paytype'); -% $paystate = $cust_main->getfield('paystate'); -% $stateid = $cust_main->getfield('stateid'); -% $stateid_state = $cust_main->getfield('stateid_state'); -% } -% - - - - - Account number - - Type - - - - ABA/Routing number - - - (help) - - - - Bank name - - - - Bank state - <% include('../edit/cust_main/select-state.html', #meh - 'empty' => '(choose)', - 'state' => $paystate, - 'country' => $cust_main->country, - 'prefix' => 'pay', - ) %> - - - - Account holder
- Social security or tax ID # - - - - - - Account holder
- Driver’s license or state ID # - - - State - <% include('../edit/cust_main/select-state.html', #meh - 'empty' => '(choose)', - 'state' => $stateid_state, - 'country' => $cust_main->country, - 'prefix' => 'stateid_', - ) %> - -% } - - - - - - Remember this information - - -% if ($conf->exists("batch-enable")) { - - exists("paymentforcedtobatch") && $payby eq 'CHEK' ) ? 'CHECKED DISABLED' : '' %> NAME="batch" VALUE="1"> - Add to current batch -% if ($conf->exists("paymentforcedtobatch") && $payby eq 'CHEK' ) { - -% } - - -% } - - 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 - - - -
- -
- -<% include('/elements/footer.html') %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Process payment'); - -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 $payunique = "webui-payment-". time. "-$$-". rand() * 2**32; - - - - diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi deleted file mode 100755 index aeef68795..000000000 --- a/httemplate/misc/print-invoice.cgi +++ /dev/null @@ -1,19 +0,0 @@ -<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -#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'); - - diff --git a/httemplate/misc/print_events.cgi b/httemplate/misc/print_events.cgi deleted file mode 100644 index 8d83d3de1..000000000 --- a/httemplate/misc/print_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_event::process_reprint', $cgi; - - diff --git a/httemplate/misc/print_invoice_events.cgi b/httemplate/misc/print_invoice_events.cgi deleted file mode 100644 index c974d5f4e..000000000 --- a/httemplate/misc/print_invoice_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reprint', $cgi; - - diff --git a/httemplate/misc/print_invoices.cgi b/httemplate/misc/print_invoices.cgi deleted file mode 100644 index f859f6db8..000000000 --- a/httemplate/misc/print_invoices.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill::process_reprint', $cgi; - - diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi deleted file mode 100644 index 058a2251a..000000000 --- a/httemplate/misc/process/batch-cust_pay.cgi +++ /dev/null @@ -1,47 +0,0 @@ -% die "access denied" -% unless $FS::CurrentUser::CurrentUser->access_right('Post payment batch'); -% -% 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/bulk_change_pkg.cgi b/httemplate/misc/process/bulk_change_pkg.cgi deleted file mode 100755 index d2ab4bf49..000000000 --- a/httemplate/misc/process/bulk_change_pkg.cgi +++ /dev/null @@ -1,56 +0,0 @@ -% if ($error) { -<% $cgi->redirect(popurl(2)."/bulk_change_pkg.cgi?".$cgi->query_string ) %> -% } -<% include('/elements/header-popup.html', "Packages Changed") %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages'); - -my %search_hash = (); - -$search_hash{'query'} = $cgi->param('query'); - -for my $param (qw(agentnum magic status classnum pkgpart)) { - $search_hash{$param} = $cgi->param($param) - if $cgi->param($param); -} - -### -# parse dates -### - -#false laziness w/report_cust_pkg.html -my %disable = ( - 'all' => {}, - 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, - 'active' => { 'susp'=>1, 'cancel'=>1 }, - 'suspended' => { 'cancel' => 1 }, - 'cancelled' => {}, - '' => {}, -); - -foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { - - my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field); - - next if $beginning == 0 && $ending == 4294967295 - or $disable{$cgi->param('status')}->{$field}; - - $search_hash{$field} = [ $beginning, $ending ]; - -} - -my $sql_query = FS::cust_pkg->search_sql(\%search_hash); -$sql_query->{'select'} = 'cust_pkg.pkgnum'; - -my $error = FS::cust_pkg::bulk_change( [ $cgi->param('new_pkgpart') ], - [ map { $_->pkgnum } qsearch($sql_query) ], - ); - -$cgi->param("error", substr($error, 0, 512)); # arbitrary length believed - # suited for all supported - # browsers - - - diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html deleted file mode 100755 index d265c1849..000000000 --- a/httemplate/misc/process/cancel_pkg.html +++ /dev/null @@ -1,79 +0,0 @@ -<% header("Package $past{$method}") %> - - - -<%once> - -my %past = ( 'cancel' => 'cancelled', - 'expire' => 'expired', - 'suspend' => 'suspended', - 'adjourn' => 'adjourned', - ); - -#i'm sure this is false laziness with somewhere, at least w/misc/cancel_pkg.html -my %right = ( 'cancel' => 'Cancel customer package immediately', - 'expire' => 'Cancel customer package later', - 'suspend' => 'Suspend customer package', - 'adjourn' => 'Suspend customer package later', - ); - - -<%init> - -#untaint method -my $method = $cgi->param('method'); -$method =~ /^(cancel|expire|suspend|adjourn)$/ or die "Illegal method"; -$method = $1; - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right($right{$method}); - -#untaint pkgnum -my $pkgnum = $cgi->param('pkgnum'); -$pkgnum =~ /^(\d+)$/ or die "Illegal pkgnum"; -$pkgnum = $1; - -#untaint reasonnum -my $reasonnum = $cgi->param('reasonnum'); -$reasonnum =~ /^(-?\d+)$/ or die "Illegal reasonnum"; -$reasonnum = $1; - -my $date = time; -if ($method eq 'expire' || $method eq 'adjourn'){ - #untaint date - $date = $cgi->param('date'); - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date = $1; -} - -my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); - -#my $otaker = $FS::CurrentUser::CurrentUser->name; -#$otaker = $FS::CurrentUser::CurrentUser->username -# if ($otaker eq "User, Legacy"); - -if ($reasonnum == -1) { - $reasonnum = { - 'typenum' => scalar( $cgi->param('newreasonnumT') ), - 'reason' => scalar( $cgi->param('newreasonnum' ) ), - }; -} - -my $error; -if ($method eq 'expire' || $method eq 'adjourn'){ - my %hash = $cust_pkg->hash; - $hash{$method} = $date; - my $new = new FS::cust_pkg \%hash; - $error = $new->replace($cust_pkg, 'reason' => $reasonnum); -} else { - $error = $cust_pkg->$method( 'reason' => $reasonnum ); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cancel_pkg.html?". $cgi->query_string ); -} - - diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi deleted file mode 100755 index 0dda2eada..000000000 --- a/httemplate/misc/process/catchall.cgi +++ /dev/null @@ -1,35 +0,0 @@ -%if ($error) { -% $cgi->param('error', $error); -<% $cgi->redirect(popurl(2). "catchall.cgi?". $cgi->query_string ) %> -%} else { -<% $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum") %> -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Edit domain catchall'); - -$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'); -} - - diff --git a/httemplate/misc/process/cdr-import.html b/httemplate/misc/process/cdr-import.html deleted file mode 100644 index 4848fa325..000000000 --- a/httemplate/misc/process/cdr-import.html +++ /dev/null @@ -1,22 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include("/elements/header.html",'Import successful') %> - - <% include("/elements/footer.html",'Import successful') %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -my $fh = $cgi->upload('csvfile'); - -my $error = defined($fh) - ? FS::cdr::batch_import( { - 'filehandle' => $fh, - 'format' => $cgi->param('format'), - } ) - : 'No file'; - - diff --git a/httemplate/misc/process/cust_main-import.cgi b/httemplate/misc/process/cust_main-import.cgi deleted file mode 100644 index aa8cd5298..000000000 --- a/httemplate/misc/process/cust_main-import.cgi +++ /dev/null @@ -1,28 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include('/elements/header.html','Import successful') %> - <% include('/elements/footer.html') %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -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 )], - 'format' => scalar($cgi->param('format')), - } ) - : 'No file'; - - 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 3ca68944a..000000000 --- a/httemplate/misc/process/cust_main-import_charges.cgi +++ /dev/null @@ -1,23 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include('/elements/header.html','Import successful') %> - <% include('/elements/footer.html') %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -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'; - - diff --git a/httemplate/misc/process/cust_main_note-import.cgi b/httemplate/misc/process/cust_main_note-import.cgi deleted file mode 100644 index 6aa8b1d37..000000000 --- a/httemplate/misc/process/cust_main_note-import.cgi +++ /dev/null @@ -1,82 +0,0 @@ -<% include("/elements/header.html", "Batch Customer Note Import $op") %> - -The following items <% $op eq 'Preview' ? 'would not be' : 'were not' %> imported. (See below for imported items) -
-%  foreach my $row (@uninserted) {
-%    $csv->combine( (map{ $row->{$_} } qw(last first note) ),
-%                   $row->{error} ? ('#!', $row->{error}) : (),
-%                 );
-<% $csv->string %>
-%  }
-
- -The following items <% $op eq 'Preview' ? 'would be' : 'were' %> imported. (See above for unimported items) - -
-%  foreach my $row (@inserted) {
-%    $csv->combine( (map{ $row->{$_} } qw(custnum last first note) ),
-%                   ('#!', $row->{name}),
-%                 );
-<% $csv->string %>
-%  }
-
- -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -my $date = time; -my $otaker = $FS::CurrentUser::CurrentUser->username; -my $csv = new Text::CSV_XS; - -my $param = $cgi->Vars; - -my $op = $param->{preview} ? "Preview" : "Results"; - -my @inserted = (); -my @uninserted = (); -for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) { - if ( $param->{"custnum$row"} ) { -# my $cust_main_note = new FS::cust_main_note { -# 'custnum' => $param->{"custnum$row"}, -# '_date' => $date, -# 'otaker' => $otaker, -# 'comments' => $param->{"note$row"}, -# }; -# my $error = ''; -# $error = $cust_main_note->insert unless ($op eq "Preview"); - my $cust_main = qsearchs('cust_main', - { 'custnum' => $param->{"custnum$row"} } - ); - my $error; - if ($cust_main) { - $cust_main->comments - ? $cust_main->comments($cust_main->comments. " ". $param->{"note$row"}) - : $cust_main->comments($param->{"note$row"}); - $error = $cust_main->replace; - }else{ - $error = "Can't find customer " . $param->{"custnum$row"}; - } - my $result = { 'custnum' => $param->{"custnum$row"}, - 'last' => $param->{"last$row"}, - 'first' => $param->{"first$row"}, - 'note' => $param->{"note$row"}, - 'name' => $param->{"name$row"}, - 'error' => $error, - }; - if ($error) { - push @uninserted, $result; - }else{ - push @inserted, $result; - } - }else{ - push @uninserted, { 'custnum' => '', - 'last' => $param->{"last$row"}, - 'first' => $param->{"first$row"}, - 'note' => $param->{"note$row"}, - 'error' => '', - }; - } -} - diff --git a/httemplate/misc/process/cust_pay-import.cgi b/httemplate/misc/process/cust_pay-import.cgi deleted file mode 100644 index d4ff226ec..000000000 --- a/httemplate/misc/process/cust_pay-import.cgi +++ /dev/null @@ -1,21 +0,0 @@ -<% $cgi->redirect(popurl(3). "search/cust_pay.cgi?magic=paybatch;paybatch=$paybatch") %> -<%init> - -my $fh = $cgi->upload('csvfile'); - -# webbatch? I suppose -my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); - -my $error = defined($fh) - ? FS::cust_pay::batch_import( { - 'filehandle' => $fh, - 'agentnum' => scalar($cgi->param('agentnum')), - 'format' => scalar($cgi->param('format')), - 'paybatch' => $paybatch, - } ) - : 'No file'; - -errorpage($error) - if ( $error ); - - diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi deleted file mode 100755 index d509a5e0e..000000000 --- a/httemplate/misc/process/delete-customer.cgi +++ /dev/null @@ -1,33 +0,0 @@ -%if ( $error ) { -% $cgi->param('error', $error); -<% $cgi->redirect(popurl(2). "delete-customer.cgi?". $cgi->query_string ) %> -%} elsif ( $new_custnum ) { -<% $cgi->redirect(popurl(3). "view/cust_main.cgi?$new_custnum") %> -%} else { -<% $cgi->redirect(popurl(3)) %> -%} -<%init> - -my $conf = new FS::Conf; -die "Customer deletions not enabled in configuration" - unless $conf->exists('deletecustomers'); - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Delete customer'); - -$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); - - diff --git a/httemplate/misc/process/inventory_item-import.html b/httemplate/misc/process/inventory_item-import.html deleted file mode 100644 index 3aae202c7..000000000 --- a/httemplate/misc/process/inventory_item-import.html +++ /dev/null @@ -1,22 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include("/elements/header.html",'Import successful') %> - - <% include("/elements/footer.html",'Import successful') %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Import'); - -my $fh = $cgi->upload('filename'); - -my $error = defined($fh) - ? FS::inventory_item::batch_import( { - 'filehandle' => $fh, - 'classnum' => $cgi->param('classnum'), - } ) - : 'No file'; - - diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi deleted file mode 100755 index df15dca72..000000000 --- a/httemplate/misc/process/link.cgi +++ /dev/null @@ -1,72 +0,0 @@ -%unless ($error) { -% #no errors, so let's view this customer. -% my $custnum = $new->cust_pkg->custnum; -<% $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum#cust_pkg$pkgnum" ) %> -%} else { -% errorpage($error); -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services'); - -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]; - - errorpage("$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 { $old->hash }; - $new->pkgnum($pkgnum); - $new->svcpart($svcpart); - - $error = $new->replace($old); -} - - diff --git a/httemplate/misc/process/meta-import.cgi b/httemplate/misc/process/meta-import.cgi deleted file mode 100644 index 68ae49c60..000000000 --- a/httemplate/misc/process/meta-import.cgi +++ /dev/null @@ -1,190 +0,0 @@ -<% include("/elements/header.html",'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!!. -% '
'. -% "". -% ''; -% } -% -% -<%init> - -#there's no ACL for this... haven't used in ages -#make XSS-safe if this is used for more than just admins to import data.... -die 'meta-import not enabled; remove this if you want to use it'; - - diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi deleted file mode 100644 index 2baca1e39..000000000 --- a/httemplate/misc/process/payment.cgi +++ /dev/null @@ -1,183 +0,0 @@ -% if ( $cgi->param('batch') ) { - - <% include( '/elements/header.html', ucfirst($type{$payby}). ' processing successful', - include('/elements/menubar.html'), - - ) - %> - - <% include( '/elements/small_custview.html', $cust_main, '', '', popurl(3). "view/cust_main.cgi" ) %> - - <% include('/elements/footer.html') %> - -% } else { -<% $cgi->redirect(popurl(3). "view/cust_pay.html?paynum=$paynum" ) %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Process payment'); - -#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 errorpage("illegal amount ". $cgi->param('amount')); -my $amount = $1; -errorpage("amount <= 0") unless $amount > 0; - -$cgi->param('year') =~ /^(\d+)$/ - or errorpage("illegal year ". $cgi->param('year')); -my $year = $1; - -$cgi->param('month') =~ /^(\d+)$/ - or errorpage("illegal month ". $cgi->param('month')); -my $month = $1; - -$cgi->param('payby') =~ /^(CARD|CHEK)$/ - or errorpage("illegal payby ". $cgi->param('payby')); -my $payby = $1; -my %payby2fields = ( - 'CARD' => [ qw( address1 address2 city state zip ) ], - 'CHEK' => [ qw( ss paytype paystate stateid stateid_state ) ], -); -my %type = ( 'CARD' => 'credit card', - 'CHEK' => 'electronic check (ACH)', - ); - -$cgi->param('payname') =~ /^([\w \,\.\-\']+)$/ - or errorpage(gettext('illegal_name'). " payname: ". $cgi->param('payname')); -my $payname = $1; - -$cgi->param('payunique') =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ - or errorpage(gettext('illegal_text'). " payunique: ". $cgi->param('payunique')); -my $payunique = $1; - -$cgi->param('balance') =~ /^\s*(\-?\s*\d*(\.\d\d)?)\s*$/ - or errorpage("illegal balance"); -my $balance = $1; - -my $payinfo; -my $paycvv = ''; -if ( $payby eq 'CHEK' ) { - - if ($cgi->param('payinfo1') =~ /xx/i || $cgi->param('payinfo2') =~ /xx/i ) { - $payinfo = $cust_main->payinfo; - } else { - $cgi->param('payinfo1') =~ /^(\d+)$/ - or errorpage("illegal account number ". $cgi->param('payinfo1')); - my $payinfo1 = $1; - $cgi->param('payinfo2') =~ /^(\d+)$/ - or errorpage("illegal ABA/routing number ". $cgi->param('payinfo2')); - my $payinfo2 = $1; - $payinfo = $payinfo1. '@'. $payinfo2; - } - -} elsif ( $payby eq 'CARD' ) { - - $payinfo = $cgi->param('payinfo'); - if ($payinfo eq $cust_main->paymask) { - $payinfo = $cust_main->payinfo; - } - $payinfo =~ s/\D//g; - $payinfo =~ /^(\d{13,16})$/ - or errorpage(gettext('invalid_card')); # . ": ". $self->payinfo; - $payinfo = $1; - validate($payinfo) - or errorpage(gettext('invalid_card')); # . ": ". $self->payinfo; - errorpage(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 errorpage("CVV2 (CID) for American Express cards is four digits."); - $paycvv = $1; - } else { - $cgi->param('paycvv') =~ /^(\d{3})$/ - or errorpage("CVV2 (CVC2/CID) is three digits."); - $paycvv = $1; - } - } - } - -} else { - die "unknown payby $payby"; -} - -my $error = ''; -my $paynum = ''; -if ( $cgi->param('batch') ) { - - $error = $cust_main->batch_card( - 'payby' => $payby, - 'amount' => $amount, - 'payinfo' => $payinfo, - 'paydate' => "$year-$month-01", - 'payname' => $payname, - map { $_ => $cgi->param($_) } - @{$payby2fields{$payby}} - ); - errorpage($error) if $error; - -} else { - - $error = $cust_main->realtime_bop( $FS::payby::payby2bop{$payby}, $amount, - 'quiet' => 1, - 'manual' => 1, - 'balance' => $balance, - 'payinfo' => $payinfo, - 'paydate' => "$year-$month-01", - 'payname' => $payname, - 'payunique' => $payunique, - 'paycvv' => $paycvv, - 'paynum_ref' => \$paynum, - map { $_ => $cgi->param($_) } @{$payby2fields{$payby}} - ); - errorpage($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); - errorpage("payment processed successfully, but error saving info: $error") - if $error; - $cust_main = $new; -} - -#success! - - diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html deleted file mode 100755 index 147b9533a..000000000 --- a/httemplate/misc/process/recharge_svc.html +++ /dev/null @@ -1,92 +0,0 @@ -%unless ($error) { -% -% my ($amount, $seconds, $up, $down, $total) = (0, 0, 0, 0, 0); -% #should probably use payby.pm but whatever -% if ($payby eq 'PREP') { -% $error = $cust_main->get_prepay($prepaid, \$amount, \$seconds, \$up, \$down, \$total) -% || $svc_acct->increment_seconds($seconds) -% || $svc_acct->increment_upbytes($up) -% || $svc_acct->increment_downbytes($down) -% || $svc_acct->increment_totalbytes($total) -% || $cust_main->insert_cust_pay_prepay( $amount, $prepaid ); -% } elsif ( $payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP)$/ ) { -% my $part_pkg = $svc_acct->cust_svc->cust_pkg->part_pkg; -% $amount = $part_pkg->option('recharge_amount', 1); -% my %rhash = map { $_ =~ /^recharge_(.*)$/; $1, $part_pkg->option($_) } -% grep { $part_pkg->option($_, 1) } -% qw ( recharge_seconds recharge_upbytes recharge_downbytes -% recharge_totalbytes ); -% -% my $description = "Recharge"; -% $description .= " $rhash{seconds}s" if $rhash{seconds}; -% $description .= " $rhash{upbytes} up" if $rhash{upbytes}; -% $description .= " $rhash{downbytes} down" if $rhash{downbytes}; -% $description .= " $rhash{totalbytes} total" if $rhash{totalbytes}; -% -% $error = $cust_main->charge($amount, "Recharge " . $svc_acct->label, -% $description, $part_pkg->taxclass); -% -% if ($part_pkg->option('recharge_reset', 1)) { -% $error ||= $svc_acct->set_usage(\%rhash); -% }else{ -% $error ||= $svc_acct->recharge(\%rhash); -% } -% -% my $old_balance = $cust_main->balance; -% $error ||= $cust_main->bill; -% $error ||= $cust_main->apply_payments_and_credits; -% my $bill_error = $cust_main->collect('realtime' => 1) unless $error; -% $error ||= "Failed to collect - $bill_error" -% if $cust_main->balance > $old_balance && $cust_main->balance > 0 -% && $payby ne 'BILL'; -% -% } else { -% $error = "fatal error - unknown payby: $payby"; -% } -%} -% -%if ($error) { -% $cgi->param('error', $error); -% $dbh->rollback if $oldAutoCommit; -% print $cgi->redirect(popurl(2). "recharge_svc.html?". $cgi->query_string ); -%} -%$dbh->commit or die $dbh->errstr if $oldAutoCommit; -% -<% header("Package recharged") %> - - -<%init> - -my $conf = new FS::Conf; - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Recharge customer service'); - -#untaint svcnum -my $svcnum = $cgi->param('svcnum'); -$svcnum =~ /^(\d+)$/ || die "Illegal svcnum"; -$svcnum = $1; - -#untaint prepaid -my $prepaid = $cgi->param('prepaid'); -$prepaid =~ /^(\w*)$/; -$prepaid = $1; - -#untaint payby -my $payby = $cgi->param('payby'); -$payby =~ /^([A-Z]*)$/; -$payby = $1; - -my $error = ''; -my $svc_acct = qsearchs( 'svc_acct', {'svcnum'=>$svcnum} ); -$error = "Can't recharge service $svcnum. " unless $svc_acct; - -my $cust_main = $svc_acct->cust_svc->cust_pkg->cust_main; - -my $oldAutoCommit = $FS::UID::AutoCommit; -local $FS::UID::AutoCommit = 0; -my $dbh = dbh; - - diff --git a/httemplate/misc/process/timeworked.html b/httemplate/misc/process/timeworked.html deleted file mode 100644 index c589d768f..000000000 --- a/httemplate/misc/process/timeworked.html +++ /dev/null @@ -1,57 +0,0 @@ -% if ($error) { -<% $cgi->redirect(popurl(2). "timeworked.html?". $cgi->query_string) %> -% } else { -<% $cgi->redirect(popurl(3). "search/timeworked.html") %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Time queue'); - -my @acct_rt_transaction; -foreach my $transaction ( - map { /^transactionid(\d+)$/; $1; } grep /^transactionid\d+$/, $cgi->param -) { - my $s = "multiplier${transaction}_"; - my %multipliers = map { /^$s(\d+)$/; $1 => $cgi->param("$s$1"); } - grep /^$s\d+$/, $cgi->param; - my $msum = 0; - foreach(values %multipliers) {$msum += $_}; - - my $seconds = $cgi->param("seconds$transaction"); - my %seconds = - map { $_ => sprintf("%.0f", $seconds * $multipliers{$_} / $msum) } - (keys %multipliers); - my $sum = 0; - my $count = 0; - foreach (values %seconds) { - $sum += $_; - $count++; - } - - #fudge in some time if we're close - if (abs($seconds-$sum) <= $count) { - my $adjustment = $seconds-$sum; - foreach (keys %seconds) { # explicitly choose one? - $seconds{$_} += $adjustment; - last; - } - } else { - die "unexpectedly cannot apportion time"; - } - - foreach my $customer ( grep {$seconds{$_}} keys %seconds ) { - push @acct_rt_transaction, new FS::acct_rt_transaction { - 'custnum' => $customer, - 'transaction_id' => $transaction, - 'seconds' => $seconds{$customer}, - 'support' => $seconds{$customer} * $msum, - }; - } - -} - -my $error = FS::acct_rt_transaction->batch_insert(@acct_rt_transaction); -$cgi->param('error', $error) if $error; - - diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi deleted file mode 100644 index 5dee29b88..000000000 --- a/httemplate/misc/queue.cgi +++ /dev/null @@ -1,49 +0,0 @@ -<% $cgi->redirect(popurl(2). "search/queue.html") %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Job queue'); - -$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; - } - } -} - - diff --git a/httemplate/misc/recharge_svc.html b/httemplate/misc/recharge_svc.html deleted file mode 100755 index d8a8faad4..000000000 --- a/httemplate/misc/recharge_svc.html +++ /dev/null @@ -1,105 +0,0 @@ -<% include('/elements/header-popup.html', 'Recharge Service' ) %> - -<% include('/elements/error.html') %> - -
- - -

-<% "Recharge $svcnum: $label - $value" %> -<% ntable("#cccccc", 2) %> - - - - <% $recharge_label ? '' : 'disabled' %>> - Prepaid Card -% if ($recharge_label) { - > - <% $recharge_label %> -% } - - - Enter prepaid card: - > - - - - -
- - -
- -<% include('/elements/footer.html') %> - -<%once> - -my $conf = new FS::Conf; -my $money_char = $conf->config('money_char') || '$'; - - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Recharge customer service'); - -my($svcnum, $prepaid, $payby); -if ( $cgi->param('error') ) { - $svcnum = $cgi->param('svcnum'); - $prepaid = $cgi->param('prepaid'); - $payby = $cgi->param('payby'); -} elsif ( $cgi->param('svcnum') =~ /^(\d+)$/ ) { - $svcnum = $1; - $prepaid = ''; -} else { - die "illegal query ". $cgi->keywords; -} - -my $title = 'Recharge Service'; - -my $cust_svc = qsearchs('cust_svc', {'svcnum' => $svcnum}); -die "No such service: $svcnum" unless $cust_svc; - -my($label, $value) = $cust_svc->label; - -$payby = $cust_svc->cust_pkg->cust_main->payby unless $payby; -my $part_pkg = $cust_svc->cust_pkg->part_pkg; -my $amount = $part_pkg->option('recharge_amount', 1) || 0; - -my $recharge_label = "Charge $money_char$amount for "; - -$recharge_label .= $part_pkg->option('recharge_seconds', 1) . 's ' - if $part_pkg->option('recharge_seconds', 1); - - -$recharge_label .= FS::UI::bytecount::display_bytecount( - $part_pkg->option('recharge_upbytes', 1) ) - . ' up ' - if $part_pkg->option('recharge_upbytes', 1); - - -$recharge_label .= FS::UI::bytecount::display_bytecount( - $part_pkg->option('recharge_downbytes', 1) ) - . ' down ' - if $part_pkg->option('recharge_downbytes', 1); - - -$recharge_label .= FS::UI::bytecount::display_bytecount( - $part_pkg->option('recharge_totalbytes', 1) ) - . ' total ' - if $part_pkg->option('recharge_totalbytes', 1); - - -$recharge_label = '' - unless ($recharge_label ne "Charge $money_char$amount for "); - - - diff --git a/httemplate/misc/states.cgi b/httemplate/misc/states.cgi deleted file mode 100644 index cf2b46ee2..000000000 --- a/httemplate/misc/states.cgi +++ /dev/null @@ -1,7 +0,0 @@ -% -% -% my $country = $cgi->param('arg'); -% my @output = states_hash($country); -% -% -[ <% join(', ', map { qq("$_") } @output) %> ] diff --git a/httemplate/misc/svc_acct-domains.cgi b/httemplate/misc/svc_acct-domains.cgi deleted file mode 100644 index 573457483..000000000 --- a/httemplate/misc/svc_acct-domains.cgi +++ /dev/null @@ -1,31 +0,0 @@ -[ <% join(', ', map { qq("$_->[0]", "$_->[1]") } @svc_domain) %> ] -<%init> - -my $conf = new FS::Conf; - -my $pkgpart_svcpart = $cgi->param('arg'); -$pkgpart_svcpart =~ /^\d+_(\d+)$/; -my $part_svc = qsearchs('part_svc', { 'svcpart' => $1 }) if $1; -my $part_svc_column = $part_svc->part_svc_column('domsvc') if $part_svc; - -my @output = split /,/, $part_svc_column->columnvalue if $part_svc_column; -my $columnflag = $part_svc_column->columnflag if $part_svc_column; -my @svc_domain = (); -my %seen = (); - -foreach (@output) { - my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $_ }) - or warn "unknown svc_domain.svcnum $_ for part_svc_column domsvc; ". - "svcpart = " . $part_svc->svcpart; - push @svc_domain, [ $_ => $svc_domain->domain ]; - $seen{$_}++; -} -if ($conf->exists('svc_acct-alldomains') - && ( $columnflag eq 'D' || $columnflag eq '' ) - ) { - foreach (grep { $_->svcnum ne $output[0] } qsearch('svc_domain', {}) ){ - push @svc_domain, [ $_->svcnum => $_->domain ]; - } -} - - diff --git a/httemplate/misc/timeworked.html b/httemplate/misc/timeworked.html deleted file mode 100755 index db4b64ce7..000000000 --- a/httemplate/misc/timeworked.html +++ /dev/null @@ -1,135 +0,0 @@ -<% include('/elements/header.html', $title, '' ) %> - -<% include('/elements/error.html') %> - -
- - - - - - - - - - - - - - - - - - - - - - - - - -% foreach my $tr_id ( keys %ticketmap ) { -% my (@customers) = @{$customers{$ticketmap{$tr_id}}}; -% next unless @customers; -% my $default_multiplier = sprintf("%.2f", 1/@customers); -% my ($custnum, $name) = split(':', pop @customers, 2); -% my $link = $p. 'rt/Ticket/Display.html?id='. $ticketmap{$tr_id}. -% '#txn-'. $tr_id; - - - - - - -% my $seconds = 0; -% if ( $cgi->param("seconds$tr_id") =~ /^(\d+)$/ ) { -% $seconds = $1; -% } - - - - - - - -% foreach ( @customers ) { -% ($custnum, $name) = split(':', $_, 2); - - - - - - - - -% } -% } - - - -
TransTicketTimeCustomerMultiplier
##Subjecthours#Name
<% $tr_id %><% $ticketmap{$tr_id} %><% $ticket{$ticketmap{$tr_id}} |h %><% sprintf("%0.2f", $seconds/3600) %><% $custnum %><% $name %> - - - -% my $multiplier = $default_multiplier; -% my $mult_paramname = "multiplier${tr_id}_$custnum"; -% if ( $cgi->param($mult_paramname) =~ /^\s*([\d\.]+)\s*$/ ) { -% $multiplier = $1; -% } - - -
<% $custnum %><% $name %> - -% $multiplier = $default_multiplier; -% $mult_paramname = "multiplier${tr_id}_$custnum"; -% if ( $cgi->param($mult_paramname) =~ /^\s*([\d\.]+)\s*$/ ) { -% $multiplier = $1; -% } - - - -
- -
- - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Time queue'); - -my(%ticketmap, %ticket, %customers); -my $title = 'Assign Time Worked'; -tie %ticketmap, 'Tie::IxHash'; - -RT::Init(); - -my $CurrentUser = RT::CurrentUser->new(); -$CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username); - -foreach my $id ( map { /^transactionid(\d+)$/; $1; } - grep /^transactionid\d+$/, $cgi->param) { - my $transaction = new RT::Transaction($CurrentUser); - $transaction->Load($id); - $ticketmap{$id} = $transaction->ObjectId; - unless(exists($ticket{$ticketmap{$id}})) { - my $ticket = new RT::Ticket($CurrentUser); - $ticket->Load($ticketmap{$id}); - $ticket{$ticketmap{$id}} = $ticket->Subject; - $customers{$ticketmap{$id}} = - [ map { $_->Resolver->AsString } - grep { $_->Resolver->{'fstable'} eq 'cust_main' } - grep { $_->Scheme eq 'freeside' } - map { $_->TargetURI } - @{ $ticket->_Links('Base')->ItemsArrayRef } - ]; - - } -} - - - diff --git a/httemplate/misc/unapply-cust_credit.cgi b/httemplate/misc/unapply-cust_credit.cgi deleted file mode 100755 index ed739ac1b..000000000 --- a/httemplate/misc/unapply-cust_credit.cgi +++ /dev/null @@ -1,20 +0,0 @@ -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unapply credit'); - -#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; - errorpage($error) if $error; -} - - diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi deleted file mode 100755 index 8cdac180b..000000000 --- a/httemplate/misc/unapply-cust_pay.cgi +++ /dev/null @@ -1,20 +0,0 @@ -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unapply payment'); - -#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; - errorpage($error) if $error; -} - - diff --git a/httemplate/misc/unprovision.cgi b/httemplate/misc/unprovision.cgi deleted file mode 100755 index 4ab15fdc0..000000000 --- a/httemplate/misc/unprovision.cgi +++ /dev/null @@ -1,26 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -<% $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum") %> -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unprovision customer service'); - -#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; - - diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi deleted file mode 100755 index b350693dd..000000000 --- a/httemplate/misc/unsusp_pkg.cgi +++ /dev/null @@ -1,20 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -<% $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')) %> -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unsuspend customer package'); - -#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; - - diff --git a/httemplate/misc/unvoid-cust_pay_void.cgi b/httemplate/misc/unvoid-cust_pay_void.cgi deleted file mode 100755 index 91fe1c223..000000000 --- a/httemplate/misc/unvoid-cust_pay_void.cgi +++ /dev/null @@ -1,21 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Unvoid'); - -#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; - - diff --git a/httemplate/misc/upload-batch.cgi b/httemplate/misc/upload-batch.cgi deleted file mode 100644 index d1a84fd02..000000000 --- a/httemplate/misc/upload-batch.cgi +++ /dev/null @@ -1,36 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include('/elements/header.html','Batch results upload successful') %> - <% include('/elements/footer.html') %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Process batches'); - -my $error; - -my $fh = $cgi->upload('batch_results'); -$error = 'No file uploaded' unless defined($fh); - -unless ( $error ) { - - $cgi->param('batchnum') =~ /^(\d+)$/; - my $batchnum = $1; - - my $pay_batch = qsearchs( 'pay_batch', { 'batchnum' => $batchnum } ); - if ( ! $pay_batch ) { - $error = "batchnum $batchnum not found"; - } elsif ( $pay_batch->status ne 'I' ) { - $error = "batch $batchnum is not in transit"; - } else { - $error = $pay_batch->import_results( - 'filehandle' => $fh, - 'format' => $cgi->param('format'), - ); - } - -} - - diff --git a/httemplate/misc/void-cust_pay.cgi b/httemplate/misc/void-cust_pay.cgi deleted file mode 100755 index 7b484e93e..000000000 --- a/httemplate/misc/void-cust_pay.cgi +++ /dev/null @@ -1,26 +0,0 @@ -%if ( $error ) { -% errorpage($error); -%} else { -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -%} -<%init> - -#untaint paynum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal paynum"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay',{'paynum'=>$paynum}); - -my $right = 'Regular void'; -$right = 'Credit card void' if $cust_pay->payby eq 'CARD'; -$right = 'Echeck void' if $cust_pay->payby eq 'CHEK'; - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right($right); - -my $custnum = $cust_pay->custnum; - -my $error = $cust_pay->void; - - diff --git a/httemplate/misc/whois.cgi b/httemplate/misc/whois.cgi deleted file mode 100644 index 35d0eccc9..000000000 --- a/httemplate/misc/whois.cgi +++ /dev/null @@ -1,27 +0,0 @@ -<% include("/elements/header.html","Whois $domain", menubar( - ( $custnum - ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : () - ), - "View this domain (#$svcnum)" => "${p}view/svc_domain.cgi?$svcnum", -)) %> - -
<% $whois %>
- -<% include('/elements/footer.html') %> - -<%init> - -my $svcnum = $cgi->param('svcnum'); -my $custnum = $cgi->param('custnum'); -my $domain = $cgi->param('domain'); - -my $whois = eval { whois($domain) }; - if ( $@ ) { - ( $whois = $@ ) =~ s/ at \/.*Net\/Whois\/Raw\.pm line \d+.*$//s; - } else { - $whois =~ s/^\n+//; - } - - diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi deleted file mode 100644 index 67512fad9..000000000 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ /dev/null @@ -1,22 +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 1d0383f2a..000000000 --- a/httemplate/misc/xmlrpc.cgi +++ /dev/null @@ -1,18 +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