2
0
forked from Wavyzz/dolibarr

Add API close to close an order

This commit is contained in:
Laurent Destailleur
2017-10-18 15:34:03 +02:00
parent 8e4cb2ea79
commit 99239cbb38
6 changed files with 76 additions and 6 deletions

View File

@@ -557,9 +557,10 @@ class Commande extends CommonOrder
* Close order
*
* @param User $user Objet user that close
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, >0 if OK
*/
function cloture($user)
function cloture($user, $notrigger=0)
{
global $conf;
@@ -580,10 +581,13 @@ class Commande extends CommonOrder
if ($this->db->query($sql))
{
// Call trigger
$result=$this->call_trigger('ORDER_CLOSE',$user);
if ($result < 0) $error++;
// End call triggers
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('ORDER_CLOSE',$user);
if ($result < 0) $error++;
// End call triggers
}
if (! $error)
{