diff --git a/ChangeLog b/ChangeLog index 0f2ed877a13..2f9bbcc45c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,7 +39,7 @@ Dolibarr better: - Trigger name SUPPLIER_PROPOSAL_CREATE has been renamed into PROPOSAL_SUPPLIER_CREATE. - A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters, no more required, were also removed. Use this new one if you were using one of them. - +- The trigger that activate or close a contract line is run on a contract line, not on contract. ***** ChangeLog for 4.0.2 compared to 4.0.1 ***** diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 032dcf6f3d9..85fccbc543b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -73,7 +73,7 @@ class BookKeeping extends CommonObject public $id; /** */ - public $doc_date = ''; + public $doc_date; public $doc_type; public $doc_ref; public $fk_doc; @@ -1163,9 +1163,12 @@ class BookKeeping extends CommonObject * @return void */ public function initAsSpecimen() { - $this->id = 0; + global $user; - $this->doc_date = ''; + $now=dol_now(); + + $this->id = 0; + $this->doc_date = $now; $this->doc_type = ''; $this->doc_ref = ''; $this->fk_doc = ''; @@ -1173,11 +1176,11 @@ class BookKeeping extends CommonObject $this->code_tiers = ''; $this->numero_compte = ''; $this->label_compte = ''; - $this->debit = ''; + $this->debit = 99.9; $this->credit = ''; $this->montant = ''; $this->sens = ''; - $this->fk_user_author = ''; + $this->fk_user_author = $user->id; $this->import_key = ''; $this->code_journal = ''; $this->piece_num = ''; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 50c40a85dc3..f36df0773eb 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -441,7 +441,6 @@ class Projects extends DolibarrApi { throw new RestException(500, $this->project->error); } - return false; } /** diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 735b830e9d5..a5bab614a4a 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -445,8 +445,6 @@ class Tasks extends DolibarrApi { throw new RestException(500, $this->task->error); } - - return false; } /**