diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2014-12-04 14:47:49 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2014-12-04 14:47:49 -0800 |
| commit | 7dd8215a91ca6ca4a9988a0108647ada7f2a11d8 (patch) | |
| tree | 0a00d42d12a5e606995374ebe0f0464856fbd373 /httemplate/edit/process | |
| parent | 61e2f89c40a50478d12b4818400caff32d20f61a (diff) | |
backdate credits, RT#32320
Diffstat (limited to 'httemplate/edit/process')
| -rwxr-xr-x | httemplate/edit/process/cust_credit.cgi | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index e442d7fa6..39c6f1997 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -42,11 +42,20 @@ if (!$reasonnum) { } $cgi->param('reasonnum', $reasonnum) unless $error; +my $_date; +if ( $FS::CurrentUser::CurrentUser->access_right('Backdate credit') ) { + $_date = parse_datetime($cgi->param('_date')); +} +else { + $_date = time; +} + +my @fields = grep { $_ ne '_date' } fields('cust_credit'); + unless ($error) { my $new = new FS::cust_credit ( { - map { - $_, scalar($cgi->param($_)); - } fields('cust_credit') + _date => $_date, + map { $_ => scalar($cgi->param($_)) } @fields } ); $error = $new->insert; } |
