[freeside-commits] freeside/FS/FS Schema.pm, 1.44.2.22, 1.44.2.23 cdr.pm, 1.5.2.1, 1.5.2.2 cust_bill.pm, 1.163.2.22, 1.163.2.23 cust_bill_pkg.pm, 1.12, 1.12.2.1 cust_bill_pkg_detail.pm, 1.3, 1.3.4.1

Jeff Finucane,420,, jeff at wavetail.420.am
Sun May 18 21:07:44 PDT 2008


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv6860/FS/FS

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	Schema.pm cdr.pm cust_bill.pm cust_bill_pkg.pm 
	cust_bill_pkg_detail.pm 
Log Message:
backport voip_cdr's upstream_simple, and the columnization features

Index: cust_bill_pkg_detail.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_pkg_detail.pm,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- cust_bill_pkg_detail.pm	3 Mar 2005 08:52:22 -0000	1.3
+++ cust_bill_pkg_detail.pm	19 May 2008 04:07:42 -0000	1.3.4.1
@@ -104,6 +104,7 @@
   $self->ut_numbern('detailnum')
     || $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
     || $self->ut_foreign_key('invnum', 'cust_bill', 'invnum')
+    || $self->ut_enum('format', [ '', 'C' ] )
     || $self->ut_text('detail')
     || $self->SUPER::check
     ;

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.44.2.22
retrieving revision 1.44.2.23
diff -u -d -r1.44.2.22 -r1.44.2.23
--- Schema.pm	20 Feb 2008 01:21:17 -0000	1.44.2.22
+++ Schema.pm	19 May 2008 04:07:39 -0000	1.44.2.23
@@ -417,6 +417,7 @@
         'detailnum', 'serial', '', '', '', '', 
         'pkgnum',  'int', '', '', '', '', 
         'invnum',  'int', '', '', '', '', 
+        'format',  'char', 'NULL', 1, '', '',
         'detail',  'varchar', '', $char_d, '', '', 
       ],
       'primary_key' => 'detailnum',
@@ -1775,6 +1776,31 @@
       'index'  => [],
     },
 
+    'report' => {
+      'columns' => [
+        'reportnum', 'serial',   '',      '', '', '',
+        'usernum',   'int',      '',      '', '', '',
+        'public',    'char', 'NULL',       1, '', '', 
+        'menu',      'char', 'NULL',       1, '', '', 
+        'name',      'varchar',  '', $char_d, '', '',
+      ],
+      'primary_key' => 'reportnum',
+      'unique' => [],
+      'index'  => [ [ 'usernum' ] ],
+    },
+
+    'report_option' => {
+      'columns' => [
+        'optionnum',   'serial',     '',      '', '', '', 
+        'reportnum',      'int',     '',      '', '', '', 
+        'optionname', 'varchar',     '', $char_d, '', '', 
+        'optionvalue',   'text', 'NULL',      '', '', '', 
+      ],
+      'primary_key' => 'optionnum',
+      'unique'      => [],
+      'index'       => [ [ 'reportnum' ], [ 'optionname' ] ],
+    },
+
     'svc_phone' => {
       'columns' => [
         'svcnum',      'int',         '',      '', '', '', 

Index: cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr.pm,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -d -r1.5.2.1 -r1.5.2.2
--- cdr.pm	29 Feb 2008 04:31:42 -0000	1.5.2.1
+++ cdr.pm	19 May 2008 04:07:41 -0000	1.5.2.2
@@ -408,6 +408,14 @@
     sub { shift->rated_price ? 'Y' : 'N' }, #RATED
     '', #OTHER_INFO
   ],
+  'voxlinesystems' => [
+    sub { time2str('%D', shift->calldate_unix ) },   #DATE
+    sub { time2str('%T', shift->calldate_unix ) },   #TIME
+    'userfield',                                     #USER
+    'dst',                                           #NUMBER_DIALED
+    sub { sprintf('%.2fm', shift->billsec / 60 ) },  #DURATION
+    sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
+  ],
 );
 
 sub downstream_csv {
@@ -440,17 +448,32 @@
 
 =over 4
 
-=item batch_import
+=item import_formats
+
+Returns an ordered list of key value pairs containing import format names
+as keys (for use with batch_import) and "pretty" format names as values.
 
 =cut
 
+sub import_formats {
+  (
+    'asterisk'       => 'Asterisk',
+    'taqua'          => 'Taqua',
+    'unitel'         => 'Unitel/RSLCOM',
+    'voxlinesystems' => 'VoxLineSystems',  #XXX? get the actual vendor name
+    'simple'         => 'Simple',
+  );
+}
+
 my($tmp_mday, $tmp_mon, $tmp_year);
 
 sub _cdr_date_parser_maker {
   my $field = shift;
   return sub {
     my( $cdr, $date ) = @_;
-    $cdr->$field( _cdr_date_parse($date) );
+    #$cdr->$field( _cdr_date_parse($date) );
+    eval { $cdr->$field( _cdr_date_parse($date) ); };
+    die "error parsing date for $field from $date: $@\n" if $@;
   };
 }
 
@@ -460,13 +483,18 @@
   return '' unless length($date); #that's okay, it becomes NULL
 
   #$date =~ /^\s*(\d{4})[\-\/]\(\d{1,2})[\-\/](\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})\s*$/
-  $date =~ /^\s*(\d{4})\D(\d{1,2})\D(\d{1,2})\s+(\d{1,2})\D(\d{1,2})\D(\d{1,2})\s*$/
+  $date =~ /^\s*(\d{4})\D(\d{1,2})\D(\d{1,2})\s+(\d{1,2})\D(\d{1,2})\D(\d{1,2})(\D|$)/
     or die "unparsable date: $date"; #maybe we shouldn't die...
   my($year, $mon, $day, $hour, $min, $sec) = ( $1, $2, $3, $4, $5, $6 );
 
+  return '' if $year == 1900 && $mon == 1 && $day == 1
+            && $hour == 0    && $min == 0 && $sec == 0;
+
   timelocal($sec, $min, $hour, $day, $mon-1, $year);
 }
 
