[freeside-commits] branch master updated. 9ceac8029d24a9262d3ea98aa840108fd7bd70aa

Mark Wells mark at 420.am
Tue Feb 3 11:44:09 PST 2015


The branch, master has been updated
       via  9ceac8029d24a9262d3ea98aa840108fd7bd70aa (commit)
      from  aeb90ade381fc3d5477db0334048c2af623fccfe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ceac8029d24a9262d3ea98aa840108fd7bd70aa
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Feb 3 11:44:01 2015 -0800

    make non-package fees appear in invoice spools, #29824, #25899

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index e26592c..d8e46c5 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2830,6 +2830,8 @@ sub _items_fee {
   my $self = shift;
   my %options = @_;
   my @cust_bill_pkg = grep { $_->feepart } $self->cust_bill_pkg;
+  my $escape_function = $options{escape_function};
+
   my @items;
   foreach my $cust_bill_pkg (@cust_bill_pkg) {
     # cache this, so we don't look it up again in every section
@@ -2865,12 +2867,17 @@ sub _items_fee {
     foreach (sort keys(%base_invnums)) {
       next if $_ == $self->invnum;
       push @ext_desc,
-        $self->mt('from invoice \\#[_1] on [_2]', $_, $base_invnums{$_});
+        &{$escape_function}(
+          $self->mt('from invoice #[_1] on [_2]', $_, $base_invnums{$_})
+        );
     }
+    my $desc = $part_fee->itemdesc_locale($self->cust_main->locale);
+    $desc = &{$escape_function}($desc);
+
     push @items,
       { feepart     => $cust_bill_pkg->feepart,
         amount      => sprintf('%.2f', $cust_bill_pkg->setup + $cust_bill_pkg->recur),
-        description => $part_fee->itemdesc_locale($self->cust_main->locale),
+        description => $desc,
         ext_description => \@ext_desc
         # sdate/edate?
       };
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 888e88b..068d0d1 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1900,7 +1900,14 @@ sub print_csv {
   if ( lc($opt{'format'}) eq 'billco' ) {
 
     my $lineseq = 0;
-    foreach my $item ( $self->_items_pkg ) {
+    my %items_opt = ( format => 'template',
+                      escape_function => sub { shift } );
+    # I don't know what characters billco actually tolerates in spool entries.
+    # Text::CSV will take care of delimiters, though.
+
+    my @items = ( $self->_items_pkg(%items_opt),
+                  $self->_items_fee(%items_opt) );
+    foreach my $item (@items) {
 
       my $description = $item->{'description'};
       if ( $item->{'_is_discount'} and exists($item->{ext_description}[0]) ) {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Template_Mixin.pm |   11 +++++++++--
 FS/FS/cust_bill.pm      |    9 ++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list