X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pay.cgi;h=90f1f00261b8c5d2ae4b1704e3bd591c0de1924e;hp=38654e98d2bfde8cde7147e163cd3f062057bc5a;hb=c2146ae32fdef80049abfa13098db2d45f3ebdd5;hpb=f91771606ce8a2bb4f2fa44e7bf54c9b7c945db6 diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 38654e98d..90f1f0026 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -1,62 +1,64 @@ + <% -# - -use strict; -use vars qw( $cgi $link $linknum $p1 $_date $payby $payinfo $paid $quickpay ); -use Date::Format; -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::Conf; -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(header popurl ntable small_custview); my $conf = new FS::Conf; -$cgi = new CGI; -cgisuidsetup($cgi); - +my($link, $linknum, $paid, $payby, $payinfo, $quickpay, $_date); if ( $cgi->param('error') ) { - $link = $cgi->param('link'); - $linknum = $cgi->param('linknum'); - $paid = $cgi->param('paid'); - $payby = $cgi->param('payby'); - $payinfo = $cgi->param('payinfo'); + $link = $cgi->param('link'); + $linknum = $cgi->param('linknum'); + $paid = $cgi->param('paid'); + $payby = $cgi->param('payby'); + $payinfo = $cgi->param('payinfo'); $quickpay = $cgi->param('quickpay'); + $_date = $cgi->param('_date') ? str2time($cgi->param('_date')) : time; } elsif ($cgi->keywords) { my($query) = $cgi->keywords; $query =~ /^(\d+)$/; - $link = 'invnum'; - $linknum = $1; - $paid = ''; - $payby = 'BILL'; - $payinfo = ""; + $link = 'invnum'; + $linknum = $1; + $paid = ''; + $payby = 'BILL'; + $payinfo = ""; $quickpay = ''; + $_date = time; } elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) { - $link = 'custnum'; - $linknum = $1; - $paid = ''; - $payby = 'BILL'; - $payinfo = ''; + $link = 'custnum'; + $linknum = $1; + $paid = ''; + $payby = 'BILL'; + $payinfo = ''; $quickpay = $cgi->param('quickpay'); + $_date = time; } else { die "illegal query ". $cgi->keywords; } -$_date = time; -$p1 = popurl(1); -print header("Post payment", ''); +my $paybatch = "webui-$_date-$$-". rand() * 2**32; + +%> + +<%= header("Post payment", '') %> -print qq!Error: !, $cgi->param('error'), - "

" - if $cgi->param('error'); +<% if ( $cgi->param('error') ) { %> +Error: <%= $cgi->param('error') %> +

+<% } %> -print < - - - -END +<%= ntable("#cccccc",2) %> + + + + + +
+ + + + +<% +my $money_char = $conf->config('money_char') || '$'; my $custnum; if ( $link eq 'invnum' ) { @@ -96,42 +98,57 @@ if ( $link eq 'invnum' ) { } } - print ''; + print '

'; $custnum = $cust_bill->custnum; } elsif ( $link eq 'custnum' ) { $custnum = $linknum; } +%> -print small_custview($custnum, $conf->config('countrydefault')); - -print qq!!; -print qq!!; - -print '

Payment'. ntable("#cccccc", 2). - 'Date'. - time2str("%D",$_date). ''; - -print qq!Amount\$!; - -print qq!Payby$payby!; - -#payinfo (check # now as payby="BILL" hardcoded.. what to do later?) -print qq!Check #!; +<%= small_custview($custnum, $conf->config('countrydefault')) %> + + + +

+Payment +<%= ntable("#cccccc", 2) %> + + Date + + "> + + + + + + Amount + <%= $money_char %> + + + + Check # + + + + Auto-apply
to invoices + + -print qq!Auto-apply
to invoices!; + -#paybatch -print qq!!; + -print <
-END - -%>