X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_bill_event.cgi;h=0921a957776da46cd48f11d9c2da18556bf94956;hb=a5ca508ed3bf1bcb03df26d35d1316b3c313820a;hp=a58f078836036ff280f3c14015586acfc82b5401;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index a58f07883..0921a9577 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -7,9 +7,14 @@ % $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') @@ -40,7 +45,7 @@ % } -
+ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> @@ -157,31 +162,36 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % }, % 'suspend' => { % 'name' => 'Suspend', -% 'code' => '$cust_main->suspend();', +% 'code' => '$cust_main->suspend(reason => %%%sreason%%%);', % '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%%% );', +% 'code' => '$cust_bill->cust_suspend_if_balance_over( %%%balanceover%%%, reason => %%%sreason%%%, );', % 'html' => " $money_char ". '', % 'weight' => 10, +% 'reason' => 'S', % }, % 'suspend-if-pkgpart' => { % 'name' => 'Suspend packages', -% 'code' => '$cust_main->suspend_if_pkgpart(%%%if_pkgpart%%%);', +% 'code' => '$cust_main->suspend_if_pkgpart({pkgparts => [%%%if_pkgpart%%%,], reason => %%%sreason%%%,});', % 'html' => sub { &select_pkgpart('if_pkgpart', @_) }, % 'weight' => 10, +% 'reason' => 'S', % }, % 'suspend-unless-pkgpart' => { % 'name' => 'Suspend packages except', -% 'code' => '$cust_main->suspend_unless_pkgpart(%%%unless_pkgpart%%%);', +% 'code' => '$cust_main->suspend_unless_pkgpart({unless_pkgpart => [%%%unless_pkgpart%%%], reason => %%%sreason%%%,});', % 'html' => sub { &select_pkgpart('unless_pkgpart', @_) }, % 'weight' => 10, +% 'reason' => 'S', % }, % 'cancel' => { % 'name' => 'Cancel', -% 'code' => '$cust_main->cancel();', +% 'code' => '$cust_main->cancel(reason => %%%creason%%%);', % 'weight' => 10, +% 'reason' => 'C', % }, % % 'addpost' => { @@ -196,6 +206,13 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % 'weight' => 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, \'%%%reason%%%\' );', +% 'html' => '', +% 'weight' => 30, +% }, +% % 'realtime-card' => { % 'name' => 'Run card with a Business::OnlinePayment realtime gateway', % 'code' => '$cust_bill->realtime_card();', @@ -215,17 +232,30 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % }, % % 'batch-card' => { -% 'name' => 'Add card to the pending credit card batch', -% 'code' => '$cust_bill->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%%%\');', @@ -378,7 +408,7 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % % 'apply' => { % 'name' => 'Apply unapplied payments and credits', -% 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; "";', +% 'code' => '$cust_main->apply_payments_and_credits; "";', % 'weight' => 70, % }, % @@ -390,6 +420,7 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % %; % + %foreach my $event ( keys %events ) { % my %plandata = map { /^(\w+) (.*)$/; ($1, $2); } % split(/\n/, $part_bill_event->plandata); @@ -402,9 +433,15 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % $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}!; @@ -413,12 +450,73 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % print ''; %} % -%#print ''; +% 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; +% } +% } % -%print < -% -%END + + + + + + + + +
+ +<% include('/elements/tr-select-reason.html', 'creason', 'C', $creason, $newcreasonT, $newcreason) %> +
+
+ + + +
+ +<% include('/elements/tr-select-reason.html', 'sreason', 'S', $sreason, $newsreasonT, $newsreason) %> +
+
+ % %print qq!{eventpart} ? $hashref->{eventpart} : "(NEW)" %> +