factura_venta_conecta5.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <report id="factura_venta_conecta5"
  5. model="account.invoice"
  6. string="Factura Legal"
  7. report_type="qweb-html"
  8. name="factura_venta_conecta5.report_factura_conecta5"
  9. file="factura_venta_conecta5.report_factura_conecta5"
  10. />
  11. <template id="report_factura_conecta5">
  12. <t t-call="report.html_container">
  13. <t t-foreach="docs" t-as="o">
  14. <!-- A4 = 29.7cm alto, dejamos 3cm arriba de margen -->
  15. <div class="page" style="width:21cm; height:29.7cm; margin:0; padding-top:2cm; font-family:Arial,Helvetica,sans-serif; font-size:11px; box-sizing:border-box;">
  16. <!-- Tres copias en la misma hoja -->
  17. <t t-foreach="[1,2,3]" t-as="i">
  18. <!-- Cada copia ocupa ~8.8cm de alto (3x8.8 + 3cm margen = 29.7cm) -->
  19. <div class="copia" t-att-style="'position:relative; height:8.8cm; width:100%; page-break-inside:avoid; margin-top:' + ('2.4' if i == 2 else ('2.0' if i == 3 else '0')) + 'cm;'">
  20. <style type="text/css">
  21. .campo{position:absolute; font-size:10px;}
  22. .detalle{position:absolute; top:2.8cm; left:1.2cm; width:19cm; font-size:10px; line-height:0.47cm;color:red;}
  23. .total_pagar_data{position:absolute; top:6.5cm; left:3.2cm; width:14cm;}
  24. .total_pagar{position:absolute; top:6.5cm; right:1.3cm; text-align:right; width:6cm;color:red;}
  25. .iva_5_data{position:absolute; top:7.9cm; left:7.1cm; width:3cm; text-align:right;color:red;}
  26. .iva_10_data{position:absolute; top:7.9cm; left:9.4cm; width:3cm; text-align:right;color:red;}
  27. .iva_total_data{position:absolute; top:7.9cm; left:15.1cm; width:3.5cm; text-align:right;color:red;}
  28. .xmark{position:absolute; font-weight:bold; font-size:12px;color:red;}
  29. </style>
  30. <!-- Fecha de emisión -->
  31. <div class="campo" style="top:0.2cm; left:3.9cm;">
  32. <!-- <span t-esc="time.strftime('%d %b %Y')"/>-->
  33. <span t-field="o.date_invoice" t-field-options='{"format": "dd MMM yyyy"}'/>
  34. </div>
  35. <!-- Condición de venta (Contado / Crédito) -->
  36. <div class="xmark" style="top:0.2cm; left:18.5cm;">
  37. <t t-if="o.contado">X</t>
  38. </div>
  39. <div class="xmark" style="top:0.2cm; left:18.6cm;">
  40. <t t-if="o.credito">X</t>
  41. </div>
  42. <!-- Cliente: Nombre y RUC -->
  43. <div class="campo" style="top:0.7cm; left:4.5cm; width:19cm;">
  44. <span t-field="o.partner_id.name"/>
  45. <span style="position:absolute; left:11.7cm;">
  46. <span t-field="o.partner_id.ruc"/>
  47. </span>
  48. </div>
  49. <!-- Dirección + Teléfono -->
  50. <div class="campo" style="top:1.2cm; left:2.5cm; width:19cm;">
  51. <t t-if="o.partner_id.street">
  52. <span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/>
  53. </t>
  54. <span style="position:absolute; left:12.0cm;">
  55. <span t-field="o.partner_id.mobile"/>
  56. </span>
  57. </div>
  58. <!-- Detalle -->
  59. <div class="detalle" style="top:2.8cm;">
  60. <t t-foreach="o.invoice_line" t-as="l">
  61. <div style="display:flex;">
  62. <div style="width:1.9cm; text-align:center;"><span t-esc="'{0:,.0f}'.format(l.quantity)"/></div>
  63. <div style="width:8.6cm;"><span t-field="l.product_id.name"/></div>
  64. <div style="width:2.3cm; text-align:right;"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></div>
  65. <div style="width:3.0cm; text-align:right;">
  66. <t t-if="l.invoice_line_tax_id and l.invoice_line_tax_id[0].amount == 0">
  67. <span t-esc="'{0:,.0f}'.format(l.price_subtotal)"/>
  68. </t>
  69. </div>
  70. <div style="width:3.4cm; text-align:right;"></div>
  71. <div style="width:2.5cm; text-align:right;">
  72. <span t-esc="'{0:,.0f}'.format((l.quantity * l.price_unit))"/>
  73. </div>
  74. </div>
  75. </t>
  76. </div>
  77. <!-- Totales -->
  78. <div class="total_pagar_data">
  79. <span t-esc="convertir(o.amount_total, o.currency_id.en_letras)"/>
  80. </div>
  81. <div class="total_pagar">
  82. <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
  83. </div>
  84. <!-- IVA -->
  85. <div class="iva_5_data"></div>
  86. <div class="iva_10_data">
  87. <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
  88. </div>
  89. <div class="iva_total_data">
  90. <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
  91. </div>
  92. </div>
  93. </t>
  94. </div>
  95. </t>
  96. </t>
  97. </template>
  98. </data>
  99. </openerp>