Selaa lähdekoodia

Merge branch 'hotfix/V8-7295-ne-pas-afficher-les-factures-pro'

Olivier Massot 6 kuukautta sitten
vanhempi
commit
05e9b8437a
1 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 12 2
      src/Service/Dolibarr/DolibarrApiService.php

+ 12 - 2
src/Service/Dolibarr/DolibarrApiService.php

@@ -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) {