+#taqua  #2007-10-31 08:57:24.113000000
+
 #http://www.the-asterisk-book.com/unstable/funktionen-cdr.html
 my %amaflags = (
   DEFAULT       => 0,
@@ -499,6 +527,130 @@
     'uniqueid',
     'userfield',
   ],
+  'taqua' => [ #some of these are kind arbitrary...
+
+    sub { my($cdr, $field) = @_; },       #XXX interesting RecordType
+             # easy to fix: Can't find cdr.cdrtypenum 1 in cdr_type.cdrtypenum
+
+    sub { my($cdr, $field) = @_; },             #all10#RecordVersion
+    sub { my($cdr, $field) = @_; },       #OrigShelfNumber
+    sub { my($cdr, $field) = @_; },       #OrigCardNumber
+    sub { my($cdr, $field) = @_; },       #OrigCircuit
+    sub { my($cdr, $field) = @_; },       #OrigCircuitType
+    'uniqueid',                           #SequenceNumber
+    'accountcode',                        #SessionNumber
+    'src',                                #CallingPartyNumber
+    'dst',                                #CalledPartyNumber
+    _cdr_date_parser_maker('startdate'),  #CallArrivalTime
+    _cdr_date_parser_maker('enddate'),    #CallCompletionTime
+
+    #Disposition
+    #sub { my($cdr, $d ) = @_; $cdr->disposition( $disposition{$d}): },
+    'disposition',
+                                          #  -1 => '',
+                                          #   0 => '',
+                                          # 100 => '',
+                                          # 101 => '',
+                                          # 102 => '',
+                                          # 103 => '',
+                                          # 104 => '',
+                                          # 105 => '',
+                                          # 201 => '',
+                                          # 203 => '',
+
+    _cdr_date_parser_maker('answerdate'), #DispositionTime
+    sub { my($cdr, $field) = @_; },       #TCAP
+    sub { my($cdr, $field) = @_; },       #OutboundCarrierConnectTime
+    sub { my($cdr, $field) = @_; },       #OutboundCarrierDisconnectTime
+
+    #TermTrunkGroup
+    #it appears channels are actually part of trunk groups, but this data
+    #is interesting and we need a source and destination place to put it
+    'dstchannel',                         #TermTrunkGroup
+
+
+    sub { my($cdr, $field) = @_; },       #TermShelfNumber
+    sub { my($cdr, $field) = @_; },       #TermCardNumber
+    sub { my($cdr, $field) = @_; },       #TermCircuit
+    sub { my($cdr, $field) = @_; },       #TermCircuitType
+    sub { my($cdr, $field) = @_; },       #OutboundCarrierId
+    'charged_party',                      #BillingNumber
+    sub { my($cdr, $field) = @_; },       #SubscriberNumber
+    'lastapp',                            #ServiceName
+    sub { my($cdr, $field) = @_; },       #some weirdness #ChargeTime
+    'lastdata',                           #ServiceInformation
+    sub { my($cdr, $field) = @_; },       #FacilityInfo
+    sub { my($cdr, $field) = @_; },             #all 1900-01-01 0#CallTraceTime
+    sub { my($cdr, $field) = @_; },             #all-1#UniqueIndicator
+    sub { my($cdr, $field) = @_; },             #all-1#PresentationIndicator
+    sub { my($cdr, $field) = @_; },             #empty#Pin
+    sub { my($cdr, $field) = @_; },       #CallType
+    sub { my($cdr, $field) = @_; },           #Balt/empty #OrigRateCenter
+    sub { my($cdr, $field) = @_; },           #Balt/empty #TermRateCenter
+
+    #OrigTrunkGroup
+    #it appears channels are actually part of trunk groups, but this data
+    #is interesting and we need a source and destination place to put it
+    'channel',                            #OrigTrunkGroup
+
+    'userfield',                                #empty#UserDefined
+    sub { my($cdr, $field) = @_; },             #empty#PseudoDestinationNumber
+    sub { my($cdr, $field) = @_; },             #all-1#PseudoCarrierCode
+    sub { my($cdr, $field) = @_; },             #empty#PseudoANI
+    sub { my($cdr, $field) = @_; },             #all-1#PseudoFacilityInfo
+    sub { my($cdr, $field) = @_; },       #OrigDialedDigits
+    sub { my($cdr, $field) = @_; },             #all-1#OrigOutboundCarrier
+    sub { my($cdr, $field) = @_; },       #IncomingCarrierID
+    'dcontext',                           #JurisdictionInfo
+    sub { my($cdr, $field) = @_; },       #OrigDestDigits
+    sub { my($cdr, $field) = @_; },       #huh?#InsertTime
+    sub { my($cdr, $field) = @_; },       #key
+    sub { my($cdr, $field) = @_; },             #empty#AMALineNumber
+    sub { my($cdr, $field) = @_; },             #empty#AMAslpID
+    sub { my($cdr, $field) = @_; },             #empty#AMADigitsDialedWC
+    sub { my($cdr, $field) = @_; },       #OpxOffHook
+    sub { my($cdr, $field) = @_; },       #OpxOnHook
+
+        #acctid - primary key
+  #AUTO #calldate - Call timestamp (SQL timestamp)
+#clid - Caller*ID with text
+        #XXX src - Caller*ID number / Source number
+        #XXX dst - Destination extension
+        #dcontext - Destination context
+        #channel - Channel used
+        #dstchannel - Destination channel if appropriate
+        #lastapp - Last application if appropriate
+        #lastdata - Last application data
+        #startdate - Start of call (UNIX-style integer timestamp)
+        #answerdate - Answer time of call (UNIX-style integer timestamp)
+        #enddate - End time of call (UNIX-style integer timestamp)
+  #HACK#duration - Total time in system, in seconds
+  #HACK#XXX billsec - Total time call is up, in seconds
+        #disposition - What happened to the call: ANSWERED, NO ANSWER, BUSY
+#INT amaflags - What flags to use: BILL, IGNORE etc, specified on a per channel basis like accountcode.
+        #accountcode - CDR account number to use: account
+
+        #uniqueid - Unique channel identifier (Unitel/RSLCOM Event ID)
+        #userfield - CDR user-defined field
+
+        #X cdrtypenum - CDR type - see FS::cdr_type (Usage = 1, S&E = 7, OC&C = 8)
+        #XXX charged_party - Service number to be billed
+#upstream_currency - Wholesale currency from upstream
+#X upstream_price - Wholesale price from upstream
+#upstream_rateplanid - Upstream rate plan ID
+#rated_price - Rated (or re-rated) price
+#distance - km (need units field?)
+#islocal - Local - 1, Non Local = 0
+#calltypenum - Type of call - see FS::cdr_calltype
+#X description - Description (cdr_type 7&8 only) (used for cust_bill_pkg.itemdesc)
+#quantity - Number of items (cdr_type 7&8 only)
+#carrierid - Upstream Carrier ID (see FS::cdr_carrier)
+#upstream_rateid - Upstream Rate ID
+
+        #svcnum - Link to customer service (see FS::cust_svc)
+        #freesidestatus - NULL, done (or something)
+
+  ],
   'unitel' => [
     'uniqueid',
     #'cdr_type',
@@ -524,6 +676,50 @@
     'carrierid',
     'upstream_rateid',
   ],
