diff options
author | Mike Robinson <miker@freeside.biz> | 2012-05-01 12:32:53 -0500 |
---|---|---|
committer | Mike Robinson <miker@freeside.biz> | 2012-05-01 12:32:53 -0500 |
commit | b3f48204012dd722912dcb3703908bd1eaf6df7b (patch) | |
tree | ede23149c6ed27f415627db7a4ef93d79666ed8c /httemplate/edit | |
parent | 1e2473f03c0fb15f1e56dc09ea3a94c5e5525a53 (diff) |
17528: back-date payment access-right
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/cust_pay.cgi | 10 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 7a1bb00fa..f0826f652 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -23,6 +23,7 @@ <% mt('Payment') |h %> <% ntable("#cccccc", 2) %> +% if ( $FS::CurrentUser::CurrentUser->access_right(['Backdate payment']) ) { <TR> <TD ALIGN="right"><% mt('Date') |h %></TD> <TD COLSPAN=2> @@ -39,6 +40,15 @@ align: "BR" }); </SCRIPT> +% } +% else { +<TR> + <TD ALIGN="right"><% mt('Date') |h %></TD> + <TD COLSPAN=2> + <% time2str($date_format.' %r',$_date) %> + </TD> +</TR> +% } <TR> <TD ALIGN="right"><% mt('Amount') |h %></TD> diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index 06f5e64d5..8664883c1 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -39,7 +39,13 @@ $cgi->param('link') =~ /^(custnum|invnum|popup)$/ my $field = my $link = $1; $field = 'custnum' if $field eq 'popup'; -my $_date = parse_datetime($cgi->param('_date')); +my $_date; +if ( $FS::CurrentUser::CurrentUser->access_right(['Backdate payment']) ) { + $_date = parse_datetime($cgi->param('_date')); +} +else { + $_date = time; +} my $new = new FS::cust_pay ( { $field => $linknum, |