+% unless ($disallow_no_auto_apply) {
+% # false laziness with edit/cust_pay.cgi
+
+<TR ID="apply_box_row">
+ <TD COLSPAN=2>
+ <% mt('Auto-apply to invoices') |h %>
+ <SELECT NAME="apply" ID="apply_box">
+ <OPTION VALUE="yes" SELECTED><% mt('yes') |h %></OPTION>
+ <OPTION VALUE=""><% mt('not now') |h %></OPTION>
+ <OPTION VALUE="never"><% mt('never') |h %></OPTION>
+ </SELECT>
+ </TD>
+</TR>
+
+% # this can go away if no_auto_apply handling gets added to batch payment processing
+<SCRIPT>
+function change_batch_checkbox () {
+ if (document.getElementById('batch_checkbox').checked) {
+ document.getElementById('apply_box').disabled = true;
+ document.getElementById('apply_box_row').style.display = 'none';
+ } else {
+ document.getElementById('apply_box').disabled = false;
+ document.getElementById('apply_box_row').style.display = '';
+ }
+}
+</SCRIPT>
+
+% }
+
+% if ($auto && $disable_payauto_default) {
+<SCRIPT>
+var unchecked_auto = false;
+function possibly_uncheck_auto () {
+ if (!unchecked_auto) {
+ unchecked_auto = true;
+ document.getElementById('auto_checkbox').checked = false;
+ }
+}
+</SCRIPT>
+% }
+