{% extends 'basee.html.twig' %}{% block title %}Recette{% endblock %}{% block subtitle %}Recette{% endblock %}{% block subtitle2 %}Details recette{% endblock %}{% block body %} <section class="section"> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-body"> <h5 class="card-title">Recette du {{ recette.dateRecette|date('Y-m-d') }}</h5> <!-- Table with stripped rows --> <table id="example" class="table datatable table-sm table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%"> <thead> <tr> <th scope="col">Description</th> <th scope="col">Montant</th> </tr> </thead> <tbody> {% for depense in recette.depenses %} <tr> <td id="crd">{{ depense.description }}</td> <td id="crd">{{ depense.montant | format_number }}</td> </tr> {% else %} <tr> <td colspan="2" id="crd">0 dépenses enregistrées</td> </tr> {% endfor %} </tbody> </table> <!-- End Table with stripped rows --> <div class="row mb-3"> <div > <p>Total Dépenses: {{ totalDepenses }}</p> </div> <div class="col-lg-6"> <p>Montant Net: {{ montantNet }}</p> </div> </div> <hr/> <h5 class="mt-4">Détails de la recette</h5> {% if recette.vente %} <div class="d-flex justify-content-between align-items-center mb-2"> <span class="badge bg-info">Vente</span> <a href="{{ path('app_vente_show', {'id': recette.vente.id}) }}" class="btn btn-outline-primary btn-sm">Voir la vente #{{ recette.vente.id }}</a> </div> <div class="table-responsive"> <table class="table table-sm table-striped"> <thead> <tr> <th>Produit</th> <th class="text-end">Qté</th> <th class="text-end">PU</th> <th class="text-end">Total</th> </tr> </thead> <tbody> {% for dv in recette.vente.detailsVentes %} <tr> <td id="crd">{{ dv.produit ? dv.produit.Nom : 'Produit supprimé' }}</td> <td id="crd" class="text-end">{{ dv.quantiteVendu }}</td> <td id="crd" class="text-end">{{ dv.prixUnitaire | format_number }}</td> <td id="crd" class="text-end">{{ dv.prixTotal | format_number }}</td> </tr> {% else %} <tr> <td id="crd" colspan="4" class="text-center text-muted">Aucun détail de vente</td> </tr> {% endfor %} </tbody> </table> </div> {% endif %} {% if recette.factureService %} <div class="d-flex justify-content-between align-items-center mt-4 mb-2"> <span class="badge bg-info">Service</span> <a href="{{ path('app_facture_service_show', {'id': recette.factureService.id}) }}" class="btn btn-outline-primary btn-sm">Voir la facture #{{ recette.factureService.id }}</a> </div> <div class="table-responsive"> <table class="table table-sm table-striped"> <thead> <tr> <th>Service</th> <th class="text-end">Prix</th> </tr> </thead> <tbody> {% for ligne in recette.factureService.serviceFactureLignes %} <tr> <td id="crd">{{ ligne.service ? ligne.service.nom : 'Service' }}</td> <td id="crd" class="text-end">{{ ligne.prix | format_number }}</td> </tr> {% else %} <tr> <td id="crd" colspan="2" class="text-center text-muted">Aucune ligne de service</td> </tr> {% endfor %} </tbody> </table> </div> {% endif %} </div> <div class="card-footer"> <a href="{{ path('app_recettes') }}" class="btn btn-primary">Retour</a> </div> </div> </div> </div> </section>{% endblock %}