瀏覽代碼

Impresion factura legal en pos factura ferresur

Sebas 6 年之前
當前提交
ed9751857f
共有 10 個文件被更改,包括 408 次插入0 次删除
  1. 18 0
      __init__.py
  2. 二進制
      __init__.pyc
  3. 40 0
      __openerp__.py
  4. 17 0
      account_invoice_view.xml
  5. 18 0
      factura_pos_ferresur.py
  6. 二進制
      factura_pos_ferresur.pyc
  7. 296 0
      factura_pos_ferresur.xml
  8. 19 0
      numbers_to_letters1.py
  9. 二進制
      numbers_to_letters1.pyc
  10. 二進制
      static/description/icon.png

+ 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 factura_pos_ferresur, numbers_to_letters1

二進制
__init__.pyc


+ 40 - 0
__openerp__.py

@@ -0,0 +1,40 @@
+# -*- 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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product features is an Openobject module with enable features management for products #
+###################################################################################
+{
+    'name': 'Factura de Pos Ferresur',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Factura Pos Legal Ferresur
+
+
+Formato para imprimir la factura pos legal de Ferresur
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com.py',
+    'depends': ['base','point_of_sale'],
+    'data': [
+	    'factura_pos_ferresur.xml'
+    ],
+    'installable': True,
+}

+ 17 - 0
account_invoice_view.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+    <data>
+        <record id="account_invoice_cred_cont" model="ir.ui.view">
+            <field name="name">account.invoice.cred.cont</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form" />
+            <field name="arch" type="xml">
+                <field name="fiscal_position" position="after">
+                        <field name="contado"/>
+                        <field name="credito"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 18 - 0
factura_pos_ferresur.py

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

二進制
factura_pos_ferresur.pyc


+ 296 - 0
factura_pos_ferresur.xml

