From 160be29a0dc62e79a4fb95d2ab8c0c7e5996760e Mon Sep 17 00:00:00 2001 From: cvs2git Date: Mon, 12 Aug 2002 06:17:10 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'BESTPRACTICAL'. --- httemplate/.htaccess | 3 - httemplate/browse/agent.cgi | 63 -- httemplate/browse/agent_type.cgi | 58 -- httemplate/browse/cust_main_county.cgi | 127 ---- httemplate/browse/cust_pay_batch.cgi | 52 -- httemplate/browse/msgcat.cgi | 50 -- httemplate/browse/nas.cgi | 80 --- httemplate/browse/part_bill_event.cgi | 71 --- httemplate/browse/part_export.cgi | 39 -- httemplate/browse/part_pkg.cgi | 102 ---- httemplate/browse/part_referral.cgi | 38 -- httemplate/browse/part_svc.cgi | 107 ---- httemplate/browse/queue.cgi | 7 - httemplate/browse/svc_acct_pop.cgi | 53 -- httemplate/config/config-process.cgi | 51 -- httemplate/config/config-view.cgi | 64 -- httemplate/config/config.cgi | 176 ------ httemplate/docs/admin.html | 81 --- httemplate/docs/billing.html | 54 -- httemplate/docs/config.html | 36 -- httemplate/docs/export.html | 55 -- httemplate/docs/index.html | 30 - httemplate/docs/install.html | 198 ------- httemplate/docs/legacy.html | 38 -- httemplate/docs/overview.dia | Bin 2800 -> 0 bytes httemplate/docs/overview.png | Bin 13064 -> 0 bytes httemplate/docs/passwd.html | 23 - httemplate/docs/schema.dia | Bin 14414 -> 0 bytes httemplate/docs/schema.html | 424 ------------- httemplate/docs/schema.png | Bin 681043 -> 0 bytes httemplate/docs/session.html | 54 -- httemplate/docs/signup.html | 56 -- httemplate/docs/ssh.html | 15 - httemplate/docs/trouble.html | 26 - httemplate/docs/upgrade4.html | 27 - httemplate/docs/upgrade5.html | 34 -- httemplate/docs/upgrade6.html | 66 --- httemplate/docs/upgrade7.html | 24 - httemplate/docs/upgrade8.html | 392 ------------ httemplate/edit/REAL_cust_pkg.cgi | 89 --- httemplate/edit/agent.cgi | 74 --- httemplate/edit/agent_type.cgi | 63 -- httemplate/edit/cust_bill_pay.cgi | 95 --- httemplate/edit/cust_credit.cgi | 63 -- httemplate/edit/cust_credit_bill.cgi | 101 ---- httemplate/edit/cust_main.cgi | 460 -------------- httemplate/edit/cust_main_county-expand.cgi | 54 -- httemplate/edit/cust_main_county.cgi | 66 --- httemplate/edit/cust_pay.cgi | 129 ---- httemplate/edit/cust_pkg.cgi | 117 ---- httemplate/edit/msgcat.cgi | 58 -- httemplate/edit/part_bill_event.cgi | 192 ------ httemplate/edit/part_export.cgi | 117 ---- httemplate/edit/part_pkg.cgi | 464 --------------- httemplate/edit/part_referral.cgi | 48 -- httemplate/edit/part_svc.cgi | 232 -------- httemplate/edit/process/REAL_cust_pkg.cgi | 20 - httemplate/edit/process/agent.cgi | 28 - httemplate/edit/process/agent_type.cgi | 55 -- httemplate/edit/process/cust_bill_pay.cgi | 31 - httemplate/edit/process/cust_credit.cgi | 30 - httemplate/edit/process/cust_credit_bill.cgi | 43 -- httemplate/edit/process/cust_main.cgi | 119 ---- .../edit/process/cust_main_county-collapse.cgi | 35 -- .../edit/process/cust_main_county-expand.cgi | 58 -- httemplate/edit/process/cust_main_county.cgi | 25 - httemplate/edit/process/cust_pay.cgi | 39 -- httemplate/edit/process/cust_pkg.cgi | 36 -- httemplate/edit/process/domain_record.cgi | 34 -- httemplate/edit/process/msgcat.cgi | 20 - httemplate/edit/process/part_bill_event.cgi | 53 -- httemplate/edit/process/part_export.cgi | 39 -- httemplate/edit/process/part_pkg.cgi | 109 ---- httemplate/edit/process/part_referral.cgi | 28 - httemplate/edit/process/part_svc.cgi | 62 -- httemplate/edit/process/quick-charge.cgi | 32 - httemplate/edit/process/quick-cust_pkg.cgi | 24 - httemplate/edit/process/svc_acct.cgi | 49 -- httemplate/edit/process/svc_acct_pop.cgi | 28 - httemplate/edit/process/svc_acct_sm.cgi | 34 -- httemplate/edit/process/svc_domain.cgi | 31 - httemplate/edit/process/svc_forward.cgi | 29 - httemplate/edit/process/svc_www.cgi | 36 -- httemplate/edit/svc_acct.cgi | 278 --------- httemplate/edit/svc_acct_pop.cgi | 56 -- httemplate/edit/svc_acct_sm.cgi | 178 ------ httemplate/edit/svc_domain.cgi | 98 --- httemplate/edit/svc_forward.cgi | 176 ------ httemplate/edit/svc_www.cgi | 178 ------ httemplate/images/mid-logo.png | Bin 9727 -> 0 bytes httemplate/images/small-logo.png | Bin 4781 -> 0 bytes httemplate/index.html | 210 ------- httemplate/misc/bill.cgi | 37 -- httemplate/misc/cancel-unaudited.cgi | 31 - httemplate/misc/cancel_pkg.cgi | 15 - httemplate/misc/catchall.cgi | 133 ----- httemplate/misc/delete-cust_pay.cgi | 16 - httemplate/misc/delete-customer.cgi | 60 -- httemplate/misc/delete-domain_record.cgi | 15 - httemplate/misc/delete-part_export.cgi | 15 - httemplate/misc/expire_pkg.cgi | 25 - httemplate/misc/link.cgi | 46 -- httemplate/misc/print-invoice.cgi | 23 - httemplate/misc/process/catchall.cgi | 33 -- httemplate/misc/process/delete-customer.cgi | 29 - httemplate/misc/process/link.cgi | 40 -- httemplate/misc/queue.cgi | 47 -- httemplate/misc/susp_pkg.cgi | 15 - httemplate/misc/unsusp_pkg.cgi | 15 - httemplate/search/cust_bill.cgi | 165 ------ httemplate/search/cust_bill.html | 19 - httemplate/search/cust_bill_event.cgi | 62 -- httemplate/search/cust_bill_event.html | 23 - httemplate/search/cust_main-otaker.cgi | 29 - httemplate/search/cust_main-payinfo.html | 20 - httemplate/search/cust_main-quickpay.html | 43 -- httemplate/search/cust_main.cgi | 659 --------------------- httemplate/search/cust_main.html | 42 -- httemplate/search/cust_pay.cgi | 103 ---- httemplate/search/cust_pay.html | 18 - httemplate/search/cust_pkg.cgi | 319 ---------- httemplate/search/cust_pkg.html | 24 - httemplate/search/report_cc.cgi | 25 - httemplate/search/report_cc.html | 23 - httemplate/search/report_credit.cgi | 25 - httemplate/search/report_credit.html | 23 - httemplate/search/report_receivables.cgi | 19 - httemplate/search/report_tax.cgi | 25 - httemplate/search/report_tax.html | 23 - httemplate/search/sql.cgi | 76 --- httemplate/search/svc_acct.cgi | 294 --------- httemplate/search/svc_acct.html | 19 - httemplate/search/svc_acct_sm.cgi | 84 --- httemplate/search/svc_acct_sm.html | 23 - httemplate/search/svc_domain.cgi | 163 ----- httemplate/search/svc_domain.html | 19 - httemplate/view/cust_bill.cgi | 48 -- httemplate/view/cust_main.cgi | 653 -------------------- httemplate/view/cust_pkg.cgi | 157 ----- httemplate/view/svc_acct.cgi | 156 ----- httemplate/view/svc_acct_sm.cgi | 58 -- httemplate/view/svc_domain.cgi | 106 ---- httemplate/view/svc_forward.cgi | 69 --- httemplate/view/svc_www.cgi | 59 -- 144 files changed, 11765 deletions(-) delete mode 100755 httemplate/.htaccess delete mode 100755 httemplate/browse/agent.cgi delete mode 100755 httemplate/browse/agent_type.cgi delete mode 100755 httemplate/browse/cust_main_county.cgi delete mode 100755 httemplate/browse/cust_pay_batch.cgi delete mode 100755 httemplate/browse/msgcat.cgi delete mode 100755 httemplate/browse/nas.cgi delete mode 100755 httemplate/browse/part_bill_event.cgi delete mode 100755 httemplate/browse/part_export.cgi delete mode 100755 httemplate/browse/part_pkg.cgi delete mode 100755 httemplate/browse/part_referral.cgi delete mode 100755 httemplate/browse/part_svc.cgi delete mode 100755 httemplate/browse/queue.cgi delete mode 100755 httemplate/browse/svc_acct_pop.cgi delete mode 100644 httemplate/config/config-process.cgi delete mode 100644 httemplate/config/config-view.cgi delete mode 100644 httemplate/config/config.cgi delete mode 100755 httemplate/docs/admin.html delete mode 100644 httemplate/docs/billing.html delete mode 100644 httemplate/docs/config.html delete mode 100755 httemplate/docs/export.html delete mode 100644 httemplate/docs/index.html delete mode 100644 httemplate/docs/install.html delete mode 100755 httemplate/docs/legacy.html delete mode 100644 httemplate/docs/overview.dia delete mode 100644 httemplate/docs/overview.png delete mode 100755 httemplate/docs/passwd.html delete mode 100644 httemplate/docs/schema.dia delete mode 100644 httemplate/docs/schema.html delete mode 100644 httemplate/docs/schema.png delete mode 100644 httemplate/docs/session.html delete mode 100644 httemplate/docs/signup.html delete mode 100755 httemplate/docs/ssh.html delete mode 100755 httemplate/docs/trouble.html delete mode 100644 httemplate/docs/upgrade4.html delete mode 100644 httemplate/docs/upgrade5.html delete mode 100644 httemplate/docs/upgrade6.html delete mode 100644 httemplate/docs/upgrade7.html delete mode 100644 httemplate/docs/upgrade8.html delete mode 100755 httemplate/edit/REAL_cust_pkg.cgi delete mode 100755 httemplate/edit/agent.cgi delete mode 100755 httemplate/edit/agent_type.cgi delete mode 100755 httemplate/edit/cust_bill_pay.cgi delete mode 100755 httemplate/edit/cust_credit.cgi delete mode 100755 httemplate/edit/cust_credit_bill.cgi delete mode 100755 httemplate/edit/cust_main.cgi delete mode 100755 httemplate/edit/cust_main_county-expand.cgi delete mode 100755 httemplate/edit/cust_main_county.cgi delete mode 100755 httemplate/edit/cust_pay.cgi delete mode 100755 httemplate/edit/cust_pkg.cgi delete mode 100755 httemplate/edit/msgcat.cgi delete mode 100755 httemplate/edit/part_bill_event.cgi delete mode 100644 httemplate/edit/part_export.cgi delete mode 100755 httemplate/edit/part_pkg.cgi delete mode 100755 httemplate/edit/part_referral.cgi delete mode 100755 httemplate/edit/part_svc.cgi delete mode 100755 httemplate/edit/process/REAL_cust_pkg.cgi delete mode 100755 httemplate/edit/process/agent.cgi delete mode 100755 httemplate/edit/process/agent_type.cgi delete mode 100755 httemplate/edit/process/cust_bill_pay.cgi delete mode 100755 httemplate/edit/process/cust_credit.cgi delete mode 100755 httemplate/edit/process/cust_credit_bill.cgi delete mode 100755 httemplate/edit/process/cust_main.cgi delete mode 100755 httemplate/edit/process/cust_main_county-collapse.cgi delete mode 100755 httemplate/edit/process/cust_main_county-expand.cgi delete mode 100755 httemplate/edit/process/cust_main_county.cgi delete mode 100755 httemplate/edit/process/cust_pay.cgi delete mode 100755 httemplate/edit/process/cust_pkg.cgi delete mode 100755 httemplate/edit/process/domain_record.cgi delete mode 100644 httemplate/edit/process/msgcat.cgi delete mode 100755 httemplate/edit/process/part_bill_event.cgi delete mode 100644 httemplate/edit/process/part_export.cgi delete mode 100755 httemplate/edit/process/part_pkg.cgi delete mode 100755 httemplate/edit/process/part_referral.cgi delete mode 100755 httemplate/edit/process/part_svc.cgi delete mode 100644 httemplate/edit/process/quick-charge.cgi delete mode 100644 httemplate/edit/process/quick-cust_pkg.cgi delete mode 100755 httemplate/edit/process/svc_acct.cgi delete mode 100755 httemplate/edit/process/svc_acct_pop.cgi delete mode 100755 httemplate/edit/process/svc_acct_sm.cgi delete mode 100755 httemplate/edit/process/svc_domain.cgi delete mode 100755 httemplate/edit/process/svc_forward.cgi delete mode 100644 httemplate/edit/process/svc_www.cgi delete mode 100755 httemplate/edit/svc_acct.cgi delete mode 100755 httemplate/edit/svc_acct_pop.cgi delete mode 100755 httemplate/edit/svc_acct_sm.cgi delete mode 100755 httemplate/edit/svc_domain.cgi delete mode 100755 httemplate/edit/svc_forward.cgi delete mode 100644 httemplate/edit/svc_www.cgi delete mode 100644 httemplate/images/mid-logo.png delete mode 100644 httemplate/images/small-logo.png delete mode 100644 httemplate/index.html delete mode 100755 httemplate/misc/bill.cgi delete mode 100755 httemplate/misc/cancel-unaudited.cgi delete mode 100755 httemplate/misc/cancel_pkg.cgi delete mode 100755 httemplate/misc/catchall.cgi delete mode 100755 httemplate/misc/delete-cust_pay.cgi delete mode 100755 httemplate/misc/delete-customer.cgi delete mode 100755 httemplate/misc/delete-domain_record.cgi delete mode 100755 httemplate/misc/delete-part_export.cgi delete mode 100755 httemplate/misc/expire_pkg.cgi delete mode 100755 httemplate/misc/link.cgi delete mode 100755 httemplate/misc/print-invoice.cgi delete mode 100755 httemplate/misc/process/catchall.cgi delete mode 100755 httemplate/misc/process/delete-customer.cgi delete mode 100755 httemplate/misc/process/link.cgi delete mode 100644 httemplate/misc/queue.cgi delete mode 100755 httemplate/misc/susp_pkg.cgi delete mode 100755 httemplate/misc/unsusp_pkg.cgi delete mode 100755 httemplate/search/cust_bill.cgi delete mode 100755 httemplate/search/cust_bill.html delete mode 100644 httemplate/search/cust_bill_event.cgi delete mode 100755 httemplate/search/cust_bill_event.html delete mode 100755 httemplate/search/cust_main-otaker.cgi delete mode 100755 httemplate/search/cust_main-payinfo.html delete mode 100755 httemplate/search/cust_main-quickpay.html delete mode 100755 httemplate/search/cust_main.cgi delete mode 100755 httemplate/search/cust_main.html delete mode 100755 httemplate/search/cust_pay.cgi delete mode 100755 httemplate/search/cust_pay.html delete mode 100755 httemplate/search/cust_pkg.cgi delete mode 100755 httemplate/search/cust_pkg.html delete mode 100755 httemplate/search/report_cc.cgi delete mode 100755 httemplate/search/report_cc.html delete mode 100755 httemplate/search/report_credit.cgi delete mode 100755 httemplate/search/report_credit.html delete mode 100755 httemplate/search/report_receivables.cgi delete mode 100755 httemplate/search/report_tax.cgi delete mode 100755 httemplate/search/report_tax.html delete mode 100755 httemplate/search/sql.cgi delete mode 100755 httemplate/search/svc_acct.cgi delete mode 100755 httemplate/search/svc_acct.html delete mode 100755 httemplate/search/svc_acct_sm.cgi delete mode 100755 httemplate/search/svc_acct_sm.html delete mode 100755 httemplate/search/svc_domain.cgi delete mode 100755 httemplate/search/svc_domain.html delete mode 100755 httemplate/view/cust_bill.cgi delete mode 100755 httemplate/view/cust_main.cgi delete mode 100755 httemplate/view/cust_pkg.cgi delete mode 100755 httemplate/view/svc_acct.cgi delete mode 100755 httemplate/view/svc_acct_sm.cgi delete mode 100755 httemplate/view/svc_domain.cgi delete mode 100755 httemplate/view/svc_forward.cgi delete mode 100644 httemplate/view/svc_www.cgi (limited to 'httemplate') diff --git a/httemplate/.htaccess b/httemplate/.htaccess deleted file mode 100755 index f8c6b9c0c..000000000 --- a/httemplate/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ -AuthName Freeside -AuthType Basic -require valid-user diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi deleted file mode 100755 index cff111ca4..000000000 --- a/httemplate/browse/agent.cgi +++ /dev/null @@ -1,63 +0,0 @@ - -<% -#Begin silliness -# -#use FS::UI::CGI; -#use FS::UI::agent; -# -#$ui = new FS::UI::agent; -#$ui->browse; -#exit; -#__END__ -#End silliness -%> - -<%= header('Agent Listing', menubar( - 'Main Menu' => $p, - 'Agent Types' => $p. 'browse/agent_type.cgi', -# 'Add new agent' => '../edit/agent.cgi' -)) %> -Agents are resellers of your service. Agents may be limited to a subset of your -full offerings (via their type).

-Add a new agent

- -<%= table() %> - - Agent - Type - Freq. - Prog. - -<% -# Agent # -# Agent - -foreach my $agent ( sort { - #$a->getfield('agentnum') <=> $b->getfield('agentnum') - $a->getfield('agent') cmp $b->getfield('agent') -} qsearch('agent',{}) ) { - my($hashref)=$agent->hashref; - my($typenum)=$hashref->{typenum}; - my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum}); - my($atype)=$agent_type->getfield('atype'); - print < - - $hashref->{agentnum} - - $hashref->{agent} - $atype - $hashref->{freq} - $hashref->{prog} - -END - -} - -print < - - -END - -%> diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi deleted file mode 100755 index 5a8438589..000000000 --- a/httemplate/browse/agent_type.cgi +++ /dev/null @@ -1,58 +0,0 @@ - -<%= header("Agent Type Listing", menubar( - 'Main Menu' => $p, - 'Agents' => $p. 'browse/agent.cgi', -)) %> -Agent types define groups of packages that you can then assign to particular -agents.

-Add a new agent type

- -<%= table() %> - - Agent Type - Packages - - -<% -foreach my $agent_type ( sort { - $a->getfield('typenum') <=> $b->getfield('typenum') -} qsearch('agent_type',{}) ) { - my($hashref)=$agent_type->hashref; - my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} }); - my($rowspan)=scalar(@type_pkgs); - $rowspan = int($rowspan/2+0.5) ; - print < - - $hashref->{typenum} - - $hashref->{atype} -END - - my($type_pkgs); - my($tdcount) = -1 ; - foreach $type_pkgs ( @type_pkgs ) { - my($pkgpart)=$type_pkgs->getfield('pkgpart'); - my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart }); - print qq!! if ($tdcount == 0) ; - $tdcount = 0 if ($tdcount == -1) ; - print qq!!, - $part_pkg->getfield('pkg'),""; - $tdcount ++ ; - if ($tdcount == 2) - { - print qq!\n! ; - $tdcount = 0 ; - } - } - - print ""; -} - -print < - - -END - -%> diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi deleted file mode 100755 index 991606087..000000000 --- a/httemplate/browse/cust_main_county.cgi +++ /dev/null @@ -1,127 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $enable_taxclasses = $conf->exists('enable_taxclasses'); - -print header("Tax Rate Listing", menubar( - 'Main Menu' => $p, - 'Edit tax rates' => $p. "edit/cust_main_county.cgi", -)),<expand country to specify a country's tax rates by state. -
Click on expand state to specify a state's tax rates by county. -END - -if ( $enable_taxclasses ) { - print '
Click on expand taxclasses to specify tax classes'; -} - -print '

'. &table(). < - Country - State - County - Taxclass - Tax - Exempt
per
month - -END - -my @regions = sort { $a->country cmp $b->country - or $a->state cmp $b->state - or $a->county cmp $b->county - or $a->taxclass cmp $b->taxclass - } qsearch('cust_main_county',{}); - -my $sup=0; -#foreach $cust_main_county ( @regions ) { -for ( my $i=0; $i<@regions; $i++ ) { - my $cust_main_county = $regions[$i]; - my $hashref = $cust_main_county->hashref; - print < - $hashref->{country} -END - - my $j; - if ( $sup ) { - $sup--; - } else { - - #lookahead - for ( $j=1; $i+$j<@regions; $j++ ) { - last if $hashref->{country} ne $regions[$i+$j]->country - || $hashref->{state} ne $regions[$i+$j]->state - || $hashref->{tax} != $regions[$i+$j]->tax - || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount; - } - - my $newsup=0; - if ( $j>1 && $i+$j+1 < @regions - && ( $hashref->{state} ne $regions[$i+$j+1]->state - || $hashref->{country} ne $regions[$i+$j+1]->country - ) - && ( ! $i - || $hashref->{state} ne $regions[$i-1]->state - || $hashref->{country} ne $regions[$i-1]->country - ) - ) { - $sup = $j-1; - } else { - $j = 1; - } - - print "{state} - ? ' BGCOLOR="#ffffff">'. $hashref->{state} - : qq! BGCOLOR="#cccccc">(ALL) !. - qq!expand country!; - - print qq! collapse state! if $j>1; - - print ""; - } - -# $sup=$newsup; - - print "{county} ) { - print ' BGCOLOR="#ffffff">'. $hashref->{county}; - } else { - print ' BGCOLOR="#cccccc">(ALL)'; - if ( $hashref->{state} ) { - print qq!!. - qq!expand state!; - } - } - print ""; - - print "{taxclass} ) { - print ' BGCOLOR="#ffffff">'. $hashref->{taxclass}; - } else { - print ' BGCOLOR="#cccccc">(ALL)'; - if ( $enable_taxclasses ) { - print qq!!. - qq!expand taxclasses!; - } - - } - print ""; - - print "$hashref->{tax}%". - '$'. - sprintf("%.2f", $hashref->{exempt_amount} || 0). ''. - ''; - -} - -print < - - -END - -%> diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi deleted file mode 100755 index 608a58d0d..000000000 --- a/httemplate/browse/cust_pay_batch.cgi +++ /dev/null @@ -1,52 +0,0 @@ - -<% - -print header("Pending credit card batch", menubar( - 'Main Menu' => $p, -# 'Add new referral' => "../edit/part_referral.cgi", -)), &table(), < - # - inv# - Customer - Card name - Card - Exp - Amount - -END - -foreach my $cust_pay_batch ( sort { - $a->getfield('paybatchnum') <=> $b->getfield('paybatchnum') -} qsearch('cust_pay_batch',{}) ) { -# my $date = time2str( "%a %b %e %T %Y", $queue->_date ); -# my $status = $hashref->{status}; -# if ( $status eq 'failed' || $status eq 'locked' ) { -# $status .= -# qq! ( retry |!. -# qq! remove )!; -# } - my $cardnum = $cust_pay_batch->{cardnum}; - $cardnum =~ s/.{4}$/xxxx/; - print < - $cust_pay_batch->{paybatchnum} - $cust_pay_batch->{invnum} - $cust_pay_batch->{custnum} - $cust_pay_batch->{last}, $cust_pay_batch->{last} - $cust_pay_batch->{payname} - $cardnum - $cust_pay_batch->{exp} - \$$cust_pay_batch->{amount} - -END - -} - -print < - - -END - -%> diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi deleted file mode 100755 index d4adf9f1a..000000000 --- a/httemplate/browse/msgcat.cgi +++ /dev/null @@ -1,50 +0,0 @@ - -<% - -print header("View Message catalog", menubar( - 'Main Menu' => $p, - 'Edit message catalog' => $p. "edit/msgcat.cgi", -)), '
'; - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => 'en_US', - 'options' => { 'en_US'=>'en_US' }, - 'layer_callback' => sub { - my $layer = shift; - my $html = "
Messages for locale $layer
". table(). - "Code". - "Message"; - $html .= "en_US Message" unless $layer eq 'en_US'; - $html .= ''; - - #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } - # qsearch('msgcat', { 'locale' => $layer } ) ) { - foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { - $html .= ''. $msgcat->msgnum. ''. - ''. $msgcat->msgcode. ''. - ''. $msgcat->msg. ''; - unless ( $layer eq 'en_US' ) { - my $en_msgcat = qsearchs('msgcat', { - 'locale' => 'en_US', - 'msgcode' => $msgcat->msgcode, - } ); - $html .= ''. $en_msgcat->msg. ''; - } - $html .= ''; - } - - $html .= ''; - $html; - }, - -); - -print $widget->html; - -print < - - -END - -%> diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi deleted file mode 100755 index 9ccbfe632..000000000 --- a/httemplate/browse/nas.cgi +++ /dev/null @@ -1,80 +0,0 @@ - -<% - -print header('NAS ports', menubar( - 'Main Menu' => $p, -)); - -my $now = time; - -foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) { - print $nas->nasnum. ": ". $nas->nas. " ". - $nas->nasfqdn. " (". $nas->nasip. ") ". - "as of ". time2str("%c",$nas->last). - " (". &pretty_interval($now - $nas->last). " ago)
". - &table(). "Nas
Port #Global
Port #
". - "IP addressUserSinceDuration", - ; - foreach my $port ( sort { - $a->nasport <=> $b->nasport || $a->portnum <=> $b->portnum - } qsearch( 'port', { 'nasnum' => $nas->nasnum } ) ) { - my $session = $port->session; - my($user, $since, $pretty_since, $duration); - if ( ! $session ) { - $user = "(empty)"; - $since = 0; - $pretty_since = "(never)"; - $duration = ''; - } elsif ( $session->logout ) { - $user = "(empty)"; - $since = $session->logout; - } else { - my $svc_acct = $session->svc_acct; - $user = "
svcnum. "\">". - $svc_acct->username. ""; - $since = $session->login; - } - $pretty_since = time2str("%c", $since) if $since; - $duration = pretty_interval( $now - $since ). " ago" - unless defined($duration); - print "". $port->nasport. "". $port->portnum. "". - $port->ip. "$user$pretty_since". - "$duration" - ; - } - print "
"; -} - -#Time::Duration?? -sub pretty_interval { - my $interval = shift; - my %howlong = ( - '604800' => 'week', - '86400' => 'day', - '3600' => 'hour', - '60' => 'minute', - '1' => 'second', - ); - - my $pretty = ""; - foreach my $key ( sort { $b <=> $a } keys %howlong ) { - my $value = int( $interval / $key ); - if ( $value ) { - if ( $value == 1 ) { - $pretty .= - ( $howlong{$key} eq 'hour' ? 'an ' : 'a ' ). $howlong{$key}. " " - } else { - $pretty .= $value. ' '. $howlong{$key}. 's '; - } - } - $interval -= $value * $key; - } - $pretty =~ /^\s*(\S.*\S)\s*$/; - $1; -} - -#print &table(), < -# # -# NAS diff --git a/httemplate/browse/part_bill_event.cgi b/httemplate/browse/part_bill_event.cgi deleted file mode 100755 index 670474d48..000000000 --- a/httemplate/browse/part_bill_event.cgi +++ /dev/null @@ -1,71 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_bill_event = qsearch('part_bill_event', \%search ); -my $total = scalar(@part_bill_event); - -%> -<%= header('Invoice Event Listing', menubar( 'Main Menu' => $p) ) %> - - Invoice events are actions taken on overdue invoices.

-Add a new invoice event -

-<%= $total %> events -<%= $cgi->param('showdisabled') - ? do { $cgi->param('showdisabled', 0); - '( hide disabled events )'; } - : do { $cgi->param('showdisabled', 1); - '( show disabled events )'; } -%> -<%= table() %> - - param('showdisabled') ? 2 : 3 %>>Event - Payby - After - Action - Options - Code - - -<% foreach my $part_bill_event ( sort { $a->payby cmp $b->payby - || $a->seconds <=> $b->seconds - || $a->weight <=> $b->weight - || $a->eventpart <=> $b->eventpart - } @part_bill_event ) { - my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart; - use Time::Duration; - my $delay = duration_exact($part_bill_event->seconds); - my $plandata = $part_bill_event->plandata; - $plandata =~ s/\n/
/go; -%> - - - <%= $part_bill_event->eventpart %> -<% unless ( $cgi->param('showdisabled') ) { %> - - <%= $part_bill_event->disabled ? 'DISABLED' : '' %> -<% } %> - - <%= $part_bill_event->event %> - - <%= $part_bill_event->payby %> - - <%= $delay %> - - <%= $part_bill_event->plan %> - - <%= $plandata %> - - <%= $part_bill_event->eventcode %> - -<% } %> - - - diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi deleted file mode 100755 index 76662e0c9..000000000 --- a/httemplate/browse/part_export.cgi +++ /dev/null @@ -1,39 +0,0 @@ - -<%= header("Export Listing", menubar( 'Main Menu' => "$p#sysadmin" )) %> -Provisioning services to external machines, databases and APIs.

-Add a new export

- - -<%= table() %> - - Export - Options - - -<% foreach my $part_export ( sort { - $a->getfield('exportnum') <=> $b->getfield('exportnum') - } qsearch('part_export',{}) ) { -%> - - <%= $part_export->exportnum %> - <%= $part_export->exporttype %> to <%= $part_export->machine %> (edit | delete) - - <%= itable() %> - <% my %opt = $part_export->options; - foreach my $opt ( keys %opt ) { %> - <%= $opt %><%= $opt{$opt} %> - <% } %> - - - - -<% } %> - - - - diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi deleted file mode 100755 index 58422c67d..000000000 --- a/httemplate/browse/part_pkg.cgi +++ /dev/null @@ -1,102 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_pkg = qsearch('part_pkg', \%search ); -my $total = scalar(@part_pkg); - -%> -<%= header("Package Definition Listing",menubar( 'Main Menu' => $p )) %> -One or more services are grouped together into a package and given pricing -information. Customers purchase packages rather than purchase services -directly.

-Add a new package definition -

