summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2001-08-03 20:34:28 +0000
committerjeff <jeff>2001-08-03 20:34:28 +0000
commit1dc0755721b4f5989f798df4d37842c70662cf9f (patch)
tree661f05c5d6c813704332563b48b57875229b8cb3
parentf7caf50929669fdf317f1ab51767ac93a1f743fc (diff)
added the tax method
-rw-r--r--FS/FS/cust_bill.pm19
1 files changed, 18 insertions, 1 deletions
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<FS::cust_bill_pkg>) 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