From 0c525f3ba7b2b6730b8939b950e4d76dd16802a9 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Thu, 5 Jan 2006 09:34:30 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'SQL_LEDGER_2_4_4'. --- httemplate/view/cust_bill-logo.cgi | 15 - httemplate/view/cust_bill-pdf.cgi | 17 - httemplate/view/cust_bill-ps.cgi | 13 - httemplate/view/cust_bill.cgi | 151 -------- httemplate/view/cust_main.cgi | 138 ------- httemplate/view/cust_main/billing.html | 164 -------- httemplate/view/cust_main/contacts.html | 131 ------- httemplate/view/cust_main/misc.html | 75 ---- httemplate/view/cust_main/order_pkg.html | 39 -- httemplate/view/cust_main/packages.html | 494 ------------------------- httemplate/view/cust_main/payment_history.html | 428 --------------------- httemplate/view/cust_main/quick-charge.html | 18 - httemplate/view/cust_main/tickets.html | 54 --- httemplate/view/cust_pkg.cgi | 165 --------- httemplate/view/svc_acct.cgi | 332 ----------------- httemplate/view/svc_broadband.cgi | 155 -------- httemplate/view/svc_domain.cgi | 108 ------ httemplate/view/svc_external.cgi | 54 --- httemplate/view/svc_forward.cgi | 84 ----- httemplate/view/svc_www.cgi | 73 ---- 20 files changed, 2708 deletions(-) delete mode 100755 httemplate/view/cust_bill-logo.cgi delete mode 100755 httemplate/view/cust_bill-pdf.cgi delete mode 100755 httemplate/view/cust_bill-ps.cgi delete mode 100755 httemplate/view/cust_bill.cgi delete mode 100755 httemplate/view/cust_main.cgi delete mode 100644 httemplate/view/cust_main/billing.html delete mode 100644 httemplate/view/cust_main/contacts.html delete mode 100644 httemplate/view/cust_main/misc.html delete mode 100644 httemplate/view/cust_main/order_pkg.html delete mode 100755 httemplate/view/cust_main/packages.html delete mode 100644 httemplate/view/cust_main/payment_history.html delete mode 100644 httemplate/view/cust_main/quick-charge.html delete mode 100644 httemplate/view/cust_main/tickets.html delete mode 100755 httemplate/view/cust_pkg.cgi delete mode 100755 httemplate/view/svc_acct.cgi delete mode 100644 httemplate/view/svc_broadband.cgi delete mode 100755 httemplate/view/svc_domain.cgi delete mode 100644 httemplate/view/svc_external.cgi delete mode 100755 httemplate/view/svc_forward.cgi delete mode 100644 httemplate/view/svc_www.cgi (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi deleted file mode 100755 index 235485f6b..000000000 --- a/httemplate/view/cust_bill-logo.cgi +++ /dev/null @@ -1,15 +0,0 @@ -<% - -my $conf = new FS::Conf; - -my($query) = $cgi->keywords; -$query =~ /^([^\.\/]*)$/; -my $templatename = $1; -if ( $templatename && $conf->exists("logo_$templatename.png") ) { - $templatename = "_$templatename"; -} else { - $templatename = ''; -} - -http_header('Content-Type' => 'image/png' ); -%><%= $conf->config_binary("logo$templatename.png") %> diff --git a/httemplate/view/cust_bill-pdf.cgi b/httemplate/view/cust_bill-pdf.cgi deleted file mode 100755 index ce7ab0c5c..000000000 --- a/httemplate/view/cust_bill-pdf.cgi +++ /dev/null @@ -1,17 +0,0 @@ -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)(.pdf)?$/; -my $templatename = $2; -my $invnum = $3; - -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; - -my $pdf = $cust_bill->print_pdf( '', $templatename); - -http_header('Content-Type' => 'application/pdf' ); -http_header('Content-Length' => length($pdf) ); -http_header('Cache-control' => 'max-age=60' ); -%><%= $pdf %> diff --git a/httemplate/view/cust_bill-ps.cgi b/httemplate/view/cust_bill-ps.cgi deleted file mode 100755 index e730a822a..000000000 --- a/httemplate/view/cust_bill-ps.cgi +++ /dev/null @@ -1,13 +0,0 @@ -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; -my $invnum = $3; - -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; - -http_header('Content-Type' => 'application/postscript' ); -%><%= $cust_bill->print_ps( '', $templatename) %> diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi deleted file mode 100755 index 56c0c1736..000000000 --- a/httemplate/view/cust_bill.cgi +++ /dev/null @@ -1,151 +0,0 @@ -<% - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; -my $invnum = $3; - -my $conf = new FS::Conf; - -my @payby = grep /\w/, $conf->config('payby'); -#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) -@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; -my %payby = map { $_=>1 } @payby; - -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; - -my $link = $templatename ? "$templatename-$invnum" : $invnum; - -%> -<%= header('Invoice View', menubar( - "Main Menu" => $p, - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", -)) %> - -<% if ( $cust_bill->owed > 0 - && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} || $payby{'MCRD'} ) - ) - { - my $s = 0; -%> - - Post - - <% if ( $payby{'BILL'} ) { %> - - <%= $s++ ? ' | ' : '' %> - check - - <% } %> - - <% if ( $payby{'CASH'} ) { %> - - <%= $s++ ? ' | ' : '' %> - cash - - <% } %> - - <% if ( $payby{'WEST'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Western Union - - <% } %> - - <% if ( $payby{'MCRD'} ) { %> - - <%= $s++ ? ' | ' : '' %> - manual credit card - - <% } %> - - payment against this invoice
- -<% } %> - -Re-print this invoice - -<% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { %> - | Re-email - this invoice -<% } %> - -<% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { %> - | Re-fax - this invoice -<% } %> - -

