[freeside-commits] branch FREESIDE_4_BRANCH updated. 2d5a8b0b5dc2ddbaa84d9884169c52ead1f790c8

Mark Wells mark at 420.am
Tue Jul 12 17:33:08 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  2d5a8b0b5dc2ddbaa84d9884169c52ead1f790c8 (commit)
       via  92aeca588c2e42aae2d50dc0d6b1115c4e4a768d (commit)
       via  6f5ea058941c0acb13b02c86287c54974bd3d59f (commit)
      from  44d27f7842c32750ddf6210c83b949d5b440a6c5 (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 2d5a8b0b5dc2ddbaa84d9884169c52ead1f790c8
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jul 12 17:32:50 2016 -0700

    remove unused config option

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 3fef424..27368f4 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3470,13 +3470,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'cust_pkg-always_show_location',
-    'section'     => 'packages',
-    'description' => "Always display package locations, even when they're all the default service address.",
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'cust_pkg-group_by_location',
     'section'     => 'packages',
     'description' => "Group packages by location.",

commit 92aeca588c2e42aae2d50dc0d6b1115c4e4a768d
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jul 12 17:31:33 2016 -0700

    restore location labels on invoices, but remove the 'default service location' prefix from everywhere, #71474

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 2355529..c8ddffd 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -3360,7 +3360,7 @@ sub _items_cust_bill_pkg {
             # location, and we're not grouping items by location already
             if ( $cust_pkg->locationnum != $default_locationnum
                   and !defined($locationnum) ) {
-              my $loc = $cust_pkg->location_label(no_prefix => 1);
+              my $loc = $cust_pkg->location_label;
               $loc = substr($loc, 0, $maxlength). '...'
                 if $format eq 'latex' && length($loc) > $maxlength;
               push @d, &{$escape_function}($loc);
@@ -3470,7 +3470,7 @@ sub _items_cust_bill_pkg {
             # location, and we're not grouping items by location already
             if ( $cust_pkg->locationnum != $default_locationnum
                   and !defined($locationnum) ) {
-              my $loc = $cust_pkg->location_label(no_prefix => 1);
+              my $loc = $cust_pkg->location_label;
               $loc = substr($loc, 0, $maxlength). '...'
                 if $format eq 'latex' && length($loc) > $maxlength;
               push @d, &{$escape_function}($loc);
diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index 0dec065..9040098 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -722,9 +722,12 @@ sub label_prefix {
   } elsif ( $label_prefix eq '_location' && $self->locationname ) {
     $prefix = $self->locationname;
 
-  } elsif (    ( $opt{'cust_main'} || $self->custnum )
-          && $self->locationnum == $cust_or_prospect->ship_locationnum ) {
-    $prefix = 'Default service location';
+  #} elsif (    ( $opt{'cust_main'} || $self->custnum )
+  #        && $self->locationnum == $cust_or_prospect->ship_locationnum ) {
+  #  $prefix = 'Default service location';
+  #}
+  } else {
+    $prefix = '';
   }
 
   $prefix;

commit 6f5ea058941c0acb13b02c86287c54974bd3d59f
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jul 12 15:46:47 2016 -0700

    option to show all package locations on invoice, #71474

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index e251cab..3fef424 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3632,6 +3632,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'invoice-all_pkg_addresses',
+    'section'     => 'invoicing',
+    'description' => 'Show all package addresses on invoices, even the default.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'invoice-unitprice',
     'section'     => 'invoicing',
     'description' => 'Enable unit pricing on invoices and quantities on packages.',
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index ddc933e..2355529 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -3186,7 +3186,9 @@ sub _items_cust_bill_pkg {
 
   # for location labels: use default location on the invoice date
   my $default_locationnum;
-  if ( $self->custnum ) {
+  if ( $conf->exists('invoice-all_pkg_addresses') ) {
+    $default_locationnum = 0; # treat them all as non-default
+  } elsif ( $self->custnum ) {
     my $h_cust_main;
     my @h_search = FS::h_cust_main->sql_h_search($self->_date);
     $h_cust_main = qsearchs({
@@ -3358,7 +3360,7 @@ sub _items_cust_bill_pkg {
             # location, and we're not grouping items by location already
             if ( $cust_pkg->locationnum != $default_locationnum
                   and !defined($locationnum) ) {
-              my $loc = $cust_pkg->location_label;
+              my $loc = $cust_pkg->location_label(no_prefix => 1);
               $loc = substr($loc, 0, $maxlength). '...'
                 if $format eq 'latex' && length($loc) > $maxlength;
               push @d, &{$escape_function}($loc);
@@ -3468,7 +3470,7 @@ sub _items_cust_bill_pkg {
             # location, and we're not grouping items by location already
             if ( $cust_pkg->locationnum != $default_locationnum
                   and !defined($locationnum) ) {
-              my $loc = $cust_pkg->location_label;
+              my $loc = $cust_pkg->location_label(no_prefix => 1);
               $loc = substr($loc, 0, $maxlength). '...'
                 if $format eq 'latex' && length($loc) > $maxlength;
               push @d, &{$escape_function}($loc);

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

Summary of changes:
 FS/FS/Conf.pm           |   14 +++++++-------
 FS/FS/Template_Mixin.pm |    4 +++-
 FS/FS/cust_location.pm  |    9 ++++++---
 3 files changed, 16 insertions(+), 11 deletions(-)




More information about the freeside-commits mailing list