RT78356 - fixed exportname error added missing file
[freeside.git] / httemplate / edit / cust_pay_pending.html
1 <% include('/elements/header-popup.html', $title ) %>
2
3 % if ( $action eq 'delete' ) {
4
5     <CENTER><FONT SIZE="+1"><B>Are you sure you want to delete this pending payment?</B></FONT></CENTER>
6
7 % } elsif (( $action eq 'complete' ) and $authorized) {
8
9     <CENTER><FONT SIZE="+1"><B>Payment was authorized but not captured.  Contact <% $cust_pay_pending->processor || 'the payment gateway' %> to establish the final disposition of this transaction.</B></FONT></CENTER>
10
11 % } elsif ( $action eq 'complete' ) {
12
13     <CENTER><FONT SIZE="+1"><B>No response was received from <% $cust_pay_pending->processor || 'the payment gateway' %> for this transaction.  Check <% $cust_pay_pending->processor || 'the payment gateway' %>'s reporting and determine if this transaction completed successfully.</B></FONT></CENTER>
14
15 % } elsif ( $action eq 'capture' ) {
16
17     <CENTER><FONT SIZE="+1"><B>Captured payment not recorded in database - check logs for errors.</B></FONT></CENTER>
18
19 % }
20
21 <BR>
22
23 %#false laziness w/view/cust_pay.html
24 <% include('/elements/small_custview.html',
25              $cust_pay_pending->custnum,
26              scalar($conf->config('countrydefault')),
27              1, #no balance
28           )
29 %>
30 <BR>
31
32 <% ntable("#cccccc", 2) %>
33
34 <TR>
35   <TD ALIGN="right">Pending payment#</TD>
36   <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->paypendingnum %></B></TD>
37 </TR>
38
39 <TR>
40   <TD ALIGN="right">Date</TD>
41   <TD BGCOLOR="#FFFFFF"><B><% time2str"%a&nbsp;%b&nbsp;%o,&nbsp;%Y&nbsp;%r", $cust_pay_pending->_date %></B></TD>
42 </TR>
43
44 <TR>
45   <TD ALIGN="right">Amount</TD>
46   <TD BGCOLOR="#FFFFFF"><B><% $money_char. $cust_pay_pending->paid %></B></TD>
47 </TR>
48
49 <TR>
50   <TD ALIGN="right">Payment method</TD>
51   <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->payby_name %> #<% $cust_pay_pending->paymask %></B></TD>
52 </TR>
53
54 % #if ( $cust_pay_pending->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay_pending->paybatch ) { 
55
56     <TR>
57       <TD ALIGN="right">Processor</TD>
58       <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->processor %></B></TD>
59     </TR>
60
61     <TR>
62       <TD ALIGN="right">Authorization#</TD>
63       <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->authorization %></B></TD>
64     </TR>
65
66 %   if ( $cust_pay_pending->order_number ) {
67       <TR>
68         <TD ALIGN="right">Order#</TD>
69         <TD BGCOLOR="#FFFFFF"><B><% $cust_pay_pending->order_number %></B></TD>
70       </TR>
71 %   }
72
73 % #}
74
75 </TABLE>
76
77 <BR>
78
79 <FORM NAME   = "pendingform"
80       METHOD = "POST"
81       ACTION = "process/cust_pay_pending.html"
82 >
83
84 <INPUT TYPE="hidden" NAME="paypendingnum" VALUE="<% $paypendingnum %>">
85
86 <% itable() %>
87
88 % if ( $action eq 'delete' ) {
89
90     <INPUT TYPE="hidden" NAME="action" VALUE="<% $action %>">
91
92     <TR>
93       <TD ALIGN="center">
94         <BUTTON TYPE="button" onClick="document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, delete payment</BUTTON>
95       </TD>
96       <TD>&nbsp;&nbsp;&nbsp;</TD>
97       <TD ALIGN="center">
98         <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, cancel deletion</BUTTON>
99       </TD>
100     </TR>
101
102 % } else {
103
104     <INPUT TYPE="hidden" NAME="action" VALUE="">
105
106     <TR>
107       <TD ALIGN="center">
108         <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'insert_cust_pay'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/tick.png" ALT=""-->Yes, transaction completed successfully.</BUTTON>
109       </TD>
110
111 %   if ( $action eq 'complete' ) {
112         <TD>&nbsp;&nbsp;&nbsp;</TD>
113 %     if ($authorized) {
114         <TD ALIGN="center">
115           <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'reverse'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was reversed</BUTTON>
116         </TD>
117 %     } else {
118         <TD ALIGN="center">
119           <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'decline'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was declined</BUTTON>
120         </TD>
121 %     }
122         <TD>&nbsp;&nbsp;&nbsp;</TD>
123         <TD ALIGN="center">
124           <BUTTON TYPE="button" onClick="document.pendingform.action.value = 'delete'; document.pendingform.submit();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->No, transaction was not received</BUTTON>
125         </TD>
126 %   }
127
128     </TR>
129
130     <TR><TD COLSPAN=5></TD></TR>
131
132     <TR>
133       <TD COLSPAN=5 ALIGN="center">
134         <BUTTON TYPE="button" onClick="parent.cClick();"><!--IMG SRC="<%$p%>images/cross.png" ALT=""-->Cancel payment completion; transaction status not yet known</BUTTON>
135       </TD>
136     </TR>
137
138 % }
139
140 </TABLE>
141
142 </FORM>
143 </BODY>
144 </HTML>
145 <%init>
146
147 my $curuser = $FS::CurrentUser::CurrentUser;
148
149 die "access denied"
150   unless $curuser->access_right('Edit customer pending payments');
151
152 $cgi->param('action') =~ /^(\w+)$/ or die 'illegal action';
153 my $action = $1;
154 my $title = ucfirst($action). ' pending payment';
155
156 $cgi->param('paypendingnum') =~ /^(\d+)$/ or die 'illegal paypendingnum';
157 my $paypendingnum = $1;
158 my $cust_pay_pending =
159   qsearchs({
160     'select'    => 'cust_pay_pending.*',
161     'table'     => 'cust_pay_pending',
162     'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
163     'hashref'   => { 'paypendingnum' => $paypendingnum },
164     'extra_sql' => ' AND '. $curuser->agentnums_sql,
165   })
166   or die 'unknown paypendingnum';
167
168 my $authorized = ($cust_pay_pending->status eq 'authorized') ? 1 : 0;
169
170 my $conf = new FS::Conf;
171
172 my $money_char = $conf->config('money_char') || '$';
173
174 </%init>