diff options
author | ivan <ivan> | 2004-06-29 04:02:45 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-06-29 04:02:45 +0000 |
commit | 157e8bdba110b7aac022bd2c2f7b377d3c5b2f85 (patch) | |
tree | 9dc49439d40ebbbeeea1db3f48fdd6ee7602cb34 /httemplate/edit | |
parent | f1e474e3ea4c658b9a1f84af108f09a65886055c (diff) |
add cust_pay_refund table to refund payments
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/cust_bill_pay.cgi | 8 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_bill_pay.cgi | 24 |
2 files changed, 22 insertions, 10 deletions
diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi index 8cdf4509a..24bce308a 100755 --- a/httemplate/edit/cust_bill_pay.cgi +++ b/httemplate/edit/cust_bill_pay.cgi @@ -59,10 +59,10 @@ foreach my $cust_bill ( @cust_bill ) { END } -# if ( cust_bill == "Refund" ) { -# what.form.amount.value = "$credited"; -# } print <<END; + if ( cust_bill == "Refund" ) { + what.form.amount.value = "$unapplied"; + } } </SCRIPT> END @@ -75,7 +75,7 @@ foreach my $cust_bill ( @cust_bill ) { ' - '. time2str("%D",$cust_bill->_date). ' - $'. $cust_bill->owed; } -#print qq!<OPTION VALUE="Refund">Refund!; +print qq!<OPTION VALUE="Refund">Refund!; print "</SELECT>"; print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!; diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi index 0c33506a8..0025b16b5 100755 --- a/httemplate/edit/process/cust_bill_pay.cgi +++ b/httemplate/edit/process/cust_bill_pay.cgi @@ -11,12 +11,24 @@ my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } ) my $custnum = $cust_main->custnum; -my $new = new FS::cust_bill_pay ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount invnum) - } fields('cust_bill_pay') -} ); +my $new; +if ($cgi->param('invnum') =~ /^Refund$/) { + $new = new FS::cust_refund ( { + 'reason' => 'Refunding payment', #enter reason in UI + 'refund' => $cgi->param('amount'), + 'payby' => 'BILL', + #'_date' => $cgi->param('_date'), + 'payinfo' => 'Cash', #enter payinfo in UI + 'paynum' => $paynum, + } ); +} else { + $new = new FS::cust_bill_pay ( { + map { + $_, scalar($cgi->param($_)); + #} qw(custnum _date amount invnum) + } fields('cust_bill_pay') + } ); +} my $error = $new->insert; |