Advertisement
Guest User

Odoo Open ERP - Modificación QWeb Orden de Compra Reporte para Impresión PDF

a guest
Aug 24th, 2020 (edited)
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 13.97 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <t t-name="purchase.report_purchaseorder_document">
  3.   <style>
  4.     .titulosFondoGris {
  5.       background-color: #c1bfbf;
  6.       margin-top: 15px;
  7.     }
  8.     @media print {
  9.       /* Contenido del fichero print.css */
  10.       input {
  11.         display: none;
  12.       }
  13.     }
  14.   </style>
  15.      
  16.       <t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/>
  17.         <div class="page">
  18.             <div class="oe_structure"/>
  19.            
  20.             <input type="button" onclick="window.print();" value="Imprimir Factura" />
  21.            
  22.             <div t-attf-class="header o_company_#{o.company_id}_layout">
  23.               <div class="row">
  24.                   <div class="col-3 mb4">
  25.                       <img t-if="o.company_id.logo" t-att-src="image_data_uri(o.company_id.logo)"  t-attf-style="max-height: 80px;" alt="Logo"/>
  26.                   </div>
  27.                   <div class="col-9 text-right"  t-attf-style="margin-top:22px;" t-field="o.company_id.report_header" name="moto">
  28.                    
  29.                     <h2 class="text-right" t-if="o.state == 'draft'"><b>Request for Quotation No <span t-field="o.name"/></b></h2>
  30.                     <h2 class="text-right" t-if="o.state in ['sent', 'to approve']"><b>Purchase Order No <span t-field="o.name"/></b></h2>
  31.                     <h2 class="text-right" t-if="o.state in ['purchase', 'done']"><b>Purchase Order No <span t-field="o.name"/></b></h2>
  32.                     <h2 class="text-right" t-if="o.state == 'cancel'"><b>Cancelled Purchase Order No <span t-field="o.name"/></b></h2>
  33.            
  34.                   </div>
  35.               </div>
  36.               <div t-if="o.company_id.logo or o.company_id.report_header" class="row zero_min_height">
  37.                   <div class="col-12">
  38.                       <div  t-attf-style="border-bottom: 1px solid black;"/>
  39.                   </div>
  40.               </div>
  41.               <div class="row">
  42.                   <div class="col-6" name="company_address">
  43.                       <p t-attf-style="background-color: #c1bfbf; margin-top: 15px;"><b>Información General</b></p>
  44.                       <p t-attf-style="font-size: 20px;" t-field="o.company_id.partner_id" class="m-0"/>
  45.                       <p t-field="o.company_id.partner_id.vat" class="m-0"/>
  46.                       <p t-field="o.company_id.partner_id.street" class="m-0"/>
  47.                       <p t-field="o.company_id.partner_id.city" class="m-0"/>
  48.                       <p t-field="o.company_id.partner_id.country_id" class="m-0"/>
  49.                       <div t-if="o.company_id.partner_id.phone">
  50.                         <p t-field="o.company_id.partner_id.phone" class="m-0"/>
  51.                         <p t-field="o.company_id.partner_id.mobile" class="m-0"/>
  52.                       </div>
  53.                       <p t-field="o.company_id.partner_id.website" class="m-0"/>
  54.                   </div>
  55.                   <div class="col-6" name="company_address">
  56.                     <p t-attf-style="background-color: #c1bfbf; margin-top: 15px;"><b>Fechas</b></p>
  57.                     <p class="m-0" >Fecha de Confirmación: <span t-field="o.date_approve"/></p>
  58.                     <p class="m-0" >Fecha de Pedido: <span t-field="o.date_order"/></p>
  59.                     <p class="m-0" >Fecha de Entrega: <span t-field="o.date_order"/></p>
  60.                     <!--p class="m-0" >Fecha de Entrega: <span t-field="o.order_line.date_planned"/></p-->
  61.                   </div>
  62.               </div>
  63.              
  64.               <div class="row">
  65.                   <div class="col-6" name="info_proveedor">
  66.                       <p class="titulosFondoGris"><b>Proveedor</b></p>
  67.                       <p t-attf-style="font-size: 18px;" t-field="o.partner_id" class="m-0"/>
  68.                       <p t-field="o.partner_id.vat" class="m-0"/>
  69.                       <p t-field="o.partner_id.street" class="m-0"/>
  70.                       <p t-field="o.partner_id.city" class="m-0"/>
  71.                       <p t-field="o.partner_id.country_id" class="m-0"/>
  72.                       <div t-if="o.partner_id.phone">
  73.                         <p t-field="o.partner_id.phone" class="m-0"/>
  74.                         <p t-field="o.partner_id.mobile" class="m-0"/>
  75.                       </div>
  76.                       <p t-field="o.partner_id.website" class="m-0"/>
  77.                   </div>
  78.                   <div class="col-6" name="company_address">
  79.                     <p t-attf-style="background-color: #c1bfbf; margin-top: 15px;"><b>Condiciones de Compra</b></p>
  80.                     <p class="m-0" >Tipo de Ubicación de Destino: <span t-field="o.default_location_dest_id_usage"/></p>
  81.                     <!--p class="m-0" >Dirección de Envío triangulado: <span t-field="o.dest_address_id"/></p-->
  82.                     <p class="m-0" >Entregar a: <span t-field="o.picking_type_id"/></p>
  83.                     <p class="m-0" >Forma de pago: <span t-field="o.payment_term_id"/></p>
  84.                   </div>
  85.               </div>
  86.             </div>
  87.  
  88.             <div id="informations" class="row mt32 mb32">
  89.                 <div t-if="o.user_id" class="col-3 bm-2">
  90.                     <strong>Purchase Representative:</strong>
  91.                     <p t-field="o.user_id" class="m-0"/>
  92.                 </div>
  93.                 <div t-if="o.partner_ref" class="col-3 bm-2">
  94.                     <strong>Your Order Reference:</strong>
  95.                     <p t-field="o.partner_ref" class="m-0"/>
  96.                 </div>
  97.                 <div t-if="o.date_order" class="col-3 bm-2">
  98.                     <strong>Order Date:</strong>
  99.                     <p t-field="o.date_order" class="m-0"/>
  100.                 </div>
  101.             </div>
  102.  
  103.             <div id="linea_productos" class="row">
  104.               <div class="col-12">
  105.                 <table class="table table-sm o_main_table">
  106.                     <thead>
  107.                         <tr>
  108.                             <th name="th_item" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>Item</strong></th>
  109.                             <th name="th_codigo" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>Código</strong></th>
  110.                             <th name="th_description" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>Description</strong></th>
  111.                             <th name="th_quantity" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>Cantidad</strong></th>
  112.                             <th name="th_unidades" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>Unidad</strong></th>
  113.                             <th name="th_price_unit" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>Valor Unitario</strong></th>
  114.                             <th name="th_taxes" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>% IVA</strong></th>
  115.                             <th name="th_descuento" class="text-center" t-attf-style="background-color: #c1bfbf;"><strong>% Descuento</strong></th>
  116.                             <th name="th_valor_neto" class="text-center"  t-attf-style="background-color: #c1bfbf;"><strong>Valor Neto</strong></th>
  117.                         </tr>
  118.                     </thead>
  119.                     <tbody>
  120.                         <t t-set="current_subtotal" t-value="0"/>
  121.                         <t t-foreach="o.order_line" t-as="line">
  122.                             <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
  123.                             <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
  124.    
  125.                             <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 ''">
  126.                                 <t t-if="not line.display_type">
  127.                                     <td class="text-center" id="item">
  128.                                       <span t-esc="line_index + 1"/>
  129.                                     </td>
  130.                                     <td class="text-center" id="codigo">
  131.                                         <span t-field="line.product_id.default_code"/>
  132.                                     </td>
  133.                                     <td class="text-center" id="product">
  134.                                         <span t-field="line.name"/>
  135.                                     </td>
  136.                                     <td class="text-center" >
  137.                                         <span t-field="line.product_qty"/>
  138.                                     </td>
  139.                                     <td class="text-center" >
  140.                                         <span t-field="line.product_uom.name" groups="uom.group_uom"/>
  141.                                     </td>
  142.                                     <td class="text-center" >
  143.                                         <span t-field="line.price_unit"/>
  144.                                     </td>
  145.                                     <td class="text-center" name="td_taxes">
  146.                                         <span t-field="line.taxes_id"/>
  147.                                     </td>
  148.                                     <td class="text-center" name="td_discount">
  149.                                         <span t-field="line.discount"/>
  150.                                     </td>
  151.                                     <td class="text-center" t-attf-style="background-color: #cccccc;">
  152.                                         <span t-field="line.price_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
  153.                                     </td>
  154.                                 </t>
  155.                                 <t t-if="line.display_type == 'line_section'">
  156.                                     <td colspan="99" id="section">
  157.                                         <span t-field="line.name"/>
  158.                                     </td>
  159.                                     <t t-set="current_section" t-value="line"/>
  160.                                     <t t-set="current_subtotal" t-value="0"/>
  161.                                 </t>
  162.                                 <t t-if="line.display_type == 'line_note'">
  163.                                     <td colspan="99" id="note">
  164.                                         <span t-field="line.name"/>
  165.                                     </td>
  166.                                 </t>
  167.                             </tr>
  168.                             <t t-if="current_section and (line_last or o.order_line[line_index+1].display_type == 'line_section')">
  169.                                 <tr class="is-subtotal text-right">
  170.                                     <td colspan="99" id="subtotal">
  171.                                         <strong class="mr16">Subtotal</strong>
  172.                                         <span t-esc="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
  173.                                     </td>
  174.                                 </tr>
  175.                             </t>
  176.                         </t>
  177.                     </tbody>
  178.                 </table>
  179.               </div>
  180.             </div>
  181.            
  182.  
  183.             <div id="total" class="row justify-content-end">
  184.                   <div class="col-8">
  185.                     <table class="table table-sm">
  186.                       <thead>
  187.                         <tr class="text-center">
  188.                           <th class="text-center">Observaciones Generales</th>
  189.                         </tr>
  190.                       </thead>
  191.                       <tbody>
  192.                         <tr  t-attf-style="height: 20px;">
  193.                           <td><p t-field="o.notes"/></td>
  194.                         </tr>
  195.                       </tbody>
  196.                     </table>
  197.                   </div>
  198.                 <div class="col-4">
  199.                     <table class="table table-sm">
  200.                         <tr class="border-black">
  201.                             <td name="td_subtotal_label"><strong>Subtotal</strong></td>
  202.                             <td class="text-right">
  203.                                 <span t-field="o.amount_untaxed" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
  204.                             </td>
  205.                         </tr>
  206.                         <tr>
  207.                             <td name="td_taxes_label">Taxes</td>
  208.                             <td class="text-right">
  209.                                 <span t-field="o.amount_tax" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
  210.                             </td>
  211.                         </tr>
  212.                         <tr>
  213.                             <td name="td_total_descuentos">Total Descuentos</td>
  214.                             <td class="text-right">
  215.                                 <span t-field="o.x_studio_total_descuentos" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
  216.                             </td>
  217.                         </tr>
  218.                         <tr class="border-black o_total">
  219.                             <td name="td_amount_total_label"><strong>Total</strong></td>
  220.                             <td class="text-right">
  221.                                 <span t-field="o.amount_total" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
  222.                             </td>
  223.                         </tr>
  224.                     </table>
  225.                 </div>
  226.             </div>
  227.            
  228.             <p class="text-center"><b>Señor proveedor, la factura deberá incluir el número de la orden de compra que la generá.</b></p>
  229.             <p t-field="o.notes"/>
  230.             <div class="oe_structure"/>
  231.         </div>
  232. </t>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement