[freeside-commits] branch FREESIDE_3_BRANCH updated. 4dcbb6b380dfd036cc06e4d7002cbda17d29f23a

Carl J. Adams-Collier cjac at 420.am
Tue Sep 16 17:22:02 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  4dcbb6b380dfd036cc06e4d7002cbda17d29f23a (commit)
       via  3f56918a17a6f534513cbb1643630bc5b61e6034 (commit)
       via  5192ab23dffe251a20b6aa739d39a33ee65ce518 (commit)
       via  a32c436ae3a0c40b71698547d1abe2a2c89b3f8c (commit)
       via  a52d6f02a276f3e5ff14b1b017923556cde3a6e3 (commit)
       via  47697b2c3988393de996dca3889a24c480c586b5 (commit)
      from  9d96031e79187a549c2c150e96363d421e59efc5 (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 4dcbb6b380dfd036cc06e4d7002cbda17d29f23a
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Tue Sep 9 17:42:19 2014 -0700

    altered FS::UI::Web::cust_sort_fields() and cust_sql_fields() so that ->param('cust_fields') argument is no longer required
    when the parameter is not passed, the initial value previously passed to cust_header() is used
    if @cust_fields is empty, cust_header() is called with no arguments

diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index fba4a45..0aeaa5b 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -325,7 +325,7 @@ sub cust_header {
 }
 
 sub cust_sort_fields {
-  cust_header(@_);
+  cust_header(@_) if( @_ or !@cust_fields );
   #inefficientish, but tiny lists and only run once per page
 
   map { $_ eq 'custnum' ? 'custnum' : '' } @cust_fields;
@@ -347,7 +347,7 @@ sub cust_sql_fields {
   my @fields = qw( last first company );
 #  push @fields, map "ship_$_", @fields;
 
-  cust_header(@_);
+  cust_header(@_) if( @_ or !@cust_fields );
   #inefficientish, but tiny lists and only run once per page
 
   my @location_fields;
@@ -487,6 +487,7 @@ element.
 
 sub cust_fields_subs {
   my $unlinked_warn = 0;
+
   return map { 
     my $f = $_;
     if ( $unlinked_warn++ ) {
diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html
index ddde23a..5dbece8 100644
--- a/httemplate/search/elements/cust_main_dayranges.html
+++ b/httemplate/search/elements/cust_main_dayranges.html
@@ -187,7 +187,7 @@ my $sql_query = {
                    'cust_main.custnum',
                    $range_cols,
                    $packages_cols,
-                   FS::UI::Web::cust_sql_fields($cgi->param('cust_fields')),
+                   FS::UI::Web::cust_sql_fields(),
                    'payby',
                  ),
   'extra_sql' => $where,

commit 3f56918a17a6f534513cbb1643630bc5b61e6034
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Fri Sep 12 14:46:26 2014 -0700

    FS RT #27208 - using field names specified by ivan for customer / phone in AR aging report

diff --git a/FS/FS/ConfDefaults.pm b/FS/FS/ConfDefaults.pm
index c20a9c9..a66d0ab 100644
--- a/FS/FS/ConfDefaults.pm
+++ b/FS/FS/ConfDefaults.pm
@@ -33,10 +33,10 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Customer' =>
     'custnum | Status | Last, First or Company (Last, First)',
 
-  'Cust. Status | Day phone | Night phone | Mobile phone | Fax number' =>
-    'Status | (all phones)',
-  'Cust# | Cust. Status | Day phone | Night phone | Mobile phone | Fax number' =>
-    'custnum | Status | (all phones)',
+  'Customer | Day phone | Night phone | Mobile phone | Fax number' =>
+    'Customer | (all phones)',
+  'Cust# | Customer | Day phone | Night phone | Mobile phone | Fax number' =>
+    'custnum | Customer | (all phones)',
 
   'Cust. Status | Name | Company' =>
     'Status | Last, First | Company',

commit 5192ab23dffe251a20b6aa739d39a33ee65ce518
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Thu Sep 11 12:12:44 2014 -0700

    FS RT #27208 - adding Mobile phone to FS::ConfDefaults::cust_fields_avail and related FS::UI::Web::cust_header / ::cust_sql_fields

diff --git a/FS/FS/ConfDefaults.pm b/FS/FS/ConfDefaults.pm
index df8024a..c20a9c9 100644
--- a/FS/FS/ConfDefaults.pm
+++ b/FS/FS/ConfDefaults.pm
@@ -33,8 +33,10 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Customer' =>
     'custnum | Status | Last, First or Company (Last, First)',
 
-  'Cust# | Day phone | Night phone | Fax number' =>
-    'custnum | (all phones)',
+  'Cust. Status | Day phone | Night phone | Mobile phone | Fax number' =>
+    'Status | (all phones)',
+  'Cust# | Cust. Status | Day phone | Night phone | Mobile phone | Fax number' =>
+    'custnum | Status | (all phones)',
 
   'Cust. Status | Name | Company' =>
     'Status | Last, First | Company',
@@ -51,22 +53,22 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Name | Company' =>
     'custnum | Status | Last, First | Company',
 
-  'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Invoicing email(s)' => 
-    'custnum | Status | Last, First | Company | (address) | Day phone | Night phone | Invoicing email(s)',
+  'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Mobile phone | Fax number | Invoicing email(s)' =>
+    'custnum | Status | Last, First | Company | (address) | (all phones) | Invoicing email(s)',
 
-  'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type' => 
+  'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Mobile phone | Fax number | Invoicing email(s) | Payment Type' =>
     'custnum | Status | Last, First | Company | (address) | (all phones) | Invoicing email(s) | Payment Type',
 
-  'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type | Current Balance' => 
+  'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Mobile phone | Fax number | Invoicing email(s) | Payment Type | Current Balance' =>
     'custnum | Status | Last, First | Company | (address) | (all phones) | Invoicing email(s) | Payment Type | Current Balance',
 
-  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Day phone | Night phone | Invoicing email(s)' => 
-    'custnum | Status | Last, First | Company | (address) | Day phone | Night phone | (service address) | Invoicing email(s)',
+  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Mobile phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Invoicing email(s)' =>
+    'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s)',
 
-  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Invoicing email(s) | Payment Type' => 
+  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Mobile phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Invoicing email(s) | Payment Type' =>
     'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s) | Payment Type',
 
-  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type | Current Balance' => 
+  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Mobile phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Invoicing email(s) | Payment Type | Current Balance' =>
     'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s) | Payment Type | Current Balance',
 
   'Invoicing email(s)' => 'Invoicing email(s)',
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index f182e42..fba4a45 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -250,6 +250,7 @@ sub cust_header {
     'Country'                  => 'bill_country_full',
     'Day phone'                => 'daytime', # XXX should use msgcat, but how?
     'Night phone'              => 'night',   # XXX should use msgcat, but how?
+    'Mobile phone'             => 'mobile',  # XXX should use msgcat, but how?
     'Fax number'               => 'fax',
     '(bill) Address 1'         => 'bill_address1',
     '(bill) Address 2'         => 'bill_address2',
@@ -363,7 +364,7 @@ sub cust_sql_fields {
     }
   }
 
-  foreach my $field (qw(daytime night fax payby)) {
+  foreach my $field (qw(daytime night mobile fax payby)) {
     push @fields, $field if (grep { $_ eq $field } @cust_fields);
   }
   push @fields, 'agent_custid';

commit a32c436ae3a0c40b71698547d1abe2a2c89b3f8c
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Tue Sep 9 17:18:41 2014 -0700

    calling FS::UI::Web::cust_sql_fields() with ->param('cust_fields'); reduced number of calls to FS::UI::Web::cust_header() by 3 in this component

diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html
index ce12402..ddde23a 100644
--- a/httemplate/search/elements/cust_main_dayranges.html
+++ b/httemplate/search/elements/cust_main_dayranges.html
@@ -19,8 +19,8 @@ Example:
                  'name'        => 'customers',
                  'query'       => $sql_query,
                  'count_query' => $count_sql,
-                 'header'      => [ 
-                                    FS::UI::Web::cust_header($cgi->param('cust_fields')),
+                 'header'      => [
+                                    @cust_header,
                                     '0-30',
                                     '30-60',
                                     '60-90',
@@ -30,12 +30,7 @@ Example:
                                   ],
                  'footer'      => [
                                     'Total',
-                                    ( map '',
-                                          ( 1 .. 
-                                            scalar(FS::UI::Web::cust_header($cgi->param('cust_fields'))-1)
-                                          ),
-                                    ),
-                                    
+                                    ( map '',( 1 .. $#cust_header ),),
                                     sprintf( $money_char.'%.2f',
                                              $row->{'rangecol_0_30'} ),
                                     sprintf( $money_char.'%.2f',
@@ -59,7 +54,7 @@ Example:
                                   ],
                  'links'       => [
                                     ( map { $_ ne 'Cust. Status' ? $clink : '' }
-                                          FS::UI::Web::cust_header($cgi->param('cust_fields'))
+                                          @cust_header
                                     ),
                                     '',
                                     '',
@@ -71,7 +66,7 @@ Example:
                  'align'       => FS::UI::Web::cust_aligns(). 
                                    'rrrrr'.
                                   ('c' x @pay_labels),
-                 'size'        => [ ( map '', FS::UI::Web::cust_header($cgi->param('cust_fields')) ),
+                 'size'        => [ ( map '', @cust_header ),
                                     #'-1', '', '', '', '',  '', ],
                                     '', '', '', '', '',  '', 
                                     ( map '', @pay_labels ),
@@ -98,7 +93,7 @@ Example:
 &>
 <%init>
 
-my @cust_field = FS::UI::Web::cust_header($cgi->param('cust_fields'));
+my @cust_header = FS::UI::Web::cust_header($cgi->param('cust_fields'));
 my %opt = @_;
 
 #actually need to auto-generate other things too for a passed-in ranges to work
@@ -192,7 +187,7 @@ my $sql_query = {
                    'cust_main.custnum',
                    $range_cols,
                    $packages_cols,
-                   FS::UI::Web::cust_sql_fields(),
+                   FS::UI::Web::cust_sql_fields($cgi->param('cust_fields')),
                    'payby',
                  ),
   'extra_sql' => $where,

commit a52d6f02a276f3e5ff14b1b017923556cde3a6e3
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Tue Sep 9 16:53:13 2014 -0700

    repaired a compile error I caused in cust_main_dayranges.html

diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html
index e78f2a4..ce12402 100644
--- a/httemplate/search/elements/cust_main_dayranges.html
+++ b/httemplate/search/elements/cust_main_dayranges.html
@@ -15,13 +15,12 @@ Example:
   };
 
 </%doc>
-
 <& search.html,
                  'name'        => 'customers',
                  'query'       => $sql_query,
                  'count_query' => $count_sql,
-                 'header'      => [
-				    @cust_header = FS::UI::Web::cust_header($cgi->param('cust_fields')),
+                 'header'      => [ 
+                                    FS::UI::Web::cust_header($cgi->param('cust_fields')),
                                     '0-30',
                                     '30-60',
                                     '60-90',
@@ -31,8 +30,12 @@ Example:
                                   ],
                  'footer'      => [
                                     'Total',
-                                    ( map '', ( 1 .. $#cust_header ) ),
-
+                                    ( map '',
+                                          ( 1 .. 
+                                            scalar(FS::UI::Web::cust_header($cgi->param('cust_fields'))-1)
+                                          ),
+                                    ),
+                                    
                                     sprintf( $money_char.'%.2f',
                                              $row->{'rangecol_0_30'} ),
                                     sprintf( $money_char.'%.2f',
@@ -55,7 +58,9 @@ Example:
                                     @pay_labels,
                                   ],
                  'links'       => [
-                                    ( map { $_ ne 'Cust. Status' ? $clink : '' } @cust_header) ),
+                                    ( map { $_ ne 'Cust. Status' ? $clink : '' }
+                                          FS::UI::Web::cust_header($cgi->param('cust_fields'))
+                                    ),
                                     '',
                                     '',
                                     '',
@@ -63,10 +68,10 @@ Example:
                                     '',
                                     @pay_links,
                                   ],
-                 'align'       => FS::UI::Web::cust_aligns().
+                 'align'       => FS::UI::Web::cust_aligns(). 
                                    'rrrrr'.
                                   ('c' x @pay_labels),
-                 'size'        => [ ( map '', @cust_header ) ),
+                 'size'        => [ ( map '', FS::UI::Web::cust_header($cgi->param('cust_fields')) ),
                                     #'-1', '', '', '', '',  '', ],
                                     '', '', '', '', '',  '', 
                                     ( map '', @pay_labels ),
@@ -93,8 +98,8 @@ Example:
 &>
 <%init>
 
+my @cust_field = FS::UI::Web::cust_header($cgi->param('cust_fields'));
 my %opt = @_;
-my @cust_header = ();
 
 #actually need to auto-generate other things too for a passed-in ranges to work
 my $ranges = $opt{'ranges'} ? delete($opt{'ranges'}) : [

commit 47697b2c3988393de996dca3889a24c480c586b5
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Tue Sep 9 13:16:21 2014 -0700

    have expanded the AR aging summary to include other fields.  Have not yet populated the fields.  FS RT #27208

diff --git a/FS/FS/ConfDefaults.pm b/FS/FS/ConfDefaults.pm
index 191ff85..df8024a 100644
--- a/FS/FS/ConfDefaults.pm
+++ b/FS/FS/ConfDefaults.pm
@@ -33,6 +33,9 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Customer' =>
     'custnum | Status | Last, First or Company (Last, First)',
 
+  'Cust# | Day phone | Night phone | Fax number' =>
+    'custnum | (all phones)',
+
   'Cust. Status | Name | Company' =>
     'Status | Last, First | Company',
   'Cust# | Cust. Status | Name | Company' =>
diff --git a/httemplate/elements/select-cust-fields.html b/httemplate/elements/select-cust-fields.html
index 98feaf8..5e30638 100644
--- a/httemplate/elements/select-cust-fields.html
+++ b/httemplate/elements/select-cust-fields.html
@@ -1,22 +1,18 @@
-%
-%  my( $cust_fields, %opt ) = @_;
-%
-%  use FS::ConfDefaults;
-%  $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ];
-%
-%  tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} };
-%
-%
+<%init>
+  my( $cust_fields, %opt ) = @_;
 
+  use FS::ConfDefaults;
+  $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ];
+
+  tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} };
+</%init>
 
 <SELECT NAME="cust_fields">
 
   <OPTION VALUE="">(configured default)
-% 
-%     foreach my $value ( keys %hash ) { 
-
 
-       <OPTION VALUE="<% $value %>"><% $hash{$value} %>
+% foreach my $value ( keys %hash ) { 
+  <OPTION VALUE="<% $value %>"><% $hash{$value} %>
 % } 
 
 
diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html
index 4933652..e78f2a4 100644
--- a/httemplate/search/elements/cust_main_dayranges.html
+++ b/httemplate/search/elements/cust_main_dayranges.html
@@ -15,12 +15,13 @@ Example:
   };
 
 </%doc>
+
 <& search.html,
                  'name'        => 'customers',
                  'query'       => $sql_query,
                  'count_query' => $count_sql,
-                 'header'      => [ 
-                                    FS::UI::Web::cust_header(),
+                 'header'      => [
+				    @cust_header = FS::UI::Web::cust_header($cgi->param('cust_fields')),
                                     '0-30',
                                     '30-60',
                                     '60-90',
@@ -30,12 +31,8 @@ Example:
                                   ],
                  'footer'      => [
                                     'Total',
-                                    ( map '',
-                                          ( 1 .. 
-                                            scalar(FS::UI::Web::cust_header()-1)
-                                          ),
-                                    ),
-                                    
+                                    ( map '', ( 1 .. $#cust_header ) ),
+
                                     sprintf( $money_char.'%.2f',
                                              $row->{'rangecol_0_30'} ),
                                     sprintf( $money_char.'%.2f',
@@ -58,9 +55,7 @@ Example:
                                     @pay_labels,
                                   ],
                  'links'       => [
-                                    ( map { $_ ne 'Cust. Status' ? $clink : '' }
-                                          FS::UI::Web::cust_header()
-                                    ),
+                                    ( map { $_ ne 'Cust. Status' ? $clink : '' } @cust_header) ),
                                     '',
                                     '',
                                     '',
@@ -68,10 +63,10 @@ Example:
                                     '',
                                     @pay_links,
                                   ],
-                 'align'       => FS::UI::Web::cust_aligns(). 
+                 'align'       => FS::UI::Web::cust_aligns().
                                    'rrrrr'.
                                   ('c' x @pay_labels),
-                 'size'        => [ ( map '', FS::UI::Web::cust_header() ),
+                 'size'        => [ ( map '', @cust_header ) ),
                                     #'-1', '', '', '', '',  '', ],
                                     '', '', '', '', '',  '', 
                                     ( map '', @pay_labels ),
@@ -99,6 +94,7 @@ Example:
 <%init>
 
 my %opt = @_;
+my @cust_header = ();
 
 #actually need to auto-generate other things too for a passed-in ranges to work
 my $ranges = $opt{'ranges'} ? delete($opt{'ranges'}) : [
diff --git a/httemplate/search/report_receivables.html b/httemplate/search/report_receivables.html
index 854b24a..20a98be 100755
--- a/httemplate/search/report_receivables.html
+++ b/httemplate/search/report_receivables.html
@@ -65,6 +65,15 @@ function toggle(obj) {
                 } 
   &>
 
+  <TR>
+    <TH CLASS="background" COLSPAN=2> </TH>
+  </TR>
+
+  <TR>
+    <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
+  </TR>
+  <& /elements/tr-select-cust-fields.html &>
+
 </TABLE>
 
 <BR><INPUT TYPE="submit" VALUE="Get Report">

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

Summary of changes:
 FS/FS/ConfDefaults.pm                              |   21 ++++++++++++-------
 FS/FS/UI/Web.pm                                    |    8 ++++---
 httemplate/elements/select-cust-fields.html        |   22 ++++++++------------
 .../search/elements/cust_main_dayranges.html       |   16 ++++++--------
 httemplate/search/report_receivables.html          |    9 ++++++++
 5 files changed, 42 insertions(+), 34 deletions(-)




More information about the freeside-commits mailing list