diff options
Diffstat (limited to 'httemplate/edit/process/cust_pay.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 98 |
1 files changed, 50 insertions, 48 deletions
diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index cecccb59e..68342ee04 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,54 +1,56 @@ -<% - -$cgi->param('linknum') =~ /^(\d+)$/ - or die "Illegal linknum: ". $cgi->param('linknum'); -my $linknum = $1; - -$cgi->param('link') =~ /^(custnum|invnum|popup)$/ - or die "Illegal link: ". $cgi->param('link'); -my $field = my $link = $1; -$field = 'custnum' if $field eq 'popup'; - -my $_date = str2time($cgi->param('_date')); - -my $new = new FS::cust_pay ( { - $field => $linknum, - _date => $_date, - map { - $_, scalar($cgi->param($_)); - } qw(paid payby payinfo paybatch) - #} fields('cust_pay') -} ); - -my $error = $new->insert; - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); -} elsif ( $field eq 'invnum' ) { - print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); -} elsif ( $field eq 'custnum' ) { - if ( $cgi->param('apply') eq 'yes' ) { - my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum }) - or die "unknown custnum $linknum"; - $cust_main->apply_payments; - } - if ( $link eq 'popup' ) { - - %><%= header('Payment entered') %> +% +% +%$cgi->param('linknum') =~ /^(\d+)$/ +% or die "Illegal linknum: ". $cgi->param('linknum'); +%my $linknum = $1; +% +%$cgi->param('link') =~ /^(custnum|invnum|popup)$/ +% or die "Illegal link: ". $cgi->param('link'); +%my $field = my $link = $1; +%$field = 'custnum' if $field eq 'popup'; +% +%my $_date = str2time($cgi->param('_date')); +% +%my $new = new FS::cust_pay ( { +% $field => $linknum, +% _date => $_date, +% map { +% $_, scalar($cgi->param($_)); +% } qw(paid payby payinfo paybatch) +% #} fields('cust_pay') +%} ); +% +%my $error = $new->insert; +% +%if ($error) { +% $cgi->param('error', $error); +% print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); +%} elsif ( $field eq 'invnum' ) { +% print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); +%} elsif ( $field eq 'custnum' ) { +% if ( $cgi->param('apply') eq 'yes' ) { +% my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum }) +% or die "unknown custnum $linknum"; +% $cust_main->apply_payments; +% } +% if ( $link eq 'popup' ) { +% +% +<% header('Payment entered') %> <SCRIPT TYPE="text/javascript"> window.top.location.reload(); </SCRIPT> </BODY></HTML> - <% - - } elsif ( $link eq 'custnum' ) { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); - } else { - die "unknown link $link"; - } - -} +% +% +% } elsif ( $link eq 'custnum' ) { +% print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); +% } else { +% die "unknown link $link"; +% } +% +%} +% +% -%> |