- -<% if ( $conf->exists('invoice_latex') ) { %> - View typeset invoice -

-<% } %> - -<% #false laziness with search/cust_bill_event.cgi - unless ( $templatename ) { %> - - <%= table() %> - - Event - Date - Status - - - <% foreach my $cust_bill_event ( - sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event - ) { - - my $status = $cust_bill_event->status; - $status .= ': '. encode_entities($cust_bill_event->statustext) - if $cust_bill_event->statustext; - my $part_bill_event = $cust_bill_event->part_bill_event; - %> - - <%= $part_bill_event->event %> - - <% if ( $part_bill_event->templatename ) { - my $alt_templatename = $part_bill_event->templatename; - my $alt_link = "$alt_templatename-$invnum"; - %> - ( view - | view - typeset - | re-print - <% if ( grep { $_ ne 'POST' } - $cust_bill->cust_main->invoicing_list ) { %> - | re-email - <% } %> - - <% if ( $conf->exists('hylafax') - && length($cust_bill->cust_main->fax) ) { %> - | re-fax - <% } %> - - ) - <% } %> - - - <%= time2str("%a %b %e %T %Y", $cust_bill_event->_date) %> - <%= $status %> - - <% } %> - - -
- -<% } %> - -<% if ( $conf->exists('invoice_html') ) { %> - <%= join('', $cust_bill->print_html('', $templatename) ) %> -<% } else { %> -
<%= join('', $cust_bill->print_text('', $templatename) ) %>
-<% } %> - - diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi deleted file mode 100755 index 59c1a4b73..000000000 --- a/httemplate/view/cust_main.cgi +++ /dev/null @@ -1,138 +0,0 @@ - -<% - -my $conf = new FS::Conf; - -my %uiview = (); -my %uiadd = (); -foreach my $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart} = $p. "view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}= $p. "edit/". $part_svc->svcdb . ".cgi"; -} - -%> - -<%= header("Customer View", menubar( - 'Main Menu' => $p, -)) %> - -<% - -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!; - -%> - - - - - - - - - -<% if ( $cust_main->ncancelled_pkgs ) { %> - - | Cancel 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

"; -} - -%> - - -<%= &itable() %> - - - <%= include('cust_main/contacts.html', $cust_main ) %> - - - <%= include('cust_main/misc.html', $cust_main ) %> - <% if ( $conf->config('payby-default') ne 'HIDE' ) { %> -
- <%= include('cust_main/billing.html', $cust_main ) %> - <% } %> - - - - -<% -if ( defined $cust_main->dbdef_table->column('comments') - && $cust_main->comments =~ /[^\s\n\r]/ ) { -%> -
-Comments -<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %> - - -
<%= encode_entities($cust_main->comments) %>
- - - -<% } %> - -<% if ( $conf->config('ticket_system') ) { %> -
- <%= include('cust_main/tickets.html', $cust_main ) %> -<% } %> - -

