%init> # XXX ACL? die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Edit customer'); $cgi->param('invnum') =~ /^(\d+)$/ or die "Illegal invnum"; my $invnum = $1; my $promised_date = ''; if ( length($cgi->param('promised_date')) ) { $promised_date = parse_datetime($cgi->param('promised_date')) or die "Illegal promised_date"; } my $cust_bill = qsearchs('cust_bill', { invnum => $invnum }); my $cust_main = $cust_bill->cust_main; $cust_bill->promised_date($promised_date); # also reset failed payment events my $error = $cust_bill->replace || $cust_main->retry_realtime; die $error if $error; # nothing fancy here %init>