api_dolibarr #53

Manually merged
mlamalle merged 6 commits from api_dolibarr into master 2020-11-03 09:55:48 +01:00
3 changed files with 8 additions and 3 deletions
Showing only changes of commit 5ea06c9aec - Show all commits

View File

@@ -39,7 +39,7 @@ class dolibarrApi
$qty = $qty + intval($line['qty']); $qty = $qty + intval($line['qty']);
} }
$order['total_qty'] = $qty; $order['total_qty'] = $qty;
array_push( $tbcontent, $order); array_push($tbcontent, $order);
} }
return $tbcontent; return $tbcontent;
} }
@@ -65,11 +65,11 @@ class dolibarrApi
$order['total_qty'] = $qty; $order['total_qty'] = $qty;
return $order; return $order;
} }
public function getPropals() { public function getPropals() {
$start=new \Datetime(); $start=new \Datetime();
$start->sub(new \DateInterval('P6M')); $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")."')"); $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")."')");

View File

@@ -21,7 +21,8 @@
Nouvelles Commandes Dolibarr Nouvelles Commandes Dolibarr
</h1> </h1>
<p></p> <p>Liste des dernières commandes/propal récupérées depuis Dolibarr.<br>
Les commandes doivent avoir un statut "Validée", et le Propal un statut "Signée" pour apparaître dans la liste.</p>
<div class="card"> <div class="card">
<div class="dataTable_wrapper"> <div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover small" id="dataTables" style="width:100%"> <table class="table table-striped table-bordered table-hover small" id="dataTables" style="width:100%">

View File

@@ -85,6 +85,10 @@
<td>{{offer.project.customer.name}}</td> <td>{{offer.project.customer.name}}</td>
<td>{{offer.project.name}}</td> <td>{{offer.project.name}}</td>
<td>{{offer.name}}</td> <td>{{offer.name}}</td>
{%if offer.iddolibarr %}
{% if offer.typedolibarr == "commande" %}<td><a href="https://doli.cadoles.com/dolibarr/commande/card.php?id={{offer.iddolibarr}}" target="_blank">{{offer.ref}}</td>{% endif %}
{% if offer.typedolibarr == "propal" %}<td><a href="https://doli.cadoles.com/dolibarr/comm/propal/card.php?id={{offer.iddolibarr}}" target="_blank">{{offer.ref}}</td>{% endif %}
{% endif %}
<td>{{offer.ref}}</td> <td>{{offer.ref}}</td>
<td class="text-right">{{offer.quantity|number_format(2, '.', ' ')}}</td> <td class="text-right">{{offer.quantity|number_format(2, '.', ' ')}}</td>
<td class="text-right">{{offer.pu|number_format(2, '.', ' ')}}</td> <td class="text-right">{{offer.pu|number_format(2, '.', ' ')}}</td>