summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/areacodes.cgi24
-rw-r--r--httemplate/misc/batch-cust_pay.html133
-rwxr-xr-xhttemplate/misc/bill.cgi8
-rwxr-xr-xhttemplate/misc/bulk_change_pkg.cgi62
-rwxr-xr-xhttemplate/misc/bulk_pkg_increment_bill.cgi50
-rwxr-xr-xhttemplate/misc/cancel-unaudited.cgi33
-rw-r--r--httemplate/misc/cancel_cust.html91
-rwxr-xr-xhttemplate/misc/cancel_pkg.html112
-rwxr-xr-xhttemplate/misc/catchall.cgi118
-rw-r--r--httemplate/misc/cdr-import.html61
-rw-r--r--httemplate/misc/cdr-post.cgi58
-rw-r--r--httemplate/misc/cdr-post.html11
-rw-r--r--httemplate/misc/cdr.cgi48
-rwxr-xr-xhttemplate/misc/change_pkg.cgi76
-rw-r--r--httemplate/misc/choose_tax_location.html90
-rw-r--r--httemplate/misc/cities.cgi7
-rw-r--r--httemplate/misc/clone-cgp_rule.html27
-rw-r--r--httemplate/misc/copy-rate_detail.html61
-rw-r--r--httemplate/misc/counties.cgi7
-rw-r--r--httemplate/misc/cust-part_pkg.cgi30
-rw-r--r--httemplate/misc/cust_attachment.cgi34
-rwxr-xr-xhttemplate/misc/cust_main-cancel.cgi76
-rw-r--r--httemplate/misc/cust_main-import.cgi161
-rw-r--r--httemplate/misc/cust_main-import_charges.cgi69
-rwxr-xr-xhttemplate/misc/cust_main-merge.html40
-rw-r--r--httemplate/misc/cust_main_note-import.cgi211
-rw-r--r--httemplate/misc/cust_main_note-import.html51
-rw-r--r--httemplate/misc/cust_pay-import.cgi62
-rw-r--r--httemplate/misc/cust_pkg-import.html150
-rw-r--r--httemplate/misc/custom_link_proxy.cgi24
-rwxr-xr-xhttemplate/misc/delay_susp_pkg.html73
-rw-r--r--httemplate/misc/delete-agent_payment_gateway.cgi15
-rw-r--r--httemplate/misc/delete-cgp_rule.html23
-rw-r--r--httemplate/misc/delete-cust_bill.html21
-rwxr-xr-xhttemplate/misc/delete-cust_credit.cgi21
-rwxr-xr-xhttemplate/misc/delete-cust_pay.cgi21
-rw-r--r--httemplate/misc/delete-cust_pkg_discount.html32
-rwxr-xr-xhttemplate/misc/delete-cust_refund.cgi21
-rwxr-xr-xhttemplate/misc/delete-customer.cgi64
-rwxr-xr-xhttemplate/misc/delete-domain_record.cgi20
-rw-r--r--httemplate/misc/delete-mailinglistmember.html20
-rwxr-xr-xhttemplate/misc/delete-part_export.cgi20
-rwxr-xr-xhttemplate/misc/delete-phone_device.html23
-rwxr-xr-xhttemplate/misc/delete-rate_detail.html20
-rwxr-xr-xhttemplate/misc/disable-cust_location.cgi35
-rw-r--r--httemplate/misc/disable-payment_gateway.cgi25
-rw-r--r--httemplate/misc/download-batch.cgi21
-rw-r--r--httemplate/misc/dump.cgi20
-rw-r--r--httemplate/misc/email-customers.html194
-rwxr-xr-xhttemplate/misc/email-invoice.cgi19
-rw-r--r--httemplate/misc/email_events.cgi9
-rw-r--r--httemplate/misc/email_invoice_events.cgi9
-rw-r--r--httemplate/misc/email_invoices.cgi9
-rwxr-xr-xhttemplate/misc/enable_or_disable_tax.html37
-rw-r--r--httemplate/misc/exchanges.cgi24
-rwxr-xr-xhttemplate/misc/fax-invoice.cgi19
-rw-r--r--httemplate/misc/fax_events.cgi9
-rw-r--r--httemplate/misc/fax_invoice_events.cgi9
-rw-r--r--httemplate/misc/fax_invoices.cgi9
-rw-r--r--httemplate/misc/file-upload.html53
-rw-r--r--httemplate/misc/ftp_invoices.cgi9
-rw-r--r--httemplate/misc/inventory_item-import.html73
-rw-r--r--httemplate/misc/inventory_item-move.cgi23
-rwxr-xr-xhttemplate/misc/link.cgi85
-rw-r--r--httemplate/misc/location.cgi30
-rw-r--r--httemplate/misc/maestro-customer_status-test.html34
-rw-r--r--httemplate/misc/maestro-customer_status.cgi16
-rw-r--r--httemplate/misc/maestro-customer_status.html16
-rw-r--r--httemplate/misc/merge_cust.html72
-rw-r--r--httemplate/misc/meta-import.cgi79
-rw-r--r--httemplate/misc/order_pkg.html142
-rw-r--r--httemplate/misc/part_device-import.html53
-rw-r--r--httemplate/misc/part_svc-columns.cgi13
-rw-r--r--httemplate/misc/payment.cgi340
-rw-r--r--httemplate/misc/phone_avail-import.html88
-rw-r--r--httemplate/misc/phone_device_config.html57
-rw-r--r--httemplate/misc/phonenums.cgi29
-rw-r--r--httemplate/misc/ping.html102
-rwxr-xr-xhttemplate/misc/print-invoice.cgi19
-rw-r--r--httemplate/misc/print_events.cgi9
-rw-r--r--httemplate/misc/print_invoice_events.cgi9
-rw-r--r--httemplate/misc/print_invoices.cgi9
-rw-r--r--httemplate/misc/process/batch-cust_pay.cgi68
-rw-r--r--httemplate/misc/process/bill_batch-print.html5
-rwxr-xr-xhttemplate/misc/process/bulk_change_pkg.cgi56
-rwxr-xr-xhttemplate/misc/process/bulk_pkg_increment_bill.cgi76
-rwxr-xr-xhttemplate/misc/process/cancel_pkg.html72
-rwxr-xr-xhttemplate/misc/process/catchall.cgi35
-rw-r--r--httemplate/misc/process/cdr-import.html9
-rw-r--r--httemplate/misc/process/copy-rate_detail.html61
-rw-r--r--httemplate/misc/process/cust_main-import.cgi10
-rw-r--r--httemplate/misc/process/cust_main-import_charges.cgi24
-rw-r--r--httemplate/misc/process/cust_main_note-import.cgi85
-rw-r--r--httemplate/misc/process/cust_pay-import.cgi21
-rw-r--r--httemplate/misc/process/cust_pkg-import.html10
-rwxr-xr-xhttemplate/misc/process/delay_susp_pkg.html41
-rwxr-xr-xhttemplate/misc/process/delete-customer.cgi33
-rw-r--r--httemplate/misc/process/email-customers.html9
-rwxr-xr-xhttemplate/misc/process/enable_or_disable_tax.html41
-rw-r--r--httemplate/misc/process/inventory_item-import.html9
-rwxr-xr-xhttemplate/misc/process/link.cgi78
-rw-r--r--httemplate/misc/process/meta-import.cgi190
-rw-r--r--httemplate/misc/process/part_device-import.html9
-rw-r--r--httemplate/misc/process/pay_batch-approve.cgi16
-rw-r--r--httemplate/misc/process/payment.cgi214
-rw-r--r--httemplate/misc/process/phone_avail-import.html9
-rw-r--r--httemplate/misc/process/rate-import.html9
-rw-r--r--httemplate/misc/process/rate_edit_excel.html10
-rwxr-xr-xhttemplate/misc/process/recharge_svc.html92
-rwxr-xr-xhttemplate/misc/process/recharge_svc.new85
-rw-r--r--httemplate/misc/process/tax-fetch_and_import.cgi9
-rw-r--r--httemplate/misc/process/tax-fetch_and_replace.cgi9
-rw-r--r--httemplate/misc/process/tax-import.cgi9
-rw-r--r--httemplate/misc/process/tax-upgrade.cgi147
-rw-r--r--httemplate/misc/process/timeworked.html59
-rw-r--r--httemplate/misc/qual.html88
-rw-r--r--httemplate/misc/queue.cgi49
-rwxr-xr-xhttemplate/misc/queued_report.html29
-rw-r--r--httemplate/misc/rate-import.html76
-rw-r--r--httemplate/misc/rate_edit_excel.html70
-rwxr-xr-xhttemplate/misc/recharge_svc.html105
-rw-r--r--httemplate/misc/send-invoice.cgi30
-rwxr-xr-xhttemplate/misc/send-statement.cgi28
-rw-r--r--httemplate/misc/spool_invoices.cgi9
-rw-r--r--httemplate/misc/states.cgi7
-rw-r--r--httemplate/misc/svc_acct-domains.cgi31
-rw-r--r--httemplate/misc/svc_cert-generate.html25
-rw-r--r--httemplate/misc/tax-fetch_and_import.cgi48
-rw-r--r--httemplate/misc/tax-fetch_and_replace.cgi48
-rw-r--r--httemplate/misc/tax-import.cgi74
-rwxr-xr-xhttemplate/misc/timeworked.html128
-rwxr-xr-xhttemplate/misc/unadjourn_pkg.cgi17
-rwxr-xr-xhttemplate/misc/unapply-cust_credit.cgi20
-rwxr-xr-xhttemplate/misc/unapply-cust_pay.cgi20
-rwxr-xr-xhttemplate/misc/unexpire_pkg.cgi17
-rwxr-xr-xhttemplate/misc/unprovision.cgi38
-rwxr-xr-xhttemplate/misc/unsusp_pkg.cgi20
-rwxr-xr-xhttemplate/misc/unvoid-cust_pay_void.cgi21
-rw-r--r--httemplate/misc/upload-batch.cgi10
-rwxr-xr-xhttemplate/misc/void-cust_pay.cgi26
-rw-r--r--httemplate/misc/whois.cgi33
-rw-r--r--httemplate/misc/xmlhttp-calculate_taxes.html106
-rw-r--r--httemplate/misc/xmlhttp-cust_main-address_standardize.html93
-rw-r--r--httemplate/misc/xmlhttp-cust_main-censustract.html116
-rw-r--r--httemplate/misc/xmlhttp-cust_main-discount_terms.cgi24
-rw-r--r--httemplate/misc/xmlhttp-cust_main-search.cgi38
-rw-r--r--httemplate/misc/xmlhttp-ping.html20
-rw-r--r--httemplate/misc/xmlrpc.cgi16
148 files changed, 0 insertions, 7277 deletions
diff --git a/httemplate/misc/areacodes.cgi b/httemplate/misc/areacodes.cgi
deleted file mode 100644
index 69c9573..0000000
--- a/httemplate/misc/areacodes.cgi
+++ /dev/null
@@ -1,24 +0,0 @@
-%# [ <% join(', ', map { qq("$_") } @areacodes) %> ]
-<% objToJson(\@areacodes) %>
-<%init>
-
-my( $state, $svcpart ) = $cgi->param('arg');
-
-my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
-die "unknown svcpart $svcpart" unless $part_svc;
-
-my @exports = $part_svc->part_export_did;
-if ( scalar(@exports) > 1 ) {
- die "more than one DID-providing export attached to svcpart $svcpart";
-} elsif ( ! @exports ) {
- die "no DID providing export attached to svcpart $svcpart";
-}
-my $export = $exports[0];
-
-my $something = $export->get_dids('state'=>$state);
-
-#warn Dumper($something);
-
-my @areacodes = @{ $something };
-
-</%init>
diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
deleted file mode 100644
index c5ed6d8..0000000
--- a/httemplate/misc/batch-cust_pay.html
+++ /dev/null
@@ -1,133 +0,0 @@
-<% include('/elements/header.html', 'Quick payment entry') %>
-
-<% include('/elements/error.html') %>
-
-<SCRIPT TYPE="text/javascript">
-function warnUnload() {
- if(document.getElementById("OneTrueTable").rows.length > 3 &&
- !document.OneTrueForm.submit.disabled) {
- return "The current batch will be lost.";
- }
- else {
- return null;
- }
-}
-window.onbeforeunload = warnUnload;
-
-function select_discount_term(row, prefix) {
- var custnum_obj = document.getElementById('custnum'+prefix+row);
- var select_obj = document.getElementById('discount_term'+prefix+row);
-
- var value = '';
- if (select_obj.type == 'hidden') {
- value = select_obj.value;
- }
-
- var term_select = document.createElement('SELECT');
- term_select.setAttribute('name', 'discount_term'+row);
- term_select.setAttribute('id', 'discount_term'+row);
- term_select.setAttribute('rownum', row);
- term_select.style.display = '';
- select_obj.parentNode.replaceChild(term_select, select_obj);
- opt(term_select, '', '1 month');
-
- function select_discount_term_update(discount_terms) {
-
- var termArray = eval('(' + discount_terms + ')');
- for ( var t = 0; t < termArray.length; t++ ) {
- opt(term_select, termArray[t][0], termArray[t][1]);
- if (termArray[t][0] == value) {
- term_select.selectedIndex = t+1;
- }
- }
-
- }
-
- discount_terms(custnum_obj.value, select_discount_term_update);
-
-}
-</SCRIPT>
-
-<% include('/elements/xmlhttp.html',
- 'url' => $p. 'misc/xmlhttp-cust_main-discount_terms.cgi',
- 'subs' => [qw( discount_terms )],
- )
-%>
-
-<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.submit.disabled=true;window.onbeforeunload = null;">
-
-<!-- <B>Batch</B> <INPUT TYPE="text" NAME="paybatch"><BR><BR> -->
-
-<% include( "/elements/customer-table.html",
- name_singular => 'payment',
- header => \@header,
- fields => \@fields,
- types => \@types,
- align => \@align,
- sizes => \@sizes,
- colors => \@colors,
- param => \%param,
- footer => \@footer,
- footer_align => \@footer_align,
- custnum_update_callback => $custnum_update_callback,
- )
-%>
-
-<!-- <BR>
-<INPUT TYPE="button" VALUE="TEST addrow" onclick="addRow()"> -->
-
-<BR>
-<INPUT TYPE="submit" NAME="submit" VALUE="Post payment batch">
-
-</FORM>
-
-%if ( $cgi->param('error') ) {
-<SCRIPT TYPE="text/javascript">
-% for ( my $row = 0; defined($cgi->param("custnum$row")); $row++ ) {
- select_discount_term(<% $row %>, '');
-% }
-</SCRIPT>
-%}
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Post payment batch');
-
-my @header = ( '', 'Amount', 'Check #' );
-my @fields = ( sub {'$'}, 'paid', 'payinfo' );
-my @types = ( 'immutable', '', '' );
-my @align = ( 'c', 'r', 'r' );
-my @sizes = ( 0, 8, 10 );
-my @colors = ( '', '', '' );
-my %param = ();
-my @footer = ( '$', '_TOTAL', '' );
-my @footer_align = ( 'c', 'r', 'r' );
-my $custnum_update_callback = '';
-
-if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM part_pkg_discount') ) {
- push @header, '';
- push @fields, 'discount_term';
- push @types, 'immutable';
- push @align, 'r';
- push @sizes, '0';
- push @colors, '';
- push @footer, '';
- push @footer_align, '';
- $custnum_update_callback = 'select_discount_term';
-}
-
-push @header, '';
-push @fields, 'error';
-push @types, 'immutable';
-push @align, 'l';
-push @sizes, '0';
-push @colors, '#ff0000';
-push @footer, '';
-push @footer_align, '';
-
-$m->comp('/elements/handle_uri_query');
-
-</%init>
diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi
deleted file mode 100755
index 2bc43d7..0000000
--- a/httemplate/misc/bill.cgi
+++ /dev/null
@@ -1,8 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Bill customer now');
-my $server = FS::UI::Web::JSRPC->new('FS::cust_main::process_bill_and_collect', $cgi);
-</%init>
-
diff --git a/httemplate/misc/bulk_change_pkg.cgi b/httemplate/misc/bulk_change_pkg.cgi
deleted file mode 100755
index 4964e59..0000000
--- a/httemplate/misc/bulk_change_pkg.cgi
+++ /dev/null
@@ -1,62 +0,0 @@
-<% include('/elements/header-popup.html', "Change Packages") %>
-
-% if ( $cgi->param('error') ) {
- <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
- <BR><BR>
-% }
-
-<FORM ACTION="<% $p %>misc/process/bulk_change_pkg.cgi" METHOD=POST>
-
-%# some false laziness w/search/cust_pkg.cgi
-
-<INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
-% for my $param (qw(agentnum custnum magic status classnum custom censustract)) {
-<INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% foreach my $pkgpart ($cgi->param('pkgpart')) {
-<INPUT TYPE="hidden" NAME="pkgpart" VALUE="<% $pkgpart |h %>">
-% }
-%
-% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
-%
- <INPUT TYPE="hidden" NAME="<% $field %>begin" VALUE="<% $cgi->param("${field}.begin") |h %>">
- <INPUT TYPE="hidden" NAME="<% $field %>beginning" VALUE="<% $cgi->param("${field}beginning") |h %>">
- <INPUT TYPE="hidden" NAME="<% $field %>end" VALUE="<% $cgi->param("${field}.end") |h %>">
- <INPUT TYPE="hidden" NAME="<% $field %>ending" VALUE="<% $cgi->param("${field}.ending") |h %>">
-% }
-
-<% ntable('#cccccc') %>
-
- <TR>
- <TD>New package: </TD>
- <TD><% include('/elements/select-table.html',
- 'table' => 'part_pkg',
- 'name_col' => 'pkg',
- 'empty_label' => 'Select package',
- 'label_callback' => sub { $_[0]->pkg_comment },
- 'element_name' => 'new_pkgpart',
- 'curr_value' => ( $cgi->param('error')
- ? scalar($cgi->param('new_pkgpart'))
- : ''
- ),
- )
- %>
- </TD>
- </TR>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" VALUE="Change packages">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages');
-
-</%init>
diff --git a/httemplate/misc/bulk_pkg_increment_bill.cgi b/httemplate/misc/bulk_pkg_increment_bill.cgi
deleted file mode 100755
index d594b55..0000000
--- a/httemplate/misc/bulk_pkg_increment_bill.cgi
+++ /dev/null
@@ -1,50 +0,0 @@
-<% include('/elements/header-popup.html', "Increment Next Bill Date") %>
-
-% if ( $cgi->param('error') ) {
- <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
- <BR><BR>
-% }
-
-<FORM ACTION="<% $p %>misc/process/bulk_pkg_increment_bill.cgi" METHOD=POST>
-
-%# some false laziness w/search/cust_pkg.cgi
-
-<INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
-% for my $param (qw(agentnum custnum magic status classnum custom censustract)) {
-<INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% foreach my $pkgpart ($cgi->param('pkgpart')) {
-<INPUT TYPE="hidden" NAME="pkgpart" VALUE="<% $pkgpart |h %>">
-% }
-%
-% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) {
-%
- <INPUT TYPE="hidden" NAME="<% $field %>begin" VALUE="<% $cgi->param("${field}.begin") |h %>">
- <INPUT TYPE="hidden" NAME="<% $field %>beginning" VALUE="<% $cgi->param("${field}beginning") |h %>">
- <INPUT TYPE="hidden" NAME="<% $field %>end" VALUE="<% $cgi->param("${field}.end") |h %>">
- <INPUT TYPE="hidden" NAME="<% $field %>ending" VALUE="<% $cgi->param("${field}.ending") |h %>">
-% }
-
-<% ntable('#cccccc') %>
-
- <TR>
- <TD>Days to increment: </TD>
- <TD><INPUT type="text" name="days"></TD>
- </TR>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" VALUE="Increment next bill date">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages');
-
-</%init>
diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi
deleted file mode 100755
index 4919c66..0000000
--- 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!<A HREF="${p}view/cust_main.cgi?!. $cust_pkg->custnum.
- '#cust_pkg'. $cust_pkg->pkgnum. '">'.
- 'package</A> instead.');
-}
-
-my $error = $cust_svc->cancel;
-
-</%init>
diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html
deleted file mode 100644
index b7ecccd..0000000
--- a/httemplate/misc/cancel_cust.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<% include('/elements/header-popup.html', 'Cancel customer' ) %>
-
-<% include('/elements/error.html') %>
-
-
-<FORM NAME="cust_cancel_popup" ACTION="<% popurl(1) %>cust_main-cancel.cgi" METHOD=POST>
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
-
-
- <P ALIGN="center"><B>Permanently delete all services and cancel this customer?</B>
-
-<TABLE BORDER="0" CELLSPACING="2"
-STYLE="margin-left:auto; margin-right:auto">
-<TR>
- <TD ALIGN="right">
- <INPUT TYPE="radio" NAME="now_or_later" VALUE="0" onclick="toggle(false)" CHECKED />
- </TD>
- <TD ALIGN="left">Cancel now</TD>
-</TR>
-<TR>
- <TD ALIGN="right">
- <INPUT TYPE="radio" NAME="now_or_later" VALUE="1" onclick="toggle(true)" />
- </TD>
- <TD ALIGN="left">Cancel on date:&nbsp;
- <% include('/elements/input-date-field.html', {
- 'name' => 'expire',
- 'value' => time,
- } ) %>
- </TD>
-</TR>
-</TABLE>
-<SCRIPT type="text/javascript">
-function toggle(val) {
- document.getElementById("expire_text").disabled = !val;
- document.getElementById("ban").disabled = val;
- document.getElementById("expire_button").style.visibility =
- val ? 'visible' : 'hidden';
-}
-toggle(false);
-</SCRIPT>
-<% $ban %>
-
-<TABLE BGCOLOR="#cccccc", BORDER="0" CELLSPACING="2"
-STYLE="margin-left:auto; margin-right:auto">
-<% include('/elements/tr-select-reason.html',
- 'field' => 'reasonnum',
- 'reason_class' => 'C',
- 'cgi' => $cgi,
- 'control_button' => "document.getElementById('confirm_cancel_cust_button')",
- )
-%>
-
-</TABLE>
-
-<BR>
-<P ALIGN="CENTER">
-<INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_cust_button" VALUE="Cancel customer" DISABLED> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
-my $custnum = $1;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied" unless $curuser->access_right('Cancel customer');
-
-my $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 = '<P ALIGN="center">'.
- '<INPUT TYPE="checkbox" NAME="ban" ID="ban" VALUE="1"> Ban this customer\'s ';
- if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
- $ban .= 'credit card';
- } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
- $ban .= 'ACH account';
- }
-}
-
-</%init>
-
diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html
deleted file mode 100755
index 10c0e0d..0000000
--- a/httemplate/misc/cancel_pkg.html
+++ /dev/null
@@ -1,112 +0,0 @@
-%# if ( $link eq 'popup' ) {
- <% include('/elements/header-popup.html', $title ) %>
-%# } else {
-%# <% include("/elements/header.html", $title, '') %>
-%# }
-
-<LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
-<SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="sc_popup" ACTION="<% popurl(1) %>process/cancel_pkg.html" METHOD=POST>
-<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
-<INPUT TYPE="hidden" NAME="method" VALUE="<% $method %>">
-
-
-<BR><BR>
-<% ucfirst($method) %> <% $part_pkg->pkg_comment %>
-<% ntable("#cccccc", 2) %>
-
-% if ($method eq 'expire' || $method eq 'adjourn') {
-<TR>
- <TD><% $submit =~ /^(\w*)\s/ %> package on </TD>
- <TD><INPUT TYPE="text" NAME="date" ID="expire_date" VALUE="<% $date |h %>">
- <IMG SRC="<% $p %>images/calendar.png" ID="expire_button" STYLE="cursor:pointer" TITLE="Select date">
- <BR><I>m/d/y</I>
- </TD>
-</TR>
-<SCRIPT TYPE="text/javascript">
- Calendar.setup({
- inputField: "expire_date",
- ifFormat: "<% $date_format %>",
- button: "expire_button",
- align: "BR"
- });
-</SCRIPT>
-%}
-%
-
-<% include('/elements/tr-select-reason.html',
- 'field' => 'reasonnum',
- 'reason_class' => $class,
- 'curr_value' => $reasonnum,
- 'control_button' => "document.getElementById('confirm_cancel_pkg_button')",
- )
-%>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_pkg_button" VALUE="<% $submit %>" DISABLED>
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-my $conf = new FS::Conf;
-my $date_format = $conf->config('date_format') || '%m/%d/%Y';
-
-my $date = time2str($date_format, 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;
-
-</%init>
diff --git a/httemplate/misc/catchall.cgi b/httemplate/misc/catchall.cgi
deleted file mode 100755
index 240f34d..0000000
--- a/httemplate/misc/catchall.cgi
+++ /dev/null
@@ -1,118 +0,0 @@
-<% include('/elements/header.html', 'Domain Catchall Edit') %>
-
-<% include('/elements/error.html') %>
-
-<FORM ACTION="<%$p1%>process/catchall.cgi" METHOD=POST>
-
-<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum |h %>">
-Service #<FONT SIZE=+1><B><% $svcnum ? $svcnum : ' (NEW)' |h %></B></FONT>
-<BR><BR>
-
-<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum |h %>">
-
-<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
-
-% my $domain = $svc_domain->domain;
-% my $catchall = $svc_domain->catchall;
-
-<INPUT TYPE="hidden" NAME="domain" VALUE="<% $domain |h %>">
-
-Mail to <I>(anything)</I>@<B><% $domain |h %></B> forwards to <SELECT NAME="catchall" SIZE=1>
-% foreach $_ (keys %email) {
- <OPTION<% $_ eq $catchall ? ' SELECTED' : '' %> VALUE="<% $_ %>"><% $email{$_} %>
-% }
-</SELECT>
-<BR><BR>
-
-<INPUT TYPE="submit" VALUE="Submit">
-
-</FORM>
-
-<% 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);
-
-</%init>
diff --git a/httemplate/misc/cdr-import.html b/httemplate/misc/cdr-import.html
deleted file mode 100644
index 7af6c52..0000000
--- a/httemplate/misc/cdr-import.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<% include("/elements/header.html",'Call Detail Record Import') %>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'CDRImportForm',
- 'action' => 'process/cdr-import.html',
- 'num_files' => 1,
- 'fields' => [ 'format', 'cdrbatch', ],
- 'message' => 'CDR import successful',
- 'url' => $p."search/cdr.html?cdrbatch=$cdrbatch",
- )
-%>
-
-Import a file containing Call Detail Records (CDRs).<BR><BR>
-
-<INPUT TYPE="hidden" NAME="cdrbatch" VALUE="<% $cdrbatch %>"%>
-
-<% ntable('#cccccc', 2) %>
-
- <TR>
- <TD>CDR Format</TD>
- <TD>
- <SELECT NAME="format">
-% foreach my $format ( keys %formats ) {
- <OPTION VALUE="<% $format %>"><% $formats{$format} %></OPTION>
-% }
- </SELECT>
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.InventoryItemImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-tie my %formats, 'Tie::IxHash', FS::cdr->import_formats;
-
-my $cdrbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
-
-</%init>
diff --git a/httemplate/misc/cdr-post.cgi b/httemplate/misc/cdr-post.cgi
deleted file mode 100644
index 541dac3..0000000
--- a/httemplate/misc/cdr-post.cgi
+++ /dev/null
@@ -1,58 +0,0 @@
-% if ( $error ) {
-0,"<% $error %>",,
-% } else {
-1,"CDR import successful",<% $cdr_batch->cdrbatchnum %>,"<% $cdrbatch %>"
-% }
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $error = '';
-my $cdr_batch;
-my $cdrbatch = '';
-
-{
-
- my $filename = $cgi->param('cdr_file');
- unless ( $filename ) {
- $error = "No cdr_file filename";
- last;
- }
-
- my $fh = $cgi->upload('cdr_file');
- unless ( defined($fh) ) {
- $error = 'No cdr_file file';
- last;
- }
-
- #i should probably be transactionalized.
-
- my $csv = new Text::CSV_XS or die Text::CSV->error_diag;
-
- $cdrbatch = time2str('post-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
- $cdr_batch = new FS::cdr_batch { 'cdrbatch' => $cdrbatch };
- $error = $cdr_batch->insert and last;
-
- chomp(my $hline = scalar(<$fh>));
- $csv->parse($hline);
- my @header = $csv->fields;
-
- #while ( my $row = $csv->getline($fh) ) {
- while (<$fh>) {
-
- $csv->parse($_);
- my @row = $csv->fields;
-
- my $cdr = new FS::cdr { 'cdrbatchnum' => $cdr_batch->cdrbatchnum };
- $cdr->set( lc($_) => shift(@row) ) foreach @header;
-
- $error = $cdr->insert and last;
-
- }
-
-}
-
-$error =~ s/"/""/g; #CSV
-
-</%init>
diff --git a/httemplate/misc/cdr-post.html b/httemplate/misc/cdr-post.html
deleted file mode 100644
index 5d34272..0000000
--- a/httemplate/misc/cdr-post.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<% include("/elements/header.html",'Call Detail Record - POST Import') %>
-
-<FORM METHOD="POST" ACTION="cdr-post.cgi" enctype="multipart/form-data">
-
- cdr_file: <INPUT TYPE="file" NAME="cdr_file"><BR><BR>
-
- <INPUT TYPE="submit" VALUE="upload">
-
-</FORM>
-
-<% include("/elements/footer.html") %>
diff --git a/httemplate/misc/cdr.cgi b/httemplate/misc/cdr.cgi
deleted file mode 100644
index d2ee773..0000000
--- a/httemplate/misc/cdr.cgi
+++ /dev/null
@@ -1,48 +0,0 @@
-%# <% $cgi->redirect(popurl(2). "search/cdr.html") %>
-%# i should be a popup and reload my parent... until then, this will do
-<% include('/elements/header.html','CDR update successful') %>
-<% include('/elements/footer.html') %>
-<%init>
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Edit rating data');
-
-$cgi->param('action') =~ /^(new|del|(reprocess|delete) selected)$/
- or die "Illegal action";
-my $action = $1;
-
-my $cdr;
-if ( $action eq 'new' || $action eq 'del' ) {
- $cgi->param('acctid') =~ /^(\d+)$/ or die "Illegal acctid";
- my $acctid = $1;
- $cdr = qsearchs('cdr', { 'acctid' => $1 })
- or die "unknown acctid $acctid";
-}
-
-if ( $action eq 'new' ) {
- my %hash = $cdr->hash;
- $hash{'freesidestatus'} = '';
- my $new = new FS::cdr \%hash;
- my $error = $new->replace($cdr);
- die $error if $error;
-} elsif ( $action eq 'del' ) {
- my $error = $cdr->delete;
- die $error if $error;
-} elsif ( $action =~ /^(reprocess|delete) selected$/ ) {
- foreach my $acctid (
- map { /^acctid(\d+)$/; $1; } grep /^acctid\d+$/, $cgi->param
- ) {
- my $cdr = qsearchs('cdr', { 'acctid' => $acctid });
- if ( $action eq 'reprocess selected' && $cdr ) { #new
- my %hash = $cdr->hash;
- $hash{'freesidestatus'} = '';
- my $new = new FS::cdr \%hash;
- my $error = $new->replace($cdr);
- die $error if $error;
- } elsif ( $action eq 'delete selected' && $cdr ) { #del
- my $error = $cdr->delete;
- die $error if $error;
- }
- }
-}
-
-</%init>
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi
deleted file mode 100755
index ec10b85..0000000
--- a/httemplate/misc/change_pkg.cgi
+++ /dev/null
@@ -1,76 +0,0 @@
-<% include('/elements/header-popup.html', "Change Package") %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
-<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
-
-<% ntable('#cccccc') %>
-
- <TR>
- <TH ALIGN="right">Current package</TH>
- <TD COLSPAN=7>
- <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
- </TD>
- </TR>
-
- <% include('/elements/tr-select-cust-part_pkg.html',
- 'pre_label' => 'New',
- 'curr_value' => scalar($cgi->param('pkgpart')),
- 'classnum' => $part_pkg->classnum,
- 'cust_main' => $cust_main,
- #'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart,
- )
- %>
-
- <% include('/elements/tr-select-cust_location.html',
- 'cgi' => $cgi,
- 'cust_main' => $cust_main,
- )
- %>
-
-</TABLE>
-
-<% include( '/elements/standardize_locations.html',
- 'form' => "OrderPkgForm",
- 'onlyship' => 1,
- 'no_company' => 1,
- 'callback' => 'document.OrderPkgForm.submit();',
- )
-%>
-
-<BR>
-<INPUT NAME="submitButton" TYPE="button" VALUE="Change package" onClick="this.disabled=true; standardize_locations();">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-my $conf = new FS::Conf;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied"
- unless $curuser->access_right('Change customer package');
-
-my $pkgnum = scalar($cgi->param('pkgnum'));
-$pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum";
-$pkgnum = $1;
-
-my $cust_pkg =
- qsearchs({
- 'table' => 'cust_pkg',
- 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
- 'hashref' => { 'pkgnum' => $pkgnum },
- 'extra_sql' => ' AND '. $curuser->agentnums_sql,
- }) or die "unknown pkgnum $pkgnum";
-
-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 $part_pkg = $cust_pkg->part_pkg;
-
-</%init>
diff --git a/httemplate/misc/choose_tax_location.html b/httemplate/misc/choose_tax_location.html
deleted file mode 100644
index dce04c7..0000000
--- a/httemplate/misc/choose_tax_location.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<FORM NAME="choosegeocodeform">
-<CENTER><BR><B>Choose tax location</B><BR><BR>
-<P>the geocode is:<% $header %></P>
-<P STYLE="<% $style %>"><% $header %></P>
-
-<SELECT NAME='geocodes' ID='geocodes' STYLE="<% $style %>">
-% foreach my $location (@cust_tax_location) {
-% my %value = ( zip => $zip5,
-% map { $_ => $location->$_ }
-% qw ( city state geocode )
-% );
-% map { $value{$_} = $location{$_} } qw ( city state )
-% if $location{country} eq 'CA';
-%
-% my $value = encode_entities(objToJson({ %value })
-% );
-% my $content = '';
-% $content .= $location->$_. '&nbsp;' x ( $max{$_} - length($location->$_) )
-% foreach qw( city county state );
-% $content .= $location->cityflag eq 'I' ? 'Y' : 'N' ;
-% my $selected = '' ;
-% if ($geocode && $location->geocode eq $geocode) {
-% $selected = 'SELECTED';
-% }
- <OPTION VALUE="<% $value %>" STYLE="<% $style %>" <% $selected %>><% $content %>
-% }
-</SELECT><BR><BR>
-
-<TABLE><TR>
- <TD> <BUTTON TYPE="button" onClick="set_geocode(document.getElementById('geocodes'));"><IMG SRC="<%$p%>images/tick.png" ALT=""> Set location </BUTTON></TD>
- <TD><BUTTON TYPE="button" onClick="document.<% $formname %>.submitButton.disabled=false; parent.cClick();"><IMG SRC="<%$p%>images/cross.png" ALT=""> Cancel submission </BUTTON></TD>
-</TR>
-</TABLE>
-
-</CENTER>
-</FORM>
-<%init>
-
-my $conf = new FS::Conf;
-
-my %location = ();
-
-($location{data_vendor}) = $cgi->param('data_vendor') =~ /^([-\w]+)$/;
-($location{city}) = $cgi->param('city') =~ /^([\w ]+)$/;
-($location{state}) = $cgi->param('state') =~ /^(\w+)$/;
-($location{zip}) = $cgi->param('zip') =~ /^([-\w ]+)$/;
-($location{country}) = $cgi->param('country') =~ /^([\w ]+)$/;
-
-my($geocode) = $cgi->param('geocode') =~ /^([\w]+)$/;
-
-my($formname) = $cgi->param('formname') =~ /^([\w]*)$/;
-$formname ||= 'CustomerForm';
-
-my($zip5, $zip4) = split('-', $location{zip});
-
-#only support US & CA
-my $hashref = { 'data_vendor' => $location{data_vendor} };
-$hashref->{zip} = $location{country} eq 'CA' ? substr($zip5,0,1) : $zip5,
-
-my @keys = keys(%$hashref);
-my @cust_tax_location = ();
-until ( @cust_tax_location ) {
- @cust_tax_location = qsearch({ table => 'cust_tax_location',
- hashref => $hashref,
- order_by => 'LIMIT 50',
- });
- last unless scalar(@keys);
- delete $hashref->{ shift @keys };
-}
-
-my %max = ( city => 4, county => 6, state => 5);
-foreach my $location (@cust_tax_location) {
- foreach ( qw( city county state ) ) {
- my $length = length($location->$_);
- $max{$_} = ($length > $max{$_}) ? $length : $max{$_};
- }
-}
-foreach ( qw( city county state ) ) {
- $max{$_} = $location{$_} if $location{$_} > $max{$_};
- $max{$_}++;
-}
-
-my $header = '&nbsp;&nbsp;';
-$header .= $_. '&nbsp;' x ( $max{lc($_)} - length($_) )
- foreach qw( City County State );
-$header .= "In city?";
-
-my $style = "font-family:monospace;";
-
-</%init>
diff --git a/httemplate/misc/cities.cgi b/httemplate/misc/cities.cgi
deleted file mode 100644
index c92485e..0000000
--- a/httemplate/misc/cities.cgi
+++ /dev/null
@@ -1,7 +0,0 @@
-[ <% join(', ', map { qq("$_") } @cities) %> ]
-<%init>
-
-my( $county, $state, $country ) = $cgi->param('arg');
-my @cities = cities($county, $state, $country);
-
-</%init>
diff --git a/httemplate/misc/clone-cgp_rule.html b/httemplate/misc/clone-cgp_rule.html
deleted file mode 100644
index d821a2d..0000000
--- a/httemplate/misc/clone-cgp_rule.html
+++ /dev/null
@@ -1,27 +0,0 @@
-% if ( $error ) {
-% errorpage($error);
-% } else {
-<% $cgi->redirect($p. "browse/cgp_rule.html?svcnum=". $svcnum) %>
-% }
-<%init>
-
-# :/ needs agent-virt so you can't futz with arbitrary rules
-
-#die "access denied"
-# unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service');
-
-#untaint svcnum and clone
-$cgi->param('svcnum') =~ /^(\d+)$/ || die "Illegal svcnum";
-my $svcnum = $1;
-$cgi->param('clone') =~ /^(\d+)$/ || die "Illegal clone";
-my $clone = $1;
-
-my @cgp_rule = qsearch('cgp_rule', { 'svcnum' => $clone } );
-
-my $error = '';
-foreach my $cgp_rule ( @cgp_rule ) {
- $error = $cgp_rule->clone( $svcnum );
- last if $error;
-}
-
-</%init>
diff --git a/httemplate/misc/copy-rate_detail.html b/httemplate/misc/copy-rate_detail.html
deleted file mode 100644
index 3d328ce..0000000
--- a/httemplate/misc/copy-rate_detail.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<% include( '/elements/header.html', 'Copy rates between plans', menubar(
- 'View all rate plans' => "${p}browse/rate.cgi",
- ))
-%>
-
-<% include('/elements/error.html') %>
-
-<FORM ACTION="process/copy-rate_detail.html">
-
-<% ntable('#cccccc') %>
-
- <% include( '/elements/tr-justtitle.html', 'value' => 'Copy rates' ) %>
-
- <% include( '/elements/tr-select-rate.html',
- 'label' => 'From rate plan',
- 'element_name' => 'src_ratenum',
- )
- %>
-
- <% include( '/elements/tr-select-rate.html',
- 'label' => 'To rate plan',
- 'element_name' => 'dst_ratenum',
- )
- %>
-
- <TR>
- <TD COLSPAN=2>Copy country codes</TD>
- </TR>
-
- <TR>
- <TD COLSPAN=2>
-
- <% include( '/elements/checkboxes.html',
- 'names_list' => [ FS::rate_prefix->all_countrycodes ],
- 'element_name_prefix' => 'countrycode',
- )
- %>
- </TD>
- </TR>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center">
- <INPUT TYPE="submit" VALUE="Copy rates">
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-#should have some javascript that enables submit button only when both src & dst
-#rates are chosen
-
-</%init>
diff --git a/httemplate/misc/counties.cgi b/httemplate/misc/counties.cgi
deleted file mode 100644
index c022a27..0000000
--- 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);
-
-</%init>
diff --git a/httemplate/misc/cust-part_pkg.cgi b/httemplate/misc/cust-part_pkg.cgi
deleted file mode 100644
index 524799c..0000000
--- a/httemplate/misc/cust-part_pkg.cgi
+++ /dev/null
@@ -1,30 +0,0 @@
-<% objToJson( \@return ) %>
-<%init>
-
-my( $custnum, $classnum ) = $cgi->param('arg');
-
-#XXX i guess i should be agent-virtualized. cause "packages a customer can
-#order" is such a huge deal
-my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
-
-my %hash = ( 'disabled' => '' );
-if ( $classnum > 0 ) {
- $hash{'classnum'} = $classnum;
-} elsif ( $classnum eq '' || $classnum == 0 ) {
- $hash{'classnum'} = '';
-} #else -1, all classes, so don't set classnum
-
-my @part_pkg = qsearch({
- 'table' => 'part_pkg',
- 'hashref' => \%hash,
- 'extra_sql' =>
- ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql( 'null'=>1 ).
- ' AND '. FS::part_pkg->agent_pkgs_sql( $cust_main->agent ),
- 'order_by' => 'ORDER BY pkg',
-});
-
-my @return = map { ( $_->pkgpart, $_->pkg_comment, $_->can_discount ); }
- #sort { $a->pkg_comment cmp $b->pkg_comment }
- @part_pkg;
-
-</%init>
diff --git a/httemplate/misc/cust_attachment.cgi b/httemplate/misc/cust_attachment.cgi
deleted file mode 100644
index d1ec777..0000000
--- a/httemplate/misc/cust_attachment.cgi
+++ /dev/null
@@ -1,34 +0,0 @@
-<% '',$cgi->redirect(popurl(2). "browse/cust_attachment.html?$browse_opts") %>
-<%init>
-
-$cgi->param('action') =~ /^(Delete|Undelete|Purge) selected$/
- or die "Illegal action";
-my $action = $1;
-
-my $browse_opts = join(';', map { $_.'='.$cgi->param($_) }
- qw( orderby show_deleted )
- );
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right("$action attachment");
-
-foreach my $attachnum (
- map { /^attachnum(\d+)$/; $1; } grep /^attachnum\d+$/, $cgi->param
- ) {
- my $attach = qsearchs('cust_attachment', { 'attachnum' => $attachnum });
- my $error;
- if ( $action eq 'Delete' and !$attach->disabled ) {
- $attach->disabled(time);
- $error = $attach->replace;
- }
- elsif ( $action eq 'Undelete' and $attach->disabled ) {
- $attach->disabled('');
- $error = $attach->replace;
- }
- elsif ( $action eq 'Purge' and $attach->disabled ) {
- $error = $attach->delete;
- }
- die $error if $error;
-}
-
-</%init>
diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi
deleted file mode 100755
index 44be20c..0000000
--- a/httemplate/misc/cust_main-cancel.cgi
+++ /dev/null
@@ -1,76 +0,0 @@
-<% include('/elements/header.html', "Customer cancelled") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY>
-</HTML>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Cancel customer');
-
-my $custnum;
-my $ban = '';
-my $expire = '';
-if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
- $custnum = $1;
- $ban = $cgi->param('ban');
- $expire = $cgi->param('expire');
-} 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,
-} );
-
-my @errors;
-if($cgi->param('now_or_later')) {
- $expire = parse_datetime($expire);
- if($expire) {
- #warn "setting expire dates on custnum#$custnum\n";
- my @pkgs = $cust_main->ncancelled_pkgs;
- @errors = grep {$_} map { $_->cancel(
- 'reason' => $reasonnum,
- 'date' => $expire,
- ) } @pkgs;
- }
- else {
- @errors = ("error parsing expire date: ".$cgi->param('expire'));
- }
-}
-else {
- warn "cancelling $cust_main";
- @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 );
-}
-
-</%init>
diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi
deleted file mode 100644
index edf4665..0000000
--- a/httemplate/misc/cust_main-import.cgi
+++ /dev/null
@@ -1,161 +0,0 @@
-<% include("/elements/header.html",'Batch Customer Import') %>
-
-Import a file containing customer records.
-<BR><BR>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'CustomerImportForm',
- 'action' => 'process/cust_main-import.cgi',
- 'num_files' => 1,
- 'fields' => [ 'agentnum', 'custbatch', 'format' ],
- 'message' => 'Customer import successful',
- 'url' => $p."search/cust_main.html?custbatch=$custbatch",
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <% include( '/elements/tr-select-agent.html',
- #'curr_value' => '', #$agentnum,
- 'label' => "<B>Agent</B>",
- 'empty_label' => 'Select agent',
- )
- %>
-
- <INPUT TYPE="hidden" NAME="custbatch" VALUE="<% $custbatch %>"%>
-
- <TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <!-- <OPTION VALUE="simple">Simple -->
- <OPTION VALUE="extended" SELECTED>Extended
- <OPTION VALUE="extended-plus_options">Extended + options
- <OPTION VALUE="extended-plus_company">Extended plus company
- <OPTION VALUE="extended-plus_company_and_options">Extended plus company and options
- <OPTION VALUE="svc_external">External service
- <OPTION VALUE="svc_external_svc_phone">External service and phone service
- </SELECT>
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
-
-% #include('/elements/tr-select-part_referral.html')
-%
-
-
-<!--
-<TR>
- <TH>First package</TH>
- <TD>
- This needs to be agent-virtualized if it gets used!
- <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
-% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) {
-
- <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg_comment %></OPTION>
-% }
-
- </SELECT>
- </TD>
-</TR>
--->
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.CustomerImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-<!-- Simple file format is CSV, with the following field order: <i>cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments</i>
-<BR><BR> -->
-
-Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
-<BR><BR>
-
-<b>Extended</b> format has the following field order: <i>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, paycvv, paydate, invoicing_list, pkgpart, username, _password</i>
-<BR><BR>
-
-<b>Extended plus options</b> format has the following field order: <i>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, paycvv, paydate, invoicing_list, pkgpart, username, _password, options</i>
-
-<b>Extended plus company</b> format has the following field order: <i>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, paycvv, paydate, invoicing_list, pkgpart, username, _password</i>
-
-<b>Extended plus company and options </b> format has the following field order: <i>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, paycvv, paydate, invoicing_list, pkgpart, username, _password, options</i>
-<BR><BR>
-
-<b>External service</b> format has the following field order: <i>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, paycvv, paydate, invoicing_list, pkgpart, next_bill_date, id, title</i>
-<BR><BR>
-
-<b>External service and phone service</b> format has the following field order: <i>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, paycvv, paydate, invoicing_list, pkgpart, next_bill_date, id, title, countrycode, phonenum, sip_password, pin</i>
-<BR><BR>
-
-<%$req%> Required fields
-<BR><BR>
-
-Field information:
-
-<ul>
-
- <li><i>agent_custid</i>: This is the reseller's idea of the customer number or identifier. It may be left blank. If specified, it must be unique per-agent.
-
- <li><i>refnum</i>: Advertising source number - where a customer heard about your service. Configuration -&gt; Miscellaneous -&gt; View/Edit advertising sources. This field has special treatment upon import: If a string is passed instead
-of an integer, the string is searched for and if necessary auto-created in the
-advertising source table.
-
- <li><i>payinfo</i>: Credit card number, or leave this, <i>paycvv</i> and <i>paydate</i> blank for email/paper invoicing. You may optionally prepend an 'A' or 'D' to the credit card number for automatic or on demand of customer billing respectively
-
- <li><i>paycvv</i>: CVV2 number (three digits on the back of the credit card)
-
- <li><i>paydate</i>: Credit card expiration date, MM/YYYY or MM/YY (M/YY and M/YYYY are also accepted).
-
- <li><i>invoicing_list</i>: Email address for invoices, or POST for postal invoices.
-
- <li><i>pkgpart</i>: Package definition. Configuration -&gt; Packages -&gt; Package definitions
-
- <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
-
- <li><i>id</i>: External service id, integer
-
- <li><i>title</i>: External service identifier, text
-
- <li><i>options</i>: text containing one or more of
-
- <ul>
- <li>taxexempt: this customer does not pay taxes
- <li>postalinvoice: ensure this customer receives a postal invoice
- </ul>
-
-</ul>
-
-<BR>
-
-<% include('/elements/footer.html') %>
-
-<%once>
-
-my $req = qq!<font color="#ff0000">*</font>!;
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $custbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
-
-</%init>
diff --git a/httemplate/misc/cust_main-import_charges.cgi b/httemplate/misc/cust_main-import_charges.cgi
deleted file mode 100644
index c844e0e..0000000
--- a/httemplate/misc/cust_main-import_charges.cgi
+++ /dev/null
@@ -1,69 +0,0 @@
-<% include("/elements/header.html",'Batch Payment Charge') %>
-
-Import a CSV file containing customer payments.
-<BR><BR>
-
-<FORM ACTION="process/cust_main-import_charges.cgi" METHOD="post" ENCTYPE="multipart/form-data">
-
-<% &ntable("#cccccc", 2) %>
-
-<% include('/elements/tr-select-agent.html',
- #'curr_value' => '', #$agentnum,
- 'label' => "<B>Agent</B>",
- 'empty_label' => 'Select agent',
- )
-%>
-
-<TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <OPTION VALUE="simple">Simple
-<!-- <OPTION VALUE="extended" SELECTED>Extended -->
- </SELECT>
- </TD>
-</TR>
-
-<TR>
- <TH ALIGN="right">CSV filename</TH>
- <TD><INPUT TYPE="file" NAME="csvfile"></TD>
-</TR>
-
-<TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import CSV file"></TD></TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-Simple file format is CSV, with the following field order: <i>custnum, agent_custid, amount, description</i>
-<BR><BR>
-
-<!-- Extended file format is not yet defined</i>
-<BR><BR> -->
-
-Field information:
-
-<ul>
-
- <li><i>custnum</i>: This is the freeside customer number. It may be left blank. If specified, agent_custid must be blank.
-
- <li><i>agent_custid</i>: This is the reseller's idea of the customer number or identifier. It may be left blank. If specified, custnum must be blank.
-
- <li><i>amount</i>: A numeric value with at most two digits after the decimal point. If <i>amount</i> is negative, a credit will be applied instead.
-
- <li><i>description</i>: Text describing the transaction.
-
-</ul>
-
-<BR>
-
-<% include('/elements/footer.html') %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
-
diff --git a/httemplate/misc/cust_main-merge.html b/httemplate/misc/cust_main-merge.html
deleted file mode 100755
index 4decbef..0000000
--- a/httemplate/misc/cust_main-merge.html
+++ /dev/null
@@ -1,40 +0,0 @@
-% if ( $error ) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(1). "merge_cust.html?". $cgi->query_string ) %>
-% } else {
-<% include('/elements/header-popup.html', "Customer merged") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.href = '<% $p %>view/cust_main.cgi?<% $new_custnum %>';
-%# parent.nd(1) ?
- </SCRIPT>
- </BODY>
-</HTML>
-% }
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Merge customer');
-
-my $error = '';
-
-$cgi->param('custnum') =~ /^(\d+)$/ or die "illegal custnum";
-my $custnum = $1;
-
-my $new_custnum;
-if ( $cgi->param('new_custnum') =~ /^(\d+)$/ ) {
- $new_custnum = $1;
-
- my $cust_main = qsearchs( {
- 'table' => 'cust_main',
- 'hashref' => { 'custnum' => $custnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
- } );
- die "No customer # $custnum" unless $cust_main;
-
- $error = $cust_main->merge($new_custnum);
-
-} else {
- $error = 'Select a customer to merge into';
-}
-
-</%init>
diff --git a/httemplate/misc/cust_main_note-import.cgi b/httemplate/misc/cust_main_note-import.cgi
deleted file mode 100644
index 8a94ae4..0000000
--- a/httemplate/misc/cust_main_note-import.cgi
+++ /dev/null
@@ -1,211 +0,0 @@
-<% include("/elements/header.html", 'Batch Customer Note Import') %>
-%
-
-<FORM ACTION="process/cust_main_note-import.cgi" METHOD="POST">
-
-
-<SCRIPT TYPE="text/javascript">
-
- function clearhint_custnum() {
-
- if ( this.value == 'Not found' ) {
- this.value = '';
- this.style.color = '#000000';
- }
-
- }
-
- function search_custnum() {
-
- this.style.color = '#000000'
-
- var custnum_obj = this;
- var searchrow = this.getAttribute('rownum');
- var custnum = this.value;
- var name_obj = document.getElementById('name'+searchrow);
-
- if ( custnum == 'searching...' || custnum == 'Not found' )
- return;
-
- var customer_select = document.getElementById('cust_select'+searchrow);
-
- if ( custnum == '' ) {
- customer_select.selectedIndex = 0;
- return;
- }
-
- custnum_obj.value = 'searching...';
- custnum_obj.disabled = true;
- custnum_obj.style.backgroundColor = '#dddddd';
-
-
- //alert('search for custnum ' + custnum + ', row#' + searchrow );
-
- function search_custnum_update(name) {
-
- var name = eval('(' + name + ')' );
-
- custnum_obj.disabled = false;
- custnum_obj.style.backgroundColor = '#ffffff';
-
- if ( name.length > 0 ) {
- //alert('custnum found: ' + name);
- opt(customer_select,custnum,name,'#000000');
- customer_select.selectedIndex = customer_select.length - 1;
- custnum_obj.value = custnum;
- name_obj.value = name;
- } else {
- custnum_obj.value = 'Not found';
- custnum_obj.style.color = '#ff0000';
- }
-
- }
-
- custnum_search( custnum, search_custnum_update );
-
- }
-
- function select_customer() {
-
- var custnum = this.options[this.selectedIndex].value;
- var name = this.options[this.selectedIndex].text;
-
- var searchrow = this.getAttribute('rownum');
- var custnum_obj = document.getElementById('custnum'+searchrow);
- var name_obj = document.getElementById('name'+searchrow);
-
- custnum_obj.value = custnum;
- custnum_obj.style.color = '#000000';
-
- name_obj.value = name;
-
- }
-
- function opt(what,value,text,color) {
- var optionName = new Option(text, value, false, false);
- optionName.style.color = color;
- var length = what.length;
- what.options[length] = optionName;
- }
-
- function previewChanged(what) {
- var submit_obj = document.getElementById('importsubmit');
- if (what.checked) {
- submit_obj.value = 'Preview note import';
- }else{
- submit_obj.value = 'Import notes';
- }
- }
-
-</SCRIPT>
-
-<% 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;
-% my $use_agent_custid = $cgi->param('use_agent_custid') ? 1 : 0;
-%
-% if ( defined($fh) ) {
- <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
- <TR>
- <TH>Cust #</TH>
- <TH>Customer</TH>
- <TH>Last</TH>
- <TH>First</TH>
- <TH>Note to be added</TH>
- </TR>
-% 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 ($agentnum && $custnum && $use_agent_custid) {
-% @cust_main = qsearch('cust_main', { 'agent' => $agentnum,
-% 'agent_custid' => $custnum } );
-% } elsif ($custnum) { # && !use_agent_custid
-% @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);
-% }
-%
- <TR>
- <TD>
- <INPUT TYPE="text" NAME="custnum<% $row %>" ID="custnum<% $row %>" SIZE=8 MAXLENGTH=12 VALUE="<% $cust_main[0] ? $cust_main[0]->custnum : '' %>" rownum="<% $row %>">
- <SCRIPT TYPE="text/javascript">
- var custnum_input<% $row %> = document.getElementById("custnum<% $row %>");
- custnum_input<% $row %>.onfocus = clearhint_custnum;
- custnum_input<% $row %>.onchange = search_custnum;
- </SCRIPT>
- </TD>
- <TD>
- <SELECT NAME="cust_select<% $row %>" ID="cust_select<% $row %>" rownum="<% $row %>">
- <OPTION VALUE="">---</OPTION>
-% my $i=0;
-% foreach (@cust_main) {
- <OPTION <% $i ? '' : 'SELECTED' %> VALUE="<% $_->custnum %>"><% $_->name %></OPTION>
-% $i++;
-% }
- </SELECT>
- <SCRIPT TYPE="text/javascript">
- var customer_select<% $row %> = document.getElementById("cust_select<% $row %>");
- customer_select<% $row %>.onchange = select_customer;
- </SCRIPT>
- <INPUT TYPE="hidden" NAME="name<% $row %>" ID="name<% $row %>" VALUE="<% $i ? $cust_main[0]->name : '' %>">
- </TD>
- <TD>
- <% $first %>
- <INPUT TYPE="hidden" NAME="first<% $row %>" VALUE="<% $first %>">
- </TD>
- <TD>
- <% $last %>
- <INPUT TYPE="hidden" NAME="last<% $row %>" VALUE="<% $last %>">
- </TD>
- <TD>
- <% $note %>
- <INPUT TYPE="hidden" NAME="note<% $row %>" VALUE="<% $note %>">
- </TD>
- </TR>
-% $row++;
-% }
- </TABLE>
- <INPUT TYPE="submit" NAME="submit" ID="importsubmit" VALUE="Import notes">
- <INPUT TYPE="checkbox" NAME="preview" onchange="previewChanged(this);">
- Preview mode
-% } else {
- No file supplied
-% }
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
diff --git a/httemplate/misc/cust_main_note-import.html b/httemplate/misc/cust_main_note-import.html
deleted file mode 100644
index cc1645d..0000000
--- a/httemplate/misc/cust_main_note-import.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<% include("/elements/header.html",'Batch Customer Note Import') %>
-
-<FORM ACTION="cust_main_note-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
-
-Import a CSV file containing customer notes records.
-<BR><BR>
-
-File format is CSV, with the following field order: <i>[custnum,] last, first, notefield1, notefield2, notefield3...</i>
-<BR>
-The optional custnum field is identified by being numeric.
-Anything after the character sequence #! is ignored.
-<BR><BR>
-
-<% &ntable("#cccccc") %>
-
-<% include('/elements/tr-select-agent.html',
- #'curr_value' => '', #$agentnum,
- 'label' => "<B>Agent</B>",
- 'empty_label' => 'Select agent',
- )
-%>
-
-<TR>
- <TH ALIGN="right">CSV filename</TH>
- <TD><INPUT TYPE="file" NAME="csvfile"></TD>
-</TR>
-<TR>
- <TH ALIGN="right">Include additional possibilites when exact match is found</TH>
- <TD><INPUT TYPE="checkbox" NAME="fuzzies"></TD>
-</TR>
-
-<TR>
- <TH ALIGN="right">custnum is reseller's customer number</TH>
- <TD><INPUT TYPE="checkbox" NAME="use_agent_custid"></TD>
-</TR>
-
-</TABLE>
-<BR><BR>
-
-<INPUT TYPE="submit" VALUE="Load and match">
-</FORM>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
-
diff --git a/httemplate/misc/cust_pay-import.cgi b/httemplate/misc/cust_pay-import.cgi
deleted file mode 100644
index 849a25b..0000000
--- 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.
-<BR><BR>
-
-<FORM ACTION="process/cust_pay-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
-
-<% &ntable("#cccccc", 2) %>
-
-<% include('/elements/tr-select-agent.html',
- #'curr_value' => '', #$agentnum,
- 'label' => "<B>Agent</B>",
- 'empty_label' => 'Select agent',
- )
-%>
-
-<TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <OPTION VALUE="simple">Simple
-<!-- <OPTION VALUE="extended" SELECTED>Extended -->
- </SELECT>
- </TD>
-</TR>
-
-<TR>
- <TH ALIGN="right">CSV filename</TH>
- <TD><INPUT TYPE="file" NAME="csvfile"></TD>
-</TR>
-
-<TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import CSV file"></TD></TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-Simple file format is CSV, with the following field order: <i>custnum, agent_custid, amount, checknum</i>
-<BR><BR>
-
-<!-- Extended file format is not yet defined</i>
-<BR><BR> -->
-
-Field information:
-
-<ul>
-
- <li><i>custnum</i>: This is the freeside customer number. It may be left blank. If specified, agent_custid must be blank.
-
- <li><i>agent_custid</i>: This is the reseller's idea of the customer number or identifier. It may be left blank. If specified, custnum must be blank.
-
- <li><i>amount</i>: A positive numeric value with at most two digits after the decimal point.
-
- <li><i>checknum</i>: A sequences of digits. May be left blank.
-
-</ul>
-
-<BR>
-
-<% include('/elements/footer.html') %>
diff --git a/httemplate/misc/cust_pkg-import.html b/httemplate/misc/cust_pkg-import.html
deleted file mode 100644
index b29884d..0000000
--- a/httemplate/misc/cust_pkg-import.html
+++ /dev/null
@@ -1,150 +0,0 @@
-<% include("/elements/header.html",'Batch Package Import') %>
-
-Import a file containing package records.
-<BR><BR>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'PackageImportForm',
- 'action' => 'process/cust_pkg-import.html',
- 'num_files' => 1,
- 'fields' => [ 'agentnum', 'pkgbatch', 'format' ],
- 'message' => 'Package import successful',
- 'url' => $p."search/cust_pkg.cgi?pkgbatch=$pkgbatch",
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <% include( '/elements/tr-select-agent.html',
- #'curr_value' => '', #$agentnum,
- 'label' => "<B>Agent</B>",
- 'empty_label' => 'Select agent',
- )
- %>
-
- <INPUT TYPE="hidden" NAME="pkgbatch" VALUE="<% $pkgbatch %>"%>
-
- <TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <OPTION VALUE="default" SELECTED>Default
- <OPTION VALUE="default-agent_custid">Default with agent_custid
- <OPTION VALUE="svc_acct">Account service
- <OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
- <OPTION VALUE="svc_phone">Phone service
- <OPTION VALUE="svc_phone-agent_custid">Phone service with agent_custid
- <OPTION VALUE="svc_external">External service
- <OPTION VALUE="svc_external-agent_custid">External service with agent_custid
- </SELECT>
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.PackageImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
-<BR><BR>
-
-<b>Default</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire</i>
-<BR><BR>
-
-<b>Default with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire</i>
-<BR><BR>
-
-<b>Account service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
-<BR><BR>
-
-<b>Account service with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
-<BR><BR>
-
-<b>Phone sevice</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, phonenum, sip_password, pin</i>
-<BR><BR>
-
-<b>Phone service with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, phonenum, sip_password, pin</i>
-<BR><BR>
-
-<b>External sevice</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, id, title</i>
-<BR><BR>
-
-<b>External service with agent_custid</b> format has the following field order: <i>agent_custid<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, id, title</i>
-<BR><BR>
-
-<%$req%> Required fields
-<BR><BR>
-
-Field information:
-
-<ul>
-
- <li><i>custnum</i>: This specifies an existing customer by custnum.
-
- <li><i>agent_custid</i>: This specifies an existing customer record by agent_custid.
-
- <li><i>pkgpart</i>: Package definition. Configuration -&gt; Packages -&gt; Package definitions
-
- <li><i>discountnum</i>: Optional discount. Configuration -&gt; Packages -&gt; Discounts
-
- <li><i>start_date</i>: Indicates a future start date; do not fill in for active packages
-
- <li><i>setup</i>: Indicates setup fee has been charged and package setup on this date
-
- <li><i>bill</i>: Next bill date
-
- <li><i>last_bill</i>: Last bill date
-
- <li><i>susp</i>: Indicates the package is suspended (on the given date).
-
- <li><i>adjourn</i>: Indicates a future suspension on this date.
-
- <li><i>cancel</i>: Indicates the package is cancelled (on the given date).
-
- <li><i>expire</i>: Indicates a future cancellation on this date.
-
-<!--
- <li><i>username</i> and <i>_password</i> are required if <i>pkgpart</i> is specified. (Extended and Extended plus company formats)
--->
-
- <li><i>domsvc</i>: Domain svcnum
-
- <li><i>id</i>: External service id, integer
-
- <li><i>title</i>: External service identifier, text
-
-</ul>
-
-<BR>
-
-<% include('/elements/footer.html') %>
-
-<%once>
-
-my $req = qq!<font color="#ff0000">*</font>!;
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $pkgbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
-
-</%init>
diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi
deleted file mode 100644
index e5934e4..0000000
--- a/httemplate/misc/custom_link_proxy.cgi
+++ /dev/null
@@ -1,24 +0,0 @@
-% if( $response->is_success ) {
-<% $response->decoded_content %>
-% }
-% else {
-<% $response->error_as_HTML %>
-% }
-<%init>
-
-my( $custnum ) = $cgi->param('custnum');
-my $cust_main = qsearchs('cust_main', { custnum => $custnum } )
- or die "custnum '$custnum' not found"; # just check for existence
-
-my $conf = new FS::Conf;
-my $url = $conf->config('cust_main-custom_link') . $cust_main->custnum;
-#warn $url;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied"
- unless $curuser->access_right('View customer');
-
-my $ua = new LWP::UserAgent;
-my $response = $ua->get($url);
-</%init>
diff --git a/httemplate/misc/delay_susp_pkg.html b/httemplate/misc/delay_susp_pkg.html
deleted file mode 100755
index 8adc40d..0000000
--- a/httemplate/misc/delay_susp_pkg.html
+++ /dev/null
@@ -1,73 +0,0 @@
-%# if ( $link eq 'popup' ) {
- <% include('/elements/header-popup.html', $title ) %>
-%# } else {
-%# <% include("/elements/header.html", $title, '') %>
-%# }
-
-<% include('/elements/init_calendar.html') %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="ds_popup" ACTION="<% popurl(1) %>process/delay_susp_pkg.html" METHOD=POST>
-<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
-
-<BR><BR>
-<% "Delay automatic suspension of " .$part_pkg->pkg_comment %>
-<% ntable("#cccccc", 2) %>
-
-<TR>
- <TD>Delay until</TD>
- <TD><INPUT TYPE="text" NAME="date" ID="dun_date" VALUE="<% $date |h %>">
- <IMG SRC="<% $p %>images/calendar.png" ID="dun_button" STYLE="cursor:pointer" TITLE="Select date">
- <BR><I>m/d/y</I>
- </TD>
-</TR>
-<SCRIPT TYPE="text/javascript">
- Calendar.setup({
- inputField: "dun_date",
- ifFormat: "<% $date_format %>",
- button: "dun_button",
- align: "BR"
- });
-</SCRIPT>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-my $conf = new FS::Conf;
-my $date_format = $conf->config('date_format') || '%m/%d/%Y';
-
-my $date = time2str($date_format, time);
-
-my($pkgnum);
-if ( $cgi->param('error') ) {
- $pkgnum = $cgi->param('pkgnum');
- $date = $cgi->param('date');
-} elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
- $pkgnum = $1;
-} else {
- die "illegal query ". $cgi->keywords;
-}
-
-my $submit = 'Delay Suspension';
-my $right = 'Delay suspension events';
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-die "access denied" unless $curuser->access_right($right);
-
-my $title = 'Delay Suspension of Package';
-
-my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum})
- or die "Unknown pkgnum: $pkgnum";
-
-my $part_pkg = $cust_pkg->part_pkg;
-
-</%init>
diff --git a/httemplate/misc/delete-agent_payment_gateway.cgi b/httemplate/misc/delete-agent_payment_gateway.cgi
deleted file mode 100644
index 20a202e..0000000
--- 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-cgp_rule.html b/httemplate/misc/delete-cgp_rule.html
deleted file mode 100644
index 0415bc9..0000000
--- a/httemplate/misc/delete-cgp_rule.html
+++ /dev/null
@@ -1,23 +0,0 @@
-% if ( $error ) {
-% errorpage($error);
-% } else {
-<% $cgi->redirect($p. "browse/cgp_rule.html?svcnum=". $svcnum) %>
-% }
-<%init>
-
-# :/ needs agent-virt so you can't futz with arbitrary rules
-
-#die "access denied"
-# unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service');
-
-#untaint rulenum
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal rulenum";
-my $rulenum = $1;
-
-my $cgp_rule = qsearchs('cgp_rule', { 'rulenum' => $rulenum } );
-my $svcnum = $cgp_rule->svcnum;
-
-my $error = $cgp_rule->delete;
-
-</%init>
diff --git a/httemplate/misc/delete-cust_bill.html b/httemplate/misc/delete-cust_bill.html
deleted file mode 100644
index 3a642b0..0000000
--- a/httemplate/misc/delete-cust_bill.html
+++ /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 invoices');
-
-#untaint invnum
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal crednum";
-my $invnum = $1;
-
-my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
-my $custnum = $cust_bill->custnum;
-
-my $error = $cust_bill->delete;
-
-</%init>
diff --git a/httemplate/misc/delete-cust_credit.cgi b/httemplate/misc/delete-cust_credit.cgi
deleted file mode 100755
index 03eb472..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/delete-cust_pay.cgi b/httemplate/misc/delete-cust_pay.cgi
deleted file mode 100755
index 38e7e4b..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/delete-cust_pkg_discount.html b/httemplate/misc/delete-cust_pkg_discount.html
deleted file mode 100644
index 0bdaa13..0000000
--- a/httemplate/misc/delete-cust_pkg_discount.html
+++ /dev/null
@@ -1,32 +0,0 @@
-% if ( $error ) {
-% errorpage($error);
-% } else {
-% my $frag = "cust_pkg". $cust_pkg->pkgnum;
-% my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/
-% ? ''
-% : ';show=packages';
-<% $cgi->redirect($p. "view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag" ) %>
-% }
-<%init>
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-#XXX ACL to remove discounts
-#die "access denied"
-# unless $curuser->access_right('Delete invoices');
-
-#untaint pkgdiscountnum
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal crednum";
-my $pkgdiscountnum = $1;
-
-my $cust_pkg_discount =
- qsearchs('cust_pkg_discount', {'pkgdiscountnum'=>$pkgdiscountnum});
-my $cust_pkg = $cust_pkg_discount->cust_pkg;
-my $custnum = $cust_pkg->custnum;
-
-$cust_pkg_discount->disabled('Y');
-
-my $error = $cust_pkg_discount->replace;
-
-</%init>
diff --git a/httemplate/misc/delete-cust_refund.cgi b/httemplate/misc/delete-cust_refund.cgi
deleted file mode 100755
index 983a79d..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi
deleted file mode 100755
index 203ed36..0000000
--- a/httemplate/misc/delete-customer.cgi
+++ /dev/null
@@ -1,64 +0,0 @@
-<% include('/elements/header.html', 'Delete customer') %>
-
-<% include('/elements/error.html') %>
-
-<FORM ACTION="<% popurl(1) %>process/delete-customer.cgi" METHOD=POST>
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum |h %>">
-
-%if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
- Move uncancelled packages to customer number
- <INPUT TYPE="text" NAME="new_custnum" VALUE="<% $new_custnum |h %>"><BR><BR>
-%}
-
-This will <B>completely remove</B> all traces of this customer record. This
-is <B>not</B> 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 <A HREF="../config/config-view.cgi#hidecancelledcustomers">hidecancelledcustomers</A> configuration option)
-<BR>
-<BR>Are you <B>absolutely sure</B> you want to delete this customer?
-<BR><INPUT TYPE="submit" VALUE="Yes">
-</FORM>
-
-<% 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 200365d..0000000
--- 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. '#dns') %>
-% }
-<%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;
-
-</%init>
diff --git a/httemplate/misc/delete-mailinglistmember.html b/httemplate/misc/delete-mailinglistmember.html
deleted file mode 100644
index 6b91de8..0000000
--- a/httemplate/misc/delete-mailinglistmember.html
+++ /dev/null
@@ -1,20 +0,0 @@
-% if ( $error ) {
-% errorpage($error);
-% } else {
-<% $cgi->redirect($p."search/mailinglistmember.html?listnum=$listnum") %>
-% }
-<%init>
-
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal devicenum";
-my $membernum = $1;
-
-my $mailinglistmember =
- qsearchs('mailinglistmember', { 'membernum' => $membernum } )
- or die "unknown membernum $membernum";
-
-my $listnum = $mailinglistmember->listnum;
-
-my $error = $mailinglistmember->delete;
-
-</%init>
diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi
deleted file mode 100755
index 52404e0..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/delete-phone_device.html b/httemplate/misc/delete-phone_device.html
deleted file mode 100755
index 7220c41..0000000
--- a/httemplate/misc/delete-phone_device.html
+++ /dev/null
@@ -1,23 +0,0 @@
-% if ( $error ) {
-% errorpage($error);
-% } else {
-<% $cgi->redirect($p. "view/svc_phone.cgi?". $svcnum) %>
-% }
-<%init>
-
-# :/ needs agent-virt so you can't futz with arbitrary devices
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
-
-#untaint devicenum
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal devicenum";
-my $devicenum = $1;
-
-my $phone_device = qsearchs('phone_device', { 'devicenum' => $devicenum } );
-my $svcnum = $phone_device->svcnum;
-
-my $error = $phone_device->delete;
-
-</%init>
diff --git a/httemplate/misc/delete-rate_detail.html b/httemplate/misc/delete-rate_detail.html
deleted file mode 100755
index 30856a7..0000000
--- a/httemplate/misc/delete-rate_detail.html
+++ /dev/null
@@ -1,20 +0,0 @@
-% if ( $error ) {
-% errorpage($error);
-% } else {
-<% header('Rate deleted') %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY></HTML>
-% }
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my ($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ or die "Illegal ratedetailnum";
-my $rate_detail = FS::rate_detail->by_key($1);
-my $error = $rate_detail->delete;
-
-</%init>
diff --git a/httemplate/misc/disable-cust_location.cgi b/httemplate/misc/disable-cust_location.cgi
deleted file mode 100755
index ee7ba1d..0000000
--- a/httemplate/misc/disable-cust_location.cgi
+++ /dev/null
@@ -1,35 +0,0 @@
-<% header("Location disabled") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
-</BODY>
-</HTML>
-<%init>
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-my $error;
-
-die "access denied"
- unless $curuser->access_right('Change customer package');
-
-my $locationnum = $cgi->param('locationnum');
-my $cust_location = qsearchs({
- 'select' => 'cust_location.*',
- 'table' => 'cust_location',
- 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
- 'hashref' => { 'locationnum' => $locationnum },
- 'extra_sql' => ' AND '. $curuser->agentnums_sql,
-});
-die "unknown locationnum $locationnum" unless $cust_location;
-
-my @pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum,
- 'cancel' => '' });
-if ( @pkgs ) {
- $error = "Location $locationnum has active packages"
-}
-else {
- $cust_location->disabled('Y');
- $error = $cust_location->replace;
-}
-die $error if $error;
-</%init>
diff --git a/httemplate/misc/disable-payment_gateway.cgi b/httemplate/misc/disable-payment_gateway.cgi
deleted file mode 100644
index 13e1f92..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi
deleted file mode 100644
index 23deba7..0000000
--- a/httemplate/misc/download-batch.cgi
+++ /dev/null
@@ -1,21 +0,0 @@
-<% $pay_batch->export_batch($format) %><%init>
-
-#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
-http_header('Content-Type' => 'text/plain' ); # not necessarily correct...
-
-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;
-}
-
-my $pay_batch = qsearchs('pay_batch', { batchnum => $batchnum } );
-die "Batch not found: '$batchnum'" if !$pay_batch;
-
-</%init>
diff --git a/httemplate/misc/dump.cgi b/httemplate/misc/dump.cgi
deleted file mode 100644
index 3b60b20..0000000
--- 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 (<DUMP>) {
-% print $_;
-% }
-% close DUMP;
diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html
deleted file mode 100644
index 759c8bf..0000000
--- a/httemplate/misc/email-customers.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<% include('/elements/header.html', $title) %>
-
-<FORM NAME="OneTrueForm" ACTION="email-customers.html" METHOD="POST">
-<INPUT TYPE="hidden" NAME="table" VALUE="<% $table %>">
-%# Mixing search params with from address, subject, etc. required special-case
-%# handling of those, risked name conflicts, and caused massive problems with
-%# multi-valued search params. We are no longer in search context, so we
-%# pack the search into a Storable string for later use.
-<INPUT TYPE="hidden" NAME="search" VALUE="<% encode_base64(nfreeze(\%search)) %>">
-
-% if ( $cgi->param('action') eq 'send' ) {
-
- <FONT SIZE="+2">Sending notice</FONT>
-
- <% include('/elements/progress-init.html',
- 'OneTrueForm',
- [ qw( search table from subject html_body text_body msgnum ) ],
- 'process/email-customers.html',
- { 'message' => "Notice sent" }, #would be nice to show #, but..
- )
- %>
-
-% } elsif ( $cgi->param('action') eq 'preview' ) {
-
- <FONT SIZE="+2">Preview notice</FONT>
-
-% }
-
-% if ( $cgi->param('action') ) {
-
- <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
- <INPUT TYPE="hidden" NAME="msgnum" VALUE="<% $cgi->param('msgnum') %>">
-
-% if ( $msg_template ) {
- <% include('/elements/tr-fixed.html',
- 'label' => 'Template:',
- 'value' => $msg_template->msgname,
- )
- %>
-% }
-
- <% include('/elements/tr-fixed.html',
- 'field' => 'from',
- 'label' => 'From:',
- 'value' => scalar( $from ),
- )
- %>
-
- <% include('/elements/tr-fixed.html',
- 'field' => 'subject',
- 'label' => 'Subject:',
- 'value' => scalar( $subject ),
- )
- %>
-
- <INPUT TYPE="hidden" NAME="html_body" VALUE="<% $html_body |h %>">
- <TR>
- <TD ALIGN="right" VALIGN="top">Message (HTML display): </TD>
- <TD CLASS="background" ALIGN="left"><% $html_body %></TD>
- </TR>
-
-% my $text_body = HTML::FormatText->new(leftmargin=>0)->format(
-% HTML::TreeBuilder->new_from_content(
-% $html_body
-% )
-% );
- <INPUT TYPE="hidden" NAME="text_body" VALUE="<% $text_body |h %>">
- <TR>
- <TD ALIGN="right" VALIGN="top">Message (Text display): </TD>
- <TD CLASS="background" STYLE="background-color:white" ALIGN="left"><PRE><% $text_body %></PRE></TD>
- </TR>
-
- </TABLE>
-
-% if ( $cgi->param('action') eq 'preview' ) {
-
- <SCRIPT>
- function areyousure(href) {
- return confirm("Send this notice to <% $num_cust %> customers?");
- }
- </SCRIPT>
-
- <BR>
- <INPUT TYPE="hidden" NAME="action" VALUE="send">
- <INPUT TYPE="submit" VALUE="Send notice" onClick="return areyousure()">
-
-% }
-
-% } else {
-
-<SCRIPT TYPE="text/javascript">
-function toggle(obj) {
- document.getElementById('table_no_template').style.display = (obj.value == 0) ? '' : 'none';
-}
-
-</SCRIPT>
-Template:
- <% include('/elements/select-table.html',
- 'label' => 'Template:',
- 'table' => 'msg_template',
- 'name_col' => 'msgname',
- 'empty_label' => '(none)',
- 'onchange' => 'toggle(this)',
- )
- %><BR>
- <TABLE BGCOLOR="#cccccc" CELLSPACING=0 WIDTH="100%" id="table_no_template">
- <% include('/elements/tr-input-text.html',
- 'field' => 'from',
- 'label' => 'From:',
- )
- %>
-
- <% include('/elements/tr-input-text.html',
- 'field' => 'subject',
- 'label' => 'Subject:',
- )
- %>
-
- <TR>
- <TD ALIGN="right" VALIGN="top">Message: </TD>
- <TD><% include('/elements/htmlarea.html', 'field'=>'html_body') %></TD>
- </TR>
-
- </TABLE>
-
-%#Substitution vars:
-
- <INPUT TYPE="hidden" NAME="action" VALUE="preview">
- <INPUT TYPE="submit" VALUE="Preview notice">
-
-% }
-
-</FORM>
-
-% if ( $cgi->param('action') eq 'send' ) {
- <SCRIPT TYPE="text/javascript">
- process();
- </SCRIPT>
-% }
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices');
-
-my $table = $cgi->param('table') or die "'table' required";
-my %search;
-if ( $cgi->param('search') ) {
- %search = %{ thaw(decode_base64($cgi->param('search'))) };
-}
-else {
- %search = $cgi->Vars;
- delete $search{$_} for qw( action table from subject html_body text_body );
- # FS::$table->search is expected to know which parameters might be
- # multi-valued, and to accept scalar values for them also. No good
- # solution to this since CGI can't tell whether a parameter _might_
- # have had multiple values, only whether it does.
- @search{keys %search} = map { /\0/ ? [ split /\0/, $_ ] : $_ } values %search;
-}
-
-my $title = 'Send bulk customer notices';
-
-my $num_cust;
-my $from = $cgi->param('from') || '';
-my $subject = $cgi->param('subject') || '';
-my $html_body = $cgi->param('html_body') || '';
-
-my $msg_template = '';
-
-if ( $cgi->param('action') eq 'preview' ) {
- my $sql_query = "FS::$table"->search(\%search);
- my $count_query = delete($sql_query->{'count_query'});
- my $count_sth = dbh->prepare($count_query)
- or die "Error preparing $count_query: ". dbh->errstr;
- $count_sth->execute
- or die "Error executing $count_query: ". $count_sth->errstr;
- my $count_arrayref = $count_sth->fetchrow_arrayref;
- $num_cust = $count_arrayref->[0];
-
- if ( $cgi->param('msgnum') ) {
- $msg_template = qsearchs('msg_template',
- { msgnum => $cgi->param('msgnum') } )
- or die "template not found: ".$cgi->param('msgnum');
- $sql_query->{'extra_sql'} .= ' LIMIT 1';
- $sql_query->{'order_by'} = '';
- my $cust = qsearchs($sql_query)->cust_main;
- my %message = $msg_template->prepare( 'cust_main' => $cust );
- ($from, $subject, $html_body) = @message{'from', 'subject', 'html_body'};
- }
-}
-
-</%init>
diff --git a/httemplate/misc/email-invoice.cgi b/httemplate/misc/email-invoice.cgi
deleted file mode 100755
index 269722f..0000000
--- 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');
-
-</%init>
diff --git a/httemplate/misc/email_events.cgi b/httemplate/misc/email_events.cgi
deleted file mode 100644
index e7a0e77..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/email_invoice_events.cgi b/httemplate/misc/email_invoice_events.cgi
deleted file mode 100644
index d65fe17..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/email_invoices.cgi b/httemplate/misc/email_invoices.cgi
deleted file mode 100644
index 78ca0f6..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/enable_or_disable_tax.html b/httemplate/misc/enable_or_disable_tax.html
deleted file mode 100755
index 0efd07d..0000000
--- a/httemplate/misc/enable_or_disable_tax.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<% include('/elements/header-popup.html', ucfirst($action). ' Tax Rates') %>
-<% include('/elements/error.html') %>
-
-<FORM ACTION="<% popurl(1) %>process/enable_or_disable_tax.html" METHOD=POST>
-<INPUT TYPE="hidden" NAME="action" VALUE="<% $action %>">
-<INPUT TYPE="hidden" NAME="data_vendor" VALUE="<% $cgi->param('data_vendor') %>">
-<INPUT TYPE="hidden" NAME="geocode" VALUE="<% $cgi->param('geocode') %>">
-<INPUT TYPE="hidden" NAME="taxclassnum" VALUE="<% $cgi->param('taxclassnum') %>">
-<INPUT TYPE="hidden" NAME="tax_type" VALUE="<% $cgi->param('tax_type') %>">
-<INPUT TYPE="hidden" NAME="tax_cat" VALUE="<% $cgi->param('tax_cat') %>">
-<INPUT TYPE="hidden" NAME="showdisabled" VALUE="<% $cgi->param('showdisabled') |h %>">
-
-This will <B><% $action %></B> <% $count %> tax
-<% $count == 1 ? 'rate' : 'rates' %>. Are you <B>certain</B> you want to do
-this?
-<BR><BR><INPUT TYPE="submit" VALUE="Yes">
-</FORM>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $action = '';
-if ( $cgi->param('action') =~ /^(\w+)$/ ) {
- $action = $1;
-}
-
-my ($query, $count_query) = FS::tax_rate::browse_queries(scalar($cgi->Vars));
-
-my $count_sth = dbh->prepare($count_query)
- or die "Error preparing $count_query: ". dbh->errstr;
-$count_sth->execute
- or die "Error executing $count_query: ". $count_sth->errstr;
-my $count = $count_sth->fetchrow_arrayref->[0];
-
-</%init>
diff --git a/httemplate/misc/exchanges.cgi b/httemplate/misc/exchanges.cgi
deleted file mode 100644
index f5860cf..0000000
--- a/httemplate/misc/exchanges.cgi
+++ /dev/null
@@ -1,24 +0,0 @@
-%# [ <% join(', ', map { qq("$_") } @exchanges) %> ]
-<% objToJson(\@exchanges) %>
-<%init>
-
-my( $areacode, $svcpart ) = $cgi->param('arg');
-
-my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
-die "unknown svcpart $svcpart" unless $part_svc;
-
-my @exports = $part_svc->part_export_did;
-if ( scalar(@exports) > 1 ) {
- die "more than one DID-providing export attached to svcpart $svcpart";
-} elsif ( ! @exports ) {
- die "no DID providing export attached to svcpart $svcpart";
-}
-my $export = $exports[0];
-
-my $something = $export->get_dids('areacode'=>$areacode);
-
-#warn Dumper($something);
-
-my @exchanges = @{ $something };
-
-</%init>
diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi
deleted file mode 100755
index 2591fce..0000000
--- 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_invoice($template);
-
-my $custnum = $cust_bill->getfield('custnum');
-
-</%init>
diff --git a/httemplate/misc/fax_events.cgi b/httemplate/misc/fax_events.cgi
deleted file mode 100644
index 39cba07..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/fax_invoice_events.cgi b/httemplate/misc/fax_invoice_events.cgi
deleted file mode 100644
index 05420ee..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/fax_invoices.cgi b/httemplate/misc/fax_invoices.cgi
deleted file mode 100644
index a843523..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/file-upload.html b/httemplate/misc/file-upload.html
deleted file mode 100644
index 469274c..0000000
--- a/httemplate/misc/file-upload.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<% include('/elements/header-minimal.html', 'File Upload') %>
-% if ($error) {
-Error: <% $error %>
-% }else{
-File Upload Successful <% join(',', @filenames) %>;
-% }
-<% include('/elements/footer.html') %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import'); #?
-
-my @filenames = ();
-my $error = ''; # could be extended to the access control
-
-$cgi->param('upload_fields') =~ /^([,\w]+)$/
- or $error = "invalid upload_fields";
-my $fields = $1;
-
-my $dir = $FS::UID::cache_dir. "/cache.". $FS::UID::datasrc;
-
-foreach my $field (split /,/, $fields) {
- next if $error;
-
- my $fh = $cgi->upload($field)
- or $error = "No valid file was provided.";
-
- my $suffix = '';
- if ( $cgi->param($field) =~ /(\.\w+)$/i ) {
- $suffix = lc($1);
- }
-
- my $sh = new File::Temp( TEMPLATE => 'upload.XXXXXXXX',
- SUFFIX => $suffix,
- DIR => $dir,
- UNLINK => 0,
- )
- or $error ||= "can't open temporary file to store upload: $!\n";
-
- unless ($error) {
- while(<$fh>) {
- print $sh $_;
- }
- $sh->filename =~ m!.*/([.\w]+)$!;
- push @filenames, "$field:$1";
- close $sh
- }
-
-}
-
-$error = "No files" unless scalar(@filenames);
-
-</%init>
diff --git a/httemplate/misc/ftp_invoices.cgi b/httemplate/misc/ftp_invoices.cgi
deleted file mode 100644
index 9a072b9..0000000
--- a/httemplate/misc/ftp_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_reftp', $cgi;
-
-</%init>
diff --git a/httemplate/misc/inventory_item-import.html b/httemplate/misc/inventory_item-import.html
deleted file mode 100644
index d264baf..0000000
--- a/httemplate/misc/inventory_item-import.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<% include("/elements/header.html", PL($inventory_class->classname)) %>
-
-Import a file containing <% PL($inventory_class->classname) %>, one per line.
-<BR><BR>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'InventoryItemImportForm',
- 'action' => 'process/inventory_item-import.html',
- 'num_files' => 1,
- #'fields' => [ 'format', 'itembatch', 'classnum', 'agentnum' ],
- 'fields' => [ 'format', 'classnum', 'agentnum', ],
- 'message' => 'Inventory import successful',
- #XXX redirect via $itembatch? or just back to class browse?
- #'url' => $p."search/phone_avail.html?availbatch=$availbatch",
- 'url' => $p."search/inventory_item.html?classnum=$classnum;avail=1",
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <INPUT TYPE="hidden" NAME="format" VALUE="default">
-
- <INPUT TYPE="hidden" NAME="classnum" VALUE="<% $classnum %>">
-
-%# <INPUT TYPE="hidden" NAME="itembatch" VALUE="<% $itembatch %>">
-
- <% include('/elements/tr-select-agent.html',
- 'viewall_right' => 'None',
- )
- %>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.InventoryItemImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-Upload file can be a text file or Excel spreadsheet. If an Excel spreadsheet,
- should have an .XLS extension.
-<BR><BR>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-$cgi->param('classnum') =~ /^(\d+)$/ or errorpage("illegal classnum");
-my $classnum = $1;
-my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } );
-
-#my $conf = new FS::Conf;
-#my $itembatch =
-# time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
-
-</%init>
diff --git a/httemplate/misc/inventory_item-move.cgi b/httemplate/misc/inventory_item-move.cgi
deleted file mode 100644
index 4d53beb..0000000
--- a/httemplate/misc/inventory_item-move.cgi
+++ /dev/null
@@ -1,23 +0,0 @@
-<% '',$cgi->redirect(popurl(2). "search/inventory_item.html?$browse_opts") %>
-<%init>
-
-# Shamelessly copied from misc/cust_attachment.cgi.
-
-my $browse_opts = join(';', map { $_.'='.$cgi->param($_) }
- qw( classnum avail )
- );
-
-my $move_agentnum = $cgi->param('move_agentnum') or
- die "No agent selected";
-foreach my $itemnum (
- map { /^itemnum(\d+)$/; $1; } grep /^itemnum\d+$/, $cgi->param ) {
- my $item = qsearchs('inventory_item', { 'itemnum' => $itemnum });
-# die "Can't move assigned inventory item $itemnum" if $item->svcnum;
- my $error;
- $item->agentnum($move_agentnum);
- $error = $item->replace;
- die $error if $error;
-}
-
-</%init>
-
diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi
deleted file mode 100755
index f37f769..0000000
--- a/httemplate/misc/link.cgi
+++ /dev/null
@@ -1,85 +0,0 @@
-<% include("/elements/header.html","Link to existing $svc") %>
-
-<FORM ACTION="<% popurl(1) %>process/link.cgi" METHOD=POST>
-% if ( $link_field ) {
-
- <INPUT TYPE="hidden" NAME="svcnum" VALUE="">
- <INPUT TYPE="hidden" NAME="link_field" VALUE="<% $link_field %>">
- <% $link_field %> of existing service: <INPUT TYPE="text" NAME="link_value">
- <BR>
-% if ( $link_field2 ) {
-
- <INPUT TYPE="hidden" NAME="link_field2" VALUE="<% $link_field2->{field} %>">
- <% $link_field2->{'label'} %> of existing service:
-% if ( $link_field2->{'type'} eq 'select' ) {
-% if ( $link_field2->{'select_table'} ) {
-
- <SELECT NAME="link_value2">
- <OPTION> </OPTION>
-% foreach my $r ( qsearch( $link_field2->{'select_table'}, {})) {
-% my $key = $link_field2->{'select_key'};
-% my $label = $link_field2->{'select_label'};
-
- <OPTION VALUE="<% $r->$key() %>"><% $r->$label() %></OPTION>
-% }
-
- </SELECT>
-% } 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'} %>)
-% }
-
- <BR>
-% }
-% } else {
-
- Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">
-% }
-
-
-<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
-<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
-<BR><INPUT TYPE="submit" VALUE="Link">
-</FORM>
-
-<% 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',
- 'svc_phone' => 'phonenum',
-);
-
-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};
-
-</%init>
diff --git a/httemplate/misc/location.cgi b/httemplate/misc/location.cgi
deleted file mode 100644
index 82ad636..0000000
--- a/httemplate/misc/location.cgi
+++ /dev/null
@@ -1,30 +0,0 @@
-<% objToJson(\%hash) %>
-<%init>
-
-my $locationnum = $cgi->param('arg');
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-my $cust_location = qsearchs({
- 'select' => 'cust_location.*',
- 'table' => 'cust_location',
- 'hashref' => { 'locationnum' => $locationnum },
- 'addl_from' => ' LEFT JOIN cust_main USING ( custnum ) ',
- ' LEFT JOIN prospect_main USING ( prospectnum ) ',
- 'extra_sql' => ' AND ( '.
- ' ( custnum IS NOT NULL AND '.
- $curuser->agentnums_sql( table=>'cust_main' ).
- ' ) '.
- ' OR '.
- ' ( prospectnum IS NOT NULL AND '.
- $curuser->agentnums_sql( table=>'prospect_main' ).
- ' ) '.
- ' )',
-});
-
-my %hash = ();
-%hash = map { $_ => $cust_location->$_() }
- qw( address1 address2 city county state zip country )
- if $cust_location;
-
-</%init>
diff --git a/httemplate/misc/maestro-customer_status-test.html b/httemplate/misc/maestro-customer_status-test.html
deleted file mode 100644
index 0064929..0000000
--- a/httemplate/misc/maestro-customer_status-test.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<% include('/elements/header.html', {
- 'title' => "Customer $custnum status",
- }) %>
-
-<% include('/elements/small_custview.html', $custnum, '', 1) %>
-<BR>
-
-<table style="border:1px solid #000000">
-% foreach my $key (keys %$return) {
-% my $value = $return->{$key};
-% $value = join(', ', @$value) if ref($value) eq 'ARRAY';
- <TR>
- <TD ALIGN="right"><% $key %>:</TD>
- <TD><B><% $value %></B></TD>
- </TR>
-% }
-</table>
-
-<% include('/elements/footer.html') %>
-<%init>
-
-my $return;
-
-my($custnum, $svcnum) = $cgi->keywords;
-if ( $custnum =~ /^(\d+)$/ ) {
-
- use FS::Maestro;
- $return = FS::Maestro::customer_status($1, $svcnum);
-
-} else {
- $return = { 'error' => 'No custnum' };
-}
-
-</%init>
diff --git a/httemplate/misc/maestro-customer_status.cgi b/httemplate/misc/maestro-customer_status.cgi
deleted file mode 100644
index ffeb53c..0000000
--- a/httemplate/misc/maestro-customer_status.cgi
+++ /dev/null
@@ -1,16 +0,0 @@
-<% $uri->query %>
-<%init>
-
-my $uri = new URI;
-
-my($custnum, $svcnum) = $cgi->keywords;
-if ( $custnum =~ /^(\d+)$/ ) {
-
- use FS::Maestro;
- $uri->query_form( FS::Maestro::customer_status($1) );
-
-} else {
- $uri->query_form( { 'error' => 'No custnum' } );
-}
-
-</%init>
diff --git a/httemplate/misc/maestro-customer_status.html b/httemplate/misc/maestro-customer_status.html
deleted file mode 100644
index 8acae2b..0000000
--- a/httemplate/misc/maestro-customer_status.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<% objToJson( $return ) %>
-<%init>
-
-my $return;
-
-my($custnum, $svcnum) = $cgi->keywords;
-if ( $custnum =~ /^(\d+)$/ ) {
-
- use FS::Maestro;
- $return = FS::Maestro::customer_status($1, $svcnum);
-
-} else {
- $return = { 'error' => 'No custnum' };
-}
-
-</%init>
diff --git a/httemplate/misc/merge_cust.html b/httemplate/misc/merge_cust.html
deleted file mode 100644
index ad075be..0000000
--- a/httemplate/misc/merge_cust.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<% include('/elements/header-popup.html', 'Merge customer' ) %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="cust_merge_popup" ID="cust_merge_popup" ACTION="<% popurl(1) %>cust_main-merge.html" METHOD=POST onSubmit="submit_merge(); return false;">
-
-<SCRIPT TYPE="text/javascript">
-
-var submit_interval_id;
-function submit_merge() {
- document.getElementById('confirm_merge_cust_button').disabled = 'true';
- smart_new_custnum_search(document.getElementById('new_custnum_search'));
- submit_interval_id = setInterval( do_submit_merge, 100);
-}
-
-function do_submit_merge() {
-
- if ( new_custnum_search_active )
- return;
-
- document.getElementById('confirm_merge_cust_button').disabled = '';
-
- clearInterval(submit_interval_id);
-
- if ( document.cust_merge_popup.new_custnum.value != '' ) {
- document.cust_merge_popup.submit();
- }
-
-}
-
-</SCRIPT>
-
-</SCRIPT>
-
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
-
-<TABLE BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
- <% include('/elements/tr-search-cust_main.html',
- 'label' => 'Merge into: ',
- 'field' => 'new_custnum',
- 'find_button' => 1,
- 'curr_value' => scalar($cgi->param('new_custnum')),
- )
- %>
-</TABLE>
-
-<P ALIGN="CENTER">
-%#have merge button start out disabled and enable after you select a target cust
-<INPUT TYPE="submit" NAME="confirm_merge_cust_button" ID="confirm_merge_cust_button" VALUE="Merge customer">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="BUTTON" VALUE="Don't merge" onClick="parent.cClick();">
-
-</FORM>
-</BODY>
-</HTML>
-
-<%init>
-
-$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
-my $custnum = $1;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied" unless $curuser->access_right('Merge customer');
-
-my $cust_main = qsearchs( {
- 'table' => 'cust_main',
- 'hashref' => { 'custnum' => $custnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-} );
-die "No customer # $custnum" unless $cust_main;
-
-</%init>
-
diff --git a/httemplate/misc/meta-import.cgi b/httemplate/misc/meta-import.cgi
deleted file mode 100644
index 8c158bd..0000000
--- a/httemplate/misc/meta-import.cgi
+++ /dev/null
@@ -1,79 +0,0 @@
-<% include('/elements/header.html', 'Import') %>
-
-<FORM ACTION="process/meta-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
-Import data from a DBI data source<BR><BR>
-%
-% #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 ) {
-%
-
- <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agentnum %>">
-% } else {
-
- <BR><BR>Agent <SELECT NAME="agentnum" SIZE="1">
-% foreach my $agent (sort { $a->agent cmp $b->agent } @agents) {
-
- <OPTION VALUE="<% $agent->agentnum %>" <% " SELECTED"x($agent->agentnum==$agentnum) %>><% $agent->agent %></OPTION>
-% }
-
- </SELECT><BR><BR>
-% }
-%
-% my @referrals = qsearch('part_referral',{});
-% die "No advertising sources created!" unless @referrals;
-% my $refnum = $referrals[0]->refnum; #default to first
-%
-% if ( scalar(@referrals) == 1 ) {
-%
-
- <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
-% } else {
-
- <BR><BR>Advertising source <SELECT NAME="refnum" SIZE="1">
-% foreach my $referral ( sort { $a->referral <=> $b->referral } @referrals) {
-
- <OPTION VALUE="<% $referral->refnum %>" <% " SELECTED"x($referral->refnum==$refnum) %>><% $referral->refnum %>: <% $referral->referral %></OPTION>
-% }
-
- </SELECT><BR><BR>
-% }
-
-
- First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
-% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) {
-
- <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg_comment %></OPTION>
-% }
-
-</SELECT><BR><BR>
-
- <table>
- <tr>
- <td align="right">DBI data source: </td>
- <td><INPUT TYPE="text" NAME="data_source"></td>
- </tr>
- <tr>
- <td align="right">DBI username: </td>
- <td><INPUT TYPE="text" NAME="username"></td>
- </tr>
- <tr>
- <td align="right">DBI password: </td>
- <td><INPUT TYPE="text" NAME="password"></td>
- </tr>
- </table>
- <INPUT TYPE="submit" VALUE="Import">
-
- </FORM>
-
-<% 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';
-
-</%init>
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
deleted file mode 100644
index b232deb..0000000
--- a/httemplate/misc/order_pkg.html
+++ /dev/null
@@ -1,142 +0,0 @@
-<% include('/elements/header-popup.html', 'Order new package' ) %>
-
-<LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
-<SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
-
-<SCRIPT TYPE="text/javascript">
-
- function enable_order_pkg () {
- if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
- document.OrderPkgForm.submitButton.disabled = false;
- if ( document.OrderPkgForm.pkgpart.options[document.OrderPkgForm.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
- document.OrderPkgForm.discountnum.disabled = false;
- } else {
- document.OrderPkgForm.discountnum.disabled = true;
- }
- } else {
- document.OrderPkgForm.submitButton.disabled = true;
- document.OrderPkgForm.discountnum.disabled = true;
- }
- }
-
-</SCRIPT>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/quick-cust_pkg.cgi" METHOD="POST">
-
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
-
-<% ntable("#cccccc", 2) %>
-<% include('/elements/tr-select-cust-part_pkg.html',
- 'curr_value' => $pkgpart,
- 'classnum' => -1,
- 'cust_main' => $cust_main,
- 'onchange' => 'enable_order_pkg',
- )
-%>
-
-<TR>
- <TH ALIGN="right">Start date </TD>
- <TD COLSPAN=6>
- <% include('/elements/input-date-field.html',{
- 'name' => 'start_date',
- 'format' => $date_format,
- 'value' => $start_date,
- 'noinit' => 1,
- }) %>
- <FONT SIZE=-1>(leave blank to start immediately)</FONT>
- </TD>
-</TR>
-
-% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
-% my $what = lc(FS::payby->shortname($cust_main->payby));
- <TR>
- <TH ALIGN="right">Disable automatic <% $what %> charge </TH>
- <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="no_auto" VALUE="Y"></TD>
- </TR>
-% }
-
-% if ( $curuser->access_right('Discount customer package') ) {
- <% include('/elements/tr-select-discount.html',
- 'element_etc' => 'DISABLED',
- 'colspan' => 7,
- 'cgi' => $cgi,
- )
- %>
-% }
-
-% 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'),
- 'colspan' => 7,
- )
- %>
-% }
-
-<% include('/elements/tr-select-cust_location.html',
- 'cgi' => $cgi,
- 'cust_main' => $cust_main,
- )
-%>
-
-<TR>
- <TH ALIGN="right">Contract end date </TD>
- <TD COLSPAN=6>
- <% include('/elements/input-date-field.html',{
- 'name' => 'contract_end',
- 'format' => $date_format,
- 'value' => '',
- 'noinit' => 1,
- }) %>
- </TD>
-</TR>
-
-</TABLE>
-
-<% include( '/elements/standardize_locations.html',
- 'form' => "OrderPkgForm",
- 'onlyship' => 1,
- 'no_company' => 1,
- 'callback' => 'document.OrderPkgForm.submit();',
- )
-%>
-
-<BR>
-<INPUT NAME="submitButton" TYPE="button" VALUE="Order Package" onClick = "this.disabled=true; standardize_locations();" <% $pkgpart ? '' : 'DISABLED' %>>
-
-</FORM>
-</BODY>
-</HTML>
-<%init>
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied"
- unless $curuser->access_right('Order customer package');
-
-my $conf = new FS::Conf;
-my $date_format = $conf->config('date_format') || '%m/%d/%Y';
-
-$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
-my $custnum = $1;
-my $cust_main = qsearchs({
- 'table' => 'cust_main',
- 'hashref' => { 'custnum' => $custnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-});
-
-my $pkgpart = scalar($cgi->param('pkgpart'));
-
-my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi?
-my $start_date = '';
-if( ! $conf->exists('order_pkg-no_start_date') ) {
- $start_date = $cust_main->next_bill_date;
- $start_date = $start_date ? time2str($format, $start_date) : '';
-}
-
-</%init>
diff --git a/httemplate/misc/part_device-import.html b/httemplate/misc/part_device-import.html
deleted file mode 100644
index 7bd6404..0000000
--- a/httemplate/misc/part_device-import.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<% include("/elements/header.html", 'Import device types') %>
-
-Import a file containing phone device types, one per line.
-<BR><BR>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'PartDeviceImportForm',
- 'action' => 'process/part_device-import.html',
- 'num_files' => 1,
- 'fields' => [ 'format', ],
- 'message' => 'Device type import successful',
- 'url' => $p.'browse/part_device.html',
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <INPUT TYPE="hidden" NAME="format" VALUE="default">
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.PartDeviceImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-Upload file can be a text file or Excel spreadsheet. If an Excel spreadsheet,
- should have an .XLS extension.
-<BR><BR>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
diff --git a/httemplate/misc/part_svc-columns.cgi b/httemplate/misc/part_svc-columns.cgi
deleted file mode 100644
index 0602561..0000000
--- a/httemplate/misc/part_svc-columns.cgi
+++ /dev/null
@@ -1,13 +0,0 @@
-<% objToJson(\@output) %>
-<%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 @output = map { ( $_->columnname, $_->columnflag, $_->columnvalue ) }
- $part_svc->all_part_svc_column;
-
-</%init>
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
deleted file mode 100644
index bcab68a..0000000
--- a/httemplate/misc/payment.cgi
+++ /dev/null
@@ -1,340 +0,0 @@
-<% include( '/elements/header.html', "Process $type{$payby} payment" ) %>
-<% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %>
-<FORM NAME="OneTrueForm" ACTION="process/payment.cgi" METHOD="POST" onSubmit="document.OneTrueForm.process.disabled=true">
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
-<INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>">
-<INPUT TYPE="hidden" NAME="payunique" VALUE="<% $payunique %>">
-<INPUT TYPE="hidden" NAME="balance" VALUE="<% $balance %>">
-
-<% include('/elements/init_overlib.html') %>
-
-% #include( '/elements/table.html', '#cccccc' )
-
-<% ntable('#cccccc') %>
- <TR>
- <TH ALIGN="right">Payment amount</TH>
- <TD COLSPAN=7>
- <TABLE><TR><TD BGCOLOR="#ffffff">
- <% $money_char %><INPUT NAME = "amount"
- TYPE = "text"
- VALUE = "<% $amount %>"
- SIZE = 8
- STYLE = "text-align:right;"
-% if ( $fee ) {
- onChange = "amount_changed(this)"
- onKeyDown = "amount_changed(this)"
- onKeyUp = "amount_changed(this)"
- onKeyPress = "amount_changed(this)"
-% }
- >
- </TD><TD BGCOLOR="#cccccc">
-% if ( $fee ) {
- <INPUT TYPE="hidden" NAME="fee_pkgpart" VALUE="<% $fee_pkg->pkgpart %>">
- <INPUT TYPE="hidden" NAME="fee" VALUE="<% $fee_display eq 'add' ? $fee : '' %>">
- <B><FONT SIZE='+1'><% $fee_op %></FONT>
- <% $money_char . $fee %>
- </B>
- <% $fee_pkg->pkg |h %>
- <B><FONT SIZE='+1'>=</FONT></B>
- </TD><TD ID="ajax_total_cell" BGCOLOR="#dddddd" STYLE="border:1px solid blue">
- <FONT SIZE="+1"><% length($amount) ? $money_char. sprintf('%.2f', ($fee_display eq 'add') ? $amount + $fee : $amount - $fee ) : '' %> <% $fee_display eq 'add' ? 'TOTAL' : 'AVAILABLE' %></FONT>
-
-% }
- </TD></TR></TABLE>
- </TD>
- </TR>
-
-% if ( $fee ) {
-
- <SCRIPT TYPE="text/javascript">
-
- function amount_changed(what) {
-
-
- var total = '';
- if ( what.value.length ) {
- total = parseFloat(what.value) <% $fee_op %> <% $fee %>;
- /* total = Math.round(total*100)/100; */
- total = '<% $money_char %>' + total.toFixed(2);
- }
-
- var total_cell = document.getElementById('ajax_total_cell');
- total_cell.innerHTML = '<FONT SIZE="+1">' + total + ' <% $fee_display eq 'add' ? 'TOTAL' : 'AVAILABLE' %></FONT>';
-
- }
-
- </SCRIPT>
-
-% }
-
-<% include('/elements/tr-select-discount_term.html',
- 'custnum' => $custnum,
- 'cgi' => $cgi
- )
-%>
-
-% if ( $payby eq 'CARD' ) {
-%
-% my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' );
-% my $payname = $cust_main->first. ' '. $cust_main->getfield('last');
-% 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;
-% }
-
- <TR>
- <TH ALIGN="right">Card&nbsp;number</TH>
- <TD COLSPAN=7>
- <TABLE>
- <TR>
- <TD>
- <INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<%$payinfo%>"> </TD>
- <TH>Exp.</TH>
- <TD>
- <SELECT NAME="month">
-% for ( ( map "0$_", 1 .. 9 ), 10 .. 12 ) {
-
- <OPTION<% $_ == $month ? ' SELECTED' : '' %>><% $_ %>
-% }
-
- </SELECT>
- </TD>
- <TD> / </TD>
- <TD>
- <SELECT NAME="year">
-% my @a = localtime; for ( $a[5]+1900 .. $a[5]+1915 ) {
-
- <OPTION<% $_ == $year ? ' SELECTED' : '' %>><% $_ %>
-% }
-
- </SELECT>
- </TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- <TR>
- <TH ALIGN="right">CVV2</TH>
- <TD><INPUT TYPE="text" NAME="paycvv" VALUE="<% $paycvv %>" SIZE=4 MAXLENGTH=4>
- (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)
- </TD>
- </TR>
- <TR>
- <TH ALIGN="right">Exact&nbsp;name&nbsp;on&nbsp;card</TH>
- <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%$payname%>"></TD>
- </TR>
-
- <% include( '/elements/location.html',
- 'object' => $cust_main, #XXX errors???
- 'no_asterisks' => 1,
- 'address1_label' => 'Card billing address',
- )
- %>
-
-% } 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');
-% }
-
- <INPUT TYPE="hidden" NAME="month" VALUE="12">
- <INPUT TYPE="hidden" NAME="year" VALUE="2037">
- <TR>
- <TD ALIGN="right">Account&nbsp;number</TD>
- <TD><INPUT TYPE="text" SIZE=10 NAME="payinfo1" VALUE="<%$payinfo1%>"></TD>
- <TD ALIGN="right">Type</TD>
- <TD><SELECT NAME="paytype"><% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes) %></SELECT></TD>
- </TR>
- <TR>
- <TD ALIGN="right">ABA/Routing&nbsp;number</TD>
- <TD>
- <INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="<%$payinfo2%>">
- (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)
- </TD>
- </TR>
- <TR>
- <TD ALIGN="right">Bank&nbsp;name</TD>
- <TD><INPUT TYPE="text" NAME="payname" VALUE="<%$payname%>"></TD>
- </TR>
-
-% if ( $conf->exists('show_bankstate') ) {
- <TR>
- <TD ALIGN="right">Bank&nbsp;state</TD>
- <TD><% include('/elements/select-state.html',
- 'disable_empty' => 0,
- 'empty_label' => '(choose)',
- 'state' => $paystate,
- 'country' => $cust_main->country,
- 'prefix' => 'pay',
- )
- %>
- </TD>
- </TR>
-% } else {
- <INPUT TYPE="hidden" NAME="paystate" VALUE="<% $paystate %>">
-% }
-
-% if ( $conf->exists('show_ss') ) {
- <TR>
- <TD ALIGN="right">
- Account&nbsp;holder<BR>
- Social&nbsp;security&nbsp;or&nbsp;tax&nbsp;ID&nbsp;#
- </TD>
- <TD><INPUT TYPE="text" NAME="ss" VALUE="<% $ss %>"></TD>
- </TR>
-% } else {
- <INPUT TYPE="hidden" NAME="ss" VALUE="<% $ss %>"></TD>
-% }
-
-% if ( $conf->exists('show_stateid') ) {
- <TR>
- <TD ALIGN="right">
- Account&nbsp;holder<BR>
- Driver&rsquo;s&nbsp;license&nbsp;or&nbsp;state&nbsp;ID&nbsp;#
- </TD>
- <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>"></TD>
- <TD ALIGN="right">State</TD>
- <TD><% include('/elements/select-state.html',
- 'disable_empty' => 0,
- 'empty_label' => '(choose)',
- 'state' => $stateid_state,
- 'country' => $cust_main->country,
- 'prefix' => 'stateid_',
- )
- %>
- </TD>
- </TR>
-% } else {
- <INPUT TYPE="hidden" NAME="stateid" VALUE="<% $stateid %>">
- <INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $stateid_state %>">
-% }
-
-% } #end CARD/CHEK-specific section
-
-
-<TR>
- <TD COLSPAN=2>
- <INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1">
- Remember this information
- </TD>
-</TR>
-
-% if ( $conf->exists("batch-enable")
-% || grep $payby eq $_, $conf->config('batch-enable_payby')
-% ) {
-%
-% if ( grep $payby eq $_, $conf->config('realtime-disable_payby') ) {
-
- <INPUT TYPE="hidden" NAME="batch" VALUE="1">
-
-% } else {
-
- <TR>
- <TD COLSPAN=2>
- <INPUT TYPE="checkbox" NAME="batch" VALUE="1">
- Add to current batch
- </TD>
- </TR>
-
-% }
-% }
-
-<TR>
- <TD COLSPAN=2>
- <INPUT TYPE="checkbox"<% ( ( $payby eq 'CARD' && $cust_main->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
- </TD>
-</TR>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" NAME="process" VALUE="Process payment">
-</FORM>
-
-<% 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 = '';
-
-my $conf = new FS::Conf;
-
-my $money_char = $conf->config('money_char') || '$';
-
-#false laziness w/selfservice make_payment.html shortcut for one-country
-my %states = map { $_->state => 1 }
- qsearch('cust_main_county', {
- 'country' => $conf->config('countrydefault') || 'US'
- } );
-my @states = sort { $a cmp $b } keys %states;
-
-my $fee = '';
-my $fee_pkg = '';
-my $fee_display = '';
-my $fee_op = '';
-my $num_payments = scalar($cust_main->cust_pay);
-#handle old cust_main.pm (remove...)
-$num_payments = scalar( @{ [ $cust_main->cust_pay ] } )
- unless defined $num_payments;
-if ( $conf->config('manual_process-pkgpart')
- and ! $conf->exists('manual_process-skip_first') || $num_payments
- )
-{
-
- $fee_display = $conf->config('manual_process-display') || 'add';
- $fee_op = $fee_display eq 'add' ? '+' : '-';
-
- $fee_pkg =
- qsearchs('part_pkg', { pkgpart=>$conf->config('manual_process-pkgpart') } );
-
- #well ->unit_setup or ->calc_setup both call for a $cust_pkg
- # (though ->unit_setup doesn't use it...)
- $fee = $fee_pkg->option('setup_fee')
- if $fee_pkg; #in case.. better than dying with a perl traceback
-
-}
-
-my $amount = '';
-if ( $balance > 0 ) {
- $amount = $balance;
- $amount += $fee
- if $fee && $fee_display eq 'subtract';
- $amount = sprintf("%.2f", $amount);
-}
-
-my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32;
-
-</%init>
diff --git a/httemplate/misc/phone_avail-import.html b/httemplate/misc/phone_avail-import.html
deleted file mode 100644
index 1f4d8ca..0000000
--- a/httemplate/misc/phone_avail-import.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<% include('/elements/header.html', 'Phone number (DID) import') %>
-
-Import a file containing phone numbers (DIDs).
-<BR><BR>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'PhonenumImportForm',
- 'action' => 'process/phone_avail-import.html',
- 'num_files' => 1,
- 'fields' => [ 'format', 'availbatch', 'exportnum', 'countrycode' ],
- 'message' => 'DID import successful',
- 'url' => $p."search/phone_avail.html?availbatch=$availbatch",
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <INPUT TYPE="hidden" NAME="format" VALUE="default">
-
- <INPUT TYPE="hidden" NAME="availbatch" VALUE="<% $availbatch %>">
-
- <% include( '/elements/tr-select-table.html',
- 'table' => 'part_export',
- 'name_col' => 'machine',
- 'label' => 'Export',
- 'empty_label' => 'Select export',
- 'hashref' => { 'exporttype' => 'internal_diddb', },
- #'label_callback' =>
- )
- %>
-
- <TR>
- <TH ALIGN="right">Country code</TH>
- <TD>
- <INPUT TYPE = "text"
- NAME = "countrycode"
- VALUE = "<% $conf->config('default_phone_countrycode') || 1 %>"
- >
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.PhonenumImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
-<BR><BR>
-
-<b>Default</b> format has the following field order: <i>state, number<i></i>
-<BR><BR>
-
-Field information:
-<ul>
- <li><i>state</i>: Two-letter state code, i.e. "CA"
- <li><i>number</i>: Phone number
-</ul>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $conf = new FS::Conf;
-
-my $availbatch =
- time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
-
-</%init>
diff --git a/httemplate/misc/phone_device_config.html b/httemplate/misc/phone_device_config.html
deleted file mode 100644
index 9ea0d0d..0000000
--- a/httemplate/misc/phone_device_config.html
+++ /dev/null
@@ -1,57 +0,0 @@
-%if ($config) {
-<% $config %>
-%}else{
-<% include("/elements/errorpage.html", "No configuration data produced.") %>
-%}
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
-
-my $exportnum;
-if ( $cgi->param('exportnum') ) {
- $cgi->param('exportnum') =~ /^(\d+)$/ or die "unparsable exportnum";
- $exportnum = $1;
-}
-
-die "no export provided"
- unless $exportnum;
-
-my $svcnum;
-if ( $cgi->param('svcnum') ) {
- $cgi->param('svcnum') =~ /^(\d+)$/ or die "unparsable svcnum";
- $svcnum = $1;
-}
-
-my $devicenum;
-if ( $cgi->param('devicenum') ) {
- $cgi->param('devicenum') =~ /^(\d+)$/ or die "unparsable devicenum";
- $devicenum = $1;
-}
-
-die "no device or service provided"
- unless $svcnum || $devicenum;
-
-my $part_export = qsearchs('part_export', { 'exportnum' => $exportnum })
- or die "Unknown exportnum $exportnum\n";
-
-my $phone_device;
-my $svc_phone;
-if ($devicenum) {
- $phone_device = qsearchs('phone_device', { 'devicenum' => $devicenum })
- or die "Unknown device $devicenum\n";
- $svc_phone = $phone_device->svc_phone;
-} else {
- $svc_phone = qsearchs('svc_phone', { 'svcnum' => $svcnum })
- or die "Unknown svc_phone $svcnum\n";
-}
-
-my $config = $part_export->export_device_config($svc_phone, $phone_device);
-
-if ($config) {
- http_header('Content-Type' => 'application/octet-stream');
- http_header('Content-Disposition' => 'attachment;filename="config"');
- http_header('Content-Length' => length($config));
-}
-
-</%init>
diff --git a/httemplate/misc/phonenums.cgi b/httemplate/misc/phonenums.cgi
deleted file mode 100644
index 2ed0f61..0000000
--- a/httemplate/misc/phonenums.cgi
+++ /dev/null
@@ -1,29 +0,0 @@
-%# [ <% join(', ', map { qq("$_") } @exchanges) %> ]
-<% objToJson(\@exchanges) %>
-<%init>
-
-my( $exchangestring, $svcpart ) = $cgi->param('arg');
-
-$exchangestring =~ /\((\d{3})-(\d{3})-XXXX\)\s*$/i
- or die "unparsable exchange: $exchangestring";
-my( $areacode, $exchange ) = ( $1, $2 );
-my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
-die "unknown svcpart $svcpart" unless $part_svc;
-
-my @exports = $part_svc->part_export_did;
-if ( scalar(@exports) > 1 ) {
- die "more than one DID-providing export attached to svcpart $svcpart";
-} elsif ( ! @exports ) {
- die "no DID providing export attached to svcpart $svcpart";
-}
-my $export = $exports[0];
-
-my $something = $export->get_dids('areacode'=>$areacode,
- 'exchange'=>$exchange,
- );
-
-#warn Dumper($something);
-
-my @exchanges = @{ $something };
-
-</%init>
diff --git a/httemplate/misc/ping.html b/httemplate/misc/ping.html
deleted file mode 100644
index 4f0360e..0000000
--- a/httemplate/misc/ping.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<% include('/elements/header-popup.html', "Ping $ip" ) %>
-
-<% include('/elements/xmlhttp.html',
- 'url' => $p. 'misc/xmlhttp-ping.html',
- 'subs' => [ 'ping' ],
- )
-%>
-
-%# <img src="<%$p%>images/bullet_red.png" border=0>
-
-
-<%ntable("#cccccc", 2)%>
-
-<TR>
- <TD>Status</TD>
- <TD BGCOLOR="#ffffff" ID="ping_status">Checking...</TD>
-</TR>
-<TR>
- <TD>Packet loss</TD>
- <TD BGCOLOR="#ffffff" ID="ping_packetloss"></TD>
-</TR>
-<TR>
- <TD>Latency</TD>
- <TD BGCOLOR="#ffffff" ID="ping_latency"></TD>
-</TR>
-<TR>
- <TD>Packets</TD>
- <TD BGCOLOR="#ffffff" ID="ping_packets"></TD>
-</TR>
-
-</TABLE>
-
-<BR>
-<CENTER>
-<INPUT TYPE="button" VALUE="Close" onClick="parent.nd(1);">
-</CENTER>
-
-<SCRIPT TYPE="text/javascript">
-
- var fails = 0;
- var pongs = 0;
- var totaltime = 0;
- var avg = 0;
-
- function ping_update ( updatetext ) {
- var pingArray = eval('(' + updatetext + ')');
- var status = pingArray[0];
- var rtt = pingArray[1];
-
- if ( status == 0 ) {
- fails++;
- } else if ( status == 1 ) {
- pongs++;
- totaltime = totaltime + rtt;
- avg = totaltime / pongs;
- }
-
- var loss = 100 * fails / ( fails + pongs );
-
- var statusCell = document.getElementById('ping_status');
- var packetlossCell = document.getElementById('ping_packetloss');
- var latencyCell = document.getElementById('ping_latency');
- var packetsCell = document.getElementById('ping_packets');
-
- var status = '';
- // red conditions
- if ( loss == 100 ) {
- status = '<FONT COLOR="#ff0000">Unreachable</FONT>';
- } else
- // yellow conditions
- if ( loss > 50 ) {
- status = '<FONT COLOR="#ff9900">High packet loss</FONT>';
- } else
- if ( avg > 1 ) {
- status = '<FONT COLOR="#ff9900">High latency</FONT>';
- } else {
- status = '<FONT COLOR="#00cc00">Up</FONT>';
- }
-
- statusCell.innerHTML = '<B>' + status + '</B>';
- packetlossCell.innerHTML = '<B>' + Math.round(loss) + '%</B>';
- if ( avg > 0 ) {
- latencyCell.innerHTML = '<B>' + Math.round( avg*1000 ) + 'ms</B>';
- }
- var packets = fails + pongs;
- packetsCell.innerHTML = '<B>' + packets + '</B>';
-
- setTimeout( "ping('<%$ip%>', ping_update)", 1000 );
-
- }
-
- ping( '<%$ip%>', ping_update );
-
-</SCRIPT>
-
-<%init>
-
-my($query) = $cgi->keywords;
-$query =~ /^([\d\.]+)$/ or die 'Illegal IP';
-my $ip = $1;
-
-</%init>
diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi
deleted file mode 100755
index aeef687..0000000
--- 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');
-
-</%init>
diff --git a/httemplate/misc/print_events.cgi b/httemplate/misc/print_events.cgi
deleted file mode 100644
index 8d83d3d..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/print_invoice_events.cgi b/httemplate/misc/print_invoice_events.cgi
deleted file mode 100644
index c974d5f..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/print_invoices.cgi b/httemplate/misc/print_invoices.cgi
deleted file mode 100644
index f859f6d..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi
deleted file mode 100644
index aa37126..0000000
--- a/httemplate/misc/process/batch-cust_pay.cgi
+++ /dev/null
@@ -1,68 +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++ ) {
-% my $custnum = $param->{"custnum$row"};
-% my $cust_main;
-% if ( $custnum =~ /^(\d+)$/ and $1 <= 2147483647 ) {
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'custnum' => $1 },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
-% }
-% if ( !$cust_main ) { # not found, try agent_custid
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'agent_custid' => $custnum },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
-% }
-% $custnum = $cust_main->custnum if $cust_main;
-% # if !$cust_main, then this will throw an error on batch_insert
-%
-% push @cust_pay, new FS::cust_pay {
-% 'custnum' => $custnum,
-% 'paid' => $param->{"paid$row"},
-% 'payby' => 'BILL',
-% 'payinfo' => $param->{"payinfo$row"},
-% 'discount_term' => $param->{"discount_term$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;
-%
-% my $query = $m->scomp('/elements/create_uri_query');
-%
-<% $cgi->redirect($p."batch-cust_pay.html?$query")
-
- %>
-% } else {
-%
-%
-<% $cgi->redirect(popurl(3). "search/cust_pay.html?magic=paybatch;paybatch=$paybatch") %>
-% }
-
diff --git a/httemplate/misc/process/bill_batch-print.html b/httemplate/misc/process/bill_batch-print.html
deleted file mode 100644
index 54d639e..0000000
--- a/httemplate/misc/process/bill_batch-print.html
+++ /dev/null
@@ -1,5 +0,0 @@
-% die "access denied"
-% unless $FS::CurrentUser::CurrentUser->access_right('View invoices');
-% my $server = FS::UI::Web::JSRPC->new('FS::bill_batch::process_print_pdf', $cgi);
-<% $server->process %>
-<%init></%init>
diff --git a/httemplate/misc/process/bulk_change_pkg.cgi b/httemplate/misc/process/bulk_change_pkg.cgi
deleted file mode 100755
index e22dafe..0000000
--- 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(\%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
-
-
-</%init>
diff --git a/httemplate/misc/process/bulk_pkg_increment_bill.cgi b/httemplate/misc/process/bulk_pkg_increment_bill.cgi
deleted file mode 100755
index 0d8417b..0000000
--- a/httemplate/misc/process/bulk_pkg_increment_bill.cgi
+++ /dev/null
@@ -1,76 +0,0 @@
-%if ($error) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). 'bulk_pkg_increment_bill.cgi?'. $cgi->query_string ) %>
-%} else {
-<% header('Packages Adjusted') %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY></HTML>
-% }
-<%init>
-
-local $FS::UID::AutoCommit = 0;
-my $dbh = dbh;
-my $error;
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages')
- and $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates');
-
-my $days = $cgi->param('days') or die "missing parameter: days";
-$days > 0 or $error = "Number of days must be > 0";
-
-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
-# and, now, w/bulk_change_pkg.cgi
-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 ];
-
-}
-
-if(!$error) {
- foreach my $cust_pkg (qsearch(FS::cust_pkg->search(\%search_hash))) {
- next if ! $cust_pkg->bill;
- my $new_cust_pkg = FS::cust_pkg->new({ $cust_pkg->hash });
- $new_cust_pkg->bill($new_cust_pkg->bill + $days*86400);
- $error = $new_cust_pkg->replace($cust_pkg);
-
- if($error) {
- $cgi->param("error",substr($error, 0, 512));
- $dbh->rollback;
- return;
- }
- }
-
- $dbh->commit;
-}
-
-</%init>
diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html
deleted file mode 100755
index e17872c..0000000
--- a/httemplate/misc/process/cancel_pkg.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<% header("Package $past{$method}") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY>
-</HTML>
-<%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',
- );
-
-</%once>
-<%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');
- parse_datetime($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
- $date = $1;
- $method = ($method eq 'expire') ? 'cancel' : 'suspend';
-}
-
-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 = $cust_pkg->$method( 'reason' => $reasonnum, 'date' => $date );
-
-if ($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "cancel_pkg.html?". $cgi->query_string );
-}
-
-</%init>
diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi
deleted file mode 100755
index 0dda2ea..0000000
--- 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');
-}
-
-</%init>
diff --git a/httemplate/misc/process/cdr-import.html b/httemplate/misc/process/cdr-import.html
deleted file mode 100644
index edc441e..0000000
--- a/httemplate/misc/process/cdr-import.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server = new FS::UI::Web::JSRPC 'FS::cdr::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/copy-rate_detail.html b/httemplate/misc/process/copy-rate_detail.html
deleted file mode 100644
index 60b2aeb..0000000
--- a/httemplate/misc/process/copy-rate_detail.html
+++ /dev/null
@@ -1,61 +0,0 @@
-%# if ( $error ) {
-%# <% $cgi->redirect(popurl(2).'copy-rate_detail.html?'. $cgi->query_string ) %>
-%# } else {
-<% include('/elements/header.html', 'Rates copied',
- menubar( 'View all rate plans' => popurl(3).'browse/rate.cgi' ),
- ) %>
-%# }
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-$cgi->param('src_ratenum') =~ /^(\d+)$/ or die 'Illegal src_ratenum';
-my $src_ratenum = $1;
-
-$cgi->param('dst_ratenum') =~ /^(\d+)$/ or die 'Illegal src_ratenum';
-my $dst_ratenum = $1;
-
-my @countrycodes = map { /^countrycode(\d+)$/ or die; $1 }
- grep { /^countrycode(\d+)$/ && $cgi->param($_) }
- $cgi->param;
-
-foreach my $countrycode ( @countrycodes ) {
-
- my @src_rate_detail = qsearch({
- 'table' => 'rate_detail',
- 'addl_from' => 'JOIN rate_region'.
- ' ON ( rate_detail.dest_regionnum = rate_region.regionnum )',
- 'hashref' => { 'ratenum' => $src_ratenum },
- 'extra_sql' =>
- "AND 0 < ( SELECT COUNT(*) FROM rate_prefix
- WHERE rate_prefix.regionnum = rate_region.regionnum
- AND countrycode = '$countrycode'
- )
- ",
- });
-
- foreach my $src_rate_detail ( @src_rate_detail ) {
-
- my %hash = (
- 'ratenum' => $dst_ratenum,
- map { $_ => $src_rate_detail->get($_) }
- qw( orig_regionnum dest_regionnum )
- );
-
- my $dst_rate_detail = qsearchs( 'rate_detail', \%hash)
- || new FS::rate_detail \%hash;
-
- $dst_rate_detail->$_( $src_rate_detail->get($_) )
- foreach qw( min_included conn_charge conn_sec min_charge sec_granularity classnum );
-
- my $method = $dst_rate_detail->ratedetailnum ? 'replace' : 'insert';
-
- my $error = $dst_rate_detail->$method();
-
- die $error if $error; # "shouldn't" happen
-
- }
-}
-
-</%init>
diff --git a/httemplate/misc/process/cust_main-import.cgi b/httemplate/misc/process/cust_main-import.cgi
deleted file mode 100644
index 2b705a6..0000000
--- a/httemplate/misc/process/cust_main-import.cgi
+++ /dev/null
@@ -1,10 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server =
- new FS::UI::Web::JSRPC 'FS::cust_main::Import::process_batch_import', $cgi;
-
-</%init>
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 bda3e3b..0000000
--- a/httemplate/misc/process/cust_main-import_charges.cgi
+++ /dev/null
@@ -1,24 +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,
- 'agentnum' => scalar($cgi->param('agentnum')),
- 'format' => scalar($cgi->param('format')),
- } )
- : 'No file';
-
-</%init>
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 6625e00..0000000
--- a/httemplate/misc/process/cust_main_note-import.cgi
+++ /dev/null
@@ -1,85 +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)
-<PRE>
-% foreach my $row (@uninserted) {
-% $csv->combine( (map{ $row->{$_} } qw(last first note) ),
-% $row->{error} ? ('#!', $row->{error}) : (),
-% );
-<% $csv->string %>
-% }
-</PRE>
-
-The following items <% $op eq 'Preview' ? 'would be' : 'were' %> imported. (See above for unimported items)
-
-<PRE>
-% foreach my $row (@inserted) {
-% $csv->combine( (map{ $row->{$_} } qw(custnum last first note) ),
-% ('#!', $row->{name}),
-% );
-<% $csv->string %>
-% }
-</PRE>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-$FS::cust_main::import=1; # the customer records are already in the database
-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 $error = '';
- if ( $param->{use_comments} ) { # why? notes are sexier
- my $cust_main = qsearchs('cust_main',
- { 'custnum' => $param->{"custnum$row"} }
- );
- 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"};
- }
- } else {
- my $cust_main_note = new FS::cust_main_note {
- 'custnum' => $param->{"custnum$row"},
- '_date' => $date,
- 'otaker' => $otaker,
- 'comments' => $param->{"note$row"},
- };
- $error = $cust_main_note->insert unless ($op eq "Preview");
- }
- 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' => '',
- };
- }
-}
-</%init>
diff --git a/httemplate/misc/process/cust_pay-import.cgi b/httemplate/misc/process/cust_pay-import.cgi
deleted file mode 100644
index 92b6e5a..0000000
--- a/httemplate/misc/process/cust_pay-import.cgi
+++ /dev/null
@@ -1,21 +0,0 @@
-<% $cgi->redirect(popurl(3). "search/cust_pay.html?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 );
-
-</%init>
diff --git a/httemplate/misc/process/cust_pkg-import.html b/httemplate/misc/process/cust_pkg-import.html
deleted file mode 100644
index 1021817..0000000
--- a/httemplate/misc/process/cust_pkg-import.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server =
- new FS::UI::Web::JSRPC 'FS::cust_pkg::Import::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/delay_susp_pkg.html b/httemplate/misc/process/delay_susp_pkg.html
deleted file mode 100755
index 8649cc2..0000000
--- a/httemplate/misc/process/delay_susp_pkg.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<% header("Package suspension delayed") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY>
-</HTML>
-<%once>
-
-my $right = 'Delay suspension events';
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right($right);
-
-my ($pkgnum, $date, $cust_pkg, $cust_main, $error);
-
-#untaint pkgnum
-$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
-$pkgnum = $1;
-
-#untaint date
-parse_datetime($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
-my $date = $1;
-
-$cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} );
-if ($cust_pkg) {
- $cust_main = $cust_pkg->cust_main;
- $cust_main->dundate( $date );
- $error = $cust_main->replace;
-} else {
- $error = "Invalid pkgnum";
-}
-
-if ($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "cancel_pkg.html?". $cgi->query_string );
-}
-
-</%init>
diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi
deleted file mode 100755
index 1201131..0000000
--- 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' => $new_custnum);
-
-</%init>
diff --git a/httemplate/misc/process/email-customers.html b/httemplate/misc/process/email-customers.html
deleted file mode 100644
index de2bb92..0000000
--- a/httemplate/misc/process/email-customers.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices');
-
-my $server = new FS::UI::Web::JSRPC 'FS::cust_main_Mixin::process_email_search_result', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/enable_or_disable_tax.html b/httemplate/misc/process/enable_or_disable_tax.html
deleted file mode 100755
index 9b7324b..0000000
--- a/httemplate/misc/process/enable_or_disable_tax.html
+++ /dev/null
@@ -1,41 +0,0 @@
-%if ($error) {
-<% $cgi->redirect(popurl(2).'enable_or_disable_tax.html?'.$cgi->query_string) %>
-%}else{
- <% include('/elements/header-popup.html', $title) %>
-
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
-
- </BODY>
- </HTML>
-%}
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $action = '';
-if ( $cgi->param('action') =~ /^(\w+)$/ ) {
- $action = $1;
-}
-
-my ($query, $count_query) = FS::tax_rate::browse_queries(scalar($cgi->Vars));
-my @tax_rate = qsearch( $query );
-
-#transaction?
-my $error;
-$error = "Invalid action" unless ($action =~ /enable|disable/);
-
-foreach my $tax_rate (@tax_rate) {
- $action eq 'enable' ? $tax_rate->disabled('') : $tax_rate->disabled('Y');
- # $tax_rate->manual('Y');
- $error ||= $tax_rate->replace;
- last if $error;
-}
-$cgi->param('error', $error) if $error;
-
-my $title = scalar(@tax_rate) == 1 ? 'Tax rate ' : 'Tax rates ';
-$title .= lc($action). 'd';
-
-</%init>
diff --git a/httemplate/misc/process/inventory_item-import.html b/httemplate/misc/process/inventory_item-import.html
deleted file mode 100644
index 377943f..0000000
--- a/httemplate/misc/process/inventory_item-import.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server = new FS::UI::Web::JSRPC 'FS::inventory_item::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi
deleted file mode 100755
index 77546f3..0000000
--- a/httemplate/misc/process/link.cgi
+++ /dev/null
@@ -1,78 +0,0 @@
-%unless ($error) {
-% #no errors, so let's view this customer.
-% my $custnum = $new->cust_pkg->custnum;
-% my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/
-% ? ''
-% : ';show=packages';
-% my $frag = "cust_pkg$pkgnum"; #hack for IE ignoring real #fragment
-<% $cgi->redirect(popurl(3). "view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag" ) %>
-%} else {
-% errorpage($error);
-%}
-<%init>
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied"
- unless $curuser->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);
-}
-
-</%init>
diff --git a/httemplate/misc/process/meta-import.cgi b/httemplate/misc/process/meta-import.cgi
deleted file mode 100644
index 68ae49c..0000000
--- a/httemplate/misc/process/meta-import.cgi
+++ /dev/null
@@ -1,190 +0,0 @@
-<% include("/elements/header.html",'Map tables') %>
-
-<SCRIPT>
-var gSafeOnload = new Array();
-var gSafeOnsubmit = new Array();
-window.onload = SafeOnload;
-function SafeAddOnLoad(f) {
- gSafeOnload[gSafeOnload.length] = f;
-}
-function SafeOnload() {
- for (var i=0;i<gSafeOnload.length;i++)
- gSafeOnload[i]();
-}
-function SafeAddOnSubmit(f) {
- gSafeOnsubmit[gSafeOnsubmit.length] = f;
-}
-function SafeOnsubmit() {
- for (var i=0;i<gSafeOnsubmit.length;i++)
- gSafeOnsubmit[i]();
-}
-</SCRIPT>
-
-<FORM NAME="OneTrueForm" METHOD="POST" ACTION="meta-import.cgi">
-%
-% #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 )) {
-
- <INPUT TYPE="hidden" NAME=<% $field %> VALUE="<% $cgi->param($field) %>">
-% }
-%
-% my %schema;
-% use Tie::DxHash;
-% tie %schema, 'Tie::DxHash';
-% if ( $cgi->param('schema') ) {
-% my $schema_string = $cgi->param('schema');
-%
- <INPUT TYPE="hidden" NAME="schema" VALUE="<%$schema_string%>">
-%
-% %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') ) {
-
-
- <INPUT TYPE="hidden" NAME="magic" VALUE="process">
- <% hashmaker('schema', [ $schema->tables ],
- [ grep !/^h_/, dbdef->tables ], ) %>
- <br><INPUT TYPE="submit" VALUE="done">
-%
-%
-% #second page
-% } elsif ( $cgi->param('magic') eq 'process' ) {
-
-
- <INPUT TYPE="hidden" NAME="magic" VALUE="process2">
-%
-%
-% 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}, ) %>
- <br><hr><br>
-%
-%
-% }
-%
-%
-
- <br><INPUT TYPE="submit" VALUE="done">
-%
-%
-% #third (results)
-% } elsif ( $cgi->param('magic') eq 'process2' ) {
-%
-% print "<pre>\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</pre>";
-%
-% } else {
-% warn "unrecognized magic: ". $cgi->param('magic');
-% }
-%
-%
-
-</FORM>
-</BODY>
-</HTML>
-%
-% #hashmaker widget
-% sub hashmaker {
-% my($name, $from, $to, $labelfrom, $labelto) = @_;
-% my $fromsize = scalar(@$from);
-% my $tosize = scalar(@$to);
-% "<TABLE><TR><TH>$labelfrom</TH><TH>$labelto</TH></TR><TR><TD>".
-% qq!<SELECT NAME="${name}_from" SIZE=$fromsize>\n!.
-% join("\n", map { qq!<OPTION VALUE="$_">$_</OPTION>! } sort { $a cmp $b } @$from ).
-% "</SELECT>\n<BR>".
-% qq!<INPUT TYPE="button" VALUE="refill" onClick="repack_${name}_from()">!.
-% '</TD><TD>'.
-% qq!<SELECT NAME="${name}_to" SIZE=$tosize>\n!.
-% join("\n", map { qq!<OPTION VALUE="$_">$_</OPTION>! } sort { $a cmp $b } @$to ).
-% "</SELECT>\n<BR>".
-% qq!<INPUT TYPE="button" VALUE="refill" onClick="repack_${name}_to()">!.
-% '</TD></TR>'.
-% '<TR><TD COLSPAN=2>'.
-% qq!<INPUT TYPE="button" VALUE="map" onClick="toke_$name(this.form)">!.
-% '</TD></TR><TR><TD COLSPAN=2>'.
-% qq!<TEXTAREA NAME="$name" COLS=80 ROWS=8></TEXTAREA>!.
-% '</TD></TR></TABLE>'.
-% "<script>
-% function toke_$name() {
-% fromObject = document.OneTrueForm.${name}_from;
-% for (var i=fromObject.options.length-1;i>-1;i--) {
-% if (fromObject.options[i].selected)
-% fromname = deleteOption_$name(fromObject,i);
-% }
-% toObject = document.OneTrueForm.${name}_to;
-% for (var i=toObject.options.length-1;i>-1;i--) {
-% if (toObject.options[i].selected)
-% toname = deleteOption_$name(toObject,i);
-% }
-% document.OneTrueForm.$name.value = document.OneTrueForm.$name.value + fromname + ' => ' + toname + '\\n';
-% }
-% function deleteOption_$name(object,index) {
-% value = object.options[index].value;
-% object.options[index] = null;
-% return value;
-% }
-% function repack_${name}_from() {
-% var object = document.OneTrueForm.${name}_from;
-% object.options.length = 0;
-% ". join("\n",
-% map { "addOption_$name(object, '$_');\n" }
-% ( sort { $a cmp $b } @$from ) ). "
-% }
-% function repack_${name}_to() {
-% var object = document.OneTrueForm.${name}_to;
-% object.options.length = 0;
-% ". join("\n",
-% map { "addOption_$name(object, '$_');\n" }
-% ( sort { $a cmp $b } @$to ) ). "
-% }
-% function addOption_$name(object,value) {
-% var length = object.length;
-% object.options[length] = new Option(value, value, false, false);
-% }
-% </script>".
-% '';
-% }
-%
-%
-<%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';
-
-</%init>
diff --git a/httemplate/misc/process/part_device-import.html b/httemplate/misc/process/part_device-import.html
deleted file mode 100644
index eac111a..0000000
--- a/httemplate/misc/process/part_device-import.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server = new FS::UI::Web::JSRPC 'FS::part_device::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/pay_batch-approve.cgi b/httemplate/misc/process/pay_batch-approve.cgi
deleted file mode 100644
index f857e23..0000000
--- a/httemplate/misc/process/pay_batch-approve.cgi
+++ /dev/null
@@ -1,16 +0,0 @@
-% if ( $error ) {
-% $cgi->param('error', $error);
-% }
-<% $cgi->redirect(popurl(3)."search/cust_pay_batch.cgi?dcln=1;batchnum=$batchnum") %>
-<%init>
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Process batches');
-
-my $batchnum = $cgi->param('batchnum');
-# make a record in the paybatch of who did this
-my $paybatch = 'manual-'.$FS::CurrentUser::CurrentUser->username.
- '-' . time2str('%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
-my $pay_batch = qsearchs('pay_batch', { 'batchnum' => $batchnum })
- or die "batchnum '$batchnum' not found";
-my $error = $pay_batch->manual_approve('paybatch' => $paybatch);
-</%init>
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
deleted file mode 100644
index c1c9071..0000000
--- a/httemplate/misc/process/payment.cgi
+++ /dev/null
@@ -1,214 +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;
-
-if ( $cgi->param('fee') =~ /^\s*(\d*(\.\d\d)?)\s*$/ ) {
- my $fee = $1;
- $amount = sprintf('%.2f', $amount + $fee);
-}
-
-$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 county state zip country ) ],
- '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 $payinfo !~ /^99\d{14}$/ #token
- && 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";
-}
-
-$cgi->param('discount_term') =~ /^\d*$/
- or errorpage("illegal discount_term");
-my $discount_term = $1;
-
-my $error = '';
-my $paynum = '';
-if ( $cgi->param('batch') ) {
-
- $error = 'Prepayment discounts not supported with batched payments'
- if $discount_term;
-
- $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,
- 'discount_term' => $discount_term,
- map { $_ => $cgi->param($_) } @{$payby2fields{$payby}}
- );
- errorpage($error) if $error;
-
- #no error, so order the fee package if applicable...
- if ( $cgi->param('fee_pkgpart') =~ /^(\d+)$/ ) {
-
- my $cust_pkg = new FS::cust_pkg { 'pkgpart' => $1 };
-
- my $error = $cust_main->order_pkg( 'cust_pkg' => $cust_pkg );
- errorpage("payment processed successfully, but error ordering fee: $error")
- if $error;
-
- #and generate an invoice for it now too
- $error = $cust_main->bill( 'pkg_list' => [ $cust_pkg ] );
- errorpage("payment processed and fee ordered sucessfully, but error billing fee: $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' => $cust_main->card_token || $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!
-
-</%init>
diff --git a/httemplate/misc/process/phone_avail-import.html b/httemplate/misc/process/phone_avail-import.html
deleted file mode 100644
index f1a2f24..0000000
--- a/httemplate/misc/process/phone_avail-import.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server = new FS::UI::Web::JSRPC 'FS::phone_avail::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/rate-import.html b/httemplate/misc/process/rate-import.html
deleted file mode 100644
index 2c64164..0000000
--- a/httemplate/misc/process/rate-import.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server = new FS::UI::Web::JSRPC 'FS::rate::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/rate_edit_excel.html b/httemplate/misc/process/rate_edit_excel.html
deleted file mode 100644
index acd5f49..0000000
--- a/httemplate/misc/process/rate_edit_excel.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $server = new FS::UI::Web::JSRPC 'FS::rate_detail::process_edit_import', $cgi;
-
-</%init>
-
diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html
deleted file mode 100755
index b56f8a2..0000000
--- a/httemplate/misc/process/recharge_svc.html
+++ /dev/null
@@ -1,92 +0,0 @@
-%if ($error) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "recharge_svc.html?". $cgi->query_string ) %>
-%} else {
-<% header("Package recharged") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY></HTML>
-%}
-<%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;
-
-unless ($error) {
-
- #should probably use payby.pm but whatever
- if ($payby eq 'PREP') {
- $error = $cust_main->recharge_prepay( $prepaid );
- } elsif ( $payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP)$/ ) {
- my $part_pkg = $svc_acct->cust_svc->cust_pkg->part_pkg;
- my $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);
-
- $error ||= "invalid $_" foreach grep { $rhash{$_} !~ /^\d*$/ } keys %rhash;
- if ($part_pkg->option('recharge_reset', 1)) {
- $error ||= $svc_acct->set_usage(\%rhash, 'null' => 1);
- }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) {
- $dbh->rollback if $oldAutoCommit;
-} else {
- $dbh->commit or die $dbh->errstr if $oldAutoCommit;
-}
-
-</%init>
diff --git a/httemplate/misc/process/recharge_svc.new b/httemplate/misc/process/recharge_svc.new
deleted file mode 100755
index bc916e5..0000000
--- a/httemplate/misc/process/recharge_svc.new
+++ /dev/null
@@ -1,85 +0,0 @@
-%
-%
-%#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;
-%
-%
-%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($_, 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);
-%
-% $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") %>
- <SCRIPT TYPE="text/javascript">
- window.top.location.reload();
- </SCRIPT>
- </BODY></HTML>
-<%init>
-my $conf = new FS::Conf;
-</%init>
diff --git a/httemplate/misc/process/tax-fetch_and_import.cgi b/httemplate/misc/process/tax-fetch_and_import.cgi
deleted file mode 100644
index 553c755..0000000
--- a/httemplate/misc/process/tax-fetch_and_import.cgi
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $server = new FS::UI::Web::JSRPC 'FS::tax_rate::process_download_and_update', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/tax-fetch_and_replace.cgi b/httemplate/misc/process/tax-fetch_and_replace.cgi
deleted file mode 100644
index 1a9b626..0000000
--- a/httemplate/misc/process/tax-fetch_and_replace.cgi
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $server = new FS::UI::Web::JSRPC 'FS::tax_rate::process_download_and_reload', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/tax-import.cgi b/httemplate/misc/process/tax-import.cgi
deleted file mode 100644
index b9e9daa..0000000
--- a/httemplate/misc/process/tax-import.cgi
+++ /dev/null
@@ -1,9 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-my $server = new FS::UI::Web::JSRPC 'FS::tax_rate::process_batch_import', $cgi;
-
-</%init>
diff --git a/httemplate/misc/process/tax-upgrade.cgi b/httemplate/misc/process/tax-upgrade.cgi
deleted file mode 100644
index 8782282..0000000
--- a/httemplate/misc/process/tax-upgrade.cgi
+++ /dev/null
@@ -1,147 +0,0 @@
-% if ( $error ) {
-% warn $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 $cfh = $cgi->upload('codefile');
-my $zfh = $cgi->upload('plus4file');
-my $tfh = $cgi->upload('txmatrix');
-my $dfh = $cgi->upload('detail');
-#warn $cgi;
-#warn $fh;
-
-my $oldAutoCommit = $FS::UID::AutoCommit;
-local $FS::UID::AutoCommit = 0;
-my $dbh = dbh;
-
-my $error = '';
-
-my ($cifh, $cdfh, $zifh, $zdfh, $tifh, $tdfh);
-
-if (defined($cfh)) {
- $cifh = new File::Temp( TEMPLATE => 'code.insert.XXXXXXXX',
- DIR => $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc,
- ) or die "can't open temp file: $!\n";
-
- $cdfh = new File::Temp( TEMPLATE => 'code.insert.XXXXXXXX',
- DIR => $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc,
- ) or die "can't open temp file: $!\n";
-
- while(<$cfh>) {
- my $fh = '';
- $fh = $cifh if $_ =~ /"I"\s*$/;
- $fh = $cdfh if $_ =~ /"D"\s*$/;
- die "bad input line: $_" unless $fh;
- print $fh $_;
- }
- seek $cifh, 0, 0;
- seek $cdfh, 0, 0;
-
-}else{
- $error = 'No code file';
-}
-
-$error ||= FS::tax_class::batch_import( {
- filehandle => $cifh,
- 'format' => scalar($cgi->param('format')),
- } );
-
-close $cifh if $cifh;
-
-if (defined($zfh)) {
- $zifh = new File::Temp( TEMPLATE => 'plus4.insert.XXXXXXXX',
- DIR => $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc,
- ) or die "can't open temp file: $!\n";
-
- $zdfh = new File::Temp( TEMPLATE => 'plus4.insert.XXXXXXXX',
- DIR => $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc,
- ) or die "can't open temp file: $!\n";
-
- while(<$zfh>) {
- my $fh = '';
- $fh = $zifh if $_ =~ /"I"\s*$/;
- $fh = $zdfh if $_ =~ /"D"\s*$/;
- die "bad input line: $_" unless $fh;
- print $fh $_;
- }
- seek $zifh, 0, 0;
- seek $zdfh, 0, 0;
-
-}else{
- $error = 'No plus4 file';
-}
-
-$error ||= FS::cust_tax_location::batch_import( {
- filehandle => $zifh,
- 'format' => scalar($cgi->param('format')),
- } );
-close $zifh if $zifh;
-
-if (defined($tfh)) {
- $tifh = new File::Temp( TEMPLATE => 'txmatrix.insert.XXXXXXXX',
- DIR => $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc,
- ) or die "can't open temp file: $!\n";
-
- $tdfh = new File::Temp( TEMPLATE => 'txmatrix.insert.XXXXXXXX',
- DIR => $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc,
- ) or die "can't open temp file: $!\n";
-
- while(<$tfh>) {
- my $fh = '';
- $fh = $tifh if $_ =~ /"I"\s*$/;
- $fh = $tdfh if $_ =~ /"D"\s*$/;
- die "bad input line: $_" unless $fh;
- print $fh $_;
- }
- seek $tifh, 0, 0;
- seek $tdfh, 0, 0;
-
-}else{
- $error = 'No tax matrix file';
-}
-
-$error ||= FS::part_pkg_taxrate::batch_import( {
- filehandle => $tifh,
- 'format' => scalar($cgi->param('format')),
- } );
-close $tifh if $tifh;
-
-$error ||= defined($dfh)
- ? FS::tax_rate::batch_update( {
- filehandle => $dfh,
- 'format' => scalar($cgi->param('format')),
- } )
- : 'No tax detail file';
-
-$error ||= FS::part_pkg_taxrate::batch_import( {
- filehandle => $tdfh,
- 'format' => scalar($cgi->param('format')),
- } );
-close $tdfh if $tdfh;
-
-$error ||= FS::cust_tax_location::batch_import( {
- filehandle => $zdfh,
- 'format' => scalar($cgi->param('format')),
- } );
-close $zdfh if $zdfh;
-
-$error ||= FS::tax_class::batch_import( {
- filehandle => $cdfh,
- 'format' => scalar($cgi->param('format')),
- } );
-close $cdfh if $cdfh;
-
-if ($error) {
- $dbh->rollback or die $dbh->errstr if $oldAutoCommit;
-}else{
- $dbh->commit or die $dbh->errstr if $oldAutoCommit;
-}
-
-</%init>
diff --git a/httemplate/misc/process/timeworked.html b/httemplate/misc/process/timeworked.html
deleted file mode 100644
index 200a751..0000000
--- a/httemplate/misc/process/timeworked.html
+++ /dev/null
@@ -1,59 +0,0 @@
-% if ($error) {
-<% $cgi->redirect(popurl(2). "timeworked.html?". $cgi->query_string) %>
-% } else {
-<% $cgi->redirect(popurl(3). "search/timeworked.html?begin=$begin;end=$end") %>
-% }
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Time queue');
-
-my($begin, $end) = FS::UI::Web::parse_beginning_ending($cgi);
-
-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' => int( $seconds{$customer} * $msum ),
- };
- }
-
-}
-
-my $error = FS::acct_rt_transaction->batch_insert(@acct_rt_transaction);
-$cgi->param('error', $error) if $error;
-
-</%init>
diff --git a/httemplate/misc/qual.html b/httemplate/misc/qual.html
deleted file mode 100644
index 69a5f8b..0000000
--- a/httemplate/misc/qual.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<% include('/elements/header-popup.html', 'Service Qualification' ) %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="QualForm" ACTION="<% $p %>edit/process/qual.cgi" METHOD="POST">
-
-<INPUT TYPE="hidden" NAME="<%$cust_or_prospect%>num" VALUE="<% $custnum_or_prospectnum %>">
-
-<% ntable("#cccccc", 2) %>
-
-<% include('/elements/tr-td-label.html',
- 'cgi' => $cgi,
- 'label' => 'Qualify using',
- 'cell_style' => 'font-weight: bold',
- 'id' => 'exportnum',
- )
-%>
-<TD>
-<% include('/elements/select.html',
- 'cgi' => $cgi,
- 'field' => 'exportnum',
- 'options' => \@export_options,
- 'labels' => $export_labels,
- 'curr_value' => $cgi->param('exportnum'),
- )
-%>
-</TD>
-</TR>
-
-<% include('/elements/tr-input-text.html',
- 'cgi' => $cgi,
- 'label' => 'Service Telephone Number',
- 'field' => 'phonenum',
- 'size' => '12',
- 'value' => $cgi->param('phonenum'),
- )
-%>
-
-<% include('/elements/tr-select-cust_location.html',
- 'cgi' => $cgi,
- $table => $cust_main_or_prospect_main,
- 'alt_format' => $conf->exists('qual-alt-address-format') ? 1 : 0,
- 'is_optional' => 1,
- 'no_bold' => 1,
- )
-%>
-</TABLE>
-
-<BR>
-<INPUT type="submit" VALUE="Qualify" onClick = "this.disabled=true;">
-
-</FORM>
-</BODY>
-</HTML>
-<%init>
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-die "access denied"
- unless $curuser->access_right('Qualify service');
-
-my $conf = new FS::Conf;
-my $date_format = $conf->config('date_format') || '%m/%d/%Y';
-
-$cgi->param('custnum') =~ /^(\d+)$/;
-my $custnum = $1;
-$cgi->param('prospectnum') =~ /^(\d+)$/;
-my $prospectnum = $1;
-my $cust_or_prospect = $custnum ? "cust" : "prospect";
-my $table = $cust_or_prospect . "_main";
-my $custnum_or_prospectnum = $custnum ? $custnum : $prospectnum;
-my $cust_main_or_prospect_main = qsearchs({
- 'table' => $table,
- 'hashref' => { $cust_or_prospect."num" => $custnum_or_prospectnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-});
-die "neither prospect nor customer specified or found"
- unless $cust_main_or_prospect_main;
-
-my @exports = grep { $_->can('qual') } qsearch( 'part_export', {} );
-my @export_options = ( 0 );
-my $export_labels = { '0' => '(manual)' };
-foreach my $export ( @exports ) {
- push @export_options, $export->exportnum;
- $export_labels->{$export->exportnum} = $export->exportname;
-}
-
-</%init>
diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi
deleted file mode 100644
index 5dee29b..0000000
--- 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;
- }
- }
-}
-
-</%init>
diff --git a/httemplate/misc/queued_report.html b/httemplate/misc/queued_report.html
deleted file mode 100755
index 8754045..0000000
--- a/httemplate/misc/queued_report.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<% include($report_comp) %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
-
-my $report = '';
-$cgi->param('report') =~ /^([.\w]+)$/ && ($report = $1);
-die "no such report" unless $report;
-
-my $prefix = "$FS::UID::cache_dir/cache.$FS::UID::datasrc";
-open my $fh, "$prefix/report.$report"
- or die "can't open report: $!\n";
-
-my $reportvalue = '';
-{
- local $/;
- $reportvalue = <$fh>;
-}
-close $fh;
-
-#my ($interp, $other) = FS::Mason::mason_interps('standalone');
-my $interp = $m->interp;
-my $report_comp =
- eval { $interp->make_component ( comp_source => $reportvalue ) };
-die $@ if $@;
-errorpage($@) if $@;
-
-</%init>
diff --git a/httemplate/misc/rate-import.html b/httemplate/misc/rate-import.html
deleted file mode 100644
index ae8ee69..0000000
--- a/httemplate/misc/rate-import.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<% include("/elements/header.html",'Import Rate Plan') %>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'RateImportForm',
- 'action ' => 'process/rate-import.html',
- 'num_files' => 1,
- 'fields' => [ 'ratename' ],
- 'message' => 'Rate plan import successful',
-# 'url' => $p."browse/rate_detail.cgi?ratenum=$ratenum", #XXX how?
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <TR>
- <TD>Rate plan</TD>
- <TD>
- <INPUT TYPE="text" NAME="ratename" SIZE=32 VALUE="">
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => 'Filename',
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import rate plan"
- onClick = "document.RateImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<BR>
-
-<!--Upload file can be a text file or Excel spreadsheet. If an Excel spreadsheet,
- should have an .XLS extension.
-<BR><BR>
--->
-File format is CSV (comma-separated value), with the following field order:
-<ul>
- <li>Destination name
- <li>Country code / Prefix. See below for formatting rules.
- <li>Rate (per minute)
-<!--
- <li>(Optional) Included minutes
- <li>(Optional) Granularity
--->
-</ul>
-
-Formatting rules for second field:
-<ul>
- <li>Simple entries contain just a countrycode or a countrycode and single prefix for example, "61" or "52 33". Whitespace, plus and dash are ignored.
- <li>Additional prefixes may be appended after a comma (appropriately quoted), but country code should only be listed once at the beginning. For example, "61 38,39".
- <li>
-</ul>
-
-Have caution when importing prefix data that is mismatched to your current
-prefixes.
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
diff --git a/httemplate/misc/rate_edit_excel.html b/httemplate/misc/rate_edit_excel.html
deleted file mode 100644
index 442d83a..0000000
--- a/httemplate/misc/rate_edit_excel.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<% include('/elements/header.html', 'Edit rates with Excel' ) %>
-
-% if ( $have_conn ) {
- <FONT COLOR="#FF0000">WARNING: This functionality does not yet preserve connection charges.</FONT><BR><BR>
-% }
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'RateImportForm',
- 'action' => 'process/rate_edit_excel.html',
- 'num_files' => 1,
- 'fields' => [ 'format' ],
- 'message' => 'Rate edit successful',
- 'url' => $p."browse/rate_region.html",
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <TR>
- <TH ALIGN="left">1. Download current rates:</TH>
- <TD>
- <A HREF="<%$p%>/browse/rate_region.html?show_rates=1;_type=regions.xls">Download rate spreadsheet</A>
- </TD>
- </TR>
-
- <TR>
- <TH ALIGN="left" COLSPAN=2>2. Edit rates with Excel (or other .XLS-compatible application)</TH>
- </TR>
-
- <TR>
- <TD ALIGN="left" COLSPAN=2>
- &nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;To add rates, add four columns like an existing rate, with headers starting with "NEW: Rate Name" or "Rate Name".<BR>
- &nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<FONT SIZE="-2"><I>For rate addition, protection can be turned off in Excel via the Tools-&gt;Protection-&gt;Unprotect Sheet menu command. Note that only new rates can be added; modified grayed out cells will not be imported.</I></FONT>
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => 'file',
- 'label' => '3. Upload edited rate file: ',
- 'label_align' => 'left',
- )
- %>
-
- <INPUT TYPE="hidden" NAME="format" VALUE="default">
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Upload"
- onClick = "document.RateImportForm.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-
-</TABLE>
-
-<% include('/elements/footer.html') %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $sth = dbh->prepare('SELECT COUNT(*) FROM rate_detail WHERE conn_charge > 0 OR conn_sec > 0 LIMIT 1')
- or die dbh->errstr;
-$sth->execute or die $sth->errstr;
-my $have_conn = $sth->fetchrow_arrayref->[0];
-
-</%init>
diff --git a/httemplate/misc/recharge_svc.html b/httemplate/misc/recharge_svc.html
deleted file mode 100755
index d8a8faa..0000000
--- a/httemplate/misc/recharge_svc.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<% include('/elements/header-popup.html', 'Recharge Service' ) %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="recharge_popup" ACTION="<% popurl(1) %>process/recharge_svc.html" METHOD=POST>
-<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
-
-<BR><BR>
-<% "Recharge $svcnum: $label - $value" %>
-<% ntable("#cccccc", 2) %>
-
-<SCRIPT>
- function toggle_prep(what) {
- if (what.value == "PREP"){
- what.form.prepaid.disabled = false;
- }else{
- what.form.prepaid.disabled = true;
- }
- }
-</SCRIPT>
-<TR>
- <TD><INPUT TYPE="radio" NAME="payby" onchange="toggle_prep(this)" VALUE="PREP" <% $payby eq "PREP" ? 'checked' : '' %> <% $recharge_label ? '' : 'disabled' %>></TD>
- <TD>Prepaid Card</TD>
-% if ($recharge_label) {
- <TD><INPUT TYPE="radio" NAME="payby" onchange="toggle_prep(this)" VALUE="<% $cust_svc->cust_pkg->cust_main->payby %>" <% $payby eq "PREP" ? '' : 'checked' %>></TD>
- <TD><% $recharge_label %></TD>
-% }
-</TR>
-<TR>
- <TD>Enter prepaid card: </TD>
- <TD><INPUT TYPE="text" NAME="prepaid" VALUE="<% $prepaid |h %>" <% $payby eq "PREP" ? '' : 'disabled' %>></TD>
-</TR>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" NAME="submit" VALUE="Recharge">
-
-</FORM>
-
-<% include('/elements/footer.html') %>
-
-<%once>
-
-my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
-
-</%once>
-<%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 ");
-
-</%init>
-
diff --git a/httemplate/misc/send-invoice.cgi b/httemplate/misc/send-invoice.cgi
deleted file mode 100644
index 32dfe27..0000000
--- a/httemplate/misc/send-invoice.cgi
+++ /dev/null
@@ -1,30 +0,0 @@
-<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
-<%once>
-
-my %method = ( map { $_=>1 } qw( email print fax_invoice ) );
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices');
-
-my $invnum = $cgi->param('invnum');
-my $template = $cgi->param('template');
-my $notice_name = $cgi->param('notice_name') if $cgi->param('notice_name');
-my $method = $cgi->param('method');
-
-$method .= '_invoice' if $method eq 'fax'; #!
-
-die "unknown method $method" unless $method{$method};
-
-my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
-die "Can't find invoice!\n" unless $cust_bill;
-
-$cust_bill->$method({ 'template' => $template,
- 'notice_name' => $notice_name,
- });
-
-my $custnum = $cust_bill->getfield('custnum');
-
-</%init>
diff --git a/httemplate/misc/send-statement.cgi b/httemplate/misc/send-statement.cgi
deleted file mode 100755
index e363fbd..0000000
--- a/httemplate/misc/send-statement.cgi
+++ /dev/null
@@ -1,28 +0,0 @@
-<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
-<%once>
-
-my %method = map { $_=>1 } qw( email print fax_invoice );
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices');
-
-my $statementnum = $cgi->param('statementnum');
-my $template = $cgi->param('template') || 'statement'; #XXX configure... via event?? eh..
-my $notice_name = $cgi->param('notice_name') if $cgi->param('notice_name');
-my $method = $cgi->param('method');
-
-$method .= '_invoice' if $method eq 'fax'; #!
-
-die "unknown method $method" unless $method{$method};
-
-my $cust_statement = qsearchs('cust_statement',{'statementnum'=>$statementnum});
-die "Can't find statement!\n" unless $cust_statement;
-
-$cust_statement->$method({ 'template' => $template });
-
-my $custnum = $cust_statement->getfield('custnum');
-
-</%init>
diff --git a/httemplate/misc/spool_invoices.cgi b/httemplate/misc/spool_invoices.cgi
deleted file mode 100644
index bfe24e6..0000000
--- a/httemplate/misc/spool_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_respool', $cgi;
-
-</%init>
diff --git a/httemplate/misc/states.cgi b/httemplate/misc/states.cgi
deleted file mode 100644
index 02b7be4..0000000
--- a/httemplate/misc/states.cgi
+++ /dev/null
@@ -1,7 +0,0 @@
-[ <% join(', ', map { qq("$_") } @output) %> ]
-<%init>
-
-my $country = $cgi->param('arg');
-my @output = states_hash($country);
-
-</%init>
diff --git a/httemplate/misc/svc_acct-domains.cgi b/httemplate/misc/svc_acct-domains.cgi
deleted file mode 100644
index 5734574..0000000
--- 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 ];
- }
-}
-
-</%init>
diff --git a/httemplate/misc/svc_cert-generate.html b/httemplate/misc/svc_cert-generate.html
deleted file mode 100644
index 10e8ab4..0000000
--- a/httemplate/misc/svc_cert-generate.html
+++ /dev/null
@@ -1,25 +0,0 @@
-% if ($error) {
-% errorpage($error);
-%} else {
-<% $cgi->redirect($p."view/svc_cert.cgi?$svcnum") %>
-%}
-<%init>
-
-$cgi->param('svcnum') =~ /^(\d+)$/ or die 'illegal svcnum';
-my $svcnum = $1;
-
-my $svc_cert = qsearchs('svc_cert', { 'svcnum' => $svcnum } )
- or die 'unknown svcnum';
-
-my $error = '';
-if ( $cgi->param('action') eq 'generate_csr' ) {
- $svc_cert->generate_csr;
- $error = $svc_cert->replace;
-} elsif ( $cgi->param('action') eq 'generate_selfsigned' ) {
- $svc_cert->generate_selfsigned;
- $error = $svc_cert->replace;
-} else {
- die 'unknown action';
-}
-
-</%init>
diff --git a/httemplate/misc/tax-fetch_and_import.cgi b/httemplate/misc/tax-fetch_and_import.cgi
deleted file mode 100644
index 33a6c9b..0000000
--- a/httemplate/misc/tax-fetch_and_import.cgi
+++ /dev/null
@@ -1,48 +0,0 @@
-<% include("/elements/header.html",'Tax Rate Download and Import') %>
-
-Import a tax data update.
-<BR><BR>
-
-<% include( '/elements/progress-init.html', 'TaxRateImport',[ 'format', ],
- 'process/tax-fetch_and_import.cgi', { 'message' => 'Tax rates imported' },
- )
-%>
-
-<FORM NAME="TaxRateImport" ACTION="javascript:void()" METHOD="POST">
-<% &ntable("#cccccc", 2) %>
-
- <TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <OPTION VALUE="cch">CCH import
- </SELECT>
- </TD>
- </TR>
- <TR>
- <TH ALIGN="right">Update Password</TH>
- <TD>
- <INPUT TYPE="text" NAME="password">
- </TD>
- </TR>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- VALUE = "Download and Import"
- onClick = "document.TaxRateImport.submit.disabled=true; process();"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<% include('/elements/footer.html') %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
diff --git a/httemplate/misc/tax-fetch_and_replace.cgi b/httemplate/misc/tax-fetch_and_replace.cgi
deleted file mode 100644
index 3290a3c..0000000
--- a/httemplate/misc/tax-fetch_and_replace.cgi
+++ /dev/null
@@ -1,48 +0,0 @@
-<% include("/elements/header.html",'Tax Rate Download and Import') %>
-
-Replace tax data.
-<BR><BR>
-
-<% include( '/elements/progress-init.html', 'TaxRateImport',[ 'format', ],
- 'process/tax-fetch_and_replace.cgi', { 'message' => 'Tax rates replaced' },
- )
-%>
-
-<FORM NAME="TaxRateImport" ACTION="javascript:void()" METHOD="POST">
-<% &ntable("#cccccc", 2) %>
-
- <TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <OPTION VALUE="cch">CCH import
- </SELECT>
- </TD>
- </TR>
- <TR>
- <TH ALIGN="right">Update Password</TH>
- <TD>
- <INPUT TYPE="text" NAME="password">
- </TD>
- </TR>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- VALUE = "Download and Import"
- onClick = "document.TaxRateImport.submit.disabled=true; process();"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<% include('/elements/footer.html') %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
diff --git a/httemplate/misc/tax-import.cgi b/httemplate/misc/tax-import.cgi
deleted file mode 100644
index ceb7464..0000000
--- a/httemplate/misc/tax-import.cgi
+++ /dev/null
@@ -1,74 +0,0 @@
-<% include("/elements/header.html",'Batch Tax Rate Import') %>
-
-Import a CSV file set containing tax rate records.
-<BR><BR>
-
-<% include( '/elements/form-file_upload.html',
- 'name' => 'TaxRateUpload',
- 'action' => 'process/tax-import.cgi',
- 'num_files' => 6,
- 'fields' => [ 'format', 'reload' ],
- 'message' => 'Tax rates imported',
- )
-%>
-
-<% &ntable("#cccccc", 2) %>
-
- <TR>
- <TH ALIGN="right">Format</TH>
- <TD>
- <SELECT NAME="format">
- <!-- <OPTION VALUE="cch-update" SELECTED>CCH update (CSV) -->
- <OPTION VALUE="cch">CCH import (CSV)
- <!-- <OPTION VALUE="cch-fixed-update">CCH update (fixed length) -->
- <OPTION VALUE="cch-fixed">CCH import (fixed length)
- </SELECT>
- </TD>
- </TR>
-
- <TR>
- <TH ALIGN="right">Replace existing data from this vendor</TH>
- <TD>
- <INPUT NAME="reload" TYPE="checkbox" VALUE="1" CHECKED>
- </TD>
- </TR>
-
- <% include( '/elements/file-upload.html',
- 'field' => [ 'geocodefile',
- 'codefile',
- 'plus4file',
- 'zipfile',
- 'txmatrixfile',
- 'detailfile',
- ],
- 'label' => [ 'geocode filename',
- 'code filename',
- 'plus4 filename',
- 'zip filename',
- 'txmatrix filename',
- 'detail filename',
- ],
- 'debug' => 0,
- )
- %>
-
- <TR>
- <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- VALUE = "Import CSV files"
- onClick = "document.TaxRateUpload.submit.disabled=true;"
- >
- </TD>
- </TR>
-
-</TABLE>
-
-</FORM>
-
-<% include('/elements/footer.html') %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
-</%init>
diff --git a/httemplate/misc/timeworked.html b/httemplate/misc/timeworked.html
deleted file mode 100755
index 672fad8..0000000
--- a/httemplate/misc/timeworked.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<% include('/elements/header.html', $title, '' ) %>
-
-<% include('/elements/error.html') %>
-
-<FORM NAME="timeworked_form" ACTION="<% popurl(1) %>process/timeworked.html" METHOD=POST>
-
-<TABLE CELLSPACING="2" CELLPADDING="2" RULES="groups" FRAME="hsides">
-
- <THEAD>
- <TR>
- <TH COLSPAN="2">Ticket</TH>
- <TH>Hours</TH>
- <TH COLSPAN="2">Customer</TH>
- <TH>Multiplier</TH>
- </TR>
- </THEAD>
-
- <TBODY>
-
-% 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 $clink = $p. 'view/cust_main.cgi?'. $custnum;
-
- <TR>
- <TD><a href="<% $link %>"><% $ticketmap{$tr_id} %></a></TD>
- <TD><a href="<% $link %>"><% $ticket{$ticketmap{$tr_id}} |h %></a></TD>
-
-% my $seconds = 0;
-% if ( $cgi->param("seconds$tr_id") =~ /^(\d+)$/ ) {
-% $seconds = $1;
-% }
-
- <TD><% sprintf("%0.2f", $seconds/3600) %></TD>
- <TD ALIGN="right"><a href="<% $clink %>"><% $custnum %></a></TD>
- <TD ALIGN="right"><a href="<% $clink %>"><% $name %></a></TD>
- <TD>
- <INPUT TYPE="hidden" NAME="transactionid<%$tr_id%>" VALUE="1" >
- <INPUT TYPE="hidden" NAME="seconds<%$tr_id%>" VALUE="<% $seconds %>" >
-
-% my $multiplier = $default_multiplier;
-% my $mult_paramname = "multiplier${tr_id}_$custnum";
-% if ( $cgi->param($mult_paramname) =~ /^\s*([\d\.]+)\s*$/ ) {
-% $multiplier = $1;
-% }
-
- <INPUT TYPE="text" NAME="<% $mult_paramname %>" SIZE="5" VALUE="<% $multiplier %>" >
- </TD>
- </TR>
-
-% foreach ( @customers ) {
-% ($custnum, $name) = split(':', $_, 2);
-% $clink = $p. 'view/cust_main.cgi?'. $custnum;
-
- <TR>
- <TD ALIGN="right" COLSPAN="4" ><a href="<% $clink %>"><% $custnum %></a></TD>
- <TD ALIGN="right"><a href="<% $clink %>"><% $name %></a></TD>
- <TD>
-
-% $multiplier = $default_multiplier;
-% $mult_paramname = "multiplier${tr_id}_$custnum";
-% if ( $cgi->param($mult_paramname) =~ /^\s*([\d\.]+)\s*$/ ) {
-% $multiplier = $1;
-% }
-
- <INPUT TYPE="text" NAME="<% $mult_paramname %>" SIZE="5" VALUE="<% $multiplier %>" >
-
- </TD>
-
- </TR>
-
-% }
-% }
-
- </TBODY>
-
-</TABLE>
-
-<BR>
-
-<INPUT TYPE="hidden" NAME="begin" VALUE="<% $cgi->param('begin') |h %>">
-<INPUT TYPE="hidden" NAME="end" VALUE="<% $cgi->param('end') |h %>">
-
-<INPUT TYPE="submit" NAME="submit" VALUE="<% $title %>">
-</FORM>
-
-<% 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 }
- ];
-
- }
-}
-
-</%init>
-
diff --git a/httemplate/misc/unadjourn_pkg.cgi b/httemplate/misc/unadjourn_pkg.cgi
deleted file mode 100755
index 356b49c..0000000
--- a/httemplate/misc/unadjourn_pkg.cgi
+++ /dev/null
@@ -1,17 +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('Suspend customer package later');
-
-my ($pkgnum) = $cgi->keywords;
-my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
-my $error = "No package $pkgnum" unless $cust_pkg;
-
-$error ||= $cust_pkg->unadjourn;
-
-</%init>
diff --git a/httemplate/misc/unapply-cust_credit.cgi b/httemplate/misc/unapply-cust_credit.cgi
deleted file mode 100755
index ed739ac..0000000
--- 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;
-}
-
-</%init>
diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi
deleted file mode 100755
index 8cdac18..0000000
--- 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;
-}
-
-</%init>
diff --git a/httemplate/misc/unexpire_pkg.cgi b/httemplate/misc/unexpire_pkg.cgi
deleted file mode 100755
index 4450255..0000000
--- a/httemplate/misc/unexpire_pkg.cgi
+++ /dev/null
@@ -1,17 +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('Cancel customer package later');
-
-my ($pkgnum) = $cgi->keywords;
-my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
-my $error = "No package $pkgnum" unless $cust_pkg;
-
-$error ||= $cust_pkg->unexpire;
-
-</%init>
diff --git a/httemplate/misc/unprovision.cgi b/httemplate/misc/unprovision.cgi
deleted file mode 100755
index 6f2c238..0000000
--- a/httemplate/misc/unprovision.cgi
+++ /dev/null
@@ -1,38 +0,0 @@
-%if ( $error ) {
-% errorpage($error);
-%} elsif ( $pkgnum ) {
-<% $cgi->redirect(popurl(2)."search/cust_pkg_svc.html?svcpart=$svcpart;pkgnum=$pkgnum") %>
-%} else { # $custnum should always exist
-<% $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 @svcnums;
-my ($pkgnum, $svcpart, $custnum);
-if( $cgi->param('svcnum') ) {
- @svcnums = grep { $_ } map { /^(\d+)$/ && $1 } $cgi->param('svcnum');
- $pkgnum = $cgi->param('pkgnum');
- $svcpart = $cgi->param('svcpart');
- $custnum = $cgi->param('custnum');
-}
-else {
- @svcnums = map { /^(\d+)$/ && $1 } $cgi->keywords;
-}
-
-my $error = '';
-foreach my $svcnum (@svcnums) {
-
- my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
- die "Unknown svcnum!" unless $cust_svc;
-
- $custnum ||= $cust_svc->cust_pkg->custnum;
-
- $error .= $cust_svc->cancel;
-
-}
-
-</%init>
diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi
deleted file mode 100755
index b350693..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/unvoid-cust_pay_void.cgi b/httemplate/misc/unvoid-cust_pay_void.cgi
deleted file mode 100755
index 91fe1c2..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/upload-batch.cgi b/httemplate/misc/upload-batch.cgi
deleted file mode 100644
index be80b1f..0000000
--- a/httemplate/misc/upload-batch.cgi
+++ /dev/null
@@ -1,10 +0,0 @@
-<% $server->process %>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Process batches');
-
-my $server =
- new FS::UI::Web::JSRPC 'FS::pay_batch::process_import_results', $cgi;
-
-</%init>
diff --git a/httemplate/misc/void-cust_pay.cgi b/httemplate/misc/void-cust_pay.cgi
deleted file mode 100755
index 7b484e9..0000000
--- 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;
-
-</%init>
diff --git a/httemplate/misc/whois.cgi b/httemplate/misc/whois.cgi
deleted file mode 100644
index 533b2d7..0000000
--- a/httemplate/misc/whois.cgi
+++ /dev/null
@@ -1,33 +0,0 @@
-<% include("/elements/header.html","Whois $domain", menubar(
- ( $custnum
- ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ()
- ),
- "View this domain (#$svcnum)" => "${p}view/svc_domain.cgi?$svcnum",
-)) %>
-
-<PRE><% $whois %></PRE>
-
-<% include('/elements/footer.html') %>
-
-<%init>
-
-my $svcnum = $cgi->param('svcnum');
-my $custnum = $cgi->param('custnum');
-my $domain = $cgi->param('domain');
-
-my $display_custnum;
-if ( $custnum ) {
- my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
- $display_custnum = $cust_main->display_custnum;
-}
-
-my $whois = eval { whois($domain) };
- if ( $@ ) {
- ( $whois = $@ ) =~ s/ at \/.*Net\/Whois\/Raw\.pm line \d+.*$//s;
- } else {
- $whois =~ s/^\n+//;
- }
-
-</%init>
diff --git a/httemplate/misc/xmlhttp-calculate_taxes.html b/httemplate/misc/xmlhttp-calculate_taxes.html
deleted file mode 100644
index d3dc36a..0000000
--- a/httemplate/misc/xmlhttp-calculate_taxes.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<% objToJson($return) %>
-<%init>
-
-my $DEBUG = 0;
-
-my $conf = new FS::Conf;
-
-my $sub = $cgi->param('sub');
-
-my $return = {};
-
-if ( $sub eq 'calculate_taxes' ) {
-
- {
- my %arg = $cgi->param('arg');
- $return = \%arg;
- warn join('', map "$_: $arg{$_}\n", keys %arg )
- if $DEBUG;
-
- my $cust_credit = qsearchs( 'cust_credit', { 'crednum' => $arg{crednum} } );
- unless ($cust_credit) {
- $return->{error} = "No such credit: $arg{crednum}";
- last;
- }
-
- my %cust_bill_pkg = ();
- my @items = split(',', $arg{items});
- while ( @items ) {
- my ($billpkgnum, $s_or_r, $amount ) = splice(@items, 0, 3);
- unless ( defined($amount) ) {
- $return->{error} = "Bad items argument list";
- last;
- }
- unless ( $cust_bill_pkg{$billpkgnum} ) {
- my $cust_bill_pkg =
- qsearchs( 'cust_bill_pkg', { 'billpkgnum' => $billpkgnum } );
- unless ($cust_bill_pkg) {
- $return->{error} = "No such line item: $billpkgnum";
- last;
- }
- next unless $cust_bill_pkg->pkgnum > 0; #hmmm @ one shot (-1)
- unless ($cust_bill_pkg->cust_pkg->custnum == $cust_credit->custnum) {
- $return->{error} = "Credit/line item customer mismatch";
- last;
- }
- $cust_bill_pkg{$billpkgnum} = $cust_bill_pkg;
- $cust_bill_pkg->setup(0);
- $cust_bill_pkg->recur(0);
- }
-
- last if $return->{error};
-
- my $cust_bill_pkg = $cust_bill_pkg{$billpkgnum};
- $s_or_r = $s_or_r eq 'setup' ? 'setup' : 'recur';
- my $value = sprintf('%.2f', $cust_bill_pkg->$s_or_r + $amount);
- $cust_bill_pkg->$s_or_r($value);
- }
-
- last if $return->{error};
-
- my $cust_main = $cust_credit->cust_main;
-
- my $taxlisthash = {};
- foreach my $cust_bill_pkg (values %cust_bill_pkg) {
- my $part_pkg = $cust_bill_pkg->part_pkg;
- $cust_main->_handle_taxes( $part_pkg,
- $taxlisthash,
- $cust_bill_pkg,
- $cust_bill_pkg->cust_pkg,
- $cust_bill_pkg->cust_bill->_date,
- $cust_bill_pkg->cust_pkg->pkgpart,
- );
- }
- my $listref_or_error =
- $cust_main->calculate_taxes( [ values %cust_bill_pkg ], $taxlisthash, [ values %cust_bill_pkg ]->[0]->cust_bill->_date );
-
- unless ( ref( $listref_or_error ) ) {
- $return->{error} = "No such credit: $arg{crednum}";
- last;
- }
-
- my @taxlines = ();
- $return->{taxlines} = \@taxlines;
- foreach my $taxline ( @$listref_or_error ) {
- my $amount = $taxline->setup;
- my $desc = $taxline->desc;
- foreach my $location ( @{$taxline->cust_bill_pkg_tax_location}, @{$taxline->cust_bill_pkg_tax_rate_location} ) {
- my $taxlocnum = $location->locationnum || '';
- my $taxratelocnum = $location->taxratelocationnum || '';
- $location->cust_bill_pkg_desc($taxline->desc); #ugh @ that kludge
- push @taxlines,
- [ $location->desc, $taxline->setup, $taxlocnum, $taxratelocnum ];
- $amount -= $location->amount;
- }
- if ($amount > 0) {
- push @taxlines,
- [ $taxline->itemdesc. ' (default)', sprintf('%.2f', $amount), '', '' ];
- }
- }
-
- $return->{taxlines} = \@taxlines;
-
- }
-}
-
-</%init>
diff --git a/httemplate/misc/xmlhttp-cust_main-address_standardize.html b/httemplate/misc/xmlhttp-cust_main-address_standardize.html
deleted file mode 100644
index d0627cd..0000000
--- a/httemplate/misc/xmlhttp-cust_main-address_standardize.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<% objToJson($return) %>
-<%init>
-
-my $DEBUG = 0;
-
-my $conf = new FS::Conf;
-
-my $sub = $cgi->param('sub');
-
-my $return = {};
-
-if ( $sub eq 'address_standardize' ) {
-
- my %arg = $cgi->param('arg');
- $return = \%arg;
- warn join('', map "$_: $arg{$_}\n", keys %arg )
- if $DEBUG;
-
- my $userid = $conf->config('usps_webtools-userid');
- my $password = $conf->config('usps_webtools-password');
-
- if ( length($userid) && length($password) ) {
-
- my $verifier = Business::US::USPS::WebTools::AddressStandardization->new( {
- UserID => $userid, #$ENV{USPS_WEBTOOLS_USERID},
- Password => $password, #$ENV{USPS_WEBTOOLS_PASSWORD},
- #Testing => 1,
- } );
-
- foreach my $pre ( '', 'ship_' ) {
- next unless ($pre || !$arg{onlyship});
-
- my($zip5, $zip4) = split('-',$arg{$pre.'zip'});
-
- my %usps_args = (
- FirmName => $arg{$pre.'company'},
- Address2 => $arg{$pre.'address1'},
- Address1 => $arg{$pre.'address2'},
- City => $arg{$pre.'city'},
- State => $arg{$pre.'state'},
- Zip5 => $zip5,
- Zip4 => $zip4,
- );
- warn join('', map "$_: $usps_args{$_}\n", keys %usps_args )
- if $DEBUG;
-
- my $hash = $verifier->verify_address( %usps_args );
-
- warn $verifier->response
- if $DEBUG;
-
- unless ( $verifier->is_error ) {
-
- my $zip = $hash->{Zip5};
- $zip .= '-'. $hash->{Zip4} if $hash->{Zip4} =~ /\d/;
-
- $return = {
- %$return,
- "new_$pre".'company' => $hash->{FirmName},
- "new_$pre".'address1' => $hash->{Address2},
- "new_$pre".'address2' => $hash->{Address1},
- "new_$pre".'city' => $hash->{City},
- "new_$pre".'state' => $hash->{State},
- "new_$pre".'zip' => $zip,
- };
-
- my @fields = (qw( company address1 address2 city state zip )); #hmm
-
- my $changed =
- scalar( grep { $return->{$pre.$_} ne $return->{"new_$pre$_"} }
- @fields
- )
- ? 1 : 0;
-
- $return->{$pre.'address_standardized'} = $changed;
-
- } else {
-
- $return->{$pre.'error'} = "USPS WebTools error: ".
- $verifier->{error}{description};
-
-
- }
-
- }
-
- }
-
- $return;
-
-}
-
-</%init>
diff --git a/httemplate/misc/xmlhttp-cust_main-censustract.html b/httemplate/misc/xmlhttp-cust_main-censustract.html
deleted file mode 100644
index 3ba68af..0000000
--- a/httemplate/misc/xmlhttp-cust_main-censustract.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<% objToJson($return) %>
-<%init>
-
-my $DEBUG = 0;
-
-my $url='http://www.ffiec.gov/Geocode/default.aspx';
-
-my $sub = $cgi->param('sub');
-
-my $return = {};
-my $error = '';
-
-use LWP::UserAgent;
-use HTTP::Request;
-use HTTP::Request::Common qw( GET POST );
-use HTML::TokeParser;
-
-if ( $sub eq 'censustract' ) {
-
- my %arg = $cgi->param('arg');
- warn join('', map "$_: $arg{$_}\n", keys %arg )
- if $DEBUG;
-
- my $ua = new LWP::UserAgent;
- my $res = $ua->request( GET( $url ) );
-
- warn $res->as_string
- if $DEBUG > 1;
-
- unless ($res->code eq '200') {
-
- $error = $res->message;
-
- } else {
-
- my $content = $res->content;
- my $p = new HTML::TokeParser \$content;
- my $viewstate;
- my $eventvalidation;
- while (my $token = $p->get_tag('input') ) {
- if ($token->[1]->{name} eq '__VIEWSTATE') {
- $viewstate = $token->[1]->{value};
- }
- if ($token->[1]->{name} eq '__EVENTVALIDATION') {
- $eventvalidation = $token->[1]->{value};
- }
- last if $viewstate && $eventvalidation;
- }
-
- unless ($viewstate && $eventvalidation ) {
-
- $error = "either no __VIEWSTATE or __EVENTVALIDATION found";
-
- } else {
-
- my($zip5, $zip4) = split('-',$arg{zip});
-
- #ugh workaround a mess at ffiec
- $arg{year} = " $arg{year}" unless $arg{year} = "2010";
- my @ffiec_args = (
- __VIEWSTATE => $viewstate,
- __EVENTVALIDATION => $eventvalidation,
- ddlbYear => $arg{year},
- ddlbYear => ' 2009',
- txtAddress => $arg{address},
- txtCity => $arg{city},
- ddlbState => $arg{state},
- txtZipCode => $zip5,
- btnSearch => 'Search',
- );
- warn join("\n", @ffiec_args )
- if $DEBUG;
-
- push @{ $ua->requests_redirectable }, 'POST';
- $res = $ua->request( POST( $url, \@ffiec_args ) );
- warn $res->as_string
- if $DEBUG > 1;
-
- unless ($res->code eq '200') {
-
- $error = $res->message;
-
- } else {
-
- my @id = qw( MSACode StateCode CountyCode TractCode );
- $content = $res->content;
- warn $res->content if $DEBUG > 1;
- $p = new HTML::TokeParser \$content;
- my $prefix = 'UcGeoResult11_lb';
- my $compare =
- sub { my $t=shift; scalar( grep { lc($t) eq lc("$prefix$_")} @id ) };
-
- while (my $token = $p->get_tag('span') ) {
- next unless ( $token->[1]->{id} && &$compare( $token->[1]->{id} ) );
- $token->[1]->{id} =~ /^$prefix(\w+)$/;
- $return->{lc($1)} = $p->get_trimmed_text("/span");
- }
-
- $error = "No census tract found" unless $return->{tractcode};
- $return->{tractcode} .= ' '
- unless $error || $JSON::VERSION >= 2; #broken JSON 1 workaround
-
- } #unless ($res->code eq '200')
-
- } #unless ($viewstate)
-
- } #unless ($res->code eq '200')
-
- $error = "FFIEC Geocoding error: $error" if $error;
- $return->{'error'} = $error;
-
- $return;
-
-}
-
-</%init>
diff --git a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
deleted file mode 100644
index 71e2da5..0000000
--- a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
+++ /dev/null
@@ -1,24 +0,0 @@
-% if ( $sub eq 'discount_terms' ) {
-%
-% my $return = [];
-% my $custnum = $cgi->param('arg');
-% my $cust_main = '';
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'custnum' => $custnum },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
-%
-% if ($cust_main) {
-% $return = [ map [ $_, "$_ months" ], $cust_main->discount_terms ];
-% }
-%
-<% objToJson($return) %>
-% }
-<%init>
-
-my $conf = new FS::Conf;
-
-my $sub = $cgi->param('sub');
-
-</%init>
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi
deleted file mode 100644
index 481bea2..0000000
--- a/httemplate/misc/xmlhttp-cust_main-search.cgi
+++ /dev/null
@@ -1,38 +0,0 @@
-% if ( $sub eq 'custnum_search' ) {
-%
-% my $custnum = $cgi->param('arg');
-% my $cust_main = '';
-% if ( $custnum =~ /^(\d+)$/ and $1 <= 2147483647 ) {
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'custnum' => $1 },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
-% }
-% if ( ! $cust_main ) {
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'agent_custid' => $custnum },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
-% }
-%
-"<% $cust_main ? $cust_main->name : '' %>"
-%
-% } elsif ( $sub eq 'smart_search' ) {
-%
-% my $string = $cgi->param('arg');
-% my @cust_main = smart_search( 'search' => $string,
-% 'no_fuzzy_on_exact' => 1, #pref?
-% );
-% my $return = [ map [ $_->custnum, $_->name ], @cust_main ];
-%
-<% objToJson($return) %>
-% }
-<%init>
-
-my $conf = new FS::Conf;
-
-my $sub = $cgi->param('sub');
-
-</%init>
diff --git a/httemplate/misc/xmlhttp-ping.html b/httemplate/misc/xmlhttp-ping.html
deleted file mode 100644
index e993032..0000000
--- a/httemplate/misc/xmlhttp-ping.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<% objToJson($return) %>
-<%init>
-
-my $conf = new FS::Conf;
-
-my $sub = $cgi->param('sub');
-
-die "$sub not supported" unless $sub eq 'ping';
-
-my $ip = $cgi->param('arg');
-
-my $ping = new Net::Ping('external', 5);
-$ping->hires(1);
-#my $a=time; warn "pinging\n";
-my ($ret, $duration, $ip2) = $ping->ping($ip);
-#warn "done pinging (". int(time-$a). "s)\n";
-
-my $return = [ $ret, $duration ];
-
-</%init>
diff --git a/httemplate/misc/xmlrpc.cgi b/httemplate/misc/xmlrpc.cgi
deleted file mode 100644
index 14bf9ef..0000000
--- a/httemplate/misc/xmlrpc.cgi
+++ /dev/null
@@ -1,16 +0,0 @@
-<% $response_xml %>\
-<%init>
-
-my $request_xml = $cgi->param('POSTDATA');
-
-#warn $request_xml;
-
-my $fsxmlrpc = new FS::XMLRPC;
-my ($error, $response_xml) = $fsxmlrpc->serve($request_xml);
-
-#warn $error;
-
-http_header('Content-Type' => 'text/xml',
- 'Content-Length' => length($response_xml));
-
-</%init>