diff options
author | ivan <ivan> | 2006-05-14 16:47:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-05-14 16:47:31 +0000 |
commit | 2c757d7db4cb6a7b9655de13206fcc84fb7ce61f (patch) | |
tree | f01088bb60d49ee0dd3dd796d57abe219c321f7b /httemplate/edit/cust_bill_pay.cgi | |
parent | c46235292c6bf929615ac28fc48c1d5609ce4590 (diff) |
first part of ACL and re-skinning work and some other small stuff
Diffstat (limited to 'httemplate/edit/cust_bill_pay.cgi')
-rwxr-xr-x | httemplate/edit/cust_bill_pay.cgi | 87 |
1 files changed, 42 insertions, 45 deletions
diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi index 24bce308a..9d3bdd8cb 100755 --- a/httemplate/edit/cust_bill_pay.cgi +++ b/httemplate/edit/cust_bill_pay.cgi @@ -1,4 +1,3 @@ -<!-- mason kludge --> <% my($paynum, $amount, $invnum); @@ -18,78 +17,76 @@ my $otaker = getotaker; my $p1 = popurl(1); -print header("Apply Payment", ''); -print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'), - "</FONT><BR><BR>" - if $cgi->param('error'); -print <<END; - <FORM ACTION="${p1}process/cust_bill_pay.cgi" METHOD=POST> -END +%><%= header("Apply Payment", '') %> +<% if ( $cgi->param('error') ) { %> + <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT> + <BR><BR> +<% } %> + +<FORM ACTION="<%= $p1 %>process/cust_bill_pay.cgi" METHOD=POST> + +<% my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); die "payment $paynum not found!" unless $cust_pay; my $unapplied = $cust_pay->unapplied; +%> + +Payment #<B><%= $paynum %></B> +<INPUT TYPE="hidden" NAME="paynum" VALUE="<%= $paynum %>"> -print "Payment # <B>$paynum</B>". - qq!<INPUT TYPE="hidden" NAME="paynum" VALUE="$paynum">!. - '<BR>Date: <B>'. time2str("%D", $cust_pay->_date). '</B>'. - '<BR>Amount: $<B>'. $cust_pay->paid. '</B>'. - "<BR>Unapplied amount: \$<B>$unapplied</B>" - ; +<BR>Date: <B><%= time2str("%D", $cust_pay->_date) %></B> +<BR>Amount: $<B><%= $cust_pay->paid %></B> + +<BR>Unapplied amount: $<B><%= $unapplied %></B> + +<% my @cust_bill = grep $_->owed != 0, qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); -print <<END; +%> + <SCRIPT> function changed(what) { cust_bill = what.options[what.selectedIndex].value; -END -foreach my $cust_bill ( @cust_bill ) { +<% foreach my $cust_bill ( @cust_bill ) { my $invnum = $cust_bill->invnum; my $changeto = $cust_bill->owed < $unapplied ? $cust_bill->owed : $unapplied; - print <<END; +%> if ( cust_bill == $invnum ) { - what.form.amount.value = "$changeto"; + what.form.amount.value = "<%= $changeto %>"; } -END -} +<% } %> -print <<END; if ( cust_bill == "Refund" ) { - what.form.amount.value = "$unapplied"; + what.form.amount.value = "<%= $unapplied %>"; } } </SCRIPT> -END - -print qq!<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">!, - '<OPTION VALUE="">'; -foreach my $cust_bill ( @cust_bill ) { - print '<OPTION'. ( $cust_bill->invnum eq $invnum ? ' SELECTED' : '' ). - ' VALUE="'. $cust_bill->invnum. '">'. $cust_bill->invnum. - ' - '. time2str("%D",$cust_bill->_date). - ' - $'. $cust_bill->owed; -} -print qq!<OPTION VALUE="Refund">Refund!; -print "</SELECT>"; -print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!; +<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)"> +<OPTION VALUE=""> + +<% foreach my $cust_bill ( @cust_bill ) { %> + + <OPTION<%= $cust_bill->invnum eq $invnum ? ' SELECTED' : '' %> VALUE="<%= $cust_bill->invnum %>"><%= $cust_bill->invnum %> - <%= time2str("%D", $cust_bill->_date) %> - $<%= $cust_bill->owed %> + +<% } %> + +<OPTION VALUE="Refund">Refund +</SELECT> + +<BR>Amount $<INPUT TYPE="text" NAME="amount" VALUE="<%= $amount %>" SIZE=8 MAXLENGTH=8> -print <<END; <BR> -<INPUT TYPE="submit" VALUE="Apply"> -END +<CENTER><INPUT TYPE="submit" VALUE="Apply"></CENTER> -print <<END; +</FORM> - </FORM> - </BODY> +</BODY> </HTML> -END - -%> |