diff --git a/admin/themes/default/template/controllers/orders/_booking_document_line.tpl b/admin/themes/default/template/controllers/orders/_booking_document_line.tpl index 9411ae1b8..77badd8ff 100644 --- a/admin/themes/default/template/controllers/orders/_booking_document_line.tpl +++ b/admin/themes/default/template/controllers/orders/_booking_document_line.tpl @@ -35,9 +35,11 @@ - - - + {if $can_edit} + + + + {/if} {/foreach} diff --git a/admin/themes/default/template/controllers/orders/_documents.tpl b/admin/themes/default/template/controllers/orders/_documents.tpl index a47bc8a5a..25ad36aef 100644 --- a/admin/themes/default/template/controllers/orders/_documents.tpl +++ b/admin/themes/default/template/controllers/orders/_documents.tpl @@ -95,7 +95,7 @@  {l s='Edit note'} {/if} - {if $document->getRestPaid()} + {if $can_edit && $document->getRestPaid()}  {l s='Enter payment'} @@ -117,7 +117,7 @@ - {if !$orderDocuments|count && isset($invoice_management_active) && $invoice_management_active} + {if $can_edit && !$orderDocuments|count && isset($invoice_management_active) && $invoice_management_active}
{l s='Generate invoice'} 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 d2a660045..11aa7586d 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -146,7 +146,7 @@ {if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded} {if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if} - {else} + {elseif $can_edit} {l s='Edit'} @@ -220,14 +220,17 @@ {$row['ostate_name']|stripslashes} {if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{/if} {dateFormat date=$row['date_add'] full=true} - - {if $row['send_email']|intval} - - - {l s='Resend email'} - - {/if} - + + {if $can_edit} + + {if $row['send_email']|intval} + + + {l s='Resend email'} + + {/if} + + {/if} {else} @@ -235,14 +238,16 @@ {$row['ostate_name']|stripslashes} {if $row['employee_lastname']}{$row['employee_firstname']|stripslashes} {$row['employee_lastname']|stripslashes}{else} {/if} {dateFormat date=$row['date_add'] full=true} - - {if $row['send_email']|intval} - - - {l s='Resend email'} - - {/if} - + {if $can_edit} + + {if $row['send_email']|intval} + + + {l s='Resend email'} + + {/if} + + {/if} {/if} {/foreach} @@ -251,7 +256,7 @@
{* If current state is refunded or cancelled the further order status changes are not allowed *} - {if !isset($currentState) || (isset($currentState) && ($currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED')))} + {if $can_edit && (!isset($currentState) || (isset($currentState) && ($currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED'))))}
@@ -475,12 +480,14 @@
-
- -
- {if (!$order->valid && sizeof($currencies) > 1)} + {if $can_edit} +
+ +
+ {/if} + {if $can_edit && (!$order->valid && sizeof($currencies) > 1)}
@@ -561,8 +568,11 @@ - -

{l s='This feature will generate a random password and send an email to the customer.'}

+ + {if $can_edit} + +

{l s='This feature will generate a random password and send an email to the customer.'}

+ {/if} {else}
@@ -604,13 +614,15 @@
-
-
- + {if $can_edit} +
+
+ +
-
+ {/if}
@@ -812,7 +824,7 @@
 {l s='Rooms Booking Detail'} {$order_detail_data|@count} - {if !$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED')} + {if $can_edit && (!$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED'))} @@ -851,61 +863,66 @@ {assign var=order_shipping_price value=$order->total_shipping_tax_incl} {/if} - {assign var=room_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, true)} - {assign var=room_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)} - {assign var=service_products_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)} - {assign var=service_products_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE)} - {assign var=convenience_fee_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)} - {assign var=convenience_fee_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)} - {assign var=additional_service_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTE)} - {assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTI)} - {if $room_price_tax_excl} + {* total extra demands prices *} + {* $totalDemandsPriceTE + $totalDemandsPriceTI *} + + {* Get total rooms prices *} + {assign var=total_rooms_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, true)} + {assign var=total_rooms_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)} + + {* Get total extra services including convenience fees prices *} + {assign var=total_services_price_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false)} + {assign var=total_services_price_tax_incl value=$order->getTotalProductsWithTaxes(false, false)} + + {* Get total of extra services and extra demands prices(excluding convenience fee) *} + {assign var=total_room_services_and_demands_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTE)} + {assign var=total_room_services_and_demands_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTI)} + + {* Get total of only convenience fees prices *} + {assign var=total_convenience_fee_tax_excl value=$order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)} + {assign var=total_convenience_fee_tax_incl value=$order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT)} + + {assign var=order_total_price_tax_excl value=($total_rooms_price_tax_excl + $total_services_price_tax_excl + $totalDemandsPriceTE)} + {assign var=order_total_price_tax_incl value=($total_rooms_price_tax_incl + $total_services_price_tax_incl + $totalDemandsPriceTI)} + + {if $total_rooms_price_tax_excl} {l s='Total Rooms Cost (Tax excl.)'} - {displayPrice price=$room_price_tax_excl currency=$currency->id} + {displayPrice price=$total_rooms_price_tax_excl currency=$currency->id} {/if} - {if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0} + {if isset($total_room_services_and_demands_tax_excl) && $total_room_services_and_demands_tax_excl > 0} {l s='Total Extra services (Tax excl.)'} - {displayPrice price=($additional_service_price_tax_excl - $convenience_fee_price_tax_excl) currency=$currency->id} + {displayPrice price=($total_room_services_and_demands_tax_excl - $total_convenience_fee_tax_excl) currency=$currency->id} {/if} - {if $service_products_price_tax_excl} - - {l s='Total service products cost (Tax excl.)'} - - {displayPrice price=$service_products_price_tax_excl currency=$currency->id} - - - - {/if} - - {if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0} + {if isset($total_convenience_fee_tax_excl) && $total_convenience_fee_tax_excl > 0} {l s='Convenience Fee (Tax excl.)'} - {if isset($booking_auto_added_services) && count($booking_auto_added_services)} + {if isset($order_convenience_fee_services) && count($order_convenience_fee_services)} {/if} - {displayPrice price=$convenience_fee_price_tax_excl currency=$currency->id} + {displayPrice price=$total_convenience_fee_tax_excl currency=$currency->id} - {if isset($booking_auto_added_services) && count($booking_auto_added_services)} + {if isset($order_convenience_fee_services) && count($order_convenience_fee_services)} - {foreach $booking_auto_added_services as $service} + {foreach $order_convenience_fee_services as $service} @@ -921,41 +938,41 @@ - - {if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0} + {if ($order_total_price_tax_incl - $order_total_price_tax_excl) > 0}
{$service.name} {displayPrice price=$service.total_price_tax_excl currency=$currency->id}
{l s='Total Taxes'} - {if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0} + {if ($order_total_price_tax_incl - $order_total_price_tax_excl) > 0} {/if} {displayPrice price=(($order->total_paid_tax_incl + $order->total_discounts_tax_incl) - ($order->total_paid_tax_excl + $order->total_discounts_tax_excl)) currency=$currency->id} + {displayPrice price=($order_total_price_tax_incl - $order_total_price_tax_excl) currency=$currency->id}