[freeside-commits] branch rt74031_svc_realestate updated. a1b4b7b7c6d43687acf4b2538d24ab46f46aad83

Mitch Jackson mitch at freeside.biz
Mon Jan 8 19:36:12 PST 2018


The branch, rt74031_svc_realestate has been updated
       via  a1b4b7b7c6d43687acf4b2538d24ab46f46aad83 (commit)
       via  f778bc6bc2dac6380f32dd694480508fa071f200 (commit)
       via  785a50be3011b76a5dea45003d85dd5f5eec00ce (commit)
       via  94772a0160c6060d7c4ec4211ea22ef54c0400f0 (commit)
       via  da761caaf86625a17ac1ada65c5de2a66676bed3 (commit)
       via  856c15aef58e4a4574b15b5a1d4ba7a893883c3f (commit)
       via  15c8ee2f20ee09f1210c484c6393ddb7d603dd3b (commit)
       via  30e0dbd4f76ec2a9040ea3619501c59cb19fba1d (commit)
       via  36e1d1842617b301b5de9e2aa6acdd08f9d3cbf7 (commit)
       via  0b305da7f525d3521563bb38e394caaa90d8a0a0 (commit)
       via  6cfb6bddfabbaff2b7088a458404bd4ff7039e3f (commit)
       via  8ae6cc966366a9b97dfb0262307a83ad59120ed2 (commit)
      from  efa77ef0e8309528eb3b613a5b28d173f765b6c3 (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 a1b4b7b7c6d43687acf4b2538d24ab46f46aad83
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Mon Jan 8 16:09:13 2018 -0600

    rt# 74031 work in progress
    
    - fix error naming svcnum column in svc_realestate.pm

diff --git a/FS/FS/svc_realestate.pm b/FS/FS/svc_realestate.pm
index 657982193..7c1fba873 100644
--- a/FS/FS/svc_realestate.pm
+++ b/FS/FS/svc_realestate.pm
@@ -46,7 +46,7 @@ Instantiates a new svc_realestate object.
 
 sub table_info {
   tie my %fields, 'Tie::IxHash',
-    svc_num     => 'Service',
+    svcnum      => 'Service',
     description => 'Descriptive label',
     property    => 'Real estate property';
 

commit f778bc6bc2dac6380f32dd694480508fa071f200
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Mon Jan 8 15:17:11 2018 -0600

    rt# 74031 work in progress
    
    - Add pkgnum to realestate_unit table to link customer's package
      to a realestate unit
    - Display "provision real estate unit" on customer's package screen,
      and show select boxes for units

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index f2817f5cb..e4e6a8488 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -7639,9 +7639,10 @@ sub tables_hashref {
     'realestate_unit' => {
       'columns' => [
         'realestatenum',    'serial',  '',     '',      '',  '',
-        'realestatelocnum', 'int',     '',     '',      '',   '',
+        'realestatelocnum', 'int',     '',     '',      '',  '',
         'agentnum',         'int',     'NULL', '',      '',  '',
         'custnum',          'int',     'NULL', '',      '',  '',
+        'pkgnum',           'int',     'NULL', '',      '',  '',
         'unit_title',       'varchar', '',     $char_d, '',  '',
         'disabled',         'char',    'NULL', 1,       '',  '',
       ],
@@ -7652,7 +7653,8 @@ sub tables_hashref {
         ['custnum'],
         ['realestatelocnum'],
         ['disabled'],
-        ['unit_title']
+        ['unit_title'],
+        ['pkgnum',]
       ],
       'foreign_keys' => [
         {columns => ['agentnum'], table => 'agent'},
diff --git a/FS/FS/svc_realestate.pm b/FS/FS/svc_realestate.pm
index 27012d047..657982193 100644
--- a/FS/FS/svc_realestate.pm
+++ b/FS/FS/svc_realestate.pm
@@ -6,6 +6,7 @@ use warnings;
 use vars qw($conf);
 
 use FS::Record qw(qsearchs qsearch dbh);
+use Tie::IxHash;
 
 $FS::UID::callback{'FS::svc_realestate'} = sub {
   $conf = new FS::Conf;
@@ -43,21 +44,27 @@ Instantiates a new svc_realestate object.
 
 =cut
 
-sub table_info {{
-  name => 'Real estate',
-  name_plural => 'Real estate services',
-  longname_plural => 'Real estate services',
-  display_weight => 100,
-  cancel_weight => 100,
-  fields => {
-    svcnum => 'Service',
+sub table_info {
+  tie my %fields, 'Tie::IxHash',
+    svc_num     => 'Service',
     description => 'Descriptive label',
-    property => 'Real estate property',
-  },
-}}
+    property    => 'Real estate property';
+
+  {
+    name            => 'Real estate',
+    name_plural     => 'Real estate services',
+    longname_plural => 'Real estate services',
+    display_weight  => 100,
+    cancel_weight   => 100,
+    fields          => \%fields,
+  };
+}
 
 sub table {'svc_realestate'};
 
+# todo- In what context is this called? Mimic stub behavior w/o the warning
+sub label { $_[0]->svcnum }
+
 =item search_sql
 
 I have an unfounded suspicion this method serves no purpose in this context
diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html
index a4e345e40..33d1c758f 100644
--- a/httemplate/edit/elements/svc_Common.html
+++ b/httemplate/edit/elements/svc_Common.html
@@ -167,7 +167,9 @@
                      $f->{options} = [ split( /\s*,\s*/,
                                                 $columndef->columnvalue)
                                      ];
-                   } # shouldn't this be enforced for all 'S' fields?
+                   } elsif ( $flag eq 'R' ) { # Real Estate Unit Inventory
+                     $f->{type} = 'select-realestate_unit';
+                   }
 
                    if ( $f->{'type'} =~ /^select-svc/ )
                    {
diff --git a/httemplate/elements/tr-select-realestate_unit.html b/httemplate/elements/tr-select-realestate_unit.html
new file mode 100644
index 000000000..00c568eea
--- /dev/null
+++ b/httemplate/elements/tr-select-realestate_unit.html
@@ -0,0 +1,40 @@
+<%doc>
+
+Display a pair of select boxes for provisioning a realestate_unit
+- Real Estate Location
+- Real Estate Unit
+
+</%doc>
+<& tr-td-label.html, %opt &>
+<td>
+<& select-tiered.html,
+  'tiers' => [
+    {
+      # (todo) need to filter out locations where all units are assigned
+      field         => 'realestate_location',
+      table         => 'realestate_location',
+      #extra_sql     => "WHERE $classnum_sql",
+      name_col      => 'location_title',
+      empty_label   => '(all)',
+    },
+    {
+      field         => 'realestate_unit',
+      table         => 'realestate_unit',
+      name_col      => 'unit_title',
+      value_col     => 'realestatenum',
+      link_col      => 'realestatelocnum',
+      #extra_sql     => delete($opt{'extra_sql'}),
+      # Need to add a filter to filter-out assigned units (todo)
+      disable_empty => 1,
+    },
+  ],
+  %opt,
+  'prefix' => $opt{'prefix'}. $opt{'field'}. '_', #after %opt so it overrides
+&>
+</td>
+</tr>
+<%init>
+
+my %opt = @_;
+
+</%init>

commit 785a50be3011b76a5dea45003d85dd5f5eec00ce
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Jan 3 14:09:38 2018 -0500

    RT# 34134 - fixed error where payment amount field is hidden in self service.

diff --git a/httemplate/elements/tr-amount_fee.html b/httemplate/elements/tr-amount_fee.html
index 426957a80..9c13f5952 100644
--- a/httemplate/elements/tr-amount_fee.html
+++ b/httemplate/elements/tr-amount_fee.html
@@ -1,4 +1,4 @@
-  <TR ID="payment_amount_row" STYLE="display:none;">
+  <TR ID="payment_amount_row" <% $opt{'row_style'} %>>
     <TH ALIGN="right"><% mt('Payment amount') |h %></TH>
     <TD COLSPAN=7>
       <TABLE><TR><TD BGCOLOR="#ffffff">
diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html
index 3c50e88d8..2304c22d0 100644
--- a/httemplate/elements/tr-select-payment_options.html
+++ b/httemplate/elements/tr-select-payment_options.html
@@ -44,6 +44,7 @@ Example:
   &>
 
   <& /elements/tr-amount_fee.html,
+       'row_style'  => 'STYLE="display:none;"',
        %opt
   &>
 

commit 94772a0160c6060d7c4ec4211ea22ef54c0400f0
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Jan 3 10:43:28 2018 -0500

    RT# 34134 - added documentation for new feature

diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html
index 70923b633..3728d348d 100644
--- a/httemplate/elements/tr-select-invoice.html
+++ b/httemplate/elements/tr-select-invoice.html
@@ -1,3 +1,15 @@
+<%doc>
+
+Example:
+
+  include( '/elements/tr-select-invoice.html',
+
+    #opt - most get used in /elements/tr-amount-fee
+    'custnum'              => 4,     # customer number,
+    'prefix'               => 'pre', # prefix to fields and row ID's
+  )
+
+</%doc>
 
   <TR ID="invoice_row" STYLE="display:none;">
     <TH ALIGN="right"><% mt('Open invoices') |h %></TH>
@@ -6,7 +18,6 @@
   	  ID       = "<% $opt{prefix} %>invoice"
   	  NAME     = "<% $opt{prefix} %>invoice"
   	  onChange = "<% $opt{prefix} %>invoice_select_changed(this)"
-  	  <% $opt{disabled} %>
 	>
   		<OPTION VALUE="select">Select an invoice to pay</OPTION>
 %         foreach my $record (@records) {
diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html
index 5197c3706..3c50e88d8 100644
--- a/httemplate/elements/tr-select-payment_options.html
+++ b/httemplate/elements/tr-select-payment_options.html
@@ -1,3 +1,25 @@
+<%doc>
+
+Example:
+
+  include( '/elements/tr-select-payment_options.html',
+
+    #opt - most get used in /elements/tr-amount-fee
+    'custnum'              => 4,     # customer number needed for selecting invoices
+    'prefix'               => 'pre', # prefix to fields and row ID's
+    'amount'               => 1,     # payment amount
+    'process-pkgpart'      => scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)),
+    'process-display'      => scalar($conf->config('manual_process-display')),
+    'process-skip_first'   => $conf->exists('manual_process-skip_first'),
+    'num_payments'         => scalar($cust_main->cust_pay),
+    'surcharge_percentage' =>
+      ( $payby eq 'CARD'
+          ? scalar($conf->config('credit-card-surcharge-percentage', $cust_main->agentnum))
+          : 0
+      ),
+  )
+
+</%doc>
 
   <TR STYLE="display:block">
     <TH ALIGN="right"><% mt('Payment options') |h %></TH>
@@ -17,7 +39,8 @@
   </TR>
 
   <& /elements/tr-select-invoice.html,
-       %opt
+       'custnum' => $opt{custnum},
+       'prefix'  => $opt{prefix},
   &>
 
   <& /elements/tr-amount_fee.html,
@@ -31,6 +54,7 @@
         if ( what.value == 'select' ) {
         	document.getElementById('payment_amount_row').style.display = 'none';
         	document.getElementById('invoice_row').style.display = 'none';
+          document.getElementById('<% $opt{prefix} %>invoice').value = 'select';
         	document.getElementById('amount').value = '';
         }
         else if ( what.value == 'invoice' ) {
@@ -41,6 +65,7 @@
         else {
         	document.getElementById('payment_amount_row').style.display = 'block';
         	document.getElementById('invoice_row').style.display = 'none';
+          document.getElementById('<% $opt{prefix} %>invoice').value = 'select';
         	document.getElementById('amount').value = what.value;
         }
 

commit da761caaf86625a17ac1ada65c5de2a66676bed3
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Jan 3 09:49:58 2018 -0500

    RT# 34134 - removed config option manual_process-single_invoice_amount from config and payment page that used it.

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 59f9b69fc..9b891879b 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2753,13 +2753,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'manual_process-single_invoice_amount',
-    'section'     => 'payments',
-    'description' => 'When entering manual credit card and ACH payments, amount will not autofill if the customer has more than one open invoice',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'manual_process-pkgpart',
     'section'     => 'payments',
     'description' => 'Package to add to each manual credit card and ACH payment entered by employees from the backend.  WARNING: Although recently permitted to US merchants in general, specific consumer protection laws may prohibit or restrict this practice in California, Colorado, Connecticut, Florda, Kansas, Maine, Massachusetts, New York, Oklahome, and Texas. Surcharging is also generally prohibited in most countries outside the US, AU and UK.',
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index 7bf1713ff..5bfa29d70 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -14,7 +14,7 @@
 
   <& /elements/tr-select-payment_options.html,
        'custnum'            => $cust_main->custnum,
-       'amount'             => $amount,
+       'amount'             => $balance,
        'process-pkgpart'    => 
           scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)),
        'process-display'    => scalar($conf->config('manual_process-display')),
@@ -357,15 +357,6 @@ my %states = map { $_->state => 1 }
                } );
 my @states = sort { $a cmp $b } keys %states;
 
-my $amount = '';
-if ( $balance > 0 ) {
-  # when configured to do so, amount will only auto-fill with balance
-  # if balance represents a single invoice
-  $amount = $balance
-    unless $conf->exists('manual_process-single_invoice_amount')
-      && ($cust_main->open_cust_bill != 1);
-}
-
 my $payunique = "webui-payment-". time. "-$$-". rand() * 2**32;
 
 </%init>

commit 856c15aef58e4a4574b15b5a1d4ba7a893883c3f
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Jan 2 19:52:46 2018 -0500

    RT# 34134 - added open invoices selection when selecting pay specific invoice

diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html
index 03625b659..70923b633 100644
--- a/httemplate/elements/tr-select-invoice.html
+++ b/httemplate/elements/tr-select-invoice.html
@@ -22,4 +22,11 @@
 
 my %opt = @_;
 
+my @records = qsearch( {
+    'select'    => '*',
+    'table'     => 'cust_bill',
+    'hashref'   => { 'custnum' => $opt{custnum} },
+    'order_by'  => 'ORDER BY _date',
+});
+
 </%init>

commit 15c8ee2f20ee09f1210c484c6393ddb7d603dd3b
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Jan 2 19:47:44 2018 -0500

    RT# 34134 - removed payment amount field from payment screen, added 3 payment options (pay full balance, pay specific invoice, pay another amount) which will prefill the payment amount field.

diff --git a/httemplate/elements/tr-amount_fee.html b/httemplate/elements/tr-amount_fee.html
index 12488521a..426957a80 100644
--- a/httemplate/elements/tr-amount_fee.html
+++ b/httemplate/elements/tr-amount_fee.html
@@ -1,4 +1,4 @@
-  <TR>
+  <TR ID="payment_amount_row" STYLE="display:none;">
     <TH ALIGN="right"><% mt('Payment amount') |h %></TH>
     <TD COLSPAN=7>
       <TABLE><TR><TD BGCOLOR="#ffffff">
@@ -15,7 +15,7 @@
                                   onKeyPress = "amount_changed(this)"
 %                               }
                          >
