Unknown
This commit is contained in:
parent
5ae74f8ae1
commit
d35fc67cfc
@ -472,6 +472,11 @@ class Invoices extends DolibarrApi
|
|||||||
* @url POST {id}/lines
|
* @url POST {id}/lines
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
|
*
|
||||||
|
* @throws 200
|
||||||
|
* @throws 401
|
||||||
|
* @throws 404
|
||||||
|
* @throws 400
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = NULL) {
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
@ -528,11 +533,11 @@ class Invoices extends DolibarrApi
|
|||||||
$request_data->fk_unit
|
$request_data->fk_unit
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes > 0) {
|
if ($updateRes < 0) {
|
||||||
return $updateRes;
|
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