From b736303610b852186c220295badf4340eb8b4ac1 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 3 Mar 2020 13:22:36 +0100 Subject: [PATCH] 2144 - Prevent page break on data tables --- print/common/css/layout.css | 21 +++- print/common/css/misc.css | 3 +- .../campaign-metrics/campaign-metrics.html | 56 +++++----- .../claim-pickup-order.html | 4 +- .../reports/delivery-note/delivery-note.html | 103 +++++++++--------- .../reports/driver-route/driver-route.html | 8 +- .../reports/entry-order/entry-order.html | 66 ++++++----- .../reports/letter-debtor/letter-debtor.html | 6 +- .../reports/letter-debtor/locale/es.yml | 2 +- 9 files changed, 143 insertions(+), 126 deletions(-) diff --git a/print/common/css/layout.css b/print/common/css/layout.css index 6be065a14..b85589a81 100644 --- a/print/common/css/layout.css +++ b/print/common/css/layout.css @@ -157,6 +157,22 @@ table { border-spacing: 0; } +/** + * Prevent page break fix + */ +tbody { + page-break-inside: avoid; + break-inside: avoid; + display: block; + width: 100% +} + +thead, tbody tr { + table-layout: fixed; + display: table; + width: 100%; +} + .row-oriented, .column-oriented { text-align: left; width: 100% @@ -181,6 +197,10 @@ table { background-color: #e5e5e5 } +.column-oriented tbody { + border-bottom: 1px solid #DDD; +} + .column-oriented tfoot { border-top: 2px solid #808080; } @@ -190,7 +210,6 @@ table { } .column-oriented .description { - border-bottom: 1px solid #DDD; font-size: 0.8em } diff --git a/print/common/css/misc.css b/print/common/css/misc.css index 093d5a974..09d7706b3 100644 --- a/print/common/css/misc.css +++ b/print/common/css/misc.css @@ -42,6 +42,7 @@ font-weight: bold } -.non-page-break { +.no-page-break { page-break-inside: avoid; + break-inside: avoid } \ No newline at end of file diff --git a/print/templates/reports/campaign-metrics/campaign-metrics.html b/print/templates/reports/campaign-metrics/campaign-metrics.html index 7a0f30948..ee1908164 100644 --- a/print/templates/reports/campaign-metrics/campaign-metrics.html +++ b/print/templates/reports/campaign-metrics/campaign-metrics.html @@ -59,37 +59,35 @@ {{$t('Code')}} {{$t('Quantity')}} - {{$t('Concept')}} + {{$t('Concept')}} - - + + + {{sale.itemFk}} + {{Math.trunc(sale.subtotal)}} + {{sale.concept}} + + + +
+ {{sale.tag5}} + {{sale.value5}} +
+ + +
+ {{sale.tag6}} + {{sale.value6}} +
+ + +
+ {{sale.tag7}} + {{sale.value7}} +
+ + diff --git a/print/templates/reports/claim-pickup-order/claim-pickup-order.html b/print/templates/reports/claim-pickup-order/claim-pickup-order.html index 9c6b0fa4e..c5e2d05f3 100644 --- a/print/templates/reports/claim-pickup-order/claim-pickup-order.html +++ b/print/templates/reports/claim-pickup-order/claim-pickup-order.html @@ -64,8 +64,8 @@ {{$t('concept')}} - - + + {{sale.id}} {{sale.quantity}} {{sale.claimQuantity}} diff --git a/print/templates/reports/delivery-note/delivery-note.html b/print/templates/reports/delivery-note/delivery-note.html index 77f214c07..719397c08 100644 --- a/print/templates/reports/delivery-note/delivery-note.html +++ b/print/templates/reports/delivery-note/delivery-note.html @@ -76,53 +76,48 @@ {{$t('reference')}} {{$t('quantity')}} - {{$t('concept')}} + {{$t('concept')}} {{$t('price')}} {{$t('discount')}} {{$t('vat')}} {{$t('amount')}} - - - - + + + {{sale.itemFk}} + {{sale.quantity}} + {{sale.concept}} + {{sale.price | currency('EUR', locale)}} + {{(sale.discount / 100) | percentage}} + {{sale.vatType}} + {{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', locale)}} + + + +
+ {{sale.tag5}} + {{sale.value5}} +
+ + +
+ {{sale.tag6}} + {{sale.value6}} +
+ + +
+ {{sale.tag7}} + {{sale.value7}} +
+ + + + + {{sale.ediBotanic}} {{sale.denomination}} {{sale.countryCode}}-{{sale.passportNumber}} + ZP + @@ -138,7 +133,7 @@
-
+

{{$t('services')}}

@@ -168,29 +163,35 @@ -
+

{{$t('taxBreakdown')}}

- - + + - - + + - - + + @@ -204,7 +205,7 @@ -
+

{{$t('packagings')}}

{{$t('type')}}{{$t('taxBase')}}{{$t('type')}} + {{$t('taxBase')}} + {{$t('tax')}} {{$t('fee')}}
{{tax.name}}{{tax.Base | currency('EUR', locale)}}{{tax.name}} + {{tax.Base | currency('EUR', locale)}} + {{tax.vatPercent | percentage}} {{tax.tax | currency('EUR', locale)}}
{{$t('subtotal')}}{{getTotalBase() | currency('EUR', locale)}}{{$t('subtotal')}} + {{getTotalBase() | currency('EUR', locale)}} + {{getTotalTax()| currency('EUR', locale)}}
@@ -226,7 +227,7 @@ -
+
{{$t('digitalSignature')}}
diff --git a/print/templates/reports/driver-route/driver-route.html b/print/templates/reports/driver-route/driver-route.html index 6d3b840df..ba9a339da 100644 --- a/print/templates/reports/driver-route/driver-route.html +++ b/print/templates/reports/driver-route/driver-route.html @@ -84,14 +84,14 @@
-
+
- + @@ -100,7 +100,7 @@ - + - +
{{$t('order')}} {{$t('ticket')}}{{$t('client')}}{{$t('client')}} {{$t('address')}} {{$t('packages')}}
{{ticket.priority}} {{ticket.id}}{{ticket.clientFk}} {{ticket.addressName}}{{ticket.clientFk}} {{ticket.addressName}} {{ticket.addressFk.toString().substr(0, ticket.addressFk.toString().length - 3)}} @@ -141,7 +141,7 @@
{{$t('import')}}{{ticket.import}}{{ticket.import | currency('EUR', locale)}}
diff --git a/print/templates/reports/entry-order/entry-order.html b/print/templates/reports/entry-order/entry-order.html index cbb0de0d5..094936fd0 100644 --- a/print/templates/reports/entry-order/entry-order.html +++ b/print/templates/reports/entry-order/entry-order.html @@ -63,45 +63,43 @@ - + - + - - + + + + + + + + + + + + + + @@ -115,7 +113,7 @@
-
+

{{$t('notes')}}

diff --git a/print/templates/reports/letter-debtor/letter-debtor.html b/print/templates/reports/letter-debtor/letter-debtor.html index 93e59bba1..534798f5e 100644 --- a/print/templates/reports/letter-debtor/letter-debtor.html +++ b/print/templates/reports/letter-debtor/letter-debtor.html @@ -25,7 +25,7 @@
- + @@ -61,8 +61,8 @@ - - + + diff --git a/print/templates/reports/letter-debtor/locale/es.yml b/print/templates/reports/letter-debtor/locale/es.yml index 09a31ee5b..a9bd8c796 100644 --- a/print/templates/reports/letter-debtor/locale/es.yml +++ b/print/templates/reports/letter-debtor/locale/es.yml @@ -2,7 +2,7 @@ title: Extracto claimId: ReclamaciĆ³n clientId: Cliente clientData: Datos del cliente -dated: Fecha +date: Fecha concept: Concepto invoiced: Facturado payed: Pagado
{{$t('boxes')}}{{$t('boxes')}} {{$t('packing')}}{{$t('concept')}}{{$t('concept')}} {{$t('quantity')}} {{$t('price')}} {{$t('amount')}}
{{buy.box}}{{buy.packing}}{{buy.itemName}}{{buy.quantity}}{{buy.buyingValue | currency('EUR', locale)}}{{buy.buyingValue * buy.quantity | currency('EUR', locale)}}
+
+ {{buy.tag5}} + {{buy.value5}} +
+
+
+ {{buy.tag6}} + {{buy.value6}} +
+
+
+ {{buy.tag7}} + {{buy.value7}} +
+
{{client.id}}
{{$t('dated')}}{{$t('date')}} {{dated}}
{{$t('balance')}}
{{sale.issued | date('%d-%m-%Y')}} {{sale.ref}} {{sale.debtOut}}