factura_venta_conecta5.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <div class="page" style="width:21cm; height:29.7cm; margin:0; padding:0; font-family:Arial,Helvetica,sans-serif; font-size:11px;">
  15. <!-- Tres copias en la misma hoja -->
  16. <t t-foreach="[1,2,3]" t-as="i">
  17. <!-- Corregido: concatenación en lugar de % -->
  18. <div class="copia" t-att-style="'position:relative; height:9.7cm; width:100%; page-break-inside:avoid; margin-top:' + ('2' if i in [2,3] else '0') + 'cm;'">
  19. <style type="text/css">
  20. .campo{position:absolute; font-size:10px;}
  21. .detalle{position:absolute; top:3.6cm; left:1.2cm; width:19cm; font-size:10px; line-height:0.47cm;}
  22. .total_pagar_data{position:absolute; top:7.7cm; left:2cm; width:14cm;}
  23. .total_pagar{position:absolute; top:7.7cm; right:3.3cm; text-align:right; width:6cm;}
  24. .iva_5_data{position:absolute; top:8.3cm; left:7.1cm; width:3cm; text-align:right; padding-bottom:0.7cm;}
  25. .iva_10_data{position:absolute; top:8.3cm; left:10.4cm; width:3cm; text-align:right; padding-bottom:0.7cm;}
  26. .iva_total_data{position:absolute; top:8.3cm; left:14.9cm; width:3cm; text-align:right; padding-bottom:0.7cm;}
  27. .xmark{position:absolute; font-weight:bold; font-size:12px;}
  28. </style>
  29. <!-- Fecha de emisión -->
  30. <div class="campo" style="top:1.8cm; left:3.7cm;">
  31. <span t-field="o.date_invoice" t-field-options='{"format":"dd MMM yyyy"}'/>
  32. </div>
  33. <!-- Condición de venta (Contado / Crédito) -->
  34. <div class="xmark" style="top:0.1cm; left:18.4cm;">
  35. <t t-if="o.contado">X</t>
  36. </div>
  37. <div class="xmark" style="top:0.1cm; left:19.2cm;">
  38. <t t-if="o.credito">X</t>
  39. </div>
  40. <!-- Cliente: Nombre y RUC -->
  41. <div class="campo" style="top:0.8cm; left:3.5cm; width:19cm;">
  42. <t t-if="o.partner_id.street">
  43. <span t-field="o.partner_id.name"/>
  44. </t>
  45. <span style="position:absolute; left:13.5cm;">
  46. <span t-field="o.partner_id.ruc"/>
  47. </span>
  48. </div>
  49. <!-- Dirección + Teléfono -->
  50. <div class="campo" style="top:1.3cm; 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:14.0cm;">
  55. <span t-field="o.partner_id.mobile"/>
  56. </span>
  57. </div>
  58. <!-- Espacio antes del detalle -->
  59. <div style="position:absolute; top:3.3cm;"></div>
  60. <!-- Detalle -->
  61. <div class="detalle" style="top:2.9cm;">
  62. <t t-foreach="o.invoice_line" t-as="l">
  63. <div style="display:flex;">
  64. <div style="width:1.8cm; text-align:center;"><span t-esc="'{0:,.0f}'.format(l.quantity)"/></div>
  65. <div style="width:9.2cm;"><span t-field="l.product_id.name"/></div>
  66. <div style="width:2.3cm; text-align:right;"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></div>
  67. <div style="width:2.7cm; text-align:right;">
  68. <t t-if="l.invoice_line_tax_id and l.invoice_line_tax_id[0].amount == 0">
  69. <span t-esc="'{0:,.0f}'.format(l.price_subtotal)"/>
  70. </t>
  71. </div>
  72. <div style="width:2.5cm; text-align:right;"></div>
  73. <div style="width:2.5cm; text-align:right;">
  74. <span t-esc="'{0:,.0f}'.format((l.quantity * l.price_unit))"/>
  75. </div>
  76. </div>
  77. </t>
  78. </div>
  79. <!-- Totales -->
  80. <div class="total_pagar_data">
  81. <span t-esc="convertir(o.amount_total, o.currency_id.en_letras)"/>
  82. </div>
  83. <div class="total_pagar">
  84. <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
  85. </div>
  86. <!-- IVA -->
  87. <div class="iva_5_data"></div>
  88. <div class="iva_10_data">
  89. <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
  90. </div>
  91. <div class="iva_total_data">
  92. <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
  93. </div>
  94. </div>
  95. </t>
  96. </div>
  97. </t>
  98. </t>
  99. </template>
  100. </data>
  101. </openerp>