|
|
@@ -86,7 +86,12 @@ class DolibarrApiService extends ApiRequestService
|
|
|
try {
|
|
|
return $this->getJsonContent(
|
|
|
'invoices',
|
|
|
- ['sortfield' => 'datef', 'sortorder' => 'DESC', 'limit' => 5, 'sqlfilters' => 'fk_soc:=:'.$socId]);
|
|
|
+ [
|
|
|
+ 'sortfield' => 'datef',
|
|
|
+ 'sortorder' => 'DESC',
|
|
|
+ 'limit' => 5,
|
|
|
+ 'sqlfilters' => "(fk_soc:=:$socId) and (fk_statut:!=:0)"
|
|
|
+ ]);
|
|
|
} catch (HttpException $e) {
|
|
|
if ($e->getStatusCode() === 404) {
|
|
|
// /!\ The dolibarr API will return a 404 error if no results are found...
|
|
|
@@ -107,7 +112,12 @@ class DolibarrApiService extends ApiRequestService
|
|
|
try {
|
|
|
$results = $this->getJsonContent(
|
|
|
'orders',
|
|
|
- ['sortfield' => 't.date_valid', 'sortorder' => 'DESC', 'limit' => 1, 'sqlfilters' => 'fk_soc:=:'.$socId]
|
|
|
+ [
|
|
|
+ 'sortfield' => 't.date_valid',
|
|
|
+ 'sortorder' => 'DESC',
|
|
|
+ 'limit' => 1,
|
|
|
+ 'sqlfilters' => 'fk_soc:=:'.$socId
|
|
|
+ ]
|
|
|
);
|
|
|
} catch (HttpException $e) {
|
|
|
if ($e->getStatusCode() === 404) {
|