Rodney Enciso Arias 7 роки тому
батько
коміт
fc1d8dc482

+ 58 - 2
static/src/js/reports/report_purchases.js

@@ -480,10 +480,10 @@ function report_purchases (reporting){
                     self.fect_cabecera(self.resCompany, self.newInvoice);
                     download(self.newCabecera, fileName, "text/plain");   
                 }else{
-                    alert('No hay registros para importar');
+                    self.showMensajeRegistro();
                 }
             }else{
-                alert('Debe elegir un periodo');
+                self.showMensaje();
             }
         },
         // Descargar el archivo adjunto
@@ -511,5 +511,61 @@ function report_purchases (reporting){
             $(".preview").attr("data-lightbox",dato.name);
             $(".preview").attr("href",img);
         },
+        // Lanzar el mensaje de pediodo
+        showMensaje : function(modelos){
+            var self = this;
+            $("#dialog" ).dialog({
+                autoOpen: true,
+                resizable: false,
+                modal: true,
+                title: 'Atención',
+                width: 500,
+                open: function() {
+                    $(this).html('Debe elegir un periodo');
+                },
+                show: {
+                    effect: "fade",
+                    duration: 200
+                },
+                hide: {
+                    effect: "fade",
+                    duration: 200
+                },
+                buttons: {
+                    Aceptar: function() {
+                        $(this).dialog('close');
+                    }
+                }
+            });
+            return
+        },
+        // Lanzar mensaje de registros
+        showMensajeRegistro : function(modelos){
+            var self = this;
+            $("#dialog" ).dialog({
+                autoOpen: true,
+                resizable: false,
+                modal: true,
+                title: 'Atención',
+                width: 500,
+                open: function() {
+                    $(this).html('No hay registros que exportar');
+                },
+                show: {
+                    effect: "fade",
+                    duration: 200
+                },
+                hide: {
+                    effect: "fade",
+                    duration: 200
+                },
+                buttons: {
+                    Aceptar: function() {
+                        $(this).dialog('close');
+                    }
+                }
+            });
+            return
+        },
     });
 }

+ 59 - 2
static/src/js/reports/report_sales.js

@@ -489,10 +489,10 @@ function report_sales (reporting){
                     self.fect_cabecera(self.resCompany, self.newInvoice);
                     download(self.newCabecera, fileName, "text/plain");
                 }else{
-                    alert('No hay registros para importar');
+                    self.showMensajeRegistro();
                 }     
             }else{
-                alert('Debe elegir un periodo');
+                self.showMensaje();
             }
         },
 
@@ -521,5 +521,62 @@ function report_sales (reporting){
             $(".preview").attr("data-lightbox",dato.name);
             $(".preview").attr("href",img);
         },
+
+        // Lanzar el mensaje de pediodo
+        showMensaje : function(modelos){
+            var self = this;
+            $("#dialog" ).dialog({
+                autoOpen: true,
+                resizable: false,
+                modal: true,
+                title: 'Atención',
+                width: 500,
+                open: function() {
+                    $(this).html('Debe elegir un periodo');
+                },
+                show: {
+                    effect: "fade",
+                    duration: 200
+                },
+                hide: {
+                    effect: "fade",
+                    duration: 200
+                },
+                buttons: {
+                    Aceptar: function() {
+                        $(this).dialog('close');
+                    }
+                }
+            });
+            return
+        },
+        // Lanzar mensaje de registros
+        showMensajeRegistro : function(modelos){
+            var self = this;
+            $("#dialog" ).dialog({
+                autoOpen: true,
+                resizable: false,
+                modal: true,
+                title: 'Atención',
+                width: 500,
+                open: function() {
+                    $(this).html('No hay registros que exportar');
+                },
+                show: {
+                    effect: "fade",
+                    duration: 200
+                },
+                hide: {
+                    effect: "fade",
+                    duration: 200
+                },
+                buttons: {
+                    Aceptar: function() {
+                        $(this).dialog('close');
+                    }
+                }
+            });
+            return
+        },
     });
 }