mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-23 13:24:28 +01:00
API orders: Update demand reason on order update
This commit is contained in:
@@ -623,6 +623,12 @@ class Orders extends DolibarrApi
|
||||
throw new RestException(400, 'Error while updating availability');
|
||||
}
|
||||
|
||||
// Update demand reason
|
||||
if (!empty($this->commande->demand_reason_id) && $this->commande->demand_reason_id > 0) {
|
||||
if ($this->commande->demand_reason($this->commande->demand_reason_id) < 0)
|
||||
throw new RestException(400, 'Error while updating demand reason');
|
||||
}
|
||||
|
||||
if ($this->commande->update(DolibarrApiAccess::$user) > 0)
|
||||
{
|
||||
return $this->get($id);
|
||||
|
||||
Reference in New Issue
Block a user