2 Quick process for toggling no_auto_apply field in cust_pay.
4 Requires paynum and no_auto_apply ('Y' or '') in cgi.
6 Requires 'Apply payment' acl.
11 <P STYLE="color: #FF0000"><% emt($error) %></P>
15 <P STYLE="font-weight: bold;"><% emt($message) %></P>
16 <P><% emt('Please wait while the page reloads.') %></P>
17 <SCRIPT TYPE="text/javascript">
25 unless $FS::CurrentUser::CurrentUser->access_right('Apply payment');
27 my $paynum = $cgi->param('paynum');
28 my $noauto = $cgi->param('no_auto_apply');
32 my $cust_pay = qsearchs('cust_pay',{ paynum => $paynum });
34 if (($noauto eq 'Y') || (defined($noauto) && (length($noauto) == 0))) {
35 $cust_pay->no_auto_apply($noauto);
36 $error = $cust_pay->replace;
38 q(Payment will not be automatically applied to open invoices, must be applied manually) :
39 q(Payment will be automatically applied to open invoices the next time this customer's payments are processed);
41 $error = 'no_auto_apply not specified';
44 $error .= 'Payment could not be found in database';