X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcust_pay-import.cgi;h=897de992cc1a5fec7dd48eec7674a2b893dd7d1e;hp=849a25bea7e83a58980b9eee2363552a2a1837dd;hb=949a80c148a8bbeeeec54c5a0be5d73b292423a5;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/httemplate/misc/cust_pay-import.cgi b/httemplate/misc/cust_pay-import.cgi index 849a25bea..897de992c 100644 --- a/httemplate/misc/cust_pay-import.cgi +++ b/httemplate/misc/cust_pay-import.cgi @@ -1,35 +1,57 @@ -<% include("/elements/header.html",'Batch Payment Import') %> +<& /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) %> -<% include('/elements/tr-select-agent.html', - #'curr_value' => '', #$agentnum, - 'label' => "Agent", - 'empty_label' => 'Select agent', - ) -%> + + +<& /elements/tr-select-agent.html, + 'label' => "Agent", + 'empty_label' => 'Select agent', +&> + +<& /elements/tr-input-date-field.html, { + 'name' => '_date', + 'label' => 'Date', + } +&> Format - - CSV filename - - +<% include( '/elements/tr-select-payby.html', + 'paybys' => \%paybys, + 'disable_empty' => 1, + 'label' => 'Payment type', + ) +%> + +<% include( '/elements/file-upload.html', + 'field' => 'file', + 'label' => 'Filename', + ) +%> - + @@ -37,11 +59,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: @@ -53,10 +74,18 @@ Field information:
  • amount: A positive numeric value with at most two digits after the decimal point. -
  • checknum: A sequences of digits. May be left blank. +
  • checknum: A sequence of digits. May be left blank. + +
  • invnum: Invoice number, optional
    -<% include('/elements/footer.html') %> +<& /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_payby2payname(); +