- -<%= $total %> packages -<% -if ( $cgi->param('showdisabled') ) { - $cgi->param('showdisabled', 0); - print qq!( hide disabled packages )!; -} else { - $cgi->param('showdisabled', 1); - print qq!( show disabled packages )!; -} - -my $colspan = $cgi->param('showdisabled') ? 2 : 3; -print &table(), < - Package - Comment - Freq. - Plan - Data - Service - Quan. - -END - -foreach my $part_pkg ( sort { - $a->getfield('pkgpart') <=> $b->getfield('pkgpart') -} @part_pkg ) { - my($hashref)=$part_pkg->hashref; - my(@pkg_svc)=grep $_->getfield('quantity'), - qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); - my($rowspan)=scalar(@pkg_svc); - my $plandata; - if ( $hashref->{plan} ) { - $plandata = $hashref->{plandata}; - $plandata =~ s/^(\w+)=/$1 /mg; - $plandata =~ s/\n/
/g; - } else { - $hashref->{plan} = "(legacy)"; - $plandata = "Setup ". $hashref->{setup}. - "
Recur ". $hashref->{recur}; - } - print < - $hashref->{pkgpart} -END - - unless ( $cgi->param('showdisabled') ) { - print ""; - print "DISABLED" if $hashref->{disabled}; - print ''; - } - - print <$hashref->{pkg} - $hashref->{comment} - $hashref->{freq} - $hashref->{plan} - $plandata -END - - my($pkg_svc); - my($n)=""; - foreach $pkg_svc ( @pkg_svc ) { - my($svcpart)=$pkg_svc->getfield('svcpart'); - my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); - print $n,qq!!, - $part_svc->getfield('svc'),"", - $pkg_svc->getfield('quantity'),"\n"; - $n=""; - } - - print ""; -} - -$colspan = $cgi->param('showdisabled') ? 8 : 9; -print < - - -END -%> diff --git a/httemplate/browse/part_referral.cgi b/httemplate/browse/part_referral.cgi deleted file mode 100755 index 084c21bd0..000000000 --- a/httemplate/browse/part_referral.cgi +++ /dev/null @@ -1,38 +0,0 @@ - -<%= header("Advertising source Listing", menubar( - 'Main Menu' => $p, -# 'Add new referral' => "../edit/part_referral.cgi", -)) %> -Where a customer heard about your service. Tracked for informational purposes. -

-Add a new advertising source -

- -<%= table() %> - - Advertising source - - -<% -foreach my $part_referral ( sort { - $a->getfield('refnum') <=> $b->getfield('refnum') -} qsearch('part_referral',{}) ) { - my($hashref)=$part_referral->hashref; - print < - - $hashref->{refnum} - - $hashref->{referral} - -END - -} - -print < - - -END - -%> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi deleted file mode 100755 index 9fb359d1d..000000000 --- a/httemplate/browse/part_svc.cgi +++ /dev/null @@ -1,107 +0,0 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_svc = - sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') } - qsearch('part_svc', \%search ); -my $total = scalar(@part_svc); - -%> -<%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %> - - - - Services are items you offer to your customers.

- -
Add a new service definition or  -

- -<%= $total %> services -<%= $cgi->param('showdisabled') - ? do { $cgi->param('showdisabled', 0); - '( hide disabled services )'; } - : do { $cgi->param('showdisabled', 1); - '( show disabled services )'; } -%> -<%= table() %> - - param('showdisabled') ? 2 : 3 %>>Service - Table - Export - Field - Modifier - - -<% foreach my $part_svc ( @part_svc ) { - my $hashref = $part_svc->hashref; - my $svcdb = $hashref->{svcdb}; - my @dfields = fields($svcdb); - push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge - my @fields = - grep { $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag } - @dfields; - - my $rowspan = scalar(@fields) || 1; - my $url = "${p}edit/part_svc.cgi?$hashref->{svcpart}"; -%> - - - > - <%= $hashref->{svcpart} %> -<% unless ( $cgi->param('showdisabled') ) { %> - > - <%= $hashref->{disabled} ? 'DISABLED' : '' %> -<% } %> - > - <%= $hashref->{svc} %> - > - <%= $hashref->{svcdb} %> - ><%= itable() %> -<% -# my @part_export = -map { qsearchs('part_export', { exportnum => $_->exportnum } ) } qsearch('export_svc', { svcpart => $part_svc->svcpart } ) ; - foreach my $part_export ( - map { qsearchs('part_export', { exportnum => $_->exportnum } ) } - qsearch('export_svc', { svcpart => $part_svc->svcpart } ) - ) { -%> - - <%= $part_export->exporttype %> to <%= $part_export->machine %> -<% } %> - - -<% my($n1)=''; - foreach my $field ( @fields ) { - my $flag = $part_svc->part_svc_column($field)->columnflag; -%> - <%= $n1 %><%= $field %> - -<% if ( $flag eq "D" ) { print "Default"; } - elsif ( $flag eq "F" ) { print "Fixed"; } - else { print "(Unknown!)"; } -%> - <%= $part_svc->part_svc_column($field)->columnvalue%> -<% $n1=""; - } -%> - -<% } %> - - - diff --git a/httemplate/browse/queue.cgi b/httemplate/browse/queue.cgi deleted file mode 100755 index b53c1402d..000000000 --- a/httemplate/browse/queue.cgi +++ /dev/null @@ -1,7 +0,0 @@ - -<% - -print header("Job Queue", menubar( 'Main Menu' => $p, )). - joblisting({}). ''; - -%> diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi deleted file mode 100755 index e890f07bf..000000000 --- a/httemplate/browse/svc_acct_pop.cgi +++ /dev/null @@ -1,53 +0,0 @@ - -<% - -print header('Access Number Listing', menubar( - 'Main Menu' => $p, -)) %> -Points of Presence

-Add new Access Number

-<%= table() %> - - - City - State - Area code - Exchange - Local - - -<% -foreach my $svc_acct_pop ( sort { - #$a->getfield('popnum') <=> $b->getfield('popnum') - $a->state cmp $b->state || $a->city cmp $b->city - || $a->ac <=> $b->ac || $a->exch <=> $b->exch || $a->loc <=> $b->loc -} qsearch('svc_acct_pop',{}) ) { - my($hashref)=$svc_acct_pop->hashref; - print < - - $hashref->{popnum} - - $hashref->{city} - - $hashref->{state} - - $hashref->{ac} - - $hashref->{exch} - - $hashref->{loc} - -END - -} - -print < - - - - -END - -%> diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi deleted file mode 100644 index 259713260..000000000 --- a/httemplate/config/config-process.cgi +++ /dev/null @@ -1,51 +0,0 @@ -<% - my $conf = new FS::Conf; - $FS::Conf::DEBUG = 1; - my @config_items = $conf->config_items; - - foreach my $i ( @config_items ) { - my @touch = (); - my @delete = (); - my $n = 0; - foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { - if ( $type eq '' ) { - } elsif ( $type eq 'textarea' ) { - if ( $cgi->param($i->key. $n) ne '' ) { - my $value = $cgi->param($i->key. $n); - $value =~ s/\r\n/\n/g; #browsers? - $conf->set($i->key, $value); - } else { - $conf->delete($i->key); - } - } elsif ( $type eq 'checkbox' ) { -# if ( defined($cgi->param($i->key. $n)) && $cgi->param($i->key. $n) ) { - if ( defined $cgi->param($i->key. $n) ) { - #$conf->touch($i->key); - push @touch, $i->key; - } else { - #$conf->delete($i->key); - push @delete, $i->key; - } - } elsif ( $type eq 'text' || $type eq 'select' ) { - if ( $cgi->param($i->key. $n) ne '' ) { - $conf->set($i->key, $cgi->param($i->key. $n)); - } else { - $conf->delete($i->key); - } - } elsif ( $type eq 'editlist' || $type eq 'selectmultiple' ) { - if ( scalar(@{[ $cgi->param($i->key. $n) ]}) ) { - $conf->set($i->key, join("\n", @{[ $cgi->param($i->key. $n) ]} )); - } else { - $conf->delete($i->key); - } - } else { - } - $n++; - } - # warn @touch; - $conf->touch($_) foreach @touch; - $conf->delete($_) foreach @delete; - } - -%> -<%= $cgi->redirect("config-view.cgi") %> diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi deleted file mode 100644 index bafe5a8e7..000000000 --- a/httemplate/config/config-view.cgi +++ /dev/null @@ -1,64 +0,0 @@ - -<%= header('View Configuration', menubar( 'Main Menu' => $p, - 'Edit Configuration' => 'config.cgi' ) ) %> - -<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> - -<% foreach my $section ( qw(required billing username password UI session - shell mail apache BIND - ), - '', 'deprecated') { %> - - - <% foreach my $nav_section ( qw(required billing username password UI session - shell mail apache BIND - ), - '', 'deprecated') { %> - <% if ( $section eq $nav_section ) { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } else { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } %> - <% } %> -
- <%= table("#cccccc", 2) %> - - - <%= ucfirst($section || 'unclassified') %> configuration options - - - <% foreach my $i (grep $_->section eq $section, @config_items) { %> - - - <%= $i->key %> - <%= $i->description %> - - - <% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { - my $n = 0; %> - <% if ( $type eq '' ) { %> - - <% } elsif ( $type eq 'textarea' - || $type eq 'editlist' - || $type eq 'selectmultiple' ) { %> - - <% } elsif ( $type eq 'checkbox' ) { %> - - <% } elsif ( $type eq 'text' || $type eq 'select' ) { %> - - <% } else { %> - - <% } %> - <% $n++; } %> -
no type
-
-<%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
-
-
YES' : 'ff0000">NO' %>
<%= $conf->exists($i->key) ? $conf->config($i->key) : '' %>
- unknown type <%= $type %> -
- - <% } %> -

-<% } %> - - diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi deleted file mode 100644 index fd9a82958..000000000 --- a/httemplate/config/config.cgi +++ /dev/null @@ -1,176 +0,0 @@ - -<%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %> - - -<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> - -
- -<% foreach my $section ( qw(required billing username password UI session - shell mail apache BIND - ), - '', 'deprecated') { %> - - - <% foreach my $nav_section ( qw(required billing username password UI session - shell mail apache BIND - ), - '', 'deprecated') { %> - <% if ( $section eq $nav_section ) { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } else { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } %> - <% } %> -
- <%= table("#cccccc", 2) %> - - - <%= ucfirst($section || 'unclassified') %> configuration options - - - <% foreach my $i (grep $_->section eq $section, @config_items) { %> - - - <% my $n = 0; - foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { - #warn $i->key unless defined($type); - %> - <% if ( $type eq '' ) { %> - no type - <% } elsif ( $type eq 'textarea' ) { %> - - <% } elsif ( $type eq 'checkbox' ) { %> - exists($i->key) ? ' CHECKED' : '' %>> - <% } elsif ( $type eq 'text' ) { %> - - <% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) { %> - - <% } elsif ( $type eq 'editlist' ) { %> - -
- - -
- <%= itable() %> - <% if ( defined $i->editlist_parts ) { %> - <% my $pnum=0; foreach my $part ( @{$i->editlist_parts} ) { %> - - <% if ( $part->{type} eq 'text' ) { %> - "> - <% } elsif ( $part->{type} eq 'immutable' ) { %> - <%= $part->{value} %>" value="<%= $part->{value} %>"> - <% } elsif ( $part->{type} eq 'select' ) { %> - - <% } else { %> - unknown type <%= $part->type %> - <% } %> - - <% $pnum++; } %> - <% } else { %> - - <% } %> - - - <% } else { %> - unknown type <%= $type %> - <% } %> - <% $n++; } %> - - - <%= $i->key %> - <%= $i->description %> - - - <% } %> -
- - You may need to restart Apache and/or freeside-queued for configuration - changes to take effect.
- -

- -<% } %> - -
- - diff --git a/httemplate/docs/admin.html b/httemplate/docs/admin.html deleted file mode 100755 index 50beafe78..000000000 --- a/httemplate/docs/admin.html +++ /dev/null @@ -1,81 +0,0 @@ - - Administration - - -

Administration

- -
    -
  • Open up the root of the Freeside document tree in your web - browser. For example, if you created the Freeside document tree in - /home/httpd/html/freeside, and your web browser's DocumentRoot is - /home/httpd/html, open https://your_host/freeside/. Replace - "your_host" with the name or network address of your web server. -
  • Select Configuration from the main menu and update your configuration values. -
  • Next you must create a service definition. An example of a service - definition would be a dial-up account or a domain. First, it is - necessary to create a domain definition. Click on View/Edit service - definitions and Add a new service definition with Table - svc_domain (and no modifiers). - -
  • Now that you have created your first service, you must create a package - including this service which you can sell to customers. Zero, one, or many - services are bundled into a package. Click on View/Edit package - definitions and Add a new package definition which includes - quantity 1 of the svc_domain service you created above. - -
  • After you create your first package, then you must define who is - able to sell that package by creating an agent type. An example of - an agent type would be an internal sales representitive which sells - regular and promotional packages, as opposed to an external sales - representitive which would only sell regular packages of services. Click on - View/Edit agent types and Add a new agent type. Allow this - agent type to sell the package you created above. - -
  • After creating a new agent type, you must create an agent. Click on - View/Edit agents and Add a new agent. - -
  • Set up at least one Advertising source. Advertising sources will help - you keep track of how effective your advertising is, tracking where customers - heard of your service offerings. You must create at least one advertising - source. If you do not wish to use the referral functionality, simply create - a single advertising source only. Click on View/Edit advertising - sources and Add a new advertising source. - -
  • Click on New Customer and create a new customer for your system - accounts with billing type Complimentary. - -
  • From the Customer View screen of the newly created customer, order the - package you defined above. - -
  • From the Package View screen of the newly created package, choose - (Provision) to add the customer's service for this new package. - -
  • Add your own domain. - -
  • Go back to View/Edit service definitions on the main menu, and - Add a new service definition with Table svc_acct. - Select your domain in the domsvc Modifier. Set Fixed to define - a service locked-in to this domain, or Default to define a service - which may select from among this domain and the customer's domains. - -
  • - - - -
    Create at least POP (Point of Presence) by selecting - View/Edit POPs from the main menu. OR If you are not doing dialup, set slipip to fixed and blank for all your - Service Definitions which have Table svc_acct.
    - -
  • If you are using Freeside to keep track of sales taxes, define tax - information for your locales by clicking on the View/Edit locales and tax - rates on the main menu. - -
  • If you would like Freeside to notify your customers when their credit - cards and other billing arrangements are about to expire, arrange for - freeside-expiration-alerter to be run daily by cron or similar - facility. The message it sends can be configured from the - Configuration choice of the main menu as alerter_template. - -
- - diff --git a/httemplate/docs/billing.html b/httemplate/docs/billing.html deleted file mode 100644 index c78a87f04..000000000 --- a/httemplate/docs/billing.html +++ /dev/null @@ -1,54 +0,0 @@ - - Billing - - -

Billing

-
    -
  • You can bill individual customers by clicking on the Bill now link on the main customer view. -
  • The freeside-daily script should be run daily to bill customers and run invoice collection events. -
  • Real-time credit card processing: Install the Business::OnlinePayment module for your processor. Configure the business-onlinepayment configuration option. Disable the default Batch card invoice event and add one for Business::OnlinePayment. -
  • Optional: Credit card expiration alerts: Customize alerter_template configuration option and run freeside-expiration-alerter daily. -
  • Credit card decline alerts: Customize the declinetemplate configuration option and set the emaildecline configuration option. -
  • Optional: Invoice template customization -
      -
    • See the Text::Template documentation for details on the substitution language. -
    • You must call the invoice_lines() function at least once - pass it a number of lines, and it returns a list of array references, each of two elements: a service description column, and a price column. Alternatively, call invoice_lines() with no arguments, and pagination will be disabled - all invoice line items will print on one page, with no padding (recommended for email invoices). -
    • In addition, the following variables are available: -
        -
      • $invnum - invoice number -
      • $date - as a UNIX timestamp (see Date::Format for conversion functions). -
      • $page - current page -
      • $total_pages - total pages -
      • @address - A six-element array containing the customer name, company, and address. - -
      -
    -
  • Batch credit card processing -
      -
    • After freeside-daily is run, a credit card batch will be in the cust_pay_batch table. Export this table to your credit card batching. -
    • When your batch completes, erase the cust_pay_batch records in that batch and add any necessary paymants to the cust_pay table. Example code to add payments is: -
      use FS::cust_pay;
      -
      -# loop over all records in batch
      -
      -my $payment=create FS::cust_pay (
      -  'invnum' => $invnum,
      -  'paid' => $paid,
      -  '_date' => $_date,
      -  'payby' => $payby,
      -  'payinfo' => $payinfo,
      -  'paybatch' => $paybatch,
      -);
      -
      -my $error=$payment->insert;
      -if ( $error ) {
      -  #process error
      -}
      -
      -# end loop
      -
      -All fields except paybatch are contained in the cust_pay_batch table. You can use paybatch field to track particular batches and/or particular transactions within a batch. -
    - -
- diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html deleted file mode 100644 index 9caf3bb3a..000000000 --- a/httemplate/docs/config.html +++ /dev/null @@ -1,36 +0,0 @@ - - Configuration files - - -

Configuration files

-Configuration is now done by the top-level Makefile and web interface. The instructions below are no longer necessary. -
    -
  • Create the /usr/local/etc/freeside directory to hold your configuration. -
  • Setting up Apache user authetication is mandatory. -
  • Create the /usr/local/etc/freeside/mapsecrets file, which maps Apache users to a secrets file which contains a DBI data source, username and password. Every -line in /usr/local/etc/freeside/mapsecrets should contain a username and -filename, separated by whitespace. Note that these are not local usernames - -they are passed from Apache. -Apache user authetication is mandatory. For example, if you had the Apache users admin, -john, and sam, -you mapsecrets file might look like: -
    -admin secretfile
    -john secretfile
    -sam secretfile
    -
    -
  • Next, the filename(s) referenced in /usr/local/etc/freeside/mapsecrets file should be created in the /usr/local/etc/freeside/ directory. Each file contains three lines: DBI data source (for example, - DBI:mysql:freeside or DBI:Pg:host=localhost;dbname=freeside), database username, and database password. - These files should not be world readable. See the DBI manpage and the manpage for your DBD for the exact syntax of a DBI data source. In a normal installation such as the example above, a single file /usr/local/etc/freeside/secretfile would be created - for example: -
    -DBI:Pg:host=localhost;dbname=freeside
    -dbusername
    -dbpassword
    -
    -
  • Create the /usr/local/etc/freeside/conf.datasource directory, for example, /usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside (remember to backslash-escape the ; character when creating directories in the shell: -
    mkdir /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside
    -
    -
  • The rest of the configuration can be done with the web interface. Select Configuration from the main menu and update your configuration values. -
- - diff --git a/httemplate/docs/export.html b/httemplate/docs/export.html deleted file mode 100755 index 71e3acf1f..000000000 --- a/httemplate/docs/export.html +++ /dev/null @@ -1,55 +0,0 @@ - - File exporting - - -

File exporting

- NOTE: This file is OUT OF DATE with the landing of the new export code and is only here for reference. DO NOT follow these instructions. Instead use the new exports in the web interface. -
    -
  • bin/svc_acct.export will create UNIX passwd, shadow and master.passwd files, ERPCD acp_passwd and acp_dialup files and a RADIUS users file in the /usr/local/etc/freeside/export.datasrc directory. Some RADIUS servers (such as Radiator, ICRADIUS and FreeRADIUS) will authenticate directly out of an SQL database. In these cases, -it is reccommended that you replicate (Replication in MySQL) the data to an external RADIUS machine or point icradius_secrets to the external machine rather than running the RADIUS server on your Freeside machine. Using the appropriate configuration settings, you can export these files to your remote machines unattended: -
      -
    • shellmachines - passwd and shadow are copied to the remote machine as /etc/passwd.new and /etc/shadow.new and then moved to /etc/passwd and /etc/shadow if no errors occur. -
    • bsdshellmachines - passwd and master.passwd are copied to the remote machine as /etc/passwd.new and /etc/master.passwd.new and moved to /etc/passwd and /etc/master.passwd if no errors occur. -
    • nismachines - passwd and shadow are copied to the /etc/global directory on the remote machine. If no errors occur, the command ( cd /var/yp; make; ) is executed on the remote machine. -
    • erpcdmachines - acp_passwd and acp_dialup are copied to the /usr/annex directory on the remote machine. If no errors occur, the command ( kill -USR1 `cat /usr/annex/erpcd.pid` ) is executed on the remote machine. -
    • radiusmachines - users is copied to the /etc/raddb directory on the remote machine. If no errors occur, the command ( builddbm ) is executed on the remote machine. -
    • icradiusmachines - Turn this option on to enable radcheck table population - by default in the Freeside database, or in the database specified by the icradius_secrets config option (the radcheck table needs to be created manually). You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option.
      ADDITIONAL DEPRECATED FUNCTIONALITY (instead use MySQL replication or point icradius_secrets to the external database) - your ICRADIUS machines or FreeRADIUS (with MySQL authentication) machines, one per line. Machines listed in this file will have the radcheck table exported to them. Each line should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password. For example: "radius.isp.tld radius_db radius_user passw0rd"
      -
    -
  • svc_acct.pm - If a shellmachine is defined, users can be created, modified and deleted remotely; see below. -
      -
    • Account creation - If the username, uid and dir fields are defined for a new user, the command(s) specified in the shellmachine-useradd configuration file are executed on shellmachine via ssh. If this file does not exist, useradd -d $dir -m -s $shell -u $uid $username is the default. If the file exists but is empty, cp -pr /etc/skel $dir; chown -R $uid.$gid $dir is the default instead. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: $username, $uid, $gid, $dir, and $shell. -
    • Account deletion - The command(s) specified in the shellmachine-userdel configuration file are executed on shellmachine via ssh. If this file does not exist, userdel $username is the default. If the file exists but is empty, rm -rf $dir is the default instead. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: $username and $dir. -
    • Account modification - If a user's home directory changes, the command(s) specified in the shellmachine-usermod configuration file are execute on shellmachine via ssh. If this file does not exist or is empty, [ -d $old_dir ] && mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir ) is the default. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: $old_dir, $new_dir, $uid and $gid. -
    -
  • svc_acct.pm - Cyrus IMAP Server integration, enabled by the cyrus configuration file -
      -
    • Account creation - (Cyrus::IMAP::Admin should be installed locally) -
    • Account deletion - (Cyrus::IMAP::Admin should be installed locally) -
    • Account modification - (not yet implemented) -
    -
  • bin/svc_acct_sm.export will create Qmail rcpthosts, recipientmap and virtualdomains files and Sendmail virtusertable and sendmail.cw files in the /usr/local/etc/freeside/export.datasrc directory. Using the appropriate configuration files, you can export these files to your remote machines unattemded: -
      -
    • qmailmachines - recipientmap, virtualdomains and rcpthosts are copied to the /var/qmail/control directory on the remote machine. Note: If you imported qmail configuration files, run the generated /usr/local/etc/freeside/export.datasrc/virtualdomains.FIX on a machine with your user home directories before exporting qmail configuration files. -
    • shellmachine - The command [ -e homedir/.qmail-default ] || { touch homedir/.qmail-default; chown uid.gid homedir/.qmail-default; } will be run on this machine for users in the virtualdomains file. -
    • sendmailmachines - sendmail.cw and virtusertable are copied to the remote machine as /etc/sendmail.cw.new and /etc/virtusertable.new. If no errors occur, they are moved to /etc/sendmail.cw and /etc/virtusertable and the command specified in the sendmailrestart configuration file is executed. (The path can be changed from the default /etc with the sendmailconfigpath configuration file.) -
    -
  • svc_domain.pm - If the qmailmachines configuration file exists and a shellmachine is defined, user .qmail- files can be updated for catchall mailboxes. -
      -
    • The command
      [ -e homedir/.qmail-domain-default ] || {
      -    touch homedir/.qmail-domain-default;
      -    chown uid.gid homedir/.qmail-domain-default;
      -}
      is run. -
    -
  • svc_forward.pm - Not yet documented; see manpage. -
  • svc_www.pm - Not yet documented; see manpage. -
-
Unattended remote login - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. Do not use this feature unless you understand what you are doing! -
    -
  • As the freeside user (on your freeside machine), generate an authentication key using ssh-keygen. Since this is for unattended operation, use a blank passphrase. -
  • Append the newly-created identity.pub file to ~root/.ssh/authorized_keys on the remote machine(s). -
  • Some new SSH v2 implementation accept v2 style keys only. Use the -t option to ssh-keygen, and append the created id_dsa.pub or id_rsa.pub to ~root/.ssh/authorized_keys2 on the remote machine(s). -
  • You may need to set PermitRootLogin without-password (meaning with keys only) in your sshd_config file on the remote machine(s). -
- - - diff --git a/httemplate/docs/index.html b/httemplate/docs/index.html deleted file mode 100644 index 00c863b0c..000000000 --- a/httemplate/docs/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - Documentation - - -

Documentation

- - - diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html deleted file mode 100644 index 75f039dd1..000000000 --- a/httemplate/docs/install.html +++ /dev/null @@ -1,198 +0,0 @@ - - Installation - - -

Installation

-Before installing, you need: - -Install the Freeside distribution: -
    -
  • Add the user and group `freeside' to your system. -
  • Allow the freeside user full access to the freeside database. -
      -
    • with PostgreSQL: -
      -$ su postgres
      -$ createuser -P freeside
      -Enter password for user "freeside": 
      -Enter it again: 
      -Shall the new user be allowed to create databases? (y/n) y
      -Shall the new user be allowed to create more new users? (y/n) n
      -CREATE USER
      - -
    - -
  • Edit the top-level Makefile: -
      -
    • Set DATASOURCE to your DBI data source, for example, DBI:Pg:host=localhost;dbname=freeside for PostgresSQL. See the DBI manpage and the manpage for your DBD for the exact syntax of your DBI data source. -
    • Set DB_PASSWORD to the freeside database user's password. -
    -
  • Add the freeside database to your database engine: -
    -$ su
    -# make create-database
    - (or manually, with Postgres:) -
    -$ su freeside
    -$ createdb freeside
    - -
  • Build and install the Perl modules: -
    -$ make perl-modules
    -$ su
    -# make install-perl-modules
    -
  • Create the necessary configuration files:
    -$ su
    -# make create-config
    -
    -
  • Run a separate iteration of Apache[-SSL] with mod_perl enabled as the freeside user. -
- - - - - - - - -
Apache::ASPMason
    -
  • Run make aspdocs -
  • Copy aspdocs/ to your web server's document space. -
  • Create a Global directory, such as /usr/local/etc/freeside/asp-global/: -
    -mkdir /usr/local/etc/freeside/asp-global/
    -chown freeside /usr/local/etc/freeside/asp-global/
    -
    -
  • Copy htetc/global.asa to the Global directory: -
    -cp htetc/global.asa /usr/local/etc/freeside/asp-global/global.asa
    -
    -
  • Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example: -
    -<Directory /usr/local/apache/htdocs/freeside-asp>
    -<Files ~ (\.cgi)>
    -AddHandler perl-script .cgi
    -PerlHandler Apache::ASP
    -</Files>
    -<Perl>
    -$MLDBM::RemoveTaint = 1;
    -</Perl>
    -PerlSetVar Global /usr/local/etc/freeside/asp-global/
    -PerlSetVar Debug 2
    -</Directory>
    -
    -
    -
  • (use version 1.0x - Freeside is not yet compatible with version 1.1x) -
  • Run make masondocs -
  • Copy masondocs/ to your web server's document space. -
  • Copy htetc/handler.pl to your web server's configuration directory. -
  • Edit handler.pl and set an appropriate data_dir, such as /usr/local/etc/freeside/mason-data -
  • Configure Apache to use the handler.pl file and to execute .cgi files using HTML::Mason. For example: -
    -<Directory /usr/local/apache/htdocs/freeside-mason>
    -<Files ~ (\.cgi)>
    -AddHandler perl-script .cgi
    -PerlHandler HTML::Mason
    -</Files>
    -<Perl>
    -require "/usr/local/apache/conf/handler.pl";
    -</Perl>
    -</Directory>
    -
    -
-
    -
  • Restrict access to this web interface - see the Apache documentation on user authentication. For example, to configure user authentication with mod_auth (flat files): -
    -<Directory /usr/local/apache/htdocs/freeside-asp>
    -PerlSetVar Global /usr/local/etc/freeside/asp-global/
    -AuthName Freeside
    -AuthType Basic
    -AuthUserFile /usr/local/etc/freeside/htpasswd
    -require valid-user
    -</Directory>
    -
    -
  • Create one or more Freeside users (your internal sales/tech folks, not customer accounts). These users are setup using using Apache authentication, not UNIX user accounts. For example, using mod_auth (flat files): -
      -
    • First user: -
      $ su
      -$ freeside-adduser -c -h /usr/local/etc/freeside/htpasswd username
      -
    • Additional users: -
      $ su
      -$ freeside-adduser -h /usr/local/etc/freeside/htpasswd username
      -
    - (using other auth types, add each user to your Apache authentication and then run: freeside-adduser username -
  • As the freeside UNIX user, run bin/fs-setup username (in the untar'ed freeside directory) to create the database tables, passing the username of a Freeside user you created above: -
    -$ su freeside
    -$ cd /path/to/freeside-1.4.0/
    -$ bin/fs-setup username
    -
    -
  • As the freeside UNIX user, run bin/populate-msgcat username (in the untar'ed freeside directory) to populate the message catalog, passing the username of a Freeside user you created above: -
    -$ su freeside
    -$ cd /path/to/freeside-1.4.0/
    -$ bin/populate-msgcat username
    -
    -
  • freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup (Do this manually, or edit the top-level Makefile, replacing INIT_FILE with the appropriate location on your systemand QUEUED_USER with the username of a Freeside user you created above, and run make install-init) -
  • Now proceed to the initial administration of your installation. -
- diff --git a/httemplate/docs/legacy.html b/httemplate/docs/legacy.html deleted file mode 100755 index 2db9edb0f..000000000 --- a/httemplate/docs/legacy.html +++ /dev/null @@ -1,38 +0,0 @@ - - Importing legacy data - - -

Importing legacy data

-In most cases, legacy data import all cases will require writing custom code to deal with your particular legacy data. The example scripts here will not work "out-of-the-box". Importing your legacy data will most probably involve some hacking on the example scripts noted below. Contributions to the import process are welcome. -

Some import scripts may require installation of the Array-PrintCols and Term-Query (make test broken; install manually) modules.
-
    -
  • bin/bind.import - Import domain information from BIND named -
  • bin/passwd.import - Just import `passwd' and `shadow' or `master.passwd', no RADIUS import. -
  • bin/svc_acct.import - Import `passwd', ( `shadow' or `master.passwd' ) and RADIUS `users'. Before running bin/svc_acct.import, you need services (with table svc_acct) as follows: -
      -
    • Most accounts probably have entries in passwd and users (with Port-Limit nonexistant or 1) -
    • Some accounts have entries in passwd and users, but with Port-Limit 2 (or more) -
    • Some accounts might have entries in users only (Port-Limit 1) -
    • Some accounts might have entries in users only (Port-Limit >= 2) -
    • POP mail accounts have entries in passwd only, and have a particular shell. -
    • Everything else in passwd is a shell account. -
    -
  • bin/svc_acct_sm.import - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need services as follows: -
      -
    • Domain (table svc_acct) -
    • Mail alias (table svc_acct_sm) -
    -
  • Importing customer data -
      -
    • Manually -
        -
      • Add a new customer -
      • Add one or more packages for this customer -
      • Enter a package by clicking on the package number -
      • Pick the `Link to existing' option -
      -
    • Batch - You will need to write a script to import your particular legacy data. You can use eg/TEMPLATE_cust_main.import as a starting point. -
    -
- - diff --git a/httemplate/docs/overview.dia b/httemplate/docs/overview.dia deleted file mode 100644 index a0e34c30e..000000000 Binary files a/httemplate/docs/overview.dia and /dev/null differ diff --git a/httemplate/docs/overview.png b/httemplate/docs/overview.png deleted file mode 100644 index bf2dbc26c..000000000 Binary files a/httemplate/docs/overview.png and /dev/null differ diff --git a/httemplate/docs/passwd.html b/httemplate/docs/passwd.html deleted file mode 100755 index fc1dde956..000000000 --- a/httemplate/docs/passwd.html +++ /dev/null @@ -1,23 +0,0 @@ - - fs_passwd - - -

fs_passwd

-You may use fs_passwd/fs_passwd as a "passwd", "chfn" and "chsh" replacement on your shell machine(s) to cause password, gecos and shell changes to update your freeside machine. You can also use the fs_passwd/fs_passwd.html and fs_passwd/fs_passwd.cgi to run a public password change CGI on a public web server. This can pose a security risk if not configured correctly. Do not use this feature unless you understand what you are doing! -

Currently it is assumed that the the crypt(3) function in the C library is the same on the Freeside machine as on the target machine. -
    -
  • Create a freeside account on the shell or web machine(s). -
  • Setup SSH keys: -
      -
    • As the freeside user (on your freeside machine), generate an authentication key using ssh-keygen. Since this is for unattended operation, use a blank passphrase. -
    • Append the newly-created identity.pub file to ~freeside -/.ssh/authorized_keys on the shell or web machine(s). -
    • Some new SSH v2 implementation accept v2 style keys only. Use the -t option to ssh-keygen, and append the created id_dsa.pub or id_rsa.pub to ~freeside/.ssh/authorized_keys2 on the remote machine(s). -
    -
  • Copy fs_passwd/fs_passwdd to /usr/local/sbin on the shell or web machine(s). (chown freeside, chmod 500) -
  • Create /usr/local/freeside on the shell or web machine(s). (chown freeside, chmod 700) -
  • Run an iteration of "fs_passwd/fs_passwd_server user shell.machine" as the freeside user for each shell or web machine (this is a daemon process). user refers to a freeside user added by freeside-adduser. -
  • Copy fs_passwd/fs_passwd to /usr/local/bin on the shell machine(s). (chown freeside, chmod 4755). You may link it to passwd, chfn and chsh as well. -
  • Copy fs_passwd/fs_passwd.cgi to the cgi-bin directory on your web machine(s). Use suEXEC or suidperl to run fs_passwd.cgi as the freeside user. -
- diff --git a/httemplate/docs/schema.dia b/httemplate/docs/schema.dia deleted file mode 100644 index 092d2f88b..000000000 Binary files a/httemplate/docs/schema.dia and /dev/null differ diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html deleted file mode 100644 index 2b8b3a132..000000000 --- a/httemplate/docs/schema.html +++ /dev/null @@ -1,424 +0,0 @@ - - Schema reference - - -

Schema reference

- Schema diagram: as a giant .png or dia source (dia homepage). -
    -
  • agent - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type). -
      -
    • agentnum - primary key -
    • agent - name of this agent -
    • typenum - agent type -
    • prog - (unimplemented) -
    • freq - (unimplemented) -
    -
  • agent_type - Agent types define groups of packages that you can then assign to particular agents. -
      -
    • typenum - primary key -
    • atype - name of this agent type -
    -
  • cust_bill - Invoices. Declarations that a customer owes you money. The specific charges are itemized in cust_bill_pkg. -
      -
    • invnum - primary key -
    • custnum - customer -
    • _date -
    • charged - amount of this invoice -
    • printed - how many times this invoice has been printed automatically -
    • closed - books closed flag, empty or `Y' -
    -
  • cust_bill_event - Invoice event history - -
  • part_bill_event - Invoice event definitions -
      -
    • eventpart - primary key -
    • payby - CARD, BILL, or COMP -
    • event - event name -
    • eventcode - event action -
    • seconds - how long after the invoice date (cust_bill._date) events of this type are triggered -
    • weight - ordering for events with identical seconds -
    • plan - eventcode plan -
    • plandata - additional plan data -
    • disabled - Disabled flag, empty or `Y' -
    • taxclass - Texas tax class flag, empty or "none", "access", or "hosting" -
    -
  • cust_bill_pkg - Invoice line items -
      -
    • invnum - (multiple) key -
    • pkgnum - package or 0 for the special virtual sales tax package -
    • setup - setup fee -
    • recur - recurring fee -
    • sdate - starting date -
    • edate - ending date -
    -
  • cust_credit - Credits. The equivalent of a negative cust_bill record. -
      -
    • crednum - primary key -
    • custnum - customer -
    • amount - amount credited -
    • _date -
    • otaker - order taker -
    • reason -
    • closed - books closed flag, empty or `Y' -
    -
  • cust_credit_bill - Credit invoice application. Links a credit to an invoice. -
      -
    • creditbillnum - primary key -
    • crednum - credit being applied -
    • invnum - invoice to which credit is applied -
    • amount - amount applied -
    • _date -
    -
  • cust_main - Customers -
      -
    • custnum - primary key -
    • agentnum - agent -
    • refnum - referral -
    • first - name -
    • last - name -
    • ss - social security number -
    • company -
    • address1 -
    • address2 -
    • city -
    • county -
    • state -
    • zip -
    • country -
    • daytime - phone -
    • night - phone -
    • fax - phone -
    • ship_first -
    • ship_last -
    • ship_company -
    • ship_address1 -
    • ship_address2 -
    • ship_city -
    • ship_county -
    • ship_state -
    • ship_zip -
    • ship_country -
    • ship_daytime -
    • ship_night -
    • ship_fax -
    • payby - CARD, BILL, or COMP -
    • payinfo - card number, P.O.#, or comp issuer -
    • paydate - expiration date -
    • payname - billing name (name on card) -
    • tax - tax exempt, Y or null -
    • otaker - order taker -
    • referral_custnum -
    • comments -
    - (columns in italics are optional) -
  • cust_main_invoice - Invoice destinations for email invoices. Note that a customer can have many email destinations for their invoice (either literal or via svcnum), but only one postal destination. -
      -
    • destnum - primary key -
    • custnum - customer -
    • dest - Invoice destination. Freeside supports three types of invoice delivery: send directly to a service defined in Freeside, send to an arbitrary email address, or print the invoice to a printer and have someone send it out via snail mail. Freeside determines which method to use based on the contents of the dest field. If the contents are numeric, a svcnum pointing to a valid service is expected in the field. If the contents are a string, a literal email address is expected to be in the field. If the special keyword `POST' is present, the snail mail method is used (which is the default if no cust_main_invoice records exist). Snail mail invoices get their address information from cust_main and are printed with the printer defined in the configuration files. -
    -
  • cust_main_county - Tax rates -
      -
    • taxnum - primary key -
    • state -
    • county -
    • country -
    • tax - % rate -
    • taxclass -
    • exempt_amount -
    -
  • cust_tax_exempt - Tax exemption record -
      -
    • exemptnum - primary key -
    • taxnum - tax rate -
    • year -
    • month -
    • amount -
    -
  • cust_pay - Payments. Money being transferred from a customer. -
      -
    • paynum - primary key -
    • custnum - customer -
    • paid - amount -
    • _date -
    • payby - CARD, BILL, or COMP -
    • payinfo - card number, P.O.#, or comp issuer -
    • paybatch - text field for tracking card processor batches -
    • closed - books closed flag, empty or `Y' -
    -
  • cust_bill_pay - Applicaton of a payment to a specific invoice. -
      -
    • billpaynum -
    • invnum - invoice -
    • paynum - payment -
    • amount -
    • _date -
    -
  • cust_pay_batch - Pending batch -
      -
    • paybatchnum -
    • cardnum -
    • exp - card expiration -
    • amount -
    • invnum - invoice -
    • custnum - customer -
    • payname - name on card -
    • first - name -
    • last - name -
    • address1 -
    • address2 -
    • city -
    • state -
    • zip -
    • country -
    -
  • cust_pkg - Customer billing items -
      -
    • pkgnum - primary key -
    • custnum - customer -
    • pkgpart - Package definition -
    • setup - date -
    • bill - next bill date -
    • susp - (past) suspension date -
    • expire - (future) cancellation date -
    • cancel - (past) cancellation date -
    • otaker - order taker -
    • manual_flag - If this field is set to 1, disables the automatic unsuspensiond of this package when using the unsuspendauto config file. -
    -
  • cust_refund - Refunds. The transfer of money to a customer; equivalent to a negative cust_pay record. -
      -
    • refundnum - primary key -
    • custnum - customer -
    • refund - amount -
    • _date -
    • payby - CARD, BILL or COMP -
    • payinfo - card number, P.O.#, or comp issuer -
    • otaker - order taker -
    • closed - books closed flag, empty or `Y' -
    -
  • cust_credit_refund - Applicaton of a refund to a specific credit. -
      -
    • creditrefundnum - primary key -
    • crednum - credit -
    • refundnum - refund -
    • amount -
    • _date -
    -
  • cust_svc - Customer services - -
  • nas - Network Access Server (terminal server) -
      -
    • nasnum - primary key -
    • nas - NAS name -
    • nasip - NAS ip address -
    • nasfqdn - NAS fully-qualified domain name -
    • last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring). -
    -
  • part_pkg - Package definitions -
      -
    • pkgpart - primary key -
    • pkg - package name -
    • comment - non-customer visable package comment -
    • setup - setup fee expression -
    • freq - recurring frequency (months) -
    • recur - recurring fee expression -
    • setuptax - Setup fee tax exempt flag, empty or `Y' -
    • recurtax - Recurring fee tax exempt flag, empty or `Y' -
    • plan - price plan -
    • plandata - additional price plan data -
    • disabled - Disabled flag, empty or `Y' -
    -
  • part_referral - Referral listing -
      -
    • refnum - primary key -
    • referral - referral -
    -
  • part_svc - Service definitions -
      -
    • svcpart - primary key -
    • svc - name of this service -
    • svcdb - table used for this service: svc_acct, svc_acct_sm, svc_forward, svc_domain, svc_charge or svc_wo -
    • disabled - Disabled flag, empty or `Y' - -
    -
  • part_svc_column -
      -
    • columnnum - primary key -
    • svcpart - Service definition -
    • columnname - column name in part_svc.svcdb table -
    • columnvalue - default or fixed value for the column -
    • columnflag - null, D or F -
    -
  • pkg_svc - -
  • export_svc - -
  • part_export - Export to external provisioning -
      -
    • exportnum - primary key -
    • machine - Machine name -
    • exporttype - Export type -
    • nodomain - blank or Y: usernames are exported to this service with no domain -
    -
  • part_export_option - provisioning options -
      -
    • optionnum - primary key -
    • exportnum - Export -
    • optionname - option name -
    • optionvalue - option value -
    -
  • port - individual port on a nas -
      -
    • portnum - primary key -
    • ip - IP address of this port -
    • nasport - port number on the NAS -
    • nasnum - NAS -
    -
  • prepay_credit -
      -
    • prepaynum - primary key -
    • identifier - text or numeric string used to receive this credit -
    • amount - amount of credit -
    -
  • session -
      -
    • sessionnum - primary key -
    • portnum - Port -
    • svcnum - Account -
    • login - timestamp indicating the beginning of this user session. -
    • logout - timestamp indicating the end of this user session. May be null, which indicates a currently open session. -
    - -
  • svc_acct - Accounts -
      -
    • svcnum - primary key -
    • username -
    • _password -
    • sec_phrase - security phrase -
    • popnum - Point of Presence -
    • uid -
    • gid -
    • finger - GECOS -
    • dir -
    • shell -
    • quota - (unimplementd) -
    • slipip - IP address -
    • seconds -
    • domsvc -
    • radius_Radius_Reply_Attribute - Radius-Reply-Attribute -
    • rc_Radius_Check_Attribute - Radius-Check-Attribute -
    -
  • svc_acct_pop - Points of Presence -
      -
    • popnum - primary key -
    • city -
    • state -
    • ac - area code -
    • exch - exchange -
    • loc - rest of number -
    -
  • part_pop_local - Local calling areas -
      -
    • localnum - primary key -
    • popnum - primary key -
    • city -
    • state -
    • npa - area code -
    • nxx - exchange -
    -
  • svc_acct_sm - DEPRECIATED Domain mail aliases - -
  • svc_domain - Domains - -
  • svc_forward - Mail forwarding aliases - -
  • domain_record - Domain zone detail -
      -
    • recnum - primary key -
    • svcnum - Domain (by svcnum) -
    • reczone - zone for this line -
    • recaf - address family, usually IN -
    • rectype - type for this record (A, MX, etc.) -
    • recdata - data for this record -
    -
  • svc_www - -
  • type_pkgs - -
  • queue - job queue -
      -
    • jobnum - primary key -
    • job -
    • _date -
    • status -
    • statustext -
    • svcnum -
    -
  • queue_arg - job arguments -
      -
    • argnum - primary key -
    • jobnum - job -
    • arg - argument -
    -
  • queue_depend - job dependancies -
      -
    • dependnum - primary key -
    • jobnum - source jobnum -
    • depend_jobnum - dependancy jobnum -
    -
  • radius_usergroup - Link users to RADIUS groups. -
      -
    • usergroupnum - primary key -
    • svcnum - account -
    • groupname -
    -
  • msgcat - i18n message catalog -
      -
    • msgnum - primary key -
    • msgcode - message code -
    • locale - locale -
    • msg - Message text -
    -
- diff --git a/httemplate/docs/schema.png b/httemplate/docs/schema.png deleted file mode 100644 index d0392e76f..000000000 Binary files a/httemplate/docs/schema.png and /dev/null differ diff --git a/httemplate/docs/session.html b/httemplate/docs/session.html deleted file mode 100644 index 7dac5fdf7..000000000 --- a/httemplate/docs/session.html +++ /dev/null @@ -1,54 +0,0 @@ - - Session monitor - - -

Session monitor

-

Installation

-For security reasons, the client portion of the session montior may run on one -or more external public machine(s). On these machines, install: -
    -
  • Perl (at l -east 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.) -
  • FS::SessionClient (copy the fs_session/FS-SessionClient directory to the external machine, then: perl Makefile.PL; make; make install) -
-Then: -
    -
  • Add the user `freeside' to the the external machine. -
  • Create the /usr/local/freeside directory on the external machine (owned by the freeside user). -
  • touch /usr/local/freeside/fs_sessiond_socket; chown freeside /usr/local/freeside/fs_sessiond_socket; chmod 600 /usr/local/freeside/fs_sessiond_socket -
  • Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s). -
  • Run
    fs_session_server user machine
    on the Freeside machine. -
      -
    • user is a user from the mapsecrets file. -
    • machine is the name of the external machine. -
    -
-

Usage

-
    -
  • Web -
      -
    • Copy FS-SessionClient/cgi/login.cgi and logout.cgi to your web - server's document space. -
    • Use suEXEC or setuid (see install.html for details) to run login.cgi and logout.cgi as the freeside user. -
    -
  • Command-line -
    freeside-login username ( portnum | ip | nasnum nasport )
    -freeside-logout username ( portnum | ip | nasnum nasport )
    -
      -
    • username is a customer username from the svc_acct table -
    • portnum, ip or nasport and nasnum uniquely identify a port in the port database table. -
    -
  • RADIUS -
      -
    • Configure your RADIUS server's login and logout callbacks to use the command-line freeside-login and freeside-logout utilites. -
    -
-

Callbacks

-
    -
  • Sesstion start - The command(s) specified in the session-start configuration file are executed on the Freeside machine. The contents of the file are treated as a double-quoted perl string, with the following variables available: $ip, $nasip and $nasfqdn, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on. -
  • Session end - The command(s) specified in the session-stop configuration file are executed on the Freeside machine. The contents of the file are treated as a double-quoted perl string, with the following variables available: $ip, $nasip and $nasfqdn, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on. -
-

Dropping expired users

-Run
bin/freeside-session-kill username
periodically from cron. - - diff --git a/httemplate/docs/signup.html b/httemplate/docs/signup.html deleted file mode 100644 index 5168f47d6..000000000 --- a/httemplate/docs/signup.html +++ /dev/null @@ -1,56 +0,0 @@ - - Signup server - - -

Signup server

-For security reasons, the signup server should run on an external public -webserver. On this machine, install: - -Then: -
    -
  • Add the user `freeside' to the the external machine. -
  • Copy or symlink fs_signup/FS-SignupClient/cgi/signup.cgi into the web server's document space. -
  • When linking to signup.cgi, you can include a referring custnum in the URL as follows: http://public.web.server/path/signup.cgi?ref=1542 -
  • Enable CGI execution for files with the `.cgi' extension. (with Apache) -
  • Create the /usr/local/freeside directory on the external machine (owned by the freeside user). -
  • touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket -
  • Use suEXEC or setuid (see install.html for details) to run signup.cgi as the freeside user. -
  • Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s). -
  • Run
    fs_signup_server user machine agentnum refnum
    on the Freeside machine. -
      -
    • user is a user from the mapsecrets file. -
    • machine is the name of the external machine. -
    • agentnum and refnum are the agent and referral, respectively, to use for customers who sign up via this signup server. -
    -
-Optional: -
    -
  • If you create a /usr/local/freeside/ieak.template file on the external machine, it will be sent to IE users with MIME type application/x-Internet-signup. This file will be processed with Text::Template with the variables listed below available. - (an example file is included as fs_signup/ieak.template) See the IEAK documentation for more information. -
  • If you create a /usr/local/freeside/cck.template file on the external machine, the variables defined will be sent to Netscape users with MIME type application/x-netscape-autoconfigure-dialer-v2. This file will be processed with Text::Template with the variables listed below available. - (an example file is included as fs_signup/cck.template). See the Netscape documentation for more information. -
  • If you create a /usr/local/freeside/success.html file on the external machine, it will be used as the success HTML page. Although template substiutions are available, a regular HTML file will work fine here, unlike signup.html. An example file is included as fs_signup/FS-SignupClient/cgi/success.html -
  • Variable substitutions available in ieak.template, cck.template and success.html: -
      -
    • $ac - area code of selected POP -
    • $exch - exchange of selected POP -
    • $loc - local part of selected POP -
    • $username -
    • $password -
    • $email_name - first and last name -
    • $pkg - package name -
    -
  • If you create a /usr/local/freeside/signup.html file on the external machine, it will be used as a template for the form HTML. This requires the template to be constructed appropriately; probably best to start with the example file included as fs_signup/FS-SignupClient/cgi/signup.html. -
  • If there are any entries in the prepay_credit table, a user can enter a string matching the identifier column to receive the credit specified in the amount column, and/or the time specified in the seconds column (for use with the session monitor), after which that identifier is no longer valid. This can be used to implement pre-paid "calling card" type signups. The bin/generate-prepay script can be used to populate the prepay_credit table. -
- diff --git a/httemplate/docs/ssh.html b/httemplate/docs/ssh.html deleted file mode 100755 index 5503a242e..000000000 --- a/httemplate/docs/ssh.html +++ /dev/null @@ -1,15 +0,0 @@ - - Unattended SSH - - -

Unattended SSH

-
Unattended remote login - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. Do not use this feature unless you understand what you are doing! -
    -
  • As the freeside user (on your freeside machine), generate an authentication key using ssh-keygen. Since this is for unattended operation, use a blank passphrase. -
  • Append the newly-created identity.pub file to ~root/.ssh/authorized_keys on the remote machine(s). -
  • Some new SSH v2 implementation accept v2 style keys only. Use the -t option to ssh-keygen, and append the created id_dsa.pub or id_rsa.pub to ~root/.ssh/authorized_keys2 on the remote machine(s). -
  • You may need to set PermitRootLogin without-password (meaning with keys only) in your sshd_config file on the remote machine(s). -
- - - diff --git a/httemplate/docs/trouble.html b/httemplate/docs/trouble.html deleted file mode 100755 index fce743928..000000000 --- a/httemplate/docs/trouble.html +++ /dev/null @@ -1,26 +0,0 @@ - - Troubleshooting - - -

Troubleshooting

-
    -
  • When troubleshooting the web interface, helpful information is often in your web server's error log. -
  • If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL. -
  • If you get tons of errors in your web server's error log like this: -
    -Ambiguous use of value => resolved to "value" =>
    -at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132.
    -
    - This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile. -
  • If you get errors like this: -
    -UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied 
    -at /your/path/site_perl/FS/UID.pm line 26.
    -BEGIN failed--compilation aborted at
    -/your/path/edit/process/part_svc.cgi line 15.
    -
    - Then the scripts are not running as the freeside freeside user. See -the New Installation section of the documentation. -
  • If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the MySQL documentation, DBI manpage and the DBD::mysql manpage for details. -
- diff --git a/httemplate/docs/upgrade4.html b/httemplate/docs/upgrade4.html deleted file mode 100644 index 1d70f8b73..000000000 --- a/httemplate/docs/upgrade4.html +++ /dev/null @@ -1,27 +0,0 @@ - - Upgrading to 1.2.2 - - -

Upgrading to 1.2.2 from 1.2.x

-
    -
  • If migrating from 1.0.0, see these instructions first. -
  • If migrating from less than 1.1.4, see these instructions first. -
  • If migrating from less than 1.2.0, see these instructions first. -
  • Back up your data and current Freeside installation. -
  • Install the Perl modules Locale-Codes and Net-Whois. -
  • Apply the following changes to your database: -
    -ALTER TABLE cust_pay_batch CHANGE exp exp VARCHAR(11);
    -
    -
  • Copy or symlink htdocs to the new copy. -
  • Remove the symlink or directory (your_site_perl_directory)/FS. -
  • Change to the FS directory in the new tarball, and build and install the - Perl modules: -
    -$ cd FS/
    -$ perl Makefile.PL
    -$ make
    -$ su
    -# make install
    -
  • Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly. - diff --git a/httemplate/docs/upgrade5.html b/httemplate/docs/upgrade5.html deleted file mode 100644 index 3f3431653..000000000 --- a/httemplate/docs/upgrade5.html +++ /dev/null @@ -1,34 +0,0 @@ - - Upgrading to 1.3.0 - - -

    Upgrading to 1.2.3 from 1.2.2

    -
      -
    • If migrating from 1.0.0, see these instructions first. -
    • If migrating from less than 1.1.4, see these instructions first. -
    • If migrating from less than 1.2.0, see these instructions first. -
    • If migrating from less than 1.2.2, see these instructions first. -
    • Back up your data and current Freeside installation. -
    • Apply the following changes to your database: -
      -ALTER TABLE svc_acct_pop ADD loc CHAR(4);
      -CREATE TABLE prepay_credit (
      -  prepaynum int NOT NULL,
      -  identifier varchar(80) NOT NULL,
      -  amount decimal(10,2) NOT NULL,
      -  PRIMARY KEY (prepaynum),
      -  INDEX (identifier)
      -);
      -
      -
    • Copy or symlink htdocs to the new copy. -
    • Remove the symlink or directory (your_site_perl_directory)/FS. -
    • Change to the FS directory in the new tarball, and build and install the - Perl modules: -
      -$ cd FS/
      -$ perl Makefile.PL
      -$ make
      -$ su
      -# make install
      -
    • Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly. - diff --git a/httemplate/docs/upgrade6.html b/httemplate/docs/upgrade6.html deleted file mode 100644 index dc82975f3..000000000 --- a/httemplate/docs/upgrade6.html +++ /dev/null @@ -1,66 +0,0 @@ - - Upgrading to 1.3.0 - - -

      Upgrading to 1.3.0 from 1.2.3

      -
        -
      • If migrating from 1.0.0, see these instructions first. -
      • If migrating from less than 1.1.4, see these instructions first. -
      • If migrating from less than 1.2.0, see these instructions first. -
      • If migrating from less than 1.2.2, see these instructions first. -
      • If migrating from less than 1.2.3, see these instructions first. -
      • Back up your data and current Freeside installation. -
      • As 1.3.0 requires transactions, MySQL's default MyISAM and ISAM table types are no longer supported. Converting to PostgreSQL is recommended. If you really want to use MySQL, convert your tables to one of the transaction-safe table types such as BDB. -
      • Copy the invoice_template file from the conf/ directory in the distribution to your configuration directory. -
      • Install the Text-Template, DBIx-DBSchema, Net-SSH, String-ShellQuote and Net-SCP Perl modules. -
      • Apply the following changes to your database: -
        -CREATE TABLE domain_record (
        -  recnum int NOT NULL,
        -  svcnum int NOT NULL,
        -  reczone varchar(80) NOT NULL,
        -  recaf char(2) NOT NULL,
        -  rectype char(5) NOT NULL,
        -  recdata varchar(80) NOT NULL,
        -  PRIMARY KEY (recnum)
        -);
        -CREATE TABLE svc_www (
        -  svcnum int NOT NULL,
        -  recnum int NOT NULL,
        -  usersvc int NOT NULL,
        -  PRIMARY KEY (svcnum)
        -);
        -ALTER TABLE part_svc ADD svc_www__recnum varchar(80) NULL;
        -ALTER TABLE part_svc ADD svc_www__recnum_flag char(1) NULL;
        -ALTER TABLE part_svc ADD svc_www__usersvc varchar(80) NULL;
        -ALTER TABLE part_svc ADD svc_www__uesrsvc_flag char(1) NULL;
        -ALTER TABLE svc_acct CHANGE _password _password varchar(50) NULL;
        -ALTER TABLE svc_acct ADD seconds integer NULL;
        -ALTER TABLE part_svc ADD svc_acct__seconds integer NULL;
        -ALTER TABLE part_svc ADD svc_acct__seconds_flag char(1) NULL;
        -ALTER TABLE prepay_credit ADD seconds integer NULL;
        -
        -
        -
      • If your database supports dropping columns: -
        -ALTER TABLE cust_bill DROP owed;
        -ALTER TABLE cust_credit DROP credited;
        -
        - Or, if your database does not support dropping columns, you can do this: -
        -ALTER TABLE cust_bill CHANGE owed depriciated decimal(10,2);
        -ALTER TABLE cust_credit CHANGE credited depriciated2 decimal(10,2);
        -
        - -
      • Copy or symlink htdocs to the new copy. -
      • Remove the symlink or directory (your_site_perl_directory)/FS. -
      • Change to the FS directory in the new tarball, and build and install the - Perl modules: -
        -$ cd FS/
        -$ perl Makefile.PL
        -$ make
        -$ su
        -# make install
        -
      • Run bin/dbdef-create. - diff --git a/httemplate/docs/upgrade7.html b/httemplate/docs/upgrade7.html deleted file mode 100644 index d9dcfe2ae..000000000 --- a/httemplate/docs/upgrade7.html +++ /dev/null @@ -1,24 +0,0 @@ - - Upgrading to 1.3.1 - - -

        Upgrading to 1.3.1 from 1.3.0

        -
          -
        • If migrating from 1.0.0, see these instructions first. -
        • If migrating from less than 1.1.4, see these instructions first. -
        • If migrating from less than 1.2.0, see these instructions first. -
        • If migrating from less than 1.2.2, see these instructions first. -
        • If migrating from less than 1.2.3, see these instructions first. -
        • If migrating from less than 1.3.0, see these instructions first. -
        • Back up your data and current Freeside installation. -
        • Copy or symlink htdocs to the new copy. -
        • Change to the FS directory in the new tarball, and build and install the - Perl modules: -
          -$ cd FS/
          -$ perl Makefile.PL
          -$ make
          -$ su
          -# make install UNINST=1
          -
        • Run bin/dbdef-create. - diff --git a/httemplate/docs/upgrade8.html b/httemplate/docs/upgrade8.html deleted file mode 100644 index 0210430ef..000000000 --- a/httemplate/docs/upgrade8.html +++ /dev/null @@ -1,392 +0,0 @@ - - Upgrading to 1.4.0 - - -

          Upgrading to 1.4.0 from 1.3.1

          - - - - - - - - - -
          Apache::ASPMason
            -
          • Run make aspdocs -
          • Copy aspdocs/ to your web server's document space. -
          • Create a Global directory, such as /usr/local/etc/freeside/asp-global/ -
          • Copy htetc/global.asa to the Global directory. -
          • Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example: -
            -<Directory /usr/local/apache/htdocs/freeside-asp>
            -<Files ~ (\.cgi)>
            -AddHandler perl-script .cgi
            -PerlHandler Apache::ASP
            -</Files>
            -<Perl>
            -$MLDBM::RemoveTaint = 1;
            -</Perl>
            -PerlSetVar Global /usr/local/etc/freeside/asp-global/
            -</Directory>
            -
            -
            -
          • (use version 1.0x - Freeside is not yet compatible with version 1.1x) -
          • Run make masondocs -
          • Copy masondocs/ to your web server's document space. -
          • Copy htetc/handler.pl to your web server's configuration directory. -
          • Edit handler.pl and set an appropriate data_dir, such as /usr/local/etc/freeside/mason-data -
          • Configure Apache to use the handler.pl file and to execute .cgi files using HTML::Mason. For example: -
            -<Directory /usr/local/apache/htdocs/freeside-mason>
            -<Files ~ (\.cgi)>
            -AddHandler perl-script .cgi
            -PerlHandler HTML::Mason
            -</Files>
            -<Perl>
            -require "/usr/local/apache/conf/handler.pl";
            -</Perl>
            -</Directory>
            -
            -
          -
            -
          • Build and install the Perl modules: -
            -$ su
            -# make install-perl-modules
            -
          • Apply the following changes to your database: -
            -CREATE TABLE svc_forward (
            -  svcnum int NOT NULL,
            -  srcsvc int NOT NULL,
            -  dstsvc int NOT NULL,
            -  dst varchar(80),
            -  PRIMARY KEY (svcnum)
            -);
            -ALTER TABLE part_svc ADD svc_forward__srcsvc varchar(80) NULL;
            -ALTER TABLE part_svc ADD svc_forward__srcsvc_flag char(1) NULL;
            -ALTER TABLE part_svc ADD svc_forward__dstsvc varchar(80) NULL;
            -ALTER TABLE part_svc ADD svc_forward__dstsvc_flag char(1) NULL;
            -ALTER TABLE part_svc ADD svc_forward__dst varchar(80) NULL;
            -ALTER TABLE part_svc ADD svc_forward__dst_flag char(1) NULL;
            -
            -CREATE TABLE cust_credit_bill (
            -  creditbillnum int primary key,
            -  crednum int not null,
            -  invnum int not null,
            -  _date int not null,
            -  amount decimal(10,2) not null
            -);
            -
            -CREATE TABLE cust_bill_pay (
            -  billpaynum int primary key,
            -  invnum int not null,
            -  paynum int not null,
            -  _date int not null,
            -  amount decimal(10,2) not null
            -);
            -
            -CREATE TABLE cust_credit_refund (
            -  creditrefundnum int primary key,
            -  crednum int not null,
            -  refundnum int not null,
            -  _date int not null,
            -  amount decimal(10,2) not null
            -);
            -
            -CREATE TABLE part_svc_column (
            -  columnnum int primary key,
            -  svcpart int not null,
            -  columnname varchar(64) not null,
            -  columnvalue varchar(80) null,
            -  columnflag char(1) null
            -);
            -
            -CREATE TABLE queue (
            -  jobnum int primary key,
            -  job text not null,
            -  _date int not null,
            -  status varchar(80) not null,
            -  statustext text null,
            -  svcnum int null
            -);
            -CREATE INDEX queue1 ON queue ( svcnum );
            -CREATE INDEX queue2 ON queue ( status );
            -
            -CREATE TABLE queue_arg (
            -  argnum int primary key,
            -  jobnum int not null,
            -  arg text null
            -);
            -CREATE INDEX queue_arg1 ON queue_arg ( jobnum );
            -
            -CREATE TABLE queue_depend (
            -  dependnum int primary key,
            -  jobnum int not null,
            -  depend_jobnum int not null
            -);
            -CREATE INDEX queue_depend1 ON queue_depend ( jobnum );
            -CREATE INDEX queue_depend2 ON queue_depend ( depend_jobnum );
            -
            -CREATE TABLE part_pop_local (
            -  localnum int primary key,
            -  popnum int not null,
            -  city varchar(80) null,
            -  state char(2) null,
            -  npa char(3) not null,
            -  nxx char(3) not null
            -);
            -CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx );
            -
            -CREATE TABLE cust_bill_event (
            -  eventnum int primary key,
            -  invnum int not null,
            -  eventpart int not null,
            -  _date int not null
            -);
            -CREATE UNIQUE INDEX cust_bill_event1 ON cust_bill_event ( eventpart, invnum );
            -CREATE INDEX cust_bill_event2 ON cust_bill_event ( invnum );
            -
            -CREATE TABLE part_bill_event (
            -  eventpart int primary key,
            -  payby char(4) not null,
            -  event varchar(80) not null,
            -  eventcode text null,
            -  seconds int null,
            -  weight int not null,
            -  plan varchar(80) null,
            -  plandata text null,
            -  disabled char(1) null
            -);
            -CREATE INDEX part_bill_event1 ON part_bill_event ( payby );
            -
            -CREATE TABLE export_svc (
            -  exportsvcnum int primary key,
            -  exportnum int not null,
            -  svcpart int not null
            -);
            -CREATE UNIQUE INDEX export_svc1 ON export_svc ( exportnum, svcpart );
            -CREATE INDEX export_svc2 ON export_svc ( exportnum );
            -CREATE INDEX export_svc3 ON export_svc ( svcpart );
            -
            -CREATE TABLE part_export (
            -  exportnum int primary key,
            -  machine varchar(80) not null,
            -  exporttype varchar(80) not null,
            -  nodomain char(1) NULL
            -);
            -CREATE INDEX part_export1 ON part_export ( machine );
            -CREATE INDEX part_export2 ON part_export ( exporttype );
            -
            -CREATE TABLE part_export_option (
            -  optionnum int primary key,
            -  exportnum int not null,
            -  optionname varchar(80) not null,
            -  optionvalue text NULL
            -);
            -CREATE INDEX part_export_option1 ON part_export_option ( exportnum );
            -CREATE INDEX part_export_option2 ON part_export_option ( optionname );
            -
            -CREATE TABLE radius_usergroup (
            -  usergroupnum int primary key,
            -  svcnum int not null,
            -  groupname varchar(80) not null
            -);
            -CREATE INDEX radius_usergroup1 ON radius_usergroup ( svcnum );
            -CREATE INDEX radius_usergroup2 ON radius_usergroup ( groupname );
            -
            -CREATE TABLE msgcat (
            -  msgnum int primary key,
            -  msgcode varchar(80) not null,
            -  locale varchar(16) not null,
            -  msg text not null
            -);
            -CREATE INDEX msgcat1 ON msgcat ( msgcode, locale );
            -
            -CREATE TABLE cust_tax_exempt (
            -  exemptnum int primary key,
            -  custnum int not null,
            -  taxnum int not null,
            -  year int not null,
            -  month int not null,
            -  amount decimal(10,2)
            -);
            -CREATE UNIQUE INDEX cust_tax_exempt1 ON cust_tax_exempt ( taxnum, year, month );
            -
            -ALTER TABLE svc_acct ADD domsvc integer NULL;
            -ALTER TABLE part_svc ADD svc_acct__domsvc varchar(80) NULL;
            -ALTER TABLE part_svc ADD svc_acct__domsvc_flag char(1) NULL;
            -ALTER TABLE svc_domain ADD catchall integer NULL;
            -ALTER TABLE cust_main ADD referral_custnum integer NULL;
            -ALTER TABLE cust_main ADD comments text NULL;
            -ALTER TABLE cust_pay ADD custnum integer;
            -ALTER TABLE cust_pay_batch ADD paybatchnum integer;
            -ALTER TABLE cust_refund ADD custnum integer;
            -ALTER TABLE cust_pkg ADD manual_flag char(1) NULL;
            -ALTER TABLE part_pkg ADD plan varchar(80) NULL;
            -ALTER TABLE part_pkg ADD plandata text NULL;
            -ALTER TABLE part_pkg ADD setuptax char(1) NULL;
            -ALTER TABLE part_pkg ADD recurtax char(1) NULL;
            -ALTER TABLE part_pkg ADD disabled char(1) NULL;
            -ALTER TABLE part_svc ADD disabled char(1) NULL;
            -ALTER TABLE cust_bill ADD closed char(1) NULL;
            -ALTER TABLE cust_pay ADD closed char(1) NULL;
            -ALTER TABLE cust_credit ADD closed char(1) NULL;
            -ALTER TABLE cust_refund ADD closed char(1) NULL;
            -ALTER TABLE cust_bill_event ADD status varchar(80);
            -ALTER TABLE cust_bill_event ADD statustext text NULL;
            -ALTER TABLE svc_acct ADD sec_phrase varchar(80) NULL;
            -ALTER TABLE part_svc ADD svc_acct__sec_phrase varchar(80) NULL;
            -ALTER TABLE part_svc ADD svc_acct__sec_phrase_flag char(1) NULL;
            -ALTER TABLE part_pkg ADD taxclass varchar(80) NULL;
            -ALTER TABLE cust_main_county ADD taxclass varchar(80) NULL;
            -ALTER TABLE cust_main_county ADD exempt_amount decimal(10,2);
            -CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
            -CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
            -CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
            -CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum );
            -CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum );
            -CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum );
            -CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum );
            -CREATE UNIQUE INDEX cust_pay_batch_pkey ON cust_pay_batch ( paybatchnum );
            -CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname );
            -CREATE INDEX cust_pay2 ON cust_pay ( paynum );
            -CREATE INDEX cust_pay3 ON cust_pay ( custnum );
            -CREATE INDEX cust_pay4 ON cust_pay ( paybatch );
            -
            - -
          • If you are using PostgreSQL, apply the following changes to your database: -
            -CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum );
            -CREATE UNIQUE INDEX agent_type_pkey ON agent_type ( typenum );
            -CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum );
            -CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum );
            -CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum );
            -CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum );
            -CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum );
            -CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum );
            -CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum );
            -CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum );
            -CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum );
            -CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum );
            -CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum );
            -CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart );
            -CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum );
            -CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart );
            -CREATE UNIQUE INDEX port_pkey ON port ( portnum );
            -CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum );
            -CREATE UNIQUE INDEX session_pkey ON session ( sessionnum );
            -CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum );
            -CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum );
            -CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum );
            -CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum );
            -CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum );
            -
            -
          • If you wish to enable service/shipping addresses, apply the following - changes to your database: -
            -ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL;
            -ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL;
            -CREATE INDEX cust_main4 ON cust_main ( ship_last );
            -CREATE INDEX cust_main5 ON cust_main ( ship_company );
            -
            -
          • If you are using the signup server, reinstall it according to the instructions. The 1.3.x signup server is not compatible with 1.4.x. -
          • Run bin/dbdef-create username -
          • If you have svc_acct_sm records or service definitions: -
              -
            • Create a service definition with table svc_forward -
            • Run bin/fs-migrate-svc_acct_sm username -
            -
          • Or if you just have svc_acct records: -
              -
            • Order and provision a package for your default domain and note down the Service # or svcnum. -
            • UPDATE svc_acct SET domsvc = svcnum -
            • Update your service definitions to have default (or fixed) domsvc. -
            -
          • Run bin/fs-migrate-payrefusername -
          • Run bin/fs-migrate-part_svcusername -
          • After running bin/fs-migrate-payref, apply the following changes to your database: - -
            PostgreSQLMySQL, others
            -
            -CREATE TABLE cust_pay_temp (
            -  paynum int primary key,
            -  custnum int not null,
            -  paid decimal(10,2) not null,
            -  _date int null,
            -  payby char(4) not null,
            -  payinfo varchar(16) null,
            -  paybatch varchar(80) null,
            -  closed char(1) null
            -);
            -INSERT INTO cust_pay_temp SELECT paynum, custnum, paid, _date, payby, payinfo, paybatch, closed FROM cust_pay;
            -DROP TABLE cust_pay;
            -ALTER TABLE cust_pay_temp RENAME TO cust_pay;
            -CREATE UNIQUE INDEX cust_pay1 ON cust_pay (paynum);
            -CREATE TABLE cust_refund_temp (
            -  refundnum int primary key,
            -  custnum int not null,
            -  _date int null,
            -  refund decimal(10,2) not null,
            -  otaker varchar(8) not null,
            -  reason varchar(80) not null,
            -  payby char(4) not null,
            -  payinfo varchar(16) null,
            -  paybatch varchar(80) null,
            -  closed char(1) null
            -);
            -INSERT INTO cust_refund_temp SELECT refundnum, custnum, _date, refund, otaker, reason, payby, payinfo, '', closed from cust_refund;
            -DROP TABLE cust_refund;
            -ALTER TABLE cust_refund_temp RENAME TO cust_refund;
            -CREATE UNIQUE INDEX cust_refund1 ON cust_refund (refundnum);
            -
            -
            -
            -ALTER TABLE cust_pay DROP COLUMN invnum;
            -ALTER TABLE cust_refund DROP COLUMN crednum;
            -
            -
            -
          • IMPORTANT: After applying the second set of database changes, run bin/dbdef-create username again. -
          • IMPORTANT: run bin/create-history-tables username -
          • IMPORTANT: After running bin/create-history-tables, run bin/dbdef-create username again. -
          • As the freeside UNIX user, run bin/populate-msgcat username to populate the message catalog -
          • set the user_policy configuration value as appropriate for your site. -
          • set the locale configuration value to en_US. -
          • the mxmachines, nsmachines, arecords and cnamerecords configuration values have been deprecated. Set the defaultrecords configuration value instead. -
          • Create the `/usr/local/etc/freeside/cache.datasrc' directory - (owned by the freeside user). -
          • freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup. -
          • Set appropriate invoice events for your site. At the very least, you'll want to set some invoice events "After 0 days": a BILL invoice event to print invoices, a CARD invoice event to batch or run cards real-time, and a COMP invoice event to "pay" complimentary customers. If you were using the -i option to freeside-bill it should be removed. -
          • Use freeside-daily instead of freeside-bill. -
          • If you would like Freeside to notify your customers when their credit - cards and other billing arrangements are about to expire, arrange for - freeside-expiration-alerter to be run daily by cron or similar - facility. The message it sends can be configured from the - Configuration choice of the main menu as alerter_template. -
          • Export has been rewritten. If you were using the icradiusmachines, - icradius_mysqldest, icradius_mysqlsource, or icradius_secrets files, add - an appropriate "sqlradius" export to all relevant Service Definitions - instead. Use MySQL replication or - point the "sqlradius" export directly at your external ICRADIUS or FreeRADIUS - database (or through an SSL-necrypting proxy...) -
          - diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi deleted file mode 100755 index 0d2f1c238..000000000 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ /dev/null @@ -1,89 +0,0 @@ - -<% -# - -my $error =''; -my $pkgnum = ''; -if ( $cgi->param('error') ) { - $error = $cgi->param('error'); - $pkgnum = $cgi->param('pkgnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ or die "no pkgnum"; - $pkgnum = $1; -} - -#get package record -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -if ( $error ) { - #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill); - $cust_pkg->setup(str2time($cgi->param('setup'))); - $cust_pkg->bill(str2time($cgi->param('bill'))); -} - -#my $custnum = $cust_pkg->getfield('custnum'); -print header('Package Edit'); #, menubar( -# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", -# 'Main Menu' => popurl(2) -#)); - -#print info -my($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -my $otaker = $cust_pkg->getfield('otaker'); - -print '
          ', qq!!; - -print qq!Error: $error! - if $error; - -print ntable("#cccccc",2), - 'Package number', - $pkgnum, '', - 'Package', - $pkg, '', - 'Comment', - $comment, '', - 'Order taker', - $otaker, '', - 'Setup date'. - '', - 'Next bill date', - '', -; - -print 'Suspension date', - time2str("%D",$susp), '' - if $susp; - -#print 'Expiration date', -# time2str("%D",$expire), '' -# if $expire; -print 'Expiration date'. - '', - ''. - '
          (will cancel this package'. - ' when the date is reached)'. - ''; - -print 'Cancellation date', - time2str("%D",$cancel), '' - if $cancel; - -%> - -
          -
          - - diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi deleted file mode 100755 index 449456cdd..000000000 --- a/httemplate/edit/agent.cgi +++ /dev/null @@ -1,74 +0,0 @@ - -<% - -my $agent; -if ( $cgi->param('error') ) { - $agent = new FS::agent ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); -} elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); -} else { #adding - $agent = new FS::agent {}; -} -my $action = $agent->agentnum ? 'Edit' : 'Add'; -my $hashref = $agent->hashref; - -print header("$action Agent", menubar( - 'Main Menu' => $p, - 'View all agents' => $p. 'browse/agent.cgi', -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print '
          ', - qq!!, - "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)"; - -print &ntable("#cccccc", 2, ''), < - Agent - - - - Agent type - - - - - - - -END - -print qq!
          !; - -print < - - -END - -%> diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi deleted file mode 100755 index 637c710ab..000000000 --- a/httemplate/edit/agent_type.cgi +++ /dev/null @@ -1,63 +0,0 @@ - -<% - -my($agent_type); -if ( $cgi->param('error') ) { - $agent_type = new FS::agent_type ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); -} elsif ( $cgi->keywords ) { #editing - my( $query ) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent_type=qsearchs('agent_type',{'typenum'=>$1}); -} else { #adding - $agent_type = new FS::agent_type {}; -} -my $action = $agent_type->typenum ? 'Edit' : 'Add'; -my $hashref = $agent_type->hashref; - -print header("$action Agent Type", menubar( - 'Main Menu' => "$p", - 'View all agent types' => "${p}browse/agent_type.cgi", -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print '', - qq!!, - "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)"; - -print <
          Agent Type -

          Select which packages agents of this type may sell to customers
          -END - -foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { - print qq!
          $agent_type->getfield('typenum'), - 'pkgpart' => $part_pkg->getfield('pkgpart'), - }) - ? 'CHECKED ' - : '', - qq!VALUE="ON"> !, - qq!', $part_pkg->pkgpart. ": ". $part_pkg->getfield('pkg'), '', - ; -} - -print qq!

          !; - -print < - - -END - -%> diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi deleted file mode 100755 index 8cdf4509a..000000000 --- a/httemplate/edit/cust_bill_pay.cgi +++ /dev/null @@ -1,95 +0,0 @@ - -<% - -my($paynum, $amount, $invnum); -if ( $cgi->param('error') ) { - $paynum = $cgi->param('paynum'); - $amount = $cgi->param('amount'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $paynum = $1; - $amount = ''; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -print header("Apply Payment", ''); -print qq!Error: !, $cgi->param('error'), - "

          " - if $cgi->param('error'); -print < -END - -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); -die "payment $paynum not found!" unless $cust_pay; - -my $unapplied = $cust_pay->unapplied; - -print "Payment # $paynum". - qq!!. - '
          Date: '. time2str("%D", $cust_pay->_date). ''. - '
          Amount: $'. $cust_pay->paid. ''. - "
          Unapplied amount: \$$unapplied" - ; - -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); - -print < -function changed(what) { - cust_bill = what.options[what.selectedIndex].value; -END - -foreach my $cust_bill ( @cust_bill ) { - my $invnum = $cust_bill->invnum; - my $changeto = $cust_bill->owed < $unapplied - ? $cust_bill->owed - : $unapplied; - print < -END - -print qq!
          Invoice #"; - -print qq!
          Amount \$!; - -print < - -END - -print < - - -END - -%> diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi deleted file mode 100755 index aae0df2fc..000000000 --- a/httemplate/edit/cust_credit.cgi +++ /dev/null @@ -1,63 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my($custnum, $amount, $reason); -if ( $cgi->param('error') ) { - #$cust_credit = new FS::cust_credit ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit') - #} ); - $custnum = $cgi->param('custnum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $reason = $cgi->param('reason'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - $amount = ''; - #$refund = 'yes'; - $reason = ''; -} -my $_date = time; - -my $otaker = getotaker; - -my $p1 = popurl(1); - -print header("Post Credit", ''); -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print <config('countrydefault')); - - - - - - - -END - -print '

          Credit'. ntable("#cccccc", 2). - 'Date'. - time2str("%D",$_date). ''; - -print qq!Amount\$!; - -#print qq! Also post refund!; - -print qq!Reason!; - -print qq!Auto-apply
          to invoices!; - -print < -
          - - - - -END - -%> diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi deleted file mode 100755 index 1a97e1312..000000000 --- a/httemplate/edit/cust_credit_bill.cgi +++ /dev/null @@ -1,101 +0,0 @@ - -<% - -my($crednum, $amount, $invnum); -if ( $cgi->param('error') ) { - #$cust_credit_bill = new FS::cust_credit_bill ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') - #} ); - $crednum = $cgi->param('crednum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $crednum = $1; - $amount = ''; - #$refund = 'yes'; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -print header("Apply Credit", ''); -print qq!Error: !, $cgi->param('error'), - "

          " - if $cgi->param('error'); -print < -END - -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -die "credit $crednum not found!" unless $cust_credit; - -my $credited = $cust_credit->credited; - -print "Credit # $crednum". - qq!!. - '
          Date: '. time2str("%D", $cust_credit->_date). ''. - '
          Amount: $'. $cust_credit->amount. ''. - "
          Unapplied amount: \$$credited". - '
          Reason: '. $cust_credit->reason. '' - ; - -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); - -print < -function changed(what) { - cust_bill = what.options[what.selectedIndex].value; -END - -foreach my $cust_bill ( @cust_bill ) { - my $invnum = $cust_bill->invnum; - my $changeto = $cust_bill->owed < $cust_credit->credited - ? $cust_bill->owed - : $cust_credit->credited; - print < -END - -print qq!
          Invoice #"; - -print qq!
          Amount \$!; - -print < - -END - -print < - - -END - -%> diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi deleted file mode 100755 index cf8de2f13..000000000 --- a/httemplate/edit/cust_main.cgi +++ /dev/null @@ -1,460 +0,0 @@ - -<% - - #for misplaced logic below - #use FS::part_pkg; - - #for false laziness below (now more properly lazy) - #use FS::svc_acct_pop; - - #for (other) false laziness below - #use FS::agent; - #use FS::type_pkgs; - -my $conf = new FS::Conf; - -#get record - -my $error = ''; -my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart); -if ( $cgi->param('error') ) { - $error = $cgi->param('error'); - $cust_main = new FS::cust_main ( { - map { $_, scalar($cgi->param($_)) } fields('cust_main') - } ); - $custnum = $cust_main->custnum; - $saved_pkgpart = $cgi->param('pkgpart_svcpart') || ''; - if ( $saved_pkgpart =~ /^(\d+)_/ ) { - $saved_pkgpart = $1; - } else { - $saved_pkgpart = ''; - } - $username = $cgi->param('username'); - $password = $cgi->param('_password'); - $popnum = $cgi->param('popnum'); -} elsif ( $cgi->keywords ) { #editing - my( $query ) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum=$1; - $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - $saved_pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; -} else { - $custnum=''; - $cust_main = new FS::cust_main ( {} ); - $cust_main->otaker( &getotaker ); - $cust_main->referral_custnum( $cgi->param('referral_custnum') ); - $saved_pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; -} -$cgi->delete_all(); -my $action = $custnum ? 'Edit' : 'Add'; - -# top - -my $p1 = popurl(1); -print header("Customer $action", ''); -print qq!Error: !, $error, "" - if $error; - -print qq!
          !, - qq!!, - qq!Customer # !, ( $custnum ? "$custnum" : " (NEW)" ), - -; - -# agent - -my $r = qq!* !; - -my @agents = qsearch( 'agent', {} ); -#die "No agents created!" unless @agents; -die "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; -my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first -if ( scalar(@agents) == 1 ) { - print qq!!; -} else { - print qq!

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

          ${r}Advertising source "; - } -} - -#referring customer - -#print qq!

          Referring Customer: !; -if ( $cust_main->referral_custnum ) { - my $referring_cust_main = - qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ); - print '

          Referring Customer: '. - $cust_main->referral_custnum. ': '. - ( $referring_cust_main->company - || $referring_cust_main->last. ', '. $referring_cust_main->first ). - ''; -} elsif ( ! $conf->exists('disable_customer_referrals') ) { - print '

          Referring customer number: '; -} else { - print ''; -} - -# contact info - -my($last,$first,$ss,$company,$address1,$address2,$city,$zip)=( - $cust_main->last, - $cust_main->first, - $cust_main->ss, - $cust_main->company, - $cust_main->address1, - $cust_main->address2, - $cust_main->city, - $cust_main->zip, -); - -print "

          Billing address", &itable("#cccccc"), <${r}Contact name
          (last, first) -END - -print < , - - -END - -if ( $conf->exists('show_ss') ) { - print qq!SS#!; -} else { - print qq!!; -} - -print < -Company -${r}Address -${r}City${r}State -END - -#false laziness with ship state -my $countrydefault = $conf->config('countrydefault') || 'US'; -$cust_main->country( $countrydefault ) unless $cust_main->country; - -$cust_main->state( $conf->config('statedefault') || 'CA' ) - unless $cust_main->state || $cust_main->country ne 'US'; - -my($county_html, $state_html, $country_html) = - FS::cust_main_county::regionselector( $cust_main->county, - $cust_main->state, - $cust_main->country ); - -print "$county_html $state_html"; - -print qq!${r}Zip!; - -my($daytime,$night,$fax)=( - $cust_main->daytime, - $cust_main->night, - $cust_main->fax, -); - -print <${r}Country$country_html -Day Phone -Night Phone -Fax -END - -print "${r}required fields
          "; - -# service address - -if ( defined $cust_main->dbdef_table->column('ship_last') ) { - - print "\n", < - function changed(what) { - what.form.same.checked = false; - } - function samechanged(what) { - if ( what.checked ) { -END -print " what.form.ship_$_.value = what.form.$_.value;\n" - for (qw( last first company address1 address2 city zip daytime night fax )); -print < -END - - print '
          Service address ', - '(ship_last ) { - print ' CHECKED'; - foreach ( - qw( last first company address1 address2 city county state zip country - daytime night fax ) - ) { - $cust_main->set("ship_$_", $cust_main->get($_) ); - } - } - print '>same as billing address)
          '; - - my($ship_last,$ship_first,$ship_company,$ship_address1,$ship_address2,$ship_city,$ship_zip)=( - $cust_main->ship_last, - $cust_main->ship_first, - $cust_main->ship_company, - $cust_main->ship_address1, - $cust_main->ship_address2, - $cust_main->ship_city, - $cust_main->ship_zip, - ); - - print &itable("#cccccc"), <${r}Contact name
          (last, first) -END - - print < , - -END - - print < - Company - ${r}Address -   - ${r}City${r}State -END - - #false laziness with regular state - $cust_main->ship_country( $countrydefault ) unless $cust_main->ship_country; - - $cust_main->ship_state( $conf->config('statedefault') || 'CA' ) - unless $cust_main->ship_state || $cust_main->ship_country ne 'US'; - - my($ship_county_html, $ship_state_html, $ship_country_html) = - FS::cust_main_county::regionselector( $cust_main->ship_county, - $cust_main->ship_state, - $cust_main->ship_country, - 'ship_', - 'changed(this)', ); - - print "$ship_county_html $ship_state_html"; - - print qq!${r}Zip!; - - my($ship_daytime,$ship_night,$ship_fax)=( - $cust_main->ship_daytime, - $cust_main->ship_night, - $cust_main->ship_fax, - ); - - print <${r}Country$ship_country_html - Day Phone - Night Phone - Fax -END - - print "${r}required fields
          "; - -} - -# billing info - -sub expselect { - my $prefix = shift; - my( $m, $y ) = (0, 0); - if ( scalar(@_) ) { - my $date = shift || '01-2000'; - if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $m, $y ) = ( $2, $1 ); - } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $m, $y ) = ( $1, $3 ); - } else { - die "unrecognized expiration date format: $date"; - } - } - - my $return = qq!!; - for ( 2001 .. 2037 ) { - $return .= "Billing information", &itable("#cccccc"), - qq!tax eq "Y"; -print qq!>Tax Exempt!; -print qq!invoicing_list; -print qq! CHECKED! - if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') ) - || grep { $_ eq 'POST' } @invoicing_list; -print qq!>Postal mail invoice!; -my $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list ); -print qq!Email invoice !; - -print "Billing type", - "", - &table("#cccccc"), ""; - -my($payinfo, $payname)=( - $cust_main->payinfo, - $cust_main->payname, -); - -my %payby = ( - 'CARD' => qq!Credit card
          ${r}
          ${r}Exp !. expselect("CARD"). qq!
          ${r}Name on card
          !, - 'BILL' => qq!Billing
          P.O.
          ${r}Exp !. expselect("BILL", "12-2037"). qq!
          Attention
          !, - 'COMP' => qq!Complimentary
          ${r}Approved by
          ${r}Exp !. expselect("COMP"), -); -my %paybychecked = ( - 'CARD' => qq!Credit card
          ${r}
          ${r}Exp !. expselect("CARD", $cust_main->paydate). qq!
          ${r}Name on card
          !, - 'BILL' => qq!Billing
          P.O.
          ${r}Exp !. expselect("BILL", $cust_main->paydate). qq!
          Attention
          !, - 'COMP' => qq!Complimentary
          ${r}Approved by
          ${r}Exp !. expselect("COMP", $cust_main->paydate), -); -for (qw(CARD BILL COMP)) { - print qq!payby eq "$_") { - print qq! CHECKED> $paybychecked{$_}!; - } else { - print qq!> $payby{$_}!; - } -} - -print "$r required fields for each billing type"; - -if ( defined $cust_main->dbdef_table->column('comments') ) { - print "

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

          First package", &itable("#cccccc", "0 ALIGN=LEFT"), -#apiabuse & undesirable wrapping - print "

          First package", &itable("#cccccc"), - qq!"; - - #false laziness: (mostly) copied from edit/svc_acct.cgi - #$ulen = $svc_acct->dbdef_table->column('username')->length; - my $ulen = dbdef->table('svc_acct')->column('username')->length; - my $ulen2 = $ulen+2; - my $passwordmax = $conf->config('passwordmax') || 8; - my $pmax2 = $passwordmax + 2; - print <Username - -Password - -(blank to generate) -END - - print 'Access number' - . - &FS::svc_acct_pop::popselector($popnum). - '' - ; - } -} - -my $otaker = $cust_main->otaker; -print qq!!, - qq!
          !, - "", -; - -%> diff --git a/httemplate/edit/cust_main_county-expand.cgi b/httemplate/edit/cust_main_county-expand.cgi deleted file mode 100755 index 9f314a457..000000000 --- a/httemplate/edit/cust_main_county-expand.cgi +++ /dev/null @@ -1,54 +0,0 @@ - -<% - -my($taxnum, $delim, $expansion, $taxclass ); -my($query) = $cgi->keywords; -if ( $cgi->param('error') ) { - $taxnum = $cgi->param('taxnum'); - $delim = $cgi->param('delim'); - $expansion = $cgi->param('expansion'); - $taxclass = $cgi->param('taxclass'); -} else { - $query =~ /^(taxclass)?(\d+)$/ - or die "Illegal taxnum (query $query)"; - $taxclass = $1 ? 'taxclass' : ''; - $taxnum = $2; - $delim = 'n'; - $expansion = ''; -} - -my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die "cust_main_county.taxnum $taxnum not found"; -die "Can't expand entry!" if $cust_main_county->getfield('county'); - -my $p1 = popurl(1); -print header("Tax Rate (expand)", menubar( - 'Main Menu' => popurl(2), -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print < - - - Separate by -END -print 'line (broken on some browsers) or', - 'whitespace.'; -print < -
          - - - - -END - -%> diff --git a/httemplate/edit/cust_main_county.cgi b/httemplate/edit/cust_main_county.cgi deleted file mode 100755 index 7ef37a48d..000000000 --- a/httemplate/edit/cust_main_county.cgi +++ /dev/null @@ -1,66 +0,0 @@ - -<% - -print header("Edit tax rates", menubar( - 'Main Menu' => popurl(2), -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!
          !, &table(), < - Country - State - County - Taxclass - Tax - Exempt
          per
          month - -END - -foreach my $cust_main_county ( sort { $a->country cmp $b->country - or $a->state cmp $b->state - or $a->county cmp $b->county - } qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; - print < - $hashref->{country} -END - - print "{state} - ? ' BGCOLOR="#ffffff">'.$hashref->{state} - : ' BGCOLOR="#cccccc">(ALL)' - , ""; - - print "{county} - ? ' BGCOLOR="#ffffff">'. $hashref->{county} - : ' BGCOLOR="#cccccc">(ALL)' - , ""; - - print "{taxclass} - ? ' BGCOLOR="#ffffff">'. $hashref->{taxclass} - : ' BGCOLOR="#cccccc">(ALL)' - , ""; - - print qq!%!; - print qq!\$!; - print ''; - -} - -print < - - - - - -END - -%> diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi deleted file mode 100755 index f6ae7b299..000000000 --- a/httemplate/edit/cust_pay.cgi +++ /dev/null @@ -1,129 +0,0 @@ - -<% - -my $conf = new FS::Conf; - -my($link, $linknum, $paid, $payby, $payinfo, $quickpay); -if ( $cgi->param('error') ) { - $link = $cgi->param('link'); - $linknum = $cgi->param('linknum'); - $paid = $cgi->param('paid'); - $payby = $cgi->param('payby'); - $payinfo = $cgi->param('payinfo'); - $quickpay = $cgi->param('quickpay'); -} elsif ($cgi->keywords) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $link = 'invnum'; - $linknum = $1; - $paid = ''; - $payby = 'BILL'; - $payinfo = ""; - $quickpay = ''; -} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) { - $link = 'custnum'; - $linknum = $1; - $paid = ''; - $payby = 'BILL'; - $payinfo = ''; - $quickpay = $cgi->param('quickpay'); -} else { - die "illegal query ". $cgi->keywords; -} -my $_date = time; - -my $paybatch = "webui-$_date-$$-". rand() * 2**32; - -my $p1 = popurl(1); -print header("Post payment", ''); - -print qq!Error: !, $cgi->param('error'), - "

          " - if $cgi->param('error'); - -print < - - - -END - -my $custnum; -if ( $link eq 'invnum' ) { - - my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } ) - or die "unknown invnum $linknum"; - print "Invoice #$linknum". ntable("#cccccc",2). - 'Date'. - time2str("%D", $cust_bill->_date). ''. - 'Items'; - foreach ( $cust_bill->cust_bill_pkg ) { #false laziness with FS::cust_bill - if ( $_->pkgnum ) { - - my($cust_pkg)=qsearchs('cust_pkg', { 'pkgnum', $_->pkgnum } ); - my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->pkgpart}); - my($pkg)=$part_pkg->pkg; - - if ( $_->setup != 0 ) { - print "$pkg Setup
          "; # $money_char. sprintf("%10.2f",$_->setup); - print join('
          ', - map { " ". $_->[0]. ": ". $_->[1] } $cust_pkg->labels - ). '
          '; - } - - if ( $_->recur != 0 ) { - print - "$pkg (" . time2str("%x",$_->sdate) . " - " . - time2str("%x",$_->edate) . ")
          "; - #$money_char. sprintf("%10.2f",$_->recur) - print join('
          ', - map { '--->'. $_->[0]. ": ". $_->[1] } $cust_pkg->labels - ). '
          '; - } - - } else { #pkgnum Tax - print "Tax
          " # $money_char. sprintf("%10.2f",$_->setup) - if $_->setup != 0; - } - - } - print '

          '; - - $custnum = $cust_bill->custnum; - -} elsif ( $link eq 'custnum' ) { - $custnum = $linknum; -} - -print small_custview($custnum, $conf->config('countrydefault')); - -print qq!!; -print qq!!; - -print '

          Payment'. ntable("#cccccc", 2). - 'Date'. - time2str("%D",$_date). ''; - -print qq!Amount\$!; - -print qq!Payby$payby!; - -#payinfo (check # now as payby="BILL" hardcoded.. what to do later?) -print qq!Check #!; - -print qq!Auto-apply
          to invoices!; - -print ""; - -#paybatch -print qq!!; - -print < - - - - -END - -%> diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi deleted file mode 100755 index 485d601eb..000000000 --- a/httemplate/edit/cust_pkg.cgi +++ /dev/null @@ -1,117 +0,0 @@ - -<% - -my %pkg = (); -my %comment = (); -my %all_pkg = (); -my %all_comment = (); -#foreach (qsearch('part_pkg', { 'disabled' => '' })) { -# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); -# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -#} -foreach (qsearch('part_pkg', {} )) { - $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); - next if $_->disabled; - $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg'); - $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment'); -} - -my($custnum, %remove_pkg); -if ( $cgi->param('error') ) { - $custnum = $cgi->param('custnum'); - %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - %remove_pkg = (); -} - -my $p1 = popurl(1); -print header("Add/Edit Packages", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!
          !; - -print qq!!; - -#current packages -my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } ); - -if (@cust_pkg) { - print <
          -END - - my $count = 0 ; - print qq!! ; - foreach (@cust_pkg) { - print '' if $count == 0; - my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') ); - print qq!\n!; - $count ++ ; - if ($count == 2) - { - $count = 0 ; - print qq!\n! ; - } - } - print qq!
          $pkgnum: $all_pkg{$pkgpart} - $all_comment{$pkgpart}


          !; -} - -print <
          -END - -my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); -my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum }); - -my $count = 0; -my $pkgparts = 0; -print qq!!; -foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { - $pkgparts++; - my($pkgpart)=$type_pkgs->pkgpart; - next unless exists $pkg{$pkgpart}; #skip disabled ones - print qq!! if ( $count == 0 ); - my $value = $cgi->param("pkg$pkgpart") || 0; - print < - - $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}\n -END - $count ++ ; - if ( $count == 2 ) { - print qq!\n! ; - $count = 0; - } -} -print qq!
          !; - -unless ( $pkgparts ) { - my $p2 = popurl(2); - my $typenum = $agent->typenum; - my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } ); - my $atype = $agent_type->atype; - print <package definitions, or agent type -$atype not allowed to purchase -any packages.) -END -} - -#submit -print < - - - -END -%> diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi deleted file mode 100755 index ee9b1c6b3..000000000 --- a/httemplate/edit/msgcat.cgi +++ /dev/null @@ -1,58 +0,0 @@ - -<% - -print header("Edit Message catalog", menubar( -# 'Main Menu' => $p, -)), '
          '; - -print qq!Error: !. $cgi->param('error'). - '

          ' - if $cgi->param('error'); - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => 'en_US', - 'options' => { 'en_US'=>'en_US' }, - 'form_action' => 'process/msgcat.cgi', - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - "
          Messages for locale $layer
          ". table(). - "Code". - "Message"; - $html .= "en_US Message" unless $layer eq 'en_US'; - $html .= ''; - - #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } - # qsearch('msgcat', { 'locale' => $layer } ) ) { - foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { - $html .= - ''. $msgcat->msgnum. ''. $msgcat->msgcode. ''. - '!; - unless ( $layer eq 'en_US' ) { - my $en_msgcat = qsearchs('msgcat', { - 'locale' => 'en_US', - 'msgcode' => $msgcat->msgcode, - } ); - $html .= ''. $en_msgcat->msg. ''; - } - $html .= ''; - } - - $html .= '
          '; - - $html; - }, - -); - -print $widget->html; - -print < - - -END - -%> diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi deleted file mode 100755 index 324daeb90..000000000 --- a/httemplate/edit/part_bill_event.cgi +++ /dev/null @@ -1,192 +0,0 @@ - -<% - -if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { - $cgi->param('eventpart', $1); -} else { - $cgi->param('eventpart', ''); -} - -my ($query) = $cgi->keywords; -my $action = ''; -my $part_bill_event = ''; -if ( $cgi->param('error') ) { - $part_bill_event = new FS::part_bill_event ( { - map { $_, scalar($cgi->param($_)) } fields('part_bill_event') - } ); -} -if ( $query && $query =~ /^(\d+)$/ ) { - $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1}); -} else { - $part_bill_event ||= new FS::part_bill_event {}; -} -$action ||= $part_bill_event->pkgpart ? 'Edit' : 'Add'; -my $hashref = $part_bill_event->hashref; - -print header("$action Invoice Event Definition", menubar( - 'Main Menu' => popurl(2), - 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print '
          '. - ''; -print "Invoice Event #", $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)"; - -print ntable("#cccccc",2), <Payby -After days -END - -print 'Disabled'; -print '{disabled} eq "Y"; -print '>'; -print ''; - -print 'Action'; - -#print ntable(); - -#this is pretty kludgy right here. -tie my %events, 'Tie::IxHash', - - 'fee' => { - 'name' => 'Late fee', - 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );', - 'html' => - 'Amount '. - '
          Reason ', - 'weight' => 10, - }, - 'suspend' => { - 'name' => 'Suspend', - 'code' => '$cust_main->suspend();', - 'weight' => 10, - }, - 'cancel' => { - 'name' => 'Cancel', - 'code' => '$cust_main->cancel();', - 'weight' => 10, - }, - - 'addpost' => { - 'name' => 'Add postal invoicing', - 'code' => '$cust_main->invoicing_list_addpost(); "";', - 'weight' => 20, - }, - - 'comp' => { - 'name' => 'Pay invoice with a complimentary "payment"', - 'code' => '$cust_bill->comp();', - 'weight' => 30, - }, - - 'realtime-card' => { - 'name' => 'Run card with a Business::OnlinePayment realtime gateway', - 'code' => '$cust_bill->realtime_card();', - 'weight' => 30, - }, - - 'realtime-card-cybercash' => { - 'name' => '(deprecated) Run card with CyberCash CashRegister realtime gateway', - 'code' => '$cust_bill->realtime_card_cybercash();', - 'weight' => 30, - }, - - 'batch-card' => { - 'name' => 'Add card to the pending credit card batch', - 'code' => '$cust_bill->batch_card();', - 'weight' => 40, - }, - - 'send' => { - 'name' => 'Send invoice (email/print)', - 'code' => '$cust_bill->send();', - 'weight' => 50, - }, - - 'send_alternate' => { - 'name' => 'Send invoice (email/print) with alternate template', - 'code' => '$cust_bill->send(\'%%%templatename%%%\');', - 'html' => - '', - 'weight' => 50, - }, - - 'bill' => { - 'name' => 'Generate invoices (normally only used with a Late Fee event)', - 'code' => '$cust_main->bill();', - 'weight' => 60, - }, - - 'apply' => { - 'name' => 'Apply unapplied payments and credits', - 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; "";', - 'weight' => 70, - }, - - 'collect' => { - 'name' => 'Collect on invoices (normally only used with a Late Fee and Generate Invoice events)', - 'code' => '$cust_main->collect();', - 'weight' => 80, - }, - -; - -foreach my $event ( keys %events ) { - my %plandata = map { /^(\w+) (.*)$/; ($1, $2); } - split(/\n/, $part_bill_event->plandata); - my $html = $events{$event}{html}; - while ( $html =~ /%%%(\w+)%%%/ ) { - my $field = $1; - $html =~ s/%%%$field%%%/$plandata{$field}/; - } - - print ntable( "#cccccc", 2). - qq!plan; - print qq!VALUE="!. $event. ":". $events{$event}{weight}. ":". - encode_entities($events{$event}{code}). - qq!">$events{$event}{name}!; - print ''. $html. '' if $html; - print qq!!; - print ''; -} - -#print ''; - -print < - -END - -print qq!!; -%> - - - - - diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi deleted file mode 100644 index 486bd4300..000000000 --- a/httemplate/edit/part_export.cgi +++ /dev/null @@ -1,117 +0,0 @@ - -<% - -#if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) { -# $cgi->param('clone', $1); -#} else { -# $cgi->param('clone', ''); -#} - -my($query) = $cgi->keywords; -my $action = ''; -my $part_export = ''; -if ( $cgi->param('error') ) { - $part_export = new FS::part_export ( { - map { $_, scalar($cgi->param($_)) } fields('part_export') - } ); -} elsif ( $query =~ /^(\d+)$/ ) { - $part_export = qsearchs('part_export', { 'exportnum' => $1 } ); -} else { - $part_export = new FS::part_export; -} -$action ||= $part_export->exportnum ? 'Edit' : 'Add'; - -#my $exports = FS::part_export::export_info($svcdb); -my $exports = FS::part_export::export_info(); - -my %layers = map { $_ => "$_ - ". $exports->{$_}{desc} } keys %$exports; -$layers{''}=''; - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => $part_export->exporttype, - 'options' => \%layers, - 'form_name' => 'dummy', - 'form_action' => 'process/part_export.cgi', - 'form_text' => [qw( exportnum machine )], -# 'form_checkbox' => [qw()], - 'html_between' => "\n", - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - ntable("#cccccc",2); - - $html .= 'Description'. - $exports->{$layer}{notes}. '' - if $layer; - - foreach my $option ( keys %{$exports->{$layer}{options}} ) { - my $optinfo = $exports->{$layer}{options}{$option}; - my $label = $optinfo->{label}; - my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text'; - my $value = $cgi->param($option) - || $part_export->option($option) - || (exists $optinfo->{default} ? $optinfo->{default} : ''); - $html .= qq!$label!; - if ( $type eq 'select' ) { - $html .= qq!'; - } elsif ( $type eq 'textarea' ) { - $html .= qq!!; - } elsif ( $type eq 'text' ) { - $html .= qq!!; - } else { - $html .= "unknown type $type"; - } - $html .= ''; - } - $html .= ''; - - $html .= ''; - - $html .= ''; - - $html .= ''; - - $html; - }, -); - -%> -<%= header("$action Export", menubar( - 'Main Menu' => popurl(2), -), ' onLoad="visualize()"') -%> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -

          -<% } %> - -
          - - -<%= ntable("#cccccc",2) %> - - Export host - - - - - - Export - <%= $widget->html %> - - - diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi deleted file mode 100755 index b6ecff2d0..000000000 --- a/httemplate/edit/part_pkg.cgi +++ /dev/null @@ -1,464 +0,0 @@ - -<% - -if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) { - $cgi->param('clone', $1); -} else { - $cgi->param('clone', ''); -} -if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - $cgi->param('pkgnum', $1); -} else { - $cgi->param('pkgnum', ''); -} - -my ($query) = $cgi->keywords; -my $action = ''; -my $part_pkg = ''; -if ( $cgi->param('error') ) { - $part_pkg = new FS::part_pkg ( { - map { $_, scalar($cgi->param($_)) } fields('part_pkg') - } ); -} -if ( $cgi->param('clone') ) { - $action='Custom Pricing'; - my $old_part_pkg = - qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } ); - $part_pkg ||= $old_part_pkg->clone; - $part_pkg->disabled('Y'); -} elsif ( $query && $query =~ /^(\d+)$/ ) { - $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); -} else { - unless ( $part_pkg ) { - $part_pkg = new FS::part_pkg {}; - $part_pkg->plan('flat'); - } -} -unless ( $part_pkg->plan ) { #backwards-compat - $part_pkg->plan('flat'); - $part_pkg->plandata("setup_fee=". $part_pkg->setup. "\n". - "recur_fee=". $part_pkg->recur. "\n"); -} -$action ||= $part_pkg->pkgpart ? 'Edit' : 'Add'; -my $hashref = $part_pkg->hashref; - - -print header("$action Package Definition", menubar( - 'Main Menu' => popurl(2), - 'View all packages' => popurl(2). 'browse/part_pkg.cgi', -)); -#), ' onLoad="visualize()"'); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -#print ''; -print ''; - -#if ( $cgi->param('clone') ) { -# print qq!!; -#} -#if ( $cgi->param('pkgnum') ) { -# print qq!!; -#} -# -#print qq!!, -print "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)"; - -print ntable("#cccccc",2), <Package (customer-visable) -Comment (customer-hidden) -Frequency (months) of recurring fee  0=no recurring fee, 1=monthly, 3=quarterly, 12=yearly -Setup fee tax exempt -END - -print '{setuptax} eq "Y"; -print '>'; - -print < -Recurring fee tax exempt -END - -print '{recurtax} eq "Y"; -print '>'; - -print ''; - -my $conf = new FS::Conf; -#false laziness w/ view/cust_main.cgi quick order -if ( $conf->exists('enable_taxclasses') ) { - print 'Tax class'; -} else { - print - ''; -} - -print 'Disable new orders'; -print '{disabled} eq "Y"; -print '>'; -print ''; - -my $thead = "\n\n". ntable('#cccccc', 2). <Quan.Service -END - -#unless ( $cgi->param('clone') ) { -#dunno why... -unless ( 0 ) { - #print <', $thead; -

          Enter the quantity of each service this package includes.

          -END -} - -my @fixups = (); -my $count = 0; -my $columns = 3; -my @part_svc = qsearch( 'part_svc', { 'disabled' => '' } ); -foreach my $part_svc ( @part_svc ) { - my $svcpart = $part_svc->svcpart; - my $pkg_svc = qsearchs( 'pkg_svc', { - 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart, - 'svcpart' => $svcpart, - } ) || new FS::pkg_svc ( { - 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart, - 'svcpart' => $svcpart, - 'quantity' => 0, - }); - #? #next unless $pkg_svc; - - push @fixups, "pkg_svc$svcpart"; - - #unless ( defined ($cgi->param('clone')) && $cgi->param('clone') ) { - #dunno why... - unless ( 0 ) { - print ''; # if $count == 0 ; - print qq!quantity || 0, - qq!">!, $part_svc->getfield('svc'), ""; -# print "$thead" if ++$count == int(scalar(@part_svc) / 2); - $count+=1; - foreach ( 1 .. $columns-1 ) { - print "$thead" - if $count == int( $_ * scalar(@part_svc) / $columns ); - } - } else { - print qq!quantity || 0, qq!">\n!; - } -} - -#unless ( $cgi->param('clone') ) { -#dunno why... -unless ( 0 ) { - print ""; - #print ""; -} - -foreach my $f ( qw( clone pkgnum ) ) { - print qq!'; -} -print ''; - -# prolly should be in database -tie my %plans, 'Tie::IxHash', - 'flat' => { - 'name' => 'Flat rate (anniversary billing)', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_fee' ], - 'setup' => 'what.setup_fee.value', - 'recur' => 'what.recur_fee.value', - }, - - 'flat_delayed' => { - 'name' => 'Free for X days, then flat rate (anniversary billing)', - 'fields' => { - 'free_days' => { 'name' => 'Initial free days', - 'default' => 0, - }, - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - }, - 'fieldorder' => [ 'free_days', 'setup_fee', 'recur_fee' ], - 'setup' => '\'my $d = $cust_pkg->bill || $time; $d += 86400 * \' + what.free_days.value + \'; $cust_pkg->bill($d); $cust_pkg_mod_flag=1; \' + what.setup_fee.value', - 'recur' => 'what.recur_fee.value', - }, - - 'prorate' => { - 'name' => 'First partial month pro-rated, then flat-rate (1st of month billing)', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_fee' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'my $mnow = $sdate; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5]; my $mstart = timelocal(0,0,0,1,$mon,$year); my $mend = timelocal(0,0,0,1, $mon == 11 ? 0 : $mon+1, $year+($mon==11)); $sdate = $mstart; ( $part_pkg->freq - 1 ) * \' + what.recur_fee.value + \' / $part_pkg->freq + \' + what.recur_fee.value + \' / $part_pkg->freq * ($mend-$mnow) / ($mend-$mstart) ; \'', - }, - - 'subscription' => { - 'name' => 'First partial month full charge, then flat-rate (1st of month billing)', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_fee' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'my $mnow = $sdate; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5]; $sdate = timelocal(0,0,0,1,$mon,$year); \' + what.recur_fee.value', - }, - - 'flat_comission_cust' => { - 'name' => 'Flat rate with recurring commission per active customer', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - 'comission_amount' => { 'name' => 'Commission amount per month (per active customer)', - 'default' => 0, - }, - 'comission_depth' => { 'name' => 'Number of layers', - 'default' => 1, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_fee', 'comission_depth', 'comission_amount' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar($cust_pkg->cust_main->referral_cust_main_ncancelled(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'', - }, - - 'flat_comission' => { - 'name' => 'Flat rate with recurring commission per (any) active package', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - 'comission_amount' => { 'name' => 'Commission amount per month (per active package)', - 'default' => 0, - }, - 'comission_depth' => { 'name' => 'Number of layers', - 'default' => 1, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_fee', 'comission_depth', 'comission_amount' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar($cust_pkg->cust_main->referral_cust_pkg(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'', - }, - - 'flat_comission_pkg' => { - 'name' => 'Flat rate with recurring commission per (selected) active package', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Recurring fee for this package', - 'default' => 0, - }, - 'comission_amount' => { 'name' => 'Commission amount per month (per uncancelled package)', - 'default' => 0, - }, - 'comission_depth' => { 'name' => 'Number of layers', - 'default' => 1, - }, - 'comission_pkgpart' => { 'name' => 'Applicable packages
          (hold ctrl to select multiple packages)', - 'type' => 'select_multiple', - 'select_table' => 'part_pkg', - 'select_hash' => { 'disabled' => '' } , - 'select_key' => 'pkgpart', - 'select_label' => 'pkg', - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_fee', 'comission_depth', 'comission_amount', 'comission_pkgpart' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '""; var pkgparts = ""; for ( var c=0; c < document.flat_comission_pkg.comission_pkgpart.options.length; c++ ) { if (document.flat_comission_pkg.comission_pkgpart.options[c].selected) { pkgparts = pkgparts + document.flat_comission_pkg.comission_pkgpart.options[c].value + \', \'; } } what.recur.value = \'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar( grep { my $pkgpart = $_->pkgpart; grep { $_ == $pkgpart } ( \' + pkgparts + \' ) } $cust_pkg->cust_main->referral_cust_pkg(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'', - }, - - - - 'sesmon_hour' => { - 'name' => 'Base charge plus charge per-hour from the session monitor', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_flat' => { 'name' => 'Base monthly charge for this package', - 'default' => 0, - }, - 'recur_included_hours' => { 'name' => 'Hours included', - 'default' => 0, - }, - 'recur_hourly_charge' => { 'name' => 'Additional charge per hour', - 'default' => 0, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_flat', 'recur_included_hours', 'recur_hourly_charge' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'my $hours = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours;\'', - }, - - 'sesmon_minute' => { - 'name' => 'Base charge plus charge per-minute from the session monitor', - 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_flat' => { 'name' => 'Base monthly charge for this package', - 'default' => 0, - }, - 'recur_included_min' => { 'name' => 'Minutes included', - 'default' => 0, - }, - 'recur_minly_charge' => { 'name' => 'Additional charge per minute', - 'default' => 0, - }, - }, - 'fieldorder' => [ 'setup_fee', 'recur_flat', 'recur_included_min', 'recur_minly_charge' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'my $min = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 60 - \' + what.recur_included_min.value + \'; $min = 0 if $min < 0; \' + what.recur_flat.value + \' + \' + what.recur_minly_charge.value + \' * $min;\'', - - }, - -; - -my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); } - split("\n", $part_pkg->plandata ); - -tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans; - -my @form_select = (); -if ( $conf->exists('enable_taxclasses') ) { - push @form_select, 'taxclass'; -} else { - push @fixups, 'taxclass'; #hidden -} - - -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => $part_pkg->plan, - 'options' => \%options, - 'form_name' => 'dummy', - 'form_action' => 'process/part_pkg.cgi', - 'form_text' => [ qw(pkg comment freq clone pkgnum pkgpart), @fixups ], - 'form_checkbox' => [ qw(setuptax recurtax disabled) ], - 'form_select' => [ @form_select ], - 'fixup_callback' => sub { - #my $ = @_; - my $html = ''; - for my $p ( keys %plans ) { - $html .= "if ( what.plan.value == \"$p\" ) { - what.setup.value = $plans{$p}->{setup} ; - what.recur.value = $plans{$p}->{recur} ; - }\n"; - } - $html; - }, - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - ntable("#cccccc",2); - my $href = $plans{$layer}->{'fields'}; - foreach my $field ( exists($plans{$layer}->{'fieldorder'}) - ? @{$plans{$layer}->{'fieldorder'}} - : keys %{ $href } - ) { - - $html .= ''. $href->{$field}{'name'}. ''; - - if ( ! exists($href->{$field}{'type'}) ) { - $html .= qq!!; - } elsif ( $href->{$field}{'type'} eq 'select_multiple' ) { - $html .= qq!'; - } - - $html .= ''; - } - $html .= ''; - - $html .= ''. - '

          '; - - $html .= ''; - - $html .= '

          don\'t edit this unless you know what you\'re doing '. - ''. - ntable("#cccccc",2). - ''. - 'Setup expression
          '. - ''. - '

          '. - 'Recurring espression
          '. - ''. - '
          '. - ''. - ''; - - $html; - - }, -); - -%> - -
          -Price plan <%= $widget->html %> - - diff --git a/httemplate/edit/part_referral.cgi b/httemplate/edit/part_referral.cgi deleted file mode 100755 index f784dfa3e..000000000 --- a/httemplate/edit/part_referral.cgi +++ /dev/null @@ -1,48 +0,0 @@ - -<% - -my $part_referral; -if ( $cgi->param('error') ) { - $part_referral = new FS::part_referral ( { - map { $_, scalar($cgi->param($_)) } fields('part_referral') - } ); -} elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } ); -} else { #adding - $part_referral = new FS::part_referral {}; -} -my $action = $part_referral->refnum ? 'Edit' : 'Add'; -my $hashref = $part_referral->hashref; - -my $p1 = popurl(1); -print header("$action Advertising source", menubar( - 'Main Menu' => popurl(2), - 'View all advertising sources' => popurl(2). "browse/part_referral.cgi", -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!!; - -print qq!!; -#print "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)"; - -print < -END - -print qq!
          !; - -print < - - -END - -%> diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi deleted file mode 100755 index 4ccb770fb..000000000 --- a/httemplate/edit/part_svc.cgi +++ /dev/null @@ -1,232 +0,0 @@ - -<% - my $part_svc; - my $clone = ''; - if ( $cgi->param('error') ) { #error - $part_svc = new FS::part_svc ( { - map { $_, scalar($cgi->param($_)) } fields('part_svc') - } ); - } elsif ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone - #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query"; - $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } ) - or die "unknown svcpart: $1"; - $clone = $part_svc->svcpart; - $part_svc->svcpart(''); - } elsif ( $cgi->keywords ) { #edit - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ or die "malformed query: $query"; - $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } ) - or die "unknown svcpart: $1"; - } else { #adding - $part_svc = new FS::part_svc {}; - } - my $action = $part_svc->svcpart ? 'Edit' : 'Add'; - my $hashref = $part_svc->hashref; -# my $p_svcdb = $part_svc->svcdb || 'svc_acct'; - - - #" onLoad=\"visualize()\"" -%> - -<%= header("$action Service Definition", - menubar( 'Main Menu' => $p, - 'View all service definitions' => "${p}browse/part_svc.cgi" - ), - ) -%> - -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -<% } %> - - - - Service Part #<%= $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> -

          -Service
          -Disable new orders {disabled} eq 'Y' ? ' CHECKED' : '' %>>
          - -
          -Services are items you offer to your customers. -
          • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts -
          • svc_domain - Domains -
          • svc_acct_sm - deprecated (use svc_forward for new installations) Virtual domain mail aliasing. -
          • svc_forward - mail forwarding -
          • svc_www - Virtual domain website - -
          -For the selected table, you can give fields default or fixed (unchangable) -values. For example, a SLIP/PPP account may have a default (or perhaps fixed) -slipip of 0.0.0.0, while a POP mailbox will probably have a fixed -blank slipip as well as a fixed shell something like /bin/true or -/usr/bin/passwd. -

          - -<% -#these might belong somewhere else for other user interfaces -#pry need to eventually create stuff that's shared amount UIs -my %defs = ( - 'svc_acct' => { - 'dir' => 'Home directory', - 'uid' => 'UID (set to fixed and blank for dial-only)', - 'slipip' => 'IP address (Set to fixed and blank to disable dialin, or, set a value to be exported to RADIUS Framed-IP-Address. Use the special value 0e0 [zero e zero] to enable export to RADIUS without a Framed-IP-Address.)', -# 'popnum' => qq!POP number!, - 'popnum' => { - desc => 'Access number', - type => 'select', - select_table => 'svc_acct_pop', - select_key => 'popnum', - select_label => 'city', - }, - 'username' => 'Username', - 'quota' => '', - '_password' => 'Password', - 'gid' => 'GID (when blank, defaults to UID)', - 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', - 'finger' => 'GECOS', - 'domsvc' => { - desc =>'svcnum from svc_domain', - type =>'select', - select_table => 'svc_domain', - select_key => 'svcnum', - select_label => 'domain', - }, - 'usergroup' => { - desc =>'ICRADIUS/FreeRADIUS groups', - type =>'radius_usergroup_selector', - }, - }, - 'svc_domain' => { - 'domain' => 'Domain', - }, - 'svc_acct_sm' => { - 'domuser' => 'domuser@virtualdomain.com', - 'domuid' => 'UID where domuser@virtualdomain.com mail is forwarded', - 'domsvc' => 'svcnum from svc_domain for virtualdomain.com', - }, - 'svc_forward' => { - 'srcsvc' => 'service from which mail is to be forwarded', - 'dstsvc' => 'service to which mail is to be forwarded', - 'dst' => 'someone@another.domain.com to use when dstsvc is 0', - }, - 'svc_charge' => { - 'amount' => 'amount', - }, - 'svc_wo' => { - 'worker' => 'Worker', - '_date' => 'Date', - }, - 'svc_www' => { - #'recnum' => '', - #'usersvc' => '', - }, -); - - my @dbs = $hashref->{svcdb} - ? ( $hashref->{svcdb} ) - : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ); - - tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs; - my $widget = new HTML::Widgets::SelectLayers( - #'selected_layer' => $p_svcdb, - 'selected_layer' => $hashref->{svcdb} || 'svc_acct', - 'options' => \%svcdb, - 'form_name' => 'dummy', - 'form_action' => 'process/part_svc.cgi', - 'form_text' => [ qw( svc svcpart ) ], - 'form_checkbox' => [ 'disabled' ], - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!; - - my $columns = 3; - my $count = 0; - my @part_export = - map { qsearch( 'part_export', {exporttype => $_ } ) } - keys %{FS::part_export::export_info($layer)}; - $html .= '

          '. table(). - table(). "Exports"; - foreach my $part_export ( @part_export ) { - $html .= ' $part_export->exportnum, - svcpart => $clone || $part_svc->svcpart }); - $html .= '> '. $part_export->exporttype. ' to '. $part_export->machine. - ''; - $count++; - $html .= '' unless $count % $columns; - } - $html .= '

          '; - - $html .= table(). "FieldModifier"; - #yucky kludge - my @fields = defined( $FS::Record::dbdef->table($layer) ) - ? grep { $_ ne 'svcnum' } fields($layer) - : (); - push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge - $part_svc->svcpart($clone) if $clone; #haha, undone below - foreach my $field (@fields) { - my $part_svc_column = $part_svc->part_svc_column($field); - my $value = $cgi->param('error') - ? $cgi->param("${layer}__${field}") - : $part_svc_column->columnvalue; - my $flag = $cgi->param('error') - ? $cgi->param("${layer}__${field}_flag") - : $part_svc_column->columnflag; - my $def = $defs{$layer}{$field}; - my $desc = ref($def) ? $def->{desc} : $def; - - $html .= "$field"; - $html .= "- $desc" if $desc; - $html .= ""; - $html .= - qq!Off". - qq!Default ". - qq!Fixed ". - '
          '; - if ( ref($def) ) { - if ( $def->{type} eq 'select' ) { - $html .= qq!'; - } elsif ( $def->{type} eq 'radius_usergroup_selector' ) { - $html .= FS::svc_acct::radius_usergroup_selector( - [ split(',', $value) ], "${layer}__${field}" ); - } else { - $html .= 'unknown type'. $def->{type}; - } - } else { - $html .= - qq!!; - } - $html .= "\n"; - } - $part_svc->svcpart('') if $clone; #undone - $html .= ""; - - $html .= '
          '; - - $html; - - }, - ); - -%> -Table <%= $widget->html %> - - - diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi deleted file mode 100755 index 2e0352c76..000000000 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ /dev/null @@ -1,20 +0,0 @@ -<% - -my $pkgnum = $cgi->param('pkgnum') or die; -my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $old->hash; -$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : ''; -$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : ''; -$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : ''; -my $new = new FS::cust_pkg \%hash; - -my $error = $new->replace($old); - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $pkgnum); -} - -%> diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi deleted file mode 100755 index 182eeab41..000000000 --- a/httemplate/edit/process/agent.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $agentnum = $cgi->param('agentnum'); - -my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; - -my $new = new FS::agent ( { - map { - $_, scalar($cgi->param($_)); - } fields('agent') -} ); - -my $error; -if ( $agentnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $agentnum=$new->getfield('agentnum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/agent.cgi"); -} - -%> diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi deleted file mode 100755 index 516594573..000000000 --- a/httemplate/edit/process/agent_type.cgi +++ /dev/null @@ -1,55 +0,0 @@ -<% - -my $typenum = $cgi->param('typenum'); -my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; - -my $new = new FS::agent_type ( { - map { - $_, scalar($cgi->param($_)); - } fields('agent_type') -} ); - -my $error; -if ( $typenum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $typenum=$new->getfield('typenum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); -} else { - - #false laziness w/ edit/process/part_svc.cgi - foreach my $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->delete; - die $error if $error; - - } elsif ( $cgi->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=new FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - $error= $type_pkgs->insert; - die $error if $error; - } - - } - - print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); -} - -%> diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi deleted file mode 100755 index 0c33506a8..000000000 --- a/httemplate/edit/process/cust_bill_pay.cgi +++ /dev/null @@ -1,31 +0,0 @@ -<% - -$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ) - or die "No such paynum"; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } ) - or die "Bogus credit: not attached to customer"; - -my $custnum = $cust_main->custnum; - -my $new = new FS::cust_bill_pay ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount invnum) - } fields('cust_bill_pay') -} ); - -my $error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - - -%> diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi deleted file mode 100755 index ac92631f8..000000000 --- a/httemplate/edit/process/cust_credit.cgi +++ /dev/null @@ -1,30 +0,0 @@ -<% - -$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -my $custnum = $1; - -$cgi->param('otaker',getotaker); - -my $new = new FS::cust_credit ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount otaker reason) - } fields('cust_credit') -} ); - -my $error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); -} else { - if ( $cgi->param('apply') eq 'yes' ) { - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) - or die "unknown custnum $custnum"; - $cust_main->apply_credits; - } - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - - -%> diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi deleted file mode 100755 index 23e2e6ce5..000000000 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ /dev/null @@ -1,43 +0,0 @@ -<% - -$cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!"; -my $crednum = $1; - -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ) - or die "No such crednum"; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_credit->custnum } ) - or die "Bogus credit: not attached to customer"; - -my $custnum = $cust_main->custnum; - -my $new; -if ($cgi->param('invnum') =~ /^Refund$/) { - $new = new FS::cust_refund ( { - 'reason' => $cust_credit->reason, - 'refund' => $cgi->param('amount'), - 'payby' => 'BILL', - #'_date' => $cgi->param('_date'), - 'payinfo' => 'Cash', - 'crednum' => $crednum, - } ); -} else { - $new = new FS::cust_credit_bill ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount invnum) - } fields('cust_credit_bill') - } ); -} - -my $error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - - -%> diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi deleted file mode 100755 index 6ce60d14a..000000000 --- a/httemplate/edit/process/cust_main.cgi +++ /dev/null @@ -1,119 +0,0 @@ -<% - -my $error = ''; - -#unmunge stuff - -$cgi->param('tax','') unless defined $cgi->param('tax'); - -$cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); - -my $payby = $cgi->param('payby'); -if ( $payby ) { - $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); - $cgi->param('paydate', - $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); - $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); -} - -$cgi->param('otaker', &getotaker ); - -my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); -push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); - -#create new record object - -my $new = new FS::cust_main ( { - map { - $_, scalar($cgi->param($_)) -# } qw(custnum agentnum last first ss company address1 address2 city county -# state zip daytime night fax payby payinfo paydate payname tax -# otaker refnum) - } fields('cust_main') -} ); - -if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { - $new->setfield("ship_$_", '') foreach qw( - last first company address1 address2 city county state zip - country daytime night fax - ); -} - -#perhaps this stuff should go to cust_main.pm -my $cust_pkg = ''; -my $svc_acct = ''; -if ( $new->custnum eq '' ) { - - if ( $cgi->param('pkgpart_svcpart') ) { - my $x = $cgi->param('pkgpart_svcpart'); - $x =~ /^(\d+)_(\d+)$/; - my($pkgpart, $svcpart) = ($1, $2); - #false laziness: copied from FS::cust_pkg::order (which should become a - #FS::cust_main method) - my(%part_pkg); - # generate %part_pkg - # $part_pkg{$pkgpart} is true iff $custnum may purchase $pkgpart - my $agent = qsearchs('agent',{'agentnum'=> $new->agentnum }); - #my($type_pkgs); - #foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { - # my($pkgpart)=$type_pkgs->pkgpart; - # $part_pkg{$pkgpart}++; - #} - # $pkgpart_href->{PKGPART} is true iff $custnum may purchase $pkgpart - my $pkgpart_href = $agent->pkgpart_hashref; - #eslaf - - # this should wind up in FS::cust_pkg! - $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't". - "purchase pkgpart ". $pkgpart - #unless $part_pkg{ $pkgpart }; - unless $pkgpart_href->{ $pkgpart }; - - $cust_pkg = new FS::cust_pkg ( { - #later 'custnum' => $custnum, - 'pkgpart' => $pkgpart, - } ); - $error ||= $cust_pkg->check; - - #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } ); - - #$error ||= $cust_svc->check; - - $svc_acct = new FS::svc_acct ( { - 'svcpart' => $svcpart, - 'username' => $cgi->param('username'), - '_password' => $cgi->param('_password'), - 'popnum' => $cgi->param('popnum'), - } ); - - my $y = $svc_acct->setdefault; # arguably should be in new method - $error ||= $y unless ref($y); - #and just in case you were silly - $svc_acct->svcpart($svcpart); - $svc_acct->username($cgi->param('username')); - $svc_acct->_password($cgi->param('_password')); - $svc_acct->popnum($cgi->param('popnum')); - - $error ||= $svc_acct->check; - - } elsif ( $cgi->param('username') ) { #good thing to catch - $error = "Can't assign username without a package!"; - } - - use Tie::RefHash; - tie my %hash, 'Tie::RefHash'; - %hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg; - $error ||= $new->insert( \%hash, \@invoicing_list ); -} else { #create old record object - my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); - $error ||= "Old record not found!" unless $old; - $error ||= $new->replace($old, \@invoicing_list); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum); -} -%> diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi deleted file mode 100755 index 8e67140a8..000000000 --- a/httemplate/edit/process/cust_main_county-collapse.cgi +++ /dev/null @@ -1,35 +0,0 @@ -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ or die "Illegal taxnum!"; -my $taxnum = $1; -my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die ("Unknown taxnum!"); - -#really should do this in a .pm & start transaction - -foreach my $delete ( qsearch('cust_main_county', { - 'country' => $cust_main_county->country, - 'state' => $cust_main_county->state - } ) ) { -# unless ( qsearch('cust_main',{ -# 'state' => $cust_main_county->getfield('state'), -# 'county' => $cust_main_county->getfield('county'), -# 'country' => $cust_main_county->getfield('country'), -# } ) ) { - my $error = $delete->delete; - die $error if $error; -# } else { - #should really fix the $cust_main record -# } - -} - -$cust_main_county->taxnum(''); -$cust_main_county->county(''); -my $error = $cust_main_county->insert; -die $error if $error; - -print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); - -%> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi deleted file mode 100755 index a452711c1..000000000 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ /dev/null @@ -1,58 +0,0 @@ -<% - -$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; -my $taxnum = $1; -my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die ("Unknown taxnum!"); - -my @expansion; -if ( $cgi->param('delim') eq 'n' ) { - @expansion=split(/\n/,$cgi->param('expansion')); -} elsif ( $cgi->param('delim') eq 's' ) { - @expansion=split(' ',$cgi->param('expansion')); -} else { - die "Illegal delim!"; -} - -@expansion=map { - unless ( /^\s*([\w\- ]+)\s*$/ ) { - $cgi->param('error', "Illegal item in expansion"); - print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string ); - myexit(); - } - $1; -} @expansion; - -foreach ( @expansion) { - my(%hash)=$cust_main_county->hash; - my($new)=new FS::cust_main_county \%hash; - $new->setfield('taxnum',''); - if ( $cgi->param('taxclass') ) { - $new->setfield('taxclass', $_); - } elsif ( ! $cust_main_county->state ) { - $new->setfield('state',$_); - } else { - $new->setfield('county',$_); - } - #if (datasrc =~ m/Pg/) - #{ - # $new->setfield('tax',0.0); - #} - my($error)=$new->insert; - die $error if $error; -} - -unless ( qsearch( 'cust_main', { - 'state' => $cust_main_county->state, - 'county' => $cust_main_county->county, - 'country' => $cust_main_county->country, - } ) - || ! @expansion -) { - my($error)=($cust_main_county->delete); - die $error if $error; -} - -print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); - -%> diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi deleted file mode 100755 index 990a23919..000000000 --- a/httemplate/edit/process/cust_main_county.cgi +++ /dev/null @@ -1,25 +0,0 @@ -<% - -foreach ( grep { /^tax\d+$/ } $cgi->param ) { - /^tax(\d+)$/ or die "Illegal form $_!"; - my($taxnum)=$1; - my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die "Couldn't find taxnum $taxnum!"; - my $exempt_amount = $cgi->param("exempt_amount$taxnum"); - next unless $old->tax ne $cgi->param("tax$taxnum") - || $old->exempt_amount ne $exempt_amount; - my %hash = $old->hash; - $hash{tax} = $cgi->param("tax$taxnum"); - $hash{exempt_amount} = $exempt_amount; - my($new)=new FS::cust_main_county \%hash; - my($error)=$new->replace($old); - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); - myexit(); - } -} - -print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); - -%> diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi deleted file mode 100755 index 82442ae00..000000000 --- a/httemplate/edit/process/cust_pay.cgi +++ /dev/null @@ -1,39 +0,0 @@ -<% - -$cgi->param('linknum') =~ /^(\d+)$/ - or die "Illegal linknum: ". $cgi->param('linknum'); -my $linknum = $1; - -$cgi->param('link') =~ /^(custnum|invnum)$/ - or die "Illegal link: ". $cgi->param('link'); -my $link = $1; - -my $new = new FS::cust_pay ( { - $link => $linknum, - map { - $_, scalar($cgi->param($_)); - } qw(paid _date payby payinfo paybatch) - #} fields('cust_pay') -} ); - -my $error = $new->insert; - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); -} elsif ( $link eq 'invnum' ) { - print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); -} elsif ( $link eq 'custnum' ) { - if ( $cgi->param('apply') eq 'yes' ) { - my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum }) - or die "unknown custnum $linknum"; - $cust_main->apply_payments; - } - if ( $cgi->param('quickpay') eq 'yes' ) { - print $cgi->redirect(popurl(3). "search/cust_main-quickpay.html"); - } else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); - } -} - -%> diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi deleted file mode 100755 index f8c9f5151..000000000 --- a/httemplate/edit/process/cust_pkg.cgi +++ /dev/null @@ -1,36 +0,0 @@ -<% - -my $error = ''; - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/; -my $custnum = $1; - -my @remove_pkgnums = map { - /^(\d+)$/ or die "Illegal remove_pkg value!"; - $1; -} $cgi->param('remove_pkg'); - -my @pkgparts; -foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { - if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { - my $num_pkgs = $1; - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } - } else { - $error = "Illegal quantity"; - last; - } -} - -$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - -%> diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi deleted file mode 100755 index b8c3f62a1..000000000 --- a/httemplate/edit/process/domain_record.cgi +++ /dev/null @@ -1,34 +0,0 @@ -<% - -my $recnum = $cgi->param('recnum'); - -my $old = qsearchs('agent',{'recnum'=>$recnum}) if $recnum; - -my $new = new FS::domain_record ( { - map { - $_, scalar($cgi->param($_)); - } fields('domain_record') -} ); - -my $error; -if ( $recnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $recnum=$new->getfield('recnum'); -} - -if ( $error ) { -# $cgi->param('error', $error); -# print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); - #no edit screen to send them back to -%> - -<% - eidiot($error); -} else { - my $svcnum = $new->svcnum; - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi deleted file mode 100644 index 1f94f6668..000000000 --- a/httemplate/edit/process/msgcat.cgi +++ /dev/null @@ -1,20 +0,0 @@ -<% - -my $error; -foreach my $param ( grep { /^\d+$/ } $cgi->param ) { - my $old = qsearchs('msgcat', { msgnum=>$param } ); - next if $old->msg eq $cgi->param($param); #no need to update identical records - my $new = new FS::msgcat { $old->hash }; - $new->msg($cgi->param($param)); - $error = $new->replace($old); - last if $error; -} - -if ( $error ) { - $cgi->param('error',$error); - print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/msgcat.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi deleted file mode 100755 index 4049ade80..000000000 --- a/httemplate/edit/process/part_bill_event.cgi +++ /dev/null @@ -1,53 +0,0 @@ -<% - -my $eventpart = $cgi->param('eventpart'); - -my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart; - -#s/days/seconds/ -$cgi->param('seconds', $cgi->param('days') * 86400 ); - -my $error; -if ( ! $cgi->param('plan_weight_eventcode') ) { - $error = "Must select an action"; -} else { - - $cgi->param('plan_weight_eventcode') =~ /^([\w\-]+):(\d+):(.*)$/ - or die "illegal plan_weight_eventcode:". - $cgi->param('plan_weight_eventcode'); - $cgi->param('plan', $1); - $cgi->param('weight', $2); - my $eventcode = $3; - my $plandata = ''; - while ( $eventcode =~ /%%%(\w+)%%%/ ) { - my $field = $1; - my $value = $cgi->param($field); - $eventcode =~ s/%%%$field%%%/$value/; - $plandata .= "$field $value\n"; - } - $cgi->param('eventcode', $eventcode); - $cgi->param('plandata', $plandata); - - my $new = new FS::part_bill_event ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_bill_event'), - } ); - - if ( $eventpart ) { - $error = $new->replace($old); - } else { - $error = $new->insert; - $eventpart = $new->getfield('eventpart'); - } -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_bill_event.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3)."browse/part_bill_event.cgi"); -} - -%> - diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi deleted file mode 100644 index fa009edbb..000000000 --- a/httemplate/edit/process/part_export.cgi +++ /dev/null @@ -1,39 +0,0 @@ -<% - -my $exportnum = $cgi->param('exportnum'); - -my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; - -#fixup options -#warn join('-', split(',',$cgi->param('options'))); -my %options = map { - my $value = $cgi->param($_); - $value =~ s/\r\n/\n/g; #browsers? (textarea) - $_ => $value; -} split(',', $cgi->param('options')); - -my $new = new FS::part_export ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_export') -} ); - -my $error; -if ( $exportnum ) { - #warn $old; - #warn $exportnum; - #warn $new->machine; - $error = $new->replace($old,\%options); -} else { - $error = $new->insert(\%options); -# $exportnum = $new->exportnum; -} - -if ( $error ) { - $cgi->param('error', $error ); - print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/part_export.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi deleted file mode 100755 index d489426f9..000000000 --- a/httemplate/edit/process/part_pkg.cgi +++ /dev/null @@ -1,109 +0,0 @@ -<% - -my $dbh = dbh; - -my $pkgpart = $cgi->param('pkgpart'); - -my $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; - -#fixup plandata -my $plandata = $cgi->param('plandata'); -my @plandata = split(',', $plandata); -$cgi->param('plandata', - join('', map { "$_=". join(', ', $cgi->param($_)). "\n" } @plandata ) -); - -foreach (qw( setuptax recurtax disabled )) { - $cgi->param($_, '') unless defined $cgi->param($_); -} - -my $new = new FS::part_pkg ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_pkg') -} ); - -#warn "setuptax: ". $new->setuptax; -#warn "recurtax: ". $new->recurtax; - -#most of the stuff below should move to part_pkg.pm - -foreach my $part_svc ( qsearch('part_svc', {} ) ) { - my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; - unless ( $quantity =~ /^(\d+)$/ ) { - $cgi->param('error', "Illegal quantity" ); - print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - myexit(); - } -} - -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; -local $SIG{PIPE} = 'IGNORE'; - -local $FS::UID::AutoCommit = 0; - -my $error; -if ( $pkgpart ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $pkgpart=$new->pkgpart; -} -if ( $error ) { - $dbh->rollback; - $cgi->param('error', $error ); - print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - myexit(); -} - -foreach my $part_svc (qsearch('part_svc',{})) { - my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; - my $old_pkg_svc = qsearchs('pkg_svc', { - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->svcpart, - } ); - my $old_quantity = $old_pkg_svc ? $old_pkg_svc->quantity : 0; - next unless $old_quantity != $quantity; #!here - my $new_pkg_svc = new FS::pkg_svc( { - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->svcpart, - 'quantity' => $quantity, - } ); - if ( $old_pkg_svc ) { - my $myerror = $new_pkg_svc->replace($old_pkg_svc); - if ( $myerror ) { - $dbh->rollback; - die $myerror; - } - } else { - my $myerror = $new_pkg_svc->insert; - if ( $myerror ) { - $dbh->rollback; - die $myerror; - } - } -} - -unless ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - $dbh->commit or die $dbh->errstr; - print $cgi->redirect(popurl(3). "browse/part_pkg.cgi"); -} else { - my($old_cust_pkg) = qsearchs( 'cust_pkg', { 'pkgnum' => $1 } ); - my %hash = $old_cust_pkg->hash; - $hash{'pkgpart'} = $pkgpart; - my($new_cust_pkg) = new FS::cust_pkg \%hash; - my $myerror = $new_cust_pkg->replace($old_cust_pkg); - if ( $myerror ) { - $dbh->rollback; - die "Error modifying cust_pkg record: $myerror\n"; - } - - $dbh->commit or die $dbh->errstr; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new_cust_pkg->custnum); -} - -%> diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi deleted file mode 100755 index fd2c01506..000000000 --- a/httemplate/edit/process/part_referral.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $refnum = $cgi->param('refnum'); - -my $new = new FS::part_referral ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_referral') -} ); - -my $error; -if ( $refnum ) { - my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); - die "(Old) Record not found!" unless $old; - $error = $new->replace($old); -} else { - $error = $new->insert; -} -$refnum=$new->refnum; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi deleted file mode 100755 index 859670b17..000000000 --- a/httemplate/edit/process/part_svc.cgi +++ /dev/null @@ -1,62 +0,0 @@ -<% - -my $svcpart = $cgi->param('svcpart'); - -my $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; - -$cgi->param( 'svc_acct__usergroup', - join(',', $cgi->param('svc_acct__usergroup') ) ); - -my $new = new FS::part_svc ( { - map { - $_, scalar($cgi->param($_)); -# } qw(svcpart svc svcdb) - } ( fields('part_svc'), - map { my $svcdb = $_; - my @fields = fields($svcdb); - push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge - map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields; - } grep defined( $FS::Record::dbdef->table($_) ), - qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) - ) -} ); - -my $error; -if ( $svcpart ) { - $error = $new->replace($old, '1.3-COMPAT', [ 'usergroup' ] ); -} else { - $error = $new->insert( [ 'usergroup' ] ); - $svcpart=$new->getfield('svcpart'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); -} else { - - #false laziness w/ edit/process/agent_type.cgi - foreach my $part_export (qsearch('part_export',{})) { - my $exportnum = $part_export->exportnum; - my $export_svc = qsearchs('export_svc', { - 'exportnum' => $part_export->exportnum, - 'svcpart' => $new->svcpart, - } ); - if ( $export_svc && ! $cgi->param("exportnum". $part_export->exportnum) ) { - $error = $export_svc->delete; - die $error if $error; - } elsif ( $cgi->param("exportnum". $part_export->exportnum) - && ! $export_svc ) { - $export_svc = new FS::export_svc ( { - 'exportnum' => $part_export->exportnum, - 'svcpart' => $new->svcpart, - } ); - $error = $export_svc->insert; - die $error if $error; - } - - } - - print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); -} - -%> diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi deleted file mode 100644 index 477f58508..000000000 --- a/httemplate/edit/process/quick-charge.cgi +++ /dev/null @@ -1,32 +0,0 @@ -<% - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/ - or die 'illegal custnum '. $cgi->param('custnum'); -my $custnum = $1; - -$cgi->param('amount') =~ /^\s*(\d+(\.\d{1,2})?)\s*$/ - or die 'illegal amount '. $cgi->param('amount'); -my $amount = $1; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) - or die "unknown custnum $custnum"; - -my $error = $cust_main->charge( - $amount, - $cgi->param('pkg'), - '$'. sprintf("%.2f",$amount), - $cgi->param('taxclass') -); - -if ($error) { -%> - -<% - eidiot($error); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" ); -} - -%> - diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi deleted file mode 100644 index a8f5b1453..000000000 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ /dev/null @@ -1,24 +0,0 @@ -<% - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/ - or die 'illegal custnum '. $cgi->param('custnum'); -my $custnum = $1; -$cgi->param('pkgpart') =~ /^(\d+)$/ - or die 'illegal pkgpart '. $cgi->param('pkgpart'); -my $pkgpart = $1; - -my @cust_pkg = (); -my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); - -if ($error) { -%> - -<% - eidiot($error); -} else { - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum ); -} - -%> - diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi deleted file mode 100755 index 950a8602f..000000000 --- a/httemplate/edit/process/svc_acct.cgi +++ /dev/null @@ -1,49 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $old; -if ( $svcnum ) { - $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) - or die "fatal: can't find account (svcnum $svcnum)!"; -} else { - $old = ''; -} - -#unmunge popnum -$cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] ); - -#unmunge passwd -if ( $cgi->param('_password') eq '*HIDDEN*' ) { - die "fatal: no previous account to recall hidden password from!" unless $old; - $cgi->param('_password',$old->getfield('_password')); -} - -#unmunge usergroup -$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] ); - -my $new = new FS::svc_acct ( { - map { - $_, scalar($cgi->param($_)); - #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - # shell quota slipip) - } ( fields('svc_acct'), qw( pkgnum svcpart usergroup ) ) -} ); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->svcnum; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $svcnum ); -} - -%> diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi deleted file mode 100755 index 46ad74d62..000000000 --- a/httemplate/edit/process/svc_acct_pop.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $popnum = $cgi->param('popnum'); - -my $old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; - -my $new = new FS::svc_acct_pop ( { - map { - $_, scalar($cgi->param($_)); - } fields('svc_acct_pop') -} ); - -my $error = ''; -if ( $popnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $popnum=$new->getfield('popnum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi"); -} - -%> diff --git a/httemplate/edit/process/svc_acct_sm.cgi b/httemplate/edit/process/svc_acct_sm.cgi deleted file mode 100755 index 41d03fb92..000000000 --- a/httemplate/edit/process/svc_acct_sm.cgi +++ /dev/null @@ -1,34 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum =$1; - -my $old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum; - -#unmunge domsvc and domuid -#$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] ); -#$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] ); - -my $new = new FS::svc_acct_sm ( { - map { - ($_, scalar($cgi->param($_))); - #} qw(svcnum pkgnum svcpart domuser domuid domsvc) - } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) ) -} ); - -my $error = ''; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct_sm.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_acct_sm.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi deleted file mode 100755 index 19f8eb4f8..000000000 --- a/httemplate/edit/process/svc_domain.cgi +++ /dev/null @@ -1,31 +0,0 @@ -<% - -#remove this to actually test the domains! -$FS::svc_domain::whois_hack = 1; - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $new = new FS::svc_domain ( { - map { - $_, scalar($cgi->param($_)); - #} qw(svcnum pkgnum svcpart domain action purpose) - } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) ) -} ); - -my $error = ''; -if ($cgi->param('svcnum')) { - $error="Can't modify a domain!"; -} else { - $error=$new->insert; - $svcnum=$new->svcnum; -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi deleted file mode 100755 index bb066d8a6..000000000 --- a/httemplate/edit/process/svc_forward.cgi +++ /dev/null @@ -1,29 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum =$1; - -my $old = qsearchs('svc_forward',{'svcnum'=>$svcnum}) if $svcnum; - -my $new = new FS::svc_forward ( { - map { - ($_, scalar($cgi->param($_))); - } ( fields('svc_forward'), qw( pkgnum svcpart ) ) -} ); - -my $error = ''; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_forward.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_forward.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi deleted file mode 100644 index 40913145a..000000000 --- a/httemplate/edit/process/svc_www.cgi +++ /dev/null @@ -1,36 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $old; -if ( $svcnum ) { - $old = qsearchs('svc_www', { 'svcnum' => $svcnum } ) - or die "fatal: can't find website (svcnum $svcnum)!"; -} else { - $old = ''; -} - -my $new = new FS::svc_www ( { - map { - ($_, scalar($cgi->param($_))); - #} qw(svcnum pkgnum svcpart recnum usersvc) - } ( fields('svc_www'), qw( pkgnum svcpart ) ) -} ); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->svcnum; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_www.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_www.cgi?" . $svcnum ); -} - -%> diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi deleted file mode 100755 index 90b26324a..000000000 --- a/httemplate/edit/svc_acct.cgi +++ /dev/null @@ -1,278 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my @shells = $conf->config('shells'); - -my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_acct, @groups); -if ( $cgi->param('error') ) { - $svc_acct = new FS::svc_acct ( { - map { $_, scalar($cgi->param($_)) } fields('svc_acct') - } ); - $svcnum = $svc_acct->svcnum; - $pkgnum = $cgi->param('pkgnum'); - $svcpart = $cgi->param('svcpart'); - $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } ); - die "No part_svc entry for svcpart $svcpart!" unless $part_svc; - @groups = $cgi->param('radius_usergroup'); -} else { - my($query) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { #editing - $svcnum=$1; - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct) 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 for svcpart $svcpart!" unless $part_svc; - - @groups = $svc_acct->radius_groups; - - } else { #adding - - $svc_acct = new FS::svc_acct({}); - - foreach $_ (split(/-/,$query)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } ); - die "No part_svc entry for svcpart $svcpart!" unless $part_svc; - - $svcnum=''; - - #set gecos - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - if ($cust_pkg) { - my($cust_main)=qsearchs('cust_main',{'custnum'=> $cust_pkg->custnum } ); - unless ( $part_svc->part_svc_column('uid')->columnflag eq 'F' ) { - $svc_acct->setfield('finger', - $cust_main->getfield('first') . " " . $cust_main->getfield('last') - ); - } - } - - #set fixed and default fields from part_svc - foreach my $part_svc_column ( - grep { $_->columnflag } $part_svc->all_part_svc_column - ) { - if ( $part_svc_column->columnname eq 'usergroup' ) { - @groups = split(',', $part_svc_column->columnvalue); - } else { - $svc_acct->setfield( $part_svc_column->columnname, - $part_svc_column->columnvalue, - ); - } - } - - } -} -my $action = $svcnum ? 'Edit' : 'Add'; - -my $svc = $part_svc->getfield('svc'); - -my $otaker = getotaker; - -my $username = $svc_acct->username; -my $password; -if ( $svc_acct->_password ) { - if ( $conf->exists('showpasswords') || ! $svcnum ) { - $password = $svc_acct->_password; - } else { - $password = "*HIDDEN*"; - } -} else { - $password = ''; -} - -my $ulen = $conf->config('usernamemax') - || $svc_acct->dbdef_table->column('username')->length; -my $ulen2 = $ulen+2; - -my $pmax = $conf->config('passwordmax') || 8; -my $pmax2 = $pmax+2; - -my $p1 = popurl(1); -print header("$action $svc account"); - -print qq!Error: !, $cgi->param('error'), - "

          " - if $cgi->param('error'); - -print 'Service # '. ( $svcnum ? "$svcnum" : " (NEW)" ). '
          '. - 'Service: '. $part_svc->svc. '

          '. - < - - - -END - -print &ntable("#cccccc",2), <Username - -Password - -(blank to generate) - -END - -my $sec_phrase = $svc_acct->sec_phrase; -if ( $conf->exists('security_phrase') ) { - print <Security phrase - - (for forgotten passwords) - -END -} else { - print qq!!; -} - -#domain -my $domsvc = $svc_acct->domsvc || 0; -if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'F' ) { - print qq!!; -} else { - my %svc_domain = (); - - if ( $domsvc ) { - my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $domsvc, } ); - if ( $svc_domain ) { - $svc_domain{$svc_domain->svcnum} = $svc_domain; - } else { - warn "unknown svc_domain.svcnum for svc_acct.domsvc: $domsvc"; - } - } - - if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'D' ) { - my $svc_domain = qsearchs('svc_domain', { - 'svcnum' => $part_svc->part_svc_column('domsvc')->columnvalue, - } ); - if ( $svc_domain ) { - $svc_domain{$svc_domain->svcnum} = $svc_domain; - } else { - warn "unknown svc_domain.svcnum for part_svc_column domsvc: ". - $part_svc->part_svc_column('domsvc')->columnvalue; - } - } - - my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $pkgnum } ); - if ($cust_pkg) { - my @cust_svc = - map { qsearch('cust_svc', { 'pkgnum' => $_->pkgnum } ) } - qsearch('cust_pkg', { 'custnum' => $cust_pkg->custnum } ); - foreach my $cust_svc ( @cust_svc ) { - my $svc_domain = - qsearchs('svc_domain', { 'svcnum' => $cust_svc->svcnum } ); - $svc_domain{$svc_domain->svcnum} = $svc_domain if $svc_domain; - } - } else { - %svc_domain = map { $_->svcnum => $_ } qsearch('svc_domain', {} ); - } - print qq!Domain!. - qq!"; -} - -#pop -my $popnum = $svc_acct->popnum || 0; -if ( $part_svc->part_svc_column('popnum')->columnflag eq "F" ) { - print qq!!; -} else { - print qq!Access number!. - qq!!. FS::svc_acct_pop::popselector($popnum). ''; -} - -my($uid,$gid,$finger,$dir)=( - $svc_acct->uid, - $svc_acct->gid, - $svc_acct->finger, - $svc_acct->dir, -); - -print < - -END - -if ( !$finger && $part_svc->part_svc_column('uid')->columnflag eq 'F' ) { - print ''; -} else { - print 'GECOS'. - qq!!; -} -print qq!!; - -my $shell = $svc_acct->shell; -if ( $part_svc->part_svc_column('shell')->columnflag eq "F" - || ( !$shell && $part_svc->part_svc_column('uid')->columnflag eq 'F' ) - ) { - print qq!!; -} else { - print qq!Shell"; -} - -my($quota,$slipip)=( - $svc_acct->quota, - $svc_acct->slipip, -); - -print qq!!; - -if ( $part_svc->part_svc_column('slipip')->columnflag eq "F" ) { - print qq!!; -} else { - print qq!IP!; -} - -foreach my $r ( grep { /^r(adius|[cr])_/ } fields('svc_acct') ) { - $r =~ /^^r(adius|[cr])_(.+)$/ or next; #? - my $a = $2; - if ( $part_svc->part_svc_column($r)->columnflag eq 'F' ) { - print qq!'; - } else { - print qq!$FS::raddb::attrib{$a}'; - } -} - -print 'RADIUS groups'; -if ( $part_svc->part_svc_column('usergroup')->columnflag eq "F" ) { - print ''. join('
          ', @groups); -} else { - print ''. &FS::svc_acct::radius_usergroup_selector( \@groups ); -} -print ''; - -#submit -print qq!
          !; - -print < - - -END - -%> diff --git a/httemplate/edit/svc_acct_pop.cgi b/httemplate/edit/svc_acct_pop.cgi deleted file mode 100755 index 399502a70..000000000 --- a/httemplate/edit/svc_acct_pop.cgi +++ /dev/null @@ -1,56 +0,0 @@ - -<% - -my $svc_acct_pop; -if ( $cgi->param('error') ) { - $svc_acct_pop = new FS::svc_acct_pop ( { - map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop') - } ); -} elsif ( $cgi->keywords ) { #editing - my($query)=$cgi->keywords; - $query =~ /^(\d+)$/; - $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1}); -} else { #adding - $svc_acct_pop = new FS::svc_acct_pop {}; -} -my $action = $svc_acct_pop->popnum ? 'Edit' : 'Add'; -my $hashref = $svc_acct_pop->hashref; - -my $p1 = popurl(1); -print header("$action Access Number", menubar( - 'Main Menu' => popurl(2), - 'View all Access Numbers' => popurl(2). "browse/svc_acct_pop.cgi", -)); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!!; - -#display - -print qq!!, - "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)"; - -print < -City -State -Area Code -Exchange -Local - -END - -print qq!
          !; - -print < - - -END - -%> diff --git a/httemplate/edit/svc_acct_sm.cgi b/httemplate/edit/svc_acct_sm.cgi deleted file mode 100755 index 0fd5f7622..000000000 --- a/httemplate/edit/svc_acct_sm.cgi +++ /dev/null @@ -1,178 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $mydomain = $conf->config('domain'); - -my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_acct_sm ); -if ( $cgi->param('error') ) { - $svc_acct_sm = new FS::svc_acct_sm ( { - map { $_, scalar($cgi->param($_)) } fields('svc_acct_sm') - } ); - $svcnum = $svc_acct_sm->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_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) - or die "Unknown (svc_acct_sm) 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 { #adding - - $svc_acct_sm = new FS::svc_acct_sm({}); - - foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - my $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - foreach my $part_svc_column ( - grep { $_->columnflag } $part_svc->all_part_svc_column - ) { - $svc_acct_sm->setfield( $part_svc_column->columnname, - $part_svc_column->columnvalue, - ); - } - - } -} -my $action = $svc_acct_sm->svcnum ? 'Edit' : 'Add'; - -my %username = (); -my %domain = (); -if ($pkgnum) { - - #find all possible uids (and usernames) - - my @u_acct_svcparts = (); - foreach my $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'); - foreach my $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')}); - $username{$svc_acct->getfield('uid')}=$svc_acct->getfield('username'); - } - } - } - - #find all possible domains (and domsvc's) - - my @d_acct_svcparts = (); - foreach my $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) { - push @d_acct_svcparts,$d_part_svc->getfield('svcpart'); - } - - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@d_acct_svcparts) { - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_domain)=qsearch('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $domain{$svc_domain->getfield('svcnum')}=$svc_domain->getfield('domain'); - } - } - } - -} elsif ( $action eq 'Edit' ) { - - my($svc_acct)=qsearchs('svc_acct',{'uid'=>$svc_acct_sm->domuid}); - $username{$svc_acct_sm->uid} = $svc_acct->username; - - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svc_acct_sm->domsvc}); - $domain{$svc_acct_sm->domsvc} = $svc_domain->domain; - -} else { - die "\$action eq Add, but \$pkgnum is null!\n"; -} - -my $p1 = popurl(1); -print header("Mail Alias $action", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!!; - -#display - - #formatting - print "
          ";
          -
          -#svcnum
          -print qq!!;
          -print qq!Service #!, $svcnum ? $svcnum : " (NEW)", "";
          -
          -#pkgnum
          -print qq!!;
          - 
          -#svcpart
          -print qq!!;
          -
          -my($domuser,$domsvc,$domuid)=(
          -  $svc_acct_sm->domuser,
          -  $svc_acct_sm->domsvc,
          -  $svc_acct_sm->domuid,
          -);
          -
          -#domuser
          -print qq!\n\nMail to  ( * for anything )!;
          -
          -#domsvc
          -print qq! \@ ";
          -
          -#uid
          -print qq!\nforwards to \@$mydomain mailbox.";
          -
          -	#formatting
          -	print "
          \n"; - -print qq!
          !; - -print < - - -END - -%> diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi deleted file mode 100755 index d20e1f336..000000000 --- a/httemplate/edit/svc_domain.cgi +++ /dev/null @@ -1,98 +0,0 @@ - -<% - -my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc, - $svc_domain); -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'); - $kludge_action = $cgi->param('action'); - $purpose = $cgi->param('purpose'); - $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } ); - die "No part_svc entry!" unless $part_svc; -} else { - $kludge_action = ''; - $purpose = ''; - 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 { #adding - - $svc_domain = new FS::svc_domain({}); - - foreach $_ (split(/-/,$query)) { - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - foreach my $part_svc_column ( - grep { $_->columnflag } $part_svc->all_part_svc_column - ) { - $svc_domain->setfield( $part_svc_column->columnname, - $part_svc_column->columnvalue, - ); - } - - } - -} -my $action = $svcnum ? 'Edit' : 'Add'; - -my $svc = $part_svc->getfield('svc'); - -my $otaker = getotaker; - -my $domain = $svc_domain->domain; - -my $p1 = popurl(1); -print header("$action $svc", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print < - - - -END - -print qq!New!; -print qq!
          Transfer!; - -print <Domain -
          Purpose/Description: -

          -

          - - -END - -%> diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi deleted file mode 100755 index bc19fe1de..000000000 --- a/httemplate/edit/svc_forward.cgi +++ /dev/null @@ -1,176 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $mydomain = $conf->config('domain'); - -my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_forward); -if ( $cgi->param('error') ) { - $svc_forward = new FS::svc_forward ( { - map { $_, scalar($cgi->param($_)) } fields('svc_forward') - } ); - $svcnum = $svc_forward->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_forward=qsearchs('svc_forward',{'svcnum'=>$svcnum}) - or die "Unknown (svc_forward) 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 { #adding - - $svc_forward = new FS::svc_forward({}); - - foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - foreach my $part_svc_column ( - grep { $_->columnflag } $part_svc->all_part_svc_column - ) { - $svc_forward->setfield( $part_svc_column->columnname, - $part_svc_column->columnvalue, - ); - } - } - -} -my $action = $svc_forward->svcnum ? 'Edit' : 'Add'; - -my %email; -if ($pkgnum) { - - #find all possible user svcnums (and emails) - - #starting with those currently attached - if ( $svc_forward->srcsvc ) { - my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $svc_forward->srcsvc } ); - $email{$svc_forward->srcsvc} = $svc_acct->email; - } - if ( $svc_forward->dstsvc ) { - my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $svc_forward->dstsvc } ); - $email{$svc_forward->dstsvc} = $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 ! ) - foreach my $i_cust_svc ( - qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum, - 'svcpart' => $acct_svcpart } ) - ) { - my $svc_acct = - qsearchs( 'svc_acct', { 'svcnum' => $i_cust_svc->svcnum } ); - $email{$svc_acct->svcnum} = $svc_acct->email; - } - } - } - -} elsif ( $action eq 'Edit' ) { - - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_forward->srcsvc}); - $email{$svc_forward->srcsvc} = $svc_acct->email; - - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svc_forward->dstsvc}); - $email{$svc_forward->dstsvc} = $svc_acct->email; - -} else { - die "\$action eq Add, but \$pkgnum is null!\n"; -} - -my($srcsvc,$dstsvc,$dst)=( - $svc_forward->srcsvc, - $svc_forward->dstsvc, - $svc_forward->dst, -); - -#display - -%> - -<%= header("Mail Forward $action") %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -

          -<% } %> - -Service #<%= $svcnum ? "$svcnum" : " (NEW)" %>
          -Service: <%= $part_svc->svc %>

          - -
          - -<%= ntable("#cccccc",2) %> -Email to - -<% - tie my %tied_email, 'Tie::IxHash', - '' => 'SELECT DESTINATION', - %email, - '0' => '(other email address)'; - my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => $dstsvc, - 'options' => \%tied_email, - 'form_name' => 'dummy', - 'form_action' => 'process/svc_forward.cgi', - 'form_select' => ['srcsvc'], - 'html_between' => '', - 'layer_callback' => sub { - my $layer = shift; - my $html = qq!!. - qq!!. - qq!!. - qq!!; - if ( $layer eq '0' ) { - $html .= ntable("#cccccc",2). - 'Destination email'. - qq!!. - ''; - } - $html .= '
          '; - $html; - }, - ); -%> - -Forwards to -<%= $widget->html %> - - diff --git a/httemplate/edit/svc_www.cgi b/httemplate/edit/svc_www.cgi deleted file mode 100644 index d2c9ade5c..000000000 --- a/httemplate/edit/svc_www.cgi +++ /dev/null @@ -1,178 +0,0 @@ - -<% - -my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_www ); -if ( $cgi->param('error') ) { - $svc_www = new FS::svc_www ( { - map { $_, scalar($cgi->param($_)) } fields('svc_www') - } ); - $svcnum = $svc_www->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_www=qsearchs('svc_www',{'svcnum'=>$svcnum}) - or die "Unknown (svc_www) 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 { #adding - - $svc_www = new FS::svc_www({}); - - foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; - } - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - $svcnum=''; - - #set fixed and default fields from part_svc - foreach my $part_svc_column ( - grep { $_->columnflag } $part_svc->all_part_svc_column - ) { - $svc_www->setfield( $part_svc_column->columnname, - $part_svc_column->columnvalue, - ); - } - - } -} -my $action = $svc_www->svcnum ? 'Edit' : 'Add'; - -my( %username, %arec ); -if ($pkgnum) { - - 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')}); - $username{$svc_acct->getfield('svcnum')}=$svc_acct->getfield('username'); - } - } - } - - - my($d_part_svc,@d_acct_svcparts); - foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) { - push @d_acct_svcparts,$d_part_svc->getfield('svcpart'); - } - - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@d_acct_svcparts) { - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - my $domain_rec; - foreach $domain_rec ( qsearch('domain_record',{ - 'svcnum' => $svc_domain->svcnum, - 'rectype' => 'A' } ), - qsearch('domain_record',{ - 'svcnum' => $svc_domain->svcnum, - 'rectype' => 'CNAME' - } ) ) { - $arec{$domain_rec->recnum} = - $domain_rec->reczone eq '@' - ? $svc_domain->domain - : $domain_rec->reczone. '.'. $svc_domain->domain; - } - $arec{'@.'. $svc_domain->domain} = $svc_domain->domain - unless qsearchs('domain_record', { svcnum => $svc_domain->svcnum, - reczone => '@', } ); - $arec{'www.'. $svc_domain->domain} = 'www.'. $svc_domain->domain - unless qsearchs('domain_record', { svcnum => $svc_domain->svcnum, - reczone => 'www', } ); - } - } - } - -} elsif ( $action eq 'Edit' ) { - - my($domain_rec) = qsearchs('domain_record', { 'recnum'=>$svc_www->recnum }); - $arec{$svc_www->recnum} = join '.', $domain_rec->recdata, $domain_rec->reczone; - -} else { - die "\$action eq Add, but \$pkgnum is null!\n"; -} - - -my $p1 = popurl(1); -print header("Web Hosting $action", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!!; - -#display - - - -#svcnum -print qq!!; -print qq!Service #!, $svcnum ? $svcnum : "(NEW)", "

          "; - -#pkgnum -print qq!!; - -#svcpart -print qq!!; - -my($recnum,$usersvc)=( - $svc_www->recnum, - $svc_www->usersvc, -); - -print &ntable("#cccccc",2), - 'Zone"; - -print 'Username"; - -print '
          '; - -print < - - -END -%> diff --git a/httemplate/images/mid-logo.png b/httemplate/images/mid-logo.png deleted file mode 100644 index d993419cc..000000000 Binary files a/httemplate/images/mid-logo.png and /dev/null differ diff --git a/httemplate/images/small-logo.png b/httemplate/images/small-logo.png deleted file mode 100644 index 406a36980..000000000 Binary files a/httemplate/images/small-logo.png and /dev/null differ diff --git a/httemplate/index.html b/httemplate/index.html deleted file mode 100644 index 29dd3b471..000000000 --- a/httemplate/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - Freeside Main Menu - - - - - -
          - Silicon Interactive Software Design - - freeside main menu - - version 1.4.0 -
          Freeside home page -
          Documentation -
          - -
          -[ Sales / Customer service ] -[ Bookkeeping / Collections ] -[ Reports ] -[ Sysadmin ] - - - -
          Sales / Customer service
          -
          New Customer -
          -
          Customer # or all customers by customer number -
          Last name or all customers by last name
          -
          Company or all customers by company
          - -
          Phone #
          -
          Username or all accounts by username or uid
          -
          Domain or all domains
          - - -
          -
          - - - -


          - - -[ Sales / Customer service ] -[ Bookkeeping / Collections ] -[ Reports ] -[ Sysadmin ] - - - -
          Bookkeeping / Collections
          -
          Quick payment entry -
          -
          Credit card #
          -
          Invoice #
          -
          Check #
          -
          View pending credit card batch

          Packages (by next bill date range) -

          Invoice reports - - Financial reports - -


          - Administration - -
          -
          - - - -


          - - - -[ Sales / Customer service ] -[ Bookkeeping / Collections ] -[ Reports ] -[ Sysadmin ] - - - -
          Reports
          -
          - Auditing pre-Freeside services with no customer record - - Packages - - Invoices - - Financial reports - - Customers - -
          SQL query: SELECT
          - -
          -
          - - - -


          - - -[ Sales / Customer service ] -[ Bookkeeping / Collections ] -[ Reports ] -[ Sysadmin ] - - - -
          Sysadmin
          -
          - View active NAS ports -
          View pending job queue -



          - Configuration -

          Administration - -
          -
          -















          -















          -















          -















          -















          -















          -















          -















          - - diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi deleted file mode 100755 index f048e5559..000000000 --- a/httemplate/misc/bill.cgi +++ /dev/null @@ -1,37 +0,0 @@ -<% - -#untaint custnum -my($query) = $cgi->keywords; -$query =~ /^(\d*)$/; -my $custnum = $1; -my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); -die "Can't find customer!\n" unless $cust_main; - -my $error = $cust_main->bill( -# 'time'=>$time - ); -#&eidiot($error) if $error; - -unless ( $error ) { - $cust_main->apply_payments; - $cust_main->apply_credits; - - $error = $cust_main->collect( - # 'invoice-time'=>$time, - #'batch_card'=> 'yes', - #'batch_card'=> 'no', - #'report_badcard'=> 'yes', - 'retry_card' => 'yes', - ); -} -#&eidiot($error) if $error; - -if ( $error ) { -%> - -<% - &idiot($error); -} else { - print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); -} -%> diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi deleted file mode 100755 index 11cde968d..000000000 --- a/httemplate/misc/cancel-unaudited.cgi +++ /dev/null @@ -1,31 +0,0 @@ -<% - -my $dbh = dbh; - -#untaint svcnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; - -#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -#die "Unknown svcnum!" unless $svc_acct; - -my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "Unknown svcnum!" unless $cust_svc; -&eidiot(qq!This account has already been audited. Cancel the - package instead.!) - if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0'; - -my $error = $cust_svc->cancel; - -if ( $error ) { - %> - -<% - &eidiot($error); -} else { - print $cgi->redirect(popurl(2)); -} - -%> diff --git a/httemplate/misc/cancel_pkg.cgi b/httemplate/misc/cancel_pkg.cgi deleted file mode 100755 index 0487677df..000000000 --- a/httemplate/misc/cancel_pkg.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint pkgnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -my $error = $cust_pkg->cancel; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/catchall.cgi b/httemplate/misc/catchall.cgi deleted file mode 100755 index 9aa84be18..000000000 --- a/httemplate/misc/catchall.cgi +++ /dev/null @@ -1,133 +0,0 @@ - -<% - -my $conf = new FS::Conf; - -my($svc_domain, $svcnum, $pkgnum, $svcpart, $part_svc); -if ( $cgi->param('error') ) { - $svc_domain = new FS::svc_domain ( { - map { $_, scalar($cgi->param($_)) } fields('svc_domain') - } ); - $svcnum = $svc_domain->svcnum; - $pkgnum = $cgi->param('pkgnum'); - $svcpart = $cgi->param('svcpart'); - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; -} else { - my($query) = $cgi->keywords; - if ( $query =~ /^(\d+)$/ ) { #editing - $svcnum=$1; - $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) - or die "Unknown (svc_domain) svcnum!"; - - my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}) - or die "Unknown (cust_svc) svcnum!"; - - $pkgnum=$cust_svc->pkgnum; - $svcpart=$cust_svc->svcpart; - - $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart}); - die "No part_svc entry!" unless $part_svc; - - } else { - - die "Invalid (svc_domain) svcnum!"; - - } -} - -my %email; -if ($pkgnum) { - - #find all possible user svcnums (and emails) - - #starting with that currently attached - if ($svc_domain->catchall) { - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_domain->catchall}); - $email{$svc_domain->catchall} = $svc_acct->email; - } - - #and including the rest for this customer - my($u_part_svc,@u_acct_svcparts); - foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) { - push @u_acct_svcparts,$u_part_svc->getfield('svcpart'); - } - - my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - my($custnum)=$cust_pkg->getfield('custnum'); - my($i_cust_pkg); - foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) { - my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum'); - my($acct_svcpart); - foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding - #record(s) in cust_svc ( for this - #pkgnum ! ) - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $email{$svc_acct->getfield('svcnum')}=$svc_acct->email; - } - } - } - -} else { - - my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_domain->catchall}); - $email{$svc_domain->catchall} = $svc_acct->email; -} - -# add an absence of a catchall -$email{0} = "(none)"; - -my $p1 = popurl(1); -print header("Domain Catchall Edit", ''); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print qq!
          !; - -#display - - #formatting - print "
          ";
          -
          -#svcnum
          -print qq!!;
          -print qq!Service #!, $svcnum ? $svcnum : " (NEW)", "";
          -
          -#pkgnum
          -print qq!!;
          - 
          -#svcpart
          -print qq!!;
          -
          -my($domain,$catchall)=(
          -  $svc_domain->domain,
          -  $svc_domain->catchall,
          -);
          -
          -print qq!!;
          -
          -#catchall
          -print qq!\n\nMail to (anything)@$domain forwards to ";
          -
          -	#formatting
          -	print "
          \n"; - -print qq!
          !; - -print < - - -END - -%> diff --git a/httemplate/misc/delete-cust_pay.cgi b/httemplate/misc/delete-cust_pay.cgi deleted file mode 100755 index 3efd918ab..000000000 --- a/httemplate/misc/delete-cust_pay.cgi +++ /dev/null @@ -1,16 +0,0 @@ -<% - -#untaint paynum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal paynum"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay',{'paynum'=>$paynum}); -my $custnum = $cust_pay->custnum; - -my $error = $cust_pay->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); - -%> diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi deleted file mode 100755 index 430231737..000000000 --- a/httemplate/misc/delete-customer.cgi +++ /dev/null @@ -1,60 +0,0 @@ - -<% - -my $conf = new FS::Conf; -die "Customer deletions not enabled" unless $conf->exists('deletecustomers'); - -my($custnum, $new_custnum); -if ( $cgi->param('error') ) { - $custnum = $cgi->param('custnum'); - $new_custnum = $cgi->param('new_custnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ or die "Illegal query: $query"; - $custnum = $1; - $new_custnum = ''; -} -my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } ) - or die "Customer not found: $custnum"; - -print header('Delete customer'); - -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); - -print - qq!!, - qq!!; - -if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) { - print "Move uncancelled packages to customer number ", - qq!

          !; -} - -print <completely remove all traces of this customer record. This -is not what you want if this is a real customer who has simply -canceled service with you. For that, cancel all of the customer's packages. -(you can optionally hide cancelled customers with the hidecancelledcustomers configuration option) -
          -
          Are you absolutely sure you want to delete this customer? -
          - -END - -#Deleting a customer you have financial records on (i.e. credits) is -#typically considered fraudulant bookkeeping. Remember, deleting -#customers should ONLY be used for completely bogus records. You should -#NOT delete real customers who simply discontinue service. -# -#For real customers who simply discontinue service, cancel all of the -#customer's packages. Customers with all cancelled packages are not -#billed. There is no need to take further action to prevent billing on -#customers with all cancelled packages. -# -#Also see the "hidecancelledcustomers" and "hidecancelledpackages" -#configuration options, which will allow you to surpress the display of -#cancelled customers and packages, respectively. - -%> diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi deleted file mode 100755 index dcc2d5022..000000000 --- a/httemplate/misc/delete-domain_record.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint recnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal recnum"; -my $recnum = $1; - -my $domain_record = qsearchs('domain_record',{'recnum'=>$recnum}); - -my $error = $domain_record->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum); - -%> diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi deleted file mode 100755 index 7c4ab8b9d..000000000 --- a/httemplate/misc/delete-part_export.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint exportnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal exportnum"; -my $exportnum = $1; - -my $part_export = qsearchs('part_export',{'exportnum'=>$exportnum}); - -my $error = $part_export->delete; -eidiot($error) if $error; - -print $cgi->redirect($p. "browse/part_export.cgi"); - -%> diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi deleted file mode 100755 index 9e4ce8b62..000000000 --- a/httemplate/misc/expire_pkg.cgi +++ /dev/null @@ -1,25 +0,0 @@ -<% - -#untaint date & pkgnum - -my $date; -if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $cust_pkg->hash; -$hash{expire}=$date; -my $new = new FS::cust_pkg ( \%hash ); -my $error = $new->replace($cust_pkg); -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi deleted file mode 100755 index efc762cc5..000000000 --- a/httemplate/misc/link.cgi +++ /dev/null @@ -1,46 +0,0 @@ - -<% - -my %link_field = ( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', - 'svc_acct_sm' => '', - 'svc_charge' => '', - 'svc_wo' => '', -); - -my($query) = $cgi->keywords; -my($pkgnum, $svcpart) = ('', ''); -foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my $svc = $part_svc->getfield('svc'); -my $svcdb = $part_svc->getfield('svcdb'); -my $link_field = $link_field{$svcdb}; - -print header("Link to existing $svc"), - qq!
          !; - -if ( $link_field ) { - print < - - $link_field of existing service: -END -} else { - print qq!Service # of existing service: !; -} - -print < - -

          - - - -END - -%> diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi deleted file mode 100755 index a5500bff2..000000000 --- a/httemplate/misc/print-invoice.cgi +++ /dev/null @@ -1,23 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $lpr = $conf->config('lpr'); - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^(\d*)$/; -my $invnum = $1; -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Can't find invoice!\n" unless $cust_bill; - - open(LPR,"|$lpr") or die "Can't open $lpr: $!"; - print LPR $cust_bill->print_text; #( date ) - close LPR - or die $! ? "Error closing $lpr: $!" - : "Exit status $? from $lpr"; - -my $custnum = $cust_bill->getfield('custnum'); - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history"); - -%> diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi deleted file mode 100755 index 44a63f9f8..000000000 --- a/httemplate/misc/process/catchall.cgi +++ /dev/null @@ -1,33 +0,0 @@ -<% - -$FS::svc_domain::whois_hack=1; - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum =$1; - -my $old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum; - -my $new = new FS::svc_domain ( { - map { - ($_, scalar($cgi->param($_))); - } ( fields('svc_domain'), qw( pkgnum svcpart ) ) -} ); - -$new->setfield('action' => 'M'); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "catchall.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); -} - -%> diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi deleted file mode 100755 index 16bdbaea8..000000000 --- a/httemplate/misc/process/delete-customer.cgi +++ /dev/null @@ -1,29 +0,0 @@ -<% - -my $conf = new FS::Conf; -die "Customer deletions not enabled" unless $conf->exists('deletecustomers'); - -$cgi->param('custnum') =~ /^(\d+)$/; -my $custnum = $1; -my $new_custnum; -if ( $cgi->param('new_custnum') ) { - $cgi->param('new_custnum') =~ /^(\d+)$/ - or die "Illegal new customer number: ". $cgi->param('new_custnum'); - $new_custnum = $1; -} else { - $new_custnum = ''; -} -my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } ) - or die "Customer not found: $custnum"; - -my $error = $cust_main->delete($new_custnum); - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "delete-customer.cgi?". $cgi->query_string ); -} elsif ( $new_custnum ) { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$new_custnum"); -} else { - print $cgi->redirect(popurl(3)); -} -%> diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi deleted file mode 100755 index 4b220a867..000000000 --- a/httemplate/misc/process/link.cgi +++ /dev/null @@ -1,40 +0,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($svc_x)=qsearchs($svcdb,{$link_field => $cgi->param('link_value') }); - eidiot("$link_field not found!") unless $svc_x; - $svcnum=$svc_x->svcnum; -} - -my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -die "svcnum not found!" unless $old; -#die "svcnum $svcnum already linked to package ". $old->pkgnum if $old->pkgnum; -my $new = new FS::cust_svc ({ - 'svcnum' => $svcnum, - 'pkgnum' => $pkgnum, - 'svcpart' => $svcpart, -}); - -my $error = $new->replace($old); - -unless ($error) { - #no errors, so let's view this customer. - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?$pkgnum"); -} else { -%> - -<% - idiot($error); -} - -%> diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi deleted file mode 100644 index ce9c8fbd3..000000000 --- a/httemplate/misc/queue.cgi +++ /dev/null @@ -1,47 +0,0 @@ -<% - -$cgi->param('action') =~ /^(new|del|(retry|remove) selected)$/ - or die "Illegal action"; -my $action = $1; - -my $job; -if ( $action eq 'new' || $action eq 'del' ) { - $cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum"; - my $jobnum = $1; - $job = qsearchs('queue', { 'jobnum' => $1 }) - or die "unknown jobnum $jobnum - ". - "it probably completed normally or was removed by another user"; -} - -if ( $action eq 'new' ) { - my %hash = $job->hash; - $hash{'status'} = 'new'; - $hash{'statustext'} = ''; - my $new = new FS::queue \%hash; - my $error = $new->replace($job); - die $error if $error; -} elsif ( $action eq 'del' ) { - my $error = $job->delete; - die $error if $error; -} elsif ( $action =~ /^(retry|remove) selected$/ ) { - foreach my $jobnum ( - map { /^jobnum(\d+)$/; $1; } grep /^jobnum\d+$/, $cgi->param - ) { - my $job = qsearchs('queue', { 'jobnum' => $jobnum }); - if ( $action eq 'retry selected' && $job ) { #new - my %hash = $job->hash; - $hash{'status'} = 'new'; - $hash{'statustext'} = ''; - my $new = new FS::queue \%hash; - my $error = $new->replace($job); - die $error if $error; - } elsif ( $action eq 'remove selected' && $job ) { #del - my $error = $job->delete; - die $error if $error; - } - } -} - -print $cgi->redirect(popurl(2). "browse/queue.cgi"); - -%> diff --git a/httemplate/misc/susp_pkg.cgi b/httemplate/misc/susp_pkg.cgi deleted file mode 100755 index 4a19fa830..000000000 --- a/httemplate/misc/susp_pkg.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint pkgnum -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -my $error = $cust_pkg->suspend; -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi deleted file mode 100755 index 500872983..000000000 --- a/httemplate/misc/unsusp_pkg.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -#untaint pkgnum -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - -my $error = $cust_pkg->unsuspend; -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); - -%> diff --git a/httemplate/search/cust_bill.cgi b/httemplate/search/cust_bill.cgi deleted file mode 100755 index 586399a41..000000000 --- a/httemplate/search/cust_bill.cgi +++ /dev/null @@ -1,165 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $maxrecords = $conf->config('maxsearchrecordsperpage'); - -my $orderby = ''; #removeme - -my $limit = ''; -$limit .= "LIMIT $maxrecords" if $maxrecords; - -my $offset = $cgi->param('offset') || 0; -$limit .= " OFFSET $offset" if $offset; - -my $total; - -my(@cust_bill); -if ( $cgi->keywords ) { - my($query) = $cgi->keywords; - my $owed = "charged - ( select coalesce(sum(amount),0) from cust_bill_pay - where cust_bill_pay.invnum = cust_bill.invnum ) - - ( select coalesce(sum(amount),0) from cust_credit_bill - where cust_credit_bill.invnum = cust_bill.invnum )"; - my @where; - if ( $query =~ /^(OPEN(\d*)_)?(invnum|date|custnum)$/ ) { - my($open, $days, $field) = ($1, $2, $3); - $field = "_date" if $field eq 'date'; - $orderby = "ORDER BY cust_bill.$field"; - push @where, "0 != $owed" if $open; - push @where, "cust_bill._date < ". (time-86400*$days) if $days; - } else { - die "unknown query string $query"; - } - - my $extra_sql = scalar(@where) ? 'WHERE '. join(' AND ', @where) : ''; - - my $statement = "SELECT COUNT(*), sum(charged), sum($owed) - FROM cust_bill $extra_sql"; - my $sth = dbh->prepare($statement) or die dbh->errstr. " doing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - - ( $total, $tot_amount, $tot_balance ) = @{$sth->fetchrow_arrayref}; - - @cust_bill = qsearch( - 'cust_bill', - {}, - "cust_bill.*, $owed as owed", - "$extra_sql $orderby $limit" - ); -} else { - $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; - my $invnum = $2; - @cust_bill = qsearchs('cust_bill', { 'invnum' => $invnum } ); - $total = scalar(@cust_bill); -} - -#if ( scalar(@cust_bill) == 1 ) { -if ( $total == 1 ) { - my $invnum = $cust_bill[0]->invnum; - print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect -} elsif ( scalar(@cust_bill) == 0 ) { -%> - -<% - eidiot("Invoice not found."); -} else { -%> - -<% - - #begin pager - my $pager = ''; - if ( $total != scalar(@cust_bill) && $maxrecords ) { - unless ( $offset == 0 ) { - $cgi->param('offset', $offset - $maxrecords); - $pager .= 'Previous '; - } - my $poff; - my $page; - for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { - $page++; - if ( $offset == $poff ) { - $pager .= qq!$page !; - } else { - $cgi->param('offset', $poff); - $pager .= qq!$page !; - } - } - unless ( $offset + $maxrecords > $total ) { - $cgi->param('offset', $offset + $maxrecords); - $pager .= 'Next '; - } - } - #end pager - - print header("Invoice Search Results", menubar( - 'Main Menu', popurl(2) - )). - "$total matching invoices found
          ". - "\$$tot_balance total balance
          ". - "\$$tot_amount total amount
          ". - "
          $pager". table(). < - - Balance - Amount - Date - Contact name - Company - -END - - foreach my $cust_bill ( @cust_bill ) { - my($invnum, $owed, $charged, $date ) = ( - $cust_bill->invnum, - sprintf("%.2f", $cust_bill->getfield('owed')), - sprintf("%.2f", $cust_bill->charged), - $cust_bill->_date, - ); - my $pdate = time2str("%b %d %Y", $date); - - my $rowspan = 1; - - my $view = popurl(2). "view/cust_bill.cgi?$invnum"; - print < - $invnum - \$$owed - \$$charged - $pdate -END - my $custnum = $cust_bill->custnum; - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - if ( $cust_main ) { - my $cview = popurl(2). "view/cust_main.cgi?". $cust_main->custnum; - my ( $name, $company ) = ( - $cust_main->last. ', '. $cust_main->first, - $cust_main->company, - ); - print <$name - $company -END - } else { - print <WARNING: couldn't find cust_main.custnum $custnum (cust_bill.invnum $invnum) -END - } - - print ""; - } - $tot_balance = sprintf("%.2f", $tot_balance); - $tot_amount = sprintf("%.2f", $tot_amount); - print "$pager
          ". table(). <       Total
          Balance
          Total
          Amount
          - \$$tot_balance\$$tot_amount - - - -END - -} - -%> diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html deleted file mode 100755 index 36e8bc91b..000000000 --- a/httemplate/search/cust_bill.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Invoice Search - - - - Invoice Search - -

          -
          - Search for invoice #: - - -

          - -

          - - - diff --git a/httemplate/search/cust_bill_event.cgi b/httemplate/search/cust_bill_event.cgi deleted file mode 100644 index 9cb36d28e..000000000 --- a/httemplate/search/cust_bill_event.cgi +++ /dev/null @@ -1,62 +0,0 @@ - -<% - -#false laziness with view/cust_bill.cgi - -$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/; -my $beginning = str2time($1); - -$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/; -my $ending = str2time($1) + 86400; - -my @cust_bill_event = - sort { $a->_date <=> $b->_date } - qsearch('cust_bill_event', { - _date => { op=> '>=', value=>$beginning }, - statustext => { op=> '!=', value=>'' }, -# i wish... -# _date => { op=> '<=', value=>$ending }, - }, '', "AND _date <= $ending"); - -%> - -<%= header('Failed billing events') %> - -<%= table() %> - - Event - Date - Status - Invoice - (bill) name - company -<% if ( defined dbdef->table('cust_main')->column('ship_last') ) { %> - (service) name - company -<% } %> - - -<% foreach my $cust_bill_event ( @cust_bill_event ) { - my $status = $cust_bill_event->status; - $status .= ': '.$cust_bill_event->statustext if $cust_bill_event->statustext; - my $cust_bill = $cust_bill_event->cust_bill; - my $cust_main = $cust_bill->cust_main; - my $invlink = "${p}view/cust_bill.cgi?". $cust_bill->invnum; - my $custlink = "${p}view/cust_main.cgi?". $cust_main->custnum; -%> - - <%= $cust_bill_event->part_bill_event->event %> - <%= time2str("%a %b %e %T %Y", $cust_bill_event->_date) %> - <%= $status %> - Invoice #<%= $cust_bill->invnum %> (<%= time2str("%D", $cust_bill->_date ) %>) - <%= $cust_main->last. ', '. $cust_main->first %> - <%= $cust_main->company %> - <% if ( defined dbdef->table('cust_main')->column('ship_last') ) { %> - <%= $cust_main->ship_last. ', '. $cust_main->ship_first %> - <%= $cust_main->ship_company %> - <% } %> - -<% } %> - - - diff --git a/httemplate/search/cust_bill_event.html b/httemplate/search/cust_bill_event.html deleted file mode 100755 index d76ce3c8c..000000000 --- a/httemplate/search/cust_bill_event.html +++ /dev/null @@ -1,23 +0,0 @@ - - - Failed billing events - - -
          -

          Failed billing events

          -
          -
          -
          - Return failed billing events for period: - from m/d/y - to m/d/y - -

          - -

          - -
          - - - - diff --git a/httemplate/search/cust_main-otaker.cgi b/httemplate/search/cust_main-otaker.cgi deleted file mode 100755 index b7173c49c..000000000 --- a/httemplate/search/cust_main-otaker.cgi +++ /dev/null @@ -1,29 +0,0 @@ - - - Customer Search - - - - Customer Search - -
          -
          - Search for Order taker: - - <% my $dbh = dbh; - my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_main") - or eidiot $dbh->errstr; - $sth->execute() or eidiot $sth->errstr; -# my @otakers = map { $_->[0] } @{$sth->selectall_arrayref}; - %> - -

          - -

          - - - diff --git a/httemplate/search/cust_main-payinfo.html b/httemplate/search/cust_main-payinfo.html deleted file mode 100755 index 671b5ef08..000000000 --- a/httemplate/search/cust_main-payinfo.html +++ /dev/null @@ -1,20 +0,0 @@ - - - Customer Search - - - - Customer Search - -
          -
          - Search for Credit card #: - - - -

          - -

          - - - diff --git a/httemplate/search/cust_main-quickpay.html b/httemplate/search/cust_main-quickpay.html deleted file mode 100755 index 9f39db914..000000000 --- a/httemplate/search/cust_main-quickpay.html +++ /dev/null @@ -1,43 +0,0 @@ - - - Quick payment entry - - - - Quick payment entry - -

          -
          - - Search for last name: - - using search method: - -

          Search for company: - - using search methods: - -

          Note: Fuzzy searching can take a while. Please be patient. - -

          - -
          Explanation of search methods: -
            -
          • All - Try all search methods. -
          • Fuzzy - Searches for matches that are close to your text. -
          • Substring - Searches for matches that contain your text. -
          • Exact - Finds exact matches only, but much faster than the other search methods. -
          - - - diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi deleted file mode 100755 index 586f8d991..000000000 --- a/httemplate/search/cust_main.cgi +++ /dev/null @@ -1,659 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $maxrecords = $conf->config('maxsearchrecordsperpage'); - -#my $cache; - -#my $monsterjoin = <param('offset') || 0; -$limit .= " OFFSET $offset" if $offset; - -my $total = 0; - -my(@cust_main, $sortby, $orderby); -if ( $cgi->param('browse') - || $cgi->param('otaker_on') -) { - - my %search = (); - if ( $cgi->param('browse') ) { - my $query = $cgi->param('browse'); - if ( $query eq 'custnum' ) { - $sortby=\*custnum_sort; - $orderby = "ORDER BY custnum"; - } elsif ( $query eq 'last' ) { - $sortby=\*last_sort; - $orderby = "ORDER BY LOWER(last || ' ' || first)"; - } elsif ( $query eq 'company' ) { - $sortby=\*company_sort; - $orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )"; - } else { - die "unknown browse field $query"; - } - } else { - $sortby = \*last_sort; #?? - $orderby = "ORDER BY LOWER(last || ' ' || first)"; #?? - if ( $cgi->param('otaker_on') ) { - $cgi->param('otaker') =~ /^(\w{1,32})$/ or eidiot "Illegal otaker\n"; - $search{otaker} = $1; - } else { - die "unknown query..."; - } - } - - my $ncancelled = ''; - - if ( driver_name eq 'mysql' ) { - - my $query = "CREATE TEMPORARY TABLE temp1_$$ TYPE=MYISAM - SELECT cust_pkg.custnum,COUNT(*) as count - FROM cust_pkg,cust_main - WHERE cust_pkg.custnum = cust_main.custnum - AND ( cust_pkg.cancel IS NULL - OR cust_pkg.cancel = 0 ) - GROUP BY cust_pkg.custnum"; - my $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query"; - $sth->execute or die "Error executing \"$query\": ". $sth->errstr; - $query = "CREATE TEMPORARY TABLE temp2_$$ TYPE=MYISAM - SELECT cust_pkg.custnum,COUNT(*) as count - FROM cust_pkg,cust_main - WHERE cust_pkg.custnum = cust_main.custnum - GROUP BY cust_pkg.custnum"; - my $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query"; - $sth->execute or die "Error executing \"$query\": ". $sth->errstr; - } - - if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me - || ( $conf->exists('hidecancelledcustomers') - && ! $cgi->param('showcancelledcustomers') ) - ) { - #grep { $_->ncancelled_pkgs || ! $_->all_pkgs } - if ( driver_name eq 'mysql' ) { - $ncancelled = " - temp1_$$.custnum = cust_main.custnum - AND temp2_$$.custnum = cust_main.custnum - AND (temp1_$$.count > 0 - OR temp2_$$.count = 0 ) - "; - } else { - $ncancelled = " - 0 < ( SELECT COUNT(*) FROM cust_pkg - WHERE cust_pkg.custnum = cust_main.custnum - AND ( cust_pkg.cancel IS NULL - OR cust_pkg.cancel = 0 - ) - ) - OR 0 = ( SELECT COUNT(*) FROM cust_pkg - WHERE cust_pkg.custnum = cust_main.custnum - ) - "; - } - - } - - #EWWWWWW - my $qual = join(' AND ', - map { "$_ = ". dbh->quote($search{$_}) } keys %search ); - - if ( $ncancelled ) { - $qual .= ' AND ' if $qual; - $qual .= $ncancelled; - } - - $qual = " WHERE $qual" if $qual; - my $statement; - if ( driver_name eq 'mysql' ) { - $statement = "SELECT COUNT(*) FROM cust_main"; - $statement .= ", temp1_$$, temp2_$$ $qual" if $qual; - } else { - $statement = "SELECT COUNT(*) FROM cust_main $qual"; - } - my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - - $total = $sth->fetchrow_arrayref->[0]; - - if ( $ncancelled ) { - if ( %search ) { - $ncancelled = " AND $ncancelled"; - } else { - $ncancelled = " WHERE $ncancelled"; - } - } - - my @just_cust_main; - if ( driver_name eq 'mysql' ) { - @just_cust_main = qsearch('cust_main', \%search, 'cust_main.*', - ",temp1_$$,temp2_$$ $ncancelled $orderby $limit"); - } else { - @just_cust_main = qsearch('cust_main', \%search, '', - "$ncancelled $orderby $limit" ); - } - if ( driver_name eq 'mysql' ) { - $query = "DROP TABLE temp1_$$,temp2_$$;"; - my $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query"; - $sth->execute or die "Error executing \"$query\": ". $sth->errstr; - } - @cust_main = @just_cust_main; - -# foreach my $cust_main ( @just_cust_main ) { -# -# my @one_cust_main; -# $FS::Record::DEBUG=1; -# ( $cache, @one_cust_main ) = jsearch( -# "$monsterjoin", -# { 'custnum' => $cust_main->custnum }, -# '', -# '', -# 'cust_main', -# 'custnum', -# ); -# push @cust_main, @one_cust_main; -# } - -} else { - @cust_main=(); - $sortby = \*last_sort; - - push @cust_main, @{&custnumsearch} - if $cgi->param('custnum_on') && $cgi->param('custnum_text'); - push @cust_main, @{&cardsearch} - if $cgi->param('card_on') && $cgi->param('card'); - push @cust_main, @{&lastsearch} - if $cgi->param('last_on') && $cgi->param('last_text'); - push @cust_main, @{&companysearch} - if $cgi->param('company_on') && $cgi->param('company_text'); - push @cust_main, @{&address2search} - if $cgi->param('address2_on') && $cgi->param('address2_text'); - push @cust_main, @{&phonesearch} - if $cgi->param('phone_on') && $cgi->param('phone_text'); - push @cust_main, @{&referralsearch} - if $cgi->param('referral_custnum'); - - if ( $cgi->param('company_on') && $cgi->param('company_text') ) { - $sortby = \*company_sort; - push @cust_main, @{&companysearch}; - } - - @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main - if $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me - || ( $conf->exists('hidecancelledcustomers') - && ! $cgi->param('showcancelledcustomers') ); - - my %saw = (); - @cust_main = grep { !$saw{$_->custnum}++ } @cust_main; -} - -my %all_pkgs; -if ( $conf->exists('hidecancelledpackages' ) ) { - %all_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main; -} else { - %all_pkgs = map { $_->custnum => [ $_->all_pkgs ] } @cust_main; -} -#%all_pkgs = (); - -if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) { - if ( $cgi->param('quickpay') eq 'yes' ) { - print $cgi->redirect(popurl(2). "edit/cust_pay.cgi?quickpay=yes;custnum=". $cust_main[0]->custnum); - } else { - print $cgi->redirect(popurl(2). "view/cust_main.cgi?". $cust_main[0]->custnum); - } - #exit; -} elsif ( scalar(@cust_main) == 0 ) { -%> - -<% - eidiot "No matching customers found!\n"; -} else { -%> - -<% - - $total ||= scalar(@cust_main); - print header("Customer Search Results",menubar( - 'Main Menu', popurl(2) - )), "$total matching customers found "; - - #begin pager - my $pager = ''; - if ( $total != scalar(@cust_main) && $maxrecords ) { - unless ( $offset == 0 ) { - $cgi->param('offset', $offset - $maxrecords); - $pager .= 'Previous '; - } - my $poff; - my $page; - for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { - $page++; - if ( $offset == $poff ) { - $pager .= qq!$page !; - } else { - $cgi->param('offset', $poff); - $pager .= qq!$page !; - } - } - unless ( $offset + $maxrecords > $total ) { - $cgi->param('offset', $offset + $maxrecords); - $pager .= 'Next '; - } - } - #end pager - - if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me - || ( $conf->exists('hidecancelledcustomers') - && ! $cgi->param('showcancelledcustomers') - ) - ) { - $cgi->param('showcancelledcustomers', 1); - $cgi->param('offset', 0); - print qq!( show cancelled customers )!; - } else { - $cgi->param('showcancelledcustomers', 0); - $cgi->param('offset', 0); - print qq!( hide cancelled customers )!; - } - if ( $cgi->param('referral_custnum') ) { - $cgi->param('referral_custnum') =~ /^(\d+)$/ - or eidiot "Illegal referral_custnum\n"; - my $referral_custnum = $1; - my $cust_main = qsearchs('cust_main', { custnum => $referral_custnum } ); - print '
          '. - qq!!. - 'referrals of $referral_custnum: ". - ( $cust_main->company - || $cust_main->last. ', '. $cust_main->first ). - ''; - print "\n",< - function changed(what) { - what.form.submit(); - } - -END - print ' levels deep". - ''. - ''; - } - - print "

          ". $pager. &table(). < - - (bill) name - company -END - -if ( defined dbdef->table('cust_main')->column('ship_last') ) { - print <(service) name - company -END -} - -print <Packages - Services - -END - - my(%saw,$cust_main); - my $p = popurl(2); - foreach $cust_main ( - sort $sortby grep(!$saw{$_->custnum}++, @cust_main) - ) { - my($custnum,$last,$first,$company)=( - $cust_main->custnum, - $cust_main->getfield('last'), - $cust_main->getfield('first'), - $cust_main->company, - ); - - my(@lol_cust_svc); - my($rowspan)=0;#scalar( @{$all_pkgs{$custnum}} ); - foreach ( @{$all_pkgs{$custnum}} ) { - #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); - my @cust_svc = $_->cust_svc; - push @lol_cust_svc, \@cust_svc; - $rowspan += scalar(@cust_svc) || 1; - } - - #my($rowspan) = scalar(@{$all_pkgs{$custnum}}); - my $view; - if ( defined $cgi->param('quickpay') && $cgi->param('quickpay') eq 'yes' ) { - $view = $p. 'edit/cust_pay.cgi?quickpay=yes;custnum='. $custnum; - } else { - $view = $p. 'view/cust_main.cgi?'. $custnum; - } - my $pcompany = $company - ? qq!$company! - : ' '; - print < - $custnum - $last, $first - $pcompany -END - if ( defined dbdef->table('cust_main')->column('ship_last') ) { - my($ship_last,$ship_first,$ship_company)=( - $cust_main->ship_last || $cust_main->getfield('last'), - $cust_main->ship_last ? $cust_main->ship_first : $cust_main->first, - $cust_main->ship_last ? $cust_main->ship_company : $cust_main->company, - ); - my $pship_company = $ship_company - ? qq!$ship_company! - : ' '; - print <$ship_last, $ship_first - $pship_company -END - } - - my($n1)=''; - foreach ( @{$all_pkgs{$custnum}} ) { - my $pkgnum = $_->pkgnum; -# my $part_pkg = qsearchs( 'part_pkg', { pkgpart => $_->pkgpart } ); - my $part_pkg = $_->part_pkg; - - my $pkg = $part_pkg->pkg; - my $comment = $part_pkg->comment; - my $pkgview = $p. 'view/cust_pkg.cgi?'. $pkgnum; - my @cust_svc = @{shift @lol_cust_svc}; - #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); - my $rowspan = scalar(@cust_svc) || 1; - - print $n1, qq!$pkg - $comment!; - my($n2)=''; - foreach my $cust_svc ( @cust_svc ) { - my($label, $value, $svcdb) = $cust_svc->label; - my($svcnum) = $cust_svc->svcnum; - my($sview) = $p.'view'; - print $n2,qq!$label!, - qq!$value!; - $n2=""; - } - #print qq!\n!; - $n1=""; - } - print ""; - } - - print "$pager"; - -} - -#undef $cache; #does this help? - -# - -sub last_sort { - lc($a->getfield('last')) cmp lc($b->getfield('last')) - || lc($a->first) cmp lc($b->first); -} - -sub company_sort { - return -1 if $a->company && ! $b->company; - return 1 if ! $a->company && $b->company; - lc($a->company) cmp lc($b->company) - || lc($a->getfield('last')) cmp lc($b->getfield('last')) - || lc($a->first) cmp lc($b->first);; -} - -sub custnum_sort { - $a->getfield('custnum') <=> $b->getfield('custnum'); -} - -sub custnumsearch { - - my $custnum = $cgi->param('custnum_text'); - $custnum =~ s/\D//g; - $custnum =~ /^(\d{1,23})$/ or eidiot "Illegal customer number\n"; - my $custnum = $1; - - [ qsearchs('cust_main', { 'custnum' => $custnum } ) ]; -} - -sub cardsearch { - - my($card)=$cgi->param('card'); - $card =~ s/\D//g; - $card =~ /^(\d{13,16})$/ or eidiot "Illegal card number\n"; - my($payinfo)=$1; - - [ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'}) ]; -} - -sub referralsearch { - $cgi->param('referral_custnum') =~ /^(\d+)$/ - or eidiot "Illegal referral_custnum"; - my $cust_main = qsearchs('cust_main', { 'custnum' => $1 } ) - or eidiot "Customer $1 not found"; - my $depth; - if ( $cgi->param('referral_depth') ) { - $cgi->param('referral_depth') =~ /^(\d+)$/ - or eidiot "Illegal referral_depth"; - $depth = $1; - } else { - $depth = 1; - } - [ $cust_main->referral_cust_main($depth) ]; -} - -sub lastsearch { - my(%last_type); - my @cust_main; - foreach ( $cgi->param('last_type') ) { - $last_type{$_}++; - } - - $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/ - or eidiot "Illegal last name"; - my($last)=$1; - - if ( $last_type{'Exact'} || $last_type{'Fuzzy'} ) { - push @cust_main, qsearch( 'cust_main', - { 'last' => { 'op' => 'ILIKE', - 'value' => $last } } ); - - push @cust_main, qsearch( 'cust_main', - { 'ship_last' => { 'op' => 'ILIKE', - 'value' => $last } } ) - if defined dbdef->table('cust_main')->column('ship_last'); - } - - if ( $last_type{'Substring'} || $last_type{'All'} ) { - - push @cust_main, qsearch( 'cust_main', - { 'last' => { 'op' => 'ILIKE', - 'value' => "%$last%" } } ); - - push @cust_main, qsearch( 'cust_main', - { 'ship_last' => { 'op' => 'ILIKE', - 'value' => "%$last%" } } ) - if defined dbdef->table('cust_main')->column('ship_last'); - - } - - if ( $last_type{'Fuzzy'} || $last_type{'All'} ) { - - &FS::cust_main::check_and_rebuild_fuzzyfiles; - my $all_last = &FS::cust_main::all_last; - - my %last; - if ( $last_type{'Fuzzy'} || $last_type{'All'} ) { - foreach ( amatch($last, [ qw(i) ], @$all_last) ) { - $last{$_}++; - } - } - - #if ($last_type{'Sound-alike'}) { - #} - - foreach ( keys %last ) { - push @cust_main, qsearch('cust_main',{'last'=>$_}); - push @cust_main, qsearch('cust_main',{'ship_last'=>$_}) - if defined dbdef->table('cust_main')->column('ship_last'); - } - - } - - \@cust_main; -} - -sub companysearch { - - my(%company_type); - my @cust_main; - foreach ( $cgi->param('company_type') ) { - $company_type{$_}++ - }; - - $cgi->param('company_text') =~ - /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ - or eidiot "Illegal company"; - my $company = $1; - - if ( $company_type{'Exact'} || $company_type{'Fuzzy'} ) { - push @cust_main, qsearch( 'cust_main', - { 'company' => { 'op' => 'ILIKE', - 'value' => $company } } ); - - push @cust_main, qsearch( 'cust_main', - { 'ship_company' => { 'op' => 'ILIKE', - 'value' => $company } } ) - if defined dbdef->table('cust_main')->column('ship_last'); - } - - if ( $company_type{'Substring'} || $company_type{'All'} ) { - - push @cust_main, qsearch( 'cust_main', - { 'company' => { 'op' => 'ILIKE', - 'value' => "%$company%" } } ); - - push @cust_main, qsearch( 'cust_main', - { 'ship_company' => { 'op' => 'ILIKE', - 'value' => "%$company%" } }) - if defined dbdef->table('cust_main')->column('ship_last'); - - } - - if ( $company_type{'Fuzzy'} || $company_type{'All'} ) { - - &FS::cust_main::check_and_rebuild_fuzzyfiles; - my $all_company = &FS::cust_main::all_company; - - my %company; - if ( $company_type{'Fuzzy'} || $company_type{'All'} ) { - foreach ( amatch($company, [ qw(i) ], @$all_company ) ) { - $company{$_}++; - } - } - - #if ($company_type{'Sound-alike'}) { - #} - - foreach ( keys %company ) { - push @cust_main, qsearch('cust_main',{'company'=>$_}); - push @cust_main, qsearch('cust_main',{'ship_company'=>$_}) - if defined dbdef->table('cust_main')->column('ship_last'); - } - - } - - \@cust_main; -} - -sub address2search { - my @cust_main; - - $cgi->param('address2_text') =~ - /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/ - or eidiot "Illegal address2"; - my $address2 = $1; - - push @cust_main, qsearch( 'cust_main', - { 'address2' => { 'op' => 'ILIKE', - 'value' => $address2 } } ); - push @cust_main, qsearch( 'cust_main', - { 'address2' => { 'op' => 'ILIKE', - 'value' => $address2 } } ) - if defined dbdef->table('cust_main')->column('ship_last'); - - \@cust_main; -} - -sub phonesearch { - my @cust_main; - - my $phone = $cgi->param('phone_text'); - - #false laziness with Record::ut_phonen, only works with US/CA numbers... - $phone =~ s/\D//g; - $phone =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/ - or eidiot gettext('illegal_phone'). ": $phone"; - $phone = "$1-$2-$3"; - $phone .= " x$4" if $4; - - my @fields = qw(daytime night fax); - push @fields, qw(ship_daytime ship_night ship_fax) - if defined dbdef->table('cust_main')->column('ship_last'); - - for my $field ( @fields ) { - push @cust_main, qsearch ( 'cust_main', - { $field => { 'op' => 'LIKE', - 'value' => "$phone%" } } ); - } - - \@cust_main; -} - -%> diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html deleted file mode 100755 index 5a066e453..000000000 --- a/httemplate/search/cust_main.html +++ /dev/null @@ -1,42 +0,0 @@ - - - Customer Search - - - - Customer Search - -

          -
          - Search for last name: - - using search method: - -

          Search for company: - - using search methods: - -

          Note: Fuzzy searching can take a while. Please be patient. - -

          - -
          Explanation of search methods: -
            -
          • All - Try all search methods. -
          • Fuzzy - Searches for matches that are close to your text. -
          • Substring - Searches for matches that contain your text. -
          • Exact - Finds exact matches only, but much faster than the other search methods. -
          - - - diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi deleted file mode 100755 index b5bdf8296..000000000 --- a/httemplate/search/cust_pay.cgi +++ /dev/null @@ -1,103 +0,0 @@ -<% - -$cgi->param('payinfo') =~ /^\s*(\d+)\s*$/ or die "illegal payinfo"; -my $payinfo = $1; -$cgi->param('payby') =~ /^(\w+)$/ or die "illegal payby"; -my $payby = $1; -my @cust_pay = qsearch('cust_pay', { 'payinfo' => $payinfo, - 'payby' => $payby } ); -my $sortby = \*date_sort; - -if (0) { -#if ( scalar(@cust_pay) == 1 ) { -# my $invnum = $cust_bill[0]->invnum; -# print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect -} elsif ( scalar(@cust_pay) == 0 ) { -%> - -<% - idiot("Check # not found."); - #exit; -} else { - my $total = scalar(@cust_pay); - my $s = $total > 1 ? 's' : ''; -%> - -<% - print header("Check # Search Results", menubar( - 'Main Menu', popurl(2) - )), "$total matching check$s found
          ", &table(), < - - Amount - Date - Contact name - Company - -END - - my(%saw, $cust_pay); - foreach my $cust_pay ( - sort $sortby grep(!$saw{$_->paynum}++, @cust_pay) - ) { - my($paynum, $custnum, $payinfo, $amount, $date ) = ( - $cust_pay->paynum, - $cust_pay->custnum, - $cust_pay->payinfo, - sprintf("%.2f", $cust_pay->paid), - $cust_pay->_date, - ); - my $pdate = time2str("%b %d %Y", $date); - - my $rowspan = 1; - - my $view = popurl(2). "view/cust_main.cgi?". $custnum. - "#". $payby. $payinfo; - - print < - $payinfo - \$$amount - $pdate -END - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - if ( $cust_main ) { - #my $cview = popurl(2). "view/cust_main.cgi?". $cust_main->custnum; - my ( $name, $company ) = ( - $cust_main->last. ', '. $cust_main->first, - $cust_main->company, - ); - print <$name - $company -END - } else { - print <WARNING: couldn't find cust_main.custnum $custnum (cust_pay.paynum $paynum) -END - } - - print ""; - } - print < - - -END - -} - -# - -#sub invnum_sort { -# $a->invnum <=> $b->invnum; -#} -# -#sub custnum_sort { -# $a->custnum <=> $b->custnum || $a->invnum <=> $b->invnum; -#} - -sub date_sort { - $a->_date <=> $b->_date || $a->invnum <=> $b->invnum; -} -%> diff --git a/httemplate/search/cust_pay.html b/httemplate/search/cust_pay.html deleted file mode 100755 index 3848d66f7..000000000 --- a/httemplate/search/cust_pay.html +++ /dev/null @@ -1,18 +0,0 @@ - - - Check # Search - - - - Check # Search - -

          -
          - Search for check #: - - -

          -
          - - - diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi deleted file mode 100755 index abf6eee4c..000000000 --- a/httemplate/search/cust_pkg.cgi +++ /dev/null @@ -1,319 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $maxrecords = $conf->config('maxsearchrecordsperpage'); - -my %part_pkg = map { $_->pkgpart => $_ } qsearch('part_pkg', {}); - -my $limit = ''; -$limit .= "LIMIT $maxrecords" if $maxrecords; - -my $offset = $cgi->param('offset') || 0; -$limit .= " OFFSET $offset" if $offset; - -my $total; - -my($query) = $cgi->keywords; -my $sortby; -my @cust_pkg; - -if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) { - $sortby=\*bill_sort; - my $range = ''; - if ( $cgi->param('beginning') - && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) { - my $beginning = str2time($1); - $range = " WHERE bill >= $beginning "; - } - if ( $cgi->param('ending') - && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) { - my $ending = str2time($1) + 86400; - $range .= ( $range ? ' AND ' : ' WHERE ' ). " bill <= $ending "; - } - - #false laziness with below - my $statement = "SELECT COUNT(*) FROM cust_pkg $range"; - warn $statement; - my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - - $total = $sth->fetchrow_arrayref->[0]; - - @cust_pkg = qsearch('cust_pkg',{}, '', " $range ORDER BY bill $limit" ); - -} else { - - my $unconf = ''; - if ( $query eq 'pkgnum' ) { - $sortby=\*pkgnum_sort; - - } elsif ( $query eq 'APKG_pkgnum' ) { - - $sortby=\*pkgnum_sort; - - #@cust_pkg=(); - ##perhaps this should go in cust_pkg as a qsearch-like constructor? - #my($cust_pkg); - #foreach $cust_pkg ( - # qsearch('cust_pkg',{}, '', "ORDER BY pkgnum $limit" ) - #) { - # my($flag)=0; - # my($pkg_svc); - # PKG_SVC: - # foreach $pkg_svc (qsearch('pkg_svc',{ 'pkgpart' => $cust_pkg->pkgpart })) { - # if ( $pkg_svc->quantity - # > scalar(qsearch('cust_svc',{ - # 'pkgnum' => $cust_pkg->pkgnum, - # 'svcpart' => $pkg_svc->svcpart, - # })) - # ) - # { - # $flag=1; - # last PKG_SVC; - # } - # } - # push @cust_pkg, $cust_pkg if $flag; - #} - - if ( driver_name eq 'mysql' ) { - #$query = "DROP TABLE temp1_$$,temp2_$$;"; - #my $sth = dbh->prepare($query); - #$sth->execute; - - $query = "CREATE TEMPORARY TABLE temp1_$$ TYPE=MYISAM - SELECT cust_svc.pkgnum,cust_svc.svcpart,COUNT(*) as count - FROM cust_pkg,cust_svc,pkg_svc - WHERE cust_pkg.pkgnum = cust_svc.pkgnum - AND cust_svc.svcpart = pkg_svc.svcpart - AND cust_pkg.pkgpart = pkg_svc.pkgpart - GROUP BY cust_svc.pkgnum,cust_svc.svcpart"; - $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query"; - - $sth->execute or die "Error executing \"$query\": ". $sth->errstr; - - $query = "CREATE TEMPORARY TABLE temp2_$$ TYPE=MYISAM - SELECT cust_pkg.pkgnum FROM cust_pkg - LEFT JOIN pkg_svc ON (cust_pkg.pkgpart=pkg_svc.pkgpart) - LEFT JOIN temp1_$$ ON (cust_pkg.pkgnum = temp1_$$.pkgnum - AND pkg_svc.svcpart=temp1_$$.svcpart) - WHERE ( pkg_svc.quantity > temp1_$$.count - OR temp1_$$.pkgnum IS NULL ) - AND pkg_svc.quantity != 0;"; - $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query"; - $sth->execute or die "Error executing \"$query\": ". $sth->errstr; - $unconf = " LEFT JOIN temp2_$$ ON cust_pkg.pkgnum = temp2_$$.pkgnum - WHERE temp2_$$.pkgnum IS NOT NULL"; - - } else { - - $unconf = " - WHERE 0 < - ( SELECT count(*) FROM pkg_svc - WHERE pkg_svc.pkgpart = cust_pkg.pkgpart - AND pkg_svc.quantity > ( SELECT count(*) FROM cust_svc - WHERE cust_svc.pkgnum = cust_pkg.pkgnum - AND cust_svc.svcpart = pkg_svc.svcpart - ) - ) - "; - - } - - } else { - die "Empty QUERY_STRING!"; - } - - my $statement = "SELECT COUNT(*) FROM cust_pkg $unconf"; - my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - - $total = $sth->fetchrow_arrayref->[0]; - - my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : ''; - @cust_pkg = - qsearch('cust_pkg',{}, '', "$unconf ORDER BY ${tblname}pkgnum $limit" ); - - if ( driver_name eq 'mysql' ) { - $query = "DROP TABLE temp1_$$,temp2_$$;"; - my $sth = dbh->prepare($query) or die dbh->errstr. " doing $query"; - $sth->execute; # or die "Error executing \"$query\": ". $sth->errstr; - } - -} - -if ( scalar(@cust_pkg) == 1 ) { - my($pkgnum)=$cust_pkg[0]->pkgnum; - print $cgi->redirect(popurl(2). "view/cust_pkg.cgi?$pkgnum"); - #exit; -} elsif ( scalar(@cust_pkg) == 0 ) { #error -%> - -<% - eidiot("No packages found"); -} else { -%> - -<% - $total ||= scalar(@cust_pkg); - - #begin pager - my $pager = ''; - if ( $total != scalar(@cust_pkg) && $maxrecords ) { - unless ( $offset == 0 ) { - $cgi->param('offset', $offset - $maxrecords); - $pager .= 'Previous '; - } - my $poff; - my $page; - for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { - $page++; - if ( $offset == $poff ) { - $pager .= qq!$page !; - } else { - $cgi->param('offset', $poff); - $pager .= qq!$page !; - } - } - unless ( $offset + $maxrecords > $total ) { - $cgi->param('offset', $offset + $maxrecords); - $pager .= 'Next '; - } - } - #end pager - - print header('Package Search Results',''), - "$total matching packages found

          $pager", &table(), < - Package - Setup - Next
          bill
          - Susp. - Expire - Cancel - Cust# - (bill) name - company -END - -if ( defined dbdef->table('cust_main')->column('ship_last') ) { - print <(service) name - company -END -} - -print <Services - -END - - my $n1 = ''; - my(%saw,$cust_pkg); - foreach $cust_pkg ( - sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg) - ) { - my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum}); - my($pkgnum, $setup, $bill, $susp, $expire, $cancel, - $custnum, $last, $first, $company ) = ( - $cust_pkg->pkgnum, - $cust_pkg->getfield('setup') - ? time2str("%D", $cust_pkg->getfield('setup') ) - : '', - $cust_pkg->getfield('bill') - ? time2str("%D", $cust_pkg->getfield('bill') ) - : '', - $cust_pkg->getfield('susp') - ? time2str("%D", $cust_pkg->getfield('susp') ) - : '', - $cust_pkg->getfield('expire') - ? time2str("%D", $cust_pkg->getfield('expire') ) - : '', - $cust_pkg->getfield('cancel') - ? time2str("%D", $cust_pkg->getfield('cancel') ) - : '', - $cust_pkg->custnum, - $cust_main ? $cust_main->last : '', - $cust_main ? $cust_main->first : '', - $cust_main ? $cust_main->company : '', - ); - my($ship_last, $ship_first, $ship_company); - if ( defined dbdef->table('cust_main')->column('ship_last') ) { - ($ship_last, $ship_first, $ship_company) = ( - $cust_main - ? ( $cust_main->ship_last || $cust_main->getfield('last') ) - : '', - $cust_main - ? ( $cust_main->ship_last - ? $cust_main->ship_first - : $cust_main->first ) - : '', - $cust_main - ? ( $cust_main->ship_last - ? $cust_main->ship_company - : $cust_main->company ) - : '', - ); - } - my $pkg = $part_pkg{$cust_pkg->pkgpart}->pkg; - #$pkg .= ' - '. $part_pkg{$cust_pkg->pkgpart}->comment; - my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } ); - my $rowspan = scalar(@cust_svc) || 1; - my $p = popurl(2); - print $n1, <$pkgnum - $pkg - $setup - $bill - $susp - $expire - $cancel -END - if ( $cust_main ) { - print <$custnum - $last, $first - $company -END - if ( defined dbdef->table('cust_main')->column('ship_last') ) { - print <$ship_last, $ship_first - $ship_company -END - } - } else { - my $colspan = defined dbdef->table('cust_main')->column('ship_last') - ? 5 : 3; - print <WARNING: couldn't find cust_main.custnum $custnum (cust_pkg.pkgnum $pkgnum) -END - } - - my $n2 = ''; - foreach my $cust_svc ( @cust_svc ) { - my($label, $value, $svcdb) = $cust_svc->label; - my $svcnum = $cust_svc->svcnum; - my $sview = $p. "view"; - print $n2,qq!$label!, - qq!$value!; - $n2=""; - } - - $n1 = ""; - - } - print ''; - - print "$pager"; - -} - -sub pkgnum_sort { - $a->getfield('pkgnum') <=> $b->getfield('pkgnum'); -} - -sub bill_sort { - $a->getfield('bill') <=> $b->getfield('bill'); -} - -%> diff --git a/httemplate/search/cust_pkg.html b/httemplate/search/cust_pkg.html deleted file mode 100755 index bb0a5407c..000000000 --- a/httemplate/search/cust_pkg.html +++ /dev/null @@ -1,24 +0,0 @@ - - - Packages - - -
          -

          Packages

          -
          -
          -
          - - Return packages with next bill date: - from m/d/y - to m/d/y - -

          - -

          - -
          - - - - diff --git a/httemplate/search/report_cc.cgi b/httemplate/search/report_cc.cgi deleted file mode 100755 index c2ab726b6..000000000 --- a/httemplate/search/report_cc.cgi +++ /dev/null @@ -1,25 +0,0 @@ - -<% - -my $user = getotaker; - -$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/; -my $beginning = $1; - -$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/; -my $ending = $1; - -print header('Credit Card Recipt Report Results'); - -open (REPORT, "freeside-cc-receipts-report -v -s $beginning -f $ending $user |"); - -print '
          ';
          -while() {
          -  print $_;
          -}
          -print '
          '; - -print ''; - -%> - diff --git a/httemplate/search/report_cc.html b/httemplate/search/report_cc.html deleted file mode 100755 index 8653dcc69..000000000 --- a/httemplate/search/report_cc.html +++ /dev/null @@ -1,23 +0,0 @@ - - - Credit Card Receipt Report Criteria - - -
          -

          Credit Card Receipt Report Criteria

          -
          -
          -
          - Return credit card receipt report for period: - from m/d/y - to m/d/y - -

          - -

          - -
          - - - - diff --git a/httemplate/search/report_credit.cgi b/httemplate/search/report_credit.cgi deleted file mode 100755 index 2adafc06e..000000000 --- a/httemplate/search/report_credit.cgi +++ /dev/null @@ -1,25 +0,0 @@ - -<% - -my $user = getotaker; - -$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/; -my $beginning = $1; - -$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/; -my $ending = $1; - -print header('In House Credit Report Results'); - -open (REPORT, "freeside-credit-report -v -s $beginning -f $ending $user |"); - -print '
          ';
          -while() {
          -  print $_;
          -}
          -print '
          '; - -print ''; - -%> - diff --git a/httemplate/search/report_credit.html b/httemplate/search/report_credit.html deleted file mode 100755 index df9b9581f..000000000 --- a/httemplate/search/report_credit.html +++ /dev/null @@ -1,23 +0,0 @@ - - - In House Credit Report Criteria - - -
          -

          In House Credit Report Criteria

          -
          -
          -
          - Return in house credit report for period: - from m/d/y - to m/d/y - -

          - -

          - -
          - - - - diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi deleted file mode 100755 index fdd3779a9..000000000 --- a/httemplate/search/report_receivables.cgi +++ /dev/null @@ -1,19 +0,0 @@ - -<% - -my $user = getotaker; - -print header('Current Receivables Report Results'); - -open (REPORT, "freeside-receivables-report -v $user |"); - -print '
          ';
          -while() {
          -  print $_;
          -}
          -print '
          '; - -print ''; - -%> - diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi deleted file mode 100755 index ac76fad6e..000000000 --- a/httemplate/search/report_tax.cgi +++ /dev/null @@ -1,25 +0,0 @@ - -<% - -my $user = getotaker; - -$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/; -my $beginning = $1; - -$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/; -my $ending = $1; - -print header('Tax Report Results'); - -open (REPORT, "freeside-tax-report -v -s $beginning -f $ending $user |"); - -print '
          ';
          -while() {
          -  print $_;
          -}
          -print '
          '; - -print ''; - -%> - diff --git a/httemplate/search/report_tax.html b/httemplate/search/report_tax.html deleted file mode 100755 index 7bf681b42..000000000 --- a/httemplate/search/report_tax.html +++ /dev/null @@ -1,23 +0,0 @@ - - - Tax Report Criteria - - -
          -

          Tax Report Criteria

          -
          -
          -
          - Return tax report for period: - from m/d/y - to m/d/y - -

          - -

          - -
          - - - - diff --git a/httemplate/search/sql.cgi b/httemplate/search/sql.cgi deleted file mode 100755 index b83ef039f..000000000 --- a/httemplate/search/sql.cgi +++ /dev/null @@ -1,76 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $maxrecords = $conf->config('maxsearchrecordsperpage'); - -my $limit = ''; -$limit .= "LIMIT $maxrecords" if $maxrecords; - -my $offset = $cgi->param('offset') || 0; -$limit .= " OFFSET $offset" if $offset; - -my $total; - -my $sql = $cgi->param('sql'); -$sql =~ s/^\s*SELECT//i; - -my $count_sql = $sql; -$count_sql =~ s/^(.*)\s+FROM\s/COUNT(*) FROM /i; - -my $sth = dbh->prepare("SELECT $count_sql") - or eidiot dbh->errstr. " doing $count_sql\n"; -$sth->execute or eidiot "Error executing \"$count_sql\": ". $sth->errstr; - -$total = $sth->fetchrow_arrayref->[0]; - -my $sth = dbh->prepare("SELECT $sql $limit") - or eidiot dbh->errstr. " doing $sql\n"; -$sth->execute or eidiot "Error executing \"$sql\": ". $sth->errstr; -my $rows = $sth->fetchall_arrayref; - -%> - -<% - - #begin pager - my $pager = ''; - if ( $total != scalar(@$rows) && $maxrecords ) { - unless ( $offset == 0 ) { - $cgi->param('offset', $offset - $maxrecords); - $pager .= 'Previous '; - } - my $poff; - my $page; - for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { - $page++; - if ( $offset == $poff ) { - $pager .= qq!$page !; - } else { - $cgi->param('offset', $poff); - $pager .= qq!$page !; - } - } - unless ( $offset + $maxrecords > $total ) { - $cgi->param('offset', $offset + $maxrecords); - $pager .= 'Next '; - } - } - #end pager - - print header('Query Results', menubar('Main Menu'=>$p) ). - "$total total rows

          $pager". table(). - ""; - print "$_" foreach @{$sth->{NAME}}; - print ""; - - foreach $row ( @$rows ) { - print ""; - print "$_" foreach @$row; - print ""; - } - - print "$pager"; - -%> diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi deleted file mode 100755 index 549231d3f..000000000 --- a/httemplate/search/svc_acct.cgi +++ /dev/null @@ -1,294 +0,0 @@ -<% - -my $mydomain = ''; - -my $conf = new FS::Conf; -my $maxrecords = $conf->config('maxsearchrecordsperpage'); - -my $orderby = ''; #removeme - -my $limit = ''; -$limit .= "LIMIT $maxrecords" if $maxrecords; - -my $offset = $cgi->param('offset') || 0; -$limit .= " OFFSET $offset" if $offset; - -my $total; - -my($query)=$cgi->keywords; -$query ||= ''; #to avoid use of unitialized value errors - -my $unlinked = ''; -if ( $query =~ /^UN_(.*)$/ ) { - $query = $1; - my $empty = driver_name eq 'Pg' ? qq('') : qq(""); - if ( driver_name eq 'mysql' ) { - $unlinked = "LEFT JOIN cust_svc ON cust_svc.svcnum = svc_acct.svcnum - WHERE cust_svc.pkgnum IS NULL - OR cust_svc.pkgnum = 0 - OR cust_svc.pkgnum = $empty"; - } else { - $unlinked = " - WHERE 0 < - ( SELECT count(*) FROM cust_svc - WHERE cust_svc.svcnum = svc_acct.svcnum - AND ( pkgnum IS NULL OR pkgnum = 0 OR pkgnum = $empty ) - ) - "; - } -} - -my $tblname = driver_name eq 'mysql' ? 'svc_acct.' : ''; -my(@svc_acct, $sortby); -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - $orderby = "ORDER BY ${tblname}svcnum"; -} elsif ( $query eq 'username' ) { - $sortby=\*username_sort; - $orderby = "ORDER BY ${tblname}username"; -} elsif ( $query eq 'uid' ) { - $sortby=\*uid_sort; - $orderby = ( $unlinked ? 'AND' : 'WHERE' ). - " ${tblname}uid IS NOT NULL ORDER BY ${tblname}uid"; -} else { - $sortby=\*uid_sort; - @svc_acct = @{&usernamesearch}; -} - -if ( $query eq 'svcnum' || $query eq 'username' || $query eq 'uid' ) { - - my $statement = "SELECT COUNT(*) FROM svc_acct $unlinked"; - my $sth = dbh->prepare($statement) - or die dbh->errstr. " doing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - - $total = $sth->fetchrow_arrayref->[0]; - - @svc_acct = qsearch('svc_acct', {}, '', "$unlinked $orderby $limit"); - -} - -if ( scalar(@svc_acct) == 1 ) { - my($svcnum)=$svc_acct[0]->svcnum; - print $cgi->redirect(popurl(2). "view/svc_acct.cgi?$svcnum"); #redirect - #exit; -} elsif ( scalar(@svc_acct) == 0 ) { #error -%> - -<% - idiot("Account not found"); -} else { -%> - -<% - $total ||= scalar(@svc_acct); - - #begin pager - my $pager = ''; - if ( $total != scalar(@svc_acct) && $maxrecords ) { - unless ( $offset == 0 ) { - $cgi->param('offset', $offset - $maxrecords); - $pager .= 'Previous '; - } - my $poff; - my $page; - for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { - $page++; - if ( $offset == $poff ) { - $pager .= qq!$page !; - } else { - $cgi->param('offset', $poff); - $pager .= qq!$page !; - } - } - unless ( $offset + $maxrecords > $total ) { - $cgi->param('offset', $offset + $maxrecords); - $pager .= 'Next '; - } - } - #end pager - - print header("Account Search Results",menubar('Main Menu'=>popurl(2))), - "$total matching accounts found

          $pager", - &table(), < - # - Username - Domain - UID - Service - Cust# - (bill) name - company -END - if ( defined dbdef->table('cust_main')->column('ship_last') ) { - print <(service) name - company -END - } - print ""; - - my(%saw,$svc_acct); - my $p = popurl(2); - foreach $svc_acct ( - sort $sortby grep(!$saw{$_->svcnum}++, @svc_acct) - ) { - my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct->svcnum }) - or die "No cust_svc record for svcnum ". $svc_acct->svcnum; - my $part_svc = qsearchs('part_svc', { 'svcpart' => $cust_svc->svcpart }) - or die "No part_svc record for svcpart ". $cust_svc->svcpart; - - my $domain; - my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc }); - if ( $svc_domain ) { - $domain = "svcnum. - "\">". $svc_domain->domain. ""; - } else { - unless ( $mydomain ) { - my $conf = new FS::Conf; - unless ( $mydomain = $conf->config('domain') ) { - die "No legacy domain config file and no svc_domain.svcnum record ". - "for svc_acct.domsvc: ". $svc_acct->domsvc; - } - } - $domain = "$mydomain*"; - } - my($cust_pkg,$cust_main); - if ( $cust_svc->pkgnum ) { - $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc->pkgnum }) - or die "No cust_pkg record for pkgnum ". $cust_svc->pkgnum; - $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pkg->custnum }) - or die "No cust_main record for custnum ". $cust_pkg->custnum; - } - my($svcnum, $username, $uid, $svc, $custnum, $last, $first, $company) = ( - $svc_acct->svcnum, - $svc_acct->getfield('username'), - $svc_acct->getfield('uid'), - $part_svc->svc, - $cust_svc->pkgnum ? $cust_main->custnum : '', - $cust_svc->pkgnum ? $cust_main->getfield('last') : '', - $cust_svc->pkgnum ? $cust_main->getfield('first') : '', - $cust_svc->pkgnum ? $cust_main->company : '', - ); - my($pcustnum) = $custnum - ? "$custnum" - : "(unlinked)" - ; - my $pname = $custnum ? "$last, $first" : ''; - my $pcompany = $custnum ? "$company" : ''; - my($pship_name, $pship_company); - if ( defined dbdef->table('cust_main')->column('ship_last') ) { - my($ship_last, $ship_first, $ship_company) = ( - $cust_svc->pkgnum ? ( $cust_main->ship_last || $last ) : '', - $cust_svc->pkgnum ? ( $cust_main->ship_last - ? $cust_main->ship_first - : $first - ) : '', - $cust_svc->pkgnum ? ( $cust_main->ship_last - ? $cust_main->ship_company - : $company - ) : '', - ); - $pship_name = $custnum ? "$ship_last, $ship_first" : ''; - $pship_company = $custnum ? "$ship_company" : ''; - } - print < - $svcnum - $username - $domain - $uid - $svc - $pcustnum - $pname - $pcompany -END - if ( defined dbdef->table('cust_main')->column('ship_last') ) { - print <$pship_name - $pship_company -END - } - print ""; - - } - - print "$pager
          "; - - if ( $mydomain ) { - print "
          * The $mydomain domain ". - "is contained in your legacy domain ". - "configuration file. ". - "You should run the bin/fs-migrate-svc_acct_sm script ". - "to create a proper svc_domain record for this domain."; - } - - print ''; - -} - -sub svcnum_sort { - $a->getfield('svcnum') <=> $b->getfield('svcnum'); -} - -sub username_sort { - $a->getfield('username') cmp $b->getfield('username'); -} - -sub uid_sort { - $a->getfield('uid') <=> $b->getfield('uid'); -} - -sub usernamesearch { - - my @svc_acct; - - my %username_type; - foreach ( $cgi->param('username_type') ) { - $username_type{$_}++; - } - - $cgi->param('username') =~ /^([\w\-\.\&]+)$/; #untaint username_text - my $username = $1; - - if ( $username_type{'Exact'} || $username_type{'Fuzzy'} ) { - push @svc_acct, qsearch( 'svc_acct', - { 'username' => { 'op' => 'ILIKE', - 'value' => $username } } ); - } - - if ( $username_type{'Substring'} || $username_type{'All'} ) { - push @svc_acct, qsearch( 'svc_acct', - { 'username' => { 'op' => 'ILIKE', - 'value' => "%$username%" } } ); - } - - if ( $username_type{'Fuzzy'} || $username_type{'All'} ) { - &FS::svc_acct::check_and_rebuild_fuzzyfiles; - my $all_username = &FS::svc_acct::all_username; - - my %username; - if ( $username_type{'Fuzzy'} || $username_type{'All'} ) { - foreach ( amatch($username, [ qw(i) ], @$all_username) ) { - $username{$_}++; - } - } - - #if ($username_type{'Sound-alike'}) { - #} - - foreach ( keys %username ) { - push @svc_acct, qsearch('svc_acct',{'username'=>$_}); - } - - } - - #[ qsearch('svc_acct',{'username'=>$username}) ]; - \@svc_acct; - -} - -%> diff --git a/httemplate/search/svc_acct.html b/httemplate/search/svc_acct.html deleted file mode 100755 index 742360596..000000000 --- a/httemplate/search/svc_acct.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Account Search - - - - Account Search - -

          -
          - Search for username: - - -

          - -

          - - - diff --git a/httemplate/search/svc_acct_sm.cgi b/httemplate/search/svc_acct_sm.cgi deleted file mode 100755 index 4ee300612..000000000 --- a/httemplate/search/svc_acct_sm.cgi +++ /dev/null @@ -1,84 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $mydomain = $conf->config('domain'); - -$cgi->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/; -my $domuser = $1; - -$cgi->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain"; -my $svc_domain = qsearchs('svc_domain',{'domain'=>$1}) - or die "Unknown domain"; -my $domsvc = $svc_domain->svcnum; - -my @svc_acct_sm; -if ($domuser) { - @svc_acct_sm=qsearch('svc_acct_sm',{ - 'domuser' => $domuser, - 'domsvc' => $domsvc, - }); -} else { - @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $domsvc}); -} - -if ( scalar(@svc_acct_sm) == 1 ) { - my($svcnum)=$svc_acct_sm[0]->svcnum; - print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum"); -} elsif ( scalar(@svc_acct_sm) > 1 ) { -%> - -<% - print header('Mail Alias Search Results'), &table(), < - Mail to
          (click to view mail alias) - Forwards to
          (click to view account) - -END - - my($svc_acct_sm); - foreach $svc_acct_sm (@svc_acct_sm) { - my($svcnum,$domuser,$domuid,$domsvc)=( - $svc_acct_sm->svcnum, - $svc_acct_sm->domuser, - $svc_acct_sm->domuid, - $svc_acct_sm->domsvc, - ); - - my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } ); - if ( $svc_domain ) { - my $domain = $svc_domain->domain; - - print qq!!, - #print '', ( ($domuser eq '*') ? "(anything)" : $domuser ); - ( ($domuser eq '*') ? "(anything)" : $domuser ), - qq!\@$domain !, - ; - } else { - my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum"; - warn $warning; - print "WARNING: $warning"; - } - - my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } ); - if ( $svc_acct ) { - my $username = $svc_acct->username; - my $svc_acct_svcnum =$svc_acct->svcnum; - print qq!$username\@$mydomain!, - qq!! - ; - } else { - my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!"; - warn $warning; - print "WARNING: $warning"; - } - - } - - print ''; - -} else { #error - idiot("Mail Alias not found"); -} - -%> diff --git a/httemplate/search/svc_acct_sm.html b/httemplate/search/svc_acct_sm.html deleted file mode 100755 index 0719856db..000000000 --- a/httemplate/search/svc_acct_sm.html +++ /dev/null @@ -1,23 +0,0 @@ - - - Mail Alias Search - - -
          -

          Mail Alias Search

          -
          -
          -
          - Search for mail alias: - (opt.) @ - (req.) - -

          - -

          - -
          - - - - diff --git a/httemplate/search/svc_domain.cgi b/httemplate/search/svc_domain.cgi deleted file mode 100755 index fb372db14..000000000 --- a/httemplate/search/svc_domain.cgi +++ /dev/null @@ -1,163 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $mydomain = $conf->config('domain'); - -my($query)=$cgi->keywords; -$query ||= ''; #to avoid use of unitialized value errors -my(@svc_domain,$sortby); -if ( $query eq 'svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'domain' ) { - $sortby=\*domain_sort; - @svc_domain=qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_svcnum' ) { - $sortby=\*svcnum_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} elsif ( $query eq 'UN_domain' ) { - $sortby=\*domain_sort; - @svc_domain = grep qsearchs('cust_svc',{ - 'svcnum' => $_->svcnum, - 'pkgnum' => '', - }), qsearch('svc_domain',{}); -} else { - $cgi->param('domain') =~ /^([\w\-\.]+)$/; - my($domain)=$1; - #push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain}); - @svc_domain = qsearchs('svc_domain',{'domain'=>$domain}); -} - -if ( scalar(@svc_domain) == 1 ) { - print $cgi->redirect(popurl(2). "view/svc_domain.cgi?". $svc_domain[0]->svcnum); - #exit; -} elsif ( scalar(@svc_domain) == 0 ) { -%> - -<% - eidiot "No matching domains found!\n"; -} else { -%> - -<% - my($total)=scalar(@svc_domain); - print header("Domain Search Results",''), < - - Service # - Domain - Mail to
          (click to view account) - Forwards to
          (click to view account) - -END - -# my(%saw); # if we've multiple domains with the same - # svcnum, then we've a corrupt database - - foreach my $svc_domain ( -# sort $sortby grep(!$saw{$_->svcnum}++, @svc_domain) - sort $sortby (@svc_domain) - ) { - my($svcnum,$domain)=( - $svc_domain->svcnum, - $svc_domain->domain, - ); - #my($malias); - #if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) { - # $malias=( - # qq|
          |. - # qq||. - # qq||. - # qq||. - # qq|
          | - # ); - #} else { - # $malias=''; - #} - - my @svc_acct=qsearch('svc_acct',{'domsvc' => $svcnum}); - my $rowspan = 0; - - my $n1 = ''; - my($svc_acct, @rows); - foreach $svc_acct ( - sort {$b->getfield('username') cmp $a->getfield('username')} (@svc_acct) - ) { - - my (@forwards) = (); - - my($svcnum,$username)=( - $svc_acct->svcnum, - $svc_acct->username, - ); - - my @svc_forward = qsearch( 'svc_forward', { 'srcsvc' => $svcnum } ); - my $svc_forward; - foreach $svc_forward (@svc_forward) { - my($dstsvc,$dst) = ( - $svc_forward->dstsvc, - $svc_forward->dst, - ); - if ($dstsvc) { - my $dst_svc_acct=qsearchs( 'svc_acct', { 'svcnum' => $dstsvc } ); - my $destination=$dst_svc_acct->email; - push @forwards, qq!$destination!, - qq!! - ; - }else{ - push @forwards, qq!$dst! - ; - } - } - - push @rows, qq!$n1!, - #print '', ( ($domuser eq '*') ? "(anything)" : $domuser ); - ( ($username eq '*') ? "(anything)" : $username ), - qq!\@$domain !, - ; - - push @rows, @forwards; - - $rowspan += (scalar(@svc_forward) || 1); - $n1 = ""; - } - #end of false laziness - - - - print < - $svcnum - $domain -END - - print @rows; - print ""; - - } - - print < - - -END - -} - -sub svcnum_sort { - $a->getfield('svcnum') <=> $b->getfield('svcnum'); -} - -sub domain_sort { - $a->getfield('domain') cmp $b->getfield('domain'); -} - - -%> diff --git a/httemplate/search/svc_domain.html b/httemplate/search/svc_domain.html deleted file mode 100755 index 94bb9a66d..000000000 --- a/httemplate/search/svc_domain.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Domain Search - - - - Domain Search - -

          -
          - Search for domain: - - -

          - -

          - - - diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi deleted file mode 100755 index 53d7bc051..000000000 --- a/httemplate/view/cust_bill.cgi +++ /dev/null @@ -1,48 +0,0 @@ - -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $invnum = $1; - -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; -my $custnum = $cust_bill->getfield('custnum'); - -#my $printed = $cust_bill->printed; - -print header('Invoice View', menubar( - "Main Menu" => $p, - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", -)); - -print qq!Enter payments (check/cash) against this invoice | ! - if $cust_bill->owed > 0; - -print qq!Reprint this invoice!. '

          '; - -#false laziness with search/cust_bill_event.cgi - -print table(). 'EventDateStatus'; -foreach my $cust_bill_event ( - sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event -) { - my $status = $cust_bill_event->status; - $status .= ': '. $cust_bill_event->statustext if $cust_bill_event->statustext; - print ''. $cust_bill_event->part_bill_event->event. ''. - time2str("%a %b %e %T %Y", $cust_bill_event->_date). ''. - $status. ''; -} -print '
          ';
          -
          -print $cust_bill->print_text;
          -
          -	#formatting
          -	print <
          -  
          -
          -END
          -
          -%>
          diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
          deleted file mode 100755
          index 421bd98a4..000000000
          --- a/httemplate/view/cust_main.cgi
          +++ /dev/null
          @@ -1,653 +0,0 @@
          -
          -<%
          -
          -my $conf = new FS::Conf;
          -
          -#false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so
          -my %uiview = ();
          -my %uiadd = ();
          -foreach my $part_svc ( qsearch('part_svc',{}) ) {
          -  $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
          -  $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
          -}
          -
          -print header("Customer View", menubar(
          -  'Main Menu' => popurl(2)
          -));
          -
          -die "No customer specified (bad URL)!" unless $cgi->keywords;
          -my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
          -$query =~ /^(\d+)$/;
          -my $custnum = $1;
          -my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
          -die "Customer not found!" unless $cust_main;
          -
          -print qq!Edit this customer!;
          -print qq! |  Delete this customer!
          -  if $conf->exists('deletecustomers');
          -
          -unless ( $conf->exists('disable_customer_referrals') ) {
          -  print qq! | !,
          -        qq!Refer a new customer!;
          -
          -  print qq! | !,
          -        qq!View this customer's referrals!;
          -}
          -
          -print '

          '; - -my $signupurl = $conf->config('signupurl'); -if ( $signupurl ) { -print "This customer's signup URL: ". - "$signupurl?ref=$custnum

          "; -} - -print ''; - -print &itable(), ''; - -print ''; - - print "Billing address", &ntable("#cccccc"), "", - &ntable("#cccccc",2), - 'Contact name', - '', - $cust_main->last, ', ', $cust_main->first, - ''; -print 'SS#', - $cust_main->ss || ' ', '' - if $conf->exists('show_ss'); - -print '', - 'Company', - $cust_main->company, - '', - 'Address', - $cust_main->address1, - '', - ; - print ' ', - $cust_main->address2, '' - if $cust_main->address2; - print 'City', - $cust_main->city, - 'State', - $cust_main->state, - 'Zip', - $cust_main->zip, '', - 'Country', - $cust_main->country, - '', - ; - print 'Day Phone', - $cust_main->daytime || ' ', '', - 'Night Phone', - $cust_main->night || ' ', '', - 'Fax', - $cust_main->fax || ' ', '', - '', "" - ; - - if ( defined $cust_main->dbdef_table->column('ship_last') ) { - - my $pre = $cust_main->ship_last ? 'ship_' : ''; - - print "
          Service address", &ntable("#cccccc"), "", - &ntable("#cccccc",2), - 'Contact name', - '', - $cust_main->get("${pre}last"), ', ', $cust_main->get("${pre}first"), - '', - 'Company', - $cust_main->get("${pre}company"), - '', - 'Address', - $cust_main->get("${pre}address1"), - '', - ; - print ' ', - $cust_main->get("${pre}address2"), '' - if $cust_main->get("${pre}address2"); - print 'City', - $cust_main->get("${pre}city"), - 'State', - $cust_main->get("${pre}state"), - 'Zip', - $cust_main->get("${pre}zip"), '', - 'Country', - $cust_main->get("${pre}country"), - '', - ; - print 'Day Phone', - '', - $cust_main->get("${pre}daytime") || ' ', '', - 'Night Phone'. - '', - $cust_main->get("${pre}night") || ' ', '', - 'Fax', - $cust_main->get("${pre}fax") || ' ', '', - '', "" - ; - - } - -print ''; - -print ''; - - print &ntable("#cccccc"), "", &ntable("#cccccc",2), - 'Customer number', - $custnum, '', - ; - - my @agents = qsearch( 'agent', {} ); - my $agent; - unless ( scalar(@agents) == 1 ) { - $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); - print 'Agent', - $agent->agentnum, ": ", $agent->agent, ''; - } else { - $agent = $agents[0]; - } - my @referrals = qsearch( 'part_referral', {} ); - unless ( scalar(@referrals) == 1 ) { - my $referral = qsearchs('part_referral', { - 'refnum' => $cust_main->refnum - } ); - print 'Advertising source', - $referral->refnum, ": ", $referral->referral, ''; - } - print 'Order taker', - $cust_main->otaker, ''; - - print 'Referring Customer'; - my $referring_cust_main = ''; - if ( $cust_main->referral_custnum - && ( $referring_cust_main = - qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) - ) - ) { - print ''. - $cust_main->referral_custnum. ': '. - ( $referring_cust_main->company - ? $referring_cust_main->company. ' ('. - $referring_cust_main->last. ', '. $referring_cust_main->first. - ')' - : $referring_cust_main->last. ', '. $referring_cust_main->first - ). - ''; - } - print ''; - - print ''; - -print '
          '; - - my @invoicing_list = $cust_main->invoicing_list; - print "Billing information (", - qq!!, "Bill now)", - &ntable("#cccccc"), "", &ntable("#cccccc",2), - 'Tax exempt', - $cust_main->tax ? 'yes' : 'no', - '', - 'Postal invoices', - ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no', - '', - 'Email invoices', - join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no', - '', - 'Billing type', - ; - - if ( $cust_main->payby eq 'CARD' ) { - my $payinfo = $cust_main->payinfo; - $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4)); - print 'Credit card', - 'Card number', - $payinfo, '', - 'Expiration', - $cust_main->paydate, '', - 'Name on card', - $cust_main->payname, '' - ; - } elsif ( $cust_main->payby eq 'BILL' ) { - print 'Billing'; - print 'P.O. ', - $cust_main->payinfo, '', - if $cust_main->payinfo; - print 'Expiration', - $cust_main->paydate, '', - 'Attention', - $cust_main->payname, '', - ; - } elsif ( $cust_main->payby eq 'COMP' ) { - print 'Complimentary', - 'Authorized by', - $cust_main->payinfo, '', - 'Expiration', - $cust_main->paydate, '', - ; - } - - print ""; - -print ''; - -if ( defined $cust_main->dbdef_table->column('comments') - && $cust_main->comments ) -{ - print "
          Comments", &ntable("#cccccc"), "", - &ntable("#cccccc",2), - '
          ', $cust_main->comments,
          -        '
          '; -} - -print ''; - -print '
          '. - '
          '. - qq!!. - '

          '; - -print '
          '. - qq!
          !. - qq!!. - qq!Description:!. - qq! Amount:!. - qq! !; - -#false laziness w/ edit/part_pkg.cgi -if ( $conf->exists('enable_taxclasses') ) { - print ''; -} else { - print ''; -} - -print qq!

          !; - -print < -function cust_pkg_areyousure(href) { - if (confirm("Permanently delete included services and cancel this package?") == true) - window.location.href = href; -} - -END - -print qq!
          Packages !, -# qq!
          Click on package number to view/edit package.!, - qq!( Order and cancel packages (preserves services) )!, -; - -#display packages - -#formatting -print qq!!, &table(), "\n", - qq!Package!, - qq!DatesServices\n!, - qq!Setup!, - qq!Next bill!, - qq!Susp.Expire!, - qq!!, - qq!Cancel!, - qq!\n!; - -#get package info -my @packages; -if ( $conf->exists('hidecancelledpackages') ) { - @packages = sort { $a->pkgnum <=> $b->pkgnum } ($cust_main->ncancelled_pkgs); -} else { - @packages = sort { $a->pkgnum <=> $b->pkgnum } ($cust_main->all_pkgs); -} - -my $n1 = ''; -foreach my $package (@packages) { - my $pkgnum = $package->pkgnum; - my $pkg = $package->part_pkg->pkg; - my $comment = $package->part_pkg->comment; - my $pkgview = popurl(2). "view/cust_pkg.cgi?$pkgnum"; - - #my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } ); - #my $rowspan = scalar(@cust_svc) || 1; - my @cust_svc = (); - my $rowspan = 0; - my %pkg_svc = (); - unless ( $package->getfield('cancel') ) { - foreach my $pkg_svc ( - grep { $_->quantity } - qsearch('pkg_svc',{'pkgpart'=> $package->pkgpart }) - ) { - $rowspan += ( $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity ); - } - } else { - #@cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } ); - @cust_svc = (); - $rowspan = scalar(@cust_svc) || 1; - } - $rowspan ||= 1; - - my $button_cgi = new CGI; - $button_cgi->param('clone', $package->part_pkg->pkgpart); - $button_cgi->param('pkgnum', $package->pkgnum); - my $button_url = popurl(2). "edit/part_pkg.cgi?". $button_cgi->query_string; - - #print $n1, qq!$pkgnum!, - print $n1, qq!$pkgnum!, - qq!!, - #qq!$pkg - $comment!, - qq!$pkg - $comment ( Details )!; - # | !; - - #false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so - unless ( $package->getfield('cancel') ) { - print ' ( '; - if ( $package->getfield('susp') ) { - print qq!Unsuspend!; - } else { - print qq!Suspend!; - } - print ' | Cancel'; - - print ' ) '; - - print ' ( Edit dates | '; - - print qq!Customize )!; - - } - print ''; - - for ( qw( setup bill susp expire cancel ) ) { - print "", ( $package->getfield($_) - ? time2str("%D
          %l:%M:%S%P %z", - $package->getfield($_) ) - : ' ' - ), '
          ', - ; - } - - my $n2 = ''; - #false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so - #foreach my $cust_svc ( @cust_svc ) { - foreach my $svcpart ( sort { $a<=>$b } keys %pkg_svc ) { - my $svc = qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc'); - my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum, - 'svcpart'=>$svcpart, - }); - for my $enum ( 1 .. $pkg_svc{$svcpart} ) { - my $cust_svc; - if ( $cust_svc = shift @cust_svc ) { - my($label, $value, $svcdb) = $cust_svc->label; - my($svcnum) = $cust_svc->svcnum; - my($sview) = popurl(2). "view"; - print $n2,qq!$label!, - qq!$value!; - } else { - print $n2, qq!!. - qq!Provision $svc!; - - print qq!
          !. - qq!Link to legacy $svc! - if $conf->exists('legacy_link'); - - print ''; - } - $n2=""; - } - } - - $n1=""; -} -print ""; - -#formatting -print ""; - -print < -function cust_pay_areyousure(href) { - if (confirm("Are you sure you want to delete this payment?") - == true) - window.location.href = href; -} - -END - -#formatting -print qq!

          Payment History!. - qq! ( !. - qq!!. - qq!Post payment | !. - qq!!. - qq!Post credit )!; - -#get payment history -# -# major problem: this whole thing is way too sloppy. -# minor problem: the description lines need better formatting. - -my @history = (); #needed for mod_perl :) - -my %target = (); - -my @bills = qsearch('cust_bill',{'custnum'=>$custnum}); -foreach my $bill (@bills) { - my($bref)=$bill->hashref; - my $bpre = ( $bill->owed > 0 ) - ? ' Open ' - : ''; - my $bpost = ( $bill->owed > 0 ) ? '' : ''; - push @history, - $bref->{_date} . qq!\t${bpre}Invoice #! . $bref->{invnum} . - qq! (Balance \$! . $bill->owed . qq!)$bpost\t! . - $bref->{charged} . qq!\t\t\t!; - - my(@cust_bill_pay)=qsearch('cust_bill_pay',{'invnum'=> $bref->{invnum} } ); -# my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } ); -# my($payment); -# foreach $payment (@payments) { - foreach my $cust_bill_pay (@cust_bill_pay) { - my $payment = $cust_bill_pay->cust_pay; - my($date,$invnum,$payby,$payinfo,$paid)=($payment->_date, - $cust_bill_pay->invnum, - $payment->payby, - $payment->payinfo, - $cust_bill_pay->amount, - ); - $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4)) - if $payby eq 'CARD'; - my $target = "$payby$payinfo"; - $payby =~ s/^BILL$/Check #/ if $payinfo; - $payby =~ s/^(CARD|COMP)$/$1 /; - my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments') - ? qq! (delete)! - : ''; - push @history, - "$date\tPayment, Invoice #$invnum ($payby$payinfo)$delete\t\t$paid\t\t\t$target"; - } - - my(@cust_credit_bill)= - qsearch('cust_credit_bill', { 'invnum'=> $bref->{invnum} } ); - foreach my $cust_credit_bill (@cust_credit_bill) { - my $cust_credit = $cust_credit_bill->cust_credit; - my($date, $invnum, $crednum, $amount, $reason, $app_date ) = ( - $cust_credit->_date, - $cust_credit_bill->invnum, - $cust_credit_bill->crednum, - $cust_credit_bill->amount, - $cust_credit->reason, - time2str("%D", $cust_credit_bill->_date), - ); - push @history, - "$date\tCredit #$crednum: $reason
          ". - "(applied to invoice #$invnum on $app_date)\t\t\t$amount\t"; - } -} - -my @credits = grep { scalar(my @array = $_->cust_credit_refund) } - qsearch('cust_credit',{'custnum'=>$custnum}); -foreach my $credit (@credits) { - my($cref)=$credit->hashref; - my(@cust_credit_refund)= - qsearch('cust_credit_refund', { 'crednum'=> $cref->{crednum} } ); - foreach my $cust_credit_refund (@cust_credit_refund) { - my $cust_refund = $cust_credit_refund->cust_credit; - my($date, $crednum, $amount, $reason, $app_date ) = ( - $credit->_date, - $credit->crednum, - $cust_credit_refund->amount, - $credit->reason, - time2str("%D", $cust_credit_refund->_date), - ); - push @history, - "$date\tCredit #$crednum: $reason
          ". - "(applied to refund on $app_date)\t\t\t$amount\t"; - } -} - -@credits = grep { $_->credited > 0 } - qsearch('cust_credit',{'custnum'=>$custnum}); -foreach my $credit (@credits) { - my($cref)=$credit->hashref; - push @history, - $cref->{_date} . "\t" . - qq!!. - 'Unapplied credit #' . - $cref->{crednum} . ": ". - $cref->{reason} . "\t\t\t" . $credit->credited . "\t"; -} - -my(@refunds)=qsearch('cust_refund',{'custnum'=> $custnum } ); -foreach my $refund (@refunds) { - my($rref)=$refund->hashref; - my($refundnum) = ( - $refund->refundnum, - ); - - push @history, - $rref->{_date} . "\tRefund #$refundnum, (" . - $rref->{payby} . " " . $rref->{payinfo} . ") by " . - $rref->{otaker} . " - ". $rref->{reason} . "\t\t\t\t" . - $rref->{refund}; -} - -my @unapplied_payments = - grep { $_->unapplied > 0 } qsearch('cust_pay', { 'custnum' => $custnum } ); -foreach my $payment (@unapplied_payments) { - my $payby = $payment->payby; - my $payinfo = $payment->payinfo; - #false laziness w/above - $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4)) - if $payby eq 'CARD'; - my $target = "$payby$payinfo"; - $payby =~ s/^BILL$/Check #/ if $payinfo; - $payby =~ s/^(CARD|COMP)$/$1 /; - my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments') - ? qq! (delete)! - : ''; - push @history, - $payment->_date. "\t". - 'Unapplied payment #' . - $payment->paynum . " ($payby$payinfo) ". - '('. - "apply)$delete". - "\t\t" . $payment->unapplied . "\t\t\t$target"; -} - - #formatting - print &table(), < - Date - Description - Charge - Payment - In-house
          Credit
          - Refund - Balance - -END - -#display payment history - -my $balance = 0; -foreach my $item (sort keyfield_numerically @history) { - my($date,$desc,$charge,$payment,$credit,$refund,$target)=split(/\t/,$item); - $charge ||= 0; - $payment ||= 0; - $credit ||= 0; - $refund ||= 0; - $balance += $charge - $payment; - $balance -= $credit - $refund; - $balance = sprintf("%.2f", $balance); - $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp - $target = '' unless defined $target; - - print ""; - print qq!! unless $target && $target{$target}++; - print time2str("%D",$date); - print '' if $target && $target{$target} == 1; - print "", - "$desc", - "", - ( $charge ? "\$".sprintf("%.2f",$charge) : '' ), - "", - "", - ( $payment ? "- \$".sprintf("%.2f",$payment) : '' ), - "", - "", - ( $credit ? "- \$".sprintf("%.2f",$credit) : '' ), - "", - "", - ( $refund ? "\$".sprintf("%.2f",$refund) : '' ), - "", - "\$" . $balance, - "", - "\n"; -} - -#formatting -print ""; - -#end - -#formatting -print < - -END - -#subroutiens -sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0] ; } - -%> diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi deleted file mode 100755 index 09a2a7a8b..000000000 --- a/httemplate/view/cust_pkg.cgi +++ /dev/null @@ -1,157 +0,0 @@ - -<% - -my $conf = new FS::Conf; - -my %uiview = (); -my %uiadd = (); -foreach my $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi"; -} - -my ($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $pkgnum = $1; - -#get package record -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -my $custnum = $cust_pkg->getfield('custnum'); -print header('Package View', menubar( - "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", - 'Main Menu' => popurl(2) -)); - -#print info -my ($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -my $otaker = $cust_pkg->getfield('otaker'); - -print < -function areyousure(href) { - if (confirm("Permanently delete included services and cancel this package?") == true) - window.location.href = href; -} - -END - -print "Package information"; -print ' (unsuspend)' - if ( $susp && ! $cancel ); - -print ' (suspend)' - unless ( $susp || $cancel ); - -print ' (cancel)' - unless $cancel; - -print ' (edit dates)'; - -print &ntable("#cccccc"), '', &ntable("#cccccc",2), - 'Package number', - $pkgnum, '', - 'Package', - $pkg, '', - 'Comment', - $comment, '', - 'Setup date', - ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '', - 'Next bill date', - ( $bill ? time2str("%D",$bill) : " " ), '', -; -print 'Suspension date', - time2str("%D",$susp), '' if $susp; -print 'Expiration date', - time2str("%D",$expire), '' if $expire; -print 'Cancellation date', - time2str("%D",$cancel), '' if $cancel; -print 'Order taker', - $otaker, '', - '' -; - -# print < -# -#Expire (date): -# -#END - -unless ($cancel) { - - #services - print '
          Service Information', &table(); - - #list of services this pkgpart includes - my $pkg_svc; - my %pkg_svc = (); - foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { - $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity; - } - - #list of records from cust_svc - my $svcpart; - foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) { - - my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc'); - - my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum, - 'svcpart'=>$svcpart, - }); - - my($enum); - for $enum ( 1 .. $pkg_svc{$svcpart} ) { - - my($cust_svc); - if ( $cust_svc=shift @cust_svc ) { - my($svcnum)=$cust_svc->svcnum; - my($label, $value, $svcdb) = $cust_svc->label; - print <(View/Edit) $svc: $value -END - } else { - print qq!!. - qq!!. - qq!(Provision) $svc!; - - print qq! or !. - qq!(Link to legacy) $svc! - if $conf->exists('legacy_link'); - - print ''; - } - - } - warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;; - } - - print "", - "Choose (View/Edit) to view or edit an existing service
          ", - "Choose (Provision) to setup a new service
          "; - - print "Choose (Link to legacy) to link to a legacy (pre-Freeside) service" - if $conf->exists('legacy_link'); - - print "
          "; -} - -#formatting -print < - -END - -%> diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi deleted file mode 100755 index f6c1b026c..000000000 --- a/httemplate/view/svc_acct.cgi +++ /dev/null @@ -1,156 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $mydomain = $conf->config('domain'); - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_acct; - -#false laziness w/all svc_*.cgi -my $cust_svc = qsearchs( 'cust_svc' , { 'svcnum' => $svcnum } ); -my $pkgnum = $cust_svc->getfield('pkgnum'); -my($cust_pkg, $custnum); -if ($pkgnum) { - $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } ); - $custnum = $cust_pkg->custnum; -} else { - $cust_pkg = ''; - $custnum = ''; -} -#eofalse - -my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unknown svcpart" unless $part_svc; - -my $domain; -if ( $svc_acct->domsvc ) { - my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } ); - die "Unknown domain" unless $svc_domain; - $domain = $svc_domain->domain; -} else { - unless ( $mydomain ) { - die "No legacy domain config file and no svc_domain.svcnum record ". - "for svc_acct.domsvc: ". $cust_svc->domsvc; - } - $domain = $mydomain; -} - -%> - - - -<%= header('Account View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) account" => - "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" ) - ), - "Main menu" => $p, -)) %> - -<% - -#print qq!
          Send account information!; - -print qq!Edit this information
          !. - &ntable("#cccccc"). ''. &ntable("#cccccc",2). - "Service number". - "$svcnum". - "Service". - "". $part_svc->svc. "". - "Username". - "". $svc_acct->username. "" -; - -print "Domain". - "". $domain, ""; - -print "Password"; -my $password = $svc_acct->_password; -if ( $password =~ /^\*\w+\* (.*)$/ ) { - $password = $1; - print "(login disabled) "; -} -if ( $conf->exists('showpasswords') ) { - print "$password"; -} else { - print "(hidden)"; -} -print ""; -$password = ''; - -if ( $conf->exists('security_phrase') ) { - my $sec_phrase = $svc_acct->sec_phrase; - print 'Security phrase'. - $svc_acct->sec_phrase. ''; -} - -my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); -print "Access number". - "". $svc_acct_pop->text. '' - if $svc_acct_pop; - -if ($svc_acct->uid ne '') { - print "Uid". - "". $svc_acct->uid. "", - "Gid". - "". $svc_acct->gid. "", - "GECOS". - "". $svc_acct->finger. "", - "Home directory". - "". $svc_acct->dir. "", - "Shell". - "". $svc_acct->shell. "", - "Quota". - "". $svc_acct->quota. "" - ; -} else { - print "(No shell account)"; -} - -if ($svc_acct->slipip) { - print "IP address". - ( ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) - ? "(Dynamic)" - : $svc_acct->slipip - ). ""; - my($attribute); - foreach $attribute ( grep /^radius_/, fields('svc_acct') ) { - #warn $attribute; - $attribute =~ /^radius_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; - print "Radius (reply) $pattribute". - "". $svc_acct->getfield($attribute). - ""; - } - foreach $attribute ( grep /^rc_/, fields('svc_acct') ) { - #warn $attribute; - $attribute =~ /^rc_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; - print "Radius (check) $pattribute: ". - "". $svc_acct->getfield($attribute). - ""; - } -} else { - print "(No SLIP/PPP account)"; -} - -print 'RADIUS groups'. - join('
          ', $svc_acct->radius_groups). ''; - -print "". - '
          '. joblisting({'svcnum'=>$svcnum}, 1). - ""; - -%> diff --git a/httemplate/view/svc_acct_sm.cgi b/httemplate/view/svc_acct_sm.cgi deleted file mode 100755 index 4e5acc427..000000000 --- a/httemplate/view/svc_acct_sm.cgi +++ /dev/null @@ -1,58 +0,0 @@ - -<% - -my $conf = new FS::Conf; -my $mydomain = $conf->config('domain'); - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_acct_sm = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_acct_sm; - -my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my $pkgnum = $cust_svc->getfield('pkgnum'); -my($cust_pkg, $custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} else { - $cust_pkg = ''; - $custnum = ''; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ) - or die "Unkonwn svcpart"; - -print header('Mail Alias View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) account" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)); - -my($domsvc,$domuid,$domuser) = ( - $svc_acct_sm->domsvc, - $svc_acct_sm->domuid, - $svc_acct_sm->domuser, -); -my $svc = $part_svc->svc; -my $svc_domain = qsearchs('svc_domain',{'svcnum'=>$domsvc}) - or die "Corrupted database: no svc_domain.svcnum matching domsvc $domsvc"; -my $domain = $svc_domain->domain; -my $svc_acct = qsearchs('svc_acct',{'uid'=>$domuid}) - or die "Corrupted database: no svc_acct.uid matching domuid $domuid"; -my $username = $svc_acct->username; - -print qq!Edit this information!, - "
          Service #$svcnum", - "
          Service: $svc", - qq!
          Mail to !, ( ($domuser eq '*') ? "(anything)" : $domuser ) , qq!\@$domain forwards to $username\@$mydomain mailbox.!, - '' -; - -%> diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi deleted file mode 100755 index b70ac8f90..000000000 --- a/httemplate/view/svc_domain.cgi +++ /dev/null @@ -1,106 +0,0 @@ - -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_domain = qsearchs('svc_domain',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_domain; - -my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my $pkgnum = $cust_svc->getfield('pkgnum'); -my($cust_pkg, $custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} else { - $cust_pkg = ''; - $custnum = ''; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unknown svcpart" unless $part_svc; - -my $email = ''; -if ($svc_domain->catchall) { - my $svc_acct = qsearchs('svc_acct',{'svcnum'=> $svc_domain->catchall } ); - die "Unknown svcpart" unless $svc_acct; - $email = $svc_acct->email; -} - -my $domain = $svc_domain->domain; - -%> - -<%= header('Domain View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) domain" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)) %> - -Service #<%= $svcnum %> -
          Service: <%= $part_svc->svc %> -
          Domain name: <%= $domain %> -
          Catch all email (change): -<%= $email ? "$email" : "(none)" %> -

          View whois information. -

          - - -<% my @records; if ( @records = $svc_domain->domain_record ) { %> - <%= ntable("",2) %> - ZoneTypeData - - <% foreach my $domain_record ( @records ) { - my $type = $domain_record->rectype eq '_mstr' - ? "(slave)" - : $domain_record->recaf. ' '. $domain_record->rectype; - %> - - <%= $domain_record->reczone %> - <%= $type %> - <%= $domain_record->recdata %> - - <% unless ( $domain_record->rectype eq 'SOA' ) { %> - (delete) - <% } %> - - <% } %> - -<% } %> - -
          -
          - - - IN - - -


          or

          -
          - - -<% if ( @records ) { %> Delete all records and <% } %> -Slave from nameserver IP - - - - - -
          -

          <%= joblisting({'svcnum'=>$svcnum}, 1) %> - diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi deleted file mode 100755 index c8d1d6213..000000000 --- a/httemplate/view/svc_forward.cgi +++ /dev/null @@ -1,69 +0,0 @@ - -<% - -my $conf = new FS::Conf; - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_forward = qsearchs('svc_forward',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_forward; - -my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my $pkgnum = $cust_svc->getfield('pkgnum'); -my($cust_pkg, $custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} else { - $cust_pkg = ''; - $custnum = ''; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ) - or die "Unkonwn svcpart"; - -print header('Mail Forward View', menubar( - ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) account" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)); - -my($srcsvc,$dstsvc,$dst) = ( - $svc_forward->srcsvc, - $svc_forward->dstsvc, - $svc_forward->dst, -); -my $svc = $part_svc->svc; -my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc}) - or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc"; -my $source = $svc_acct->email; -my $destination; -if ($dstsvc) { - my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$dstsvc}) - or die "Corrupted database: no svc_acct.svcnum matching dstsvc $dstsvc"; - $destination = $svc_acct->email; -}else{ - $destination = $dst; -} - -print qq!Edit this information!. - ntable("#cccccc",2). - 'Service number'. - qq!$svcnum!. - 'Service'. - qq!$svc!. - qq!Email to!. - qq!$source!. - qq!Forwards to !. - qq!$destination!. - '
          '. joblisting({'svcnum'=>$svcnum}, 1). - '' -; - -%> diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi deleted file mode 100644 index 9fa9661b1..000000000 --- a/httemplate/view/svc_www.cgi +++ /dev/null @@ -1,59 +0,0 @@ - -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_www = qsearchs( 'svc_www', { 'svcnum' => $svcnum } ) - or die "svc_www: Unknown svcnum $svcnum"; - -#false laziness w/all svc_*.cgi -my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } ); -my $pkgnum = $cust_svc->getfield('pkgnum'); -my($cust_pkg, $custnum); -if ($pkgnum) { - $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } ); - $custnum = $cust_pkg->custnum; -} else { - $cust_pkg = ''; - $custnum = ''; -} -#eofalse - -my $usersvc = $svc_www->usersvc; -my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } ) - or die "svc_www: Unknown usersvc $usersvc"; -my $email = $svc_acct->email; - -my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } ) - or die "svc_www: Unknown recnum ". $svc_www->recnum; - -my $www = $domain_record->reczone; -unless ( $www =~ /\.$/ ) { - my $svc_domain = qsearchs('svc_domain', { svcnum=>$domain_record->svcnum } ); - $www .= '.'. $svc_domain->domain; -} - -print header('Website View', menubar( - ( ( $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) website" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)). - qq!Edit this information
          !. - ntable("#cccccc"). ''. ntable("#cccccc",2). - qq!Service number!. - qq!$svcnum!. - qq!Website name!. - qq!$www!. - qq!Account!. - qq!$email!. - ''. - '
          '. joblisting({'svcnum'=>$svcnum}, 1). - '' -; -%> -- cgit v1.2.1