{# /************************************************************* File name: refund-policy.html.twig Project: Villas3 Copyright 2022 Michael J. Miller, All rights reserved Purpose: markup for showing refund policy in a modal dialog Requuires: policy - array of refund rules for the reservation; reservation - reservation record Date Version Details --------- ------- ------------------------------------- 3/15/24 2.6.3 Modified calc for showing disclaimer1 to be accurate for all rules 9/14/24 3.0a Modified to be used with **************************************************************/ #} {% macro currency(amount, currency_code, language_code) %} {{ (amount / 100)|format_currency(currency_code, {}, language_code) }} {% endmacro currency %}
{% include 'includes/dialog-close.html.twig' %} {% set language_code = customer.language_code|default(globals.language_code) %}

Refund Policy{{role == 'webmaster' ? ' ('~reservation.cancel_policy_id~')'}}

{% set net_payment = reservation.total_paid - reservation.total_refund %}

{{reservation.title_short}}: {{reservation.starts}} to {{reservation.ends}}

Our refund policy for cancellations is based on individual reservations and the rules in effect at the time a booking is confirmed. {% if policy is not empty and policy[0].rate != 0 %} The actual refund shown has been calculated from the amount paid to date{{net_payment ? ' ('~ _self.currency(net_payment, reservation.currency_code, language_code)~')' : ' but you have not yet made a payment'}}. {% endif %}

{% set disclaimer1 = false %} {% set disclaimer2 = false %} {% set last_date = '' %} {% set last_rate = 0 %} {% if policy is not empty %}
{% for rule in policy %} {% set expires = rule.grace_date > rule.expires ? rule.grace_date : rule.expires %} {% set last_rate = rule.rate %} {% set last_date = rule.rate > 0 or rule.return_cleaning_fee ? expires : last_date|default(today) %} {% if rule.rate > 0 or rule.return_cleaning_fee or rule.return_cost %} {% endif %} {% endfor %}
If you cancel before:Lodging refund is:Refund Amount
{{expires|date("d M Y")}} {{rule.rate}}% {% if rule.return_cleaning_fee == 1 %}  + cleaning fee {% endif %} {% if rule.return_cost == 1 %}  + transaction costs {% endif %} {{_self.currency(rule.refund, reservation.currency_code, language_code)}} {% if (rule.refund + reservation.transaction_costs >= reservation.total_paid) and not rule.return_cost %} * {% set disclaimer1 = true %} {% endif %} {% if reservation.balance_due < reservation.deposit and reservation.collect_deposit|default(1) %} ** {% set disclaimer2 = true %} {% endif %}
After {{(last_date ?:reservation.starts)|date("d M Y")}} not refundable {% if reservation.balance_due < reservation.deposit and reservation.collect_deposit|default(1) %} {% set disclaimer2 = true %} {{ _self.currency(reservation.deposit - reservation.balance_due, reservation.currency_code, language_code) }}** {% endif %}
{% if disclaimer1 == true %} *We cannot refund more than we receive so any processing fees associated with the payment are deducted from full refunds. These fees vary with the method of payment. {% endif %} {% if disclaimer2 == true and reservation.collect_deposit|default(1) %} **Includes {{ _self.currency(reservation.deposit, reservation.currency_code, language_code) }} damage deposit. {% endif %}
{% else %}

In order to determine this, we need to know which property and the dates of the reservation. Please enter start and end dates to see the rules affecting your reservation. It isn't necessary to confirm the reservation or make a payment in order to view the refund policy.

{% endif %} {% if reservation.state != 'confirmed' %}

These policies are subject to change until the reservation is confirmed. If this is a concern for you, it's best to check the rules just before confirming the reservation.

{% endif %}

The damage deposit, if collected, is always refundable in full less any damage charges.