diff options
author | ivan <ivan> | 2011-01-12 06:26:42 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-01-12 06:26:42 +0000 |
commit | 5bd39b3a93605d45b74b3cfcc447a1f64633ba7d (patch) | |
tree | 38c702d003173d9bbd5d4946fa8a623af99697c0 | |
parent | f09bfd28e16b27d8d62c81abebb8062223ce0114 (diff) |
fix otaker getting inserted and messing up discount reports; upgrade fixes db, RT#10876
-rw-r--r-- | FS/FS/cust_pkg.pm | 1 | ||||
-rw-r--r-- | FS/FS/cust_pkg_discount.pm | 3 | ||||
-rw-r--r-- | httemplate/edit/process/cust_pkg_discount.html | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 324dbba43..d9604459f 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -2506,7 +2506,6 @@ sub insert_discount { 'discountnum' => $self->discountnum, 'months_used' => 0, 'end_date' => '', #XXX - 'otaker' => $self->otaker, #for the create a new discount case '_type' => $self->discountnum__type, 'amount' => $self->discountnum_amount, diff --git a/FS/FS/cust_pkg_discount.pm b/FS/FS/cust_pkg_discount.pm index 3770a2b79..7b6b203b8 100644 --- a/FS/FS/cust_pkg_discount.pm +++ b/FS/FS/cust_pkg_discount.pm @@ -165,10 +165,13 @@ sub check { || $self->ut_float('months_used') #actually decimal, but this will do || $self->ut_numbern('end_date') || $self->ut_alphan('otaker') + || $self->ut_numbern('usernum') || $self->ut_enum('disabled', [ '', 'Y' ] ) ; return $error if $error; + $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum; + $self->SUPER::check; } diff --git a/httemplate/edit/process/cust_pkg_discount.html b/httemplate/edit/process/cust_pkg_discount.html index e3249d79c..ad9842a89 100644 --- a/httemplate/edit/process/cust_pkg_discount.html +++ b/httemplate/edit/process/cust_pkg_discount.html @@ -34,7 +34,6 @@ my $cust_pkg_discount = new FS::cust_pkg_discount { 'discountnum' => scalar($cgi->param('discountnum')), 'months_used' => 0, 'end_date' => '', #XXX - 'otaker' => $curuser->username, #for the create a new discount case '_type' => scalar($cgi->param('discountnum__type')), 'amount' => scalar($cgi->param('discountnum_amount')), |