From 9401ca6a4d2a6a0d6a3ab0edf3cf4057582fd46e Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 28 Jun 2024 17:34:41 +0530 Subject: [PATCH 1/3] Fixed: Design issue in order page and kpi when printing page --- .../themes/default/sass/partials/_print.sass | 39 ++++- .../controllers/orders/_overbookings.tpl | 4 +- .../controllers/orders/_product_line.tpl | 162 ++---------------- js/admin/orders.js | 20 +++ 4 files changed, 76 insertions(+), 149 deletions(-) diff --git a/admin/themes/default/sass/partials/_print.sass b/admin/themes/default/sass/partials/_print.sass index 118b98014..9a8097f89 100644 --- a/admin/themes/default/sass/partials/_print.sass +++ b/admin/themes/default/sass/partials/_print.sass @@ -65,7 +65,7 @@ margin-bottom: 0 !important #addressInvoice width: 49% !important - float: right !important + float: right !important margin-bottom: 0 !important #status tr:first-child td @@ -84,9 +84,7 @@ margin: 30px 0 20px 0 !important border: solid 1px black !important .box-stats - padding: 10px 0 !important height: auto !important - width: 25% !important font-size: 8pt !important i font-size: 20pt !important @@ -99,3 +97,38 @@ margin: 0 !important .panel-total td font-size: 13pt!important + + + #customer_cart_details + thead + display: none + tr + display: block + border: 1px solid #ccc + -webkit-box-shadow: #EAEDEF 0 2px 0 0 + box-shadow: #EAEDEF 0 2px 0 0 + width: 100% + margin-bottom: 6px + td + display: block + display: grid + grid-template-columns: 2fr 3fr + text-align: center !important + position: relative + width: 100% !important + text-align: left !important + line-height: 2em !important + font-size: 1.15em !important + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + > span + padding: 0px 5px + > span:nth-child(1) + border-right: 1px solid #EAEDEF + padding-right: 10px + white-space: nowrap + color: #aaa + text-align: right + font-size: .9em + font-style: italic \ No newline at end of file diff --git a/admin/themes/default/template/controllers/orders/_overbookings.tpl b/admin/themes/default/template/controllers/orders/_overbookings.tpl index b2b89fa6c..d68e38021 100644 --- a/admin/themes/default/template/controllers/orders/_overbookings.tpl +++ b/admin/themes/default/template/controllers/orders/_overbookings.tpl @@ -42,7 +42,7 @@ {dateFormat date=$data['date_from']} {l s='To'} {dateFormat date=$data['date_to']} {if $order->with_occupancy && $data['children']} - {else} - {if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if} + {if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if} {/if} diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index 18ceebacc..68823d0e1 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -35,33 +35,11 @@

{$data.room_type}

- {dateFormat date=$data.date_from} - {dateFormat date=$data.date_to} - - {if $can_edit} - - {/if} + {dateFormat date=$data.date_from} - {dateFormat date=$data.date_to} {if $data['children']} - {else} - {if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if} + {if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if} {/if} - - -

- - {convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id} - -

-

{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}

-
- +

+ + {convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id} + +

+

{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}

- - {convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id} - {if $data['extra_demands']|count || $data['additional_services']|count} - - - - {/if} - - - - - {convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id} - - - {convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id} - {if $can_edit} - {/if} + + {convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id} + + + {convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id} + {if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)} {if $data.is_cancelled} @@ -212,19 +99,6 @@ {/if} {if ($can_edit && !$order->hasBeenDelivered())} - - {if sizeof($invoices_collection)} - - {else} -   - {/if} -
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled} diff --git a/js/admin/orders.js b/js/admin/orders.js index 097961a27..c5147d809 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -31,6 +31,26 @@ $(document).ready(function() { init(); $('img.js-disabled-action').css({"opacity":0.5}); + + // change table design for printing + $(window).on('beforeprint', function() { + $('#customer_cart_details thead tr th').each(function(i, val) { + $('#customer_cart_details tbody td:nth-child('+(i+1)+')').each(function () { + let span = $('').addClass('print-class-container') + .append($('').addClass('print-class-title').html($(val).html())) + .append($('').addClass('print-class-content').html( + $(this).html() + ) + ); + $(this).html($(span).html()); + }); + }); + }); + $(window).on('afterprint', function() { + $('#customer_cart_details tbody td').each(function () { + $(this).html($(this).find('span.print-class-content').html()); + }); + }); }); function stopAjaxQuery() { From ffc554bf40b5fb606f349507a94341ceccc683e5 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Thu, 18 Jul 2024 16:47:02 +0530 Subject: [PATCH 2/3] fixed kpi pannel height issue --- admin/themes/default/sass/partials/_kpi.sass | 1 + admin/themes/default/sass/partials/_print.sass | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/themes/default/sass/partials/_kpi.sass b/admin/themes/default/sass/partials/_kpi.sass index e6ccfe8cb..6e2e15fbf 100644 --- a/admin/themes/default/sass/partials/_kpi.sass +++ b/admin/themes/default/sass/partials/_kpi.sass @@ -16,6 +16,7 @@ $kpi-gap: 10px flex-wrap: wrap margin-left: -($kpi-gap / 2) margin-right: -($kpi-gap / 2) + flex-grow: 1 .kpi-wrap display: inline-block width: 20% diff --git a/admin/themes/default/sass/partials/_print.sass b/admin/themes/default/sass/partials/_print.sass index 9a8097f89..2732a42aa 100644 --- a/admin/themes/default/sass/partials/_print.sass +++ b/admin/themes/default/sass/partials/_print.sass @@ -81,13 +81,14 @@ i display: none !important .kpi-container.panel - margin: 30px 0 20px 0 !important border: solid 1px black !important + .actions-wrap + display: none .box-stats height: auto !important font-size: 8pt !important - i - font-size: 20pt !important + span.arrow + display: none .alert border: 1px solid black !important &:before From efa04cf529fcd93b099f2626f4a10bdade2857c6 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 12 Aug 2024 16:43:46 +0530 Subject: [PATCH 3/3] hide messages panel in order print --- .../default/template/controllers/orders/helpers/view/view.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index e8c21dfc3..8de94b812 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -1098,13 +1098,13 @@
{/if} -
+
 {l s='Messages'} {sizeof($customer_thread_message)} {l s='Show all messages'}
-
+