From fdab21bcd110c98808614f704d29638ecc2fd2aa Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 30 Sep 2008 20:22:38 +0000 Subject: [PATCH] option for no postal fee on one-time charges --- FS/FS/Conf.pm | 7 +++++++ FS/FS/cust_main.pm | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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, -- 2.11.0