robert2206 vor 7 Jahren
Ursprung
Commit
01cfecdf30

+ 50 - 30
static/src/js/widgets/expired_account_counters.js

@@ -1,6 +1,8 @@
 function expired_account_counters (widget) {
     "use strict";
-    var model= openerp;
+
+    var model = openerp;
+
     widget.ExpiredAccountCountersWidget = widget.Base.extend({
         template: 'ExpiredAccountCounters',
         // data : [],
@@ -16,79 +18,97 @@ function expired_account_counters (widget) {
         },
         start: function () {
             var self = this;
-            self.fecthInitial();
+            self.fetchInitial();
         },
-        fecthInitial:function(){
+        fetchInitial: function(){
             var self = this;
-            self.$el.find('.grid-stack-item-content dashboard').block({ message: null, overlayCSS: { backgroundColor: '#FAFAFA' }});
+            self.$el.find('.grid-stack-item-content dashboard').block({
+                message: null,
+                overlayCSS: {
+                    backgroundColor: '#FAFAFA'
+                }
+            });
             self.$el.find('.widget-content.widget-loading').css('display','flex');
 
-            self.fecthPartner().then(function(resPartner){
+            self.fetchPartner().then(function (resPartner){
                 return resPartner;
-            }).then(function(resPartner){
+            }).then(function (resPartner){
                 self.resPartner = resPartner;
-                return self.fecthMoveLine(resPartner);
-            }).then(function(moveLine){
-                self.moveLine= moveLine;
-                return self.fecthResComapny();
-            }).then(function(resCompany){
-                self.resCompany=resCompany;
-                return self.fecthReduceMoveLine();
+                return self.fetchMoveLine(resPartner);
+            }).then(function (moveLine){
+                self.moveLine = moveLine;
+                return self.fetchResCompany();
+            }).then(function (resCompany){
+                self.resCompany = resCompany;
+                return self.fetchReduceMoveLine();
             });
-            return false;
         },
         // Partner
-        fecthPartner(){
+        fetchPartner: function () {
             var self = this;
             var defer = $.Deferred();
             var fields =['id', 'name', 'unreconciled_aml_ids', 'credit'];
             var domain =[['active', '=', true], ['credit', '>', 0]];
             var resPartner = new model.web.Model('res.partner');
-            resPartner.query(fields).filter(domain).all().then(function(results){
+
+            resPartner.query(fields).filter(domain).all().then(function (results){
                 defer.resolve(results);
             });
-             return defer;
+
+            return defer;
         },
         // Move line
-        fecthMoveLine(partner){
+        fetchMoveLine: function (partner){
             var self = this;
             var fecha = new Date();
-            var hoy = (fecha.getFullYear()+"-"+(fecha.getMonth()+1)+"-"+fecha.getDate());
+            var hoy = (fecha.getFullYear() + "-" + (fecha.getMonth() + 1) + "-" + fecha.getDate());
             var defer = $.Deferred();
-            var move_id =_.flatten( _.map(partner, function(map){return map.unreconciled_aml_ids}));
+            var move_id = _.flatten(_.map(partner, function (map) {
+                return map.unreconciled_aml_ids
+            }));
             var field =['id', 'partner_id', 'amount_residual', 'credit', 'debit', 'date_maturity'];
             var domain=[['credit', '<=', 0],['id', '=', move_id],['date_maturity', '<', hoy]];
             var moveLine = new model.web.Model('account.move.line');
+
             moveLine.query(field).filter(domain).all().then(function(results){
                 defer.resolve(results);
             });
             return defer;
         },
         //Comapnia
-        fecthResComapny: function(){
+        fetchResCompany: function(){
             var self = this;
             var defer = $.Deferred();
-            var fields =['id','name', 'currency_id','logo'];
+            var fields =['id','name', 'currency_id', 'logo'];
             var domain =[['id', '=', 1]];
             var resComapy = new model.web.Model('res.company');
-            resComapy.query(fields).filter(domain).all().then(function(results){
+
+            resComapy.query(fields).filter(domain).all().then(function (results){
                 defer.resolve(results);
             });
-            return defer ;
-        } ,
+
+            return defer;
+        },
         // Reduce Move line
-        fecthReduceMoveLine(){
+        fetchReduceMoveLine: function () {
             var self = this;
             var residual =0;
-            var company = _.map(self.resCompany, function(map){return map.currency_id[1]});
+            var company = _.map(self.resCompany, function (map) {
+                return map.currency_id[1]
+            });
+
             if (self.moveLine.length > 0){
-                residual = _.reduce(_.map(self.moveLine, function(map){return map.amount_residual}),function(memo, num){return memo + num});
+                residual = _.reduce(_.map(self.moveLine, function (map) {
+                    return map.amount_residual;
+                }), function (memo, num) {
+                    return memo + num;
+                });
             }
 
-            self.$el.find('.grid-stack-item-content dashboard').unblock()
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content').find('a').text(accounting.formatNumber(residual,2, ".", ","));
             self.$el.find('.widget-footer').find('span').text("Monto en "+company);
-        },
+            self.$el.find('.grid-stack-item-content dashboard').unblock();
+        }
     });
 }

+ 39 - 21
static/src/js/widgets/expired_account_counters_now.js

@@ -1,6 +1,8 @@
 function expired_account_counters_now (widget) {
     "use strict";
+
     var model= openerp;
+    
     widget.ExpiredAccountCountersNowWidget = widget.Base.extend({
         template: 'ExpiredAccountCountersNow',
         // data : [],
@@ -16,78 +18,94 @@ function expired_account_counters_now (widget) {
         },
         start: function () {
             var self = this;
-            self.fecthInitial();
+            self.fetchInitial();
         },
-        fecthInitial:function(){
+        fetchInitial: function () {
             var self = this;
-            self.$el.find('#morosidad').block({ message: null, overlayCSS: { backgroundColor: '#FAFAFA' }});
+
+            self.$el.find('#morosidad').block({
+                message: null,
+                overlayCSS: {
+                    backgroundColor: '#FAFAFA'
+                }
+            });
             self.$el.find('.widget-content.widget-loading').css('display','flex');
 
-            self.fecthPartner().then(function(resPartner){
+            self.fetchPartner().then(function(resPartner){
                 return resPartner;
             }).then(function(resPartner){
                 self.resPartner = resPartner;
-                return self.fecthMoveLine(resPartner);
+                return self.fetchMoveLine(resPartner);
             }).then(function(moveLine){
                 self.moveLine= moveLine;
-                return self.fecthResComapny();
+                return self.fetchResCompany();
             }).then(function(resCompany){
                 self.resCompany=resCompany;
-                return self.fecthReduceMoveLine();
+                return self.fetchReduceMoveLine();
             });
+
             return false;
         },
         // Partner
-        fecthPartner(){
+        fetchPartner: function () {
             var self = this;
             var defer = $.Deferred();
             var fields =['id', 'name', 'unreconciled_aml_ids', 'credit'];
             var domain =[['active', '=', true], ['credit', '>', 0]];
             var resPartner = new model.web.Model('res.partner');
-            resPartner.query(fields).filter(domain).all().then(function(results){
+
+            resPartner.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
-             return defer;
+
+            return defer;
         },
         // Move line
-        fecthMoveLine(partner){
+        fetchMoveLine: function (partner) {
             var self = this;
             var fecha = new Date();
-            var hoy = (fecha.getFullYear()+"-"+(fecha.getMonth()+1)+"-"+fecha.getDate());
+            var hoy = (fecha.getFullYear() + "-" + (fecha.getMonth() + 1) + "-" + fecha.getDate());
             var defer = $.Deferred();
-            var move_id =_.flatten( _.map(partner, function(map){return map.unreconciled_aml_ids}));
-            var field =['id', 'partner_id', 'amount_residual', 'credit', 'debit', 'date_maturity'];
-            var domain=[['credit', '<=', 0],['id', '=', move_id],['date_maturity', '=', hoy]];
+            var move_id = _.flatten(_.map(partner, function (map) {
+                return map.unreconciled_aml_ids
+            }));
+            var field = ['id', 'partner_id', 'amount_residual', 'credit', 'debit', 'date_maturity'];
+            var domain = [['credit', '<=', 0], ['id', '=', move_id], ['date_maturity', '=', hoy]];
             var moveLine = new model.web.Model('account.move.line');
-            moveLine.query(field).filter(domain).all().then(function(results){
+
+            moveLine.query(field).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
+
             return defer;
         },
         //Comapnia
-        fecthResComapny: function(){
+        fetchResCompany: function () {
             var self = this;
             var defer = $.Deferred();
             var fields =['id','name', 'currency_id','logo'];
             var domain =[['id', '=', 1]];
             var resComapy = new model.web.Model('res.company');
-            resComapy.query(fields).filter(domain).all().then(function(results){
+
+            resComapy.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
             return defer ;
         } ,
         // Reduce Move line
-        fecthReduceMoveLine(){
+        fetchReduceMoveLine: function () {
             var self = this;
             var residual =0;
             var company = _.map(self.resCompany, function(map){return map.currency_id[1]});
+
             if (self.moveLine.length > 0){
                 residual = _.reduce(_.map(self.moveLine, function(map){return map.amount_residual}),function(memo, num){return memo + num});
             }
-            self.$el.find('#morosidad').unblock()
+
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content').find('a').text(accounting.formatNumber(residual,2, ".", ","));
-            self.$el.find('.widget-footer').find('span').text("Monto en "+company);
+            self.$el.find('.widget-footer').find('span').text("Monto en " + company);
+            self.$el.find('#morosidad').unblock()
         },
     });
 }

+ 27 - 18
static/src/js/widgets/invoice_today_counters.js

@@ -1,9 +1,10 @@
 function invoice_today_counters (widget) {
     "use strict";
+
     var model= openerp;
+
     widget.InvoiceTodayCountersWidget = widget.Base.extend({
         template: 'InvoiceTodayCounters',
-
         init: function (parent) {
             this._super(parent, {
                 width : 3,
@@ -12,44 +13,52 @@ function invoice_today_counters (widget) {
         },
         start: function () {
             var self = this;
-            self.fecthInitial();
+            self.fetchInitial();
         },
-        fecthInitial:function(){
+        fetchInitial: function(){
             var self = this;
-            self.$el.find('#morosidad').block({ message: null, overlayCSS: { backgroundColor: '#FAFAFA' }});
+            self.$el.find('#morosidad').block({
+                message: null,
+                overlayCSS: {
+                    backgroundColor: '#FAFAFA'
+                }
+            });
             self.$el.find('.widget-content.widget-loading').css('display','flex');
-            self.fecthAccountInvoice().then(function(accountInvoice){
+            self.fetchAccountInvoice().then(function (accountInvoice) {
                 return accountInvoice;
-            }).then(function(accountInvoice){
-                return self.fecthReduceInvoice(accountInvoice);
+            }).then(function (accountInvoice) {
+                return self.fetchReduceInvoice(accountInvoice);
             });
-            return false;
         },
         // Invoice
-        fecthAccountInvoice: function(){
+        fetchAccountInvoice: function() {
             var self = this;
             var defer = $.Deferred();
             var fecha = new Date();
-            var hoy = fecha.getFullYear()+"-"+(fecha.getMonth()+1)+"-"+fecha.getDate();
+            var hoy = fecha.getFullYear() + "-" + (fecha.getMonth() +1 ) + "-" + fecha.getDate();
             var fields = ['id', 'residual'];
-            var domain = [['type', '=', 'out_invoice'],['state', '=', ['open','paid']],['date_invoice', '=', hoy]];
+            var domain = [['type', '=', 'out_invoice'], ['state', '=', ['open','paid']], ['date_invoice', '=', hoy]];
             var accountInvoice = new model.web.Model('account.invoice');
-            accountInvoice.query(fields).filter(domain).all().then(function(results){
+
+            accountInvoice.query(fields).filter(domain).all().then(function (results){
                 defer.resolve(results);
             });
+
             return defer;
         },
-        fecthReduceInvoice(accountInvoice){
+        fetchReduceInvoice: function (accountInvoice) {
             var self = this;
-            var fecha= new Date();
-            var cat =0;
+            var fecha = new Date();
+            var cat = 0;
+
             if (accountInvoice.length > 0){
-                cat=accountInvoice.length;
+                cat = accountInvoice.length;
             }
-            self.$el.find('#morosidad').unblock()
+
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content').find('a').text(accounting.formatNumber(cat, ".", ","));
-            self.$el.find('.widget-footer').find('span').text("Facturas Creadas en "+fecha.getDate()+"/"+(fecha.getMonth()+1)+"/"+fecha.getFullYear());
+            self.$el.find('.widget-footer').find('span').text("Facturas Creadas en "+ fecha.getDate() + "/" + (fecha.getMonth() + 1) + "/" + fecha.getFullYear());
+            self.$el.find('#morosidad').unblock();
         },
     });
 }

+ 80 - 56
static/src/js/widgets/ranking_sales_product.js

@@ -2,13 +2,13 @@ function ranking_sales_product (widget) {
     "use strict";
 
     var model= openerp;
+
     widget.RankingSalesProductWidget = widget.Base.extend({
         template: 'RankingSalesProductTmpl',
         data : [],
         accountInvoice : [],
         invoiceLine : [],
-        productProdcut : [],
-
+        productProduct : [],
         init: function (parent) {
             this._super(parent, {
                 width : 6,
@@ -17,116 +17,141 @@ function ranking_sales_product (widget) {
         },
         start: function () {
             var self = this;
-            self.fecthInitial();
+            self.fetchInitial();
         },
-        fecthInitial:function(){
+        fetchInitial:function(){
             var self = this;
-            self.$el.block({ message: null, overlayCSS: { backgroundColor: '#FAFAFA' }});
+            self.$el.block({
+                message: null,
+                overlayCSS: {
+                    backgroundColor: '#FAFAFA'
+                }
+            });
             self.$el.find('.widget-content.widget-loading').css('display','flex');
-            self.fecthInvoice().then(function(accountInvoice){
+            self.fecthInvoice().then(function (accountInvoice) {
                 return accountInvoice;
-            }).then(function(accountInvoice){
+            }).then(function (accountInvoice) {
                 self.accountInvoice = accountInvoice;
                 return self.fecthInvoiceLine(accountInvoice);
-            }).then(function(invoiceLine){
+            }).then(function (invoiceLine) {
                 self.invoiceLine = invoiceLine;
                 return self.fecthProductProduct(invoiceLine);
-            }).then(function(productProdcut){
-                self.productProdcut = productProdcut;
-                return self.fecthRankingProdcuto();
+            }).then(function(productProduct){
+                self.productProduct = productProduct;
+                return self.fetchProductRanking();
             });
-            return false;
         },
         // Obtener factura
-        fecthInvoice :function(){
+        fecthInvoice: function(){
             var self = this;
             var fecha = new Date
-            var desde =fecha.getFullYear()+"-"+(fecha.getMonth()+1)+"-01";
-            var hasta =fecha.getFullYear()+"-"+(fecha.getMonth()+2)+"-01";
-            var defer =$.Deferred();
-            var fields =['id','invoice_line', 'date_invoice'];
-            var domain =[['type', '=', 'out_invoice'],['date_invoice', '>=', desde],['date_invoice', '<', hasta],['state', '=',['open','paid']]];
+            var desde = fecha.getFullYear() + "-" + (fecha.getMonth() + 1) + "-01";
+            var hasta = fecha.getFullYear() + "-" + (fecha.getMonth() +2 ) + "-01";
+            var defer = $.Deferred();
+            var fields = ['id', 'invoice_line', 'date_invoice'];
+            var domain = [['type', '=', 'out_invoice'], ['date_invoice', '>=', desde], ['date_invoice', '<', hasta], ['state', '=', ['open','paid']]];
             // date_invoice
             var invoice = new model.web.Model('account.invoice');
-            invoice.query(fields).filter(domain).all().then(function(results){
+
+            invoice.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
+
             return defer;
         },
         // Obtener linea de la factura
-        fecthInvoiceLine : function(accountInvoice){
+        fecthInvoiceLine: function(accountInvoice){
             var self = this;
-            var defer =$.Deferred();
-            var invoice_line =_.flatten(_.map(accountInvoice, function(item){return item.invoice_line}));
-            var fields =['id', 'product_id','quantity'];
+            var defer = $.Deferred();
+            var invoice_line = _.flatten(_.map(accountInvoice, function (item) {
+                return item.invoice_line
+            }));
+            var fields =['id', 'product_id', 'quantity'];
             var domain = [['id','=', invoice_line]];
             var invoiceLine = new model.web.Model('account.invoice.line');
-            invoiceLine.query(fields).filter(domain).all().then(function(results){
+
+            invoiceLine.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
+
             return defer;
         },
         // Obtener Prodcutos
-        fecthProductProduct : function(invoiceLine){
+        fecthProductProduct: function (invoiceLine) {
             var self = this;
-            var defer =$.Deferred();
-            var prodcut_id = _.flatten(_.map(invoiceLine,function(item){return item.product_id[0]}));
+            var defer = $.Deferred();
+            var product_id = _.flatten(_.map(invoiceLine,function (item) {
+                return item.product_id[0]
+            }));
             var fields = ['id', 'name_template', 'type'];
-            var domain =[['id', '=', prodcut_id]];
-            var prodcut= new model.web.Model('product.product');
-            prodcut.query(fields).filter(domain).all().then(function(results){
+            var domain =[['id', '=', product_id]];
+            var product= new model.web.Model('product.product');
+
+            product.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
+
             return defer;
         },
-
-        fecthRankingProdcuto : function(){
+        fetchProductRanking: function(){
             var self = this;
             var itemProduct;
             var itemLine;
-            var ranking=[];
-            var cat=0;
+            var ranking = [];
+            var cat = 0;
             var lineUnik;
-            for (var i = 0; i < self.productProdcut.length; i++) {
-                itemProduct = self.productProdcut[i];
+            for (var i = 0; i < self.productProduct.length; i++) {
+                itemProduct = self.productProduct[i];
                 itemLine= self.getInvoiceLine(itemProduct.id);
+
                 if (itemProduct.type == 'product'){
                     if (itemLine.length > 0){
-                        cat = _.reduce(_.map(itemLine,function(map){return map.quantity}),function(meno,num){return meno + num},0);
-                        lineUnik=itemLine.shift();
-                        ranking.push({  product :lineUnik.product_id[1],qty:cat });
+                        cat = _.reduce(_.map(itemLine, function (map) {
+                            return map.quantity
+                        }), function (meno,num) {
+                            return meno + num
+                        }, 0);
+                        lineUnik = itemLine.shift();
+                        ranking.push({
+                            product: lineUnik.product_id[1],
+                            qty: cat
+                        });
                     }
                 }
             }
-            ranking.sort(function(a,b){return b.qty - a.qty});
-            self.$el.unblock()
+            ranking.sort(function (a, b) {
+                return b.qty - a.qty
+            });
+
             self.$el.find('.widget-content.widget-loading').css('display','none');
             var fecha = new Date();
-            var meses = new Array ("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
-            self.$el.find('.widget-title').find('span').text("Ranking de Producto mas Vendido Mes de "+meses[fecha.getMonth()]);
-
-            self.fecthChart(ranking);
+            var meses = new Array ("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
+            self.$el.find('.widget-title').find('span').text("Ranking de Producto mas Vendido Mes de " + meses[fecha.getMonth()]);
+            self.fetchChart(ranking);
+            self.$el.unblock()
         },
         // get line
-        getInvoiceLine(product_id){
+        getInvoiceLine: function (product_id){
             var self = this;
-            return _.flatten(_.filter(self.invoiceLine,function(line){return  line.product_id[0] === product_id}));
+            return _.flatten(_.filter(self.invoiceLine,function (line) {
+                return line.product_id[0] === product_id
+            }));
         },
         // Generar Grafico
-        fecthChart: function(ranking){
+        fetchChart: function (ranking){
             var self = this;
-            var label=[];
-            var body=[];
+            var label = [];
+            var body = [];
             var item;
-            var rank=10;
+            var rank = 10;
 
             for (var i = 0; i < rank; i++) {
                 if (ranking[i]){
                     item = ranking[i];
-                }else{
-                    item={};
-                    item.product="N/A";
-                    item.qty=0;
+                } else {
+                    item = {};
+                    item.product = "N/A";
+                    item.qty = 0;
                 }
                 label.push(item.product);
                 body.push(item.qty);
@@ -157,7 +182,6 @@ function ranking_sales_product (widget) {
                         display: false,
                     },
                 }
-
             });
         }
     });

+ 61 - 40
static/src/js/widgets/voucher_today_counters.js

@@ -1,12 +1,13 @@
 function voucher_today_counters (widget) {
     "use strict";
+
     var model= openerp;
+
     widget.VoucherTodayCountersWidget = widget.Base.extend({
         template: 'VoucherTodayCounters',
-        accountVoucher : [],
-        resCompany : [],
-        currecyRate :[],
-
+        accountVoucher: [],
+        resCompany: [],
+        currencyRate: [],
         init: function (parent) {
             this._super(parent, {
                 width : 3,
@@ -15,69 +16,80 @@ function voucher_today_counters (widget) {
         },
         start: function () {
             var self = this;
-            self.fecthInitial();
+            self.fetchInitial();
         },
-        fecthInitial:function(){
+        fetchInitial: function () {
             var self = this;
-            self.$el.find('#morosidad').block({ message: null, overlayCSS: { backgroundColor: '#FAFAFA' }});
+            self.$el.find('#morosidad').block({
+                message: null,
+                overlayCSS: {
+                    backgroundColor: '#FAFAFA'
+                }
+            });
             self.$el.find('.widget-content.widget-loading').css('display','flex');
-            self.fecthAccountVoucher().then(function(accountVoucher){
+            self.fetchAccountVoucher().then(function (accountVoucher) {
                 return accountVoucher;
-            }).then(function(accountVoucher){
+            }).then(function (accountVoucher) {
                 self.accountVoucher = accountVoucher;
-                return self.fecthResComapny();
-            }).then(function(resCompany){
-                self.resCompany= resCompany;
-                return self.fetchCurency();
-            }).then(function(currecyRate){
-                self.currecyRate=currecyRate;
+                return self.fetchResCompany();
+            }).then(function (resCompany) {
+                self.resCompany = resCompany;
+                return self.fetchCurrency();
+            }).then(function (currencyRate) {
+                self.currencyRate = currencyRate;
                 return self.fetchVoucherCurrency();
             });
-            return false;
         },
         // Account Voucher
-        fecthAccountVoucher: function(){
+        fetchAccountVoucher: function () {
             var self = this;
             var defer = $.Deferred();
             var fecha = new Date();
-            var hoy = fecha.getFullYear()+"-"+(fecha.getMonth()+1)+"-"+fecha.getDate();
-            var fields = ['id', 'amount', 'currency_id','payment_rate_currency_id'];
-            var domain = [['state', '=', 'posted'], ['type', '=', 'receipt'],['date', '=', hoy]];
+            var hoy = fecha.getFullYear() + "-" + (fecha.getMonth() + 1) + "-" + fecha.getDate();
+            var fields = ['id', 'amount', 'currency_id', 'payment_rate_currency_id'];
+            var domain = [['state', '=', 'posted'], ['type', '=', 'receipt'], ['date', '=', hoy]];
             var accountVoucher = new model.web.Model('account.voucher');
-            accountVoucher.query(fields).filter(domain).all().then(function(results){
+
+            accountVoucher.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
+
             return defer;
         },
         //Comapnia
-        fecthResComapny: function(){
+        fetchResCompany: function () {
             var self = this;
             var defer = $.Deferred();
             var fields =['id','name', 'currency_id','logo'];
             var domain =[['id', '=', 1]];
-            var resComapy = new model.web.Model('res.company');
-            resComapy.query(fields).filter(domain).all().then(function(results){
+            var resCompany = new model.web.Model('res.company');
+
+            resCompany.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
-            return defer ;
-        } ,
+
+            return defer;
+        },
         // Buscar Cambio de Monedas USD,PYG,ARG,BRL
-        fetchCurency: function () {
+        fetchCurrency: function () {
             var defer = $.Deferred();
             var currency_Rate = new model.web.Model('res.currency.rate');
             var fields = ['id', 'name', 'currency_id', 'rate', 'create_date'];
             var domain = [['currency_id', '=', [166 , 20, 7, 3]]];
+
             currency_Rate.query(fields).filter(domain).all().then(function (results) {
-              defer.resolve(results);
+                defer.resolve(results);
             });
+
             return defer;
-          },
+        },
         //   voucherCurrencyRate
-        fetchVoucherCurrency : function(){
+        fetchVoucherCurrency: function () {
             var self = this;
             var newVoucher=[];
             var itemvoucher;
             var itemCurrencyRate;
+
             for (var i = 0; i < self.accountVoucher.length; i++) {
                 itemvoucher = self.accountVoucher[i];
                 itemCurrencyRate = self.getCutrrencyRate(itemvoucher.payment_rate_currency_id[0]);
@@ -89,24 +101,33 @@ function voucher_today_counters (widget) {
                                     amount_rate : (itemvoucher.amount/itemCurrencyRate.rate)
                                 });
             }
-            self.fecthReduceMoveLine(newVoucher)
+            self.fetchReduceMoveLine(newVoucher)
         },
-        getCutrrencyRate:function(currency_id){
+        getCutrrencyRate: function (currency_id) {
             var self = this;
-             return _.filter(self.currecyRate,function(item){return item.currency_id[0]== currency_id}).shift();
+            return _.filter(self.currencyRate,function (item) {
+                return item.currency_id[0] == currency_id
+            }).shift();
         },
         // // Reduce Move line
-        fecthReduceMoveLine(newVoucher){
+        fetchReduceMoveLine: function (newVoucher) {
             var self = this;
             var residual =0;
-            var company = _.map(self.resCompany, function(map){return map.currency_id[1]});
-            if (newVoucher.length > 0){
-                residual = _.reduce(_.map(newVoucher, function(map){return map.amount_rate}),function(memo, num){return memo + num});
+            var company = _.map(self.resCompany, function (map) {
+                return map.currency_id[1];
+            });
+            if (newVoucher.length > 0) {
+                residual = _.reduce(_.map(newVoucher, function (map) {
+                    return map.amount_rate;
+                }), function (memo, num) {
+                    return memo + num;
+                });
             }
-            self.$el.find('#morosidad').unblock()
+
             self.$el.find('.widget-content.widget-loading').css('display','none');
-            self.$el.find('.widget-content').find('a').text(accounting.formatNumber(residual,2, ".", ","));
-            self.$el.find('.widget-footer').find('span').text("Monto en "+company);
+            self.$el.find('.widget-content').find('a').text(accounting.formatNumber(residual, 2, ".", ","));
+            self.$el.find('.widget-footer').find('span').text("Monto en "+ company);
+            self.$el.find('#morosidad').unblock();
         },
     });
 }

+ 2 - 2
static/src/xml/widgets/expired_account_counters.xml

@@ -5,10 +5,10 @@
         <div>
             <div class="grid-stack-item-content dashboard">
                 <h2 class="widget-title">
-                    <i class="fa fa-money" aria-hidden="true"> </i>
+                    <i class="fa fa-money" aria-hidden="true"></i>
                     Deudas  Atrasadas
                 </h2>
-                <div  class="widget-content">
+                <div class="widget-content">
                     <a></a>
                 </div>
                 <div class="widget-footer">

+ 1 - 1
static/src/xml/widgets/invoice_today_counters.xml

@@ -8,7 +8,7 @@
                     <i class="fa fa-files-o" aria-hidden="true"></i>
                     Facturas Realizada Hoy
                 </h2>
-                <div  class="widget-content">
+                <div class="widget-content">
                     <a></a>
                 </div>
                 <div class="widget-footer">

+ 2 - 2
static/src/xml/widgets/ranking_sales_product.xml

@@ -5,9 +5,9 @@
         <t t-call="WidgetBaseTmpl">
             <h2  class="widget-title">
                 <i class="fa fa-bar-chart" aria-hidden="true"></i>
-                <span>Ranking de Producto mas Vendido</span>
+                <span>Ranking de Productos más Vendidos</span>
             </h2>
-            <div  class="widget-content">
+            <div class="widget-content">
                 <canvas></canvas>
             </div>
             <div class="widget-content widget-loading">

+ 1 - 1
static/src/xml/widgets/voucher_today_counters.xml

@@ -8,7 +8,7 @@
                     <i class="fa fa-money" aria-hidden="true"> </i>
                     Cobros de hoy
                 </h2>
-                <div  class="widget-content">
+                <div class="widget-content">
                     <a></a>
                 </div>
                 <div class="widget-footer">