From 171e388f6df562c1d2b2cad538304bee17830840 Mon Sep 17 00:00:00 2001 From: Neil Orley Date: Tue, 19 Dec 2017 14:16:51 +0100 Subject: [PATCH] NEW Update bank account when updating an order Add the ability to update the bankaccount when updating an order --- htdocs/commande/class/api_orders.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 1b080c4e995..c15befe46e2 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -418,6 +418,15 @@ class Orders extends DolibarrApi if ($this->commande->availability($this->commande->availability_id) < 0) throw new RestException(400, 'Error while updating availability'); } + // update bank account + if(!empty($this->commande->fk_account)) + { + if($this->commande->setBankAccount($this->commande->fk_account) == 0) + { + throw new RestException(400,$this->commande->error); + } + } + if ($this->commande->update(DolibarrApiAccess::$user) > 0) {