|
@@ -596,48 +596,50 @@ openerp.eiru_reporting = function (instance, local) {
|
|
self.fecthInitial();
|
|
self.fecthInitial();
|
|
},
|
|
},
|
|
// Redirecionar
|
|
// Redirecionar
|
|
- // renderReport: function () {
|
|
|
|
- // var self = this;
|
|
|
|
- //
|
|
|
|
- // var container = this.$el.closest('.oe_form_sheet.oe_form_sheet_width');
|
|
|
|
- // this.$el.closest('.report_view').remove();
|
|
|
|
- // container.find('.report_view').show({
|
|
|
|
- // effect: 'fade',
|
|
|
|
- // duration: 200,
|
|
|
|
- // });
|
|
|
|
- // },
|
|
|
|
- // // Verificar el modelo
|
|
|
|
- // checkModel : function(model){
|
|
|
|
- // var self = this;
|
|
|
|
- // return _.filter(self.modules,function(item){return item === model});
|
|
|
|
- // },
|
|
|
|
- // // Lanzar el mensaje
|
|
|
|
- // showMensaje : function(modelos){
|
|
|
|
- // $("#dialog" ).dialog({
|
|
|
|
- // autoOpen: true,
|
|
|
|
- // resizable: false,
|
|
|
|
- // modal: true,
|
|
|
|
- // title: 'Atención',
|
|
|
|
- // width: 500,
|
|
|
|
- // open: function() {
|
|
|
|
- // $(this).html('Lo sentimos , pero no contás con las configuraciones adecuado para manipular este informe.\nPóngase en contacto con el administrador del sistema (referencia : '+modelos+' )');
|
|
|
|
- // },
|
|
|
|
- // show: {
|
|
|
|
- // effect: "fade",
|
|
|
|
- // duration: 200
|
|
|
|
- // },
|
|
|
|
- // hide: {
|
|
|
|
- // effect: "fade",
|
|
|
|
- // duration: 200
|
|
|
|
- // },
|
|
|
|
- // buttons: {
|
|
|
|
- // Aceptar: function() {
|
|
|
|
- // $(this).dialog('close');
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // return
|
|
|
|
- // },
|
|
|
|
|
|
+ renderReport: function () {
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ var container = this.$el.closest('.oe_form_sheet.oe_form_sheet_width');
|
|
|
|
+ this.$el.closest('.report_view').remove();
|
|
|
|
+ container.find('.report_view').show({
|
|
|
|
+ effect: 'fade',
|
|
|
|
+ duration: 200,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // Verificar el modelo
|
|
|
|
+ checkModel : function(model){
|
|
|
|
+ var self = this;
|
|
|
|
+ return _.filter(self.modules,function(item){return item.name === model});
|
|
|
|
+ },
|
|
|
|
+ // Lanzar el mensaje
|
|
|
|
+ showMensaje : function(modelos){
|
|
|
|
+ var self = this;
|
|
|
|
+ $("#dialog" ).dialog({
|
|
|
|
+ autoOpen: true,
|
|
|
|
+ resizable: false,
|
|
|
|
+ modal: true,
|
|
|
|
+ title: 'Atención',
|
|
|
|
+ width: 500,
|
|
|
|
+ open: function() {
|
|
|
|
+ $(this).html('Reporte in-disponible, contacte con el administrador del sistema ref : '+modelos);
|
|
|
|
+ },
|
|
|
|
+ show: {
|
|
|
|
+ effect: "fade",
|
|
|
|
+ duration: 200
|
|
|
|
+ },
|
|
|
|
+ hide: {
|
|
|
|
+ effect: "fade",
|
|
|
|
+ duration: 200
|
|
|
|
+ },
|
|
|
|
+ buttons: {
|
|
|
|
+ Aceptar: function() {
|
|
|
|
+ $(this).dialog('close');
|
|
|
|
+ self.renderReport()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ },
|
|
// Fecha
|
|
// Fecha
|
|
fecthFecha: function() {
|
|
fecthFecha: function() {
|
|
var to;
|
|
var to;
|
|
@@ -673,12 +675,14 @@ openerp.eiru_reporting = function (instance, local) {
|
|
// Metodo inicial
|
|
// Metodo inicial
|
|
fecthInitial: function(){
|
|
fecthInitial: function(){
|
|
var self = this;
|
|
var self = this;
|
|
- // self.modules = instance._modules;
|
|
|
|
|
|
|
|
- self.fecthJournalStore().then(function(accountJournal){
|
|
|
|
- self.accountJournal=accountJournal;
|
|
|
|
- return accountJournal;
|
|
|
|
|
|
+ self.fecthIrModuleModule().then(function(modules){
|
|
|
|
+ self.modules = modules;
|
|
|
|
+ return modules;
|
|
|
|
+ }).then(function(modules){
|
|
|
|
+ return self.fecthJournalStore();
|
|
}).then(function(accountJournal){
|
|
}).then(function(accountJournal){
|
|
|
|
+ self.accountJournal=accountJournal;
|
|
self.$el.find('#current-journal').append('<option value="9999999">Todas las SUC.</option>');
|
|
self.$el.find('#current-journal').append('<option value="9999999">Todas las SUC.</option>');
|
|
_.each(accountJournal,function(item){
|
|
_.each(accountJournal,function(item){
|
|
self.$el.find('#current-journal').append('<option value="' + item.id + '">' + item.name + '</option>');
|
|
self.$el.find('#current-journal').append('<option value="' + item.id + '">' + item.name + '</option>');
|
|
@@ -703,15 +707,29 @@ openerp.eiru_reporting = function (instance, local) {
|
|
});
|
|
});
|
|
// return self.renderReport()
|
|
// return self.renderReport()
|
|
},
|
|
},
|
|
|
|
+ // Modelos instalados
|
|
|
|
+ fecthIrModuleModule: function(){
|
|
|
|
+ var self = this;
|
|
|
|
+ var defer = $.Deferred();
|
|
|
|
+ var fields = ['name','id'];
|
|
|
|
+ var domain=[['state','=','installed']];
|
|
|
|
+ var irModule = new instance.web.Model('ir.module.module');
|
|
|
|
+
|
|
|
|
+ irModule.query(fields).filter(domain).all().then(function(results){
|
|
|
|
+ defer.resolve(results);
|
|
|
|
+ });
|
|
|
|
+ return defer;
|
|
|
|
+ },
|
|
// Journal
|
|
// Journal
|
|
fecthJournalStore: function(){
|
|
fecthJournalStore: function(){
|
|
var self = this;
|
|
var self = this;
|
|
var defer = $.Deferred();
|
|
var defer = $.Deferred();
|
|
- // var modules = self.checkModel('multi_store');
|
|
|
|
- // if (modules.length <= 0){
|
|
|
|
- // self.showMensaje('multi_store');
|
|
|
|
- // return defer;
|
|
|
|
- // }
|
|
|
|
|
|
+ var modules = _.flatten(self.checkModel('multi_store'));
|
|
|
|
+
|
|
|
|
+ if (modules.length <= 0){
|
|
|
|
+ self.showMensaje('multi_store');
|
|
|
|
+ return defer;
|
|
|
|
+ }
|
|
|
|
|
|
var journal = new instance.web.Model('res.store');
|
|
var journal = new instance.web.Model('res.store');
|
|
var field=['id', 'name','out_invoice_id','journal_ids'];
|
|
var field=['id', 'name','out_invoice_id','journal_ids'];
|
|
@@ -1096,48 +1114,50 @@ openerp.eiru_reporting = function (instance, local) {
|
|
self.fecthInitial();
|
|
self.fecthInitial();
|
|
},
|
|
},
|
|
// Redirecionar
|
|
// Redirecionar
|
|
- // renderReport: function () {
|
|
|
|
- // var self = this;
|
|
|
|
- //
|
|
|
|
- // var container = this.$el.closest('.oe_form_sheet.oe_form_sheet_width');
|
|
|
|
- // this.$el.closest('.report_view').remove();
|
|
|
|
- // container.find('.report_view').show({
|
|
|
|
- // effect: 'fade',
|
|
|
|
- // duration: 200,
|
|
|
|
- // });
|
|
|
|
- // },
|
|
|
|
|
|
+ renderReport: function () {
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ var container = this.$el.closest('.oe_form_sheet.oe_form_sheet_width');
|
|
|
|
+ this.$el.closest('.report_view').remove();
|
|
|
|
+ container.find('.report_view').show({
|
|
|
|
+ effect: 'fade',
|
|
|
|
+ duration: 200,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// Verificar el modelo
|
|
// Verificar el modelo
|
|
- // checkModel : function(model){
|
|
|
|
- // var self = this;
|
|
|
|
- // return _.filter(self.modules,function(item){return item === model});
|
|
|
|
- // },
|
|
|
|
- // // Lanzar el mensaje
|
|
|
|
- // showMensaje : function(modelos){
|
|
|
|
- // $("#dialog" ).dialog({
|
|
|
|
- // autoOpen: true,
|
|
|
|
- // resizable: false,
|
|
|
|
- // modal: true,
|
|
|
|
- // title: 'Atención',
|
|
|
|
- // width: 500,
|
|
|
|
- // open: function() {
|
|
|
|
- // $(this).html('Lo sentimos , pero no contás con las configuraciones adecuado para manipular este informe.\nPóngase en contacto con el administrador del sistema (referencia : '+modelos+' )');
|
|
|
|
- // },
|
|
|
|
- // show: {
|
|
|
|
- // effect: "fade",
|
|
|
|
- // duration: 200
|
|
|
|
- // },
|
|
|
|
- // hide: {
|
|
|
|
- // effect: "fade",
|
|
|
|
- // duration: 200
|
|
|
|
- // },
|
|
|
|
- // buttons: {
|
|
|
|
- // Aceptar: function() {
|
|
|
|
- // $(this).dialog('close');
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // return
|
|
|
|
- // },
|
|
|
|
|
|
+ checkModel : function(model){
|
|
|
|
+ var self = this;
|
|
|
|
+ return _.filter(self.modules,function(item){return item.name === model});
|
|
|
|
+ },
|
|
|
|
+ // Lanzar el mensaje
|
|
|
|
+ showMensaje : function(modelos){
|
|
|
|
+ var self = this;
|
|
|
|
+ $("#dialog" ).dialog({
|
|
|
|
+ autoOpen: true,
|
|
|
|
+ resizable: false,
|
|
|
|
+ modal: true,
|
|
|
|
+ title: 'Atención',
|
|
|
|
+ width: 500,
|
|
|
|
+ open: function() {
|
|
|
|
+ $(this).html('Reporte in-disponible, contacte con el administrador del sistema ref : '+modelos);
|
|
|
|
+ },
|
|
|
|
+ show: {
|
|
|
|
+ effect: "fade",
|
|
|
|
+ duration: 200
|
|
|
|
+ },
|
|
|
|
+ hide: {
|
|
|
|
+ effect: "fade",
|
|
|
|
+ duration: 200
|
|
|
|
+ },
|
|
|
|
+ buttons: {
|
|
|
|
+ Aceptar: function() {
|
|
|
|
+ $(this).dialog('close');
|
|
|
|
+ self.renderReport();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ },
|
|
// Fecha
|
|
// Fecha
|
|
fecthFecha: function() {
|
|
fecthFecha: function() {
|
|
var to;
|
|
var to;
|
|
@@ -1173,11 +1193,14 @@ openerp.eiru_reporting = function (instance, local) {
|
|
// Metodo inicial
|
|
// Metodo inicial
|
|
fecthInitial: function(){
|
|
fecthInitial: function(){
|
|
var self = this;
|
|
var self = this;
|
|
- // self.modules = instance._modules;
|
|
|
|
- self.fecthJournalStore().then(function(accountJournal){
|
|
|
|
- self.accountJournal=accountJournal;
|
|
|
|
- return accountJournal;
|
|
|
|
|
|
+
|
|
|
|
+ self.fecthIrModuleModule().then(function(modules){
|
|
|
|
+ self.modules = modules;
|
|
|
|
+ return modules;
|
|
|
|
+ }).then(function(modules){
|
|
|
|
+ return self.fecthJournalStore();
|
|
}).then(function(accountJournal){
|
|
}).then(function(accountJournal){
|
|
|
|
+ self.accountJournal=accountJournal;
|
|
self.$el.find('#current-journal').append('<option value="9999999">Todas las SUC.</option>');
|
|
self.$el.find('#current-journal').append('<option value="9999999">Todas las SUC.</option>');
|
|
_.each(accountJournal,function(item){
|
|
_.each(accountJournal,function(item){
|
|
self.$el.find('#current-journal').append('<option value="' + item.id + '">' + item.name + '</option>');
|
|
self.$el.find('#current-journal').append('<option value="' + item.id + '">' + item.name + '</option>');
|
|
@@ -1202,6 +1225,19 @@ openerp.eiru_reporting = function (instance, local) {
|
|
});
|
|
});
|
|
// return self.renderReport();
|
|
// return self.renderReport();
|
|
},
|
|
},
|
|
|
|
+ // Modelos instalados
|
|
|
|
+ fecthIrModuleModule: function(){
|
|
|
|
+ var self = this;
|
|
|
|
+ var defer = $.Deferred();
|
|
|
|
+ var fields = ['name','id'];
|
|
|
|
+ var domain=[['state','=','installed']];
|
|
|
|
+ var irModule = new instance.web.Model('ir.module.module');
|
|
|
|
+
|
|
|
|
+ irModule.query(fields).filter(domain).all().then(function(results){
|
|
|
|
+ defer.resolve(results);
|
|
|
|
+ });
|
|
|
|
+ return defer;
|
|
|
|
+ },
|
|
// company_curency
|
|
// company_curency
|
|
fecthComanyCurrency: function(){
|
|
fecthComanyCurrency: function(){
|
|
var self = this;
|
|
var self = this;
|
|
@@ -1218,12 +1254,12 @@ openerp.eiru_reporting = function (instance, local) {
|
|
fecthJournalStore: function(){
|
|
fecthJournalStore: function(){
|
|
var self = this;
|
|
var self = this;
|
|
var defer = $.Deferred();
|
|
var defer = $.Deferred();
|
|
- // var modules = self.checkModel('multi_store');
|
|
|
|
|
|
+ var modules = self.checkModel('multi_store');
|
|
//
|
|
//
|
|
- // if (modules.length <= 0){
|
|
|
|
- // self.showMensaje('multi_store');
|
|
|
|
- // return defer;
|
|
|
|
- // }
|
|
|
|
|
|
+ if (modules.length <= 0){
|
|
|
|
+ self.showMensaje('multi_store');
|
|
|
|
+ return defer;
|
|
|
|
+ }
|
|
|
|
|
|
var journal = new instance.web.Model('res.store');
|
|
var journal = new instance.web.Model('res.store');
|
|
var field=['id', 'name','out_invoice_id','journal_ids'];
|
|
var field=['id', 'name','out_invoice_id','journal_ids'];
|
|
@@ -1765,7 +1801,7 @@ openerp.eiru_reporting = function (instance, local) {
|
|
pdfDoc.setFontSize(12);
|
|
pdfDoc.setFontSize(12);
|
|
pdfDoc.setFontStyle('bold');
|
|
pdfDoc.setFontStyle('bold');
|
|
pdfDoc.setTextColor(40);
|
|
pdfDoc.setTextColor(40);
|
|
- pdfDoc.text('Listado de Stock Por '+ location, data.settings.margin.left, 10);
|
|
|
|
|
|
+ pdfDoc.text('Listado de productos de '+ location, data.settings.margin.left, 10);
|
|
// FOOTER
|
|
// FOOTER
|
|
var str = "Pagina " + data.pageCount;
|
|
var str = "Pagina " + data.pageCount;
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
@@ -1780,7 +1816,7 @@ openerp.eiru_reporting = function (instance, local) {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
pdfDoc.putTotalPages(totalPagesExp);
|
|
pdfDoc.putTotalPages(totalPagesExp);
|
|
}
|
|
}
|
|
- pdfDoc.save('Listado_de_Stock_Por_Ubicaion.pdf');
|
|
|
|
|
|
+ pdfDoc.save('Listado de productos de '+location+'.pdf');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// AllPurchases Listado de Compras
|
|
// AllPurchases Listado de Compras
|
|
@@ -1995,6 +2031,9 @@ openerp.eiru_reporting = function (instance, local) {
|
|
self.factSearch();
|
|
self.factSearch();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ close: function( event, ui ) {
|
|
|
|
+ self.factSearch();
|
|
|
|
+ },
|
|
select: function(event, ui) {
|
|
select: function(event, ui) {
|
|
self.factSearch();
|
|
self.factSearch();
|
|
}
|
|
}
|
|
@@ -2216,7 +2255,7 @@ openerp.eiru_reporting = function (instance, local) {
|
|
pdfDoc.setFontSize(12);
|
|
pdfDoc.setFontSize(12);
|
|
pdfDoc.setFontStyle('bold');
|
|
pdfDoc.setFontStyle('bold');
|
|
pdfDoc.setTextColor(40);
|
|
pdfDoc.setTextColor(40);
|
|
- pdfDoc.text('Listado de Compras '+ sucusal, data.settings.margin.left, 10);
|
|
|
|
|
|
+ pdfDoc.text('Histórico de compras de '+ sucusal, data.settings.margin.left, 10);
|
|
|
|
|
|
if(desde.length > 0 || hasta.length > 0){
|
|
if(desde.length > 0 || hasta.length > 0){
|
|
var fecha='';
|
|
var fecha='';
|
|
@@ -2247,7 +2286,7 @@ openerp.eiru_reporting = function (instance, local) {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
pdfDoc.putTotalPages(totalPagesExp);
|
|
pdfDoc.putTotalPages(totalPagesExp);
|
|
}
|
|
}
|
|
- pdfDoc.save('Listado de Compras.pdf')
|
|
|
|
|
|
+ pdfDoc.save('Histórico de compras.pdf')
|
|
},
|
|
},
|
|
});
|
|
});
|
|
// ReposrtExpenses Listado de Gastos
|
|
// ReposrtExpenses Listado de Gastos
|
|
@@ -2462,6 +2501,9 @@ openerp.eiru_reporting = function (instance, local) {
|
|
self.factSearch();
|
|
self.factSearch();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ close: function( event, ui ) {
|
|
|
|
+ self.factSearch();
|
|
|
|
+ },
|
|
select: function(event, ui) {
|
|
select: function(event, ui) {
|
|
self.factSearch();
|
|
self.factSearch();
|
|
}
|
|
}
|
|
@@ -2683,7 +2725,7 @@ openerp.eiru_reporting = function (instance, local) {
|
|
pdfDoc.setFontSize(12);
|
|
pdfDoc.setFontSize(12);
|
|
pdfDoc.setFontStyle('bold');
|
|
pdfDoc.setFontStyle('bold');
|
|
pdfDoc.setTextColor(40);
|
|
pdfDoc.setTextColor(40);
|
|
- pdfDoc.text('Listado de Compras '+ sucusal, data.settings.margin.left, 10);
|
|
|
|
|
|
+ pdfDoc.text('Histórico de gastos de '+ sucusal, data.settings.margin.left, 10);
|
|
|
|
|
|
if(desde.length > 0 || hasta.length > 0){
|
|
if(desde.length > 0 || hasta.length > 0){
|
|
var fecha='';
|
|
var fecha='';
|
|
@@ -2714,7 +2756,7 @@ openerp.eiru_reporting = function (instance, local) {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
if (typeof pdfDoc.putTotalPages === 'function') {
|
|
pdfDoc.putTotalPages(totalPagesExp);
|
|
pdfDoc.putTotalPages(totalPagesExp);
|
|
}
|
|
}
|
|
- pdfDoc.save('Listado de Gastos.pdf')
|
|
|
|
|
|
+ pdfDoc.save('Histórico de gastos.pdf')
|
|
},
|
|
},
|
|
});
|
|
});
|
|
// Proximo Report
|
|
// Proximo Report
|