FIX error message
This commit is contained in:
parent
5ae74f8ae1
commit
e61d625577
@ -472,6 +472,11 @@ class Invoices extends DolibarrApi
|
||||
* @url POST {id}/lines
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws 200
|
||||
* @throws 401
|
||||
* @throws 404
|
||||
* @throws 400
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
@ -528,11 +533,11 @@ class Invoices extends DolibarrApi
|
||||
$request_data->fk_unit
|
||||
);
|
||||
|
||||
if ($updateRes > 0) {
|
||||
return $updateRes;
|
||||
|
||||
if ($updateRes < 0) {
|
||||
throw new RestException(400, 'Unable to insert the new line. Check your inputs. '.$this->invoice->error);
|
||||
}
|
||||
throw new RestException(400, 'Unable to insert the new line. Check your inputs.');
|
||||
|
||||
return $updateRes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user