소스 검색

[FIX] limpieza de codigo y eliminacion de archivos innecesarios

Rodney Elpidio Enciso Arias 7 년 전
부모
커밋
643ad82592

BIN
__init__.pyc


+ 0 - 76
static/src/css/eiru_set.css

@@ -1,79 +1,3 @@
-.reporting_view_header {
-    display: flex;
-    width: 100%;
-    height: 80px;
-    padding: 5px;
-}
-
-.reporting_view_header > h2 {
-    font-weight: bold;
-    font-size: 14pt !important;
-    padding: 10px;
-}
-
-.reporting_view_header > .reporting_searcher {
-    display: flex;
-    flex-direction: row-reverse;
-    padding: 5px;
-    height: 35px;
-    width: 100%;
-}
-
-.reporting_page_header {
-    padding-bottom: 9px;
-    margin: 25px 0 35px;
-    border-bottom: 1px solid #eee;
-}
-
-.reporting_page_header > h1 > small {
-    padding-left: 1.833em;
-    font-size: 8pt;
-}
-
-.report_group {
-    display: flex;
-    flex-direction: row;
-    flex-wrap: wrap;
-    justify-content: center;
-    width: 100%;
-    height: 100%;
-}
-
-.report_item {
-    padding: 1em 1em;
-    margin: 1em 1em;
-    width: 220px;
-    height: 250px;
-    border: 1px solid #d3d3d3;
-    border-radius: 3px;
-    box-shadow: 5px 5px 2px #d3d3d3;
-    display: flex;
-    flex-direction: column;
-}
-
-.report_item:hover {
-    box-shadow: 3px 3px 2px #d3d3d3;
-    transform: translateY(2px);
-}
-
-.report_title > h1 {
-    text-align: center;
-    font-size: 9pt;
-}
-
-.report_content {
-    flex-grow: 1;
-    margin: 0.8em 0;
-    overflow-y: auto;
-}
-
-.report_content > p {
-}
-
-.report_action > button {
-    width: 100%;
-}
-
 .oe_form_sheet_width{
     max-width: 1100px !important;
 }

+ 23 - 7
static/src/js/reports/report_purchases.js