-<%= include('cust_main/packages.html', $cust_main ) %> - -<% if ( $conf->config('payby-default') ne 'HIDE' ) { %> - <%= include('cust_main/payment_history.html', $cust_main ) %> -<% } %> - - - diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html deleted file mode 100644 index 5786a0711..000000000 --- a/httemplate/view/cust_main/billing.html +++ /dev/null @@ -1,164 +0,0 @@ -<% - my( $cust_main ) = @_; - my @invoicing_list = $cust_main->invoicing_list; -%> - -Billing information -(Bill now) -<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %> - - - Billing type - - -<% if ( $cust_main->payby eq 'CARD' || $cust_main->payby eq 'DCRD' ) { %> - - Credit card <%= $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' %> - - - - Card number - <%= $cust_main->payinfo_masked %> - - -<% -#false laziness w/elements/select-month_year.html & edit/cust_main/billing.html -my( $mon, $year ); -my $date = $cust_main->paydate || '12-2037'; -if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); -} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); -} else { - warn "unrecognized expiration date format: $date"; - ( $mon, $year ) = ( '', '' ); -} -%> - - Expiration - <%= "$mon/$year" %> - - -<% if ( $cust_main->paystart_month ) { %> - - Start date - <%= $cust_main->paystart_month. '/'. $cust_main->paystart_year %> - -<% } elsif ( $cust_main->payissue ) { %> - - Issue # - <%= $cust_main->payissue %> - -<% } %> - - - Name on card - <%= $cust_main->payname %> - - -<% } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') { - my( $account, $aba ) = split('@', $cust_main->payinfo ); -%> - - Electronic check <%= $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' %> - - - - ABA/Routing code - <%= $aba %> - - - Account number - <%= 'x'x(length($account)-2). substr($account,(length($account)-2)) %> - - - Bank name - <%= $cust_main->payname %> - - -<% } elsif ( $cust_main->payby eq 'LECB' ) { - $cust_main->payinfo =~ /^(\d{3})(\d{3})(\d{4})$/; - my $payinfo = "$1-$2-$3"; -%> - - Phone bill billing - - - - Phone number - <%= $payinfo %> - - -<% } elsif ( $cust_main->payby eq 'BILL' ) { %> - - Billing - - - - <% if ( $cust_main->payinfo ) { %> - - P.O. - <%= $cust_main->payinfo %> - - <% } %> - - - Attention - <%= $cust_main->payname %> - - -<% } elsif ( $cust_main->payby eq 'COMP' ) { %> - - Complimentary - - - - Authorized by - <%= $cust_main->payinfo %> - - -<% -#false laziness w/above etc. -my( $mon, $year ); -my $date = $cust_main->paydate || '12-2037'; -if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); -} elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); -} else { - warn "unrecognized expiration date format: $date"; - ( $mon, $year ) = ( '', '' ); -} -%> - - Expiration - <%= "$mon/$year" %> - - -<% } %> - - - Tax exempt - <%= $cust_main->tax ? 'yes' : 'no' %> - - - Postal invoices - - <%= ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no' %> - - - - FAX invoices - - <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> - - - - Email invoices - - <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> - - - - - diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html deleted file mode 100644 index 456d117a6..000000000 --- a/httemplate/view/cust_main/contacts.html +++ /dev/null @@ -1,131 +0,0 @@ -<% - my( $cust_main ) = @_; - my $conf = new FS::Conf; -%> - -Billing address -<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %> - - Contact name - - <%= $cust_main->last. ', '. $cust_main->first %> - -<% if ( $conf->exists('show_ss') ) { %> - SS# - <%= $cust_main->ss || ' ' %> -<% } %> - - - Company - <%= $cust_main->company %> - - - Address - <%= $cust_main->address1 %> - -<% if ( $cust_main->address2 ) { %> - -   - <%= $cust_main->address2 %> - -<% } %> - - City - <%= $cust_main->city %> - State - <%= $cust_main->state %> - Zip - <%= $cust_main->zip %> - - - Country - <%= $cust_main->country %> - -<% - my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ - ? 'Day Phone' - : FS::Msgcat::_gettext('daytime'); - my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/ - ? 'Night Phone' - : FS::Msgcat::_gettext('night'); -%> - - <%= $daytime_label %> - - <%= $cust_main->daytime || ' ' %> - - - - <%= $night_label %> - - <%= $cust_main->night || ' ' %> - - - - Fax - - <%= $cust_main->fax || ' ' %> - - - - -<% if ( defined $cust_main->dbdef_table->column('ship_last') ) { - my $pre = $cust_main->ship_last ? 'ship_' : ''; -%> - -
-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") %> - -<% if ( $cust_main->get("${pre}address2") ) { %> - -   - <%= $cust_main->get("${pre}address2") %> - -<% } %> - - City - <%= $cust_main->get("${pre}city") %> - State - <%= $cust_main->get("${pre}state") %> - Zip - <%= $cust_main->get("${pre}zip") %> - - - Country - <%= $cust_main->get("${pre}country") %> - - - <%= $daytime_label %> - - <%= $cust_main->get("${pre}daytime") || ' ' %> - - - - <%= $night_label %> - - <%= $cust_main->get("${pre}night") || ' ' %> - - - - Fax - - <%= $cust_main->get("${pre}fax") || ' ' %> - - - - -<% } %> diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html deleted file mode 100644 index 69e120573..000000000 --- a/httemplate/view/cust_main/misc.html +++ /dev/null @@ -1,75 +0,0 @@ -<% - my( $cust_main ) = @_; -%> - -<%= ntable("#cccccc") %><%= &ntable("#cccccc",2) %> - - Customer number - <%= $cust_main->custnum %> - - -<% - my @agents = qsearch( 'agent', {} ); - my $agent; - unless ( scalar(@agents) == 1 ) { - $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); -%> - - - 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 - } ); -%> - - - Advertising source - <%= $referral->refnum %>: <%= $referral->referral%> - - -<% } %> - - - Order taker - <%= $cust_main->otaker %> - - - Referring Customer - - -<% - my $referring_cust_main = ''; - if ( $cust_main->referral_custnum - && ( $referring_cust_main = - qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) - ) - ) { -%> - -<%=$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 - ) -%> - -<% } %> - - - - - - diff --git a/httemplate/view/cust_main/order_pkg.html b/httemplate/view/cust_main/order_pkg.html deleted file mode 100644 index ac2d05df2..000000000 --- a/httemplate/view/cust_main/order_pkg.html +++ /dev/null @@ -1,39 +0,0 @@ -<% - my( $cust_main ) = @_; -%> - - - -
- - - - - - - -
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html deleted file mode 100755 index ece1b62bb..000000000 --- a/httemplate/view/cust_main/packages.html +++ /dev/null @@ -1,494 +0,0 @@ -<% - my( $cust_main ) = @_; - my $conf = new FS::Conf; - - my $packages = get_packages($cust_main, $conf); -%> - - - -Packages - -<%= include('order_pkg.html', $cust_main ) %> - -<% if ( $conf->config('payby-default') ne 'HIDE' ) { %> - <%= include('quick-charge.html', $cust_main ) %> -<% } %> - -Bulk order and cancel packages (preserves services) -

- -<% if ( @$packages ) { %> -Current packages -<% } %> - -<% if ( $cust_main->num_cancelled_pkgs ) { - if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me - || ( $conf->exists('hidecancelledpackages') - && ! $cgi->param('showcancelledpackages') - ) - ) - { - $cgi->param('showcancelledpackages', 1); -%> - ( show -<% } else { - $cgi->param('showcancelledpackages', 0); -%> - ( hide -<% } %> - cancelled packages ) -<% } %> - -<% if ( @$packages ) { %> - - - - - - - - -<% -foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { - my $rowspan = 0; - - if ($pkg->{cancel}) { - $rowspan = 0; - } else { - foreach my $svcpart (@{$pkg->{svcparts}}) { - $rowspan += $svcpart->{count}; - $rowspan++ if ($svcpart->{count} < $svcpart->{quantity}); - } - } -%> - - - - - - -<% - if ($rowspan == 0) { print qq!\n!; next; } - - my $cnt = 0; - foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) { - foreach my $service (@{$svcpart->{services}}) { - print '' if ($cnt > 0); -%> - - - -<% - $cnt++; - } - if ($svcpart->{count} < $svcpart->{quantity}) { - print qq!\n! if ($cnt > 0); - print qq! \n\n!; - } - } -} -#end display packages -%> - -
PackageStatusServices
> - <%=$pkg->{pkgnum}%>: - <%=$pkg->{pkg}%> - <%=$pkg->{comment}%>
-<% unless ($pkg->{cancel}) { %> - ( <%=pkg_change_link($pkg)%> ) - ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$cust_main->custnum)%> ) -<% } %> -
> - - -<% - sub myfreq { - my $part_pkg = shift; - my $freq = $part_pkg->freq_pretty; - $freq =~ s/ / /g; - $freq; - } - - #this should use cust_pkg->status and cust_pkg->statuscolor eventually - - my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4; - my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%'; - - #false laziness w/edit/REAL_cust_pkg.cgi - my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until ); - unless ( $pkg->{'part_pkg'}->is_prepaid ) { - $billed_or_prepaid = 'billed'; - $last_bill_or_renewed = 'Last bill'; - $next_bill_or_prepaid_until = 'Next bill'; - } else { - $billed_or_prepaid = 'prepaid'; - $last_bill_or_renewed = 'Renewed'; - $next_bill_or_prepaid_until = 'Prepaid until'; - } - -%> - -<% if ( $pkg->{cancel} ) { %> - - - - <%= pkg_datestr($pkg,'cancel',$conf) %> - - - <% unless ( $pkg->{setup} ) { %> - - - - - - <% } else { %> - - - - <%= pkg_datestr($pkg, 'setup',$conf) %> - - - <% if ( $pkg->{'last_bill'} ) { %> - - - <%= pkg_datestr($pkg, 'last_bill',$conf) %> - - <% } %> - - <% if ( $pkg->{'susp'} ) { %> - - - <%= pkg_datestr($pkg, 'susp',$conf) %> - - <% } %> - - <% } %> - -<% } else { %> - - <% if ( $pkg->{susp} ) { %> - - - - <%= pkg_datestr($pkg,'susp',$conf) %> - - - <% unless ( $pkg->{setup} ) { %> - - - - - - <% } else { %> - - - - <%= pkg_datestr($pkg, 'setup',$conf) %> - - - <% } %> - - <% if ( $pkg->{'last_bill'} ) { %> - - - <%= pkg_datestr($pkg, 'last_bill',$conf) %> - - <% } %> - - - - <% if ( $pkg->{'expire'} ) { %> - - - <%= pkg_datestr($pkg, 'expire',$conf) %> - - <% } %> - - - - - - <% } else { %> - - <% unless ( $pkg->{setup} ) { %> - - <% unless ( $pkg->{'freq'} ) { %> - - - - - - - - - - <% } else { %> - - - - - - <% } %> - - <% } else { %> - - <% unless ( $pkg->{freq} ) { %> - - - - - - - - <%= pkg_datestr($pkg,'setup',$conf) %> - - - <% } else { %> - - - - - - - - <%= pkg_datestr($pkg, 'setup',$conf) %> - - - <% } %> - - <% } %> - - <% if ( $pkg->{'last_bill'} ) { %> - - - <%= pkg_datestr($pkg, 'last_bill',$conf) %> - - <% } %> - - <% if ( $pkg->{'next_bill'} ) { %> - - - <%= pkg_datestr($pkg, 'next_bill',$conf) %> - - <% } %> - - <% if ( $pkg->{'expire'} ) { %> - - - <%= pkg_datestr($pkg, 'expire',$conf) %> - - <% } %> - - <% if ( $pkg->{freq} ) { %> - - - - <% } %> - - <% } %> - -<% } %> - -
Cancelled 
>Never billed
Setup 
<%= $last_bill_or_renewed %> 
Suspended 
Suspended 
>Never billed
Setup 
<%= $last_bill_or_renewed %> 
Expires 
>( <%= pkg_unsuspend_link($pkg) %> | <%= pkg_cancel_link($pkg) %> )
>Not yet billed (one-time charge)
>( <%= pkg_cancel_link($pkg) %> )
>Not yet billed (<%= $billed_or_prepaid %> <%= myfreq($pkg->{part_pkg}) %>)
>One-time charge
Billed 
>Active, <%= $billed_or_prepaid %> <%= myfreq($pkg->{part_pkg}) %>
Setup 
<%= $last_bill_or_renewed %> 
<%= $next_bill_or_prepaid_until %> 
Expires 
>( <%= pkg_suspend_link($pkg) %> | <%= pkg_cancel_link($pkg) %> )
-
<%=svc_link($svcpart,$service)%><%=svc_label_link($svcpart,$service)%>
( <%=svc_unprovision_link($service)%> )
!.svc_provision_link($pkg, $svcpart, $conf).qq!
-<% } else { %> -
-<% } %> - -<% -#subroutines - -sub get_packages { - my $cust_main = shift or return undef; - my $conf = shift; - - my @packages = (); - my $method; - if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me - || ( $conf->exists('hidecancelledpackages') - && ! $cgi->param('showcancelledpackages') ) - ) - { - $method = 'ncancelled_pkgs'; - } else { - $method = 'all_pkgs'; - } - - foreach my $cust_pkg ( $cust_main->$method() ) { - - my $part_pkg = $cust_pkg->part_pkg; - - my %pkg = (); - - #to get back to the original object... should use it in the first place!! - $pkg{cust_pkg} = $cust_pkg; - $pkg{part_pkg} = $part_pkg; - - $pkg{pkgnum} = $cust_pkg->pkgnum; - $pkg{pkg} = $part_pkg->pkg; - $pkg{pkgpart} = $part_pkg->pkgpart; - $pkg{comment} = $part_pkg->getfield('comment'); - $pkg{freq} = $part_pkg->freq; - $pkg{setup} = $cust_pkg->getfield('setup'); - $pkg{last_bill} = $cust_pkg->getfield('last_bill'); - $pkg{next_bill} = $cust_pkg->getfield('bill'); - $pkg{susp} = $cust_pkg->getfield('susp'); - $pkg{expire} = $cust_pkg->getfield('expire'); - $pkg{cancel} = $cust_pkg->getfield('cancel'); - - - my %svcparts = map { - $_->svcpart => { - $_->part_svc->hash, - 'quantity' => $_->quantity, - 'count' => $cust_pkg->num_cust_svc($_->svcpart), - #'services' => [], - }; - } $part_pkg->pkg_svc; - - foreach my $cust_svc ( $cust_pkg->cust_svc ) { - #warn "svcnum ". $cust_svc->svcnum. " / svcpart ". $cust_svc->svcpart. "\n"; - my $svc = { - 'svcnum' => $cust_svc->svcnum, - 'label' => ($cust_svc->label)[1], - }; - - #false laziness with above, to catch extraneous services. whole - #damn thing should be OO... - my $svcpart = ( $svcparts{$cust_svc->svcpart} ||= { - $cust_svc->part_svc->hash, - 'quantity' => 0, - 'count' => $cust_pkg->num_cust_svc($cust_svc->svcpart), - #'services' => [], - } ); - - push @{$svcpart->{services}}, $svc; - - } - - $pkg{svcparts} = [ values %svcparts ]; - - push @packages, \%pkg; - - } - - return \@packages; - -} - -sub svc_link { - - my ($svcpart, $svc) = (shift,shift) or return ''; - return qq!$svcpart->{svc}!; - -} - -sub svc_label_link { - - my ($svcpart, $svc) = (shift,shift) or return ''; - return qq!$svc->{label}!; - -} - -sub svc_provision_link { - my ($pkg, $svcpart, $conf) = @_; - ( my $svc_nbsp = $svcpart->{svc} ) =~ s/\s+/ /g; - my $num_left = $svcpart->{quantity} - $svcpart->{count}; - my $pkgnum_svcpart = "pkgnum$pkg->{pkgnum}-svcpart$svcpart->{svcpart}"; - - my $url; - if ( $svcpart->{svcdb} eq 'svc_external' - && $conf->exists('svc_external-skip_manual') - ) { - $url = "${p}edit/process/$svcpart->{svcdb}.cgi?". - "pkgnum=$pkg->{pkgnum}&". - "svcpart=$svcpart->{svcpart}"; - } else { - $url = "${p}edit/$svcpart->{svcdb}.cgi?$pkgnum_svcpart"; - } - - my $link = qq!!. - "Provision $svc_nbsp ($num_left)"; - if ( $conf->exists('legacy_link') ) { - $link .= '
'. - qq!!. - "Link to legacy $svc_nbsp ($num_left)"; - } - $link; -} - -sub svc_unprovision_link { - my $svc = shift or return ''; - qq!Unprovision!; -} - -# This should be generalized to use config options to determine order. -sub pkgsort_pkgnum_cancel { - if ($a->{cancel} and $b->{cancel}) { - return ($a->{pkgnum} <=> $b->{pkgnum}); - } elsif ($a->{cancel} or $b->{cancel}) { - return (-1) if ($b->{cancel}); - return (1) if ($a->{cancel}); - return (0); - } else { - return($a->{pkgnum} <=> $b->{pkgnum}); - } -} - -sub pkg_datestr { - my($pkg, $field, $conf) = @_ or return ''; - return ' ' unless $pkg->{$field}; - my $format = '%b'. - ' %o,'. - ' %Y'; - #$format .= ' %l:%M:%S%P %z' - $format .= ' %l'. - ':'. - '%M'. - ' %P' - if $conf->exists('cust_pkg-display_times'); - ( my $strip = time2str($format, $pkg->{$field}) ) =~ s/ (\d)/$1/g; - $strip; -} - -sub pkg_change_link { - my $pkg = shift or return ''; - return qq!!. - qq!Change package!; -} - -sub pkg_suspend_link { - my $pkg = shift or return ''; - return qq!Suspend!; -} - -sub pkg_unsuspend_link { - my $pkg = shift or return ''; - return qq!Unsuspend!; -} - -sub pkg_cancel_link { - my $pkg = shift or return ''; - qq!!. - qq!Cancel now | !. - qq!Cancel later!; -} - -sub pkg_dates_link { - my $pkg = shift or return ''; - qq!Edit dates!; -} - -sub pkg_customize_link { - my $pkg = shift or return ''; - my $custnum = shift; - qq!Customize!; -} - -%> diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html deleted file mode 100644 index ec99b8c54..000000000 --- a/httemplate/view/cust_main/payment_history.html +++ /dev/null @@ -1,428 +0,0 @@ -<% - my( $cust_main ) = @_; - my $custnum = $cust_main->custnum; - - my $conf = new FS::Conf; - - my @payby = grep /\w/, $conf->config('payby'); - #@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) - @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; - my %payby = map { $_=>1 } @payby; - - my $s = 0; - -%> - -

