summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/cust_bill-promised_date.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/process/cust_bill-promised_date.html')
-rw-r--r--httemplate/misc/process/cust_bill-promised_date.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/misc/process/cust_bill-promised_date.html b/httemplate/misc/process/cust_bill-promised_date.html
new file mode 100644
index 000000000..721a763eb
--- /dev/null
+++ b/httemplate/misc/process/cust_bill-promised_date.html
@@ -0,0 +1,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>