X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcust_pay-import.cgi;h=ee0154db5f3b6e835cc02bd75da62adad4cc5efe;hp=05a6c4fd8bdd0c711924c8b82eef971b146f203f;hb=1ac4a177bd93ad7a97a45aacb66aa0bc9c23726b;hpb=aec7743508bd9565dd076ec019dbb3d5b7cedd9c diff --git a/httemplate/misc/cust_pay-import.cgi b/httemplate/misc/cust_pay-import.cgi index 05a6c4fd8..ee0154db5 100644 --- a/httemplate/misc/cust_pay-import.cgi +++ b/httemplate/misc/cust_pay-import.cgi @@ -1,22 +1,31 @@ <& /elements/header.html, 'Batch Payment Import' &> -Import a CSV file containing customer payments. +Import a file containing customer payments.

-
+ +<% include( '/elements/form-file_upload.html', + 'name' => 'OneTrueForm', + 'action' => 'process/cust_pay-import.cgi', #progress-init target + 'fields' => [ 'agentnum', '_date', 'paybatch', 'format', 'payby' ], + 'num_files' => 1, + 'url' => popurl(2)."search/cust_pay.html?magic=paybatch;paybatch=$paybatch", + 'message' => 'Batch Payment Imported', + ) +%> <% &ntable("#cccccc", 2) %> + + <& /elements/tr-select-agent.html, - #'curr_value' => '', #$agentnum, 'label' => "Agent", 'empty_label' => 'Select agent', &> <& /elements/tr-input-date-field.html, { 'name' => '_date', - #'value' => '', - 'label' => 'Date', + 'label' => 'Date', } &> @@ -24,18 +33,26 @@ Import a CSV file containing customer payments. Format - - CSV filename - - +<% include( '/elements/tr-select-payby.html', + 'paybys' => \%paybys, + 'no_all' => 1, + 'label' => 'Payment type', + ) +%> + +<% include( '/elements/file-upload.html', + 'field' => 'file', + 'label' => 'Filename', + ) +%> - + @@ -43,11 +60,10 @@ Import a CSV file containing customer payments.
-Simple file format is CSV, with the following field order: custnum, agent_custid, amount, checknum +Simple file format is CSV or XLS, with the following field order: custnum, agent_custid, amount, checknum, invnum

- + Field information: @@ -68,3 +84,9 @@ Field information:
<& /elements/footer.html &> + +<%init> +my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); +my %paybys; +tie %paybys, 'Tie::IxHash', FS::payby->payment_payby2longname(); +