svg
This commit is contained in:
187
templates/Offer/list.html.twig
Normal file
187
templates/Offer/list.html.twig
Normal file
@@ -0,0 +1,187 @@
|
||||
{% 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 {% if app.session.get('viewservice') %}PAR ACTVITE{%else%}PAR DOMAINE{%endif%}
|
||||
</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_dolibarr') }}>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>
|
||||
|
||||
<div class="custom-control custom-switch float-right mr-3">
|
||||
<input type="checkbox" class="custom-control-input" id="switchservice" {% if app.session.get('viewservice') %} checked {% endif %}>
|
||||
{% if app.session.get('viewservice') %}
|
||||
<label class="custom-control-label" for="switchservice">Vue par Activité</label>
|
||||
{% else %}
|
||||
<label class="custom-control-label" for="switchservice">Vue par Domaine</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<p></p>
|
||||
|
||||
{% if app.session.get('viewservice') %}
|
||||
{% set loop01s=services %}
|
||||
{% else %}
|
||||
{% set loop01s=domaines %}
|
||||
{% endif %}
|
||||
|
||||
{%for loop01 in loop01s %}
|
||||
{% if not loop01.projects is empty %}
|
||||
{% set haveoffer=false %}
|
||||
{% set haveproject=false %}
|
||||
{% for offer in loop01.offers %}
|
||||
{% if app.session.get('activeoffer')==offer.active and app.session.get('activeproject')==offer.project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==offer.project.id) %}
|
||||
{% set haveoffer=true %}
|
||||
{% set haveproject=true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if haveoffer and haveproject %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> {{ loop01.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="100px">Proposition</th>
|
||||
<th width="100px">Ref</th>
|
||||
<th width="70px" class="text-center no-string">Validé hors</th>
|
||||
<th width="70px" class="text-center no-string">Frais</th>
|
||||
<th width="70px" class="text-center no-string">Qt</th>
|
||||
<th width="70px" class="text-center no-string">PU</th>
|
||||
<th width="100px" class="text-center no-string">Total</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if loop01.offers is defined %}
|
||||
{% for offer in loop01.offers %}
|
||||
{% if app.session.get('activeoffer')==offer.active and app.session.get('activeproject')==offer.project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==offer.project.id) %}
|
||||
<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 %}
|
||||
<td><a href="{{doliUri}}/commande/card.php?ref={{offer.ref}}" target="_blank">{{offer.ref}}</td>
|
||||
{% else %}
|
||||
<td>{{offer.ref}}</td>
|
||||
{% endif %}
|
||||
|
||||
<td class="text-right">{{offer.validate|number_format(2, '.', ' ')}}</td>
|
||||
<td class="text-right">{{offer.cost|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.total|number_format(2, '.', ' ')}}</td>
|
||||
</tr>
|
||||
{%endif%}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for project in loop01.projects %}
|
||||
{% for offer in project.offers %}
|
||||
{% if app.session.get('activeoffer')==offer.active and app.session.get('activeproject')==offer.project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==offer.project.id) %}
|
||||
<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 %}
|
||||
<td><a href="{{doliUri}}/commande/card.php?ref={{offer.ref}}" target="_blank">{{offer.ref}}</td>
|
||||
{% else %}
|
||||
<td>{{offer.ref}}</td>
|
||||
{% endif %}
|
||||
<td class="text-right">{{offer.validate|number_format(2, '.', ' ')}}</td>
|
||||
<td class="text-right">{{offer.cost|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.total|number_format(2, '.', ' ')}}</td>
|
||||
</tr>
|
||||
{%endif%}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</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' )}}";
|
||||
});
|
||||
|
||||
$('#switchservice').change(function() {
|
||||
window.location="{{ path('app_offer_viewservice' )}}";
|
||||
});
|
||||
{% endblock %}
|
Reference in New Issue
Block a user