rht_odoo

[GREENHOUSE GROUP] Self billing

Aug 28th, 2025 (edited)
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 12.17 KB | None | 0 0
  1. <data>
  2.     <data>
  3.         <xpath position="replace" expr="/t[@t-name='studio_report_document']//t[@t-call='web.internal_layout']/div/div" meta-class="oe_structure"/>
  4.         <xpath position="inside" expr="/t[@t-name='studio_report_document']//t[@t-call='web.internal_layout']/div" meta-class="page">
  5.             <h1 class="oe_structure">Self Billing    
  6.                 <span t-field="doc.name"/>
  7.             </h1>
  8.             <div class="row">
  9.                 <div class="col-6"/>
  10.                 <div class="col-6">
  11.                     <address class="mb-0" t-field="doc.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
  12.                     <div t-if="doc.partner_id.vat" id="partner_vat_address_same_as_shipping">
  13.                         <t t-if="doc.company_id.account_fiscal_country_id.vat_label" t-out="doc.company_id.account_fiscal_country_id.vat_label" id="inv_tax_id_label"/>
  14.                         <t t-else="">Tax ID</t>:
  15.                        
  16.                         <span t-field="doc.partner_id.vat"/>
  17.                     </div>
  18.                 </div>
  19.             </div>
  20.             <br/>
  21.             <div id="informations" class="row mb-4">
  22.                 <div class="col" t-if="doc.invoice_date" name="invoice_date">
  23.                     <strong> Invoice Date:</strong>
  24.                     <div t-field="doc.invoice_date">2023-09-12</div>
  25.                 </div>
  26.                 <div class="col" t-if="doc.invoice_date_due and doc.state == 'posted'" name="due_date">
  27.                     <strong>Due Date:</strong>
  28.                     <div t-field="doc.invoice_date_due">2023-10-31</div>
  29.                 </div>
  30.                 <div class="col" t-if="doc.invoice_origin" name="origin">
  31.                     <strong>GHG Ref:</strong>
  32.                     <div t-field="doc.invoice_origin">SO123</div>
  33.                 </div>
  34.             </div>
  35.             <p>
  36.                 <br/>
  37.             </p>
  38.             <table class="o_has_total_table table o_main_table table-borderless mb-0" name="invoice_line_table">
  39.                 <thead>
  40.                     <tr style="color: rgb(17, 24, 39); background-color: rgb(156, 198, 239);">
  41.                         <th name="th_description" class="text-start">
  42.                             <strong>Description</strong>
  43.                         </th>
  44.                         <th name="th_quantity" class="text-end">
  45.                             <strong>Quantity</strong>
  46.                         </th>
  47.                         <th name="th_priceunit" t-attf-class="text-end text-nowrap {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  48.                             <strong>Unit Price</strong>
  49.                         </th>
  50.                         <th name="th_discount" t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  51.                             <strong>Disc.%</strong>
  52.                         </th>
  53.                         <th name="th_taxes" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  54.                             <strong>Taxes</strong>
  55.                         </th>
  56.                         <th name="th_subtotal" class="text-end">
  57.                             <strong>Amount</strong>
  58.                         </th>
  59.                     </tr>
  60.                 </thead>
  61.                 <tbody class="invoice_tbody">
  62.                     <t t-set="current_subtotal" t-value="0"/>
  63.                     <t t-set="current_total" t-value="0"/>
  64.                     <t t-set="lines" t-value="doc.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/>
  65.                     <t t-foreach="lines" t-as="line">
  66.                         <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
  67.                         <t t-set="current_total" t-value="current_total + line.price_total"/>
  68.                         <tr t-att-class="'fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''">
  69.                             <t t-if="line.display_type == 'product'" name="account_invoice_line_accountable">
  70.                                 <td name="account_invoice_line_name">
  71.                                     <span t-if="line.name" t-field="line.name" t-options="{'widget': 'text'}">Bacon Burger</span>
  72.                                 </td>
  73.                                 <td name="td_quantity" class="o_td_quantity text-end">
  74.                                     <span t-field="line.quantity" class="text-nowrap">3.00</span>
  75.                                     <span t-field="line.product_uom_id" groups="uom.group_uom">units</span>
  76.                                 </td>
  77.                                 <td name="td_price_unit" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  78.                                     <span class="text-nowrap" t-field="line.price_unit">9.00</span>
  79.                                 </td>
  80.                                 <td name="td_discount" t-if="display_discount" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
  81.                                     <span class="text-nowrap" t-field="line.discount">0</span>
  82.                                 </td>
  83.                                 <t t-set="taxes" t-value="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids])"/>
  84.                                 <td name="td_taxes" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }} {{ 'text-nowrap' if len(taxes) &lt; 10 else '' }}">
  85.                                     <span t-out="taxes" id="line_tax_ids">Tax 15%</span>
  86.                                 </td>
  87.                                 <td name="td_subtotal" class="text-end o_price_total">
  88.                                     <span class="text-nowrap" t-field="line.price_subtotal">27.00</span>
  89.                                 </td>
  90.                             </t>
  91.                             <t t-elif="line.display_type == 'line_section'">
  92.                                 <td colspan="99">
  93.                                     <span t-if="line.name" t-field="line.name" t-options="{'widget': 'text'}">A section title</span>
  94.                                 </td>
  95.                                 <t t-set="current_section" t-value="line"/>
  96.                                 <t t-set="current_subtotal" t-value="0"/></t>
  97.                             <t t-elif="line.display_type == 'line_note'">
  98.                                 <td colspan="99">
  99.                                     <span t-if="line.name" t-field="line.name" t-options="{'widget': 'text'}">A note, whose content usually applies to the section or product above.</span>
  100.                                 </td>
  101.                             </t>
  102.                         </tr>
  103.                         <t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
  104.                             <tr class="is-subtotal text-end">
  105.                                 <td colspan="99">
  106.                                     <strong class="mr16">Subtotal</strong>
  107.                                     <span t-out="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}">31.05</span>
  108.                                 </td>
  109.                             </tr>
  110.                         </t>
  111.                     </t>
  112.                 </tbody>
  113.             </table>
  114.             <div class="overflow-hidden">
  115.                 <div id="right-elements" t-attf-class="#{'col-5 mt-5' if report_type == 'pdf' else 'col-12 col-md-5'} ms-5 d-inline-block float-end">
  116.                     <div id="total" class="clearfix row">
  117.                         <div class="ms-auto">
  118.                             <table class="o_total_table table table-borderless avoid-page-break-inside">
  119.                                 <t t-if="doc.tax_totals" t-call="account.document_tax_totals" ws-call-key="2" ws-view-id="2494">
  120.                                     <t t-set="tax_totals" t-value="doc.tax_totals"/>
  121.                                     <t t-set="currency" t-value="doc.currency_id"/></t>
  122.                                 <t t-if="print_with_payments">
  123.                                     <t t-if="doc.payment_state != 'invoicing_legacy'">
  124.                                         <t t-set="payments_vals" t-value="doc.sudo().invoice_payments_widget and doc.sudo().invoice_payments_widget['content'] or []"/>
  125.                                         <t t-foreach="payments_vals" t-as="payment_vals">
  126.                                             <tr t-if="payment_vals['is_exchange'] == 0">
  127.                                                 <td>
  128.                                                     <i class="oe_form_field text-end oe_payment_label">
  129.                                                         <t t-if="payment_vals['is_refund']">Reversed on </t>
  130.                                                         <t t-else="">Paid on </t>
  131.                                                         <t t-out="payment_vals['date']" t-options="{&quot;widget&quot;: &quot;date&quot;}">2021-09-19</t>
  132.                                                     </i>
  133.                                                 </td>
  134.                                                 <td class="text-end">
  135.                                                     <span t-out="payment_vals['amount']" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}">20.00</span>
  136.                                                 </td>
  137.                                             </tr>
  138.                                         </t>
  139.                                         <t t-if="len(payments_vals) &gt; 0">
  140.                                             <tr class="fw-bold">
  141.                                                 <td>Amount Due</td>
  142.                                                 <td class="text-end">
  143.                                                     <span t-field="doc.amount_residual">11.05</span>
  144.                                                 </td>
  145.                                             </tr>
  146.                                         </t>
  147.                                     </t>
  148.                                 </t>
  149.                             </table>
  150.                         </div>
  151.                     </div>
  152.                     <div class="mb-2">
  153.                         <p class="text-end lh-sm" t-if="doc.company_id.display_invoice_amount_total_words">
  154.                                         Total amount in words:
  155.                            
  156.                            
  157.                            
  158.                            
  159.                            
  160.                             <br/>
  161.                             <small class="text-muted lh-sm">
  162.                                 <span t-field="doc.amount_total_words">Thirty one dollar and Five cents</span>
  163.                             </small>
  164.                         </p>
  165.                         <p class="text-end lh-sm" t-if="doc.invoice_payment_term_id">
  166.                             Payment will be done under
  167.                            
  168.                             <span t-field="doc.invoice_payment_term_id"/>
  169.                             <br/>
  170.                             Paid on
  171.                            
  172.                             <span t-field="doc.partner_bank_id.acc_number"/>
  173.                         </p>
  174.                     </div>
  175.                     <t t-if="doc.tax_totals.get('display_in_company_currency')">
  176.                         <t t-set="tax_totals" t-value="o.tax_totals"/>
  177.                         <t t-call="account.document_tax_totals_company_currency_template" ws-call-key="3" ws-view-id="2494"/></t>
  178.                     <t t-else="">
  179.                         <div class="oe_structure">
  180.                             <br/>
  181.                         </div>
  182.                     </t>
  183.                 </div>
  184.             </div>
  185.         </xpath>
  186.     </data>
  187. </data>
Advertisement
Add Comment
Please, Sign In to add comment