factura_venta_conecta5.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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.2' if i == 2 else ('2' if i == 2.5 else '0')) + 'cm;'">
  20. <style type="text/css">
  21. .campo{position:absolute; font-size:10px;}
  22. .detalle{position:absolute; top:3.6cm; left:1.2cm; width:19cm; font-size:10px; line-height:0.47cm;color:red;}
  23. .total_pagar_data{position:absolute; top:6.1cm; left:3.2cm; width:14cm;}
  24. .total_pagar{position:absolute; top:6.1cm; right:1.3cm; text-align:right; width:6cm;color:red;}
  25. .iva_5_data{position:absolute; top:7.4cm; left:7.1cm; width:3cm; text-align:right;color:red;}
  26. .iva_10_data{position:absolute; top:7.4cm; left:9.4cm; width:3cm; text-align:right;color:red;}
  27. .iva_total_data{position:absolute; top:7.4cm; left:15.1cm; width:3cm; 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.7cm;">
  32. <span t-field="o.date_invoice" t-field-options='{"format":"dd MMM yyyy"}'/>
  33. </div>
  34. <!-- Condición de venta (Contado / Crédito) -->
  35. <div class="xmark" style="top:0.2cm; left:17.8cm;">
  36. <t t-if="o.contado">X</t>
  37. </div>
  38. <div class="xmark" style="top:0.2cm; left:18.4cm;">
  39. <t t-if="o.credito">X</t>
  40. </div>
  41. <!-- Cliente: Nombre y RUC -->
  42. <div class="campo" style="top:0.5cm; left:3.9cm; width:19cm;">
  43. <t t-if="o.partner_id.street">
  44. <span t-field="o.partner_id.name"/>
  45. </t>
  46. <span style="position:absolute; left:12.5cm;">
  47. <span t-field="o.partner_id.ruc"/>
  48. </span>
  49. </div>
  50. <!-- Dirección + Teléfono -->
  51. <div class="campo" style="top:1.0cm; left:2.5cm; width:19cm;">
  52. <t t-if="o.partner_id.street">
  53. <span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/>
  54. </t>
  55. <span style="position:absolute; left:12.0cm;">
  56. <span t-field="o.partner_id.mobile"/>
  57. </span>
  58. </div>
  59. <!-- Detalle -->
  60. <div class="detalle" style="top:2.8cm;">
  61. <t t-foreach="o.invoice_line" t-as="l">
  62. <div style="display:flex;">
  63. <div style="width:1.8cm; text-align:center;"><span t-esc="'{0:,.0f}'.format(l.quantity)"/></div>
  64. <div style="width:7.9cm;"><span t-field="l.product_id.name"/></div>
  65. <div style="width:2.3cm; text-align:right;"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></div>
  66. <div style="width:3.0cm; text-align:right;">
  67. <t t-if="l.invoice_line_tax_id and l.invoice_line_tax_id[0].amount == 0">
  68. <span t-esc="'{0:,.0f}'.format(l.price_subtotal)"/>
  69. </t>
  70. </div>
  71. <div style="width:3.5cm; text-align:right;"></div>
  72. <div style="width:2.5cm; text-align:right;">
  73. <span t-esc="'{0:,.0f}'.format((l.quantity * l.price_unit))"/>
  74. </div>
  75. </div>
  76. </t>
  77. </div>
  78. <!-- Totales -->
  79. <div class="total_pagar_data">
  80. <span t-esc="convertir(o.amount_total, o.currency_id.en_letras)"/>
  81. </div>
  82. <div class="total_pagar">
  83. <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
  84. </div>
  85. <!-- IVA -->
  86. <div class="iva_5_data"></div>
  87. <div class="iva_10_data">
  88. <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
  89. </div>
  90. <div class="iva_total_data">
  91. <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
  92. </div>
  93. </div>
  94. </t>
  95. </div>
  96. </t>
  97. </t>
  98. </template>
  99. </data>
  100. </openerp>