{# /***************************************************************************** File name: resedit-payment.html.twig Project: Villas3 Copyright 2024 Michael J. Miller, All rights reserved Purpose: payment section content for reservation editor Requires: reservation - record buffer Revision History: Date Version Details -------- ------ ------------------------------------------------- 4/25/24 3.0a created ******************************************************************************/ #} {# this is a simple way to create refund rows in payment section. Put it in because there is two places this row must be inserted #} {% macro refund_row(payment, i, role, DEV_MODE) %} {% set highlight = 'red' %}
| Source | Date Paid | Amount | {% if reservation.total_refund > 0 %}Refunded | {% else %}State | {% endif %} {#Status | #}Net | Refund Amt | {% if DEV_MODE and role == 'webmaster' %} | {% endif %} | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {% if role == 'webmaster' %} {{ role == 'webmaster' ? '('~payment.payment_id~')' }} {% endif %} {{ payment.mode is not empty ? payment.mode~':'~payment.source : payment.source }} | {{ payment.date_paid|date("y-m-d") }} | {% if (payment.source_status == 'failed') %}
|
failed: {{ payment.error_detail }} | {% else %}{{ (payment.amount/100)|format_currency(payment.currency|upper, {grouping_used:true}, 'en') }} | {# {% if reservation.total_refund > 0 %}#} {% if payment.refund_amount > 0 %} {# {% if payment.refund_id > 0 %}#}{{ (payment.refund_total/100)|format_currency(payment.currency|upper, {grouping_used:true}, 'en') }} | {% else %}{{ payment.pay_status }} | {% endif %} {# {% else %}#} {#{{ payment.pay_status }} | #} {# {% endif %}#} {% endif %} {% if payment.pay_status != 'failed' %}{% if payment.fee is null %} missing fee {% else %} {{ (payment.balance/100)|format_currency(payment.currency|upper, {grouping_used:true}, 'en') }} {% endif %} | {% endif %}{% if payment.pay_status != 'refunded' and payment.pay_status != 'failed' and payment.refund_status != 'failed' %} {% endif %} | {% if payment.pay_status != 'refunded' and payment.pay_status != 'failed' and payment.refund_status != 'failed' %} {% endif %} | {% if DEV_MODE or (role == 'webmaster' and (payment.source != 'stripe' or payment.pay_status == 'started')) %}{% endif %} | |