NEW Update bank account when updating an invoice

Add the ability to update the bankaccount when updating an invoice
This commit is contained in:
Neil Orley 2017-12-19 14:14:26 +01:00
parent 7e3a2d75bb
commit a3f4066790

View File

@ -422,6 +422,15 @@ class Invoices extends DolibarrApi
$this->invoice->$field = $value;
}
// update bank account
if(!empty($this->invoice->fk_account))
{
if($this->invoice->setBankAccount($this->invoice->fk_account) == 0)
{
throw new RestException(400,$this->invoice->error);
}
}
if($this->invoice->update($id, DolibarrApiAccess::$user))
return $this->get ($id);