X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_bill_pkg.pm;h=7d5094ced8ea04b1103f299d463cd7acb531597d;hb=40a7b3dc653e099f7bd0bd762b649b04c4432db2;hp=4058f1f38e42a90416229cec01eab9582a4fe3bd;hpb=64fcb43c61c196766260319cd9219eb70ea27767;p=freeside.git diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 4058f1f38..7d5094ced 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -19,7 +19,7 @@ use FS::cust_tax_adjustment; @ISA = qw( FS::cust_main_Mixin FS::Record ); -$DEBUG = 1; +$DEBUG = 0; $me = '[FS::cust_bill_pkg]'; =head1 NAME @@ -152,6 +152,8 @@ sub insert { 'amount' => (ref($detail) ? $detail->[2] : '' ), 'classnum' => (ref($detail) ? $detail->[3] : '' ), 'phonenum' => (ref($detail) ? $detail->[4] : '' ), + 'duration' => (ref($detail) ? $detail->[5] : '' ), + 'regionname' => (ref($detail) ? $detail->[6] : '' ), }; $error = $cust_bill_pkg_detail->insert; if ( $error ) { @@ -627,7 +629,8 @@ sub disintegrate { } #split usage from recur - my $usage = sprintf( "%.2f", $cust_bill_pkg{recur}->usage ); + my $usage = sprintf( "%.2f", $cust_bill_pkg{recur}->usage ) + if exists($cust_bill_pkg{recur}); warn "usage is $usage\n" if $DEBUG > 1; if ($usage) { my $cust_bill_pkg_usage = @@ -799,6 +802,25 @@ sub cust_bill_pkg_tax_Xlocation { } +=item cust_bill_pkg_detail [ CLASSNUM ] + +Returns the list of associated cust_bill_pkg_detail objects +The optional CLASSNUM argument will limit the details to the specified usage +class. + +=cut + +sub cust_bill_pkg_detail { + my $self = shift; + my $classnum = shift || ''; + + my %hash = ( 'billpkgnum' => $self->billpkgnum ); + $hash{classnum} = $classnum if $classnum; + + qsearch ( 'cust_bill_pkg_detail', { %hash } ), + +} + =back =head1 BUGS