|
@@ -0,0 +1,533 @@
|
|
|
+function report_sales (reporting){
|
|
|
+ "use strict";
|
|
|
+
|
|
|
+ var instance = openerp;
|
|
|
+
|
|
|
+ reporting.ReportSalesWidget = reporting.Base.extend({
|
|
|
+ template: 'ReportSales',
|
|
|
+ invoice: [],
|
|
|
+ Currency:[],
|
|
|
+ resCurrency :[],
|
|
|
+ resCompany:[],
|
|
|
+ accountJournal:[],
|
|
|
+ customer:[],
|
|
|
+ newInvoice:[],
|
|
|
+ rowsData :[],
|
|
|
+ // event
|
|
|
+ events:{
|
|
|
+ 'change #current-period' : 'factSearch',
|
|
|
+ 'click #txt' : 'generarTxt',
|
|
|
+ },
|
|
|
+ // Initil
|
|
|
+ init : function(parent){
|
|
|
+ this._super(parent);
|
|
|
+ },
|
|
|
+ // start
|
|
|
+ start: function () {
|
|
|
+ var self = this;
|
|
|
+ var table = this.$el.find('#table');
|
|
|
+ table.bootstrapTable({data : self.rowsData});
|
|
|
+ this.submitForm();
|
|
|
+ },
|
|
|
+ // Consultar
|
|
|
+ submitForm: function () {
|
|
|
+ var self = this;
|
|
|
+ self.fetchPeriod().then(function(period) {
|
|
|
+ return period;
|
|
|
+ }).then(function (period) {
|
|
|
+ self.period = period;
|
|
|
+ self.$el.find('#current-period').append('<option value="9999999">Todos los periodos</option>');
|
|
|
+ _.each(period, function (item) {
|
|
|
+ self.$el.find('#current-period').append('<option value="' + item.id + '">' + item.name + '</option>');
|
|
|
+ });
|
|
|
+ return self.fetchJournal();
|
|
|
+ }).then(function (journal) {
|
|
|
+ self.accountJournal =journal;
|
|
|
+ return self.fetchInvoiceP2();
|
|
|
+ }).then(function (invoice){
|
|
|
+ self.invoice = invoice;
|
|
|
+ return self.fetchCustomer(invoice);
|
|
|
+ }).then(function (customer){
|
|
|
+ self.customer=customer;
|
|
|
+ return self.fetchPaymentTerm();
|
|
|
+ }).then(function (paymentTerm){
|
|
|
+ self.paymentTerm=paymentTerm;
|
|
|
+ return self.fetchAttachment();
|
|
|
+ }).then(function(attachment){
|
|
|
+ self.attachment=attachment;
|
|
|
+ return self.fecthComanyCurrency();
|
|
|
+ }).then(function(resCompany){
|
|
|
+ self.resCompany = resCompany;
|
|
|
+ self.inicializarBuscadorsup();
|
|
|
+ return self.fect_generar(self.invoice);
|
|
|
+ }).then(function(currency){
|
|
|
+ self.currency = currency;
|
|
|
+ return self.fect_cabecera(self.resCompany, self.invoice);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // Buscar Diario
|
|
|
+ fetchJournal: function () {
|
|
|
+ var self = this;
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var Journal = new instance.web.Model('account.journal');
|
|
|
+ Journal.query(['id', 'name']).filter([['type', '=', 'sale']]).all().then(function(results){
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+ // Periodo
|
|
|
+ fetchPeriod: function () {
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var period = new instance.web.Model('account.period');
|
|
|
+ var fields = ['id', 'name'];
|
|
|
+ var domain = [['special', '!=', true]];
|
|
|
+ period.query(fields).filter(domain).all().then(function (results) {
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+ // Invoice (FACTURAS)
|
|
|
+ fetchInvoiceP2: function () {
|
|
|
+ var journal_ids = _.flatten(_.map(this.accountJournal, function (item) {
|
|
|
+ return item.id;
|
|
|
+ }));
|
|
|
+ var filter =[['state', 'in',['open','paid']],['type', '=', 'out_invoice'],['journal_id', 'in',journal_ids]];
|
|
|
+ var field =['id', 'type', 'number', 'origin', 'state', 'journal_id', 'currency_id', 'supplier_invoice_number','date_invoice','partner_id','amount_total','user_id','contado','credito','payment_term','period_id','amount_untaxed','amount_tax','attachment_ids'];
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var Invoice = new instance.web.Model('account.invoice');
|
|
|
+ Invoice.query(field).filter(filter).all().then(function (results) {
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+ // company_curency
|
|
|
+ fecthComanyCurrency: function(){
|
|
|
+ var self = this;
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var currency = new instance.web.Model('res.company');
|
|
|
+ var field=['id', 'currency_id','exportador','agent_ruc','legal_agent','company_ruc','name'];
|
|
|
+ var domain=[['id','=',1]];
|
|
|
+ currency.query(field).filter(domain).all().then(function(results){
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+ // Partner (Proveeedor)
|
|
|
+ fetchCustomer: function() {
|
|
|
+ var self = this;
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var customer = new instance.web.Model('res.partner');
|
|
|
+ customer.query(['id', 'name', 'ruc', 'active', 'customer']).filter([['active', '=', true], ['customer', '=', true]]).all().then(function (results) {
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // archivos Adjuntos
|
|
|
+ fetchAttachment: function() {
|
|
|
+ var self = this;
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var id = _.flatten(_.map(self.invoice,function(map){
|
|
|
+ return id;
|
|
|
+ }));
|
|
|
+ var attachment = new instance.web.Model('ir.attachment');
|
|
|
+ attachment.query(['id','res_id', 'datas', 'res_model']).filter([['res_model', '=','account.invoice']]).all().then(function (results) {
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+
|
|
|
+ // plazos de pago
|
|
|
+ fetchPaymentTerm: function () {
|
|
|
+ var self = this;
|
|
|
+ var defer = $.Deferred();
|
|
|
+ var payment_term = _.flatten(_.map(self.invoice,function(map){
|
|
|
+ return map.payment_term[0];
|
|
|
+ }));
|
|
|
+ var paymentTerm = new instance.web.Model('account.payment.term');
|
|
|
+ paymentTerm.query(['id','name','line_ids']).filter([['id', '=', payment_term]]).all().then(function(results){
|
|
|
+ defer.resolve(results);
|
|
|
+ });
|
|
|
+ return defer;
|
|
|
+ },
|
|
|
+
|
|
|
+ // Verificar si los Valores no son nulos
|
|
|
+ valorNull:function(dato){
|
|
|
+ var valor ="";
|
|
|
+ if (dato){
|
|
|
+ valor=dato;
|
|
|
+ }
|
|
|
+ return valor;
|
|
|
+ },
|
|
|
+ // Buscador
|
|
|
+ inicializarBuscadorsup: function () {
|
|
|
+ var self = this;
|
|
|
+ var results = self.customer;
|
|
|
+ results = _.map(results, function (item) {
|
|
|
+ return {
|
|
|
+ label: item.id + '-'+ item.name + ' ' + self.valorNull(item.ruc),
|
|
|
+ value: item.id + '-'+ item.name + ' ' + self.valorNull(item.ruc)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ self.$('#customer').autocomplete({
|
|
|
+ source: results,
|
|
|
+ minLength:0,
|
|
|
+ search: function(event, ui) {
|
|
|
+ if (!(self.$('#customer').val())){
|
|
|
+ self.factSearch();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ close: function( event, ui ) {
|
|
|
+ self.factSearch();
|
|
|
+ },
|
|
|
+ select: function(event, ui) {
|
|
|
+ self.factSearch();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ getCustomer : function(partner_id){
|
|
|
+ var self = this;
|
|
|
+ return _.filter(self.customer,function(item){
|
|
|
+ return item.id === partner_id;
|
|
|
+ }).shift();
|
|
|
+ },
|
|
|
+
|
|
|
+ getPaymentTerm : function(id){
|
|
|
+ var self = this;
|
|
|
+ return _.filter(self.paymentTerm,function(item){
|
|
|
+ return item.id === id;
|
|
|
+ }).shift();
|
|
|
+ },
|
|
|
+
|
|
|
+ getAttachment : function(attachment_ids){
|
|
|
+ var self = this;
|
|
|
+ return _.map(_.filter(self.attachment,function(item){
|
|
|
+ return item.id === attachment_ids;
|
|
|
+ }),function(map){
|
|
|
+ return map.datas;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // unir los objetos
|
|
|
+ fect_generar: function(invoices){
|
|
|
+ var self = this;
|
|
|
+ var attach = self.attachment;
|
|
|
+ var data = [];
|
|
|
+ var customer_ruc;
|
|
|
+ var ruc;
|
|
|
+ var cuota;
|
|
|
+ var cuotaII;
|
|
|
+ var total;
|
|
|
+ var tasa_10;
|
|
|
+ var tasa_5;
|
|
|
+ var iva_10;
|
|
|
+ var iva_5;
|
|
|
+ var condicion;
|
|
|
+ var IVA;
|
|
|
+ var TAX;
|
|
|
+ var untaxed;
|
|
|
+ _.each(invoices, function(invoice){
|
|
|
+ // obtener el ruc y el DV del cliente
|
|
|
+ customer_ruc = self.getCustomer(invoice.partner_id[0]);
|
|
|
+ ruc = customer_ruc.ruc.split("-");
|
|
|
+
|
|
|
+ // Determinar si la factura es a credito o al contado
|
|
|
+ condicion = 1;
|
|
|
+ if (invoice.credito == true){
|
|
|
+ condicion = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Determinar la cantidad de cuotas
|
|
|
+ cuota = _.flatten(self.getPaymentTerm(invoice.payment_term[0])).length - 2;
|
|
|
+ // cuotaII = (cuota.length - 2);
|
|
|
+ if (condicion == 1 || cuota < 1){
|
|
|
+ cuota = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Manejo de impuestos
|
|
|
+ IVA = accounting.formatNumber(((invoice.amount_untaxed * 10)/100),"","");
|
|
|
+ TAX = accounting.formatNumber(invoice.amount_tax,"","");
|
|
|
+
|
|
|
+ untaxed = 0;
|
|
|
+ iva_5 = 0;
|
|
|
+ iva_10 = 0;
|
|
|
+ tasa_10 = 0;
|
|
|
+ tasa_5 = 0;
|
|
|
+
|
|
|
+ // Determinar si fue aplicado algun impuesto a la factura.
|
|
|
+ if(invoice.amount_total == invoice.amount_untaxed){
|
|
|
+ untaxed = accounting.formatNumber(invoice.amount_untaxed,"","");
|
|
|
+ }else{
|
|
|
+ // Si fue aplicado impuesto, determina si fue de 10% o 5%.
|
|
|
+ if(IVA == TAX){
|
|
|
+ iva_10 = accounting.formatNumber(invoice.amount_tax,"","");;
|
|
|
+ tasa_10 = accounting.formatNumber(invoice.amount_untaxed,"","");
|
|
|
+ }else{
|
|
|
+ iva_5 = accounting.formatNumber(invoice.amount_tax,"","");;
|
|
|
+ tasa_5 = accounting.formatNumber(invoice.amount_untaxed,"","");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ total = 0;
|
|
|
+ total = parseInt(tasa_10) + parseInt(iva_10) + parseInt(tasa_5) + parseInt(iva_5) + parseInt(untaxed);
|
|
|
+
|
|
|
+ data.push({
|
|
|
+ tipo_registro: 2,
|
|
|
+ ruc_cliente: ruc[0],
|
|
|
+ dv: ruc[1],
|
|
|
+ partner: invoice.partner_id[1],
|
|
|
+ tipo_documento : 1,
|
|
|
+ numero_documento : invoice.number,
|
|
|
+ date: moment(invoice.date_invoice).format("DD/MM/YYYY"),
|
|
|
+ tasa_10 : tasa_10,
|
|
|
+ iva_10 : iva_10,
|
|
|
+ tasa_5 : tasa_5,
|
|
|
+ iva_5 : iva_5,
|
|
|
+ amount: untaxed,
|
|
|
+ total : total,
|
|
|
+ condicion_venta : condicion,
|
|
|
+ cantidad_cuotas : cuota,
|
|
|
+ number: invoice.number,
|
|
|
+ // informacion del periodo
|
|
|
+ period_id : invoice.period_id[0],
|
|
|
+ period_name : invoice.period_id[1],
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+ self.newInvoice = data;
|
|
|
+ this.loadTable(data);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // Informacion para el txt.
|
|
|
+ fect_cabecera: function(resCompanys, invoices){
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ // Cabecera
|
|
|
+
|
|
|
+ var datos = [];
|
|
|
+ var periodo =(this.$el.find('#from').val());
|
|
|
+ var company_ruc;
|
|
|
+ var agent_ruc;
|
|
|
+ var version = 2;
|
|
|
+ _.each(resCompanys, function(resCompany){
|
|
|
+ company_ruc = resCompany.company_ruc.split("-");
|
|
|
+ agent_ruc = resCompany.agent_ruc.split("-");
|
|
|
+ // Tipo de registro
|
|
|
+ datos.push(1);
|
|
|
+ datos.push('\t');
|
|
|
+ // Periodo
|
|
|
+ datos.push(moment(periodo).format("YYYYMM"));
|
|
|
+ datos.push('\t');
|
|
|
+ // Tipo de reporte
|
|
|
+ datos.push(1);
|
|
|
+ datos.push('\t');
|
|
|
+ // Codigo Obligacion
|
|
|
+ datos.push(911);
|
|
|
+ datos.push('\t');
|
|
|
+ // Codigo Formulario
|
|
|
+ datos.push(211);
|
|
|
+ datos.push('\t');
|
|
|
+ // Ruc agente de informacion
|
|
|
+ datos.push(company_ruc[0]);
|
|
|
+ datos.push('\t');
|
|
|
+ // DV agente de informacion
|
|
|
+ datos.push(company_ruc[1]);
|
|
|
+ datos.push('\t');
|
|
|
+ // Nombre o denominacion del agente de informacion
|
|
|
+ datos.push(resCompany.name);
|
|
|
+ datos.push('\t');
|
|
|
+ // Ruc representante legal
|
|
|
+ datos.push(agent_ruc[0]);
|
|
|
+ datos.push('\t');
|
|
|
+ // DV representante legal
|
|
|
+ datos.push(agent_ruc[1]);
|
|
|
+ datos.push('\t');
|
|
|
+ // Nombre y apellido de representante legal
|
|
|
+ datos.push(resCompany.legal_agent);
|
|
|
+ datos.push('\t');
|
|
|
+ // Cantidad de registros
|
|
|
+ datos.push(50);
|
|
|
+ datos.push('\t');
|
|
|
+ // Monto total
|
|
|
+ datos.push(60);
|
|
|
+ datos.push('\t');
|
|
|
+ // Version
|
|
|
+ datos.push(version);
|
|
|
+ datos.push('\r\n');
|
|
|
+ });
|
|
|
+
|
|
|
+ // detalles
|
|
|
+ var customer_ruc;
|
|
|
+ var ruc;
|
|
|
+ var cuota;
|
|
|
+ var cuotaII;
|
|
|
+ var tipo;
|
|
|
+ var cantidad = 0;
|
|
|
+ var tasa_10 = 0;
|
|
|
+ var tasa_5 = 0;
|
|
|
+ var iva_5 = 0;
|
|
|
+ var iva_10 = 0;
|
|
|
+ var IVA = 0;
|
|
|
+ var TAX = 0;
|
|
|
+ var total = 0;
|
|
|
+ var valor = 0;
|
|
|
+ var condicion;
|
|
|
+ var untaxed;
|
|
|
+ var ingreso = 0;
|
|
|
+
|
|
|
+ _.each(invoices, function(invoice){
|
|
|
+ // obtener el ruc y el DV del cliente
|
|
|
+ customer_ruc = self.getCustomer(invoice.partner_id[0]);
|
|
|
+ ruc = customer_ruc.ruc.split("-");
|
|
|
+
|
|
|
+ // Determinar si la factura es a credito o al contado
|
|
|
+ condicion = 1;
|
|
|
+ if (invoice.credito == true){
|
|
|
+ condicion = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Determinar la cantidad de cuotas
|
|
|
+ cuota = _.flatten(self.getPaymentTerm(invoice.payment_term[0])).length - 2;
|
|
|
+ if (condicion == 1 || cuota < 1){
|
|
|
+ cuota = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Manejo de impuestos
|
|
|
+ IVA = accounting.formatNumber(((invoice.amount_untaxed * 10)/100),"","");
|
|
|
+ TAX = accounting.formatNumber(invoice.amount_tax,"","");
|
|
|
+
|
|
|
+ untaxed = 0;
|
|
|
+ iva_5 = 0;
|
|
|
+ iva_10 = 0;
|
|
|
+ tasa_10 = 0;
|
|
|
+ tasa_5 = 0;
|
|
|
+
|
|
|
+ // Determinar si fue aplicado algun impuesto a la factura.
|
|
|
+ if(invoice.amount_total == invoice.amount_untaxed){
|
|
|
+ untaxed = accounting.formatNumber(invoice.amount_untaxed,"","");
|
|
|
+ }else{
|
|
|
+ // Si fue aplicado impuesto, determina si fue de 10% o 5%.
|
|
|
+ if(IVA == TAX){
|
|
|
+ iva_10 = accounting.formatNumber(invoice.amount_tax,"","");;
|
|
|
+ tasa_10 = accounting.formatNumber(invoice.amount_untaxed,"","");
|
|
|
+ }else{
|
|
|
+ iva_5 = accounting.formatNumber(invoice.amount_tax,"","");;
|
|
|
+ tasa_5 = accounting.formatNumber(invoice.amount_untaxed,"","");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ total = 0;
|
|
|
+ total = parseInt(tasa_10) + parseInt(iva_10) + parseInt(tasa_5) + parseInt(iva_5) + parseInt(untaxed);
|
|
|
+
|
|
|
+ // tipo de registro
|
|
|
+ datos.push(2);
|
|
|
+ datos.push('\t');
|
|
|
+ // ruc del cliente
|
|
|
+ datos.push(ruc[0]);
|
|
|
+ datos.push('\t');
|
|
|
+ // dv del cliente
|
|
|
+ datos.push(ruc[1]);
|
|
|
+ datos.push('\t');
|
|
|
+ // Nombre o denominacion del cliente
|
|
|
+ datos.push(invoice.partner_id[1]);
|
|
|
+ datos.push('\t');
|
|
|
+ // tipo de documento
|
|
|
+ datos.push(1);
|
|
|
+ datos.push('\t');
|
|
|
+ // Numero de documento
|
|
|
+ datos.push(invoice.number);
|
|
|
+ datos.push('\t');
|
|
|
+ // Fecha de documento
|
|
|
+ datos.push(moment(invoice.date_invoice).format("DD/MM/YYYY"));
|
|
|
+ datos.push('\t');
|
|
|
+ // Monto de la venta a la tasa 10%
|
|
|
+ datos.push(tasa_10);
|
|
|
+ datos.push('\t');
|
|
|
+ // IVA debito 10%
|
|
|
+ datos.push(iva_10);
|
|
|
+ datos.push('\t');
|
|
|
+ // Monto de la venta a la tasa 5%
|
|
|
+ datos.push(tasa_5);
|
|
|
+ datos.push('\t');
|
|
|
+ // IVA debito 5%
|
|
|
+ datos.push(iva_5);
|
|
|
+ datos.push('\t');
|
|
|
+ // Monto de la venta no gravada o exenta
|
|
|
+ datos.push(untaxed);
|
|
|
+ datos.push('\t');
|
|
|
+ // Monto del ingreso
|
|
|
+ datos.push(total);
|
|
|
+ datos.push('\t');
|
|
|
+ // Condicion de venta
|
|
|
+ datos.push(condicion);
|
|
|
+ datos.push('\t');
|
|
|
+ // Cantidad de cuotas
|
|
|
+ datos.push(cuota);
|
|
|
+ datos.push('\t');
|
|
|
+ // Numero de timbrado
|
|
|
+ datos.push(invoice.number);
|
|
|
+ datos.push('\r\n');
|
|
|
+
|
|
|
+ cantidad += 1;
|
|
|
+ ingreso += total;
|
|
|
+ });
|
|
|
+ datos.splice(22,0);
|
|
|
+ datos[22] = cantidad;
|
|
|
+ datos.splice(24,0);
|
|
|
+ datos[24] = ingreso;
|
|
|
+ self.newCabecera = new Blob(datos, {type: 'text/plain'});
|
|
|
+ },
|
|
|
+
|
|
|
+ // Buscar
|
|
|
+ factSearch: function(){
|
|
|
+ var self = this;
|
|
|
+ var period =this.$el.find('#current-period').val();
|
|
|
+ var newInvoice = self.newInvoice;
|
|
|
+ // Buscar por Periodo
|
|
|
+ if (period != 9999999){
|
|
|
+ newInvoice=_.filter(newInvoice, function (inv){
|
|
|
+ return inv.period_id == period;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ self.loadTable(newInvoice)
|
|
|
+ },
|
|
|
+ // cargara la tabla
|
|
|
+ loadTable:function(rowsTable){
|
|
|
+ var self = this;
|
|
|
+ self.rowsData = rowsTable;
|
|
|
+ var table = this.$el.find('#table');
|
|
|
+ table.bootstrapTable('load',rowsTable);
|
|
|
+ },
|
|
|
+
|
|
|
+ // Descarga el archivo en formato txt
|
|
|
+ descargarArchivo: function(contenidoEnBlob, nombreArchivo) {
|
|
|
+ var self = this;
|
|
|
+ var reader = new FileReader();
|
|
|
+ reader.onload = function (event) {
|
|
|
+ var save = document.createElement('a');
|
|
|
+ save.href = event.target.result;
|
|
|
+ save.target = '_blank';
|
|
|
+ save.download = nombreArchivo || 'archivo.dat';
|
|
|
+ var clicEvent = new MouseEvent('click', {
|
|
|
+ 'view': window,
|
|
|
+ 'bubbles': true,
|
|
|
+ 'cancelable': true
|
|
|
+ });
|
|
|
+ save.dispatchEvent(clicEvent);
|
|
|
+ (window.URL || window.webkitURL).revokeObjectURL(save.href);
|
|
|
+ };
|
|
|
+ reader.readAsDataURL(contenidoEnBlob);
|
|
|
+ },
|
|
|
+
|
|
|
+ // Genera el archivo txt, con el nombre correspondiente
|
|
|
+ generarTxt: function () {
|
|
|
+ var self = this;
|
|
|
+ var periodo = self.newInvoice[0].period_name.split("/");
|
|
|
+ var fileName = "Ventas " + periodo[1] + periodo[0];
|
|
|
+ self.descargarArchivo(self.newCabecera, fileName);
|
|
|
+ },
|
|
|
+ });
|
|
|
+}
|