@@ -56,6 +56,9 @@ function report_purchases (reporting){
                 return self.fetchPaymentTerm();
             }).then(function (paymentTerm){
                 self.paymentTerm=paymentTerm;
+                return self.fetchPaymentTermLine();
+            }).then(function (paymentTermLine){
+                self.paymentTermLine=paymentTermLine;
                 return self.fetchAttachment();
             }).then(function(attachment){
                 self.attachment=attachment;
@@ -70,7 +73,7 @@ function report_purchases (reporting){
             var self = this;
             var defer = $.Deferred();
             var Journal = new instance.web.Model('account.journal');
-            Journal.query(['id', 'name']).filter([['type', '=', ['purchase','purchase_refund']]]).all().then(function(results){
+            Journal.query(['id', 'name']).filter([['type', 'in', ['purchase','purchase_refund']]]).all().then(function(results){
                 defer.resolve(results);
             });
             return defer;
@@ -91,7 +94,7 @@ function report_purchases (reporting){
             var journal_ids = _.flatten(_.map(this.accountJournal, function (item) {
                 return item.id;
             }));
-            var filter =[['state', 'in',['open','paid']],['type', '=', ['in_invoice','in_refund']],['journal_id', 'in',journal_ids]];
+            var filter =[['state', 'in',['open','paid']],['type', 'in', ['in_invoice','in_refund']],['journal_id', 'in',journal_ids]];
             var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids','timbrado'];
             var defer = $.Deferred();
             var Invoice = new instance.web.Model('account.invoice');
@@ -143,7 +146,17 @@ function report_purchases (reporting){
                 return map.payment_term[0];
             }));
             var paymentTerm = new instance.web.Model('account.payment.term');
-            paymentTerm.query(['id','name','line_ids']).filter([['id', '=', payment_term]]).all().then(function(results){
+            paymentTerm.query(['id','name','line_ids']).filter([['id', 'in', payment_term]]).all().then(function(results){
+                defer.resolve(results);
+            });
+            return defer;
+        },
+        // Linea de plazos de pago
+        fetchPaymentTermLine: function () {
+            var self = this;
+            var defer = $.Deferred();
+            var paymentTermLine = new instance.web.Model('account.payment.term.line');
+            paymentTermLine.query(['id']).filter().all().then(function(results){
                 defer.resolve(results);
             });
             return defer;
@@ -199,15 +212,18 @@ function report_purchases (reporting){
                 // Obtener el ruc y el DV del proveedor
                 supplier_ruc = self.getSupplier(invoice.partner_id[0]);
                 ruc = supplier_ruc.ruc.split("-");
+
+                // Determinar la cantidad de cuotas.
+                cuota = _.flatten(self.getPaymentTerm(invoice.payment_term[0])).length - 2;
+                
                 // Determinar si la factura es a credito o al contado.
                 condicion = 1;
-                if (invoice.credito == true){
+                if (cuota > 1){
                     condicion = 2;
                 }
-                // Determinar la cantidad de cuotas.
-                cuota = _.flatten(self.getPaymentTerm(invoice.payment_term[0])).length - 2;
+                
                 // Validar. Si la factura es al contado, la cuota debe ser cero.
-                if (condicion == 1 || cuota < 1){
+                if (condicion == 1){
                     cuota = 0;
                 }
                 // Determinar el tipo de factura.

+ 14 - 9
static/src/js/reports/report_sales.js

@@ -68,7 +68,7 @@ function report_sales (reporting){
             var self = this;
             var defer = $.Deferred();
             var Journal = new instance.web.Model('account.journal');
-            Journal.query(['id', 'name','timbrado']).filter([['type', '=', ['sale','sale_refund']]]).all().then(function(results){
+            Journal.query(['id', 'name','timbrado']).filter([['type', 'in', ['sale','sale_refund']]]).all().then(function(results){
                 defer.resolve(results);
             });
             return defer;
@@ -89,7 +89,7 @@ function report_sales (reporting){
             var journal_ids = _.flatten(_.map(this.accountJournal, function (item) {
                 return item.id;
             }));
-            var filter =[['state', 'in',['open','paid']],['type', '=', ['out_invoice','out_refund']],['journal_id', 'in',journal_ids]];
+            var filter =[['state', 'in',['open','paid']],['type', 'in', ['out_invoice','out_refund']],['journal_id', 'in',journal_ids]];
             var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids'];
             var defer = $.Deferred();
             var Invoice = new instance.web.Model('account.invoice');
@@ -141,7 +141,7 @@ function report_sales (reporting){
                 return map.payment_term[0];
             }));
             var paymentTerm = new instance.web.Model('account.payment.term');
-            paymentTerm.query(['id','name','line_ids']).filter([['id', '=', payment_term]]).all().then(function(results){
+            paymentTerm.query(['id','name','line_ids']).filter([['id', 'in', payment_term]]).all().then(function(results){
                 defer.resolve(results);
             });
             return defer;
@@ -213,22 +213,27 @@ function report_sales (reporting){
                 // obtener el ruc y el DV del cliente
                 customer_ruc = self.getCustomer(invoice.partner_id[0]);
                 ruc = customer_ruc.ruc.split("-");
-                // Determinar si la factura es a credito o al contado
-                condicion = 1;
-                if (invoice.credito == true){
-                    condicion = 2;
-                }
                 // Determinar el tipo de factura.
                 if(invoice.type == 'out_invoice'){
                     tipo = 1;
                 }else{
                     tipo = 3;
                 }
+
                 // Determinar la cantidad de cuotas
                 cuota = _.flatten(self.getPaymentTerm(invoice.payment_term[0])).length - 2;
-                if (condicion == 1 || cuota < 1){
+
+                // Determinar si la factura es a credito o al contado
+                condicion = 1;
+                if (cuota > 1){
+                    condicion = 2;
+                }
+
+                // Validar. Si la factura es al contado, la cuota debe ser cero.
+                if (condicion == 1){
                     cuota = 0;
                 }
+
                 // Manejo de impuestos
                 IVA = accounting.formatNumber(((invoice.amount_untaxed * 10)/100),"","");
                 TAX = accounting.formatNumber(invoice.amount_tax,"","");

+ 2 - 1
static/src/reports/report_purchases.xml

@@ -37,7 +37,8 @@
                 data-height="auto"
                 data-classes="table table-hover table-condensed table-bordered"
                 data-row-style="rowStyle"
-                data-search="true">
+                data-search="true"
+                class="table table-condenced">
                 <thead>
                     <tr>
                         <th data-field="linea" data-align="center">#</th>

+ 0 - 41
views/account_invoice.xml

@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <record id="account_invoice_customer_credit" model="ir.ui.view">
-            <field name="name">account.invoice.credit</field>
-            <field name="model">account.invoice</field>
-            <field name="inherit_id" ref="account.invoice_form" />
-            <field name="arch" type="xml">
-                <field name="partner_id" position="after">
-                    <field name="contado" attrs="{'readonly': [('state','!=','draft')]}"/>
-                </field>
-                <field name="contado"  position="after" >
-                    <field name="credito" attrs="{'readonly' : ['|',('state','!=','draft')]}"/>
-                </field>
-                <field name="payment_term" position="replace">
-                    <field name="payment_term" class="oe_inline" attrs="{'invisible' : [('credito', '=', False )],'required' : [ ('credito', '=', True )]}"/>
-                </field>
-            </field>
-        </record>
-
-        <record id="account_invoice_supplier_credit" model="ir.ui.view">
-            <field name="name">account.invoice.supplier.credit</field>
-            <field name="model">account.invoice</field>
-            <field name="inherit_id" ref="account.invoice_supplier_form" />
-            <field name="arch" type="xml">
-                <field name="journal_id" position="after">
-                    <field name="contado" attrs="{'readonly': [('state','!=','draft')]}"/>
-                </field>
-                <field name="contado"  position="after" >
-                    <field name="credito" attrs="{'readonly' : ['|',('state','!=','draft')]}"/>
-                </field>
-                <field name="payment_term" position="replace">
-                    <field name="payment_term" class="oe_inline" attrs="{'invisible' : [('credito', '=', False )],'required' : [ ('credito', '=', True )]}"/>
-                </field>
-                <field name="supplier_invoice_number" position="before">
-                    <field name="timbrado"/>
-                </field> 
-            </field>
-        </record>
-    </data>
-</openerp>

+ 0 - 15
views/account_journal.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <record id="view_account_journal_form" model="ir.ui.view">
-            <field name="name">account.journal.form</field>
-            <field name="model">account.journal</field>
-            <field name="inherit_id" ref="account.view_account_journal_form"/>
-            <field name="arch" type="xml">
-                <field name="company_id" position="after">
-                    <field name="timbrado" attrs=" {'required':[('type','=','sale')]}"/>
-                </field>                
-            </field>
-        </record>
-    </data>
-</openerp>

+ 0 - 18
views/res_company.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <record model="ir.ui.view" id="res_company_form_view_ruc">
-            <field name="name">res.company.form.view.ruc</field>
-            <field name="model">res.company</field>
-            <field name="inherit_id" ref="base.view_company_form" />
-            <field name="arch" type="xml">
-                <field name="company_registry" position="after">
-                    <field name="company_ruc"/>
-                    <field name="legal_agent"/>
-                    <field name="agent_ruc"/>
-                    <field name="exportador" required="1"/>       
-                </field>
-            </field>
-        </record>
-    </data>
-</openerp>