From: Ivan Kohler Date: Mon, 16 Feb 2015 07:21:50 +0000 (-0800) Subject: remove ancient invoice events X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=2c5aa117162ef4dfce93da42ea3391dcdece4bb9 remove ancient invoice events --- diff --git a/FS/FS.pm b/FS/FS.pm index 33105ba46..04311e57d 100644 --- a/FS/FS.pm +++ b/FS/FS.pm @@ -408,10 +408,6 @@ L - Invoice line item detail class L - Legacy data invoice class -L - (Old) Invoice event definition class - -L - (Old) Completed invoice event class - L - (New) Billing event definition class L - (New) Billing event option class diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm index 121f83c40..f741b7190 100644 --- a/FS/FS/AccessRight.pm +++ b/FS/FS/AccessRight.pm @@ -53,7 +53,6 @@ assigned to users and/or groups. # 'billing' => [ # '_desc' => 'Access to billing configuration', # 'payment_gateway' => {}, -# 'part_bill_event' => {}, # 'prepay_credit' => {}, # 'rate' => {}, # 'cust_main_county' => {}, diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 091070ec5..bb04d9427 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2147,11 +2147,6 @@ and customer address. Include units.', }, { - 'key' => 'safe-part_bill_event', - 'section' => 'UI', - 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.', - 'type' => 'checkbox', - }, { 'key' => 'show_ship_company', diff --git a/FS/FS/cust_pay_batch.pm b/FS/FS/cust_pay_batch.pm index d4d40b580..a4b4957aa 100644 --- a/FS/FS/cust_pay_batch.pm +++ b/FS/FS/cust_pay_batch.pm @@ -49,7 +49,7 @@ following fields are currently supported: =item batchnum - indentifies group in batch -=item payby - CARD/CHEK/LECB/BILL/COMP +=item payby - CARD/CHEK =item payinfo @@ -154,7 +154,7 @@ sub check { if ( $self->exp eq '' ) { return "Expiration date required" - unless $self->payby =~ /^(CHEK|DCHK|LECB|WEST)$/; + unless $self->payby =~ /^(CHEK|DCHK|WEST)$/; $self->exp(''); } else { if ( $self->exp =~ /^(\d{4})[\/\-](\d{1,2})[\/\-](\d{1,2})$/ ) { @@ -246,39 +246,6 @@ sub retriable { confess "deprecated method cust_pay_batch->retriable called; try removing ". "the once condition and adding an every condition?"; - my $self = shift; - - local $SIG{HUP} = 'IGNORE'; #Hmm - local $SIG{INT} = 'IGNORE'; - local $SIG{QUIT} = 'IGNORE'; - local $SIG{TERM} = 'IGNORE'; - local $SIG{TSTP} = 'IGNORE'; - local $SIG{PIPE} = 'IGNORE'; - - my $oldAutoCommit = $FS::UID::AutoCommit; - local $FS::UID::AutoCommit = 0; - my $dbh = dbh; - - my $cust_bill = qsearchs('cust_bill', { 'invnum' => $self->invnum } ) - or return "event $self->eventnum references nonexistant invoice $self->invnum"; - - warn "cust_pay_batch->retriable working with self of " . $self->paybatchnum . " and invnum of " . $self->invnum; - my @cust_bill_event = - sort { $a->part_bill_event->seconds <=> $b->part_bill_event->seconds } - grep { - $_->part_bill_event->eventcode =~ /\$cust_bill->batch_card/ - && $_->status eq 'done' - && ! $_->statustext - } - $cust_bill->cust_bill_event; - # complain loudly if scalar(@cust_bill_event) > 1 ? - my $error = $cust_bill_event[0]->retriable; - if ($error ) { - # gah, even with transactions. - $dbh->commit if $oldAutoCommit; #well. - return "error marking invoice event retriable: $error"; - } - ''; } =item approve OPTIONS diff --git a/httemplate/browse/part_bill_event.cgi b/httemplate/browse/part_bill_event.cgi deleted file mode 100755 index 11bc14e5c..000000000 --- a/httemplate/browse/part_bill_event.cgi +++ /dev/null @@ -1,122 +0,0 @@ -<% include('/elements/header.html', 'Invoice Event Listing') %> - - Invoice events are the deprecated, old-style actions taken on open invoices. Any events still listed here should be migrated to new-style events.

