diff options
author | jeff <jeff> | 2010-06-27 09:25:26 +0000 |
---|---|---|
committer | jeff <jeff> | 2010-06-27 09:25:26 +0000 |
commit | f8f4c51eaa6f5aa3d49672fe7a17f19fa22494c0 (patch) | |
tree | 1ad38dad696061c639fe9bbb7abf0f08e023bb4a /FS/FS/cust_bill_pkg.pm | |
parent | 0d3dee3cf6dc3518fb21d1014f5ebb5ea7f95434 (diff) |
planet telesis invoice fixups RT 8707,8406
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r-- | FS/FS/cust_bill_pkg.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index c825c15..d396f82 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -480,6 +480,35 @@ sub details { #qsearch ( 'cust_bill_pkg_detail', { 'lineitemnum' => $self->lineitemnum }); } +=item details_header [ OPTION => VALUE ... ] + +Returns a list representing an invoice line item detail header, if any. +This relies on the behavior of voip_cdr in that it expects the header +to be the first CSV formatted detail (as is expected by invoice generation +routines). Returns the empty list otherwise. + +=cut + +sub details_header { + my $self = shift; + return '' unless defined dbdef->table('cust_bill_pkg_detail'); + + eval "use Text::CSV_XS;"; + die $@ if $@; + my $csv = new Text::CSV_XS; + + my @detail = + qsearch ({ 'table' => 'cust_bill_pkg_detail', + 'hashref' => { 'billpkgnum' => $self->billpkgnum, + 'format' => 'C', + }, + 'order_by' => 'ORDER BY detailnum LIMIT 1', + }); + return() unless scalar(@detail); + $csv->parse($detail[0]->detail) or return (); + $csv->fields; +} + =item desc Returns a description for this line item. For typical line items, this is the |