Browse Source

Impresión de recibo de pago ticket crifin

Sebas 6 years ago
commit
8ae2ccc05f
8 changed files with 243 additions and 0 deletions
  1. 18 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 37 0
      __openerp__.py
  4. BIN
      static/description/icon.png
  5. 17 0
      ticket_venta_crifin.py
  6. BIN
      ticket_venta_crifin.pyc
  7. 157 0
      ticket_venta_crifin.xml
  8. 14 0
      voucher_print_ticket.xml

+ 18 - 0
__init__.py

@@ -0,0 +1,18 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+###################################################################################
+from . import ticket_venta_crifin

BIN
__init__.pyc


+ 37 - 0
__openerp__.py

@@ -0,0 +1,37 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+#################################################################################
+
+{
+    'name': 'Ticket Pago Crifin',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Ticket Venta Crifin
+==========================
+
+Formato para imprimir Ticket Pago Crifin
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','account'],
+    'data': [
+        'ticket_venta_crifin.xml'
+    ],
+    'installable': True,
+}

BIN
static/description/icon.png


+ 17 - 0
ticket_venta_crifin.py

@@ -0,0 +1,17 @@
+from openerp import api, models
+import datetime
+from num2words import num2words
+
+class report_ticket_crifin(models.AbstractModel):
+    _name = 'report.voucher_print_ticket.report_ticket_crifin'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('voucher_print_ticket.report_ticket_crifin')
+        docargs = {
+            'doc_ids': self._ids,
+            'doc_model': report.model,
+            'docs': self.env[report.model].browse(self._ids),
+        }
+        return report_obj.render('voucher_print_ticket.report_ticket_crifin', docargs)

BIN
ticket_venta_crifin.pyc


+ 157 - 0
ticket_venta_crifin.xml

@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="ticket_venta_crifin"
+        model="account.voucher"
+        string="Ticket Pago"
+        report_type="qweb-html"
+        name="voucher_print_ticket.report_ticket_crifin"
+        file="voucher_print_ticket.report_ticket_crifin"
+     />
+
+    <record id="paperformat_lowmargin" model="report.paperformat">
+         <field name="name">Ticket Crifin</field>
+         <field name="default" eval="True" />
+         <field name="format">custom</field>
+         <field name="page_height">150</field>
+         <field name="page_width">60</field>
+         <field name="orientation">Portrait</field>
+         <field name="margin_top">3</field>
+         <field name="margin_bottom">3</field>
+         <field name="margin_left">3</field>
+         <field name="margin_right">3</field>
+         <field name="header_line" eval="False" />
+         <field name="header_spacing">3</field>
+         <field name="dpi">90</field>
+    </record>
+
+    <record id="voucher_print_ticket.ticket_venta_crifin" model="ir.actions.report.xml">
+        <field name="paperformat_id" ref="voucher_print_ticket.paperformat_lowmargin" />
+    </record>
+
+    <template id="report_ticket_crifin">
+        <t t-call="report.html_container">
+			<!-- <t t-foreach="[1,2,3]" t-as="i"> -->
+
+                <div class="page">
+                    <style>
+                        .logo{
+                            height: 1.71cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .table-condensed>tbody>tr>td {
+                            padding: 1px !important;
+                        }
+
+                        .borderless td, .borderless th {
+                            border: none !important;
+                        }
+                        .logo1{
+                            height: 2.61cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo2{
+                            height: 3.30cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                    </style>
+
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="row">
+                                <div class="col-xs-4">
+                                    <!--
+                                    ======================================================================
+                                        CABECERA
+                                    ======================================================================
+                                    -->
+                                    <div style="height:1.5cm;">
+                                        <div style="width:12cm;padding-top:0.4cm;padding-right:5.0cm;font-size:9.5px;font-family: Arial;text-align: center;">
+                                            <h3 style="text-align:center;">
+                                        		<span t-if="o.type == 'receipt'">Recibo de Cobro</span>
+                                        		<span t-if="o.type == 'payment'">Comprobante de Pago</span>
+                                        		<span t-if="o.number">No. <span t-field="o.number"/></span>
+                                        	</h3>
+
+                                        	    <div class="row">
+                                					<div class="col-xs-9">
+                                                    <p><strong>
+                                                    <span t-if="o.type == 'receipt'">Pagado por:</span>
+                                                    <span t-if="o.type == 'payment'">Pagado a:</span>
+                                                    </strong>
+                                                    <span t-field="o.partner_id"/> - Dirección:
+                                                     <span t-field="o.partner_id.contact_address"/></p>
+                                                	</div>
+                                					<div class="col-xs-9">
+                                                    <p><strong>
+                                                    <span t-if="o.type == 'receipt'">Pagado a:</span>
+                                                    <span t-if="o.type == 'payment'">Pagado por:</span>
+                                                    </strong>
+                                                    <span t-field="o.company_id"/> - Dirección:
+                                                     <span t-field="o.company_id.partner_id.contact_address"/></p>
+                                                	</div>
+                                        	    	<div class="col-xs-4">
+                                                    <strong>Fecha de Pago:</strong>
+                                                    <p t-field="o.date"/>
+                                                	</div>
+                                                    <div class="col-xs-4">
+                                                        <strong>Referencia/Descripción:</strong>
+                                                        <p t-field="o.reference"/>
+                                                    </div>
+                                                </div>
+
+                                             <hr size="4" width="90%"></hr>
+                                        	<div>
+                                        		<p>
+                                        		<span t-if="o.type == 'receipt'">Recibido de</span>
+                                        		<span t-if="o.type == 'payment'">Pagado a</span>
+                                        		<strong><span t-field="o.partner_id"/></strong> - Dirección:
+                                        		<span t-field="o.partner_id.contact_address"/></p>
+                                        		 <p>la cantidad de
+                                					<strong>
+                                						<span t-field="o.currency_id.symbol"/>
+                                						<span t-field="o.amount"/>
+                                					</strong>
+                                        		  Método de pago: <strong><span t-field="o.journal_id"/></strong>
+                                        		  <span t-if="o.reference">
+                                        		  con Referencia de factura:<strong><span t-field="o.reference"/>
+                                        		  </strong></span>
+                                        		  </p>
+                                        	</div>
+                                        	<div>
+                                        		<!-- <span t-if="o.narration"> -->
+                                        		<p><strong>Observaciones:</strong> <span t-field="o.narration"/></p>
+                                        		<!-- </span> -->
+                                        	</div>
+                                        	             <hr size="4" width="90%"></hr>
+                                        	    <div class="row" style="text-align:center;">
+                                					<div class="col-xs-4">
+                                                    <strong>Responsable:</strong>
+                                                    <p>.......................</p>
+                                                	</div>
+                                					<div class="col-xs-4">
+                                                    <strong>Cuenta:</strong>
+                                                    <p t-field="o.create_uid"/>
+                                                	</div>
+                                        	    	<div class="col-xs-4">
+                                                    <strong>Supervisor:</strong>
+                                                    <p>..................</p>
+                                                	</div>
+                                               </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </t>
+                </div>
+            </t>
+
+    </template>
+
+</data>
+</openerp>

+ 14 - 0
voucher_print_ticket.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+<report 
+            id="voucher_ext"
+            model="account.voucher"
+            string="Payment"
+            report_type="qweb-pdf"
+            name="voucher_print.report_voucher"
+            attachment_use="False"
+            file="voucher_print"
+        />
+    </data>
+</openerp>