Commit 24f6466d27ea6d423375f4b18b196b1bd7f400ee
1 parent
6c927dae2c
Exists in
master
checked botonera
Showing
2 changed files
with
50 additions
and
5 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -27,7 +27,10 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 27 | 27 | var moneda = res.data[0]; |
| 28 | 28 | moneda.cotizacion = moneda.cotizaciones[0]; |
| 29 | 29 | $scope.cobranza.moneda = $scope.inicial.moneda = moneda; |
| 30 | - $timeout(function() {getLSCobranza();}); | |
| 30 | + $filter('filter')( $scope.botonera, { | |
| 31 | + label: 'Moneda' | |
| 32 | + })[0].checked = true; | |
| 33 | + $timeout(function() { getLSCobranza();} ); | |
| 31 | 34 | }); |
| 32 | 35 | |
| 33 | 36 | $timeout(function() { |
| ... | ... | @@ -42,7 +45,6 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 42 | 45 | } |
| 43 | 46 | |
| 44 | 47 | init(); |
| 45 | - | |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | function init() { |
| ... | ... | @@ -391,6 +393,10 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 391 | 393 | valor: $filter('rellenarDigitos')(clienteMayus.COD, 5) + ' - ' + |
| 392 | 394 | clienteMayus.NOM |
| 393 | 395 | }); |
| 396 | + | |
| 397 | + $filter('filter')($scope.botonera, | |
| 398 | + { label: 'Cliente'})[0].checked = true; | |
| 399 | + | |
| 394 | 400 | $scope.cobranza.cliente = clienteMayus; |
| 395 | 401 | $scope.cobranza.facturas = []; |
| 396 | 402 | }, function() { |
| ... | ... | @@ -679,6 +685,10 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 679 | 685 | }); |
| 680 | 686 | } |
| 681 | 687 | |
| 688 | + $filter('filter')( $scope.botonera, { | |
| 689 | + label: 'Moneda' | |
| 690 | + })[0].checked = true; | |
| 691 | + | |
| 682 | 692 | }, function() { |
| 683 | 693 | |
| 684 | 694 | } |
| ... | ... | @@ -749,6 +759,30 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 749 | 759 | } |
| 750 | 760 | }; |
| 751 | 761 | |
| 762 | + $scope.$watch('cobranza.facturas', function() { | |
| 763 | + if ($scope.cobranza.facturas.length) { | |
| 764 | + $filter('filter')( $scope.botonera, { | |
| 765 | + label: 'Comprobantes' | |
| 766 | + })[0].checked = true; | |
| 767 | + } else { | |
| 768 | + $filter('filter')( $scope.botonera, { | |
| 769 | + label: 'Comprobantes' | |
| 770 | + })[0].checked = false; | |
| 771 | + } | |
| 772 | + }, true); | |
| 773 | + | |
| 774 | + $scope.$watch('cobranza.cobros', function() { | |
| 775 | + if ($scope.cobranza.cobros.length) { | |
| 776 | + $filter('filter')( $scope.botonera, { | |
| 777 | + label: 'Cobros' | |
| 778 | + })[0].checked = true; | |
| 779 | + } else { | |
| 780 | + $filter('filter')( $scope.botonera, { | |
| 781 | + label: 'Cobros' | |
| 782 | + })[0].checked = false; | |
| 783 | + } | |
| 784 | + }, true); | |
| 785 | + | |
| 752 | 786 | function pushearCobro(cobro, hashKey) { |
| 753 | 787 | var existe; |
| 754 | 788 | |
| ... | ... | @@ -793,6 +827,10 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 793 | 827 | valor: $filter('rellenarDigitos')(cobranza.cliente.COD, 5) + ' - ' + |
| 794 | 828 | cobranza.cliente.NOM |
| 795 | 829 | }); |
| 830 | + | |
| 831 | + $filter('filter')( $scope.botonera, { | |
| 832 | + label: 'Cliente' | |
| 833 | + })[0].checked = true; | |
| 796 | 834 | } |
| 797 | 835 | if (cobranza.cobrador && cobranza.cobrador.NUM) { |
| 798 | 836 | $scope.$broadcast('addCabecera', { |
| ... | ... | @@ -800,10 +838,17 @@ angular.module('focaCrearCobranza') .controller('cobranzaController', |
| 800 | 838 | valor: (cobranza.cobrador.NUM) ? |
| 801 | 839 | $filter('rellenarDigitos')(cobranza.cobrador.NUM, 5) + ' - ' + |
| 802 | 840 | cobranza.cobrador.NOM : cobranza.cobrador |
| 803 | - | |
| 841 | + | |
| 804 | 842 | }); |
| 805 | 843 | } |
| 806 | 844 | |
| 845 | + // TODO: Setear moneda | |
| 846 | + if (cobranza.moneda) { | |
| 847 | + $filter('filter')( $scope.botonera, { | |
| 848 | + label: 'Moneda' | |
| 849 | + })[0].checked = true; | |
| 850 | + } | |
| 851 | + | |
| 807 | 852 | $scope.cobranza = cobranza; |
| 808 | 853 | } |
| 809 | 854 |
src/views/cobranza.html
| ... | ... | @@ -9,8 +9,8 @@ |
| 9 | 9 | <div class="col-lg-12"> |
| 10 | 10 | <div class="row mt-4"> |
| 11 | 11 | <div class="col-12 col-md-10 border border-light rounded"> |
| 12 | - <div class="row px-5 py-2 botonera-secundaria"> | |
| 13 | - <div class="col-12"> | |
| 12 | + <div class="row py-2 botonera-secundaria"> | |
| 13 | + <div class="col-12 foca-facturador-px"> | |
| 14 | 14 | <foca-botonera-facturador botones="botonera" extra="7" class="row"></foca-botonera-facturador> |
| 15 | 15 | </div> |
| 16 | 16 | </div> |