xml

mail@pastecode.io avatar
unknown
xml
a year ago
25 kB
1
Indexable
Never
<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <template id="eihp_report_HUB" inherit_id="hr_invoicing.report_HUB">

        <xpath expr="//div[@id='informations']" position="before">
            <style>
                .table-detailed {
                    font-size: 12pt;
                    empty-cells: show;
                    letter-spacing: 0.05em;
                    vertical-align: middle;
                }
                .table-detailed tr td {
                    padding: 0;
                    margin: 0;
                }
                .table-detailed p {
                    padding: 0;
                    margin: 0;
                }
                .table-detailed td:nth-child(2) p {
                    padding-left: 15px;
                }
            </style>
            <t t-if="o.project_contract_id">
                <t t-if="o.project_contract_document_type == 'order'">
                    <table class="table-sm table-detailed" style="width: 100%; margin-top: 15px;">
                        <tbody>
                            <td>
                                <table>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Order Name</p></td>
                                        <td><p name="project_contract_name" t-field="o.project_contract_id.name"></p></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Order Date</p></td>
                                        <td><p name="project_contract_date" t-field="o.project_contract_date" t-options="{'widget': 'date'}"></p></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Order Client Number</p></td>
                                        <td><p name="project_contract_client_number" t-field="o.project_contract_client_number"></p></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Order Code</p></td>
                                        <td><span name="project_contract_code" t-field="o.project_contract_id.executor_contract_number"/></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><p name="project_contract_line_invoice_title" t-field="o.project_contract_line_invoice_title"></p></td>
                                    </tr>
                                    <tr>
                                        <td><p>Contract Amount</p></td>
                                        <!-- <td class="text-right"><p name="project_total_amount" t-field="o.project_total_amount" t-options="{'widget': 'float', 'precision': 2}"></p></td> -->
                                        <td class="text-right" style="padding-left: 15px;">
                                            <span name="project_total_amount" t-esc="o.project_total_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;">
                                            <p>Contract Total Realized Amount
                                                <t t-if="o.contract_completion_rate != 0.0">
                                                    (<t t-esc="o.contract_completion_rate" t-options="{'widget': 'float', 'precision': 2}"/>%)
                                                </t>
                                                <t t-else="">(0.00%)</t>
                                            </p>
                                        </td>
                                        <!-- <td class="text-right"><p name="contract_completion_amount" t-field="o.contract_completion_amount" t-options="{'widget': 'float', 'precision': 2}"></p></td> -->
                                        <td class="text-right" style="padding-left: 15px;">
                                            <span name="contract_completion_amount" t-esc="o.contract_completion_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td style="display: inline;">
                                            <p>Contract Realized Amount
                                                <t t-if="o.project_total_amount != 0.0">
                                                    (<t t-esc="o.project_contract_line_realized_amount/o.project_total_amount*100.00" t-options="{'widget': 'float', 'precision': 2}"/>%)
                                                </t>
                                                <t t-else="">(0.00%)</t>
                                            </p>
                                        </td>
                                        <td class="text-right" style="padding-left: 15px;">
                                        <!-- <td class="text-right"> -->
                                            <span name="project_contract_line_realized_amount" t-esc="o.project_contract_line_realized_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;">
                                            <p>Contract Invoice Amount
                                                <t t-if="o.project_total_amount != 0.0">
                                                    (<t t-esc="o.project_contract_line_invoice_amount/o.project_total_amount*100.00" t-options="{'widget': 'float', 'precision': 2}"/>%)
                                                </t>
                                                <t t-else="">(0.00%)</t>
                                            </p>
                                        </td>
                                        <!-- <td class="text-right"><p name="project_contract_line_invoice_amount" t-field="o.project_contract_line_invoice_amount" t-options="{'widget': 'float', 'precision': 2}"></p></td> -->
                                        <td class="text-right" style="padding-left: 15px;">
                                            <span name="project_contract_line_invoice_amount" t-esc="o.project_contract_line_invoice_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                </table>
                            </td>
                        </tbody>
                    </table>
                </t>
                <t t-else="">
                    <table class="table-sm table-detailed" style="width:100%; margin-top: 15px;">
                        <tbody>
                            <td>
                                <table>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Contract Name</p></td>
                                        <td><p name="project_contract_name" t-field="o.project_contract_id.name"></p></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Contract Date</p></td>
                                        <td><p name="project_contract_date" t-field="o.project_contract_date" t-options="{'widget': 'date'}"></p></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Contract Client Number</p></td>
                                        <td><p name="project_contract_client_number" t-field="o.project_contract_client_number"></p></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;"><p>Contract Code</p></td>
                                        <td><p name="project_contract_code" t-field="o.project_contract_id.contract_code"></p></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><p name="project_contract_line_invoice_title" t-field="o.project_contract_line_invoice_title"></p></td>
                                    </tr>
                                </table>
                                <table>
                                    <tr>
                                        <td><p>Contract Amount</p></td>
                                        <td class="text-right" style="padding-left: 15px;">
                                            <span name="project_total_amount" t-field="o.project_total_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]> 
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;">
                                            <p>Contract Total Realized Amount
                                                <t t-if="o.project_total_amount != 0.0">
                                                    (<t t-esc="o.project_contract_line_total_realized_amount/o.project_total_amount*100.00" t-options="{'widget': 'float', 'precision': 2}"/>%)
                                                </t>
                                                <t t-else="">(0.00%)</t>
                                            </p>
                                        </td>
                                        <td class="text-right" style="padding-left: 15px;">
                                        <!-- <td class="text-right"> -->
                                            <span name="project_contract_line_total_realized_amount" t-field="o.project_contract_line_total_realized_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;">
                                            <p>Contract Realized Amount
                                                <t t-if="o.project_total_amount != 0.0">
                                                    (<t t-esc="o.project_contract_line_realized_amount/o.project_total_amount*100.00" t-options="{'widget': 'float', 'precision': 2}"/>%)
                                                </t>
                                                <t t-else="">(0.00%)</t>
                                            </p>
                                        </td>
                                        <td class="text-right" style="padding-left: 15px;">
                                        <!-- <td class="text-right"> -->
                                            <span name="project_contract_line_realized_amount" t-esc="o.project_contract_line_realized_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td style="white-space: nowrap;">
                                            <span>
                                                <p>Contract Invoice Amount
                                                    <t t-if="o.project_total_amount != 0.0">
                                                        (<t t-esc="o.project_contract_line_invoice_amount/o.project_total_amount*100.00" t-options="{'widget': 'float', 'precision': 2}"/>%)
                                                    </t>
                                                    <t t-else="">(0.00%)</t>
                                                </p>
                                            </span>
                                        </td>
                                        <td class="text-right" style="padding-left: 15px;">
                                        <!-- <td class="text-right"> -->
                                            <span name="project_contract_line_invoice_amount" t-field="o.project_contract_line_invoice_amount" t-options="{'widget': 'float', 'precision': 2}"/>
                                            <![CDATA[&nbsp;]]>
                                            <span t-esc="o.currency_id.name"/>
                                        </td>
                                        <td></td>
                                    </tr>
                                </table>
                            </td>
                        </tbody>
                    </table>
                </t>
            </t>

        </xpath>

        <xpath expr="//tr[@style='padding 0; margin: 0'][1]" position="before">
            <tr style="padding 0; margin: 0">
                <div style="white-space: nowrap;">
                    <td class="text-right" style="border:0; padding: 0;">Invoice date:</td>
                    <td style="border:0;" />
                    <td class="text-left" style="border:0; padding:0;">
                        <span class="m-0" t-esc="o.date_invoice.strftime('%d.%m.%Y')"/>
                    </td>
                </div>
            </tr>
        </xpath>

        <xpath expr="//tr[@style='padding 0; margin: 0'][6]" position="after">
            <tr style="padding 0; margin: 0">
                <div style="white-space: nowrap;">
                    <td class="text-right" style="border:0; padding: 0;">Reference:</td>
                    <td style="border:0;" />
                    <td class="text-left" style="border:0; padding:0;">
                        <t t-if="o.reference">
                            <span class="m-0" t-esc="o.reference"/>
                        </t>
                    </td>
                </div>
            </tr>
        </xpath>

        <xpath expr="//tr[@style='padding 0; margin: 0'][6]" position="after">
            <t t-if="o.date_invoice_delivery and o.date_invoice_delivery != o.date_due and o.type == 'out_invoice'">
                <tr style="padding 0; margin: 0">
                    <div style="white-space: nowrap;">
                        <td class="text-right" style="border:0; padding: 0;">Invoice date delivery:</td>
                        <td style="border:0;" />
                        <td class="text-left" style="border:0; padding:0;">
                            <span class="m-0" t-esc="o.date_invoice_delivery.strftime('%d.%m.%Y')"/>
                        </td>
                    </div>
                </tr>
            </t>
        </xpath>

        <xpath expr="//tr[@style='padding 0; margin: 0'][6]" position="after">
            <tr style="padding 0; margin: 0">
                <div style="white-space: nowrap;">
                    <td class="text-right" style="border:0; padding: 0;">Due date:</td>
                    <td style="border:0;" />
                    <td class="text-left" style="border:0; padding:0;">
                        <t t-if="o.date_due">
                            <span class="m-0" t-esc="o.date_due.strftime('%d.%m.%Y')"/>
                        </t>
                    </td>
                </div>
            </tr>
        </xpath>

        <xpath expr="//tr[@style='padding 0; margin: 0'][6]" position="attributes">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

        <xpath expr="//tr[@style='padding 0; margin: 0'][4]" position="attributes">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

        <xpath expr="//div[@name='invoice_date']" position="attributes">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

        <xpath expr="//div[@name='date_invoice_delivery']" position="attributes">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

        <xpath expr="//div[@id='informations']" position="attributes">
            <attribute name="class">row mt8 mb8</attribute>
        </xpath>

        <xpath expr="//div[@name='comment']" position="attributes">
            <attribute name="style">page-break-inside:avoid;</attribute>
        </xpath>

        <xpath expr="//div[@name='comment']" position="after">
            <table style="width:100%; margin-top: 20px">
                <tbody>
                    <tr>
                        <td class="text-center" style="border:0; padding:0; width:50%;">Department manager:</td>
                        <td class="text-center" style="border:0; padding:0; width:50%;">CEO:</td>
                    </tr>
                    <tr>
                        <td class="text-center" style="border:0; padding:0; width:50%;">
                            <span t-field="o.project_department_manager_id" />
                        </td>
                        <td class="text-center" style="border:0; padding:0; width:50%;">
                            <span t-field="o.company_ceo_id" />
                        </td>
                    </tr>
                </tbody>
            </table>
            <br/>
            <span name="invoice_footer_text">The invoice is written on a computer and is valid without a signature and stamp.</span>
        </xpath>

        <xpath expr="//div[@name='comment']" position="after">
            <tr style="padding 0; margin: 0">
                <td class="text-right" style="border:0; padding:0;">Operator:</td>
                <td style="border:0;" />
                <td class="text-left" style="border:0; padding:0;">
                    <span t-field="o.user_id" />
                </td>
            </tr>
        </xpath>

        <!-- hide barcode -->
        <xpath expr="//img[@t-att-src='get_barcode_src(o.id)']" position="replace">

        </xpath>
        
        <xpath expr="//div[@name='due_date']" position="replace">
            
        </xpath>

        <xpath expr="//div[@name='reference']" position="replace">
            
        </xpath>
        
        <xpath expr="//table[@name='invoice_line_table']//th[4]" position="after">
            <th class="text-right">
                <span>Value</span>
            </th>
        </xpath>

        <xpath expr="//table[@name='invoice_line_table']//td[4]" position="after">
            <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span t-field="line.price_subtotal" t-options="{'widget': 'float', 'precision': line.currency_id.decimal_places}"/>
            </td>
        </xpath>

        <xpath expr="//table[@name='invoice_line_table']//th[6]" position="attributes">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

        <xpath expr="//table[@name='invoice_line_table']//td[6]" position="attributes">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

