From 1dc0755721b4f5989f798df4d37842c70662cf9f Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 3 Aug 2001 20:34:28 +0000 Subject: [PATCH 1/1] added the tax method --- FS/FS/cust_bill.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 8480ceadc..4ffb8e210 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -64,6 +64,8 @@ FS::cust_bill - Object methods for cust_bill records @cust_pay_objects = $cust_bill->cust_pay; + $tax_amount = $record->tax; + @lines = $cust_bill->print_text; @lines = $cust_bill->print_text $time; @@ -231,6 +233,21 @@ sub cust_pay { ; } +=item tax + +Returns the tax amount (see L) for this invoice. + +=cut + +sub tax { + my $self = shift; + my $total = 0; + my @taxlines = qsearch( 'cust_bill_pkg', { 'invnum' => $self->invnum , + 'pkgnum' => 0 } ); + foreach (@taxlines) { $total += $_->setup; } + $total; +} + =item owed Returns the amount owed (still outstanding) on this invoice, which is charged @@ -424,7 +441,7 @@ sub print_text { =head1 VERSION -$Id: cust_bill.pm,v 1.7 2001-04-09 23:05:15 ivan Exp $ +$Id: cust_bill.pm,v 1.8 2001-08-03 20:34:28 jeff Exp $ =head1 BUGS -- 2.11.0