[freeside-commits] branch FREESIDE_3_BRANCH updated. 4bc3d0f7dacd7a8bc82b86daf4f938d6cf8def5b

Jeremy Davis jeremyd at 420.am
Fri Feb 7 10:56:33 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  4bc3d0f7dacd7a8bc82b86daf4f938d6cf8def5b (commit)
      from  2835b0ed9f2d2811d63cf721cf3216f316021f59 (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 4bc3d0f7dacd7a8bc82b86daf4f938d6cf8def5b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jan 24 18:34:38 2014 -0800

    select a date when importing credits, RT#27087

diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm
index 8e2aaec..a117f85 100644
--- a/FS/FS/cust_credit.pm
+++ b/FS/FS/cust_credit.pm
@@ -1127,7 +1127,7 @@ sub process_batch_import {
   my $job = shift;
 
   my $opt = { 'table'   => 'cust_credit',
-              'params'  => [ 'credbatch' ],
+              'params'  => [ '_date', 'credbatch' ],
               'formats' => { 'simple' =>
                                [ 'custnum', 'amount', 'reasonnum', 'invnum' ],
                            },
diff --git a/httemplate/misc/cust_credit-import.html b/httemplate/misc/cust_credit-import.html
index 6de34e3..9a63a04 100644
--- a/httemplate/misc/cust_credit-import.html
+++ b/httemplate/misc/cust_credit-import.html
@@ -7,7 +7,7 @@ Import a file containing credits.
      'name'      => 'CreditImportForm',
      'action'    => 'process/cust_credit-import.cgi',
      'num_files' => 1,
-     'fields'    => [ 'format', 'credbatch' ],
+     'fields'    => [ 'format', '_date', 'credbatch' ],
      'message'   => 'Credit import successful',
      'url'       => $p."search/cust_credit.html?credbatch=$credbatch",
      'onsubmit'  => "document.CreditImportForm.submitButton.disabled=true;",
@@ -18,6 +18,13 @@ Import a file containing credits.
 
   <INPUT TYPE="hidden" NAME="credbatch" VALUE="<% $credbatch %>"%>
 
+  <& /elements/tr-input-date-field.html, {
+       'name'  => '_date',
+       #'value' => '',
+       'label' => 'Date',
+     }
+  &>
+
   <!--
   <TR>
     <TH ALIGN="right">Format</TH>
diff --git a/httemplate/misc/process/cust_credit-import.cgi b/httemplate/misc/process/cust_credit-import.cgi
index 5a5cfe2..4c4d42d 100644
--- a/httemplate/misc/process/cust_credit-import.cgi
+++ b/httemplate/misc/process/cust_credit-import.cgi
@@ -4,6 +4,11 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Import');
 
+my %arg = $cgi->param('arg');
+$arg{_date} = parse_datetime( $arg{_date} )
+  if $arg{_date} && $arg{_date} =~ /\D/;
+$cgi->param('arg', %arg );
+
 my $server =
   new FS::UI::Web::JSRPC 'FS::cust_credit::process_batch_import', $cgi;
 

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

Summary of changes:
 FS/FS/cust_credit.pm                           |    2 +-
 httemplate/misc/cust_credit-import.html        |    9 ++++++++-
 httemplate/misc/process/cust_credit-import.cgi |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list