<?xml version="1.0"?>
<t t-name="purchase_edi_ubl_bis3.bis3_OrderType">
        <Order xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
            <cbc:CustomizationID>urn:fdc:peppol.eu:poacc:trns:order:3</cbc:CustomizationID>
            <cbc:ProfileID>urn:fdc:peppol.eu:poacc:bis:ordering:3</cbc:ProfileID>
            <cbc:ID t-out="vals.get('id')"/>
            <cbc:IssueDate t-out="vals.get('issue_date')"/>
            <cbc:Note t-out="vals.get('note')"/>
            <cac:OriginatorDocumentReference>
                <cbc:ID t-out="vals.get('originator_document_reference')"/>
            </cac:OriginatorDocumentReference>
            <cbc:DocumentCurrencyCode t-out="vals.get('document_currency_code')"/>
            <cac:BuyerCustomerParty>
                <cac:Party>
                    <t t-call="purchase_edi_ubl_bis3.bis3_PartyType">
                        <t t-set="vals" t-value="vals.get('customer_party_vals')"/>
                    </t>
                </cac:Party>
            </cac:BuyerCustomerParty>
            <cac:SellerSupplierParty>
                <cac:Party>
                    <t t-call="purchase_edi_ubl_bis3.bis3_PartyType">
                        <t t-set="vals" t-value="vals.get('supplier_party_vals')"/>
                    </t>
                </cac:Party>
            </cac:SellerSupplierParty>
            <cac:Delivery t-if="vals.get('delivery_party_vals')">
                <t t-call="purchase_edi_ubl_bis3.bis3_DeliveryType">
                    <t t-set="vals" t-value="vals.get('delivery_party_vals')"/>
                </t>
            </cac:Delivery>
            <cac:PaymentTerms t-if="vals.get('payment_terms_vals')">
                <t t-set="payment_terms_vals" t-value="vals.get('payment_terms_vals')"/>
                <cbc:Note t-out="payment_terms_vals.get('note')"/>
            </cac:PaymentTerms>
            <cac:AllowanceCharge>
                <t t-call="purchase_edi_ubl_bis3.bis3_AllowanceChargeType">
                    <t t-set="vals" t-value="vals.get('allowance_charge_vals', {})"/>
                </t>
            </cac:AllowanceCharge>
            <cac:TaxTotal>
                <cbc:TaxAmount t-att-currencyID="vals.get('currency_id')" t-out="vals.get('tax_amount')"/>
            </cac:TaxTotal>
            <cac:AnticipatedMonetaryTotal>
                <t t-call="purchase_edi_ubl_bis3.bis3_AnticipatedMonetaryTotalType">
                    <t t-set="vals" t-value="vals.get('anticipated_monetary_total_vals')"/>
                </t>
            </cac:AnticipatedMonetaryTotal>
            <cac:OrderLine t-foreach="vals.get('order_lines')" t-as="line_vals">
                <cac:LineItem>
                    <t t-call="purchase_edi_ubl_bis3.bis3_LineItemType">
                        <t t-set="vals" t-value="line_vals"/>
                    </t>
                </cac:LineItem>
            </cac:OrderLine>
        </Order>
    </t>
