<?xml version="1.0"?>
<t t-name="account_edi_ubl_cii.ubl_20_InvoiceLineType">
        <t xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
            <cbc:ID t-out="vals.get('id')"/>
            <cbc:Note t-out="vals.get('note')"/>
            <cbc:InvoicedQuantity t-if="invoice.move_type == 'out_invoice'" t-att="vals.get('invoiced_quantity_attrs', {})" t-out="vals.get('invoiced_quantity')"/>
            <cbc:CreditedQuantity t-if="invoice.move_type == 'out_refund'" t-att="vals.get('invoiced_quantity_attrs', {})" t-out="vals.get('invoiced_quantity')"/>
            <cbc:LineExtensionAmount t-att-currencyID="vals['currency'].name" t-out="format_float(vals.get('line_extension_amount'), vals.get('currency_dp'))"/>
            <!-- AllowanceCharge is only present for InvoiceLine, not for CreditNoteLine in UBL 2.0
            (they are both present in UBL 2.1 and next)
             http://www.datypic.com/sc/ubl20/e-cac_CreditNoteLine.html
             http://www.datypic.com/sc/ubl20/e-cac_InvoiceLine.html
             -->
            <t t-if="invoice.move_type == 'out_invoice'">
                <t t-foreach="vals.get('allowance_charge_vals', [])" t-as="foreach_vals">
                    <cac:AllowanceCharge>
                        <t t-call="{{AllowanceChargeType_template}}">
                            <t t-set="vals" t-value="foreach_vals"/>
                        </t>
                    </cac:AllowanceCharge>
                </t>
            </t>
            <t t-foreach="vals.get('tax_total_vals', [])" t-as="foreach_vals">
                <cac:TaxTotal>
                    <t t-call="{{TaxTotalType_template}}">
                        <t t-set="vals" t-value="foreach_vals"/>
                    </t>
                </cac:TaxTotal>
            </t>
            <cac:Item>
                <t t-set="item_vals" t-value="vals.get('item_vals', {})"/>
                <cbc:Description t-out="item_vals.get('description')"/>
                <cbc:Name t-out="item_vals.get('name')"/>
                <cac:SellersItemIdentification>
                    <cbc:ID t-out="item_vals.get('sellers_item_identification_vals', {}).get('id')"/>
                </cac:SellersItemIdentification>
                <t t-foreach="item_vals.get('classified_tax_category_vals', [])" t-as="foreach_vals">
                    <cac:ClassifiedTaxCategory>
                        <t t-call="{{TaxCategoryType_template}}">
                            <t t-set="vals" t-value="foreach_vals"/>
                        </t>
                    </cac:ClassifiedTaxCategory>
                </t>
            </cac:Item>
            <cac:Price>
                <t t-set="vals" t-value="vals.get('price_vals', {})"/>
                <cbc:PriceAmount t-att-currencyID="vals['currency'].name" t-out="vals.get('price_amount')"/>
                <!-- nbr of item units to which the price applies), i.e.: 1 Dozen = 12 units, not mandatory -->
                <cbc:BaseQuantity t-att="vals.get('base_quantity_attrs', {})" t-out="vals.get('base_quantity')"/>
            </cac:Price>
        </t>
    </t>

    