Browse Source

[FIX] limitado la cantidad de registros

Rodney Elpidio Enciso Arias 6 năm trước cách đây
mục cha
commit
2fa5b04a80

BIN
static/img/handshake.png


BIN
static/img/user.png


+ 2 - 1
static/src/js/charts/chart_ingreso_egreso.js

@@ -79,8 +79,9 @@ function chart_ingreso_egreso (widget) {
             var journal_ids = _.flatten(_.map(self.AccountJournal, function (item) {
                 return item.id;
             }));
+            var date = moment().format('YYYY-01-01');
             var fields = ['id','date','amount','journal_id'];
-            var domain = [['journal_id','in',journal_ids]];
+            var domain = [['journal_id','in',journal_ids],['date','>=',date]];
             var AccountBankStatementLine = new model.web.Model('account.bank.statement.line');
             AccountBankStatementLine.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);

+ 1 - 1
static/src/js/charts/chart_ranking_customer.js

@@ -116,7 +116,7 @@ function chart_ranking_customer (widget) {
                 var journal_ids = _.flatten(_.map(self.AccountJournal, function (item) {
                     return item.id;
                 }));
-                var date = moment().add(-1, 'month').format('YYYY-MM-23 00:00:00');
+                var date = moment().format('YYYY-MM-01 00:00:00');
                 var fields = ['id','date_order','partner_id','amount_total'];
                 var domain = [['state', 'in', ['paid','done','invoiced']], ['partner_id', '!=', false],['date_order', '>=', date],['sale_journal','in',journal_ids]];
                 var PosOrder = new model.web.Model('pos.order');

+ 2 - 3
static/src/js/widgets/widget_balance.js

@@ -120,7 +120,7 @@ function widget_balance(widget) {
             var journal_ids = _.flatten(_.map(this.AccountJournal, function (item) {
                 return item.id;
             }));
-            var date = moment().add(-1, 'month').format('YYYY-MM-23 HH:mm:ss');
+            var date = moment().format('YYYY-MM-01');
             var fields = ['id','type','date_invoice','amount_total','currency_id','journal_id'];
             var domain = [['state', 'not in', ['draft','cancel']],['journal_id','in',journal_ids],['date_invoice','>',date]];
             var AccountInvoice = new model.web.Model('account.invoice');
@@ -138,7 +138,7 @@ function widget_balance(widget) {
                 var journal_ids = _.flatten(_.map(this.AccountJournal, function (item) {
                     return item.id;
                 }));
-                var date = moment().add(-1, 'month').format('YYYY-MM-23 HH:mm:ss');
+                var date = moment().format('YYYY-MM-01 00:00:00');
                 var fields = ['id', 'name', 'date_order', 'amount_total','sale_journal'];
                 var domain = [['state', 'not in', ['draft','cancel']],['sale_journal','in',journal_ids],['date_order','>',date]];
                 var PosOrder = new model.web.Model('pos.order');
@@ -161,7 +161,6 @@ function widget_balance(widget) {
             ResCompany.query(fields).filter(domain).all().then(function (results) {
                 defer.resolve(results);
             });
-
             return defer;
         },
 

+ 105 - 105
static/src/js/widgets/widget_expense.js

@@ -91,13 +91,13 @@ function widget_expense(widget) {
             var journal_ids = _.flatten(_.map(this.AccountJournal, function (item) {
                 return item.id;
             }));
+            var date = moment().format('YYYY-MM-01');
             var fields = ['id', 'name', 'date_invoice', 'amount_total','currency_id'];
-            var domain = [['state', 'not in', ['draft','cancel']],['origin','=',false],['type','=','in_invoice'],['journal_id','in',journal_ids]];
+            var domain = [['state', 'not in', ['draft','cancel']],['origin','=',false],['type','=','in_invoice'],['journal_id','in',journal_ids],['date_invoice','>=',date]];
             var AccountInvoice = new model.web.Model('account.invoice');
             AccountInvoice.query(fields).filter(domain).all().then(function(results) {
                 defer.resolve(results);
             });
-
             return defer;
         },
 
@@ -179,17 +179,17 @@ function widget_expense(widget) {
             ACCOUNT INVOICE BY MONTH
         */
 
-        getMonthAccountInvoice:function(mes) {
-            var self = this;
-            if (mes < 10){
-                var fecha = moment().format('YYYY')+'-'+'0'+mes;    
-            }else{
-                var fecha = moment().format('YYYY')+'-'+mes;    
-            }
-            return _.flatten(_.filter(self.AccountInvoice,function (inv) {
-                return moment(inv.date_invoice).format('YYYY-MM') === fecha;
-            }));
-        },
+        // getMonthAccountInvoice:function(mes) {
+        //     var self = this;
+        //     if (mes < 10){
+        //         var fecha = moment().format('YYYY')+'-'+'0'+mes;    
+        //     }else{
+        //         var fecha = moment().format('YYYY')+'-'+mes;    
+        //     }
+        //     return _.flatten(_.filter(self.AccountInvoice,function (inv) {
+        //         return moment(inv.date_invoice).format('YYYY-MM') === fecha;
+        //     }));
+        // },
 
         /*
             TODAY    
@@ -294,35 +294,35 @@ function widget_expense(widget) {
             MONTH
         */
 
-        showMonth: function() {
-            var self = this;
-            var order;
-            var invoice;
-            var title = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
-            var data = [];
-            var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
-            for (var i = 1; i <= 12; i++) {
-                var array = [];
-                invoice = self.getMonthAccountInvoice(i);
-                _.each(invoice, function (item) {
-                    var currency = self.getResCurrency(item.currency_id[0]).shift();
-                    array.push({
-                        amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
-                    })
-                });
-                var invoice_total = 0;
-                if(array.length > 0){
-                    invoice_total = _.reduce(_.map(array, function (map) {
-                        return map.amount;
-                    }), function (memo, num) {
-                        return memo + num;
-                    });
-                }
-                var total = invoice_total; 
-                data.push(total);
-            }
-            self.data = data;
-        },
+        // showMonth: function() {
+        //     var self = this;
+        //     var order;
+        //     var invoice;
+        //     var title = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+        //     var data = [];
+        //     var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
+        //     for (var i = 1; i <= 12; i++) {
+        //         var array = [];
+        //         invoice = self.getMonthAccountInvoice(i);
+        //         _.each(invoice, function (item) {
+        //             var currency = self.getResCurrency(item.currency_id[0]).shift();
+        //             array.push({
+        //                 amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
+        //             })
+        //         });
+        //         var invoice_total = 0;
+        //         if(array.length > 0){
+        //             invoice_total = _.reduce(_.map(array, function (map) {
+        //                 return map.amount;
+        //             }), function (memo, num) {
+        //                 return memo + num;
+        //             });
+        //         }
+        //         var total = invoice_total; 
+        //         data.push(total);
+        //     }
+        //     self.data = data;
+        // },
 
         /* 
             MODAL
@@ -332,7 +332,7 @@ function widget_expense(widget) {
             var self = this;
             self.showThisWeek();
             self.showToday();
-            self.showMonth();
+            // self.showMonth();
             var titleData = [
                 {
                     title: "Gastos"
@@ -363,7 +363,7 @@ function widget_expense(widget) {
                 percentageTextSize: 35,
            });
 
-            self.fetchChart(self.data);
+            // self.fetchChart(self.data);
         },
 
         removeModal: function (e) {
@@ -375,66 +375,66 @@ function widget_expense(widget) {
             BUILD A CHART
         */
 
-        fetchChart: function (data) {
-            var self = this;
-            var label = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
-            var body = data;
-
-            Chart.scaleService.updateScaleDefaults('linear', {
-              ticks: {
-                callback: function(tick) {
-                    return tick.toLocaleString('de-DE');
-                }
-              }
-            });
-            Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
-                var dataset = data.datasets[tooltipItem.datasetIndex];
-                var datasetLabel = dataset.label || '';
-                return datasetLabel +  dataset.data[tooltipItem.index].toLocaleString('de-DE');
-            };
-
-            var chart = new Chart($("#prueba"), {
-                type: 'line',
-                data: {
-                    labels: label,
-                    datasets: [
-                        {
-                            label: false,
-                            data: body,
-                            backgroundColor: '#ef6c00',
-                            borderColor: '#ef6c00',
-                            borderWidth: 2,
-                            fill: false,
-                        }
-                    ]
-                },
-                options: {
-                    responsive: true,
-                    title: {
-                        display: false,
-                    },
-                    hover: {
-                        mode: 'nearest',
-                        intersect: true
-                    },
-                    legend: {
-                       display: false,
-                    },
-                    layout: {
-                        padding: {
-                            top: 45,
-                            bottom: 40,
-                            left : 10,
-                            rigth: 10,
-                        }
-                    },
-                    elements: {
-                        line: {
-                            tension: 0.000001
-                        }
-                    },
-                }
-            });
-        },
+        // fetchChart: function (data) {
+        //     var self = this;
+        //     var label = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+        //     var body = data;
+
+        //     Chart.scaleService.updateScaleDefaults('linear', {
+        //       ticks: {
+        //         callback: function(tick) {
+        //             return tick.toLocaleString('de-DE');
+        //         }
+        //       }
+        //     });
+        //     Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
+        //         var dataset = data.datasets[tooltipItem.datasetIndex];
+        //         var datasetLabel = dataset.label || '';
+        //         return datasetLabel +  dataset.data[tooltipItem.index].toLocaleString('de-DE');
+        //     };
+
+        //     var chart = new Chart($("#prueba"), {
+        //         type: 'line',
+        //         data: {
+        //             labels: label,
+        //             datasets: [
+        //                 {
+        //                     label: false,
+        //                     data: body,
+        //                     backgroundColor: '#ef6c00',
+        //                     borderColor: '#ef6c00',
+        //                     borderWidth: 2,
+        //                     fill: false,
+        //                 }
+        //             ]
+        //         },
+        //         options: {
+        //             responsive: true,
+        //             title: {
+        //                 display: false,
+        //             },
+        //             hover: {
+        //                 mode: 'nearest',
+        //                 intersect: true
+        //             },
+        //             legend: {
+        //                display: false,
+        //             },
+        //             layout: {
+        //                 padding: {
+        //                     top: 45,
+        //                     bottom: 40,
+        //                     left : 10,
+        //                     rigth: 10,
+        //                 }
+        //             },
+        //             elements: {
+        //                 line: {
+        //                     tension: 0.000001
+        //                 }
+        //             },
+        //         }
+        //     });
+        // },
     });
 }

