summaryrefslogtreecommitdiff
path: root/FS/FS/agent.pm
diff options
context:
space:
mode:
authorivan <ivan>2009-04-14 17:16:16 +0000
committerivan <ivan>2009-04-14 17:16:16 +0000
commit8c804ba59c8b284e1294e9928b5412fdf31e412c (patch)
treece2a86e7528ec3bb758207068d4014449e365a45 /FS/FS/agent.pm
parent437f7374ed17088113c4067df42201295b6d6c43 (diff)
add configuration option to control recurring_flag behavior, RT#3843
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r--FS/FS/agent.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm
index e471e04..5fbe2c4 100644
--- a/FS/FS/agent.pm
+++ b/FS/FS/agent.pm
@@ -225,16 +225,21 @@ sub payment_gateway {
my $taxclass = '';
if ( $options{invnum} ) {
+
my $cust_bill = qsearchs('cust_bill', { 'invnum' => $options{invnum} } );
die "invnum ". $options{'invnum'}. " not found" unless $cust_bill;
- my @taxclasses =
- map { $_->part_pkg->taxclass }
+
+ my @part_pkg =
+ map { $_->part_pkg }
grep { $_ }
map { $_->cust_pkg }
$cust_bill->cust_bill_pkg;
- unless ( grep { $taxclasses[0] ne $_ } @taxclasses ) { #unless there are
- #different taxclasses $taxclass = $taxclasses[0];
- }
+
+ my @taxclasses = map $_->taxclass, @part_pkg;
+
+ $taxclass = $taxclasses[0]
+ unless grep { $taxclasses[0] ne $_ } @taxclasses; #unless there are
+ #different taxclasses
}
#look for an agent gateway override first