summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/cust_bill-promised_date.html
blob: 721a763eb8c3f94604bf9fa62ba817c24cbd2f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<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";
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>