From: ivan Date: Wed, 12 Jan 2011 06:26:42 +0000 (+0000) Subject: fix otaker getting inserted and messing up discount reports; upgrade fixes db, RT... X-Git-Tag: freeside_2_3_0~769 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=5bd39b3a93605d45b74b3cfcc447a1f64633ba7d;p=freeside.git fix otaker getting inserted and messing up discount reports; upgrade fixes db, RT#10876 --- 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')),