Improve print layout and pagination
This commit is contained in:
7
app.js
7
app.js
@@ -631,9 +631,6 @@
|
|||||||
updatePreviewText("#p_vat", formatMoney(vat));
|
updatePreviewText("#p_vat", formatMoney(vat));
|
||||||
updatePreviewText("#p_total", formatMoney(total));
|
updatePreviewText("#p_total", formatMoney(total));
|
||||||
updatePreviewText("#p_totalDays", numStr(totalDays));
|
updatePreviewText("#p_totalDays", numStr(totalDays));
|
||||||
|
|
||||||
// Rebuild print pages preview structure (for print)
|
|
||||||
buildPrintPages();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const applyInitialDefaults = () => {
|
const applyInitialDefaults = () => {
|
||||||
@@ -648,7 +645,6 @@
|
|||||||
const container = document.getElementById("printPages");
|
const container = document.getElementById("printPages");
|
||||||
const previewPanel = document.getElementById("printArea");
|
const previewPanel = document.getElementById("printArea");
|
||||||
if (!container || !previewPanel) return;
|
if (!container || !previewPanel) return;
|
||||||
container.style.display = "block";
|
|
||||||
container.innerHTML = "";
|
container.innerHTML = "";
|
||||||
|
|
||||||
const rows = Array.from(
|
const rows = Array.from(
|
||||||
@@ -866,7 +862,6 @@
|
|||||||
$("#addItemBtn")?.addEventListener("click", () => addItem());
|
$("#addItemBtn")?.addEventListener("click", () => addItem());
|
||||||
$("#addGroupBtn")?.addEventListener("click", () => addGroup());
|
$("#addGroupBtn")?.addEventListener("click", () => addGroup());
|
||||||
$("#printBtn")?.addEventListener("click", () => {
|
$("#printBtn")?.addEventListener("click", () => {
|
||||||
buildPrintPages();
|
|
||||||
window.print();
|
window.print();
|
||||||
});
|
});
|
||||||
// Save current quote
|
// Save current quote
|
||||||
@@ -1457,8 +1452,6 @@
|
|||||||
window.addEventListener("beforeprint", () => {
|
window.addEventListener("beforeprint", () => {
|
||||||
const num = (state.quoteNumber || "").toString().trim();
|
const num = (state.quoteNumber || "").toString().trim();
|
||||||
document.title = num ? `Devis ${num}` : "Devis";
|
document.title = num ? `Devis ${num}` : "Devis";
|
||||||
// Assure que les pages d'impression sont reconstruites juste avant l'aperçu
|
|
||||||
buildPrintPages();
|
|
||||||
});
|
});
|
||||||
window.addEventListener("afterprint", () => {
|
window.addEventListener("afterprint", () => {
|
||||||
document.title = originalTitle;
|
document.title = originalTitle;
|
||||||
|
|||||||
15
styles.css
15
styles.css
@@ -777,12 +777,25 @@ input[type="date"] {
|
|||||||
/* Print styles */
|
/* Print styles */
|
||||||
@media print {
|
@media print {
|
||||||
@page {
|
@page {
|
||||||
margin: 8mm;
|
margin: 12mm 10mm 18mm 10mm; /* plus d'espace en bas pour le numéro de page */
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
-webkit-print-color-adjust: exact;
|
-webkit-print-color-adjust: exact;
|
||||||
print-color-adjust: exact;
|
print-color-adjust: exact;
|
||||||
|
padding-bottom: 22mm; /* réserve de place pour le footer de page */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Numérotation auto des pages (Chrome/Edge) */
|
||||||
|
body::after {
|
||||||
|
content: "Page " counter(page) " / " counter(pages);
|
||||||
|
position: fixed;
|
||||||
|
right: 10mm;
|
||||||
|
bottom: 10mm;
|
||||||
|
font-size: 9pt;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #1f3fae;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-header,
|
.app-header,
|
||||||
|
|||||||
Reference in New Issue
Block a user