+ 105 - 104
static/src/js/widgets/widget_purchase.js

@@ -102,8 +102,9 @@ function widget_purchase(widget) {
             var journal_ids = _.flatten(_.map(this.AccountJournal, function (item) {
                 return item.id;
             }));
+            var date = moment().format('YYYY-MM-01');
             var fields = ['id', 'name', 'date_invoice', 'amount_total','currency_id'];
-            var domain = [['state', 'not in', ['draft','cancel']],['origin','like','PO'],['type','=','in_invoice'],['journal_id','in',journal_ids]];
+            var domain = [['state', 'not in', ['draft','cancel']],['origin','like','PO'],['type','=','in_invoice'],['journal_id','in',journal_ids],['date_invoice','>=',date]];
             var AccountInvoice = new model.web.Model('account.invoice');
             AccountInvoice.query(fields).filter(domain).all().then(function(results) {
                 defer.resolve(results);
@@ -188,17 +189,17 @@ function widget_purchase(widget) {
             ACCOUNT INVOICE BY MONTH
         */
 
-        getMonthAccountInvoice:function(mes) {
-            var self = this;
-            if (mes < 10){
-                var fecha = moment().format('YYYY')+'-'+'0'+mes;    
-            }else{
-                var fecha = moment().format('YYYY')+'-'+mes;    
-            }
-            return _.flatten(_.filter(self.AccountInvoice,function (inv) {
-                return moment(inv.date_invoice).format('YYYY-MM') === fecha;
-            }));
-        },
+        // getMonthAccountInvoice:function(mes) {
+        //     var self = this;
+        //     if (mes < 10){
+        //         var fecha = moment().format('YYYY')+'-'+'0'+mes;    
+        //     }else{
+        //         var fecha = moment().format('YYYY')+'-'+mes;    
+        //     }
+        //     return _.flatten(_.filter(self.AccountInvoice,function (inv) {
+        //         return moment(inv.date_invoice).format('YYYY-MM') === fecha;
+        //     }));
+        // },
 
         /*
             TODAY
@@ -299,35 +300,35 @@ function widget_purchase(widget) {
             self.$el.find('.widget-content').find('a').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
         },
 
-        showMonth: function() {
-            var self = this;
-            var order;
-            var invoice;
-            var title = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
-            var data = [];
-            var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
-            for (var i = 1; i <= 12; i++) {
-                var array = [];
-                invoice = self.getMonthAccountInvoice(i);
-                _.each(invoice, function (item) {
-                    var currency = self.getResCurrency(item.currency_id[0]).shift();
-                    array.push({
-                        amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
-                    })
-                });
-                var invoice_total = 0;
-                if(array.length > 0){
-                    invoice_total = _.reduce(_.map(array, function (map) {
-                        return map.amount;
-                    }), function (memo, num) {
-                        return memo + num;
-                    });
-                }
-                var total = invoice_total; 
-                data.push(total);
-            }
-            self.data = data;
-        },
+        // showMonth: function() {
+        //     var self = this;
+        //     var order;
+        //     var invoice;
+        //     var title = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+        //     var data = [];
+        //     var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
+        //     for (var i = 1; i <= 12; i++) {
+        //         var array = [];
+        //         invoice = self.getMonthAccountInvoice(i);
+        //         _.each(invoice, function (item) {
+        //             var currency = self.getResCurrency(item.currency_id[0]).shift();
+        //             array.push({
+        //                 amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
+        //             })
+        //         });
+        //         var invoice_total = 0;
+        //         if(array.length > 0){
+        //             invoice_total = _.reduce(_.map(array, function (map) {
+        //                 return map.amount;
+        //             }), function (memo, num) {
+        //                 return memo + num;
+        //             });
+        //         }
+        //         var total = invoice_total; 
+        //         data.push(total);
+        //     }
+        //     self.data = data;
+        // },
 
         /*
             MODAL
@@ -337,7 +338,7 @@ function widget_purchase(widget) {
             var self = this;
             self.showThisWeek();
             self.showToday();
-            self.showMonth();
+            // self.showMonth();
             var titleData = [
                 {
                     title: "Compras"
@@ -368,7 +369,7 @@ function widget_purchase(widget) {
                 percentageTextSize: 35,
             });
 
-            self.fetchChart(self.data);
+            // self.fetchChart(self.data);
         },
 
         removeModal: function (e) {
@@ -380,67 +381,67 @@ function widget_purchase(widget) {
             BUILD A CHART
         */
 
-        fetchChart: function (data) {
-            var self = this;
-            var label = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
-            var body = data;
-
-            Chart.scaleService.updateScaleDefaults('linear', {
-              ticks: {
-                callback: function(tick) {
-                    return tick.toLocaleString('de-DE');
-                }
-              }
-            });
-            Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
-                var dataset = data.datasets[tooltipItem.datasetIndex];
-                var datasetLabel = dataset.label || '';
-                return datasetLabel +  dataset.data[tooltipItem.index].toLocaleString('de-DE');
-            };
-
-            var chart = new Chart($("#prueba"), {
-                type: 'line',
-                data: {
-                    labels: label,
-                    datasets: [
-                        {
-                            label: false,
-                            data: body,
-                            backgroundColor: '#f9a825',
-                            borderColor: '#f9a825',
-                            borderWidth: 2,
-                            fill: false,
-                        }
-                    ]
-                },
-                options: {
-                    responsive: true,
-                    title: {
-                        display: false,
-                    },
-                    hover: {
-                        mode: 'nearest',
-                        intersect: true
-                    },
-                    legend: {
-                       display: false,
-                    },
-                    layout: {
-                        padding: {
-                            top: 45,
-                            bottom: 40,
-                            left : 10,
-                            rigth: 10,
-                        }
-                    },
-                    elements: {
-                        line: {
-                            tension: 0.000001
-                        }
-                    },
-                }
-            });
-        },
+        // fetchChart: function (data) {
+        //     var self = this;
+        //     var label = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+        //     var body = data;
+
+        //     Chart.scaleService.updateScaleDefaults('linear', {
+        //       ticks: {
+        //         callback: function(tick) {
+        //             return tick.toLocaleString('de-DE');
+        //         }
+        //       }
+        //     });
+        //     Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
+        //         var dataset = data.datasets[tooltipItem.datasetIndex];
+        //         var datasetLabel = dataset.label || '';
+        //         return datasetLabel +  dataset.data[tooltipItem.index].toLocaleString('de-DE');
+        //     };
+
+        //     var chart = new Chart($("#prueba"), {
+        //         type: 'line',
+        //         data: {
+        //             labels: label,
+        //             datasets: [
+        //                 {
+        //                     label: false,
+        //                     data: body,
+        //                     backgroundColor: '#f9a825',
+        //                     borderColor: '#f9a825',
+        //                     borderWidth: 2,
+        //                     fill: false,
+        //                 }
+        //             ]
+        //         },
+        //         options: {
+        //             responsive: true,
+        //             title: {
+        //                 display: false,
+        //             },
+        //             hover: {
+        //                 mode: 'nearest',
+        //                 intersect: true
+        //             },
+        //             legend: {
+        //                display: false,
+        //             },
+        //             layout: {
+        //                 padding: {
+        //                     top: 45,
+        //                     bottom: 40,
+        //                     left : 10,
+        //                     rigth: 10,
+        //                 }
+        //             },
+        //             elements: {
+        //                 line: {
+        //                     tension: 0.000001
+        //                 }
+        //             },
+        //         }
+        //     });
+        // },
 
     });
 }

