1 <% include('/elements/header-popup.html', $title ) %>
3 <FONT SIZE="+1" COLOR="#ff0000">Error: <% $error |h %></FONT>
5 <SCRIPT TYPE="text/javascript">
6 window.top.location.reload();
13 my $curuser = $FS::CurrentUser::CurrentUser;
16 unless $curuser->access_right('Edit customer pending payments');
18 $cgi->param('action') =~ /^(\w+)$/ or die 'illegal action';
21 $cgi->param('paypendingnum') =~ /^(\d+)$/ or die 'illegal paypendingnum';
22 my $paypendingnum = $1;
23 my $cust_pay_pending =
25 'select' => 'cust_pay_pending.*',
26 'table' => 'cust_pay_pending',
27 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
28 'hashref' => { 'paypendingnum' => $paypendingnum },
29 'extra_sql' => ' AND '. $curuser->agentnums_sql,
31 or die 'unknown paypendingnum';
35 if ( $action eq 'delete' ) {
37 $error = $cust_pay_pending->delete;
39 $title = 'Error deleting pending payment';
41 $title = 'Pending payment deletion successful';
44 } elsif ( $action eq 'insert_cust_pay' ) {
46 $error = $cust_pay_pending->insert_cust_pay;
48 $title = 'Error completing pending payment';
50 $title = 'Pending payment completed';
53 } elsif ( $action eq 'decline' ) {
55 $error = $cust_pay_pending->decline;
57 $title = 'Error declining pending payment';
59 $title = 'Pending payment completed (decline)';
62 } elsif ( $action eq 'reverse' ) {
64 $error = $cust_pay_pending->reverse;
66 $title = 'Error reversing pending payment';
68 $title = 'Pending payment completed (reverse)';
73 die "unknown action $action";