From 55675d6cdd93f00b7c0ac93403e8c4d66567a729 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 13:16:42 -0700 Subject: invoice voiding, RT#18677 --- FS/FS/cust_bill_pkg_void.pm | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'FS/FS/cust_bill_pkg_void.pm') 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 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) 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 -- cgit v1.2.1