diff --git a/src/js/controller.js b/src/js/controller.js index f6abd68..7f4df2d 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -1,4 +1,4 @@ -angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', +angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', [ '$scope', '$uibModal', @@ -14,11 +14,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', 'APP', 'focaLoginService', '$localStorage', - function( + function ( $scope, $uibModal, $location, $filter, $timeout, crearNotaPedidoService, focaBotoneraLateralService, focaModalService, notaPedidoBusinessService, - $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) - { + $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) { config(); var cotizacionPArgentino = {}; @@ -38,9 +37,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', maxDate: new Date(), minDate: new Date(2010, 0, 1) }; - + //SETEO BOTONERA LATERAL - $timeout(function() { + $timeout(function () { focaBotoneraLateralService.showSalir(false); focaBotoneraLateralService.showPausar(true); focaBotoneraLateralService.showGuardar(true, $scope.crearNotaPedido); @@ -52,10 +51,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.idVendedor = focaLoginService.getLoginData().vendedorCobrador; } - crearNotaPedidoService.getParametros().then(function(res) { + crearNotaPedidoService.getParametros().then(function (res) { var parametros = JSON.parse(res.data[0].jsonText); if ($localStorage.notaPedido) { - $timeout(function() { getLSNotaPedido();} ); + $timeout(function () { getLSNotaPedido(); }); } else { for (var property in parametros) { $scope.notaPedido[property] = parametros[property]; @@ -76,7 +75,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', id: 0, cliente: {}, proveedor: {}, - domicilio: {dom: ''}, + domicilio: { dom: '' }, vendedor: {}, fechaCarga: new Date(), cotizacion: {}, @@ -87,16 +86,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.idLista = undefined; crearNotaPedidoService.getNumeroNotaPedido().then( - function(res) { + function (res) { $scope.puntoVenta = $filter('rellenarDigitos')( res.data.sucursal, 4 ); - + $scope.comprobante = $filter('rellenarDigitos')( res.data.numeroNotaPedido, 8 ); }, - function(err) { + function (err) { focaModalService.alert('La terminal no esta configurada correctamente'); console.info(err); } @@ -104,7 +103,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', if (APP === 'distribuidor') { crearNotaPedidoService.getVendedorById($scope.idVendedor).then( - function(res) { + function (res) { var vendedor = res.data; $scope.$broadcast('addCabecera', { label: 'Vendedor:', @@ -121,14 +120,14 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.inicial = angular.copy($scope.notaPedido); } - $scope.$watch('notaPedido', function(newValue) { + $scope.$watch('notaPedido', function (newValue) { focaBotoneraLateralService.setPausarData({ label: 'notaPedido', val: newValue }); }, true); - $scope.crearNotaPedido = function() { + $scope.crearNotaPedido = function () { if (!$scope.notaPedido.cliente.COD) { focaModalService.alert('Ingrese Cliente'); return; @@ -148,8 +147,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', focaModalService.alert('Ingrese Precios y Condiciones'); return; } else if ( - $scope.notaPedido.flete === undefined || $scope.notaPedido.flete === null) - { + $scope.notaPedido.flete === undefined || $scope.notaPedido.flete === null) { focaModalService.alert('Ingrese Flete'); return; } else if (!$scope.notaPedido.domicilioStamp) {//TODO validar domicilio correcto @@ -185,7 +183,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', total: $scope.getTotal() }; crearNotaPedidoService.crearNotaPedido(notaPedido).then( - function(data) { + function (data) { // Al guardar los datos de la nota de pedido logueamos la // actividad para su seguimiento. //TODO: GUARDAR POSISIONAMIENTO AL EDITAR? @@ -205,7 +203,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', var plazos = $scope.notaPedido.notaPedidoPlazo; var plazosACrear = []; - plazos.forEach(function(plazo) { + plazos.forEach(function (plazo) { plazosACrear.push({ idNotaPedido: data.data.id, dias: plazo.dias @@ -223,7 +221,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.saveLoading = false; config(); - }, function(error) { + }, function (error) { focaModalService.alert('Hubo un error al crear la nota de pedido'); focaBotoneraLateralService.endGuardar(); $scope.saveLoading = false; @@ -231,7 +229,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }); }; - $scope.seleccionarNotaPedido = function() { + $scope.seleccionarNotaPedido = function () { var modalInstance = $uibModal.open( { ariaLabelledBy: 'Busqueda de Nota de Pedido', @@ -239,8 +237,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', controller: 'focaModalNotaPedidoController', size: 'lg', resolve: { - usadoPor: function() {return 'notaPedido';}, - idVendedor: function() { + usadoPor: function () { return 'notaPedido'; }, + idVendedor: function () { if (APP === 'distribuidor') return $scope.notaPedido.vendedor.id; else @@ -252,7 +250,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', modalInstance.result.then(setearNotaPedido); }; - $scope.seleccionarProductos = function() { + $scope.seleccionarProductos = function () { if ($scope.idLista === undefined) { focaModalService.alert( @@ -278,7 +276,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } ); modalInstance.result.then( - function(producto) { + function (producto) { var newArt = { id: 0, @@ -296,7 +294,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', ivaUnitario: producto.IMPIVA, impuestoInternoUnitario: producto.ImpInt, impuestoInterno1Unitario: producto.ImpInt2, - impuestoInterno2Unitario: producto.ImpInt3, + impuestoInterno2Unitario: producto.ImpInt3, precioLista: producto.precio, combustible: 1, facturado: 0, @@ -309,13 +307,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.articuloACargar = newArt; $scope.cargando = false; - }, function() { + }, function () { // funcion ejecutada cuando se cancela el modal } ); }; - $scope.seleccionarPuntosDeDescarga = function() { + $scope.seleccionarPuntosDeDescarga = function () { if (!$scope.notaPedido.cliente.COD || !$scope.notaPedido.domicilio.id) { focaModalService.alert('Primero seleccione un cliente y un domicilio'); return; @@ -338,9 +336,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } ); modalInstance.result.then( - function(puntoDescarga) { + function (puntoDescarga) { - puntoDescarga.forEach(function(punto) { + puntoDescarga.forEach(function (punto) { $scope.notaPedido.notaPedidoPuntoDescarga.push( { puntoDescarga: punto @@ -352,15 +350,15 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', label: 'Puntos de descarga:', valor: getCabeceraPuntoDescarga(puntoDescarga) }); - }, function() { + }, function () { $scope.abrirModalDomicilios($scope.cliente); } ); } }; - $scope.seleccionarProveedor = function() { - $scope.abrirModalProveedores(function() { + $scope.seleccionarProveedor = function () { + $scope.abrirModalProveedores(function () { if (validarNotaRemitada()) { var modalInstance = $uibModal.open( { @@ -370,12 +368,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', size: 'lg', resolve: { parametrosFlete: - function() { + function () { return { flete: $scope.notaPedido.fob ? 'FOB' : - ( $scope.notaPedido.flete ? '1' : - ($scope.notaPedido.flete === undefined ? - null : '0')), + ($scope.notaPedido.flete ? '1' : + ($scope.notaPedido.flete === undefined ? + null : '0')), bomba: $scope.notaPedido.bomba ? '1' : ($scope.notaPedido.bomba === undefined ? null : '0'), @@ -386,7 +384,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } ); modalInstance.result.then( - function(datos) { + function (datos) { $scope.notaPedido.flete = datos.flete; $scope.notaPedido.fob = datos.FOB; $scope.notaPedido.bomba = datos.bomba; @@ -412,8 +410,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } $filter('filter')($scope.botonera, - { label: 'Proveedor'})[0].checked = true; - }, function() { + { label: 'Proveedor' })[0].checked = true; + }, function () { $scope.seleccionarTransportista(); } ); @@ -421,7 +419,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }); }; - $scope.seleccionarVendedor = function(callback, ocultarVendedor) { + $scope.seleccionarVendedor = function (callback, ocultarVendedor) { if (APP === 'distribuidor' || ocultarVendedor) { callback(); return; @@ -448,7 +446,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', size: 'md' }; focaModalService.modal(parametrosModal).then( - function(vendedor) { + function (vendedor) { $scope.$broadcast('addCabecera', { label: 'Vendedor:', valor: $filter('rellenarDigitos')(vendedor.NUM, 3) + ' - ' + @@ -457,13 +455,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.notaPedido.vendedor = vendedor; deleteCliente(); callback(); - }, function() {} + }, function () { } ); } }; - $scope.seleccionarCliente = function(ocultarVendedor) { - $scope.seleccionarVendedor(function() { + $scope.seleccionarCliente = function (ocultarVendedor) { + $scope.seleccionarVendedor(function () { if (validarNotaRemitada()) { var modalInstance = $uibModal.open( { @@ -471,17 +469,17 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', templateUrl: 'foca-busqueda-cliente-modal.html', controller: 'focaBusquedaClienteModalController', resolve: { - vendedor: function() { return $scope.notaPedido.vendedor; }, - cobrador: function() { return null; } + vendedor: function () { return null; }, + cobrador: function () { return null; } }, size: 'lg' } ); modalInstance.result.then( - function(cliente) { + function (cliente) { $scope.abrirModalDomicilios(cliente); $scope.cliente = cliente; - }, function() { + }, function () { if (APP !== 'distribuidor') $scope.seleccionarCliente(); } ); @@ -489,7 +487,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }, ocultarVendedor); }; - $scope.abrirModalProveedores = function(callback) { + $scope.abrirModalProveedores = function (callback) { if (validarNotaRemitada()) { var parametrosModal = { titulo: 'Búsqueda de Proveedor', @@ -513,10 +511,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } ], tipo: 'POST', - json: {razonCuitCod: ''} + json: { razonCuitCod: '' } }; focaModalService.modal(parametrosModal).then( - function(proveedor) { + function (proveedor) { $scope.notaPedido.proveedor = proveedor; $scope.$broadcast('addCabecera', { label: 'Proveedor:', @@ -524,28 +522,28 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', proveedor.NOM }); callback(); - }, function() { + }, function () { } ); } }; - $scope.abrirModalDomicilios = function(cliente) { + $scope.abrirModalDomicilios = function (cliente) { var modalInstanceDomicilio = $uibModal.open( { ariaLabelledBy: 'Busqueda de Domicilios', templateUrl: 'modal-domicilio.html', controller: 'focaModalDomicilioController', - resolve: { - idCliente: function() { return cliente.cod; }, - esNuevo: function() { return cliente.esNuevo; } + resolve: { + idCliente: function () { return cliente.cod; }, + esNuevo: function () { return cliente.esNuevo; } }, size: 'lg', } ); modalInstanceDomicilio.result.then( - function(domicilio) { + function (domicilio) { $scope.notaPedido.domicilio = domicilio; $scope.notaPedido.cliente = { COD: cliente.cod, @@ -553,8 +551,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', NOM: cliente.nom, MOD: cliente.mod }; - var domicilioStamp = - domicilio.Calle + ' ' + domicilio.Numero + ', ' + + var domicilioStamp = + domicilio.Calle + ' ' + domicilio.Numero + ', ' + domicilio.Localidad + ', ' + domicilio.Provincia; $scope.notaPedido.domicilioStamp = domicilioStamp; @@ -574,16 +572,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } // Seteo checked en botonera - $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = true; + $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = true; - }, function() { + }, function () { $scope.seleccionarCliente(true); return; } ); }; - $scope.getTotal = function() { + $scope.getTotal = function () { var total = 0; if ($scope.notaPedido.articulosNotaPedido) { var arrayTempArticulos = $scope.notaPedido.articulosNotaPedido; @@ -594,13 +592,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', return parseFloat(total.toFixed(2)); }; - $scope.getSubTotal = function() { + $scope.getSubTotal = function () { if ($scope.articuloACargar) { return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; } }; - $scope.seleccionarPreciosYCondiciones = function() { + $scope.seleccionarPreciosYCondiciones = function () { if (!validarNotaRemitada()) { return; @@ -611,12 +609,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', return; } if ($scope.notaPedido.articulosNotaPedido.length !== 0) { - focaModalService.confirm('Se perderan los productos ingresados') - .then(function(data) { - if (data) { - abrirModal(); - } - }); + focaModalService.confirm('Se perderan los productos ingresados') + .then(function (data) { + if (data) { + abrirModal(); + } + }); } else if (validarNotaRemitada()) { abrirModal(); } @@ -628,7 +626,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', controller: 'focaModalPrecioCondicionController', size: 'lg', resolve: { - idListaPrecio: function() { + idListaPrecio: function () { return $scope.notaPedido.cliente.MOD || null; } } @@ -636,7 +634,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', ); modalInstance.result.then( - function(precioCondicion) { + function (precioCondicion) { var cabecera = ''; var plazosConcat = ''; if (!Array.isArray(precioCondicion)) { @@ -652,7 +650,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } else { //Cuando se ingresan los plazos manualmente $scope.notaPedido.idPrecioCondicion = 0; //-1, el modal productos busca todos los productos - $scope.idLista = -1; + $scope.idLista = -1; $scope.notaPedido.notaPedidoPlazo = precioCondicion; for (var j = 0; j < precioCondicion.length; j++) { plazosConcat += precioCondicion[j].dias + ' '; @@ -666,15 +664,15 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }); $filter('filter')($scope.botonera, - { label: 'Precios y Condiciones'})[0].checked = true; - }, function() { + { label: 'Precios y Condiciones' })[0].checked = true; + }, function () { } ); } }; - $scope.seleccionarMoneda = function() { + $scope.seleccionarMoneda = function () { if (validarNotaRemitada()) { var parametrosModal = { titulo: 'Búsqueda de monedas', @@ -692,7 +690,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', size: 'md' }; focaModalService.modal(parametrosModal).then( - function(moneda) { + function (moneda) { if (moneda.ID !== 1) { $scope.abrirModalCotizacion(moneda); @@ -713,7 +711,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } }; - $scope.seleccionarObservaciones = function() { + $scope.seleccionarObservaciones = function () { var observacion = { titulo: 'Ingrese Observaciones', value: $scope.notaPedido.observaciones, @@ -723,12 +721,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', focaModalService .prompt(observacion) - .then(function(observaciones) { + .then(function (observaciones) { $scope.notaPedido.observaciones = observaciones; }); }; - $scope.abrirModalCotizacion = function(moneda) { + $scope.abrirModalCotizacion = function (moneda) { var modalInstance = $uibModal.open( { ariaLabelledBy: 'Busqueda de Cotización', @@ -736,29 +734,29 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', controller: 'focaModalCotizacionController', size: 'lg', resolve: { - idMoneda: function() { + idMoneda: function () { return moneda.ID; } } } ); modalInstance.result.then( - function(cotizacion) { + function (cotizacion) { cotizacion.moneda = moneda; actualizarCabeceraMoneda(cotizacion); $scope.notaPedido.cotizacion = cotizacion; - $filter('filter')($scope.botonera, { label: 'Moneda'})[0].checked = true; - }, function() { + $filter('filter')($scope.botonera, { label: 'Moneda' })[0].checked = true; + }, function () { } ); }; - function actualizarCabeceraMoneda (cotizacion) { + function actualizarCabeceraMoneda(cotizacion) { - $scope.notaPedido.articulosNotaPedido.forEach(function(art) { + $scope.notaPedido.articulosNotaPedido.forEach(function (art) { art.precio = (art.precio * $scope.notaPedido.cotizacion.VENDEDOR).toFixed(4); art.precio = (art.precio / cotizacion.VENDEDOR).toFixed(4); }); @@ -783,13 +781,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } } - $scope.agregarATabla = function(key) { + $scope.agregarATabla = function (key) { if (key === 13) { if ($scope.articuloACargar.cantidad === undefined || $scope.articuloACargar.cantidad === 0 || - $scope.articuloACargar.cantidad === null ) { - focaModalService.alert('El valor debe ser al menos 1'); - return; + $scope.articuloACargar.cantidad === null) { + focaModalService.alert('El valor debe ser al menos 1'); + return; } delete $scope.articuloACargar.sectorCodigo; $scope.notaPedido.articulosNotaPedido.push($scope.articuloACargar); @@ -797,13 +795,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } }; - $scope.quitarArticulo = function(key) { + $scope.quitarArticulo = function (key) { if (validarNotaRemitada()) { $scope.notaPedido.articulosNotaPedido.splice(key, 1); } }; - $scope.editarArticulo = function(key, articulo, tmpCantidad, tmpPrecio) { + $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) { if (key === 13) { if (!articulo.cantidad || !articulo.precio) { focaModalService.alert('Los valores deben ser al menos 1'); @@ -819,13 +817,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } }; - $scope.cancelarEditar = function(articulo) { + $scope.cancelarEditar = function (articulo) { $scope.tmpCantidad = articulo.cantidad; $scope.tmpPrecio = articulo.precio; articulo.editCantidad = articulo.editPrecio = false; }; - $scope.cambioEdit = function(articulo, propiedad) { + $scope.cambioEdit = function (articulo, propiedad) { if (propiedad === 'cantidad') { articulo.editCantidad = true; } else if (propiedad === 'precio') { @@ -833,12 +831,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } }; - $scope.resetFilter = function() { + $scope.resetFilter = function () { $scope.articuloACargar = {}; $scope.cargando = true; }; //Recibe aviso si el teclado está en uso - $rootScope.$on('usarTeclado', function(event, data) { + $rootScope.$on('usarTeclado', function (event, data) { if (data) { $scope.mostrarTeclado = true; return; @@ -846,7 +844,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $scope.mostrarTeclado = false; }); - $scope.selectFocus = function($event) { + $scope.selectFocus = function ($event) { // Si el teclado esta en uso no selecciona el valor if ($scope.mostrarTeclado) { return; @@ -854,23 +852,23 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $event.target.select(); }; - $scope.salir = function() { + $scope.salir = function () { $location.path('/'); }; - $scope.parsearATexto = function(articulo) { + $scope.parsearATexto = function (articulo) { articulo.cantidad = parseFloat(articulo.cantidad); articulo.precio = parseFloat(articulo.precio); }; // TODO: quitar watch usar función de articulos pedido cuando se haga - $scope.$watch('notaPedido.articulosNotaPedido', function() { + $scope.$watch('notaPedido.articulosNotaPedido', function () { if ($scope.notaPedido.articulosNotaPedido.length) { $filter('filter')($scope.botonera, - { label: 'Productos'})[0].checked = true; + { label: 'Productos' })[0].checked = true; } else { $filter('filter')($scope.botonera, - { label: 'Productos'})[0].checked = false; + { label: 'Productos' })[0].checked = false; } }, true); @@ -906,7 +904,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } if (notaPedido.cotizacion.moneda) { - $filter('filter')($scope.botonera, { label: 'Moneda'})[0].checked = true; + $filter('filter')($scope.botonera, { label: 'Moneda' })[0].checked = true; } if (notaPedido.vendedor.NUM) { @@ -927,7 +925,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', valor: notaPedido.domicilioStamp }); - $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = true; + $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = true; } if (notaPedido.proveedor.COD) { @@ -937,7 +935,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', ' - ' + notaPedido.proveedor.NOM }); - $filter('filter')($scope.botonera, { label: 'Proveedor'})[0].checked = true; + $filter('filter')($scope.botonera, { label: 'Proveedor' })[0].checked = true; } if (notaPedido.notaPedidoPlazo.length) { @@ -949,7 +947,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }); $filter('filter')($scope.botonera, - { label: 'Precios y condiciones'})[0].checked = true; + { label: 'Precios y condiciones' })[0].checked = true; } if (notaPedido.flete !== undefined) { @@ -999,7 +997,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', if (notaPedido.notaPedidoPuntoDescarga.length) { var puntos = []; - notaPedido.notaPedidoPuntoDescarga.forEach(function(notaPedidoPuntoDescarga) { + notaPedido.notaPedidoPuntoDescarga.forEach(function (notaPedidoPuntoDescarga) { puntos.push(notaPedidoPuntoDescarga.puntoDescarga); }); cabeceras.push({ @@ -1020,7 +1018,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', function getCabeceraPuntoDescarga(puntoDescarga) { var puntosStamp = ''; - puntoDescarga.forEach(function(punto, idx, arr) { + puntoDescarga.forEach(function (punto, idx, arr) { puntosStamp += punto.descripcion; if ((idx + 1) !== arr.length) puntosStamp += ', '; }); @@ -1055,7 +1053,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', if (confirmacion) { focaModalService.confirm( '¿Está seguro de que desea salir? Se perderán todos los datos cargados.' - ).then(function(data) { + ).then(function (data) { if (data) { $location.path('/'); } @@ -1076,12 +1074,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', function deleteCliente() { $scope.notaPedido.domicilioStamp = ''; $scope.notaPedido.notaPedidoPuntoDescarga = []; - $scope.notaPedido.domicilio = {dom: ''}; + $scope.notaPedido.domicilio = { dom: '' }; $scope.notaPedido.cliente = {}; $scope.$broadcast('removeCabecera', 'Cliente:'); $scope.$broadcast('removeCabecera', 'Domicilio:'); $scope.$broadcast('removeCabecera', 'Puntos de descarga:'); - $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = false; + $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = false; } } ]);