From f411189684b0ca7cc1b4b3e9be1895607245b595 Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 26 Sep 2008 03:54:25 +0000 Subject: push out event triggered suspensions --- httemplate/edit/part_bill_event.cgi | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 8e7b6da87..3b5114122 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -96,6 +96,18 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % ''; %} % +%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') || '$'; % @@ -137,28 +149,29 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % }, % 'suspend' => { % 'name' => 'Suspend', -% 'code' => '$cust_main->suspend(reason => %%%sreason%%%);', +% '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%%%, );', -% 'html' => " $money_char ". '', +% '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%%%,});', -% 'html' => sub { &select_pkgpart('if_pkgpart', @_) }, +% '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%%%,});', -% 'html' => sub { &select_pkgpart('unless_pkgpart', @_) }, +% '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', % }, -- cgit v1.2.1