Files
dsi-commander/resources/views/pdf/commande.blade.php

289 lines
9.4 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Proposition de commande {{ $commande->numero_commande }}</title>
<style>
@page {
margin: 0cm 0cm;
}
body {
font-family: 'Helvetica', Arial, sans-serif;
font-size: 11pt;
color: #333;
margin: 0;
padding: 0;
}
.header-stripe {
background-color: #2c3e50;
height: 10px;
width: 100%;
}
.container {
padding: 40px;
}
.header {
margin-bottom: 40px;
}
.logo-container {
float: left;
width: 50%;
}
.order-meta {
float: right;
width: 50%;
text-align: right;
}
.order-meta h1 {
margin: 0;
font-size: 18pt;
color: #2c3e50;
text-transform: uppercase;
}
.order-meta p {
margin: 5px 0 0;
color: #7f8c8d;
font-weight: bold;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
.info-grid {
width: 100%;
margin-bottom: 40px;
border-collapse: collapse;
}
.info-grid td {
vertical-align: top;
width: 50%;
}
.info-box {
padding: 0 10px;
}
.info-box h3 {
font-size: 10pt;
text-transform: uppercase;
color: #34495e;
border-bottom: 2px solid #ecf0f1;
padding-bottom: 5px;
margin-bottom: 10px;
}
.info-content {
line-height: 1.5;
}
.info-content strong {
color: #2c3e50;
}
.table-items {
width: 100%;
border-collapse: collapse;
margin-bottom: 30px;
}
.table-items th {
background-color: #f8f9fa;
color: #2c3e50;
text-transform: uppercase;
font-size: 9pt;
padding: 12px 10px;
border-bottom: 2px solid #dee2e6;
text-align: left;
}
.table-items td {
padding: 12px 10px;
border-bottom: 1px solid #eee;
font-size: 10pt;
}
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.summary-container {
width: 100%;
}
.summary-notes {
float: left;
width: 55%;
}
.summary-totals {
float: right;
width: 40%;
}
.summary-totals table {
width: 100%;
border-collapse: collapse;
}
.summary-totals td {
padding: 8px 10px;
}
.summary-totals tr.grand-total {
background-color: #f8f9fa;
font-weight: bold;
font-size: 13pt;
color: #2c3e50;
}
.notes-box {
padding: 15px;
background-color: #fdfdfd;
border-left: 4px solid #bdc3c7;
font-style: italic;
font-size: 10pt;
}
.footer-signatures {
margin-top: 60px;
page-break-inside: avoid;
}
.signature-table {
width: 100%;
border-collapse: separate;
border-spacing: 20px 0;
}
.signature-table td {
width: 50%;
border: 1px dashed #bdc3c7;
padding: 15px;
height: 120px;
vertical-align: top;
}
.signature-table p {
margin: 0;
font-weight: bold;
font-size: 9pt;
color: #7f8c8d;
text-transform: uppercase;
}
.watermark {
position: absolute;
bottom: 20px;
right: 40px;
font-size: 8pt;
color: #bdc3c7;
}
</style>
</head>
<body>
<div class="header-stripe"></div>
<div class="container">
<div class="header clearfix">
<div class="logo-container">
<img src="{{ public_path('images/logo_agglo.png') }}" style="height: 70px;">
</div>
<div class="order-meta">
<h1>Proposition de commande</h1>
<p> {{ $commande->numero_commande }}</p>
<div style="margin-top: 10px; font-size: 10pt; color: #333;">
Date: {{ \Carbon\Carbon::parse($commande->date_demande)->format('d/m/Y') }}<br>
Objet: {{ $commande->objet }}
</div>
</div>
</div>
<table class="info-grid">
<tr>
<td>
<div class="info-box">
<h3>Émetteur / Service</h3>
<div class="info-content">
<strong>{{ $commande->service->nom ?? 'Service Administratif' }}</strong><br>
@if($commande->commune)
{{ $commande->commune->nom }} ({{ $commande->commune->code_postal }})<br>
@endif
<span style="font-size: 9pt; color: #7f8c8d;">Demandé par: {{ $commande->demandeur->name }}</span>
</div>
</div>
</td>
<td>
<div class="info-box">
<h3>Fournisseur</h3>
<div class="info-content">
<strong>{{ $commande->fournisseur->nom ?? 'Non spécifié' }}</strong><br>
@if($commande->reference_fournisseur)
<span style="font-size: 9pt;">Réf. Fournisseur: {{ $commande->reference_fournisseur }}</span><br>
@endif
@if($commande->date_souhaitee)
<span style="font-size: 9pt;">Livraison souhaitée: {{ \Carbon\Carbon::parse($commande->date_souhaitee)->format('d/m/Y') }}</span>
@endif
</div>
</div>
</td>
</tr>
</table>
<table class="table-items">
<thead>
<tr>
<th width="50%">Désignation</th>
<th width="15%">Référence</th>
<th width="10%" class="text-center">Qté</th>
<th width="12%" class="text-right">P.U. HT</th>
<th width="13%" class="text-right">Total HT</th>
</tr>
</thead>
<tbody>
@foreach($commande->lignes as $ligne)
<tr>
<td>{{ $ligne->designation }}</td>
<td style="color: #7f8c8d; font-size: 9pt;">{{ $ligne->reference ?? '-' }}</td>
<td class="text-center">{{ number_format($ligne->quantite, 0, ',', ' ') }}</td>
<td class="text-right">{{ number_format($ligne->prix_unitaire_ht, 2, ',', ' ') }} </td>
<td class="text-right"><strong>{{ number_format($ligne->quantite * $ligne->prix_unitaire_ht, 2, ',', ' ') }} </strong></td>
</tr>
@endforeach
</tbody>
</table>
<div class="summary-container clearfix">
<div class="summary-notes">
@if($commande->description || $commande->justification)
<div class="info-box" style="padding: 0;">
<h3>Notes & Informations</h3>
<div class="notes-box">
{{ $commande->description ?: $commande->justification }}
</div>
</div>
@endif
</div>
<div class="summary-totals">
<table>
<tr>
<td class="text-right">Sous-total HT :</td>
<td class="text-right">{{ number_format($commande->montant_ht, 2, ',', ' ') }} </td>
</tr>
@php
$tva = $commande->montant_ttc - $commande->montant_ht;
@endphp
@if($tva > 0)
<tr>
<td class="text-right">TVA :</td>
<td class="text-right">{{ number_format($tva, 2, ',', ' ') }} </td>
</tr>
@endif
<tr class="grand-total">
<td class="text-right">TOTAL TTC :</td>
<td class="text-right">{{ number_format($commande->montant_ttc, 2, ',', ' ') }} </td>
</tr>
</table>
</div>
</div>
<div class="footer-signatures">
<table class="signature-table">
<tr>
<td>
<p>Date & Signature Demandeur</p>
</td>
<td>
<p>Bon pour accord (Direction / Élu)</p>
</td>
</tr>
</table>
</div>
</div>
<div class="watermark">
DSICommander - Généré le {{ now()->format('d/m/Y H:i') }}
</div>
</body>
</html>