@@ -0,0 +1,296 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="factura_pos_ferresur"
+        model="pos.order"
+        string="Factura Legal"
+        report_type="qweb-html"
+        name="factura_pos_ferresur.report_pos_ferresur"
+        file="factura_pos_ferresur.report_pos_ferresur"
+     />
+
+    <template id="report_pos_ferresur">
+        <t t-call="report.html_container">
+            <t t-foreach="[1,2]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 2.8mm;
+
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                            padding-right: 1cm;
+                        }
+                        .logo{
+                            height: 2.5cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo1{
+                            height: 4.2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .fecha_emision_data{
+                            width: 14.5cm;
+                            padding-left:2.5cm;
+                            float: left;
+                            min-height: 0.48cm;
+                        }
+                        .contado_x{
+                            width: 3.6cm;
+                            float: left;
+                            padding-left: 1cm;
+                            min-height: 0.46cm;
+                        }
+
+                        .razon_data{
+                            width: 11.7cm;
+                            float: left;
+                            padding-left: 2.5cm;
+                            min-height: 0.49cm;
+                        }
+                        .ruc_data{
+                            width: 5cm;
+                            float: left;
+                            padding-left: 2.8cm;
+                            min-height: 0.47cm;
+                        }
+                        .direccion_data{
+                            width: 13.5cm;
+                            float: left;
+                            padding-left:2.7cm;
+                            min-height: 0.45cm;
+                        }
+                        .telefono_data{
+                            width: 3.5cm;
+                            float: right;
+                            padding-left: 0.1mm;
+                            min-height: 0.45cm;
+                        }
+                        .nota_remision_data{
+                            width: 13cm;
+                            float: left;
+                            padding-left: 2.8cm;
+                            min-height: 0cm;
+                        }
+                        .dias_credito{
+                            width: 5cm;
+                            float: left;
+                            padding-left: 0.8cm;
+                            min-height: 0cm;
+                        }
+                        .cab-articulos{
+                            height: 1.3cm;
+                            clear: both;
+                        }
+                        .divisoria1{
+                            height: 1.9cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+
+                        .borderless td, .borderless th {
+                            border: none !important;
+                        }
+                        .table-condensed>tbody>tr>td {
+                            padding: 1px !important;
+                        }
+                        .table-super-condensed>tbody>tr>td {
+                            padding: 5px !important;
+                        }
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <tr>
+                                <div class="fecha_emision_data"><span t-field="o.date_order" t-field-options='{"format": "dd MMMM yyyy"}'/></div>
+                                <div class="contado_x">Contado</div>
+                            </tr>
+
+                            <tr>
+                                <div class="razon_data"><span t-field="o.partner_id.name"/></div>
+                                <div class="ruc_data"><span t-field="o.partner_id.ruc"/></div>
+                            </tr>
+
+                            <tr>
+                                <div class="direccion_data">
+                                    <t t-f="o.partner_id.street"><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/></t>
+                                    <t t-f="not o.partner_id.street"> </t>
+                                </div>
+                                <div class="telefono_data"><span t-field="o.partner_id.mobile"/></div>
+                            </tr>
+
+                            <tr>
+                                <div class="nota_remision_data"></div>
+                                <div class="dias_credito"></div>
+                            </tr>
+
+                            <div class="cab-articulos"> </div>
+                            <div style="height:5.2cm;">
+                                <div style="font-family: Arial;">
+                                    <table class="table borderless table-condensed">
+                                        <t t-set="valor_exentas" t-value="0"/>
+                                        <t t-set="valor_5" t-value="0"/>
+                                        <t t-set="valor_10" t-value="0"/>
+                                        <tbody>
+                                            <tr t-foreach="o.lines" t-as="l">
+                                                <!-- CODIGO DE PRODUCTO -->
+                                                <td style="font-size:9px;font-family: Arial;width:2.2cm;overflow: auto; text-align: left;">
+                                                    <span t-field="l.product_id.ean13"/>
+                                                </td>
+                                                <!-- CANTIDAD -->
+                                                <td style="font-size:9px;font-family: Arial;width:2.7cm;overflow: auto; text-align: center;">
+                                                    <span t-esc="'%.0f'%l.qty"/>
+                                                </td>
+
+                                                <!-- NOMBRE DEL PRODUCTO -->
+                                                <td style="font-size:9px;font-family: Arial;width:9.8cm;overflow: auto;">
+                                                    <span t-field="l.product_id.name"/>
+                                                </td>
+                                                <!-- PRECIO UNITARIO -->
+                                                <td style="font-size:9px;font-family: Arial;width:1.8cm;overflow: auto; text-align: right;">
+
+                                                        <span t-esc="'{0:,.0f}'.format(l.price_unit)"/>
+
+                                                </td>
+                                                <!-- EXENTAS -->
+                                                <td style="font-size:9px;font-family: Arial;width:2.0cm;overflow: auto; text-align: right;">
+
+                                                </td>
+
+                                                <!-- IVA 5% -->
+                                                <td style="font-size:9px;font-family: Arial;width:2cm;overflow: auto; text-align: right;">
+
+                                                </td>
+
+                                                <!-- IVA 10% -->
+                                                <td style="font-size:9px;font-family: Arial;width:2.3cm;overflow: auto; text-align: right;">
+
+
+                                                            <span t-esc="'{0:,.0f}'.format(l.price_subtotal_incl)"/>
+
+                                                        <t t-set="valor_10" t-value="valor_10+(l.price_subtotal_incl)"/>
+
+                                                </td>
+                                            </tr>
+                                        </tbody>
+                                    </table>
+                                </div>
+                            </div>
+                            <div style="height:1.9cm;padding-left:1.7cm;">
+                                    <t t-set="total_exentas" t-value="0"/>
+                                    <t t-set="total_5" t-value="0"/>
+                                    <t t-set="total_10" t-value="0"/>
+                                    <t t-set="iva_5" t-value="0"/>
+                                    <t t-set="iva_10" t-value="0"/>
+                                    <t t-set="iva_exentas" t-value="0"/>
+                                    <table class="table borderless table-condensed">
+                                        <tbody>
+
+                                            <tr>
+                                                <td style="font-size:10px;font-family: Arial;width:2.2cm;overflow: auto; text-align: center;"></td>
+                                                <td style="font-size:10px;font-family: Arial;width:2.7cm;overflow: auto; text-align: center;"></td>
+                                                <td style="font-size:10px;font-family: Arial;width:9.8cm;overflow: auto; text-align: center;"></td>
+                                                <td style="font-size:10px;font-family: Arial;width:2cm;overflow: auto; text-align: center;"></td>
+                                                <td style="font-size:10px;font-family: Arial;width:2.0cm;overflow: auto; text-align: right;">
+
+                                                        <span t-esc="'{0:,.0f}'.format(valor_exentas)"/>
+
+                                                    <t t-set="iva_exentas" t-value="valor_exentas"/>
+                                                </td>
+                                                <td style="font-size:10px;font-family: Arial;width:2.1cm;overflow: auto; text-align: right;">
+
+                                                        <span t-esc="'{0:,.0f}'.format(valor_5)"/>
+
+                                                    <t t-set="iva_5" t-value="valor_5/21" />
+                                                </td>
+                                                <td style="font-size:10px;font-family: Arial;width:2.3cm;overflow: auto; text-align: right;">
+
+                                                        <span t-esc="'{0:,.0f}'.format(valor_10)"/>
+
+                                                    <t t-set="iva_10" t-value="(valor_10)/11" />
+                                                </td>
+                                            </tr>
+
+                                            <tr>
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:2.2cm;overflow: auto; text-align: center;"></td>
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:2.5cm;overflow: auto; text-align: center;"></td>
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:7cm;overflow: auto; text-align: left;">
+                                                        <div>
+                                                            <!-- <span t-esc="o.amount_to_text(o.amount_total, o.pricelist_id.currency_id)"/> -->
+                                                            <span t-esc="o.compute_text()" />
+                                                            <!-- <span t-esc="o.amount_total"/> -->
+                                                        </div>
+                                                </td>
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:2cm;overflow: auto; text-align: center;"></td>
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:2cm;overflow: auto; text-align: right;"></td>
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:2.2cm;overflow: auto; text-align: right;"></td>
+
+                                                <td style="padding-top:0.4cm;font-size:10px;font-family: Arial;width:2.5cm;overflow: auto; text-align: right;">
+
+                                                        <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
+                                                </td>
+                                            </tr>
+
+                                            <div class="divisoria1"> </div>
+                                            <tr>
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:2.2cm;overflow: auto; text-align: center;"></td>
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:2.5cm;overflow: auto; text-align: center;">
+
+                                                        <div>
+                                                            <t t-if="iva_5 != 0">
+                                                                <span t-esc="'{0:,.0f}'.format(iva_5)"/>
+                                                            </t>
+                                                        </div>
+
+                                                </td>
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:7cm;overflow: auto; text-align: left;">
+
+                                                        <div>
+                                                            <t t-if="iva_10 != 0">
+                                                                &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
+                                                                &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
+                                                                &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
+                                                                <span t-esc="'{0:,.0f}'.format(iva_10)"/>
+                                                            </t>
+                                                        </div>
+
+                                                </td>
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:2cm;overflow: auto; text-align: left;">
+
+
+                                                        <span t-esc="'{0:,.0f}'.format(iva_5+iva_10)"/>
+
+
+                                                </td>
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:2.0cm;overflow: auto; text-align: right;">
+
+                                                </td>
+
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:2.2cm;overflow: auto; text-align: center;">
+                                                </td>
+                                                <td style="padding-top:0.6cm;font-size:10px;font-family: Arial;width:2.5cm;overflow: auto; text-align: right;">
+                                                </td>
+                                            </tr>
+                                        </tbody>
+                                    </table>
+                            </div>
+                            <div class="logo1"> </div>
+                        </div>
+
+                    </t>
+
+                </div>
+            </t>
+        </t>
+    </template>
+</data>
+</openerp>

+ 19 - 0
numbers_to_letters1.py

@@ -0,0 +1,19 @@
+# -*- encoding: utf-8 -*-
+from openerp import models, fields, api
+from openerp.tools.amount_to_text import amount_to_text
+#
+# class pos_order(models.Model):
+#     _inherit = "pos.order"
+#
+#     @api.multi
+#     def amount_to_text(self, amount):
+#         return amount_to_text(amount)
+
+
+
+class pos_order(models.Model):
+    _inherit = 'pos.order'
+
+    @api.multi
+    def compute_text(self, amount_total):
+        return compute_text(amount_total)

二進制
numbers_to_letters1.pyc


二進制
static/description/icon.png