+  'voxlinesystems' => [ #XXX get the actual vendor name
+    'disposition',                        #Status
+    'startdate',                          #Start (what do you know, a timestamp!
+    sub { my($cdr, $field) = @_; },       #Start date
+    sub { my($cdr, $field) = @_; },       #Start time
+    'enddate',                            #End (also a timestamp!)
+    sub { my($cdr, $field) = @_; },       #End date
+    sub { my($cdr, $field) = @_; },       #End time
+    'accountcode',                        #Calling customer XXX map to agent_custid??
+    sub { my($cdr, $field) = @_; },       #Calling type
+    sub { shift->src('30000'); }, #XXX FAKE XXX 'src',                                #Calling number
+    'userfield',                          #Calling name #?
+    sub { my($cdr, $field) = @_; },       #Called type
+    'dst',                                #Called number
+    sub { my($cdr, $field) = @_; },       #Destination customer
+    sub { my($cdr, $field) = @_; },       #Destination type
+    sub { my($cdr, $field) = @_; },       #Destination Number
+    sub { my($cdr, $field) = @_; },       #Inbound calling type
+    sub { my($cdr, $field) = @_; },       #Inbound calling number
+    sub { my($cdr, $field) = @_; },       #Inbound called type
+    sub { my($cdr, $field) = @_; },       #Inbound called number
+    sub { my($cdr, $field) = @_; },       #Inbound destination type
+    sub { my($cdr, $field) = @_; },       #Inbound destination number
+    sub { my($cdr, $field) = @_; },       #Outbound calling type
+    sub { my($cdr, $field) = @_; },       #Outbound calling number
+    sub { my($cdr, $field) = @_; },       #Outbound called type
+    sub { my($cdr, $field) = @_; },       #Outbound called number
+    sub { my($cdr, $field) = @_; },       #Outbound destination type
+    sub { my($cdr, $field) = @_; },       #Outbound destination number
+    sub { my($cdr, $field) = @_; },       #Internal calling type
+    sub { my($cdr, $field) = @_; },       #Internal calling number
+    sub { my($cdr, $field) = @_; },       #Internal called type
+    sub { my($cdr, $field) = @_; },       #Internal called number
+    sub { my($cdr, $field) = @_; },       #Internal destination type
+    sub { my($cdr, $field) = @_; },       #Internal destination number
+    'duration',                           #Total seconds
+    sub { my($cdr, $field) = @_; },       #Ring seconds
+    'billsec',                            #Billable seconds
+    'upstream_price',                     #Cost
+    sub { my($cdr, $field) = @_; },       #Billing customer
+    sub { my($cdr, $field) = @_; },       #Billing customer name
+    sub { my($cdr, $field) = @_; },       #Billing type
+    sub { my($cdr, $field) = @_; },       #Billing reference
+  ],
   'simple' => [
 
     # Date
@@ -561,6 +757,26 @@
   ],
 );
 
