diff --git a/src/schedule-2.0/src/Service/dolibarrApi.php b/src/schedule-2.0/src/Service/dolibarrApi.php index 1353568..1bf2e1b 100644 --- a/src/schedule-2.0/src/Service/dolibarrApi.php +++ b/src/schedule-2.0/src/Service/dolibarrApi.php @@ -39,7 +39,7 @@ class dolibarrApi $qty = $qty + intval($line['qty']); } $order['total_qty'] = $qty; - array_push( $tbcontent, $order); + array_push($tbcontent, $order); } return $tbcontent; } @@ -65,11 +65,11 @@ class dolibarrApi $order['total_qty'] = $qty; return $order; } + public function getPropals() { $start=new \Datetime(); $start->sub(new \DateInterval('P6M')); - $response = $this->client->request('GET',$this->doliuri."/api/index.php/proposals?sortfield=t.rowid&sortorder=DESC&limit=100&sqlfilters=(t.datec%3A%3E%3A'".$start->format("Ymd")."')"); diff --git a/src/schedule-2.0/templates/Offer/getorders.html.twig b/src/schedule-2.0/templates/Offer/getorders.html.twig index 9a9529d..55fe391 100644 --- a/src/schedule-2.0/templates/Offer/getorders.html.twig +++ b/src/schedule-2.0/templates/Offer/getorders.html.twig @@ -21,7 +21,8 @@ Nouvelles Commandes Dolibarr -
+Liste des dernières commandes/propal récupérées depuis Dolibarr.
+ Les commandes doivent avoir un statut "Validée", et le Propal un statut "Signée" pour apparaître dans la liste.
{{offer.project.customer.name}} | {{offer.project.name}} | {{offer.name}} | + {%if offer.iddolibarr %} + {% if offer.typedolibarr == "commande" %}{{offer.ref}} | {% endif %} + {% if offer.typedolibarr == "propal" %}{{offer.ref}} | {% endif %} + {% endif %}{{offer.ref}} | {{offer.quantity|number_format(2, '.', ' ')}} | {{offer.pu|number_format(2, '.', ' ')}} |