summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_pkg_void.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-01 13:16:42 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-01 13:16:42 -0700
commit55675d6cdd93f00b7c0ac93403e8c4d66567a729 (patch)
tree8cdcfe054c725489d25a4fce515234364e7c1a1d /FS/FS/cust_bill_pkg_void.pm
parent338eca0837fdaddbda2a34ddf8af3f815de13d26 (diff)
invoice voiding, RT#18677
Diffstat (limited to 'FS/FS/cust_bill_pkg_void.pm')
-rw-r--r--FS/FS/cust_bill_pkg_void.pm30
1 files changed, 27 insertions, 3 deletions
diff --git a/FS/FS/cust_bill_pkg_void.pm b/FS/FS/cust_bill_pkg_void.pm
index 198283955..7855d58c6 100644
--- a/FS/FS/cust_bill_pkg_void.pm
+++ b/FS/FS/cust_bill_pkg_void.pm
@@ -1,8 +1,12 @@
package FS::cust_bill_pkg_void;
+use base qw( FS::TemplateItem_Mixin FS::Record );
use strict;
-use base qw( FS::Record );
-use FS::Record; # qw( qsearch qsearchs );
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_bill_void;
+use FS::cust_bill_pkg_detail_void;
+use FS::cust_bill_pkg_display_void;
+use FS::cust_bill_pkg_discount_void;
=head1 NAME
@@ -113,6 +117,13 @@ points to. You can ask the object for a copy with the I<hash> method.
sub table { 'cust_bill_pkg_void'; }
+sub detail_table { 'cust_bill_pkg_detail_void'; }
+sub display_table { 'cust_bill_pkg_display_void'; }
+sub discount_table { 'cust_bill_pkg_discount_void'; }
+#sub tax_location_table { 'cust_bill_pkg_tax_location'; }
+#sub tax_rate_location_table { 'cust_bill_pkg_tax_rate_location'; }
+#sub tax_exempt_pkg_table { 'cust_tax_exempt_pkg'; }
+
=item insert
Adds this record to the database. If there is an error, returns the error,
@@ -147,7 +158,7 @@ sub check {
my $error =
$self->ut_number('billpkgnum')
|| $self->ut_snumber('pkgnum')
- || $self->ut_number('invnum') #cust_bill or cust_bill_void ?
+ || $self->ut_number('invnum') #cust_bill or cust_bill_void, if we ever support line item voiding
|| $self->ut_numbern('pkgpart_override')
|| $self->ut_money('setup')
|| $self->ut_money('recur')
@@ -167,6 +178,19 @@ sub check {
$self->SUPER::check;
}
+=item cust_bill
+
+Returns the voided invoice (see L<FS::cust_bill_void>) for this voided line
+item.
+
+=cut
+
+sub cust_bill {
+ my $self = shift;
+ #cust_bill or cust_bill_void, if we ever support line item voiding
+ qsearchs( 'cust_bill_void', { 'invnum' => $self->invnum } );
+}
+
=back
=head1 BUGS