Browse Source

[FIX] correciones varias

Rodney Elpidio Enciso Arias 6 years ago
parent
commit
15fcd0d8a1

+ 10 - 6
static/src/js/widgets/widget_account_receivable.js

@@ -7,6 +7,7 @@ function widget_account_receivable(widget) {
     widget.WidgetAccountReceivableWidget = widget.Base.extend({
     widget.WidgetAccountReceivableWidget = widget.Base.extend({
         template: 'WidgetAccountReceivable',
         template: 'WidgetAccountReceivable',
         modelId: [],
         modelId: [],
+        data: [],
 
 
         events: {
         events: {
             'click .today': 'showToday',
             'click .today': 'showToday',
@@ -151,7 +152,7 @@ function widget_account_receivable(widget) {
             var self = this;
             var self = this;
             var defer = $.Deferred();
             var defer = $.Deferred();
             var fields = ['id','name', 'symbol', 'rate_silent', 'base', 'decimal_separator', 'decimal_places', 'thousands_separator', 'symbol_position'];
             var fields = ['id','name', 'symbol', 'rate_silent', 'base', 'decimal_separator', 'decimal_places', 'thousands_separator', 'symbol_position'];
-            var domain = [['active', '=', true],['base','=',true]];
+            var domain = [['active', '=', true]];
             var ResCurrecy = new model.web.Model('res.currency');
             var ResCurrecy = new model.web.Model('res.currency');
             ResCurrecy.query(fields).filter(domain).all().then(function(results) {
             ResCurrecy.query(fields).filter(domain).all().then(function(results) {
                 defer.resolve(results);
                 defer.resolve(results);
@@ -206,7 +207,7 @@ function widget_account_receivable(widget) {
         showToday: function () {
         showToday: function () {
             var self = this;
             var self = this;
             var amount = 0;
             var amount = 0;
-            var data = [];
+            // var data = [];
             var MoveLine = self.getTodayAccountMoveLive();
             var MoveLine = self.getTodayAccountMoveLive();
             var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
             var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
             if(MoveLine.length > 0){
             if(MoveLine.length > 0){
@@ -216,6 +217,7 @@ function widget_account_receivable(widget) {
                     return memo + num;
                     return memo + num;
                 });
                 });
             }
             }
+            self.data = MoveLine;
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content').find('.number').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
             self.$el.find('.widget-content').find('.number').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
         },
         },
@@ -223,7 +225,7 @@ function widget_account_receivable(widget) {
         showThisWeek: function () {
         showThisWeek: function () {
             var self = this;
             var self = this;
             var amount = 0;
             var amount = 0;
-            var data = [];
+            // var data = [];
             var MoveLine = self.getThisWeekAccountMoveLive();
             var MoveLine = self.getThisWeekAccountMoveLive();
             var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
             var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
             if(MoveLine.length > 0){
             if(MoveLine.length > 0){
@@ -233,6 +235,7 @@ function widget_account_receivable(widget) {
                     return memo + num;
                     return memo + num;
                 });
                 });
             }
             }
+            self.data = MoveLine;
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content').find('.number').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
             self.$el.find('.widget-content').find('.number').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
         },
         },
@@ -240,7 +243,6 @@ function widget_account_receivable(widget) {
         showExpire: function () {
         showExpire: function () {
             var self = this;
             var self = this;
             var amount = 0;
             var amount = 0;
-            var data = [];
             var MoveLine = self.getExpireAccountMoveLive();
             var MoveLine = self.getExpireAccountMoveLive();
             var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
             var CurrencyBase = self.getResCurrency(self.ResCompany[0].currency_id[0]).shift();
             if(MoveLine.length > 0){
             if(MoveLine.length > 0){
@@ -250,19 +252,21 @@ function widget_account_receivable(widget) {
                     return memo + num;
                     return memo + num;
                 });
                 });
             }
             }
+            self.data = MoveLine;
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content.widget-loading').css('display','none');
             self.$el.find('.widget-content').find('.number').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
             self.$el.find('.widget-content').find('.number').text(accounting.formatMoney(amount, CurrencyBase.symbol, CurrencyBase.decimal_places, CurrencyBase.thousands_separator, CurrencyBase.decimal_separator))
         },
         },
 
 
         showModal: function (e) {
         showModal: function (e) {
             var self = this;
             var self = this;
-            if (self.AccountMoveLine <=0) {
+            if (self.data <=0) {
                 model.web.notification.do_warn("Atención","Sin datos");
                 model.web.notification.do_warn("Atención","Sin datos");
                 return
                 return
             }
             }
 
 
             var moneda = self.ResCurrency.shift();
             var moneda = self.ResCurrency.shift();
-            var newmoveLine = self.AccountMoveLine;
+            var newmoveLine = self.data;
+            console.log(newmoveLine);
             var titleData = [
             var titleData = [
                 {
                 {
                     title: "Cuentas a Cobrar"
                     title: "Cuentas a Cobrar"

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

@@ -12,10 +12,10 @@
                         <div class="col-xs-6">
                         <div class="col-xs-6">
                             <div class="col-xs-6 col-xs-offset-9">
                             <div class="col-xs-6 col-xs-offset-9">
                                 <div class="btn-group btn-group-xs">
                                 <div class="btn-group btn-group-xs">
-                                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                                    <a type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                     <span class="caret"></span>
                                     <span class="caret"></span>
                                     <span class="sr-only">Toggle Dropdown</span>
                                     <span class="sr-only">Toggle Dropdown</span>
-                                    </button>
+                                    </a>
                                     <ul class="dropdown-menu dropdown-menu-right">
                                     <ul class="dropdown-menu dropdown-menu-right">
                                         <li><a class="today">Hoy</a></li>
                                         <li><a class="today">Hoy</a></li>
                                         <li><a class="thisWeek">Esta Semana</a></li>
                                         <li><a class="thisWeek">Esta Semana</a></li>

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

@@ -12,10 +12,10 @@
                         <div class="col-xs-6">
                         <div class="col-xs-6">
                             <div class="col-xs-6 col-xs-offset-9">
                             <div class="col-xs-6 col-xs-offset-9">
                                 <div class="btn-group btn-group-xs">
                                 <div class="btn-group btn-group-xs">
-                                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                                    <a type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                     <span class="caret"></span>
                                     <span class="caret"></span>
                                     <span class="sr-only">Toggle Dropdown</span>
                                     <span class="sr-only">Toggle Dropdown</span>
-                                    </button>
+                                    </a>
                                     <ul class="dropdown-menu dropdown-menu-right">
                                     <ul class="dropdown-menu dropdown-menu-right">
                                         <li><a class="today">Hoy</a></li>
                                         <li><a class="today">Hoy</a></li>
                                         <li><a class="thisWeek">Esta Semana</a></li>
                                         <li><a class="thisWeek">Esta Semana</a></li>