[freeside-commits] branch FREESIDE_4_BRANCH updated. 976c302a997ec5437e205baa743e5ac80cf42ee4

Christopher Burger burgerc at freeside.biz
Thu Oct 11 08:08:28 PDT 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  976c302a997ec5437e205baa743e5ac80cf42ee4 (commit)
       via  3bae62d27df9c565e9491b7d06aefa8a55deb7c9 (commit)
      from  9397bcfb83ac646b9beb636f2083f88f4b97ab15 (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 976c302a997ec5437e205baa743e5ac80cf42ee4
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Oct 11 10:14:32 2018 -0400

    RT# 73382 - fixed formatting issue with calendar

diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html
index 457157e6d..12b192e8c 100644
--- a/httemplate/elements/customer-table.html
+++ b/httemplate/elements/customer-table.html
@@ -640,6 +640,7 @@ and probably should be cleaned up more before being used by anything else.
 
       var my_cell = document.createElement('TD');
       my_cell.setAttribute('align', '<% $align{ $opt{align}->[$col] || 'l' } %>');
+      my_cell.style.whiteSpace = 'nowrap';
 %     if ($opt{'color'}->[$col]) {
       my_cell.style.color = '<% $opt{color}->[$col] %>';
 %     }
@@ -667,6 +668,7 @@ and probably should be cleaned up more before being used by anything else.
       my_input_button.setAttribute('title', <% mt('Select date') |js_string %>);
       my_input_button.setAttribute('name', '<% $name %>'+thisrownum+'button');
       my_input_button.setAttribute('id',   '<% $name %>'+thisrownum+'button');
+      my_input_button.style.verticalAlign = 'top';
 %     }
       my_input.value = (values && values.<% $field %>) || '';
 %     if ( $opt{onchange}->[$col] ) {
@@ -732,7 +734,7 @@ and probably should be cleaned up more before being used by anything else.
   <TH>Customer</TH>
   <TH>Balance</TH>
 % foreach my $header ( @{$opt{header}} ) {
-    <TH><% $header %></TH>
+    <TH style="white-space: nowrap"><% $header %></TH>
 % }
 </TR>
 
diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi
index b4580bb4e..0720fdada 100644
--- a/httemplate/misc/process/batch-cust_pay.cgi
+++ b/httemplate/misc/process/batch-cust_pay.cgi
@@ -33,12 +33,14 @@ foreach my $row ( map /^custnum(\d+)$/, keys %$param ) {
   $custnum = $cust_main->custnum if $cust_main;
   # if !$cust_main, then this will throw an error on batch_insert
 
+  my $_date = $param->{"_date$row"} ? parse_datetime($param->{"_date$row"}) : '';
+
   my $cust_pay = new FS::cust_pay {
                     'custnum'        => $custnum,
                     'paid'           => $param->{"paid$row"},
                     'payby'          => 'BILL',
                     'payinfo'        => $param->{"payinfo$row"},
-                    '_date'          => $param->{"_date$row"},
+                    '_date'          => $_date,
                     'discount_term'  => $param->{"discount_term$row"},
                     'paybatch'       => $paybatch,
                     'no_auto_apply'  => exists($param->{"no_auto_apply$row"}) ? 'Y' : '',

commit 3bae62d27df9c565e9491b7d06aefa8a55deb7c9
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Nov 16 21:02:41 2016 -0800

    add date to quick payment entry, RT#73382

diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html
index f0a38889f..457157e6d 100644
--- a/httemplate/elements/customer-table.html
+++ b/httemplate/elements/customer-table.html
@@ -25,7 +25,7 @@ Example:
              'custnum_update_callback' => 'name_of_js_callback' #passed a rownum
 
              #listrefs
-             'types'         => ['immutable', ''], # immutable or ''/text
+             'type'          => ['immutable', ''], # immutable, checkbox, date or ''/text
              'align'         => [ 'c', 'l', 'r', '' ],
              'size'          => [],                # sizes ignored for immutable
              'color'         => [],
@@ -66,7 +66,10 @@ This mason element is currently only used by misc/batch-cust_pay.html,
 and probably should be cleaned up more before being used by anything else.
 
 </%doc>
-
+<LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2">
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript">
 
   var num_open_invoices = new Array;
@@ -658,6 +661,12 @@ and probably should be cleaned up more before being used by anything else.
 %     } elsif ( $types->[$col] eq 'checkbox' ) {
       my_input.setAttribute('type', 'checkbox');
       my_input.checked = (values && values.<% $field %>) ? true : false;
+%     } elsif ( $types->[$col] eq 'date' ) {
+      my_input_button = document.createElement('IMG');
+      my_input_button.setAttribute('src', '<% $fsurl %>images/calendar.png');
+      my_input_button.setAttribute('title', <% mt('Select date') |js_string %>);
+      my_input_button.setAttribute('name', '<% $name %>'+thisrownum+'button');
+      my_input_button.setAttribute('id',   '<% $name %>'+thisrownum+'button');
 %     }
       my_input.value = (values && values.<% $field %>) || '';
 %     if ( $opt{onchange}->[$col] ) {
@@ -668,9 +677,21 @@ and probably should be cleaned up more before being used by anything else.
         my_input.onkeyup    = calc_total<%$col%>;
 %     }
       my_cell.appendChild(my_input);
+%     if ( $types->[$col] eq 'date' ) {
+      my_cell.appendChild(my_input_button);
+%     }
 
     row.appendChild(my_cell);
 
+%     if ( $types->[$col] eq 'date' ) {
+      Calendar.setup({
+        inputField: '<% $name %>'+thisrownum,
+        ifFormat:   "<% $date_format %>",
+        button:     '<% $name %>'+thisrownum+'button',
+        align:      "BR"
+      });
+%     }
+
 %     $col++;
 %   }
 
@@ -811,6 +832,7 @@ addRow();
 
 my(%opt) = @_;
 my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
 
 my $types = $opt{'type'} ? [ @{$opt{'type'}} ] : [];
 my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : [];
diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
index ab76aa7f6..003dc86ac 100644
--- a/httemplate/misc/batch-cust_pay.html
+++ b/httemplate/misc/batch-cust_pay.html
@@ -469,16 +469,16 @@ die "access denied"
 my $conf = new FS::Conf;
 my $money_char = $conf->config('money_char') || '$';
 
-my @header  = ( 'Amount', 'Check #' );
-my @fields  = ( 'paid', 'payinfo' );
-my @types   = ( '', '' );
-my @align   = ( 'r', 'r' );
-my @sizes   = ( 8, 10 );
-my @colors  = ( '', '' );
+my @header  = ( 'Amount', 'Check #', 'Date override' );
+my @fields  = ( 'paid', 'payinfo', '_date' );
+my @types   = ( '', '', 'date', );
+my @align   = ( 'r', 'r', 'r' );
+my @sizes   = ( 8, 10, 8 );
+my @colors  = ( '', '', '' );
 my %param   = ();
-my @footer  = ( '_TOTAL', '' );
-my @footer_align = ( 'r', 'r' );
-my @onchange = ( '', '' );;
+my @footer  = ( '_TOTAL', '', '' );
+my @footer_align = ( 'r', 'r', '' );
+my @onchange = ( '', '', '' );
 my $use_discounts = '';
 
 # Not entirely sure this works anymore...
diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi
index ff7886239..b4580bb4e 100644
--- a/httemplate/misc/process/batch-cust_pay.cgi
+++ b/httemplate/misc/process/batch-cust_pay.cgi
@@ -38,6 +38,7 @@ foreach my $row ( map /^custnum(\d+)$/, keys %$param ) {
                     'paid'           => $param->{"paid$row"},
                     'payby'          => 'BILL',
                     'payinfo'        => $param->{"payinfo$row"},
+                    '_date'          => $param->{"_date$row"},
                     'discount_term'  => $param->{"discount_term$row"},
                     'paybatch'       => $paybatch,
                     'no_auto_apply'  => exists($param->{"no_auto_apply$row"}) ? 'Y' : '',

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

Summary of changes:
 httemplate/elements/customer-table.html    | 30 +++++++++++++++++++++++++++---
 httemplate/misc/batch-cust_pay.html        | 18 +++++++++---------
 httemplate/misc/process/batch-cust_pay.cgi |  3 +++
 3 files changed, 39 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list