-      </TD><TD BGCOLOR="#cccccc">
+      </TD><TD BGCOLOR="<% length($fee) ? '#cccccc' : '#ffffff' %>">
 %        if ( $fee ) {
            <INPUT TYPE="hidden" NAME="fee_pkgpart" VALUE="<% $fee_pkg->pkgpart %>">
            <INPUT TYPE="hidden" NAME="fee" VALUE="<% $fee_display eq 'add' ? $fee : '' %>">
diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html
new file mode 100644
index 000000000..03625b659
--- /dev/null
+++ b/httemplate/elements/tr-select-invoice.html
@@ -0,0 +1,25 @@
+
+  <TR ID="invoice_row" STYLE="display:none;">
+    <TH ALIGN="right"><% mt('Open invoices') |h %></TH>
+    <TD COLSPAN=7>
+     <SELECT
+  	  ID       = "<% $opt{prefix} %>invoice"
+  	  NAME     = "<% $opt{prefix} %>invoice"
+  	  onChange = "<% $opt{prefix} %>invoice_select_changed(this)"
+  	  <% $opt{disabled} %>
+	>
+  		<OPTION VALUE="select">Select an invoice to pay</OPTION>
+%         foreach my $record (@records) {
+%            my $read_date = time2str("%b %o, %Y", $record->_date);
+            <OPTION VALUE="<% $record->charged %>"><% $record->invnum %> (<% $read_date %>) - <% $record->charged %></OPTION>	
+%         }
+
+	</SELECT>	
+    </TD>
+  </TR>
+
+<%init>
+
+my %opt = @_;
+
+</%init>
diff --git a/httemplate/elements/tr-select-payment_options.html b/httemplate/elements/tr-select-payment_options.html
new file mode 100644
index 000000000..5197c3706
--- /dev/null
+++ b/httemplate/elements/tr-select-payment_options.html
@@ -0,0 +1,68 @@
+
+  <TR STYLE="display:block">
+    <TH ALIGN="right"><% mt('Payment options') |h %></TH>
+    <TD COLSPAN=7>
+     <SELECT
+  	  ID       = "<% $opt{prefix} %>payment_option"
+  	  NAME     = "<% $opt{prefix} %>payment_option"
+  	  onChange = "<% $opt{prefix} %>payment_option_changed(this)"
+  	  <% $opt{disabled} %>
+	>
+  		<OPTION VALUE="select">Select payment option</OPTION>
+  		<OPTION VALUE="<% $opt{amount} %>">Pay full balance</OPTION>
+  		<OPTION VALUE="invoice">Pay specific invoice</OPTION>
+  		<OPTION VALUE="">Pay specific amount</OPTION>
+	</SELECT>	
+    </TD>
+  </TR>
+
+  <& /elements/tr-select-invoice.html,
+       %opt
+  &>
+
+  <& /elements/tr-amount_fee.html,
+       %opt
+  &>
+
+  <SCRIPT TYPE="text/javascript">
+
+      function <% $opt{prefix} %>payment_option_changed(what) {
+
+        if ( what.value == 'select' ) {
+        	document.getElementById('payment_amount_row').style.display = 'none';
+        	document.getElementById('invoice_row').style.display = 'none';
+        	document.getElementById('amount').value = '';
+        }
+        else if ( what.value == 'invoice' ) {
+        	document.getElementById('payment_amount_row').style.display = 'none';
+        	document.getElementById('invoice_row').style.display = 'block';
+        	document.getElementById('amount').value = '';
+        }
+        else {
+        	document.getElementById('payment_amount_row').style.display = 'block';
+        	document.getElementById('invoice_row').style.display = 'none';
+        	document.getElementById('amount').value = what.value;
+        }
+
+      }
+
+      function <% $opt{prefix} %>invoice_select_changed(what) {
+
+        if ( what.value == 'select' ) {
+        	document.getElementById('payment_amount_row').style.display = 'none';
+        	document.getElementById('amount').value = '';
+        }
+        else {
+        	document.getElementById('payment_amount_row').style.display = 'block';
+        	document.getElementById('amount').value = what.value;
+        }
+
+      }
+
+</SCRIPT>
+
+<%init>
+
+my %opt = @_;
+
+</%init>
\ No newline at end of file
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index 35f57e8d6..7bf1713ff 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -12,7 +12,8 @@
 
 <TABLE class="fsinnerbox">
 
-  <& /elements/tr-amount_fee.html,
+  <& /elements/tr-select-payment_options.html,
+       'custnum'            => $cust_main->custnum,
        'amount'             => $amount,
        'process-pkgpart'    => 
           scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)),