<!-- 
        <xpath expr="//table[@name='invoice_line_table']//th[8]" position="replace">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath>

        <xpath expr="//table[@name='invoice_line_table']//td[8]" position="replace">
            <attribute name="t-if">o.hide_report_fields</attribute>
        </xpath> -->

        <xpath expr="//table[@name='invoice_line_table']//td[7]" position="replace">
            <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
                <span t-esc="', '.join(map(lambda x: str(int(x.amount)) if x.amount else '', line.invoice_line_tax_ids))" />
            </td>
        </xpath>
        
        <xpath expr="//tr[hasclass('o_subtotal')][2]" position="attributes">
            <attribute name="style">border-top: none !important;</attribute>
        </xpath>

        <xpath expr="//th[hasclass('text-center')]" position="attributes">
            <attribute name="class">text-left</attribute>
        </xpath>
        
        <xpath expr="//table[@name='invoice_line_table']//thead//tr" position="after">
            <tr>
                <th style="text-align: right; padding-top: 1px; padding-bottom: 1px;">
                    <span></span>
                </th>
                <th style="text-align: right; padding-top: 1px; padding-bottom: 1px;">
                    <span></span>
                </th>
                <th style="text-align: right; padding-top: 1px; padding-bottom: 1px;">
                    <span></span>
                </th>
                <th style="text-align: right; padding-top: 1px; padding-bottom: 1px;">
                    <span><t t-esc="o.currency_id.name"/></span>
                </th>
                <th style="text-align: right; padding-top: 1px; padding-bottom: 1px;">
                    <span><t t-esc="o.currency_id.name"/></span>
                </th>
                <th style="text-align: right; padding-top: 1px; padding-bottom: 1px;">
                    <span>(%)</span>
                </th>
            </tr>
        </xpath>
        
        <xpath expr="//div[@id='total']//div[2]//table//tr[1]//td[2]" position="replace">
            <td class="text-right">
                <div style="white-space: nowrap;"><t name="amount_untaxed" t-esc="o.amount_untaxed" t-options="{'widget': 'float', 'precision': 2}"></t> <t t-esc="o.currency_id.name"></t></div>
            </td>
        </xpath>
        
        <xpath expr="//div[@id='total']//div[2]//table//t[@name='taxes']" position="replace">
            <t t-foreach="o.tax_line_ids" t-as="t">
                <tr class="border-black o_subtotal" style="">
                    <t t-if="t.tax_id.amount">
                        <td>
                            <t t-if="t.tax_id.amount">
                                <div style="white-space: nowrap;">
                                    <strong>Taxes</strong>
                                    <strong><span>(</span><span t-esc="int(round((t.tax_id.amount),2))"/><span>%</span><span>)</span></strong>
                                </div>
                            </t>
                        </td>
                        <td class="text-right">
                            <t t-if="t.tax_id.amount">
                                <div style="white-space: nowrap;"><t name="tax_amount_total" t-esc="t.amount_total" t-options="{'widget': 'float', 'precision': 2}"></t> <t t-esc="o.currency_id.name"></t></div>
                            </t>
                        </td>
                    </t>
                </tr>
            </t>
        </xpath>

        <xpath expr="//div[@id='total']//div[2]//table//tr[2]//td[2]" position="replace">
            <td class="text-right">
                <span><t name="amount_total" t-esc="o.amount_total" t-options="{'widget': 'float', 'precision': 2}"></t> <t t-esc="o.currency_id.name"></t></span>
            </td>
        </xpath>
        
        <xpath expr="//table[@name='invoice_line_table']//th[8]" position="replace">
        </xpath>

        <xpath expr="//table[@name='invoice_line_table']//td[8]" position="replace">
        </xpath>

    </template>

</odoo>