Browse Source

commit inicial

Rodney Enciso Arias 7 years ago
commit
a58affc48e
6 changed files with 230 additions and 0 deletions
  1. 27 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 42 0
      __openerp__.py
  4. 38 0
      registro_caja.py
  5. BIN
      registro_caja.pyc
  6. 123 0
      registro_caja.xml

+ 27 - 0
__init__.py

@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_brand for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    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 Brand is an Openobject module wich enable Brand management for products #
+###################################################################################
+from . import registro_caja

BIN
__init__.pyc


+ 42 - 0
__openerp__.py

@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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': 'Account Bank Statement Report',
+    'version': '1.2',
+    'category': 'Account',
+    'sequence': 19,
+    'summary': 'Registro de Caja',
+    'description': """
+Registro de Caja
+================
+
+    """,
+    'author': 'Paraguay en la Web/Victor Obrist, Rodney Enciso Arias',
+    'website': 'http://www.eiru.com.py',
+    'depends': ['base','account'],
+    'data': [
+        'registro_caja.xml',
+    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 38 - 0
registro_caja.py

@@ -0,0 +1,38 @@
+from openerp import api, models
+
+class report_registro_caja(models.AbstractModel):
+    _name = 'report.account_bank_statement_report.report_registro_caja'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('account_bank_statement_report.report_registro_caja')
+        docargs = {
+            'doc_ids': self._ids,
+            'doc_model': report.model,
+            'docs': self.env[report.model].browse(self._ids),
+            'get_sub_total_pos': self._get_sub_total_pos,
+            'get_sub_total_neg': self._get_sub_total_neg,
+            'get_total': self._get_total,
+        }
+        return report_obj.render('account_bank_statement_report.report_registro_caja', docargs)
+
+    def _get_sub_total_pos(self,statement_line_ids):
+        subtotal = 0.0
+        for line in statement_line_ids:
+            if line.amount > 0:
+                subtotal += line.amount
+        return subtotal
+
+    def _get_sub_total_neg(self,statement_line_ids):
+        subtotal = 0.0
+        for line in statement_line_ids:
+            if line.amount < 0:
+                subtotal += line.amount
+        return subtotal
+
+    def _get_total(self, statement_line_ids):
+        total = 0.0
+        for line in statement_line_ids:
+            total += line.amount
+        return total

BIN
registro_caja.pyc


+ 123 - 0
registro_caja.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+    <report id="registro_caja"
+        model="account.bank.statement"
+        string="Registro de Caja"
+        report_type="qweb-pdf"
+        name="account_bank_statement_report.report_registro_caja"
+        file="account_bank_statement_report.report_registro_caja"
+    />
+
+    <template id="report_registro_caja">
+        <t t-call="report.html_container">
+            <t t-foreach="docs" t-as="o">
+                <t t-call="report.internal_layout">
+                    <div class="page">
+                        <h2>Registro de Caja</h2>
+
+                        <div class="row">
+                            <div class="col-xs-3">
+                                <strong>Nombre del Registro</strong>:<br/>
+                                <span t-field="o.name"/>
+                            </div>
+                            <div class="col-xs-3">
+                                <strong>Diario</strong>:<br/>
+                                <span t-field="o.journal_id"/>
+                            </div>
+                            <div class="col-xs-3">
+                                <strong>Empresa</strong>:<br/>
+                                <span t-field="o.company_id"/>
+                            </div>
+                            <div class="col-xs-3">
+                                <strong>Responsable</strong>:<br/>
+                                <span t-field="o.user_id"/>
+                            </div>
+                        </div>
+
+                        <div class="row mb32">
+                            <div class="col-xs-3">
+                                <strong>Fecha de Apertura</strong>:<br/>
+                                <span t-field="o.date"/>
+                            </div>
+                            <div class="col-xs-3">
+                                <strong>Fecha de Cierre</strong>:<br/>
+                                <span t-field="o.closing_date"/>
+                            </div>
+                            <div class="col-xs-3">
+                                <strong>Balance Inicial</strong>:<br/>
+                                <span t-field="o.balance_start" t-field-options='{"widget": "monetary", "display_currency": "o.currency"}'/>
+                            </div>
+                            <div class="col-xs-3">
+                                <strong>Balance Final</strong>:<br/>
+                                <span t-field="o.balance_end_real" t-field-options='{"widget": "monetary", "display_currency": "o.currency"}'/>
+                            </div>
+                        </div>
+
+                        <table class="table table-condensed">
+                            <thead>
+                                <tr>
+                                    <th>Referencia</th>
+                                    <th>Socio</th>
+                                    <th class="text-right">Monto</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                <tr t-foreach="o.line_ids" t-as="line">
+                                    <t t-if="line.amount > 0">
+                                        <td><span t-field="line.ref"/></td>
+                                        <td><span t-esc="line.partner_id.name"/></td>
+                                        <td class="text-right">
+                                                <span t-field="line.amount"
+                                            t-field-options='{"widget": "monetary", "display_currency": "o.currency"}'/>
+                                        </td>
+                                    </t>
+                                </tr>
+                                <tr>
+                                    <td colspan="3"></td>
+                                </tr>
+                                <tr class="border-black">
+                                        <td></td>
+                                        <td><strong>Sub Total de Ventas</strong></td>
+                                        <td class="text-right"><strong><span t-esc="get_sub_total_pos(o.line_ids)" t-esc-options='{"widget": "monetary", "display_currency": "o.currency"}'/></strong></td>
+                                </tr>
+                                <tr t-foreach="o.line_ids" t-as="line">
+                                    <t t-if="not line.amount > 0">
+                                        <td><span t-field="line.name"/></td>
+                                        <td><span t-esc="line.partner_id.name"/></td>
+                                        <td class="text-right">
+                                                <span t-field="line.amount"
+                                            t-field-options='{"widget": "monetary", "display_currency": "o.currency"}'/>
+                                        </td>
+                                    </t>
+                                </tr>
+                                <tr>
+                                    <td colspan="3"></td>
+                                </tr>
+                                <tr class="border-black">
+                                        <td></td>
+                                        <td><strong>Sub Total</strong></td>
+                                        <td class="text-right"><strong><span t-esc="get_sub_total_neg(o.line_ids)" t-esc-options='{"widget": "monetary", "display_currency": "o.currency"}'/></strong></td>
+                                </tr>
+                            </tbody>
+                        </table>
+
+                        <div class="row">
+                            <div class="col-xs-4 pull-right">
+                                <table class="table table-condensed">
+                                    <tr class="border-black">
+                                        <td><strong>Saldo Final</strong></td>
+                                        <!--<td class="text-right"><strong><span t-esc="formatLang(get_total(o.line_ids), currency_obj=res_company.currency_id)"/></strong></td>-->
+                                        <td class="text-right"><strong><span t-esc="get_total(o.line_ids)" t-esc-options='{"widget": "monetary", "display_currency": "o.currency"}'/></strong></td>
+                                    </tr>
+                                </table>
+                            </div>
+                        </div>
+                    </div>
+                </t>
+            </t>
+        </t>
+    </template>
+</data>
+</openerp>
+