142 lines
6.8 KiB
Twig
142 lines
6.8 KiB
Twig
{% extends "base.html.twig" %}
|
|
|
|
{% block localstyle %}
|
|
td {
|
|
padding:5px !important;
|
|
}
|
|
{% if fgprint is defined and fgprint %}
|
|
table { font-size:10px;}
|
|
th,td {
|
|
border: 1px solid #37474F;
|
|
}
|
|
thead {
|
|
display: table-header-group;
|
|
}
|
|
tr { page-break-inside: avoid; }
|
|
{%endif%}
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
<h1 class="page-header">
|
|
COMMANDES
|
|
</h1>
|
|
|
|
<a class="btn btn-success" href={{ path('app_offer_submit') }}>Ajouter</a>
|
|
{% if doliactive == "true" %}
|
|
<a class="btn btn-success" href={{ path('app_offer_getorders') }}>Récupérer les commandes de Dolibarr</a>
|
|
{% endif %}
|
|
|
|
<div class="custom-control custom-switch float-right">
|
|
<input type="checkbox" class="custom-control-input" id="switchactiveproject" {% if app.session.get('activeproject') %} checked {% endif %}>
|
|
<label class="custom-control-label" for="switchactiveproject">Projet Actif</label>
|
|
</div>
|
|
|
|
<div class="custom-control custom-switch float-right" style="margin-right:10px">
|
|
<input type="checkbox" class="custom-control-input" id="switchactiveoffer" {% if app.session.get('activeoffer') %} checked {% endif %}>
|
|
<label class="custom-control-label" for="switchactiveoffer">Proposition Active</label>
|
|
</div>
|
|
|
|
<p></p>
|
|
|
|
{%for service in services %}
|
|
{% if not service.projects is empty %}
|
|
{% set haveoffer=false %}
|
|
{% set haveproject=false %}
|
|
{% for project in service.projects %}
|
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
|
{% for offer in project.offers %}
|
|
{% if app.session.get('activeoffer')==offer.active %}
|
|
{% set haveoffer=true %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% set haveproject=true %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if haveoffer and haveproject %}
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<i class="fa fa-table fa-fw"></i> {{ service.name }}
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
<div class="dataTable_wrapper">
|
|
<table class="table table-striped table-bordered table-hover small" id="dataTables" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th width="70px" class="no-sort no-print">Action</th>
|
|
<th width="200px">Client</th>
|
|
<th>Projet</th>
|
|
<th width="250px">Proposition</th>
|
|
<th width="150px">Ref</th>
|
|
<th width="100px" class="text-center no-string">Qt</th>
|
|
<th width="100px" class="text-center no-string">PU</th>
|
|
<th width="100px" class="text-center no-string">Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for project in service.projects %}
|
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
|
{% for offer in project.offers %}
|
|
{% if app.session.get('activeoffer')==offer.active %}
|
|
<tr>
|
|
<td class="no-print">
|
|
<a href="{{path("app_offer_update",{id:offer.id})}}"><i class="fa fa-file"></i></a>
|
|
</td>
|
|
<td>{{offer.project.customer.name}}</td>
|
|
<td>{{offer.project.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 class="text-right">{{offer.quantity|number_format(2, '.', ' ')}}</td>
|
|
<td class="text-right">{{offer.pu|number_format(2, '.', ' ')}}</td>
|
|
<td class="text-right">{{offer.total|number_format(2, '.', ' ')}}</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{%endif%}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endblock %}
|
|
|
|
{% block localjavascript %}
|
|
$(document).ready(function() {
|
|
{% if not fgprint is defined or not fgprint %}
|
|
$('.table ').DataTable({
|
|
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
|
responsive: true,
|
|
iDisplayLength: 100,
|
|
order: [[ 1, "asc" ]]
|
|
});
|
|
{%else%}
|
|
$('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer");
|
|
{% endif %}
|
|
|
|
});
|
|
|
|
function myprint() {
|
|
href=document.location.href;
|
|
document.location.href=href+"?fgprint=true";
|
|
}
|
|
|
|
$('#switchactiveproject').change(function() {
|
|
window.location="{{ path('app_offer_activeproject' )}}";
|
|
});
|
|
|
|
$('#switchactiveoffer').change(function() {
|
|
window.location="{{ path('app_offer_activeoffer' )}}";
|
|
});
|
|
|
|
{% endblock %} |