From 5bd39b3a93605d45b74b3cfcc447a1f64633ba7d Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 12 Jan 2011 06:26:42 +0000 Subject: [PATCH] fix otaker getting inserted and messing up discount reports; upgrade fixes db, RT#10876 --- FS/FS/cust_pkg.pm | 1 - FS/FS/cust_pkg_discount.pm | 3 +++ 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')), -- 2.11.0