setting promised payment date retries events, #13554
authormark <mark>
Thu, 29 Dec 2011 19:01:37 +0000 (19:01 +0000)
committermark <mark>
Thu, 29 Dec 2011 19:01:37 +0000 (19:01 +0000)
httemplate/misc/process/cust_bill-promised_date.html

index 298b130..721a763 100644 (file)
@@ -1,6 +1,8 @@
 <SCRIPT TYPE="text/javascript">window.top.location.reload()</SCRIPT>
 <%init>
 # XXX ACL?
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Edit customer');
 
 $cgi->param('invnum') =~ /^(\d+)$/
   or die "Illegal invnum";
@@ -13,7 +15,10 @@ if ( length($cgi->param('promised_date')) ) {
 }
 
 my $cust_bill = qsearchs('cust_bill', { invnum => $invnum });
+my $cust_main = $cust_bill->cust_main;
+
 $cust_bill->promised_date($promised_date);
-my $error = $cust_bill->replace;
+# also reset failed payment events
+my $error = $cust_bill->replace || $cust_main->retry_realtime;
 die $error if $error; # nothing fancy here
 </%init>