Commit 63cd9dcc69410d08a678cb23210828714afd10b6
1 parent
033b78dab5
Exists in
master
and in
1 other branch
boton checked
Showing
1 changed file
with
36 additions
and
1 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -398,6 +398,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
398 | 398 | $scope.notaPedido.bomba = false; |
399 | 399 | $scope.notaPedido.kilometros = null; |
400 | 400 | } |
401 | + | |
402 | + $filter('filter')($scope.botonera, | |
403 | + { label: 'Proveedor'})[0].checked = true; | |
401 | 404 | }, function() { |
402 | 405 | $scope.seleccionarTransportista(); |
403 | 406 | } |
... | ... | @@ -549,10 +552,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
549 | 552 | label: 'Cliente:', |
550 | 553 | valor: $filter('rellenarDigitos')(cliente.cod, 5) + ' - ' + cliente.nom |
551 | 554 | }); |
555 | + | |
552 | 556 | $scope.$broadcast('addCabecera', { |
553 | 557 | label: 'Domicilio:', |
554 | 558 | valor: domicilioStamp |
555 | 559 | }); |
560 | + | |
556 | 561 | if (domicilio.verPuntos) { |
557 | 562 | delete $scope.notaPedido.domicilio.verPuntos; |
558 | 563 | $scope.seleccionarPuntosDeDescarga(); |
... | ... | @@ -563,6 +568,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
563 | 568 | if (res.data.length) $scope.seleccionarPuntosDeDescarga(); |
564 | 569 | }); |
565 | 570 | } |
571 | + | |
572 | + // Seteo checked en botonera | |
573 | + $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = true; | |
574 | + | |
566 | 575 | }, function() { |
567 | 576 | $scope.seleccionarCliente(true); |
568 | 577 | return; |
... | ... | @@ -646,6 +655,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
646 | 655 | label: 'Precios y condiciones:', |
647 | 656 | valor: cabecera |
648 | 657 | }); |
658 | + | |
659 | + $filter('filter')($scope.botonera, | |
660 | + { label: 'Precios y Condiciones'})[0].checked = true; | |
649 | 661 | }, function() { |
650 | 662 | |
651 | 663 | } |
... | ... | @@ -739,6 +751,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
739 | 751 | valor: $filter('number')(cotizacion.VENDEDOR, '2') |
740 | 752 | }); |
741 | 753 | } |
754 | + | |
755 | + $filter('filter')($scope.botonera, { label: 'Moneda'})[0].checked = true; | |
742 | 756 | }, function() { |
743 | 757 | |
744 | 758 | } |
... | ... | @@ -823,6 +837,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
823 | 837 | articulo.precio = parseFloat(articulo.precio); |
824 | 838 | }; |
825 | 839 | |
840 | + $scope.$watch('notaPedido.articulosNotaPedido', function() { | |
841 | + if ($scope.notaPedido.articulosNotaPedido.length) { | |
842 | + $filter('filter')($scope.botonera, | |
843 | + { label: 'Productos'})[0].checked = true; | |
844 | + } else { | |
845 | + $filter('filter')($scope.botonera, | |
846 | + { label: 'Productos'})[0].checked = false; | |
847 | + } | |
848 | + }, true); | |
849 | + | |
826 | 850 | function setearNotaPedido(notaPedido) { |
827 | 851 | //añado cabeceras |
828 | 852 | $scope.notaPedido = notaPedido; |
... | ... | @@ -854,6 +878,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
854 | 878 | }); |
855 | 879 | } |
856 | 880 | |
881 | + if (notaPedido.cotizacion.moneda) { | |
882 | + $filter('filter')($scope.botonera, { label: 'Moneda'})[0].checked = true; | |
883 | + } | |
884 | + | |
857 | 885 | if (notaPedido.vendedor.NUM) { |
858 | 886 | cabeceras.push({ |
859 | 887 | label: 'Vendedor:', |
... | ... | @@ -871,6 +899,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
871 | 899 | label: 'Domicilio:', |
872 | 900 | valor: notaPedido.domicilioStamp |
873 | 901 | }); |
902 | + | |
903 | + $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = true; | |
874 | 904 | } |
875 | 905 | |
876 | 906 | if (notaPedido.proveedor.COD) { |
... | ... | @@ -879,6 +909,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
879 | 909 | valor: $filter('rellenarDigitos')(notaPedido.proveedor.COD, 5) + |
880 | 910 | ' - ' + notaPedido.proveedor.NOM |
881 | 911 | }); |
912 | + | |
913 | + $filter('filter')($scope.botonera, { label: 'Proveedor'})[0].checked = true; | |
882 | 914 | } |
883 | 915 | |
884 | 916 | if (notaPedido.notaPedidoPlazo.length) { |
... | ... | @@ -888,6 +920,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
888 | 920 | notaPedidoBusinessService |
889 | 921 | .plazoToString(notaPedido.notaPedidoPlazo) |
890 | 922 | }); |
923 | + | |
924 | + $filter('filter')($scope.botonera, | |
925 | + { label: 'Precios y Condiciones'})[0].checked = true; | |
891 | 926 | } |
892 | 927 | |
893 | 928 | if (notaPedido.flete !== undefined) { |
... | ... | @@ -923,7 +958,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
923 | 958 | |
924 | 959 | if (notaPedido.idPrecioCondicion > 0) { |
925 | 960 | $scope.idLista = notaPedido.precioCondicion.idListaPrecio; |
926 | - } else { | |
961 | + } else if (notaPedido.idPrecioCondicion) { | |
927 | 962 | $scope.idLista = -1; |
928 | 963 | } |
929 | 964 |