+ 160 - 159
static/src/js/widgets/widget_sale.js

@@ -121,7 +121,7 @@ function widget_sale(widget) {
                 var journal_ids = _.flatten(_.map(self.AccountJournal, function (item) {
                 return item.id;
                 }));
-                var date = moment().format('YYYY-01-01 00:00:00');
+                var date = moment().format('YYYY-MM-01 00:00:00');
                 var fields = ['id', 'name', 'date_order', 'amount_total','sale_journal'];
                 var domain = [['sale_journal','in',journal_ids],['state', 'not in', ['draft','cancel']],['date_order','>=',date]];
                 var PosOrder = new model.web.Model('pos.order');
@@ -141,7 +141,7 @@ function widget_sale(widget) {
             var journal_ids = _.flatten(_.map(this.AccountJournal, function (item) {
                 return item.id;
             }));
-            var date = moment().format('YYYY-01-01');
+            var date = moment().format('YYYY-MM-01');
             var fields = ['id','name','amount_total','date_invoice','currency_id','journal_id'];
             var domain = [['state', 'not in', ['draft','cancel']],['type','in',['out_invoice','out_refund']],['journal_id','in',journal_ids],['date_invoice','>=',date]];
             var AccountInvoice = new model.web.Model('account.invoice');
@@ -232,18 +232,18 @@ function widget_sale(widget) {
             POS ORDER BY MONTH
         ======================*/
 
-        getMonthPosOrder:function(mes) {
-            var self = this;
-            if (mes < 10){
-                var fecha = moment().format('YYYY')+'-'+'0'+mes;    
-            }else{
-                var fecha = moment().format('YYYY')+'-'+mes;    
-            }
-            return _.flatten(_.filter(self.PosOrder,function (inv) {
-                var utc = moment.utc(inv.date_order,'YYYY-MM-DD h:mm:ss A');
-                return moment(utc._d).format('YYYY-MM') === fecha;
-            }));
-        },
+        // getMonthPosOrder:function(mes) {
+        //     var self = this;
+        //     if (mes < 10){
+        //         var fecha = moment().format('YYYY')+'-'+'0'+mes;    
+        //     }else{
+        //         var fecha = moment().format('YYYY')+'-'+mes;    
+        //     }
+        //     return _.flatten(_.filter(self.PosOrder,function (inv) {
+        //         var utc = moment.utc(inv.date_order,'YYYY-MM-DD h:mm:ss A');
+        //         return moment(utc._d).format('YYYY-MM') === fecha;
+        //     }));
+        // },
 
         /*===================
             ACCOUNT INVOICE
@@ -300,26 +300,26 @@ function widget_sale(widget) {
             ACCOUNT INVOICE BY MONTH
         ============================*/
 
-        getMonthAccountInvoice:function(mes, type) {
-            var self = this;
+        // getMonthAccountInvoice:function(mes, type) {
+        //     var self = this;
             
-            if (mes < 10){
-                var fecha = moment().format('YYYY')+'-'+'0'+mes;    
-            }else{
-                var fecha = moment().format('YYYY')+'-'+mes;    
-            }
-            var journals  = _.filter(self.AccountJournal,function (inv) {
-                return inv.type == type;
-            });
-            if(journals.length > 0){
-                var journal_ids = _.flatten(_.map(journals, function (item) {
-                    return item.id;
-                }));
-                return _.flatten(_.filter(self.AccountInvoice,function (inv) {
-                    return moment(inv.date_invoice).format('YYYY-MM') === fecha & _.contains(journal_ids, inv.journal_id[0]);
-                }));
-            }
-        },
+        //     if (mes < 10){
+        //         var fecha = moment().format('YYYY')+'-'+'0'+mes;    
+        //     }else{
+        //         var fecha = moment().format('YYYY')+'-'+mes;    
+        //     }
+        //     var journals  = _.filter(self.AccountJournal,function (inv) {
+        //         return inv.type == type;
+        //     });
+        //     if(journals.length > 0){
+        //         var journal_ids = _.flatten(_.map(journals, function (item) {
+        //             return item.id;
+        //         }));
+        //         return _.flatten(_.filter(self.AccountInvoice,function (inv) {
+        //             return moment(inv.date_invoice).format('YYYY-MM') === fecha & _.contains(journal_ids, inv.journal_id[0]);
+        //         }));
+        //     }
+        // },
 
         /*
             TODAY
@@ -435,6 +435,7 @@ function widget_sale(widget) {
 
         showThisMonth: function () {
             var self = this;
+            // console.log(self);
             if(self.DashboardObjetive.length > 0){
                 self.objective = self.DashboardObjetive.shift().sale_objetive;    
             }else{
@@ -510,72 +511,72 @@ function widget_sale(widget) {
             self.$el.find('.widget-content').find('a').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
         },
 
-        showMonth: function() {
-            var self = this;
-            var order;
-            var invoice;
-            var invoice_refund;
-            var title = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
-            var data = [];
-            var array = [];
-            var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
-            for (var i = 1; i <= 12; i++) {
+        // showMonth: function() {
+        //     var self = this;
+        //     var order;
+        //     var invoice;
+        //     var invoice_refund;
+        //     var title = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+        //     var data = [];
+        //     var array = [];
+        //     var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
+        //     for (var i = 1; i <= 12; i++) {
                 
-                order = self.getMonthPosOrder(i);
-                invoice = self.getMonthAccountInvoice(i, 'sale');
-                invoice_refund = self.getMonthAccountInvoice(i, 'sale_refund');
-
-                var order_total = _.reduce(_.map(order,function(item) {
-                    return item.amount_total;
-                }),function(memo, num) {
-                    return memo + num;
-                },0);
+        //         order = self.getMonthPosOrder(i);
+        //         invoice = self.getMonthAccountInvoice(i, 'sale');
+        //         invoice_refund = self.getMonthAccountInvoice(i, 'sale_refund');
+
+        //         var order_total = _.reduce(_.map(order,function(item) {
+        //             return item.amount_total;
+        //         }),function(memo, num) {
+        //             return memo + num;
+        //         },0);
                 
-                /*
-                    SALE INVOICE
-                */
+        //         /*
+        //             SALE INVOICE
+        //         */
                
-                array = [];
-                _.each(invoice, function (item) {
-                    var currency = self.getResCurrency(item.currency_id[0]).shift();
-                    array.push({
-                        amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
-                    })
-                });
-                var invoice_total = 0;
-                if(array.length > 0){
-                    invoice_total = _.reduce(_.map(array, function (map) {
-                        return map.amount;
-                    }), function (memo, num) {
-                        return memo + num;
-                    });
-                }
-
-                /* 
-                    SALE REFUND
-                */
-
-                array = [];
-                _.each(invoice_refund, function (item) {
-                    var currency = self.getResCurrency(item.currency_id[0]).shift();
-                    array.push({
-                        amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
-                    })
-                }); 
-                var invoice_total_refund = 0;
-                if(array.length > 0){
-                    invoice_total_refund = _.reduce(_.map(array, function (map) {
-                        return map.amount;
-                    }), function (memo, num) {
-                        return memo + num;
-                    });
-                }
-
-                var total = order_total + invoice_total - invoice_total_refund;
-                data.push(total);
-            }
-            self.data = data;
-        },
+        //         array = [];
+        //         _.each(invoice, function (item) {
+        //             var currency = self.getResCurrency(item.currency_id[0]).shift();
+        //             array.push({
+        //                 amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
+        //             })
+        //         });
+        //         var invoice_total = 0;
+        //         if(array.length > 0){
+        //             invoice_total = _.reduce(_.map(array, function (map) {
+        //                 return map.amount;
+        //             }), function (memo, num) {
+        //                 return memo + num;
+        //             });
+        //         }
+
+        //         /* 
+        //             SALE REFUND
+        //         */
+
+        //         array = [];
+        //         _.each(invoice_refund, function (item) {
+        //             var currency = self.getResCurrency(item.currency_id[0]).shift();
+        //             array.push({
+        //                 amount: item.amount_total * (CurrencyBase.rate_silent / currency.rate_silent),
+        //             })
+        //         }); 
+        //         var invoice_total_refund = 0;
+        //         if(array.length > 0){
+        //             invoice_total_refund = _.reduce(_.map(array, function (map) {
+        //                 return map.amount;
+        //             }), function (memo, num) {
+        //                 return memo + num;
+        //             });
+        //         }
+
+        //         var total = order_total + invoice_total - invoice_total_refund;
+        //         data.push(total);
+        //     }
+        //     self.data = data;
+        // },
 
         /*========= 
             MODAL
@@ -585,7 +586,7 @@ function widget_sale(widget) {
             var self = this;
             self.showThisWeek();
             self.showToday();
-            self.showMonth();
+            // self.showMonth();
             var titleData = [
                 {
                     title: "Ventas"
@@ -616,7 +617,7 @@ function widget_sale(widget) {
                 percentageTextSize: 35,
             });
 
-            self.fetchChart(self.data);
+            // self.fetchChart(self.data);
         },
 
         removeModal: function (e) {
@@ -628,67 +629,67 @@ function widget_sale(widget) {
             BUILD A CHART    
         */
 
-        fetchChart: function (data) {
-            var self = this;
-            var label = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
-            var body = data;
-
-            Chart.scaleService.updateScaleDefaults('linear', {
-              ticks: {
-                callback: function(tick) {
-                    return tick.toLocaleString('de-DE');
-                }
-              }
-            });
-            Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
-                var dataset = data.datasets[tooltipItem.datasetIndex];
-                var datasetLabel = dataset.label || '';
-                return datasetLabel +  dataset.data[tooltipItem.index].toLocaleString('de-DE');
-            };
-
-            var chart = new Chart($("#prueba"), {
-                type: 'line',
-                data: {
-                    labels: label,
-                    datasets: [
-                        {
-                            label: false,
-                            data: body,
-                            backgroundColor: '#e3f2fd',
-                            borderColor: '#43a047',
-                            borderWidth: 2,
-                            fill: false,
-                        }
-                    ]
-                },
-                options: {
-                    responsive: true,
-                    title: {
-                        display: false,
-                    },
-                    hover: {
-                        mode: 'nearest',
-                        intersect: true
-                    },
-                    legend: {
-                       display: false,
-                    },
-                    layout: {
-                        padding: {
-                            top: 45,
-                            bottom: 40,
-                            left : 10,
-                            rigth: 10,
-                        }
-                    },
-                    elements: {
-                        line: {
-                            tension: 0.000001
-                        }
-                    },
-                }
-            });
-        },
+        // fetchChart: function (data) {
+        //     var self = this;
+        //     var label = ['Ene', 'Feb', 'Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];
+        //     var body = data;
+
+        //     Chart.scaleService.updateScaleDefaults('linear', {
+        //       ticks: {
+        //         callback: function(tick) {
+        //             return tick.toLocaleString('de-DE');
+        //         }
+        //       }
+        //     });
+        //     Chart.defaults.global.tooltips.callbacks.label = function(tooltipItem, data) {
+        //         var dataset = data.datasets[tooltipItem.datasetIndex];
+        //         var datasetLabel = dataset.label || '';
+        //         return datasetLabel +  dataset.data[tooltipItem.index].toLocaleString('de-DE');
+        //     };
+
+        //     var chart = new Chart($("#prueba"), {
+        //         type: 'line',
+        //         data: {
+        //             labels: label,
+        //             datasets: [
+        //                 {
+        //                     label: false,
+        //                     data: body,
+        //                     backgroundColor: '#e3f2fd',
+        //                     borderColor: '#43a047',
+        //                     borderWidth: 2,
+        //                     fill: false,
+        //                 }
+        //             ]
+        //         },
+        //         options: {
+        //             responsive: true,
+        //             title: {
+        //                 display: false,
+        //             },
+        //             hover: {
+        //                 mode: 'nearest',
+        //                 intersect: true
+        //             },
+        //             legend: {
+        //                display: false,
+        //             },
+        //             layout: {
+        //                 padding: {
+        //                     top: 45,
+        //                     bottom: 40,
+        //                     left : 10,
+        //                     rigth: 10,
+        //                 }
+        //             },
+        //             elements: {
+        //                 line: {
+        //                     tension: 0.000001
+        //                 }
+        //             },
+        //         }
+        //     });
+        // },
 
     });
 }