commit 30e0dbd4f76ec2a9040ea3619501c59cb19fba1d
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Dec 21 18:16:33 2017 -0500

    RT# 76878 - Fixed installer checkbox to be sticky on error.

diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 25568745d..113f611e1 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -871,7 +871,9 @@ my $pkey = dbdef->table($table)->primary_key; #? $opt{'primary_key'} ||
 my $fields = $opt{'fields'}
              #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ];
              || [ grep { $_ ne $pkey } fields($table) ];
-#my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+
+push @actualfields, $pkey;
 
 my $js_form_validate = {};
 
@@ -914,7 +916,7 @@ if ( $opt{'embed'} ) {
     $mode = 'error';
 
     $object = $class->new( {
-      map { $_ => scalar($cgi->param($_)) } fields($table)
+      map { $_ => scalar($cgi->param($_)) } @actualfields
     });
 
     &{$opt{'error_callback'}}( $cgi, $object, $fields, \%opt )

commit 36e1d1842617b301b5de9e2aa6acdd08f9d3cbf7
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Dec 21 12:31:40 2017 -0500

    RT# 29974 - Added ability to show invoice_pay_by_message on total new charges line rather than balance due line

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 7d92d21af..b9f3e9274 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1955,6 +1955,23 @@ sub due_date2str {
   $self->due_date ? $self->time2str_local(shift, $self->due_date) : '';
 }
 
+=item invoice_pay_by_msg
+
+  displays the invoice_pay_by_msg or default Please pay by [_1] if empty.
+
+=cut
+
+sub invoice_pay_by_msg {
+  my $self = shift;
+  my $msg = '';
+  my $please_pay_by =
+        $self->conf->config('invoice_pay_by_msg', $self->agentnum)
+        || 'Please pay by [_1]';
+  $msg .= ' - ' . $self->mt($please_pay_by, $self->due_date2str('short')) . ' ';
+
+  $msg;
+}
+
 =item balance_due_msg
 
 =cut
@@ -1969,11 +1986,7 @@ sub balance_due_msg {
     # _items_total) and not here
     # (yes, or if invoice_sections is enabled; this is just for compatibility)
     if ( $self->due_date ) {
-      my $please_pay_by =
-        $self->conf->config('invoice_pay_by_msg', $self->agentnum)
-        || 'Please pay by [_1]';
-      $msg .= ' - ' . $self->mt($please_pay_by, $self->due_date2str('short')).
-              ' '
+      $msg .= $self->invoice_pay_by_msg
        unless $self->conf->config_bool('invoice_omit_due_date',$self->agentnum);
     } elsif ( $self->terms ) {
       $msg .= ' - '. $self->mt($self->terms);
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 5ae4f3686..8b94dcc87 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -3450,17 +3450,12 @@ sub _items_total {
     $total_descr = $self->mt('Total Charges');
   }
 
-  if ( $conf->exists('invoice_show_prior_due_date') ) {
+  if ( $conf->exists('invoice_show_prior_due_date') && !$conf->exists('invoice_omit_due_date') ) {
     # then the due date should be shown with Total New Charges,
     # and should NOT be shown with the Balance Due message.
 
     if ( $self->due_date ) {
-      $total_descr = join(' ',
-        $total_descr,
-        '-',
-        $self->mt('Please pay by'),
-        $self->due_date2str('short')
-      );
+      $total_descr .= $self->invoice_pay_by_msg;
     } elsif ( $self->terms ) {
       $total_descr = join(' ',
         $total_descr,

commit 0b305da7f525d3521563bb38e394caaa90d8a0a0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 20 12:47:42 2017 -0800

    added -f flag to continue voiding even if an error is received, RT#78977

diff --git a/bin/bulk_void b/bin/bulk_void
index f31eea5cd..5da7d15f6 100755
--- a/bin/bulk_void
+++ b/bin/bulk_void
@@ -8,7 +8,7 @@ use File::Slurp;
 use FS::Misc::Getopt;
 use FS::Record qw(qsearch qsearchs dbh);
 
-getopts('cpiXr:t:u:vk:');
+getopts('cpiXr:t:u:vk:f');
 
 my $dbh = dbh;
 $FS::UID::AutoCommit = 0;
@@ -29,6 +29,7 @@ sub usage() {
 -u: specifies a filename of customer numbers - only void for those customers
 -k: skip invoices with only this pkgpart
 -t: only void payments with this payby
+-f: force - continue voiding invoices even if some have errors
 -v: verbose - show more detail
 -X: commit changes
 ";
@@ -95,7 +96,7 @@ foreach my $k (keys %tables) {
       $error = "$table #" . $record->get($record->primary_key) . ": $error";
       print "$error\n";
       $error_count++;
-      if ( $opt{X} ) {
+      if ( $opt{X} && ! $opt{f} ) {
         $dbh->rollback;
         exit(1);
       }

commit 6cfb6bddfabbaff2b7088a458404bd4ff7039e3f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 20 11:33:00 2017 -0800

    add -k skip_pkgpart, RT#79001

diff --git a/bin/bulk_void b/bin/bulk_void
index 01fa3fe4b..f31eea5cd 100755
--- a/bin/bulk_void
+++ b/bin/bulk_void
@@ -8,7 +8,7 @@ use File::Slurp;
 use FS::Misc::Getopt;
 use FS::Record qw(qsearch qsearchs dbh);
 
-getopts('cpiXr:t:u:v');
+getopts('cpiXr:t:u:vk:');
 
 my $dbh = dbh;
 $FS::UID::AutoCommit = 0;

commit 8ae6cc966366a9b97dfb0262307a83ad59120ed2
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Dec 20 11:26:37 2017 -0500

    RT# 71364 - Added group total to top of payment report

diff --git a/httemplate/search/elements/grouped-search/html b/httemplate/search/elements/grouped-search/html
index c1fd9bd5e..ae8086512 100644
--- a/httemplate/search/elements/grouped-search/html
+++ b/httemplate/search/elements/grouped-search/html
@@ -90,6 +90,8 @@ if ($group_info->{num} > 1) {
 #  }
 #}
 
+my $conf = FS::Conf->new;
+my $money = $conf->config('money_char') || '$';
 </%init>
 
 <& /elements/header.html, $opt{title} &>
@@ -107,7 +109,7 @@ if ($group_info->{num} > 1) {
 
 <DIV CLASS="fstabcontainer">
 % if ( $group->num_rows > 0 ) {
-<P><% emt('[quant,_1,_2]', $group->num_rows, $opt{name_singular}) %>
+<P><% emt('[quant,_1,_2]', $group->num_rows, $opt{name_singular}) %> for <% emt($money.$group->paid) %>
 </P>
 %# download links
 <P><% emt('Download results:') %>

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

Summary of changes:
 FS/FS/Conf.pm                                      |  7 --
 FS/FS/Schema.pm                                    |  6 +-
 FS/FS/Template_Mixin.pm                            | 23 ++++--
 FS/FS/cust_bill.pm                                 |  9 +--
 FS/FS/svc_realestate.pm                            | 29 ++++---
 bin/bulk_void                                      |  5 +-
 httemplate/edit/elements/edit.html                 |  6 +-
 httemplate/edit/elements/svc_Common.html           |  4 +-
 httemplate/elements/tr-amount_fee.html             |  4 +-
 httemplate/elements/tr-select-invoice.html         | 43 ++++++++++
 httemplate/elements/tr-select-payment_options.html | 94 ++++++++++++++++++++++
 httemplate/elements/tr-select-realestate_unit.html | 40 +++++++++
 httemplate/misc/payment.cgi                        | 14 +---
 httemplate/search/elements/grouped-search/html     |  4 +-
 14 files changed, 237 insertions(+), 51 deletions(-)
 create mode 100644 httemplate/elements/tr-select-invoice.html
 create mode 100644 httemplate/elements/tr-select-payment_options.html
 create mode 100644 httemplate/elements/tr-select-realestate_unit.html




More information about the freeside-commits mailing list