From: jeff Date: Tue, 30 Sep 2008 20:22:38 +0000 (+0000) Subject: option for no postal fee on one-time charges X-Git-Tag: root_of_webpay_support~345 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=fdab21bcd110c98808614f704d29638ecc2fd2aa option for no postal fee on one-time charges --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 79e9feb3c..610d590d1 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2012,6 +2012,13 @@ worry that config_items is freeside-specific and icky. }, { + 'key' => 'postal_invoice-recurring_only', + 'section' => 'billing', + 'description' => 'The postal invoice fee is omitted on invoices without reucrring charges when this is set.', + 'type' => 'checkbox', + }, + + { 'key' => 'batch-enable', 'section' => 'billing', 'description' => 'Enable credit card and/or ACH batching - leave disabled for real-time installations.', diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b348aaa7b..225854c06 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2147,7 +2147,12 @@ sub bill { return "can't charge postal invoice fee for customer ". $self->custnum. ": $postal_pkg"; } - if ( $postal_pkg ) { + if ( $postal_pkg && + ( scalar( grep { $_->recur && $_->recur > 0 } @cust_bill_pkg) || + !$conf->exists('postal_invoice-recurring_only') + ) + ) + { foreach my $part_pkg ( $postal_pkg->part_pkg->self_and_bill_linked ) { my $error = $self->_make_lines( 'part_pkg' => $part_pkg,