Linting api_invoices.class.php
This commit is contained in:
parent
b8cb080f0d
commit
1d218b3260
@ -1006,14 +1006,14 @@ class Invoices extends DolibarrApi
|
|||||||
if (!DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
|
if (!DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$discountcheck = new DiscountAbsolute($this->db);
|
$discountcheck = new DiscountAbsolute($this->db);
|
||||||
$result = $discountcheck->fetch(0, $this->invoice->id);
|
$result = $discountcheck->fetch(0, $this->invoice->id);
|
||||||
|
|
||||||
if($result == 0){
|
if ($result == 0){
|
||||||
throw new RestException(404, 'Discount not found');
|
throw new RestException(404, 'Discount not found');
|
||||||
}
|
}
|
||||||
else if($result < 0){
|
if ($result < 0){
|
||||||
throw new RestException(500, $discountcheck->error);
|
throw new RestException(500, $discountcheck->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user