+my %import_header = (
+  'simple'         => 1,
+  'taqua'          => 1,
+  'voxlinesystems' => 2, #XXX vendor name
+);
+
+=item batch_import HASHREF
+
+Imports CDR records.  Available options are:
+
+=over 4
+
+=item filehandle
+
+=item format
+
+=back
+
+=cut
+
 sub batch_import {
   my $param = shift;
 
@@ -588,18 +804,13 @@
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
-  if ( $format eq 'simple' ) { # and other formats with a header too?
-
-  }
+  my $header_lines =
+    exists($import_header{$format}) ? $import_header{$format} : 0;
 
-  my $body = 0;
   my $line;
   while ( defined($line=<$fh>) ) {
 
-    #skip header...
-    if ( ! $body++ && $format eq 'simple' && $line =~ /^[\w\, ]+$/ ) {
-      next;
-    }
+    next if $header_lines-- > 0; #&& $line =~ /^[\w, "]+$/ 
 
     $csv->parse($line) or do {
       $dbh->rollback if $oldAutoCommit;
@@ -637,6 +848,15 @@
       &{$sub}($cdr, $data);  # $cdr->&{$sub}($data); 
     }
 
+    if ( $format eq 'taqua' ) {
+      if ( $cdr->enddate && $cdr->startdate  ) { #a bit more?
+        $cdr->duration( $cdr->enddate - $cdr->startdate  );
+      }
+      if ( $cdr->enddate && $cdr->answerdate ) { #a bit more?
+        $cdr->billsec(  $cdr->enddate - $cdr->answerdate );
+      } 
+    }
+
     my $error = $cdr->insert;
     if ( $error ) {
       $dbh->rollback if $oldAutoCommit;

Index: cust_bill_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_pkg.pm,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- cust_bill_pkg.pm	21 Jan 2007 21:45:28 -0000	1.12
+++ cust_bill_pkg.pm	19 May 2008 04:07:42 -0000	1.12.2.1
@@ -110,7 +110,8 @@
     my $cust_bill_pkg_detail = new FS::cust_bill_pkg_detail {
       'pkgnum' => $self->pkgnum,
       'invnum' => $self->invnum,
-      'detail' => $detail,
+      'format' => (ref($detail) ? $detail->[0] : '' ),
+      'detail' => (ref($detail) ? $detail->[1] : $detail ),
     };
     $error = $cust_bill_pkg_detail->insert;
     if ( $error ) {
@@ -203,18 +204,62 @@
   qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
 }
 
-=item details
+=item details [ OPTION => VALUE ... ]
 
 Returns an array of detail information for the invoice line item.
 
+Currently available options are: I<format> I<escape_function>
+
+If I<format> is set to html or latex then the array members are improved
+for tabular appearance in those environments if possible.
+
+If I<escape_function> is set then the array members are processed by this
+function before being returned.
+
 =cut
 
 sub details {
-  my $self = shift;
+  my ( $self, %opt ) = @_;
+  my $format = $opt{format} || '';
+  my $escape_function = $opt{escape_function} || sub { shift };
   return () unless defined dbdef->table('cust_bill_pkg_detail');
-  map { $_->detail }
-    qsearch ( 'cust_bill_pkg_detail', { 'pkgnum' => $self->pkgnum,
-                                        'invnum' => $self->invnum, } );
+
+  eval "use Text::CSV_XS;";
+  die $@ if $@;
+  my $csv = new Text::CSV_XS;
+
+  my $format_sub = sub { my $detail = shift;
+                         $csv->parse($detail) or return "can't parse $detail";
+                         join(' - ', map { &$escape_function($_) }
+                                     $csv->fields
+                             );
+                       };
+
+  $format_sub = sub { my $detail = shift;
+                      $csv->parse($detail) or return "can't parse $detail";
+                      join('</TD><TD>', map { &$escape_function($_) }
+                                        $csv->fields
+                          );
+                    }
+    if $format eq 'html';
+
+  $format_sub = sub { my $detail = shift;
+                      $csv->parse($detail) or return "can't parse $detail";
+                      join(' & ', map { &$escape_function($_) } $csv->fields );
+                    }
+    if $format eq 'latex';
+
+  map { ( $_->format eq 'C'
+          ? &{$format_sub}( $_->detail )
+          : &{$escape_function}( $_->detail )
+        )
+      }
+    qsearch ({ 'table'    => 'cust_bill_pkg_detail',
+               'hashref'  => { 'pkgnum' => $self->pkgnum,
+                               'invnum' => $self->invnum,
+                             },
+               'order_by' => 'ORDER BY detailnum',
+            });
     #qsearch ( 'cust_bill_pkg_detail', { 'lineitemnum' => $self->lineitemnum });
 }
 

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.163.2.22
retrieving revision 1.163.2.23
diff -u -d -r1.163.2.22 -r1.163.2.23
--- cust_bill.pm	14 May 2008 21:21:17 -0000	1.163.2.22
+++ cust_bill.pm	19 May 2008 04:07:41 -0000	1.163.2.23
@@ -1949,7 +1949,8 @@
     $invoice_data{'detail_items'} = \@detail_items;
     $invoice_data{'total_items'} = \@total_items;
   
-    foreach my $line_item ( $self->_items($conf->exists('disable_previous_balance') ? qw( _items_pkg ) : () ) ) {
+    my %options = ( 'format' => 'latex', 'escape_function' => \&_latex_escape );
+    foreach my $line_item ( ($conf->exists('disable_previous_balance') ? qw() : $self->_items_previous(%options)), $self->_items_pkg(%options) ) {
       my $detail = {
         ext_description => [],
       };
@@ -1957,9 +1958,7 @@
       $detail->{'quantity'} = 1;
       $detail->{'description'} = _latex_escape($line_item->{'description'});
       if ( exists $line_item->{'ext_description'} ) {
-        @{$detail->{'ext_description'}} = map {
-          _latex_escape($_);
-        } @{$line_item->{'ext_description'}};
+        @{$detail->{'ext_description'}} = @{$line_item->{'ext_description'}};
       }
       $detail->{'amount'} = $line_item->{'amount'};
       $detail->{'product_code'} = $line_item->{'pkgpart'} || 'N/A';
@@ -2266,16 +2265,15 @@
 
   my $money_char = $conf->config('money_char') || '$';
 
-  foreach my $line_item ( $self->_items($conf->exists('disable_previous_balance') ? qw( _items_pkg ) : () ) ) {
+  my %options = ( 'format' => 'html', 'escape_function' => \&encode_entities );
+  foreach my $line_item ( ($conf->exists('disable_previous_balance') ? qw() : $self->_items_previous(%options)), $self->_items_pkg(%options) ) {
     my $detail = {
       ext_description => [],
     };
     $detail->{'ref'} = $line_item->{'pkgnum'};
     $detail->{'description'} = encode_entities($line_item->{'description'});
     if ( exists $line_item->{'ext_description'} ) {
-      @{$detail->{'ext_description'}} = map {
-        encode_entities($_);
-      } @{$line_item->{'ext_description'}};
+      @{$detail->{'ext_description'}} = @{$line_item->{'ext_description'}};
     }
     $detail->{'amount'} = $money_char. $line_item->{'amount'};
     $detail->{'product_code'} = $line_item->{'pkgpart'} || 'N/A';
@@ -2439,6 +2437,9 @@
 sub _items_cust_bill_pkg {
   my $self = shift;
   my $cust_bill_pkg = shift;
+  my %opt = @_;
+  my $format = $opt{format} || '';
+  my $escape_function = $opt{escape_function} || sub { shift };
 
   my @b = ();
   foreach my $cust_bill_pkg ( @$cust_bill_pkg ) {
@@ -2453,7 +2454,10 @@
         my $description = $desc;
         $description .= ' Setup' if $cust_bill_pkg->recur != 0;
         my @d = $cust_pkg->h_labels_short($self->_date);
-        push @d, $cust_bill_pkg->details if $cust_bill_pkg->recur == 0;
+        push @d, $cust_bill_pkg->details( 'format'          => $format,
+                                          'escape_function' => $escape_function,
+                                        )
+          if $cust_bill_pkg->recur == 0;
         push @b, {
           description     => $description,
           #pkgpart         => $part_pkg->pkgpart,
@@ -2480,7 +2484,8 @@
             [ $cust_pkg->h_labels_short( $self->_date ),
                                          #$cust_bill_pkg->edate,
                                          #$cust_bill_pkg->sdate),
-              $cust_bill_pkg->details,
+              $cust_bill_pkg->details( 'format'          => $format,
+                                       'escape_function' => $escape_function),
             ],
         };
       }



More information about the freeside-commits mailing list