{% sw_extends '@Framework/documents/invoice.html.twig' %}
{% set payPalPuiPaymentInstruction = null %}
{% set customFieldKey = constant('Swag\\PayPal\\SwagPayPal::ORDER_TRANSACTION_CUSTOM_FIELDS_PAYPAL_PUI_INSTRUCTION') %}
{% set payPalPuiPaymentInstruction = order.transactions.last.customFields[customFieldKey] %}
{% block document_payment %}
{% if payPalPuiPaymentInstruction and payPalPuiPaymentInstruction.payment_due_date is defined %}
{{ 'paypal.payUponInvoice.document.paymentShippingInfo.payPalPuiPaymentMethod'|trans() }}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block document_payment_shipping %}
{{ parent() }}
{% if payPalPuiPaymentInstruction %}
{% if payPalPuiPaymentInstruction.payment_due_date is not defined %}
{{ 'paypal.payUponInvoice.document.paymentNoteRatepay'|trans({"%companyName%": config.companyName}) }}
{% else %}
{{ 'paypal.payUponInvoice.document.paymentNote'|trans({"%companyName%": config.companyName}) }}
{{ "paypal.payUponInvoice.instructions.transferRequest"|trans({"%value%": payPalPuiPaymentInstruction.amount.value, "%currency%": payPalPuiPaymentInstruction.amount.currency, "%date%": payPalPuiPaymentInstruction.payment_due_date|format_date('short', locale=app.request.locale)}) }}
{{ "paypal.payUponInvoice.instructions.table.bank"|trans() }} |
{{ payPalPuiPaymentInstruction.recipient_banking_instruction.bank_name }} |
{{ "paypal.payUponInvoice.instructions.table.iban"|trans() }} |
{{ payPalPuiPaymentInstruction.recipient_banking_instruction.international_bank_account_number }} |
{{ "paypal.payUponInvoice.instructions.table.bic"|trans() }} |
{{ payPalPuiPaymentInstruction.recipient_banking_instruction.bank_identifier_code }} |
{{ "paypal.payUponInvoice.instructions.table.holder"|trans() }} |
{{ payPalPuiPaymentInstruction.recipient_banking_instruction.account_holder_name }} |
{{ "paypal.payUponInvoice.instructions.table.amount"|trans() }} |
{{ payPalPuiPaymentInstruction.amount.value }}{{ payPalPuiPaymentInstruction.amount.currency }} |
{{ "paypal.payUponInvoice.instructions.table.reference"|trans() }} |
{{ payPalPuiPaymentInstruction.reference_number }} |
{% endif %}
{% endif %}
{% endblock %}
{% block document_footer_second_column %}
{% set payPalPuiPaymentInstruction = null %}
{% set customFieldKey = constant('Swag\\PayPal\\SwagPayPal::ORDER_TRANSACTION_CUSTOM_FIELDS_PAYPAL_PUI_INSTRUCTION') %}
{% for transaction in order.transactions %}
{% if transaction.customFields[customFieldKey] %}
{% set payPalPuiPaymentInstruction = transaction.customFields[customFieldKey] %}
{% endif %}
{% endfor %}
{% if payPalPuiPaymentInstruction %}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}