[freeside-commits] branch FREESIDE_3_BRANCH updated. 6d4950db273abb64d31570171260f937b61812da
Ivan
ivan at 420.am
Wed Jan 15 14:42:27 PST 2014
The branch, FREESIDE_3_BRANCH has been updated
via 6d4950db273abb64d31570171260f937b61812da (commit)
from 963df8e7ebf8577198bf4fac956bbcebe97ec33f (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 6d4950db273abb64d31570171260f937b61812da
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Jan 15 14:42:26 2014 -0800
bulk credit import, RT#26319
diff --git a/httemplate/misc/cust_credit-import.html b/httemplate/misc/cust_credit-import.html
new file mode 100644
index 0000000..6de34e3
--- /dev/null
+++ b/httemplate/misc/cust_credit-import.html
@@ -0,0 +1,79 @@
+<& /elements/header.html, 'Batch Credit Import' &>
+
+Import a file containing credits.
+<BR><BR>
+
+<& /elements/form-file_upload.html,
+ 'name' => 'CreditImportForm',
+ 'action' => 'process/cust_credit-import.cgi',
+ 'num_files' => 1,
+ 'fields' => [ 'format', 'credbatch' ],
+ 'message' => 'Credit import successful',
+ 'url' => $p."search/cust_credit.html?credbatch=$credbatch",
+ 'onsubmit' => "document.CreditImportForm.submitButton.disabled=true;",
+&>
+
+
+<% &ntable("#cccccc", 2) %>
+
+ <INPUT TYPE="hidden" NAME="credbatch" VALUE="<% $credbatch %>"%>
+
+ <!--
+ <TR>
+ <TH ALIGN="right">Format</TH>
+ <TD>
+ <SELECT NAME="format">
+ <OPTION VALUE="simple">Simple
+ </SELECT>
+ </TD>
+ </TR>
+ -->
+ <INPUT TYPE="hidden" NAME="format" VALUE="simple">
+
+ <% include( '/elements/file-upload.html',
+ 'field' => 'file',
+ 'label' => 'Filename',
+ )
+ %>
+
+ <TR>
+ <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
+ <INPUT TYPE = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
+ VALUE = "Import file"
+ >
+ </TD>
+ </TR>
+
+</TABLE>
+
+</FORM>
+
+<BR>
+
+Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
+<BR><BR>
+
+ <b>Default</b> format has the following field order: <i>custnum, amount, reasonnum, invnum</i><br>
+<BR><BR>
+
+Field information:
+<ul>
+ <li><i>custnum</i>: Customer number
+ <li><i>amount</i>:
+ <li><i>reasonnum</i>: <A HREF="<%$p%>browse/reason.html?class=R">Credit reason</A>
+ <li><i>invnum</i>: Invoice number
+</ul>
+<BR><BR>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Import');
+
+my $credbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+
+</%init>
diff --git a/httemplate/misc/process/cust_credit-import.cgi b/httemplate/misc/process/cust_credit-import.cgi
new file mode 100644
index 0000000..5a5cfe2
--- /dev/null
+++ b/httemplate/misc/process/cust_credit-import.cgi
@@ -0,0 +1,10 @@
+<% $server->process %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Import');
+
+my $server =
+ new FS::UI::Web::JSRPC 'FS::cust_credit::process_batch_import', $cgi;
+
+</%init>
-----------------------------------------------------------------------
Summary of changes:
httemplate/misc/cust_credit-import.html | 79 ++++++++++++++++++++
...cust_pkg-import.html => cust_credit-import.cgi} | 2 +-
2 files changed, 80 insertions(+), 1 deletions(-)
create mode 100644 httemplate/misc/cust_credit-import.html
copy httemplate/misc/process/{cust_pkg-import.html => cust_credit-import.cgi} (64%)
More information about the freeside-commits
mailing list