- -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 )'; } -%> -

-% tie my %payby, 'Tie::IxHash', FS::payby->cust_payby2longname; -% tie my %freq, 'Tie::IxHash', '1d' => 'daily', '1m' => 'monthly'; -% foreach my $payby ( keys %payby ) { -% my $oldfreq = ''; -% -% my @payby_part_bill_event = -% grep { $payby eq $_->payby } -% sort { ( $a->freq || '1d') cmp ( $b->freq || '1d' ) # for now -% || $a->seconds <=> $b->seconds -% || $a->weight <=> $b->weight -% || $a->eventpart <=> $b->eventpart -% } -% @part_bill_event; -% -% -% if ( @payby_part_bill_event ) { - - - <% include('/elements/table-grid.html') %> -% my $bgcolor1 = '#eeeeee'; -% my $bgcolor2 = '#ffffff'; -% my $bgcolor; -% -% -% foreach my $part_bill_event ( @payby_part_bill_event ) { -% my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart; -% my $delay = duration_exact($part_bill_event->seconds); -% ( my $plandata = $part_bill_event->plandata ) =~ s/\n/
/go; -% my $freq = $part_bill_event->freq || '1d'; -% my $reason = $part_bill_event->reasontext ; -% -% if ( $oldfreq ne $freq ) { - - - - param('showdisabled') ? 7 : 8 %>><% ucfirst($freq{$freq}) %> event tests for <% $payby{$payby} %> customers - - - - param('showdisabled') ? 2 : 3 %>>Event - After - Action - Reason - Options - Code - -% -% $oldfreq = $freq; -% $bgcolor = ''; -% -% } -% -% if ( $bgcolor eq $bgcolor1 ) { -% $bgcolor = $bgcolor2; -% } else { -% $bgcolor = $bgcolor1; -% } -% - - - - - <% $part_bill_event->eventpart %> -% unless ( $cgi->param('showdisabled') ) { - - - <% $part_bill_event->disabled ? 'DISABLED' : '' %> -% } - - - <% $part_bill_event->event %> - - <% $delay %> - - <% $part_bill_event->plan %> - - <% $reason %> - - <% $plandata %> - - <% $part_bill_event->eventcode %> - -% } - - -

-% } -% } - -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -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); - - diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi deleted file mode 100755 index c0ff38689..000000000 --- a/httemplate/edit/part_bill_event.cgi +++ /dev/null @@ -1,570 +0,0 @@ -<% include('/elements/header.html', - "$action Invoice Event Definition", - menubar( - 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', - ) - ) -%> - -<% include('/elements/error.html') %> - -
- -Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> - -<% ntable("#cccccc",2) %> - - - Event name - - - - - For - - customers - - -% my $days = $hashref->{seconds}/86400; - - - - After - days - - - - Test event - - - - - - - - Disabled - - {disabled} eq 'Y' ? ' CHECKED' : '' %>> - - - - - Action - -% -% -%#print ntable(); -% -%sub select_pkgpart { -% my $label = shift; -% my $plandata = shift; -% my %selected = map { $_=>1 } split(/,\s*/, $plandata->{$label}); -% qq('; -%} -% -%sub select_agentnum { -% my $plandata = shift; -% #my $agentnum = $plandata->{'agentnum'}; -% my %agentnums = map { $_=>1 } split(/,\s*/, $plandata->{'agentnum'}); -% ''; -%} -% -%sub honor_dundate { -% my $label = shift; -% my $plandata = shift; -% ''. -% ''. -% qq('. -% '
Allow delay until dun date? {$label} eq "$label => 1," ? 'CHECKED' : '' ). -% '>'. -% '
' -%} -% -%my $conf = new FS::Conf; -%my $money_char = $conf->config('money_char') || '$'; -% -%my $late_taxclass = ''; -%my $late_percent_taxclass = ''; -%if ( $conf->exists('enable_taxclasses') ) { -% $late_taxclass = -% '
Taxclass '. -% include('/elements/select-taxclass.html', -% 'curr_value' => '%%%late_taxclass%%%', -% 'name' => 'late_taxclass' ); -% $late_percent_taxclass = -% '
Taxclass '. -% include('/elements/select-taxclass.html', -% 'curr_value' => '%%%late_percent_taxclass%%%', -% 'name' => 'late_percent_taxclass' ); -%} -% -%#this is pretty kludgy right here. -%tie my %events, 'Tie::IxHash', -% -% 'fee' => { -% 'name' => 'Late fee (flat)', -% 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\', \'$%%%charge%%%\', \'%%%late_taxclass%%%\' );', -% 'html' => -% 'Amount '. -% '
Reason '. -% $late_taxclass, -% 'weight' => 10, -% }, -% 'fee_percent' => { -% 'name' => 'Late fee (percentage)', -% 'code' => '$cust_main->charge( sprintf(\'%.2f\', $cust_bill->owed * %%%percent%%% / 100 ), \'%%%percent_reason%%%\', \'%%%percent%%% percent\', \'%%%late_percent_taxclass%%%\' );', -% 'html' => -% 'Percent %'. -% '
Reason '. -% $late_percent_taxclass, -% 'weight' => 10, -% }, -% 'suspend' => { -% 'name' => 'Suspend', -% 'code' => '$cust_main->suspend(reason => %%%sreason%%%, %%%honor_dundate%%% );', -% 'html' => sub { &honor_dundate('honor_dundate', @_) }, -% 'weight' => 10, -% 'reason' => 'S', -% }, -% 'suspend-if-balance' => { -% 'name' => 'Suspend if balance (this invoice and previous) over', -% 'code' => '$cust_bill->cust_suspend_if_balance_over( %%%balanceover%%%, reason => %%%sreason%%%, %%%balance_honor_dundate%%% );', -% 'html' => sub { " $money_char ". ' '. &honor_dundate('balance_honor_dundate', @_) }, -% 'weight' => 10, -% 'reason' => 'S', -% }, -% 'suspend-if-pkgpart' => { -% 'name' => 'Suspend packages', -% 'code' => '$cust_main->suspend_if_pkgpart({pkgparts => [%%%if_pkgpart%%%,], reason => %%%sreason%%%, %%%if_pkgpart_honor_dundate%%% });', -% 'html' => sub { &select_pkgpart('if_pkgpart', @_). &honor_dundate('if_pkgpart_honor_dundate', @_) }, -% 'weight' => 10, -% 'reason' => 'S', -% }, -% 'suspend-unless-pkgpart' => { -% 'name' => 'Suspend packages except', -% 'code' => '$cust_main->suspend_unless_pkgpart({unless_pkgpart => [%%%unless_pkgpart%%%], reason => %%%sreason%%%, %%%unless_pkgpart_honor_dundate%%% });', -% 'html' => sub { &select_pkgpart('unless_pkgpart', @_). &honor_dundate('unless_pkgpart_honor_dundate' => @_) }, -% 'weight' => 10, -% 'reason' => 'S', -% }, -% 'cancel' => { -% 'name' => 'Cancel', -% 'code' => '$cust_main->cancel(reason => %%%creason%%%);', -% 'weight' => 80, #10, -% 'reason' => 'C', -% }, -% -% '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' => 90, #30, -% }, -% -% 'credit' => { -% 'name' => "Create and apply a credit for the customer's balance (i.e. write off as bad debt)", -% 'code' => '$cust_main->credit( $cust_main->balance, \'%%%credit_reason%%%\' );', -% 'html' => '', -% 'weight' => 30, -% }, -% -% 'realtime-card' => { -% 'name' => 'Run card with a Business::OnlinePayment realtime gateway', -% 'code' => '$cust_bill->realtime_card();', -% 'weight' => 30, -% }, -% -% 'realtime-check' => { -% 'name' => 'Run check with a Business::OnlinePayment realtime gateway', -% 'code' => '$cust_bill->realtime_ach();', -% 'weight' => 30, -% }, -% -% 'realtime-lec' => { -% 'name' => 'Run phone bill ("LEC") billing with a Business::OnlinePayment realtime gateway', -% 'code' => '$cust_bill->realtime_lec();', -% 'weight' => 30, -% }, -% -% 'batch-card' => { -% 'name' => 'Add card or check to a pending batch', -% 'code' => '$cust_bill->batch_card(%options);', -% 'weight' => 40, -% }, -% -% -% #'retriable' => { -% # 'name' => 'Mark batched card event as retriable', -% # 'code' => '$cust_pay_batch->retriable();', -% # 'weight' => 60, -% #}, -% -% 'send' => { -% 'name' => 'Send invoice (email/print/fax)', -% 'code' => '$cust_bill->send();', -% 'weight' => 50, -% }, -% -% 'send_email' => { -% 'name' => 'Send invoice (email only)', -% 'code' => '$cust_bill->email();', -% 'weight' => 50, -% }, -% -% 'send_alternate' => { -% 'name' => 'Send invoice (email/print/fax) with alternate template', -% 'code' => '$cust_bill->send(\'%%%templatename%%%\');', -% 'html' => -% '', -% 'weight' => 50, -% }, -% -% 'send_if_newest' => { -% 'name' => 'Send invoice (email/print/fax) with alternate template, if it is still the newest invoice (useful for late notices - set to 31 days or later)', -% 'code' => '$cust_bill->send_if_newest(\'%%%if_newest_templatename%%%\');', -% 'html' => -% '', -% 'weight' => 50, -% }, -% -% 'send_agent' => { -% 'name' => 'Send invoice (email/print/fax) ', -% 'code' => '$cust_bill->send( \'%%%agent_templatename%%%\', -% [ %%%agentnum%%% ], -% \'%%%agent_invoice_from%%%\', -% %%%agent_balanceover%%% -% );', -% 'html' => sub { -% ' -% -% -% -% -% -% -% -% -% -% -% -% -% -% -% -% -%
only for agent(s) '. &select_agentnum(@_). '
with template -% -%
email From: -% -%
if balance (this invoice and previous) over -% -% '. $money_char. ' -%
'; -% }, -% 'weight' => 50, -% }, -% -% 'send_csv_ftp' => { -% 'name' => 'Upload CSV invoice data to an FTP server', -% 'code' => '$cust_bill->send_csv( protocol => \'ftp\', -% server => \'%%%ftpserver%%%\', -% username => \'%%%ftpusername%%%\', -% password => \'%%%ftppassword%%%\', -% dir => \'%%%ftpdir%%%\', -% \'format\' => \'%%%ftpformat%%%\', -% );', -% 'html' => -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% '
Format ("default" or "billco"): '. -% ''. -% ''. -% '
FTP server: '. -% '
FTP username: '. -% ''. -% '
FTP password: '. -% ''. -% '
FTP directory: '. -% '
', -% 'weight' => 50, -% }, -% -% 'spool_csv' => { -% 'name' => 'Spool CSV invoice data', -% 'code' => '$cust_bill->spool_csv( -% \'format\' => \'%%%spoolformat%%%\', -% \'dest\' => \'%%%spooldest%%%\', -% \'balanceover\' => \'%%%spoolbalanceover%%%\', -% \'agent_spools\' => \'%%%spoolagent_spools%%%\', -% );', -% 'html' => sub { -% my $plandata = shift; -% -% my $html = -% ''. -% ''. -% ''. -% ''. -% ''. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% '
Format: '. -% ''. -% '
For destination: '. -% ''. -% '
if balance (this invoice and previous) over '. -% "$money_char ". -% ''. -% '
Individual per-agent spools? {'spoolagent_spools'} ? 'CHECKED' : '' ). -% '>'. -% '
'; -% -% $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_and_credits; "";', -% 'weight' => 70, -% }, -% -%; -% - -%foreach my $event ( keys %events ) { -% my %plandata = map { /^(\w+) (.*)$/; ($1, $2); } -% split(/\n/, $part_bill_event->plandata); -% my $html = $events{$event}{html}; -% if ( ref($html) eq 'CODE' ) { -% $html = &{$html}(\%plandata); -% } -% while ( $html =~ /%%%(\w+)%%%/ ) { -% my $field = $1; -% $html =~ s/%%%$field%%%/$plandata{$field}/; -% } -% - -% if ($event eq $part_bill_event->plan){ -% $currentreasonclass=$events{$event}{reason}; -% } -% print ntable( "#cccccc", 2). -% qq!plan; -% print qq!onClick="showhide_table()" !; -% print qq!VALUE="!. $event. ":". $events{$event}{weight}. ":". -% encode_entities($events{$event}{code}). -% qq!">$events{$event}{name}!; -% print ''. $html. '' if $html; -% print qq!!; -% print ''; -% print qq!
!; -%} -% -% if ($currentreasonclass eq 'C'){ -% if ($cgi->param('creason') =~ /^(-?\d+)$/){ -% $creason = $1; -% }else{ -% $creason = $part_bill_event->reason; -% } -% if ($cgi->param('newcreasonT') =~ /^(\d+)$/){ -% $newcreasonT = $1; -% } -% if ($cgi->param('newcreason') =~ /^([\w\s]+)$/){ -% $newcreason = $1; -% } -% }elsif ($currentreasonclass eq 'S'){ -% if ($cgi->param('sreason') =~ /^(-?\d+)$/){ -% $sreason = $1; -% }else{ -% $sreason = $part_bill_event->reason; -% } -% if ($cgi->param('newsreasonT') =~ /^(\d+)$/){ -% $newsreasonT = $1; -% } -% if ($cgi->param('newsreason') =~ /^([\w\s]+)$/){ -% $newsreason = $1; -% } -% } -% - - - - - - - - -
- -<% include('/elements/tr-select-reason.html', - 'field' => 'creason', - 'reason_class' => 'C', - 'curr_value' => $creason, - 'init_type' => $newcreasonT, - 'init_newreason' => $newcreason - ) -%> -
-
- - - -
- -<% include('/elements/tr-select-reason.html', - 'field' => 'sreason', - 'reason_class' => 'S', - 'curr_value' => $sreason, - 'init_type' => $newsreasonT, - 'init_newreason' => $newsreason - ) -%> -
-
- -% -%print qq!!; -% - - -
- -<% include('/elements/footer.html') %> - -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { - $cgi->param('eventpart', $1); -} else { - $cgi->param('eventpart', ''); -} - -my ($creason, $newcreasonT, $newcreason); -my ($sreason, $newsreasonT, $newsreason); - -my ($query) = $cgi->keywords; -my $action = ''; -my $part_bill_event = ''; -my $currentreasonclass = ''; -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->eventpart ? 'Edit' : 'Add'; -my $hashref = $part_bill_event->hashref; - - diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi deleted file mode 100755 index eb0529bb8..000000000 --- a/httemplate/edit/process/part_bill_event.cgi +++ /dev/null @@ -1,106 +0,0 @@ -%if ( $error ) { -% $cgi->param('error', $error); -<% $cgi->redirect(popurl(2). "part_bill_event.cgi?". $cgi->query_string ) %> -%} else { -<% $cgi->redirect(popurl(3)."browse/part_bill_event.cgi") %> -%} -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); - -my $eventpart = $cgi->param('eventpart'); - -my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart; - -#s/days/seconds/ -$cgi->param('seconds', int( $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+):(.*)$/s - or die "illegal plan_weight_eventcode:". - $cgi->param('plan_weight_eventcode'); - $cgi->param('plan', $1); - $cgi->param('weight', $2); - my $eventcode = $3; - my $plandata = ''; - - my $rnum; - my $rtype; - my $reasonm; - my $class = ''; - $class='c' if ($eventcode =~ /cancel/); - $class='s' if ($eventcode =~ /suspend/); - if ($class) { - $cgi->param("${class}reason") =~ /^(-?\d+)$/ - or $error = "Invalid ${class}reason"; - $rnum = $1; - if ($rnum == -1) { - $cgi->param("new${class}reasonT") =~ /^(\d+)$/ - or $error = "Invalid new${class}reasonT"; - $rtype = $1; - $cgi->param("new${class}reason") =~ /^([\s\w]+)$/ - or $error = "Invalid new${class}reason"; - $reasonm = $1; - } - } - - if ($rnum == -1 && !$error) { - my $reason = new FS::reason ({ 'reason' => $reasonm, - 'reason_type' => $rtype, - }); - $error = $reason->insert; - unless ($error) { - $rnum = $reason->reasonnum; - $cgi->param("${class}reason", $rnum); - $cgi->param("new${class}reason", ''); - $cgi->param("new${class}reasonT", ''); - } - } - - while ( $eventcode =~ /%%%(\w+)%%%/ ) { - my $field = $1; - my $value = join(', ', $cgi->param($field) ); - $cgi->param($field, $value); #in case it errors out - $eventcode =~ s/%%%$field%%%/$value/; - $plandata .= "$field $value\n"; - } - $cgi->param('eventcode', $eventcode); - $cgi->param('plandata', $plandata); - - unless($error) { - - if ( $eventpart ) { - - my $new = new FS::part_bill_event ( { - map { $_ => scalar($cgi->param($_)) } - fields('part_bill_event'), - } ); - $new->setfield('reason' => $rnum); - $error = $new->replace($old); - - } else { - - foreach my $payby ( $cgi->param('payby') ) { - my $new = new FS::part_bill_event ( { - map { $_ => scalar($cgi->param($_)) } - grep { $_ ne 'payby' } - fields('part_bill_event') - } ); - $new->setfield('payby' => $payby); - $new->setfield('reason' => $rnum ); - $error = $new->insert; - last if $error; - } - - } - - } - -} - - diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 7d5d4f398..548dd9a88 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -317,8 +317,6 @@ tie my %report_ticketing, 'Tie::IxHash', tie my %report_bill_event, 'Tie::IxHash', 'All billing events' => [ $fsurl.'search/report_cust_event.html', 'All billing events for a date range' ], 'Billing event errors' => [ $fsurl.'search/report_cust_event.html?failed=1', 'Failed credit cards, processor or printer problems, etc.' ], -# 'All invoice events' => [ $fsurl.'search/cust_bill_event.html', 'Reports on deprecated, old-style invoice events for a date range' ], -# 'Invoice event errors' => [ $fsurl.'search/cust_bill_event.html?failed=1', 'Reports on deprecated, old-style events for failed credit cards, processor or printer problems, etc.' ], ; tie my %report_payments, 'Tie::IxHash', @@ -667,7 +665,6 @@ $config_billing{'Billing events'} = [ $fsurl.'browse/part_event.html', 'Billing if $curuser->access_right('Edit billing events') || $curuser->access_right('Edit global billing events'); if ( $curuser->access_right('Configuration') ) { - #$config_billing{'Invoice events'} = [ $fsurl.'browse/part_bill_event.cgi', 'Deprecated, old-style actions for overdue invoices' ]; $config_billing{'Invoice configurations'} = [ $fsurl.'browse/invoice_conf.html', 'Adjust invoice settings for special-purpose notices' ]; $config_billing{'Invoice templates'} = [ $fsurl.'browse/invoice_template.html', 'Edit templates for HTML, plaintext and typeset invoices' ]; $config_billing{'separator'} = ''; #its a separator! diff --git a/httemplate/misc/email_invoice_events.cgi b/httemplate/misc/email_invoice_events.cgi deleted file mode 100644 index d65fe172b..000000000 --- a/httemplate/misc/email_invoice_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reemail', $cgi; - - diff --git a/httemplate/misc/fax_invoice_events.cgi b/httemplate/misc/fax_invoice_events.cgi deleted file mode 100644 index 05420eeca..000000000 --- a/httemplate/misc/fax_invoice_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_refax', $cgi; - - diff --git a/httemplate/misc/print_invoice_events.cgi b/httemplate/misc/print_invoice_events.cgi deleted file mode 100644 index c974d5f4e..000000000 --- a/httemplate/misc/print_invoice_events.cgi +++ /dev/null @@ -1,9 +0,0 @@ -<% $server->process %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Resend invoices'); - -my $server = new FS::UI::Web::JSRPC 'FS::cust_bill_event::process_reprint', $cgi; - - diff --git a/httemplate/search/cust_bill_event.cgi b/httemplate/search/cust_bill_event.cgi deleted file mode 100644 index 9fb533a5f..000000000 --- a/httemplate/search/cust_bill_event.cgi +++ /dev/null @@ -1,167 +0,0 @@ -<& elements/search.html, - 'title' => $title, - 'html_init' => $html_init, - 'menubar' => $menubar, - 'name' => 'billing events', - 'query' => $sql_query, - 'count_query' => $count_sql, - 'header' => [ 'Event', - 'Date', - 'Status', - #'Inv #', 'Inv Date', 'Cust #', - 'Invoice', - FS::UI::Web::cust_header(), - ], - 'fields' => [ - 'event', - sub { time2str("%b %d %Y %T", $_[0]->_date) }, - sub { - #my $cust_bill_event = shift; - my $status = $_[0]->status; - $status .= ': '.$_[0]->statustext - if $_[0]->statustext; - $status; - }, - sub { - #my $cust_bill_event = shift; - 'Invoice #'. $_[0]->invnum. - ' ('. - time2str("%D", $_[0]->cust_bill_date). - ')'; - }, - \&FS::UI::Web::cust_fields, - ], - 'align' => 'lrlr'.FS::UI::Web::cust_aligns(), - 'links' => [ - '', - '', - '', - sub { - my $part_bill_event = shift; - my $template = $part_bill_event->templatename; - $template .= '-' if $template; - [ "${p}view/cust_bill.cgi?$template", 'invnum']; - }, - ( map { $_ ne 'Cust. Status' ? $link_cust : '' } - FS::UI::Web::cust_header() - ), - ], - 'color' => [ - '', - '', - '', - '', - FS::UI::Web::cust_colors(), - ], - 'style' => [ - '', - '', - '', - '', - FS::UI::Web::cust_styles(), - ], - -&> -<%init> - -my $curuser = $FS::CurrentUser::CurrentUser; - -die "access denied" - unless $curuser->access_right('Billing event reports') - or $curuser->access_right('View customer billing events') - && $cgi->param('invnum') =~ /^(\d+)$/; - -my $title = $cgi->param('failed') - ? 'Failed invoice events' - : 'Invoice events'; - -my %search = (); - -if ( $cgi->param('agentnum') && $cgi->param('agentnum') =~ /^(\d+)$/ ) { - $search{agentnum} = $1; -} - -($search{beginning}, $search{ending}) - = FS::UI::Web::parse_beginning_ending($cgi); - -if ( $cgi->param('failed') ) { - $search{failed} = '1'; -} - -if ( $cgi->param('part_bill_event.payby') =~ /^(\w+)$/ ) { - $search{payby} = $1; -} - -if ( $cgi->param('invnum') =~ /^(\d+)$/ ) { - $search{invnum} = $1; -} - -my $where = 'WHERE '. FS::cust_bill_event->search_sql_where( \%search ); - -my $join = 'LEFT JOIN part_bill_event USING ( eventpart ) '. - 'LEFT JOIN cust_bill USING ( invnum ) '. - FS::UI::Web::join_cust_main('cust_bill'); - -my $sql_query = { - 'table' => 'cust_bill_event', - 'select' => join(', ', - 'cust_bill_event.*', - 'part_bill_event.event', - 'cust_bill.custnum', - 'cust_bill._date AS cust_bill_date', - 'cust_main.custnum AS cust_main_custnum', - FS::UI::Web::cust_sql_fields(), - ), - 'hashref' => {}, - 'extra_sql' => $where, - 'order_by' => 'ORDER BY _date ASC', - 'addl_from' => $join, -}; - -my $count_sql = "SELECT COUNT(*) FROM cust_bill_event $join $where"; - -my $conf = new FS::Conf; - -my $html_init = ' - Invoice events are the deprecated, old-style actions taken o -n open invoices. See Reports->Billing events->Billing events for current event reports.

'; - -$html_init .= join("\n", map { - ( my $action = $_ ) =~ s/_$//; - include('/elements/progress-init.html', - $_.'form', - [ keys(%search) ], - "../misc/${_}invoice_events.cgi", - { 'message' => "Invoices re-${action}ed" }, #would be nice to show the number of them, but... - $_, #key - ), - qq!
!, - qq!!, #not used though - (map {qq!!} keys(%search)), - qq!
! -} qw( print_ email_ fax_ ) ); - -my $menubar = []; - -if ( $curuser->access_right('Resend invoices') ) { - - push @$menubar, 'Re-print these events' => - "javascript:print_process()", - 'Re-email these events' => - "javascript:email_process()", - ; - - push @$menubar, 'Re-fax these events' => - "javascript:fax_process()" - if $conf->exists('hylafax'); - -} - -my $link_cust = sub { - my $cust_bill_event = shift; - $cust_bill_event->cust_main_custnum - ? [ "${p}view/cust_main.cgi?", 'custnum' ] - : ''; -}; - - diff --git a/httemplate/search/cust_bill_event.html b/httemplate/search/cust_bill_event.html deleted file mode 100755 index 0f84a5581..000000000 --- a/httemplate/search/cust_bill_event.html +++ /dev/null @@ -1,67 +0,0 @@ -<% include( - '/elements/header.html', - ( $cgi->param('failed') ? 'Failed invoice events' : 'Invoice events' ), - ) -%> - - Invoice events are the deprecated, old-style actions taken - on open invoices. See Reports->Billing events->Billing events for current event reports.

- -
- - - - <% include( '/elements/tr-select-agent.html', 'disable_empty'=>0 ) %> - - - <% include( '/elements/tr-input-beginning_ending.html' ) %> - - - - - -
Events for payment type: - -
-
-
- -<% include('/elements/footer.html') %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Billing event reports'); - - diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 27376d505..4ee4efbf4 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -111,10 +111,6 @@ ( <% mt('View invoice events') |h %> ) % } -% if ( $cust_bill->num_cust_bill_event ) { $br++; -( <% mt('View deprecated, old-style invoice events') |h %> ) -% } - % my @modes = grep {! $_->disabled} % $cust_bill->cust_main->agent->invoice_modes; % if ( @modes ) {