Skip to content

Commit

Permalink
Merge pull request #1150 from shreesh-webkul/gli-1924
Browse files Browse the repository at this point in the history
Fixed: Design issue in order page and kpi when printing admin pages
  • Loading branch information
rohit053 authored Aug 14, 2024
2 parents 023ad83 + 8f102c7 commit 8ed91aa
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 151 deletions.
1 change: 1 addition & 0 deletions admin/themes/default/sass/partials/_kpi.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
46 changes: 40 additions & 6 deletions admin/themes/default/sass/partials/_print.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -81,15 +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
padding: 10px 0 !important
height: auto !important
width: 25% !important
font-size: 8pt !important
i
font-size: 20pt !important
span.arrow
display: none
.alert
border: 1px solid black !important
&:before
Expand All @@ -99,3 +98,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
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<td>{dateFormat date=$data['date_from']} {l s='To'} {dateFormat date=$data['date_to']}</td>
<td>
{if $order->with_occupancy && $data['children']}
<div class="dropdown booking_occupancy_show">
<div class="dropdown">
<a data-toggle="dropdown">
<span>{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}</span>
</a>
Expand All @@ -62,7 +62,7 @@
</div>
</div>
{else}
<span class="booking_occupancy_show">{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}</span>
<span>{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}</span>
{/if}
</td>
<td>
Expand Down
156 changes: 15 additions & 141 deletions admin/themes/default/template/controllers/orders/_product_line.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,11 @@
<p><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$data.id_product}&amp;updateproduct" target="_blank"><span>{$data.room_type}</span></a></p>
</td>
<td>
<span class="booking_duration_show">{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</span>

{if $can_edit}
<div class="booking_duration_edit" style="display:none;">
<div class="form-group">
<div class="fixed-width-xl room_check_in_div">
<div class="input-group">
<div class="input-group-addon">{l s='Check In'}</div>
<input type="text" class="form-control edit_product_date_from" name="edit_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
<div class="input-group-addon"><i class="icon-calendar"></i></div>
</div>
</div>
<br/>
<div class="fixed-width-xl room_check_out_div">
<div class="input-group">
<div class="input-group-addon">{l s='Check Out'}</div>
<input type="text" class="form-control edit_product_date_to" name="edit_product[date_to]" value="{$data.date_to|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
<div class="input-group-addon"><i class="icon-calendar"></i></div>
</div>
</div>
</div>
</div>
{/if}
{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}
</td>
<td>
{if $data['children']}
<div class="dropdown booking_occupancy_show">
<div class="dropdown">
<a data-toggle="dropdown">
<span>{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}</span>
</a>
Expand All @@ -81,121 +59,30 @@
</div>
</div>
{else}
<span class="booking_occupancy_show">{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}</span>
{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}
<div class="booking_occupancy_edit" style="display:none;">
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
<span>
{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}
</span>
</button>
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
<div class="booking_occupancy_inner row">
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
<div class="row">
<div class="col-xs-6 form-group occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Adults'}</label>
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1">
</div>
</div>
<div class="col-xs-6 form-group occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0">
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
</div>
</div>
</div>
<p style="display:none;"><span class="text-danger occupancy-input-errors"></span></p>
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
<div class="col-sm-12 form-group">
<label class="col-sm-12">{l s='All Children'}</label>
<div class="col-sm-12">
<div class="row children_ages">
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
{for $age=1 to ($max_child_age-1)}
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
{/for}
</select>
</p>
{/foreach}
{/if}
</div>
</div>
</div>
</div>
<hr class="occupancy-info-separator col-sm-12">
<div class="col-sm-12">
<a class="pull-right close_occupancy_link" href="#">{l s='close'} <i class="icon-remove"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
<td>
<span class="room_unit_price_show">
<p>
<span class="room_type_current_price">
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
</span>
</p>
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
</span>
<div class="room_unit_price_edit" style="display: none;">
<input class="form-control" type="text" class="room_unit_price" name="room_unit_price" value="{$data['paid_unit_price_tax_excl']}">
<p class="help-block">{l s='Set per day price'}</p>
</div>
<p>
<span class="room_type_current_price">
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
</span>
</p>
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
</td>
<td>
<span class="extra_service_show">
{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}
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['id']}">
<i class="icon icon-lg icon-info-circle"></i>
</a>
{/if}
</span>
<span class="extra_service_edit" style="display: none;">
{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}
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['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}
<i class="icon icon-lg icon-info-circle"></i>
</a>
</span>
{/if}
</td>
<td>
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}</span>
{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}
</td>
<td>
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}</span>
{if $can_edit}
<div class="product_price_edit" style="display:none;">
<div class="form-group">
<div class="fixed-width-xl">
<div class="input-group">
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($data.original_unit_price_tax_excl, 2)}"/>
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
</div>
</div>
<br/>
<div class="fixed-width-xl">
<div class="input-group">
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($data.original_unit_price_tax_incl, 2)}"/>
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
</div>
</div>
</div>
</div>
{/if}
{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}
</td>
{if (isset($refundReqBookings) && $refundReqBookings)}
<td>
Expand All @@ -220,19 +107,6 @@
</td>
{/if}
{if ($can_edit && !$order->hasBeenDelivered())}
<td class="product_invoice" style="display: none;">
{if sizeof($invoices_collection)}
<select name="product_invoice" class="edit_product_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}">
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
</option>
{/foreach}
</select>
{else}
&nbsp;
{/if}
</td>
<td class="product_action">
<div class="btn-group">
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,13 @@
</div>
{/if}

<div class="col-lg-4 col-sm-6 col-xs-12">
<div class="col-lg-4 col-sm-6 col-xs-12 hidden-print">
<div class="panel">
<div class="panel-heading">
<i class="icon-envelope"></i> &nbsp;{l s='Messages'} <span class="badge">{sizeof($customer_thread_message)}</span>
<a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'html':'UTF-8'}&amp;id_order={$order->id|intval}" class="pull-right">{l s='Show all messages'}</a>
</div>
<div id="messages" class="hidden-print">
<div id="messages">
<form action="{$smarty.server.REQUEST_URI|escape:'html':'UTF-8'}&amp;token={$smarty.get.token|escape:'html':'UTF-8'}" method="post" onsubmit="if (getE('visibility').checked == true) return confirm('{l s='Do you want to send this message to the customer?'}');">
<div id="message" class="form-horizontal">
<div class="form-group">
Expand Down
20 changes: 20 additions & 0 deletions js/admin/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ $(document).ready(function() {
});

$('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 = $('<span>').addClass('print-class-container')
.append($('<span>').addClass('print-class-title').html($(val).html()))
.append($('<span>').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() {
Expand Down

0 comments on commit 8ed91aa

Please sign in to comment.