5 include( '/elements/tr-select-payment_options.html',
7 #opt - most get used in /elements/tr-amount-fee
8 'custnum' => 4, # customer number needed for selecting invoices
9 'prefix' => 'pre', # prefix to fields and row ID's
10 'amount' => 1, # payment amount
11 'process-pkgpart' => scalar($conf->config('manual_process-pkgpart', $cust_main->agentnum)),
12 'process-display' => scalar($conf->config('manual_process-display')),
13 'process-skip_first' => $conf->exists('manual_process-skip_first'),
14 'num_payments' => scalar($cust_main->cust_pay),
15 'surcharge_percentage' =>
17 ? scalar($conf->config('credit-card-surcharge-percentage', $cust_main->agentnum))
20 'surcharge_flatfee' =>
22 ? scalar($conf->config('credit-card-surcharge-flatfee', $cust_main->agentnum))
29 <TR STYLE="display:block">
30 <TH ALIGN="right"><% mt('Payment options') |h %></TH>
33 ID = "<% $opt{prefix} %>payment_option"
34 NAME = "<% $opt{prefix} %>payment_option"
35 onChange = "<% $opt{prefix} %>payment_option_changed(this)"
38 <OPTION VALUE="select">Select payment option</OPTION>
39 <OPTION VALUE="<% $opt{amount} %>">Pay full balance</OPTION>
40 <OPTION VALUE="invoice">Pay specific invoice</OPTION>
41 <OPTION VALUE="">Pay specific amount</OPTION>
46 <& /elements/tr-select-invoice.html,
47 'custnum' => $opt{custnum},
48 'prefix' => $opt{prefix},
51 <& /elements/tr-amount_fee.html,
52 'row_style' => 'STYLE="display:none;"',
56 <SCRIPT TYPE="text/javascript">
58 function <% $opt{prefix} %>payment_option_changed(what) {
60 if ( what.value == 'select' ) {
61 document.getElementById('payment_amount_row').style.display = 'none';
62 document.getElementById('invoice_row').style.display = 'none';
63 document.getElementById('<% $opt{prefix} %>invoice').value = 'select';
64 document.getElementById('amount').value = '';
66 else if ( what.value == 'invoice' ) {
67 document.getElementById('payment_amount_row').style.display = 'none';
68 document.getElementById('invoice_row').style.display = 'block';
69 document.getElementById('amount').value = '';
72 document.getElementById('payment_amount_row').style.display = 'block';
73 document.getElementById('invoice_row').style.display = 'none';
74 document.getElementById('<% $opt{prefix} %>invoice').value = 'select';
75 document.getElementById('amount').value = what.value;
80 function <% $opt{prefix} %>invoice_select_changed(what) {
82 if ( what.value == 'select' ) {
83 document.getElementById('payment_amount_row').style.display = 'none';
84 document.getElementById('amount').value = '';
87 document.getElementById('payment_amount_row').style.display = 'block';
88 document.getElementById('amount').value = what.value;