<?xml version="1.0"?>
<t t-name="l10n_es_edi_facturae.account_invoice_facturae_export">
            <fac:Facturae xmlns:fac="http://www.facturae.gob.es/formato/Versiones/Facturaev3_2_2.xml">
                <FileHeader>
                    <SchemaVersion>3.2.2</SchemaVersion>
                    <Modality t-out="Modality"/>
                    <InvoiceIssuerType t-out="'EM' if is_outstanding else 'RE'"/>
                    <Batch>
                        <BatchIdentifier t-out="BatchIdentifier"/>
                        <InvoicesCount t-out="InvoicesCount"/>
                        <TotalInvoicesAmount>
                            <TotalAmount t-out="float_repr(refund_multiplier*TotalInvoicesAmount['TotalAmount'], file_currency.decimal_places)"/>
                            <EquivalentInEuros t-if="conversion_needed" t-out="float_repr(refund_multiplier*TotalInvoicesAmount['EquivalentInEuros'], eur.decimal_places)"/>
                        </TotalInvoicesAmount>
                        <TotalOutstandingAmount>
                            <TotalAmount t-out="float_repr(refund_multiplier*TotalOutstandingAmount['TotalAmount'], file_currency.decimal_places)"/>
                            <EquivalentInEuros t-if="conversion_needed" t-out="float_repr(refund_multiplier*TotalOutstandingAmount['EquivalentInEuros'], eur.decimal_places)"/>
                        </TotalOutstandingAmount>
                        <TotalExecutableAmount>
                            <TotalAmount t-out="float_repr(refund_multiplier*TotalExecutableAmount['TotalAmount'], file_currency.decimal_places)"/>
                            <EquivalentInEuros t-if="conversion_needed" t-out="float_repr(refund_multiplier*TotalExecutableAmount['EquivalentInEuros'], eur.decimal_places)"/>
                        </TotalExecutableAmount>
                        <InvoiceCurrencyCode t-out="InvoiceCurrencyCode"/>
                    </Batch>
                </FileHeader>
                <Parties>
                    <SellerParty>
                        <t t-call="l10n_es_edi_facturae.business_type">
                            <t t-set="partner" t-value="self_party if is_outstanding else other_party"/>
                            <t t-set="partner_country_code" t-value="self_party_country_code if is_outstanding else other_party_country_code"/>
                            <t t-set="partner_phone" t-value="False if is_outstanding else other_party_phone"/>
                            <t t-set="partner_name" t-value="self_party_name if is_outstanding else other_party_name"/>
                            <t t-set="administrative_centers" t-value="self_party_administrative_centers if is_outstanding else other_party_administrative_centers"/>
                        </t>
                    </SellerParty>
                    <BuyerParty>
                        <t t-call="l10n_es_edi_facturae.business_type">
                            <t t-set="partner" t-value="other_party if is_outstanding else self_party"/>
                            <t t-set="partner_country_code" t-value="other_party_country_code if is_outstanding else self_party_country_code"/>
                            <t t-set="partner_phone" t-value="other_party_phone if is_outstanding else False"/>
                            <t t-set="partner_name" t-value="other_party_name if is_outstanding else self_party_name"/>
                            <t t-set="administrative_centers" t-value="other_party_administrative_centers if is_outstanding else self_party_administrative_centers"/>
                        </t>
                    </BuyerParty>
                </Parties>
                <Invoices>
                    <t t-foreach="Invoices" t-as="invoice"><t t-call="l10n_es_edi_facturae.invoice_type"/></t>
                </Invoices>
            </fac:Facturae>
        </t>
    