X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=e92c05dc7b6a1f56968ead5fe42c1d66bc27bc5d;hb=c545a57d21341c49674defed65a4243f07b5ebaf;hp=5d60311cfd53e20e51535904a6ee2ff675a86ab4;hpb=dc3217c61d6a62a8e599d8804e05ba45b3224c7e;p=freeside.git diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 5d60311cf..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,7 +268,21 @@ sub details { $format_sub = sub { my $detail = shift; $csv->parse($detail) or return "can't parse $detail"; - join(' & ', map { &$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'; @@ -366,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