=> {
const blob = await api.getBlob(url);
const pdfBlob = blob.type === 'application/pdf'
@@ -16,15 +16,17 @@ export const usePdfPrinter = () => {
const filename = `${currentReception.identificationNumber}_${currentReception.supplier.name}_${currentReception.licensePlate}.pdf`;
- const a = document.createElement('a');
- a.href = blobUrl;
- a.download = filename;
- a.style.display = 'none';
- document.body.appendChild(a);
- a.click();
- a.remove();
+ if (previewWindow) {
+ previewWindow.location.replace(blobUrl)
+ }
- // L'ouverture dans un nouvel onglet déclenche un 2e PDF sans le nom personnalisé.
+ const a = document.createElement('a')
+ a.href = blobUrl
+ a.download = filename
+ a.style.display = 'none'
+ document.body.appendChild(a)
+ a.click()
+ a.remove()
setTimeout(() => URL.revokeObjectURL(blobUrl), 60_000);
}
diff --git a/templates/reception_voucher.html.twig b/templates/reception_voucher.html.twig
index 2bc2e96..6c94ccd 100644
--- a/templates/reception_voucher.html.twig
+++ b/templates/reception_voucher.html.twig
@@ -65,7 +65,7 @@
.bigtable-wrap{
border: 1px solid #000;
- height: 425px;
+ height: 360px;
margin-bottom: 10px;
}
@@ -107,8 +107,8 @@
.footer-block{ page-break-inside: avoid; }
.signature-box {
- height: 22mm;
- margin-bottom: 4mm;
+ height: 130px;
+ margin-bottom: 10px;
border: 0.5px solid #000;
padding: 6px 10px;
@@ -143,7 +143,16 @@
{{ reception.supplier.name }}
{{ reception.address.street }}
- {{ reception.address.postalCode }} {{ reception.address.city }}
+ {% if reception.address.street2 %}
+ {{ reception.address.street2 }}
+ {% endif %}
+ {{ reception.address.postalCode }} {{ reception.address.city }}
+ {% if reception.supplier.phone %}
+ {{ reception.supplier.phone }}
+ {% endif %}
+ {% if reception.supplier.email %}
+ {{ reception.supplier.email}}
+ {% endif %}