summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2008-09-30 20:22:38 +0000
committerjeff <jeff>2008-09-30 20:22:38 +0000
commitfdab21bcd110c98808614f704d29638ecc2fd2aa (patch)
tree765825022faa8f3241cde7b3aba27aacf194cfd9 /FS
parent00fc1cd338410b0c2ac4990c34aba666f85b7c23 (diff)
option for no postal fee on one-time charges
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_main.pm7
2 files changed, 13 insertions, 1 deletions
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,