X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=e92c05dc7b6a1f56968ead5fe42c1d66bc27bc5d;hb=f13afe5e228a220311557e1ca6dacbf847c26baf;hp=31d5378a784dd6a325d28ec266db999d4820ad76;hpb=8688433f7692a9a0891c91f53fff2420099b327c;p=freeside.git diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 31d5378a7..e92c05dc7 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -57,6 +57,12 @@ supported: =item itemdesc - Line item description (currentlty used only when pkgnum is 0 or -1) +=item quantity - If not set, defaults to 1 + +=item unitsetup - If not set, defaults to setup + +=item unitrecur - If not set, defaults to recur + =back sdate and edate are specified as UNIX timestamps; see L. Also @@ -262,8 +268,21 @@ sub details { $format_sub = sub { my $detail = shift; $csv->parse($detail) or return "can't parse $detail"; - join(' & ', map { '\small{'. &$escape_function($_). '}' } - $csv->fields ); + #join(' & ', map { '\small{'. &$escape_function($_). '}' } + # $csv->fields ); + my $result = ''; + my $column = 1; + foreach ($csv->fields) { + $result .= ' & ' if $column > 1; + if ($column > 6) { # KLUDGE ALERT! + $result .= '\multicolumn{1}{l}{\small{'. + &$escape_function($_). '}}'; + }else{ + $result .= '\small{'. &$escape_function($_). '}'; + } + $column++; + } + $result; } if $format eq 'latex'; @@ -367,6 +386,46 @@ sub units { $self->part_pkg->calc_units($self->cust_pkg); } +=item quantity + +=cut + +sub quantity { + my( $self, $value ) = @_; + if ( defined($value) ) { + $self->setfield('quantity', $value); + } + $self->getfield('quantity') || 1; +} + +=item unitsetup + +=cut + +sub unitsetup { + my( $self, $value ) = @_; + if ( defined($value) ) { + $self->setfield('unitsetup', $value); + } + $self->getfield('unitsetup') eq '' + ? $self->getfield('setup') + : $self->getfield('unitsetup'); +} + +=item unitrecur + +=cut + +sub unitrecur { + my( $self, $value ) = @_; + if ( defined($value) ) { + $self->setfield('unitrecur', $value); + } + $self->getfield('unitrecur') eq '' + ? $self->getfield('recur') + : $self->getfield('unitrecur'); +} + =back =head1 BUGS