Payment History
- -<% if ( $payby{'BILL'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Post check payment - -<% } %> - -<% if ( $payby{'CASH'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Post cash payment - -<% } %> - -<% if ( $payby{'WEST'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Post Western Union payment - -<% } %> - -<% if ( $payby{'CARD'} || $payby{'DCRD'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Process credit card payment - -<% } %> - -<% if ( $payby{'CHEK'} || $payby{'DCHK'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Process electronic check (ACH) payment - -<% } %> - -<% if ( $payby{'MCRD'} ) { %> - - <%= $s++ ? ' | ' : '' %> - Post manual credit card payment - -<% } %> - -
Post credit -
- -<% -#get payment history -my @history = (); - -#invoices -foreach my $cust_bill ($cust_main->cust_bill) { - my $pre = ( $cust_bill->owed > 0 ) - ? 'Open ' - : ''; - my $post = ( $cust_bill->owed > 0 ) ? '' : ''; - my $invnum = $cust_bill->invnum; - push @history, { - 'date' => $cust_bill->_date, - 'desc' => qq!!. $pre. - "Invoice #$invnum (Balance \$". $cust_bill->owed. ')'. - $post. '', - 'charge' => $cust_bill->charged, - }; -} - -#payments (some false laziness w/credits) -foreach my $cust_pay ($cust_main->cust_pay) { - - my $payby = $cust_pay->payby; - - my $payinfo; - if ( $payby eq 'CARD' ) { - $payinfo = $cust_pay->payinfo_masked; - } elsif ( $payby eq 'CHEK' && $cust_pay->payinfo =~ /^(\d+)\@(\d+)$/ ) { - $payinfo = "ABA $2, Acct# $1"; - } else { - $payinfo = $cust_pay->payinfo; - } - my @cust_bill_pay = $cust_pay->cust_bill_pay; - my @cust_pay_refund = $cust_pay->cust_pay_refund; - - my $target = "$payby$payinfo"; - $payby =~ s/^BILL$/Check #/ if $payinfo; - $payby =~ s/^CHEK$/Electronic check /; - $payby =~ s/^PREP$/Prepaid card /; - $payby =~ s/^CARD$/Credit card #/; - $payby =~ s/^COMP$/Complimentary by /; - $payby =~ s/^CASH$/Cash/; - $payby =~ s/^WEST$/Western Union/; - $payby =~ s/^MCRD$/Manual credit card/; - $payby =~ s/^BILL$//; - my $info = $payby ? " ($payby$payinfo)" : ''; - - my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' ); - if ( scalar(@cust_bill_pay) == 0 - && scalar(@cust_pay_refund) == 0 ) { - #completely unapplied - $pre = 'Unapplied '; - $post = ''; - $apply = qq! (apply)'; - } elsif ( scalar(@cust_bill_pay) == 1 - && scalar(@cust_pay_refund) == 0 - && $cust_pay->unapplied == 0 ) { - #applied to one invoice, the usual situation - $desc = ' applied to Invoice #'. $cust_bill_pay[0]->invnum; - } elsif ( scalar(@cust_bill_pay) == 0 - && scalar(@cust_pay_refund) == 1 - && $cust_pay->unapplied == 0 ) { - #applied to one refund - $desc = ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date); - } else { - #complicated - $desc = '
'; - foreach my $app ( sort { $a->_date <=> $b->_date } - ( @cust_bill_pay, @cust_pay_refund ) ) { - if ( $app->isa('FS::cust_bill_pay') ) { - $desc .= '  '. - '$'. $app->amount. - ' applied to Invoice #'. $app->invnum. - '
'; - #' on '. time2str("%D", $cust_bill_pay->_date). - } elsif ( $app->isa('FS::cust_pay_refund') ) { - $desc .= '  '. - '$'. $app->amount. - ' refunded on'. time2str("%D", $app->_date). - '
'; - } else { - die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund"; - } - } - if ( $cust_pay->unapplied > 0 ) { - $desc .= '  '. - '$'. - $cust_pay->unapplied. ' unapplied'. - qq! (apply)'. - '
'; - } - } - - my $refund = ''; - my $refund_days = $conf->config('card_refund-days') || 120; - if ( $cust_pay->closed !~ /^Y/i - && $cust_pay->payby =~ /^(CARD|CHEK)$/ - && time-$cust_pay->_date < $refund_days*86400 - && $cust_pay->unrefunded > 0 - ) { - $refund = qq! (refund)!; - } - - my $void = ''; - if ( $cust_pay->closed !~ /^Y/i - && ( $cust_pay->payby ne 'CARD' || $conf->exists('cc-void') ) - && ( $cust_pay->payby ne 'CHEK' || $conf->exists('echeck-void') ) - ) { - $void = qq! (void)!; - } - - my $delete = ''; - if ( $cust_pay->closed !~ /^Y/i && $conf->exists('deletepayments') ) { - $delete = qq! (delete)!; - } - - my $unapply = ''; - if ( $cust_pay->closed !~ /^Y/i - && $conf->exists('unapplypayments') - && scalar(@cust_bill_pay) ) { - $unapply = qq! (unapply)!; - } - - push @history, { - 'date' => $cust_pay->_date, - 'desc' => $pre. "Payment$post$info$desc". - "$apply$refund$void$delete$unapply", - 'payment' => $cust_pay->paid, - 'target' => $target, - }; -} - -#voided payments -foreach my $cust_pay_void ($cust_main->cust_pay_void) { - - my $payby = $cust_pay_void->payby; - my $payinfo = $payby eq 'CARD' - ? $cust_pay_void->payinfo_masked - : $cust_pay_void->payinfo; - - $payby =~ s/^BILL$/Check #/ if $payinfo; - $payby =~ s/^CHEK$/Electronic check /; - $payby =~ s/^BILL$//; - $payby =~ s/^(CARD|COMP)$/$1 /; - my $info = $payby ? " ($payby$payinfo)" : ''; - - my $unvoid = ''; - if ( $cust_pay_void->closed !~ /^Y/i && $conf->exists('unvoid') ) { - $unvoid = qq! (unvoid)!; - } - - push @history, { - 'date' => $cust_pay_void->_date, - 'desc' => "Payment $info voided ". - time2str("%D", $cust_pay_void->void_date). - " by ". $cust_pay_void->otaker. ''. $unvoid, - 'void_payment' => $cust_pay_void->paid, - }; - -} - -#credits (some false laziness w/payments) -foreach my $cust_credit ($cust_main->cust_credit) { - - my @cust_credit_bill = $cust_credit->cust_credit_bill; - my @cust_credit_refund = $cust_credit->cust_credit_refund; - - my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' ); - if ( scalar(@cust_credit_bill) == 0 - && scalar(@cust_credit_refund) == 0 ) { - #completely unapplied - $pre = 'Unapplied '; - $post = ''; - $apply = qq! (apply)'; - } elsif ( scalar(@cust_credit_bill) == 1 - && scalar(@cust_credit_refund) == 0 - && $cust_credit->credited == 0 ) { - #applied to one invoice, the usual situation - $desc = ' applied to Invoice #'. $cust_credit_bill[0]->invnum; - } elsif ( scalar(@cust_credit_bill) == 0 - && scalar(@cust_credit_refund) == 1 - && $cust_credit->credited == 0 ) { - #applied to one refund - $desc = ' refunded on '. time2str("%D", $cust_credit_refund[0]->_date); - } else { - #complicated - $desc = '
'; - foreach my $app ( sort { $a->_date <=> $b->_date } - ( @cust_credit_bill, @cust_credit_refund ) ) { - if ( $app->isa('FS::cust_credit_bill') ) { - $desc .= '  '. - '$'. $app->amount. - ' applied to Invoice #'. $app->invnum. - '
'; - #' on '. time2str("%D", $app->_date). - } elsif ( $app->isa('FS::cust_credit_refund') ) { - $desc .= '  '. - '$'. $app->amount. - ' refunded on'. time2str("%D", $app->_date). - '
'; - } else { - die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund"; - } - } - if ( $cust_credit->credited > 0 ) { - $desc .= '  $'. - $cust_credit->credited. ' unapplied'. - qq! (apply)'. - '
'; - } - } -# - my $delete = ''; - if ( $cust_credit->closed !~ /^Y/i && $conf->exists('deletecredits') ) { - $delete = qq! (!. - qq!delete)!; - } - - my $unapply = ''; - if ( $cust_credit->closed !~ /^Y/i - && $conf->exists('unapplycredits') - && scalar(@cust_credit_bill) ) { - $unapply = qq! (!. - qq!unapply)!; - } - - push @history, { - 'date' => $cust_credit->_date, - 'desc' => $pre. "Credit$post by ". $cust_credit->otaker. - ( $cust_credit->reason - ? ' ('. $cust_credit->reason. ')' - : '' - ). - "$desc$apply$delete$unapply", - 'credit' => $cust_credit->amount, - }; - -} - -#refunds -foreach my $cust_refund ($cust_main->cust_refund) { - - my $payby = $cust_refund->payby; - my $payinfo = $payby eq 'CARD' - ? $cust_refund->payinfo_masked - : $cust_refund->payinfo; - - $payby =~ s/^BILL$/Check #/ if $payinfo; - $payby =~ s/^CHEK$/Electronic check /; - $payby =~ s/^(CARD|COMP)$/$1 /; - - push @history, { - 'date' => $cust_refund->_date, - 'desc' => "Refund ($payby$payinfo) by ". $cust_refund->otaker, - 'refund' => $cust_refund->refund, - }; - -} - -%> - -<%= table() %> - - Date - Description - Charge - Payment - In-house
Credit
- Refund - Balance - - -<% -#display payment history - -my %target; -my $balance = 0; -foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) { - - my $charge = exists($item->{'charge'}) - ? sprintf('$%.2f', $item->{'charge'}) - : ''; - my $payment = exists($item->{'payment'}) - ? sprintf('- $%.2f', $item->{'payment'}) - : ''; - $payment ||= sprintf('- $%.2f', $item->{'void_payment'}) - if exists($item->{'void_payment'}); - my $credit = exists($item->{'credit'}) - ? sprintf('- $%.2f', $item->{'credit'}) - : ''; - my $refund = exists($item->{'refund'}) - ? sprintf('$%.2f', $item->{'refund'}) - : ''; - - my $target = exists($item->{'target'}) ? $item->{'target'} : ''; - - $balance += $item->{'charge'} if exists $item->{'charge'}; - $balance -= $item->{'payment'} if exists $item->{'payment'}; - $balance -= $item->{'credit'} if exists $item->{'credit'}; - $balance += $item->{'refund'} if exists $item->{'refund'}; - $balance = sprintf("%.2f", $balance); - $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp - ( my $showbalance = '$'. $balance ) =~ s/^\$\-/- \$/; - -%> - - - - <% unless ( !$target || $target{$target}++ ) { %> - - <% } %> - <%= time2str("%D",$item->{'date'}) %> - <% if ( $target && $target{$target} == 1 ) { %> - - <% } %> - - - <%= $item->{'desc'} %> - <%= $charge %> - <%= $payment %> - <%= $credit %> - <%= $refund %> - <%= $showbalance %> - - -<% } %> - - - diff --git a/httemplate/view/cust_main/quick-charge.html b/httemplate/view/cust_main/quick-charge.html deleted file mode 100644 index 2fe3d5f3d..000000000 --- a/httemplate/view/cust_main/quick-charge.html +++ /dev/null @@ -1,18 +0,0 @@ -<% - my( $cust_main ) = @_; -%> - -
- - - -Description: - -Amount: - -<%= include('/elements/select-taxclass.html') %> - - - -
- diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html deleted file mode 100644 index 72d68152a..000000000 --- a/httemplate/view/cust_main/tickets.html +++ /dev/null @@ -1,54 +0,0 @@ -<% - my( $cust_main ) = @_; - - my $conf = new FS::Conf; - my $num = 10; - - my @tickets = (); - unless ( $conf->config('ticket_system-custom_priority_field') ) { - - @tickets = - @{ FS::TicketSystem->customer_tickets($cust_main->custnum, $num) }; - - } else { - - foreach my $priority ( - $conf->config('ticket_system-custom_priority_field-values'), '' - ) { - last if scalar(@tickets) >= $num; - push @tickets, - @{ FS::TicketSystem->customer_tickets( $cust_main->custnum, - $num - scalar(@tickets), - $priority, - ) - }; - } - - } - -%> - -Highest priority tickets -(View all tickets for this customer) -(New ticket for this customer) -<%= table() %> - - # - Subject - Priority - Queue - Status - -<% foreach my $ticket ( @tickets ) { - my $href = FS::TicketSystem->href_ticket($ticket->{id}); -%> - - ><%= $ticket->{id} %> - ><%= $ticket->{subject} %> - <%= $ticket->{content} || $ticket->{priority} %> - <%= $ticket->{name} %> - <%= $ticket->{status} %> - -<% } %> - - diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi deleted file mode 100755 index a20149ae2..000000000 --- a/httemplate/view/cust_pkg.cgi +++ /dev/null @@ -1,165 +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)" ), ''; - -print 'Last bill date', - ( $cust_pkg->get('last_bill') ? time2str("%D",$cust_pkg->get('last_bill')) : " " ), - '' - if $cust_pkg->dbdef_table->column('last_bill'); - -print '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, '', - ''; - -unless ($expire) { - 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 }) ) { - foreach $pkg_svc ( $cust_pkg->part_pkg->pkg_svc ) { - $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 b42362d91..000000000 --- a/httemplate/view/svc_acct.cgi +++ /dev/null @@ -1,332 +0,0 @@ -<% - -my $conf = new FS::Conf; - -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 $svc = $part_svc->svc; - -die 'Empty domsvc for svc_acct.svcnum '. $svc_acct->svcnum - unless $svc_acct->domsvc; -my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } ); -die 'Unknown domain (domsvc '. $svc_acct->domsvc. - ' for svc_acct.svcnum '. $svc_acct->svcnum. ')' - unless $svc_domain; -my $domain = $svc_domain->domain; - -%> - -<% if ( $custnum ) { %> - - <%= header("View $svc account", menubar( - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - "Main menu" => $p, - )) %> - - <%= include( '/elements/small_custview.html', $custnum, '', 1 ) %> -
- -<% } else { %> - - - - <%= header('Account View', menubar( - "Cancel this (unaudited) account" => - "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')", - "Main menu" => $p, - )) %> - -<% } %> - -<% if ( $part_svc->part_export_usage ) { - - my $last_bill; - my %plandata; - if ( $cust_pkg ) { - #false laziness w/httemplate/edit/part_pkg... this stuff doesn't really - #belong in plan data - %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); } - split("\n", $cust_pkg->part_pkg->plandata ); - - $last_bill = $cust_pkg->last_bill; - } else { - $last_bill = 0; - %plandata = (); - } - - my $seconds = $svc_acct->seconds_since_sqlradacct( $last_bill, time ); - my $hour = int($seconds/3600); - my $min = int( ($seconds%3600) / 60 ); - my $sec = $seconds%60; - - my $input = $svc_acct->attribute_since_sqlradacct( - $last_bill, time, 'AcctInputOctets' - ) / 1048576; - my $output = $svc_acct->attribute_since_sqlradacct( - $last_bill, time, 'AcctOutputOctets' - ) / 1048576; - -%> - - RADIUS session information
- <%= ntable('#cccccc',2) %> - - - <% if ( $seconds ) { %> - Online <%= $hour %>h <%= $min %>m <%= $sec %>s - <% } else { %> - Has not logged on - <% } %> - - <% if ( $cust_pkg ) { %> - since last bill (<%= time2str('%a %b %o %Y', $last_bill) %>) - <% if ( length($plandata{recur_included_hours}) ) { %> - - <%= $plandata{recur_included_hours} %> total hours in plan - <% } %> -
- <% } else { %> - (no billing cycle available for unaudited account)
- <% } %> - - Upload: <%= sprintf("%.3f", $input) %> megabytes
- Download: <%= sprintf("%.3f", $output) %> megabytes
- - <% my $href = qq!this billing cycle - | <%= $href %>;begin=<%= time-15552000 %>">past six months - | <%= $href %>">all sessions - -
- -<% } %> - - -
- - - -<% #print qq!
Send account information!; %> - -<% - my @part_svc = (); - if ( $pkgnum ) { - @part_svc = grep { $_->svcdb eq 'svc_acct' - && $_->svcpart != $part_svc->svcpart } - $cust_pkg->available_part_svc; - } else { - @part_svc = qsearch('part_svc', { - svcdb => 'svc_acct', - disabled => '', - svcpart => { op=>'!=', value=>$part_svc->svcpart }, - } ); - } -%> - -Service #<%= $svcnum %> -| Edit this service - -<% if ( @part_svc ) { %> -| - -<% } %> - -<%= &ntable("#cccccc") %><%= &ntable("#cccccc",2) %> - - - Service - <%= $part_svc->svc %> - - - Username - <%= $svc_acct->username %> - - - Domain - <%= $domain %> - - - - Password - - - <% my $password = $svc_acct->_password; %> - <% if ( $password =~ /^\*\w+\* (.*)$/ ) { - $password = $1; - %> - (login disabled) - <% } %> - - <% if ( $conf->exists('showpasswords') ) { %> -
<%= encode_entities($password) %>
- <% } else { %> - (hidden) - <% } %> - - - -<% $password = ''; %> - -<% if ( $conf->exists('security_phrase') ) { - my $sec_phrase = $svc_acct->sec_phrase; -%> - - Security phrase - <%= $svc_acct->sec_phrase %> - -<% } %> - -<% if ( $svc_acct->popnum ) { - my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); -%> - - Access number - <%= $svc_acct_pop->text %> - -<% } %> - -<% if ($svc_acct->uid ne '') { %> - - UID - <%= $svc_acct->uid %> - -<% } %> - -<% if ($svc_acct->gid ne '') { %> - - GID - <%= $svc_acct->gid %> - -<% } %> - -<% if ($svc_acct->finger ne '') { %> - - GECOS - <%= $svc_acct->finger %> - -<% } %> - -<% if ($svc_acct->dir ne '') { %> - - Home directory - <%= $svc_acct->dir %> - -<% } %> - -<% if ($svc_acct->shell ne '') { %> - - Shell - <%= $svc_acct->shell %> - -<% } %> - -<% if ($svc_acct->quota ne '') { %> - - Quota - <%= $svc_acct->quota %> - -<% } %> - -<% if ($svc_acct->slipip) { %> - - IP address - - <%= ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) - ? "(Dynamic)" - : $svc_acct->slipip - %> - - -<% } %> - -<% foreach my $attribute ( grep /^radius_/, $svc_acct->fields ) { - $attribute =~ /^radius_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; -%> - - Radius (reply) <%= $pattribute %> - <%= $svc_acct->getfield($attribute) %> - -<% } %> - -<% foreach my $attribute ( grep /^rc_/, $svc_acct->fields ) { - $attribute =~ /^rc_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; -%> - - Radius (check) <%= $pattribute %> - <%= $svc_acct->getfield($attribute) %> - -<% } %> - - - RADIUS groups - <%= join('
', $svc_acct->radius_groups) %> - - -<% if ( $svc_acct->seconds =~ /^\d+$/ ) { %> - - Prepaid time - <%= duration_exact($svc_acct->seconds) %> - -<% } %> - -<% -# Can this be abstracted further? Maybe a library function like -# widget('HTML', 'view', $svc_acct) ? It would definitely make UI -# style management easier. -%> - -<% foreach (sort { $a cmp $b } $svc_acct->virtual_fields) { %> - <%= $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)) %> -<% } %> - - -
-

- -<%= join("
", $conf->config('svc_acct-notes') ) %> -

- -<%= joblisting({'svcnum'=>$svcnum}, 1) %> - - - diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi deleted file mode 100644 index f381b5ad3..000000000 --- a/httemplate/view/svc_broadband.cgi +++ /dev/null @@ -1,155 +0,0 @@ - -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_broadband = qsearchs( 'svc_broadband', { 'svcnum' => $svcnum } ) - or die "svc_broadband: 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 $addr_block = $svc_broadband->addr_block; -my $router = $addr_block->router; - -if (not $router) { die "Could not lookup router for svc_broadband (svcnum $svcnum)" }; - -my ( - $routername, - $routernum, - $speed_down, - $speed_up, - $ip_addr, - $ip_gateway, - $ip_netmask, - ) = ( - $router->getfield('routername'), - $router->getfield('routernum'), - $svc_broadband->getfield('speed_down'), - $svc_broadband->getfield('speed_up'), - $svc_broadband->getfield('ip_addr'), - $addr_block->ip_gateway, - $addr_block->NetAddr->mask, - ); -%> - -<%=header('Broadband Service View', menubar( - ( ( $custnum ) - ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) website" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)) -%> - -Edit this information -
-<%=ntable("#cccccc")%> - - - <%=ntable("#cccccc",2)%> - - Service number - <%=$svcnum%> - - - Router - <%=$routernum%>: <%=$routername%> - - - Download Speed - <%=$speed_down%> - - - Upload Speed - <%=$speed_up%> - - - IP Address - <%=$ip_addr%> - - - IP Netmask - <%=$ip_netmask%> - - - IP Gateway - <%=$ip_gateway%> - - - -<% -foreach (sort { $a cmp $b } $svc_broadband->virtual_fields) { - print $svc_broadband->pvf($_)->widget('HTML', 'view', - $svc_broadband->getfield($_)), "\n"; -} - -%> - - - - - -
-<%=ntable("#cccccc", 2)%> -<% - my $sb_router = qsearchs('router', { svcnum => $svcnum }); - if ($sb_router) { - %> - Router associated: <%=$sb_router->routername%> - - (details) - -
- <% my @sb_addr_block; - if (@sb_addr_block = $sb_router->addr_block) { - %> - Address space - - (edit) - -
- <% print ntable("#cccccc", 1); - foreach (@sb_addr_block) { %> - - <%=$_->ip_gateway%>/<%=$_->ip_netmask%> - - <% } %> - - <% } else { %> - No address space allocated. - <% } %> -
- <% - } else { -%> - -
- -Add router named - - -
- -<% -} -%> - -
-<%=joblisting({'svcnum'=>$svcnum}, 1)%> - - - diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi deleted file mode 100755 index 428f3e9bf..000000000 --- a/httemplate/view/svc_domain.cgi +++ /dev/null @@ -1,108 +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 customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Delete this (unaudited) domain" => - "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" ) - ), - "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_external.cgi b/httemplate/view/svc_external.cgi deleted file mode 100644 index 49183cd95..000000000 --- a/httemplate/view/svc_external.cgi +++ /dev/null @@ -1,54 +0,0 @@ - -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $svcnum = $1; -my $svc_external = qsearchs( 'svc_external', { 'svcnum' => $svcnum } ) - or die "svc_external: Unknown svcnum $svcnum"; - -my $conf = new FS::Conf; - -#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 - - -%> - -<%= header('External Service View', menubar( - ( ( $custnum ) - ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) external service" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)) %> - -Edit this information
-<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %> - -Service number - <%= $svcnum %> -<%= FS::Msgcat::_gettext('svc_external-id') || 'External ID' %> - <%= $conf->config('svc_external-display_type') eq 'artera_turbo' ? sprintf('%010d', $svc_external->id) : $svc_external->id %> -<%= FS::Msgcat::_gettext('svc_external-title') || 'Title' %> - <%= $svc_external->title %> - -<% foreach (sort { $a cmp $b } $svc_external->virtual_fields) { %> - <%= $svc_external->pvf($_)->widget('HTML', 'view', $svc_external->getfield($_)) %> -<% } %> - - -
<%= joblisting({'svcnum'=>$svcnum}, 1) %> - diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi deleted file mode 100755 index 52360bcc2..000000000 --- a/httemplate/view/svc_forward.cgi +++ /dev/null @@ -1,84 +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 customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", - ) - : ( "Cancel this (unaudited) mail forward" => - "${p}misc/cancel-unaudited.cgi?$svcnum" ) - ), - "Main menu" => $p, -)); - -my($srcsvc,$dstsvc,$dst) = ( - $svc_forward->srcsvc, - $svc_forward->dstsvc, - $svc_forward->dst, -); -my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : ''; - -my $svc = $part_svc->svc; - -my $source; -if ($srcsvc) { - my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc}) - or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc"; - $source = $svc_acct->email; -} else { - $source = $src; -} - -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!; - -foreach (sort { $a cmp $b } $svc_forward->virtual_fields) { - print $svc_forward->pvf($_)->widget('HTML', 'view', $svc_forward->getfield($_)), - "\n"; -} - -print qq! !. - '
'. joblisting({'svcnum'=>$svcnum}, 1). - '' -; - -%> diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi deleted file mode 100644 index 6c8cd6a0b..000000000 --- a/httemplate/view/svc_www.cgi +++ /dev/null @@ -1,73 +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 = ''; -my $email = ''; -if ( $usersvc ) { - $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } ) - or die "svc_www: Unknown usersvc $usersvc"; - $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->zone; - -print header('Website View', menubar( - ( ( $custnum ) - ? ( "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!!; - -if ( $usersvc ) { - print qq!$email!; -} else { - print '
(none)
'; -} - -print ''; - -foreach (sort { $a cmp $b } $svc_www->virtual_fields) { - print $svc_www->pvf($_)->widget('HTML', 'view', $svc_www->getfield($_)), - "\n"; -} - - -print ''. - '
'. joblisting({'svcnum'=>$svcnum}, 1). - '' -; -%> -- cgit v1.2.1