<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <template
        id="report_invoice_document"
        inherit_id="account.report_invoice_document"
        priority="99999"
    >
        <xpath expr="//address" position="before">
            <t t-if="o.pms_property_id">
                <t t-set="information_block">
                    <div name="pms_property_address_block">
                        <div
                            t-field="o.pms_property_id.partner_id"
                            t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"
                        />
                    </div>
                </t>
            </t>
        </xpath>
<!-- fixme Dangerous use of "replace". Only replace as a last resort.
     Try position="attributes", position="move" or t-if="False" first - [xml-dangerous-qweb-replace-low-priority]
-->
        <xpath expr="//div[@class='page']//h2" position="replace">
            <h2>
                <t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
                    <span
                        t-if="o.move_type == 'out_invoice' and o.is_simplified_invoice and o.state == 'posted'"
                    >Simplified Invoice</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and o.is_simplified_invoice and o.state == 'draft'"
                    >Draft Simplified Invoice</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and o.is_simplified_invoice and o.state == 'cancel'"
                    >Cancelled Simplified Invoice</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and not o.is_simplified_invoice and o.state == 'posted'"
                    >Invoice</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and not o.is_simplified_invoice and o.state == 'draft'"
                    >Draft Invoice</span>
                    <span
                        t-if="o.move_type == 'out_invoice' and not o.is_simplified_invoice and o.state == 'cancel'"
                    >Cancelled Invoice</span>
                    <span t-if="o.move_type == 'out_refund'">Credit Note</span>
                    <span t-if="o.move_type == 'in_refund'">Vendor Credit Note</span>
                    <span t-if="o.move_type == 'in_invoice'">Vendor Bill</span>
                    <span t-if="o.name != '/'" t-field="o.name" />
                </t>
                <t t-if="env.context.get('proforma', False) or is_pro_forma">
                    <span>Pro-Forma Invoice # </span>
                </t>
            </h2>
        </xpath>
    </template>
</odoo>
