1 <& /elements/header-popup.html, 'Change payment package' &>
3 <& /elements/error.html &>
5 <FORM NAME="PaymentForm" ACTION="<% popurl(1) %>process/cust_pay-pkgnum.html" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="paynum" VALUE="<% $cust_pay->paynum %>">
10 <% mt('Payment') |h %>
11 <% ntable("#cccccc", 2) %>
14 <TD ALIGN="right"><% mt('Date') |h %></TD>
15 <TD COLSPAN=2 BGCOLOR="#eeeeee"><% time2str($date_format.' %r',$cust_pay->_date) |h %>
20 <TD ALIGN="right"><% mt('Amount') |h %></TD>
21 <TD COLSPAN=2 BGCOLOR="#eeeeee">
22 <% $money_char. $cust_pay->paid %>
24 <B><% mt(FS::payby->payname($cust_pay->payby)) |h %></B></TD>
27 % if ( $cust_pay->payby eq 'BILL' ) {
29 <TD ALIGN="right"><% mt('Check #') |h %></TD>
30 <TD COLSPAN=2><% $cust_pay->payinfo |h %></TD>
32 % } elsif ( $cust_pay->payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) {
34 <TD ALIGN="right"><% mt('Bank') |h %></TD>
35 <TD COLSPAN=3><% $cust_pay->bank |h %></TD>
38 <TD ALIGN="right"><% mt('Check #') |h %></TD>
39 <TD COLSPAN=2><% $cust_pay->payinfo |h %></TD>
42 <TD ALIGN="right"><% mt('Teller #') |h %></TD>
43 <TD COLSPAN=2><% $cust_pay->teller |h %></TD>
46 <TD ALIGN="right"><% mt('Depositor') |h %></TD>
47 <TD COLSPAN=3><% $cust_pay->depositor |h %></TD>
50 <TD ALIGN="right"><% mt('Account #') |h %></TD>
51 <TD COLSPAN=2><% $cust_pay->account |h %></TD>
55 % if ( $conf->exists('pkg-balances') ) {
56 % $cgi->param('pkgnum', $cust_pay->pkgnum);
57 <& /elements/tr-select-cust_pkg-balances.html,
58 'custnum' => $cust_pay->custnum,
62 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
68 <INPUT TYPE="submit" VALUE="<% mt('Change payment package') |h %>">
76 my $conf = new FS::Conf;
78 my $money_char = $conf->config('money_char') || '$';
79 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
82 unless $FS::CurrentUser::CurrentUser->access_right('Apply payment'); #own ACL?
84 my $cust_pay = qsearchs({
85 'select' => 'cust_pay.*',
86 'table' => 'cust_pay',
87 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
88 'hashref' => { paynum => scalar($cgi->param('paynum')), },
89 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
91 or die 'unknown payment';