diff --git a/report/report_invoice_adhesion.xml b/report/report_invoice_adhesion.xml index 87d99a8ffc4ada18fbb629a9bdd6e15442dd00b3..dc8cfe81c67a7d507914dc58625e74949fe8aa20 100644 --- a/report/report_invoice_adhesion.xml +++ b/report/report_invoice_adhesion.xml @@ -3,120 +3,25 @@ <data> <!-- Template invoice --> - <template id="scop_report_invoice_adhesion" inherit_id="cgscop_account.scop_report_invoice_document"> - - <xpath expr="//div[@name='hook_page']" position="after"> - <div t-elif="o.journal_id == o.company_id.journal_adhesion_id" class="page mt32"> - <h2> - <span t-if="o.type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')">Droits d'adhésion</span> - <span t-if="o.type == 'out_invoice' and o.state == 'draft'">Brouillon adhésion</span> - <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Annulation adhésion</span> - <span t-field="o.number"/> - </h2> - - <div id="informations" class="row mt32 mb32"> - <div class="col-auto mw-100 mb-2" t-if="o.name" name="description"> - <strong>Description:</strong> - <p class="m-0" t-field="o.name"/> - </div> - <div class="col-auto mw-100 mb-2" t-if="o.date_invoice" name="invoice_date"> - <strong>Date:</strong> - <p class="m-0" t-field="o.date_invoice"/> - </div> - <div class="col-auto mw-100 mb-2" t-if="o.date_due and o.type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')" name="due_date"> - <strong>Date d'échéance:</strong> - <p class="m-0" t-field="o.date_due"/> - </div> - </div> - - <t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/> - - <table class="table table-sm o_main_table" name="invoice_line_table"> - <thead> - <tr> - <t t-set="colspan" t-value="6"/> - <th name="th_description" class="text-left"><span>Description</span></th> - <th name="th_subtotal" class="text-right"> - <span groups="account.group_show_line_subtotals_tax_excluded">Montant</span> - <span groups="account.group_show_line_subtotals_tax_included">Montant</span> - </th> - </tr> - </thead> - <tbody class="invoice_tbody"> - <t t-set="current_subtotal" t-value="0"/> - - <t t-foreach="o.invoice_line_ids" t-as="line"> - - <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> - <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/> - - <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''"> - <t t-if="not line.display_type" name="account_invoice_line_accountable"> - <td name="account_invoice_line_name"><span t-field="line.name"/></td> - <td class="d-none"><span t-field="line.origin"/></td> - <td class="text-right o_price_total"> - <span t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/> - <span t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/> - </td> - </t> - <t t-if="line.display_type == 'line_section'"> - <td colspan="99"> - <span t-field="line.name"/> - </td> - <t t-set="current_section" t-value="line"/> - <t t-set="current_subtotal" t-value="0"/> - </t> - <t t-if="line.display_type == 'line_note'"> - <td colspan="99"> - <span t-field="line.name"/> - </td> - </t> - </tr> - </t> - </tbody> - </table> - - <div class="clearfix mb32"> - <div id="total" class="row"> - <div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto"> - <table class="table table-sm" style="page-break-inside: avoid;"> - <tr class="border-black o_total"> - <td><strong>Total</strong></td> - <td class="text-right"> - <span t-field="o.amount_total"/> - </td> - </tr> - </table> - </div> - </div> - </div> - - <p t-if="o.comment" name="comment"> - <span t-field="o.comment"/> - </p> - <p t-if="o.payment_term_id" name="payment_term"> - <span t-field="o.payment_term_id.note"/> - </p> - <p t-foreach="o.partner_banks_to_show()" t-as="partner_bank"> - <strong>Compte bancaire:</strong> - <t t-if="partner_bank.bank_id"> - <t t-esc="partner_bank.bank_id.name + ('' if not partner_bank.bank_id.bic else ' (' + partner_bank.bank_id.bic + ')')" /> - </t> - <t t-if="o.payment_mode_id.show_bank_account == 'full'"> - <span t-field="partner_bank.acc_number"/> - </t> - <t t-elif="o.payment_mode_id.show_bank_account == 'first'"> - <span t-esc="partner_bank.acc_number[:o.payment_mode_id.show_bank_account_chars] + '*' * (len(partner_bank.acc_number) - o.payment_mode_id.show_bank_account_chars)"/> - </t> - <t t-elif="o.payment_mode_id.show_bank_account == 'last'"> - <span t-esc="'*' * (len(partner_bank.acc_number) - o.payment_mode_id.show_bank_account_chars) + partner_bank.acc_number[-o.payment_mode_id.show_bank_account_chars:]"/> - </t> - </p> - <p t-if="o.fiscal_position_id.note" name="note"> - <span t-field="o.fiscal_position_id.note"/> - </p> - - </div> + <template id="scop_report_invoice_adhesion" inherit_id="account.report_invoice_document"> + <xpath expr="//t[@t-set='o']" position="after"> + <t t-if="o.journal_id == o.company_id.journal_adhesion_id"> + <t t-set="is_adh" t-value="True"/> + </t> + <t t-else=""> + <t t-set="is_adh" t-value="False"/> + </t> + </xpath> + <xpath expr="//div[hasclass('page')]/h2" position="attributes"> + <attribute name="t-if">not is_adh</attribute> + </xpath> + <xpath expr="//div[hasclass('page')]/h2" position="after"> + <h2 t-if="is_adh"> + <span t-if="o.type == 'out_invoice' and o.state in ('open', 'in_payment', 'paid')">Droits d'adhésion</span> + <span t-if="o.type == 'out_invoice' and o.state == 'draft'">Brouillon adhésion</span> + <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Annulation adhésion</span> + <span t-field="o.number"/> + </h2> </xpath> </template>