Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Thu, 11 Jan 2018 06:46:31 +0000 (22:46 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 11 Jan 2018 06:46:31 +0000 (22:46 -0800)
FS/FS/part_pkg/voip_inbound.pm
FS/FS/svc_phone.pm
FS/bin/freeside-upgrade
README
httemplate/edit/elements/edit.html
httemplate/elements/tr-select-from_to.html
httemplate/view/cust_main/notes/email.html

index e9ab1f7..efaf586 100644 (file)
@@ -120,6 +120,10 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
                            'type' => 'checkbox',
                          },
 
+    'bill_only_pkg_dates' => { 'name' => 'Only bill CDRs with a date during the package billing period',
+                               'type' => 'checkbox',
+                             },
+
     #XXX also have option for an external db
 #    'cdr_location' => { 'name' => 'CDR database location'
 #                        'type' => 'select',
@@ -160,6 +164,7 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
                        use_duration
                        output_format usage_mandate summarize_usage usage_section
                        bill_every_call
+                       bill_only_pkg_dates
                      )
                   ],
   'weight' => 42,
@@ -236,12 +241,18 @@ sub calc_usage {
   ) {
     my $svc_phone = $cust_svc->svc_x;
 
-    my $cdr_search = $svc_phone->psearch_cdrs(
+    my %options = (
       'inbound'        => 1,
       'default_prefix' => $self->option('default_prefix'),
       'status'         => '', # unprocessed only
       'for_update'     => 1,
     );
+    if ( $self->option('bill_only_pkg_dates') ) {
+      $options{'begin'} = $last_bill;
+      $options{'end'}   = $$sdate;
+    }
+
+    my $cdr_search = $svc_phone->psearch_cdrs(%options);
     $cdr_search->limit(1000);
     $cdr_search->increment(0);
     while ( my $cdr = $cdr_search->fetch ) {
index c2250c1..637c148 100644 (file)
@@ -813,7 +813,7 @@ sub phone_name_or_cust {
   }
   my $cust_pkg = $self->cust_svc->cust_pkg or return '';
   if ( $cust_pkg->contactnum ) {
-    return $cust_pkg->contact->firstlast;
+    return $cust_pkg->contact_obj->firstlast;
   } else {
     return $cust_pkg->cust_main->name_short;
   }
index c5ea933..c5df06d 100755 (executable)
@@ -449,8 +449,10 @@ Also performs other upgrade functions:
   [ -v ]: Run verbosely, sending debugging information to STDERR.  This is the
           current default.
 
-  [ -s ]: Schema changes only.  Useful for Pg/slony slaves where the data
-          changes will be replicated from the Pg/slony master.
+  [ -s ]: Schema changes only.  Used to be useful for Pg/slony slaves where the
+          data changes would be replicated from the Pg/slony master (current
+          native Pg replication replicates schema changes to slaves
+          automatically).
 
   [ -r ]: Skip sqlradius updates.  Useful for occassions where the sqlradius
           databases may be inaccessible.
diff --git a/README b/README
index 476b58e..0ddb78a 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 Freeside is a billing and administration package for Internet Service 
 Providers, VoIP providers and other online businesses.
 
-Copyright (C) 2005-2017 Freeside Internet Services, Inc.
+Copyright (C) 2005-2018 Freeside Internet Services, Inc.
 Copyright (C) 2000-2005 Ivan Kohler
 Copyright (C) 1999 Silicon Interactive Software Design
 Additional copyright holders may be found in the docs/license.html file.
index 113f611..8ba703a 100644 (file)
@@ -358,6 +358,7 @@ Example:
 %     #contact
 %     'custnum'     => $f->{'custnum'},
 %     'prospectnum' => $f->{'prospectnum'},
+%
 %   );
 %
 %   $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
@@ -370,7 +371,7 @@ Example:
 %     qw( formatted_value ),                               #fixed
 %     qw( country ),                                       #select-country
 %     qw( width height config ),                           #htmlarea
-%     qw( alt_format ),                                    #select-cust_location
+%     qw( is_optional alt_format ),                        #select-cust_location
 %     qw( classnum ),                                   # select-inventory_item
 %     qw( aligned ),                                    # columnstart
 %     qw( debug ),                                      # select-table
index 1224de6..c242097 100644 (file)
@@ -39,7 +39,7 @@
   my %hash = (
     'show_month_abbr' => 1,
     'start_year'      => '1999',
-    'end_year'        => '2017',
+    'end_year'        => $eyear+3,
      @_,
   );
 </%init>
index 41c5b8a..9e217e4 100644 (file)
@@ -61,7 +61,10 @@ my $cust_main = $opt{'cust_main'}
 my $custnum = $cust_main->custnum;
 
 my $where = "WHERE cust_msg.custnum = $custnum";
-my $maxrecords = $curuser->option('customer_view_emails') || 10;
+my $maxrecords = 10;
+if ( $curuser->option('customer_view_emails') =~ /^\s*(\d+)\s*$/ ) {
+  $maxrecords = $1;
+}
 
 my $order_by = '_date DESC';