% },
% '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 ". '<INPUT TYPE="text" SIZE="7" NAME="balanceover" VALUE="%%%balanceover%%%">',
% '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',
% },
% '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' => '<INPUT TYPE="text" NAME="reason" VALUE="%%%reason%%%">',
+% 'weight' => 30,
+% },
+%
% 'realtime-card' => {
% 'name' => 'Run card with a <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> realtime gateway',
% 'code' => '$cust_bill->realtime_card();',
% '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%%%\');',
%
% '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,
% },
%
<TABLE BGCOLOR="#cccccc" BORDER=0 WIDTH="100%">
<TR><TD>
<TABLE BORDER=0 id="Ctable" style="display:<% $currentreasonclass eq 'C' ? 'inline' : 'none' %>">
-<% include('/elements/tr-select-reason.html', 'creason', 'C', $creason, $newcreasonT, $newcreason) %>
+<% include('/elements/tr-select-reason.html',
+ 'field' => 'creason',
+ 'reason_class' => 'C',
+ 'curr_value' => $creason,
+ 'init_type' => $newcreasonT,
+ 'init_newreason' => $newcreason
+ )
+%>
</TABLE>
</TR></TD>
</TABLE>
<TABLE BGCOLOR="#cccccc" BORDER=0 WIDTH="100%">
<TR><TD>
<TABLE BORDER=0 id="Stable" style="display:<% $currentreasonclass eq 'S' ? 'inline' : 'none' %>">
-<% include('/elements/tr-select-reason.html', 'sreason', 'S', $sreason, $newsreasonT, $newsreason) %>
+<% include('/elements/tr-select-reason.html',
+ 'field' => 'sreason',
+ 'reason_class' => 'S',
+ 'curr_value' => $sreason,
+ 'init_type' => $newsreasonT,
+ 'init_newreason' => $newsreason
+ )
+%>
</TABLE>
</TR></TD>
</TABLE>