[#271]Créer une nouvelle expédition (étape 1) (!12)

| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|          #271        |         Créer une nouvelle expédition (étape 1)        |

## Description de la PR

## Modification du .env

## Check list

[x ] Pas de régression
TU/TI/TF rédigée
[x ] TU/TI/TF OK
[x ] CHANGELOG modifié

Co-authored-by: kevin <kevin@yuno.malio.fr>
Reviewed-on: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/12
Reviewed-by: Autin <tristan@yuno.malio.fr>
Co-authored-by: Matteo <matteo@yuno.malio.fr>
Co-committed-by: Matteo <matteo@yuno.malio.fr>
This commit is contained in:
Matteo
2026-02-12 07:31:40 +00:00
committed by Kevin Boudet
parent ab6de16319
commit b1c3952d09
50 changed files with 2842 additions and 335 deletions
+60 -46
View File
@@ -141,16 +141,18 @@
<td style="width:30%; text-align:right; vertical-align:top; font-size: 14px;">
<div style="display:inline-block; width:75mm; line-height:1.3;">
<strong>{{ reception.supplier.name }}</strong><br>
<span>{{ reception.address.street }}</span><br>
{% if reception.address.street2 %}
<strong>{{ reception.supplier ? reception.supplier.name : '-' }}</strong><br>
<span>{{ reception.address ? reception.address.street : '' }}</span><br>
{% if reception.address and reception.address.street2 %}
<span>{{ reception.address.street2 }}</span><br>
{% endif %}
<span>{{ reception.address.postalCode }} {{ reception.address.city }}</span><br>
{% if reception.supplier.phone %}
{% if reception.address %}
<span>{{ reception.address.postalCode }} {{ reception.address.city }}</span><br>
{% endif %}
{% if reception.supplier and reception.supplier.phone %}
<span>{{ reception.supplier.phone }}</span><br>
{% endif %}
{% if reception.supplier.email %}
{% if reception.supplier and reception.supplier.email %}
<span>{{ reception.supplier.email}}</span><br>
{% endif %}
</div>
@@ -168,7 +170,9 @@
<th style="width:25%; text-align:center; white-space:nowrap;">N° réception</th>
</tr>
<tr>
<td style="width:55%; text-align:center;">{{ reception.supplier.name }}</td>
<td style="width:55%; text-align:center;">
{{ reception.supplier ? reception.supplier.name : '-' }}
</td>
<td style="width:20%; text-align:center; white-space:nowrap;">
{{ reception.receptionDate|date('d/m/Y') }}
</td>
@@ -189,13 +193,11 @@
<tbody>
<tr>
<td style="width:75%;">
<strong>{{ reception.receptionType.label }}</strong><br><br>
<strong>{{ reception.receptionType ? reception.receptionType.label : '-' }}</strong><br><br>
<div class="bigtable-notes">
{% set grossWeight = null %}
{% set tareWeight = null %}
{% for weight in reception.weights %}
{% for weight in reception.weights|default([]) %}
{% if weight.type == 'gross' %}
{% set grossWeight = weight %}
<p>Poids à plein : {{ grossWeight.weight }}kg (pesée n°{{ grossWeight.dsd }} {{ grossWeight.weighedAt|date('d/m/Y H:i:s') }})</p>
@@ -219,45 +221,57 @@
<tr class="border-bottom">
<td>
<strong>
{% if reception.merchandiseType %}
{{ reception.merchandiseType.label }}
{% else %}
-
{% endif %}
Type de bovins
</strong>
<br><br>
<div class="bigtable-notes">
{% if reception.merchandiseType and reception.merchandiseType.code == 'AUTRES' and reception.merchandiseDetail %}
<p><strong>Précision</strong> : {{ reception.merchandiseDetail }}</p>
{% endif %}
{% if reception.merchandiseType and reception.merchandiseType.code == 'GRANULE' %}
{% set pelletGroups = {} %}
{% for selection in reception.pelletBuildings %}
{% set pelletLabel = selection.pelletType.label %}
{% if pelletGroups[pelletLabel] is not defined %}
{% set pelletGroups = pelletGroups|merge({ (pelletLabel): [] }) %}
{% endif %}
{% set pelletGroups = pelletGroups|merge({
(pelletLabel): pelletGroups[pelletLabel]|merge([selection.building.label])
}) %}
{% endfor %}
{% for pelletLabel, buildingLabels in pelletGroups %}
<p><strong>{{ pelletLabel }}</strong> : {{ buildingLabels|join(', ') }}</p>
{% if reception.receptionType and reception.receptionType.code == 'BOVINS' %}
{% if reception.bovinesTypes is not empty %}
{% for entry in reception.bovinesTypes %}
<p>
{{ entry.bovineType ? entry.bovineType.label : '-' }} : {{ entry.quantity ?? 0 }}
</p>
{% endfor %}
{% else %}
<p>Aucun dépôt de granulés renseigné.</p>
{% endfor %}
<p>-</p>
{% endif %}
{% if reception.bovineDetail %}
<p>Autres : {{ reception.bovineDetail }}</p>
{% endif %}
{% else %}
{% set buildingLabels = [] %}
{% for building in reception.buildings %}
{% set buildingLabels = buildingLabels|merge([building.label]) %}
{% endfor %}
{% if buildingLabels %}
<p><strong>Ferme</strong> : {{ buildingLabels|join(', ') }}</p>
{% if reception.merchandiseType and reception.merchandiseType.code == 'AUTRES' and reception.merchandiseDetail %}
<p><strong>Précision</strong> : {{ reception.merchandiseDetail }}</p>
{% endif %}
{% if reception.merchandiseType and reception.merchandiseType.code == 'GRANULE' %}
{% set pelletGroups = {} %}
{% for selection in reception.pelletBuildings|default([]) %}
{% set pelletLabel = selection.pelletType.label %}
{% if pelletGroups[pelletLabel] is not defined %}
{% set pelletGroups = pelletGroups|merge({ (pelletLabel): [] }) %}
{% endif %}
{% set pelletGroups = pelletGroups|merge({
(pelletLabel): pelletGroups[pelletLabel]|merge([selection.building.label])
}) %}
{% endfor %}
{% for pelletLabel, buildingLabels in pelletGroups %}
<p><strong>{{ pelletLabel }}</strong> : {{ buildingLabels|join(', ') }}</p>
{% else %}
<p>Aucun dépôt de granulés renseigné.</p>
{% endfor %}
{% else %}
<p>Aucun bâtiment renseigné.</p>
{% set buildingLabels = [] %}
{% for building in reception.buildings|default([]) %}
{% set buildingLabels = buildingLabels|merge([building.label]) %}
{% endfor %}
{% if buildingLabels %}
<p><strong>Ferme</strong> : {{ buildingLabels|join(', ') }}</p>
{% else %}
<p>Aucun bâtiment renseigné.</p>
{% endif %}
{% endif %}
{% endif %}
</div>
@@ -273,9 +287,9 @@
<tr>
<td style="width:60%; padding-right:8mm; vertical-align:top;">
<div class="meta">
Transporteur : <strong>{{ reception.carrier.name }}</strong><br>
Mode de livraison : <strong>{{ reception.truck.name }}</strong><br>
Immatriculation : <strong>{{ reception.licensePlate }}</strong><br><br>
Transporteur : <strong>{{ reception.carrier ? reception.carrier.name : '-' }}</strong><br>
Mode de livraison : <strong>{{ reception.truck ? reception.truck.name : '-' }}</strong><br>
Immatriculation : <strong>{{ reception.licensePlate ?? '-' }}</strong><br><br>
</div>
</td>
+292
View File
@@ -0,0 +1,292 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<style>
@page {
margin: 56px 56px;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
margin: 0;
color: #000;
}
p {
margin: 0;
}
em {
font-style: normal;
}
.company-block {
font-size: 14px;
text-align: left;
line-height: 1.3;
}
.box {
border: 1px solid #000;
border-radius: 10px;
padding: 10px;
font-size: 16px;
height: 80px;
}
.title {
text-align: center;
font-size: 18pt;
font-weight: 700;
margin: 64px 0 20px 0;
}
.info-table {
margin-bottom: 24px;
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
.info-table th {
font-size: 16px;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #333;
padding: 4px 6px;
vertical-align: top;
font-size: 12px;
}
th {
text-align: center;
font-weight: 700;
}
.layout, .layout td {
border: none !important;
padding: 0;
}
.bigtable-wrap {
border: 1px solid #000;
height: 360px;
margin-bottom: 10px;
}
.bigtable {
width: 100%;
height: 100%;
border: none;
border-collapse: collapse;
table-layout: fixed;
}
.bigtable th,
.bigtable td {
font-size: 16px;
border: 1px solid #333;
}
.bigtable thead th {
border-top: 0;
}
.bigtable tbody tr:last-child td {
border-bottom: 0;
}
.bigtable tr th:first-child,
.bigtable tr td:first-child {
border-left: 0;
}
.bigtable tr th:last-child,
.bigtable tr td:last-child {
border-right: 0;
}
.bigtable thead th {
border-bottom: 0;
}
.bigtable tbody tr:first-child td {
border-top: 1px solid #333;
}
.bigtable-notes {
font-size: 14px;
line-height: 1.25;
}
.border-bottom {
border-bottom: 1px solid #000;
}
.footer-block {
page-break-inside: avoid;
}
.signature-box {
height: 130px;
margin-bottom: 10px;
border: 0.5px solid #000;
padding: 6px 10px;
}
.meta {
font-size: 16px;
line-height: 1.35;
}
</style>
</head>
<body>
<!-- HEADER -->
<table class="layout" style="width:100%;">
<tr>
<td style="width:70%; vertical-align:top;">
<table class="layout" style="width:100%;">
<tr>
<td class="company-block" style="padding:0; border:none;">
<strong>SCEA LES NAUDS</strong><br>
14 Allée dArgenson<br>
Z.I Nord Secteur Est<br>
86100 CHATELLERAULT<br>
Tel. : 05 49 20 09 10<br>
Email : lpc.contacts@lpc-liot.fr<br>
RCS Châtellerault B 444 262 455
</td>
</tr>
</table>
</td>
<td style="width:30%; text-align:right; vertical-align:top; font-size: 14px;">
<div style="display:inline-block; width:75mm; line-height:1.3;">
<strong>{{ shipment.customer ? shipment.customer.label : '-' }}</strong><br>
<span>{{ shipment.address ? shipment.address.street : '' }}</span><br>
{% if shipment.address and shipment.address.street2 %}
<span>{{ shipment.address.street2 }}</span><br>
{% endif %}
{% if shipment.address %}
<span>{{ shipment.address.postalCode }} {{ shipment.address.city }}</span><br>
{% endif %}
</div>
</td>
</tr>
</table>
<div class="title">BON D'EXPEDITION</div>
<!-- INFOS (code/date/num) -->
<table class="info-table">
<tr>
<th style="width:55%; text-align:center;">Code client</th>
<th style="width:20%; text-align:center; white-space:nowrap;">Date</th>
<th style="width:25%; text-align:center; white-space:nowrap;">N° expédition</th>
</tr>
<tr>
<td style="width:55%; text-align:center;">
{{ shipment.customer ? shipment.customer.code : '-' }}
</td>
<td style="width:20%; text-align:center; white-space:nowrap;">
{{ shipment.shipmentDate|date('d/m/Y') }}
</td>
<td style="width:25%; text-align:center; white-space:nowrap;">
{{ shipment.identificationNumber ?? '-' }}
</td>
</tr>
</table>
<!-- GRAND TABLEAU -->
<div class="bigtable-wrap">
<table class="bigtable">
<thead>
<tr>
<th style="width:75%; text-align:center;">Désignation</th>
<th style="width:25%; text-align:center; white-space:nowrap;">Qté expédiée (kg)</th>
</tr>
</thead>
<tbody>
{% set grossWeight = null %}
{% set tareWeight = null %}
<tr>
<td style="width:75%;">
<strong>Expédition</strong><br><br>
<div class="bigtable-notes">
{% for weight in shipment.weights %}
{% if weight.type == 'gross' %}
{% set grossWeight = weight %}
<p>Poids à plein : {{ grossWeight.weight }}kg (pesée
{{ grossWeight.dsd }} {{ grossWeight.weighedAt|date('d/m/Y H:i:s') }})</p>
{% elseif weight.type == 'tare' %}
{% set tareWeight = weight %}
<p>Poids à vide : {{ tareWeight.weight }}kg (pesée
{{ tareWeight.dsd }} {{ tareWeight.weighedAt|date('d/m/Y H:i:s') }})</p>
{% endif %}
{% endfor %}
</div>
</td>
<td style="width:25%; text-align:center; white-space:nowrap;">
{% if grossWeight and tareWeight %}
{{ grossWeight.weight - tareWeight.weight }}
{% else %}
0
{% endif %}
</td>
</tr>
<tr class="border-bottom">
<td>
<strong>Bovin</strong><br><br>
<div class="bigtable-notes">
{% if shipment.bovinShipments is not empty %}
{% for entry in shipment.bovinShipments %}
<p>
{{ entry.shipmentType ? entry.shipmentType.label : '-' }} :
{{ entry.nbBovinSend ?? 0 }}
</p>
{% endfor %}
{% else %}
<p>-</p>
{% endif %}
</div>
</td>
<td style="width:25%; text-align:center; white-space:nowrap;">
</td>
</tr>
</tbody>
</table>
</div>
<!-- BAS : meta à gauche / signatures à droite -->
<table class="layout footer-block">
<tr>
<td style="width:60%; padding-right:8mm; vertical-align:top;">
<div class="meta">
<p>Transporteur : {{ shipment.carrier ? shipment.carrier.name : '-' }}</p>
<p>Mode de livraison : {{ shipment.truck ? shipment.truck.name : '-' }}</p>
<p>Immatriculation : {{ shipment.licencePlate ?? '-' }}</p>
</div>
</td>
<td style="width:40%; vertical-align:top;">
<div class="box signature-box">Signature les Nauds :</div>
<div class="box signature-box">Signature transporteur :</div>
</td>
</tr>
</table>
</body>
</html>