Commit 63dcfc5475dd72aa100d5997a7e6b3ef8217d100
1 parent
0b52379723
Exists in
master
and in
1 other branch
Auto stash before merge of "master" and "upstream/develop"
Showing
2 changed files
with
32 additions
and
34 deletions
Show diff stats
package.json
... | ... | @@ -28,10 +28,7 @@ |
28 | 28 | "foca-modal-cotizacion": "git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git", |
29 | 29 | "foca-modal-domicilio": "git+http://git.focasoftware.com/npm/foca-modal-domicilio.git", |
30 | 30 | "foca-modal-flete": "git+http://git.focasoftware.com/npm/foca-modal-flete.git", |
31 | - "foca-modal-moneda": "git+http://git.focasoftware.com/npm/foca-modal-moneda.git", | |
32 | 31 | "foca-modal-precio-condiciones": "git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git", |
33 | - "foca-modal-proveedor": "git+http://git.focasoftware.com/npm/foca-modal-proveedor.git", | |
34 | - "foca-modal-vendedores": "git+http://git.focasoftware.com/npm/foca-modal-vendedores.git", | |
35 | 32 | "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git" |
36 | 33 | }, |
37 | 34 | "devDependencies": { |
... | ... | @@ -47,10 +44,7 @@ |
47 | 44 | "foca-modal-cotizacion": "git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git", |
48 | 45 | "foca-modal-domicilio": "git+http://git.focasoftware.com/npm/foca-modal-domicilio.git", |
49 | 46 | "foca-modal-flete": "git+http://git.focasoftware.com/npm/foca-modal-flete.git", |
50 | - "foca-modal-moneda": "git+http://git.focasoftware.com/npm/foca-modal-moneda.git", | |
51 | 47 | "foca-modal-precio-condiciones": "git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git", |
52 | - "foca-modal-proveedor": "git+http://git.focasoftware.com/npm/foca-modal-proveedor.git", | |
53 | - "foca-modal-vendedores": "git+http://git.focasoftware.com/npm/foca-modal-vendedores.git", | |
54 | 48 | "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git", |
55 | 49 | "font-awesome": "^4.7.0", |
56 | 50 | "gulp": "^3.9.1", |
src/js/controller.js
... | ... | @@ -232,7 +232,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
232 | 232 | resolve: { |
233 | 233 | usadoPor: function() {return 'notaPedido';}, |
234 | 234 | idVendedor: function() { |
235 | - if(APP === 'distribuidor') | |
235 | + if (APP === 'distribuidor') | |
236 | 236 | return $scope.notaPedido.vendedor.id; |
237 | 237 | else |
238 | 238 | return null; |
... | ... | @@ -299,10 +299,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
299 | 299 | }; |
300 | 300 | |
301 | 301 | $scope.seleccionarPuntosDeDescarga = function() { |
302 | - if(!$scope.notaPedido.cliente.COD || !$scope.notaPedido.domicilio.id) { | |
302 | + if (!$scope.notaPedido.cliente.COD || !$scope.notaPedido.domicilio.id) { | |
303 | 303 | focaModalService.alert('Primero seleccione un cliente y un domicilio'); |
304 | 304 | return; |
305 | - }else { | |
305 | + } else { | |
306 | 306 | var modalInstance = $uibModal.open( |
307 | 307 | { |
308 | 308 | ariaLabelledBy: 'Búsqueda de Puntos de descarga', |
... | ... | @@ -327,7 +327,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
327 | 327 | var puntosStamp = ''; |
328 | 328 | puntosDescarga.forEach(function(punto, idx, arr) { |
329 | 329 | puntosStamp += punto.descripcion; |
330 | - if((idx + 1) !== arr.length) puntosStamp += ', '; | |
330 | + if ((idx + 1) !== arr.length) puntosStamp += ', '; | |
331 | 331 | }); |
332 | 332 | |
333 | 333 | $scope.$broadcast('addCabecera', { |
... | ... | @@ -413,7 +413,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
413 | 413 | }; |
414 | 414 | |
415 | 415 | $scope.seleccionarProveedor = function() { |
416 | - if(validarNotaRemitada()) { | |
416 | + if (validarNotaRemitada()) { | |
417 | 417 | var parametrosModal = { |
418 | 418 | titulo: 'Búsqueda de Proveedor', |
419 | 419 | query: '/proveedor', |
... | ... | @@ -497,7 +497,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
497 | 497 | crearNotaPedidoService |
498 | 498 | .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) |
499 | 499 | .then(function(res) { |
500 | - if(res.data.length) $scope.seleccionarPuntosDeDescarga(); | |
500 | + if (res.data.length) $scope.seleccionarPuntosDeDescarga(); | |
501 | 501 | }); |
502 | 502 | } |
503 | 503 | }, function() { |
... | ... | @@ -520,13 +520,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
520 | 520 | }; |
521 | 521 | |
522 | 522 | $scope.getSubTotal = function() { |
523 | - if($scope.articuloACargar) { | |
523 | + if ($scope.articuloACargar) { | |
524 | 524 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
525 | 525 | } |
526 | 526 | }; |
527 | 527 | |
528 | 528 | $scope.seleccionarPreciosYCondiciones = function() { |
529 | - if(validarNotaRemitada()) { | |
529 | + if (validarNotaRemitada()) { | |
530 | 530 | var modalInstance = $uibModal.open( |
531 | 531 | { |
532 | 532 | ariaLabelledBy: 'Busqueda de Precio Condición', |
... | ... | @@ -539,12 +539,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
539 | 539 | function(precioCondicion) { |
540 | 540 | var cabecera = ''; |
541 | 541 | var plazosConcat = ''; |
542 | - if(!Array.isArray(precioCondicion)) { | |
542 | + if (!Array.isArray(precioCondicion)) { | |
543 | 543 | $scope.notaPedido.notaPedidoPlazo = precioCondicion.plazoPago; |
544 | 544 | $scope.notaPedido.precioCondicion = precioCondicion; |
545 | 545 | $scope.notaPedido.idPrecioCondicion = precioCondicion.id; |
546 | 546 | $scope.idLista = precioCondicion.idListaPrecio; |
547 | - for(var i = 0; i < precioCondicion.plazoPago.length; i++) { | |
547 | + for (var i = 0; i < precioCondicion.plazoPago.length; i++) { | |
548 | 548 | plazosConcat += precioCondicion.plazoPago[i].dias + ' '; |
549 | 549 | } |
550 | 550 | cabecera = $filter('rellenarDigitos')(precioCondicion.id, 4) + |
... | ... | @@ -554,7 +554,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
554 | 554 | //-1, el modal productos busca todos los productos |
555 | 555 | $scope.idLista = -1; |
556 | 556 | $scope.notaPedido.notaPedidoPlazo = precioCondicion; |
557 | - for(var j = 0; j < precioCondicion.length; j++) { | |
557 | + for (var j = 0; j < precioCondicion.length; j++) { | |
558 | 558 | plazosConcat += precioCondicion[j].dias + ' '; |
559 | 559 | } |
560 | 560 | cabecera = 'Ingreso manual ' + plazosConcat.trim(); |
... | ... | @@ -572,7 +572,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
572 | 572 | }; |
573 | 573 | |
574 | 574 | $scope.seleccionarFlete = function() { |
575 | - if(validarNotaRemitada()) { | |
575 | + if (validarNotaRemitada()) { | |
576 | 576 | var modalInstance = $uibModal.open( |
577 | 577 | { |
578 | 578 | ariaLabelledBy: 'Busqueda de Flete', |
... | ... | @@ -606,7 +606,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
606 | 606 | label: 'Flete:', |
607 | 607 | valor: datos.FOB ? 'FOB' : (datos.flete ? 'Si' : 'No') |
608 | 608 | }); |
609 | - if(datos.flete) { | |
609 | + if (datos.flete) { | |
610 | 610 | $scope.$broadcast('addCabecera', { |
611 | 611 | label: 'Bomba:', |
612 | 612 | valor: datos.bomba ? 'Si' : 'No' |
... | ... | @@ -629,7 +629,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
629 | 629 | }; |
630 | 630 | |
631 | 631 | $scope.seleccionarMoneda = function() { |
632 | - if(validarNotaRemitada()) { | |
632 | + if (validarNotaRemitada()) { | |
633 | 633 | var parametrosModal = { |
634 | 634 | titulo: 'Búsqueda de monedas', |
635 | 635 | query: '/moneda', |
... | ... | @@ -684,7 +684,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
684 | 684 | modalInstance.result.then( |
685 | 685 | function(cotizacion) { |
686 | 686 | var articulosTablaTemp = $scope.notaPedido.articulosNotaPedido || []; |
687 | - for(var i = 0; i < articulosTablaTemp.length; i++) { | |
687 | + for (var i = 0; i < articulosTablaTemp.length; i++) { | |
688 | 688 | articulosTablaTemp[i].precio = articulosTablaTemp[i].precio * |
689 | 689 | $scope.notaPedido.cotizacion.VENDEDOR; |
690 | 690 | articulosTablaTemp[i].precio = articulosTablaTemp[i].precio / |
... | ... | @@ -693,7 +693,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
693 | 693 | $scope.notaPedido.articulosNotaPedido = articulosTablaTemp; |
694 | 694 | $scope.notaPedido.cotizacion = cotizacion; |
695 | 695 | $scope.notaPedido.cotizacion.moneda = moneda; |
696 | - if(moneda.DETALLE === 'PESOS ARGENTINOS') { | |
696 | + if (moneda.DETALLE === 'PESOS ARGENTINOS') { | |
697 | 697 | $scope.$broadcast('removeCabecera', 'Moneda:'); |
698 | 698 | $scope.$broadcast('removeCabecera', 'Fecha cotizacion:'); |
699 | 699 | $scope.$broadcast('removeCabecera', 'Cotizacion:'); |
... | ... | @@ -718,8 +718,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
718 | 718 | }; |
719 | 719 | |
720 | 720 | $scope.agregarATabla = function(key) { |
721 | - if(key === 13) { | |
722 | - if($scope.articuloACargar.cantidad === undefined || | |
721 | + if (key === 13) { | |
722 | + if ($scope.articuloACargar.cantidad === undefined || | |
723 | 723 | $scope.articuloACargar.cantidad === 0 || |
724 | 724 | $scope.articuloACargar.cantidad === null ) { |
725 | 725 | focaModalService.alert('El valor debe ser al menos 1'); |
... | ... | @@ -736,8 +736,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
736 | 736 | }; |
737 | 737 | |
738 | 738 | $scope.editarArticulo = function(key, articulo) { |
739 | - if(key === 13) { | |
740 | - if(articulo.cantidad === null || articulo.cantidad === 0 || | |
739 | + if (key === 13) { | |
740 | + if (articulo.cantidad === null || articulo.cantidad === 0 || | |
741 | 741 | articulo.cantidad === undefined) { |
742 | 742 | focaModalService.alert('El valor debe ser al menos 1'); |
743 | 743 | return; |
... | ... | @@ -748,9 +748,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
748 | 748 | }; |
749 | 749 | |
750 | 750 | $scope.cambioEdit = function(articulo, propiedad) { |
751 | - if(propiedad === 'cantidad') { | |
751 | + if (propiedad === 'cantidad') { | |
752 | 752 | articulo.editCantidad = true; |
753 | - } else if(propiedad === 'precio') { | |
753 | + } else if (propiedad === 'precio') { | |
754 | 754 | articulo.editPrecio = true; |
755 | 755 | } |
756 | 756 | }; |
... | ... | @@ -761,7 +761,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
761 | 761 | }; |
762 | 762 | //Recibe aviso si el teclado está en uso |
763 | 763 | $rootScope.$on('usarTeclado', function(event, data) { |
764 | - if(data) { | |
764 | + if (data) { | |
765 | 765 | $scope.mostrarTeclado = true; |
766 | 766 | return; |
767 | 767 | } |
... | ... | @@ -770,7 +770,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
770 | 770 | |
771 | 771 | $scope.selectFocus = function($event) { |
772 | 772 | // Si el teclado esta en uso no selecciona el valor |
773 | - if($scope.mostrarTeclado) { | |
773 | + if ($scope.mostrarTeclado) { | |
774 | 774 | return; |
775 | 775 | } |
776 | 776 | $event.target.select(); |
... | ... | @@ -809,6 +809,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
809 | 809 | '2') |
810 | 810 | }); |
811 | 811 | } |
812 | + | |
812 | 813 | if (notaPedido.cliente.COD) { |
813 | 814 | cabeceras.push({ |
814 | 815 | label: 'Cliente:', |
... | ... | @@ -819,6 +820,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
819 | 820 | valor: notaPedido.domicilioStamp |
820 | 821 | }); |
821 | 822 | } |
823 | + | |
822 | 824 | if (notaPedido.vendedor.NUM) { |
823 | 825 | cabeceras.push({ |
824 | 826 | label: 'Vendedor:', |
... | ... | @@ -826,6 +828,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
826 | 828 | ' - ' + notaPedido.vendedor.NOM |
827 | 829 | }); |
828 | 830 | } |
831 | + | |
829 | 832 | if (notaPedido.proveedor.COD) { |
830 | 833 | cabeceras.push({ |
831 | 834 | label: 'Proveedor:', |
... | ... | @@ -833,6 +836,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
833 | 836 | ' - ' + notaPedido.proveedor.NOM |
834 | 837 | }); |
835 | 838 | } |
839 | + | |
836 | 840 | if (notaPedido.notaPedidoPlazo.length) { |
837 | 841 | cabeceras.push({ |
838 | 842 | label: 'Precios y condiciones:', |
... | ... | @@ -841,6 +845,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
841 | 845 | .plazoToString(notaPedido.notaPedidoPlazo) |
842 | 846 | }); |
843 | 847 | } |
848 | + | |
844 | 849 | if (notaPedido.flete !== undefined) { |
845 | 850 | cabeceras.push({ |
846 | 851 | label: 'Flete:', |
... | ... | @@ -849,7 +854,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
849 | 854 | }); |
850 | 855 | } |
851 | 856 | |
852 | - | |
853 | 857 | function valorPrecioCondicion() { |
854 | 858 | if (notaPedido.idPrecioCondicion > 0) { |
855 | 859 | return notaPedido.precioCondicion.nombre; |
... | ... | @@ -896,7 +900,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
896 | 900 | } |
897 | 901 | |
898 | 902 | function addArrayCabecera(array) { |
899 | - for(var i = 0; i < array.length; i++) { | |
903 | + for (var i = 0; i < array.length; i++) { | |
900 | 904 | $scope.$broadcast('addCabecera', { |
901 | 905 | label: array[i].label, |
902 | 906 | valor: array[i].valor |
... | ... | @@ -905,9 +909,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
905 | 909 | } |
906 | 910 | |
907 | 911 | function validarNotaRemitada() { |
908 | - if(!$scope.notaPedido.idRemito) { | |
912 | + if (!$scope.notaPedido.idRemito) { | |
909 | 913 | return true; |
910 | - }else{ | |
914 | + } else { | |
911 | 915 | focaModalService.alert('No se puede editar una nota de pedido remitada'); |
912 | 916 | return false; |
913 | 917 | } |