{% sw_extends '@Framework/documents/invoice.html.twig' %} {% 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 %}
{{ 'paypal.payUponInvoice.document.paymentNoteRatepay'|trans({"%companyName%": config.companyName}) }}

{{ "paypal.payUponInvoice.instructions.transferRequest"|trans({"%value%": order.amountTotal|currency}) }}
{{ "paypal.payUponInvoice.instructions.table.bank"|trans() }} {{ payPalPuiPaymentInstruction.deposit_bank_details.bank_name }}
{{ "paypal.payUponInvoice.instructions.table.iban"|trans() }} {{ payPalPuiPaymentInstruction.deposit_bank_details.iban }}
{{ "paypal.payUponInvoice.instructions.table.bic"|trans() }} {{ payPalPuiPaymentInstruction.deposit_bank_details.bic }}
{{ "paypal.payUponInvoice.instructions.table.holder"|trans() }} {{ payPalPuiPaymentInstruction.deposit_bank_details.account_holder_name }}
{{ "paypal.payUponInvoice.instructions.table.reference"|trans() }} {{ payPalPuiPaymentInstruction.payment_reference }}
{% endif %} {% endblock %} {% block document_footer_second_column %} {% set payPalPuiPaymentInstruction = null %} {% for transaction in order.transactions %} {% if transaction.customFields[customFieldKey] %} {% set payPalPuiPaymentInstruction = transaction.customFields[customFieldKey] %} {% endif %} {% endfor %} {% if payPalPuiPaymentInstruction %} {% else %} {{ parent() }} {% endif %} {% endblock %}