Commit 3618c6d772c5fbc5343a1ba69da0960bf116fb68

Authored by Jose Pinto
1 parent e700dca0b1
Exists in master

ok cancelar cambiar contraseña

src/js/controllerItem.js
1 angular.module('focaAbmVendedorCobrador') 1 angular.module('focaAbmVendedorCobrador')
2 .controller('focaAbmVendedorCobradorController', [ 2 .controller('focaAbmVendedorCobradorController', [
3 '$scope', 'focaAbmVendedorCobradorService', '$routeParams', 'focaBotoneraLateralService', 3 '$scope', 'focaAbmVendedorCobradorService', '$routeParams', 'focaBotoneraLateralService',
4 '$timeout', '$uibModal', '$location', 'focaModalService', 4 '$timeout', '$uibModal', '$location', 'focaModalService',
5 function($scope, focaAbmVendedorCobradorService, $routeParams, focaBotoneraLateralService, 5 function($scope, focaAbmVendedorCobradorService, $routeParams, focaBotoneraLateralService,
6 $timeout, $uibModal, $location, focaModalService) { 6 $timeout, $uibModal, $location, focaModalService) {
7 7
8 $scope.guardado = false;
8 $scope.now = new Date(); 9 $scope.now = new Date();
9 $scope.focused = 0; 10 $scope.focused = 0;
10 $scope.vendedorCobrador = { 11 $scope.vendedorCobrador = {
11 ES_COBRADOR: false, 12 ES_COBRADOR: false,
12 DNI: ' ', 13 DNI: ' ',
13 ClaVen: '', 14 ClaVen: '',
14 ComVen: '0.00', 15 ComVen: '0.00',
15 comisionCobrador: '0.00', 16 comisionCobrador: '0.00',
16 provincia: { 17 provincia: {
17 NOMBRE: '' 18 NOMBRE: ''
18 }, 19 },
19 localidad: { 20 localidad: {
20 NOMBRE: ' ' 21 NOMBRE: ' '
21 } 22 }
22 }; 23 };
23 $scope.options = [ 24 $scope.options = [
24 { 25 {
25 label: 'Vendedor', 26 label: 'Vendedor',
26 value: 1 27 value: 1
27 }, 28 },
28 { 29 {
29 label: 'Cobrador', 30 label: 'Cobrador',
30 value: 2 31 value: 2
31 }, 32 },
32 { 33 {
33 label: 'Vendedor y cobrador', 34 label: 'Vendedor y cobrador',
34 value: 3 35 value: 3
35 } 36 }
36 ]; 37 ];
37 //SETEO BOTONERA LATERAL 38 //SETEO BOTONERA LATERAL
38 $timeout(function() { 39 $timeout(function() {
39 focaBotoneraLateralService.showSalir(false); 40 focaBotoneraLateralService.showSalir(false);
40 focaBotoneraLateralService.showPausar(true); 41 focaBotoneraLateralService.showPausar(true);
41 focaBotoneraLateralService.showCancelar(false); 42 focaBotoneraLateralService.showCancelar(false);
42 focaBotoneraLateralService.showGuardar(true, $scope.guardar); 43 focaBotoneraLateralService.showGuardar(true, $scope.guardar);
43 focaBotoneraLateralService.addCustomButton('Salir', $scope.cancelar); 44 focaBotoneraLateralService.addCustomButton('Salir', $scope.cancelar);
44 }); 45 });
45 focaAbmVendedorCobradorService 46 focaAbmVendedorCobradorService
46 .getCodigoSiguiente() 47 .getCodigoSiguiente()
47 .then(function(res) { 48 .then(function(res) {
48 $scope.vendedorCobrador.CodVen = res.data.mayor; 49 $scope.vendedorCobrador.CodVen = res.data.mayor;
49 }); 50 });
50 focaAbmVendedorCobradorService 51 focaAbmVendedorCobradorService
51 .getVendedorCobradorById($routeParams.id) 52 .getVendedorCobradorById($routeParams.id)
52 .then(function(res) { 53 .then(function(res) {
53 if(res.data){ 54 if(res.data){
54 $scope.edicion = true; 55 $scope.edicion = true;
55 $scope.vendedorCobrador = res.data; 56 $scope.vendedorCobrador = res.data;
56 delete $scope.vendedorCobrador.FCVEN; 57 delete $scope.vendedorCobrador.FCVEN;
57 delete $scope.vendedorCobrador.FEC; 58 delete $scope.vendedorCobrador.FEC;
58 } 59 }
59 }); 60 });
60 61
61 $scope.guardar = function() { 62 $scope.guardar = function() {
62 var vendedorCobrador = angular.copy($scope.vendedorCobrador); 63 if($scope.guardado) {
64 $scope.cambiarPassword();
63 65
64 vendedorCobrador.PciVen = vendedorCobrador.provincia.ID; 66 } else {
65 vendedorCobrador.LocVen = vendedorCobrador.localidad.ID;
66 67
67 delete vendedorCobrador.provincia; 68 var vendedorCobrador = angular.copy($scope.vendedorCobrador);
68 delete vendedorCobrador.localidad; 69
69 if (vendedorCobrador.rol == 1) { 70 vendedorCobrador.PciVen = vendedorCobrador.provincia.ID;
70 delete vendedorCobrador.comisionCobrador; 71 vendedorCobrador.LocVen = vendedorCobrador.localidad.ID;
71 } else if (vendedorCobrador.rol == 2) { 72
72 delete vendedorCobrador.ComVen; 73 delete vendedorCobrador.provincia;
74 delete vendedorCobrador.localidad;
75 if (vendedorCobrador.rol == 1) {
76 delete vendedorCobrador.comisionCobrador;
77 } else if (vendedorCobrador.rol == 2) {
78 delete vendedorCobrador.ComVen;
79 }
80 vendedorCobrador.metodo = ($routeParams.id === '0') ? 'crear' : 'actualizar';
81
82 focaAbmVendedorCobradorService
83 .guardarVendedorCobrador(vendedorCobrador)
84 .then(function(res) {
85 if ($scope.edicion) {
86 $location.path('/vendedor-cobrador');
87 } else {
88 $scope.vendedorCobrador = res.data;
89 $scope.cambiarPassword();
90 $scope.guardado = true;
91 }
92 })
93 .catch(function(err) {
94 if (err.status === 409) {
95 focaModalService.alert(err.data);
96 }
97 });
73 } 98 }
74 vendedorCobrador.metodo = ($routeParams.id === '0') ? 'crear' : 'actualizar';
75
76 focaAbmVendedorCobradorService
77 .guardarVendedorCobrador(vendedorCobrador)
78 .then(function(res) {
79 if ($scope.edicion) {
80 $location.path('/vendedor-cobrador');
81 } else {
82 $scope.vendedorCobrador = res.data;
83 $scope.cambiarContrasenia();
84 }
85 })
86 .catch(function(err) {
87 if (err.status === 409) {
88 focaModalService.alert(err.data);
89 }
90 });
91 }; 99 };
92 100
93 $scope.seleccionarProvincia = function(key) { 101 $scope.seleccionarProvincia = function(key) {
94 if(key === 13) { 102 if(key === 13) {
95 var parametrosModal = { 103 var parametrosModal = {
96 query: '/provincia', 104 query: '/provincia',
97 columnas: [ 105 columnas: [
98 { 106 {
99 propiedad: 'ID', 107 propiedad: 'ID',
100 nombre: 'Codigo', 108 nombre: 'Codigo',
101 filtro: { 109 filtro: {
102 nombre: 'rellenarDigitos', 110 nombre: 'rellenarDigitos',
103 parametro: 3} 111 parametro: 3}
104 }, 112 },
105 { 113 {
106 propiedad: 'NOMBRE', 114 propiedad: 'NOMBRE',
107 nombre: 'Nombre' 115 nombre: 'Nombre'
108 } 116 }
109 ], 117 ],
110 titulo:'Búsqueda de provincias', 118 titulo:'Búsqueda de provincias',
111 size: 'md' 119 size: 'md'
112 }; 120 };
113 focaModalService.modal(parametrosModal).then(function(provincia) { 121 focaModalService.modal(parametrosModal).then(function(provincia) {
114 $scope.vendedorCobrador.provincia = provincia; 122 $scope.vendedorCobrador.provincia = provincia;
115 $timeout(function() { 123 $timeout(function() {
116 $scope.focused = 5; 124 $scope.focused = 5;
117 }); 125 });
118 }, function() { 126 }, function() {
119 //TODO: función llamada cuando cancela el modal 127 //TODO: función llamada cuando cancela el modal
120 }); 128 });
121 } 129 }
122 }; 130 };
123 $scope.seleccionarLocalidad = function(key) { 131 $scope.seleccionarLocalidad = function(key) {
124 if(!$scope.vendedorCobrador.provincia.ID) { 132 if(!$scope.vendedorCobrador.provincia.ID) {
125 focaModalService.alert('Seleccione una provincia'); 133 focaModalService.alert('Seleccione una provincia');
126 return; 134 return;
127 } 135 }
128 if(key === 13) { 136 if(key === 13) {
129 var parametrosModal = { 137 var parametrosModal = {
130 query: '/localidad/' + $scope.vendedorCobrador.provincia.ID, 138 query: '/localidad/' + $scope.vendedorCobrador.provincia.ID,
131 columnas: [ 139 columnas: [
132 { 140 {
133 propiedad: 'ID', 141 propiedad: 'ID',
134 nombre: 'Código', 142 nombre: 'Código',
135 filtro: { 143 filtro: {
136 nombre: 'rellenarDigitos', 144 nombre: 'rellenarDigitos',
137 parametro: 3 145 parametro: 3
138 } 146 }
139 }, 147 },
140 { 148 {
141 propiedad: 'NOMBRE', 149 propiedad: 'NOMBRE',
142 nombre: 'Nombre' 150 nombre: 'Nombre'
143 } 151 }
144 ], 152 ],
145 titulo:'Búsqueda de localidades', 153 titulo:'Búsqueda de localidades',
146 size: 'md' 154 size: 'md'
147 }; 155 };
148 focaModalService.modal(parametrosModal).then(function(localidad) { 156 focaModalService.modal(parametrosModal).then(function(localidad) {
149 $scope.vendedorCobrador.localidad = localidad; 157 $scope.vendedorCobrador.localidad = localidad;
150 $timeout(function() { 158 $timeout(function() {
151 $scope.focused = 6; 159 $scope.focused = 6;
152 }); 160 });
153 }, function() { 161 }, function() {
154 //TODO: función llamada cuando cancela el modal 162 //TODO: función llamada cuando cancela el modal
155 }); 163 });
156 } 164 }
157 }; 165 };
158 166
159 $scope.cancelar = function() { 167 $scope.cancelar = function() {
160 $location.path('/vendedor-cobrador'); 168 if(!$scope.formVendedorCobrador.$pristine) {
169
170 focaModalService.confirm('¿Está seguro de que desea salir?' +
171 'Se perderán todos los datos cargados.')
172 .then(function(confirmed) {
173 if(confirmed && $scope.guardado && !$scope.edicion) {
174
175 focaAbmVendedorCobradorService
176 .eliminarVendedorCobrador($scope.vendedorCobrador.CodVen)
177 .then(function() {
178 $location.path('/vendedor-cobrador');
179 });
180
181 } else if (confirmed) {
182 $location.path('/vendedor-cobrador');
183 }
184 });
185
186 } else {
187 $location.path('/vendedor-cobrador');
188 }
161 }; 189 };
162 190
163 $scope.next = function(key) { 191 $scope.next = function(key) {
164 if(key === 13) $scope.focused++; 192 if(key === 13) $scope.focused++;
165 }; 193 };
166 194
167 $scope.cambiarContrasenia = function() { 195 $scope.cambiarPassword = function() {
168 var vendedorCobrador = angular.copy($scope.vendedorCobrador); 196 var vendedorCobrador = angular.copy($scope.vendedorCobrador);
169 vendedorCobrador.id = vendedorCobrador.CodVen; 197 vendedorCobrador.id = vendedorCobrador.CodVen;
170 vendedorCobrador.nombre = vendedorCobrador.NomVen; 198 vendedorCobrador.nombre = vendedorCobrador.NomVen;
171 vendedorCobrador.dni = vendedorCobrador.DNI; 199 vendedorCobrador.dni = vendedorCobrador.DNI;
172 vendedorCobrador.telefono = vendedorCobrador.TelVen; 200 vendedorCobrador.telefono = vendedorCobrador.TelVen;
173 201
174 var parametros = { 202 var parametros = {
175 cuenta: vendedorCobrador, 203 cuenta: vendedorCobrador,
176 tipo: ($scope.vendedorCobrador.rol === 2) ? 'Cobradores' : 'Vendedores' 204 tipo: ($scope.vendedorCobrador.rol === 2) ? 'Cobradores' : 'Vendedores'
177 }; 205 };
178 206
179 var modalInstance = $uibModal.open( 207 var modalInstance = $uibModal.open(
180 { 208 {
181 ariaLabelledBy: 'Configuracion de Logueo', 209 ariaLabelledBy: 'Configuracion de Logueo',
182 templateUrl: 'modal-login.html', 210 templateUrl: 'modal-login.html',
src/views/foca-abm-vendedor-cobrador-item.html
1 <div class="row"> 1 <div class="row">
2 <foca-cabecera-facturador 2 <foca-cabecera-facturador
3 titulo="'Vendedores / Cobradores'" 3 titulo="'Vendedores / Cobradores'"
4 fecha="now" 4 fecha="now"
5 class="mb-0 col-lg-12" 5 class="mb-0 col-lg-12"
6 ></foca-cabecera-facturador> 6 ></foca-cabecera-facturador>
7 </div> 7 </div>
8 <div class="row"> 8 <div class="row">
9 <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> 9 <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded">
10 <form name="formVendedorCobrador" class="px-3" autocomplete="off"> 10 <form name="formVendedorCobrador" class="px-3" autocomplete="off">
11 <div class="row mt-3"> 11 <div class="row mt-3">
12 <div class="form-group d-flex mb-2 col-md-6"> 12 <div class="form-group d-flex mb-2 col-md-6">
13 <label class="col-form-label col-md-4">Código</label> 13 <label class="col-form-label col-md-4">Código</label>
14 <div class="col-md-8 pl-0"> 14 <div class="col-md-8 pl-0">
15 <input 15 <input
16 class="form-control form-control-sm" 16 class="form-control form-control-sm"
17 ng-model="vendedorCobrador.CodVen" 17 ng-model="vendedorCobrador.CodVen"
18 ng-disabled="edicion"/> 18 ng-disabled="edicion"/>
19 </div> 19 </div>
20 </div> 20 </div>
21 <div class="form-group d-flex mb-2 col-md-6"> 21 <div class="form-group d-flex mb-2 col-md-6">
22 <label class="col-form-label col-md-4">Tipo</label> 22 <label class="col-form-label col-md-4">Tipo</label>
23 <div class="col-md-8 pl-0"> 23 <div class="col-md-8 pl-0">
24 <select 24 <select
25 class="form-control form-control-sm" 25 class="form-control form-control-sm"
26 ng-model="vendedorCobrador.rol" 26 ng-model="vendedorCobrador.rol"
27 ng-options="option.value as option.label for option in options" 27 ng-options="option.value as option.label for option in options"
28 foca-focus="focused == 0" 28 foca-focus="focused == 0"
29 ng-focus="focused = 0"> 29 ng-focus="focused = 0">
30 </select> 30 </select>
31 </div> 31 </div>
32 </div> 32 </div>
33 <div class="form-group d-flex mb-2 col-md-6"> 33 <div class="form-group d-flex mb-2 col-md-6">
34 <label class="col-form-label col-md-4">Nombre</label> 34 <label class="col-form-label col-md-4">Nombre</label>
35 <div class="input-group col-md-8 pl-0"> 35 <div class="input-group col-md-8 pl-0">
36 <input 36 <input
37 class="form-control form-control-sm" 37 class="form-control form-control-sm"
38 type="text" 38 type="text"
39 teclado-virtual 39 teclado-virtual
40 ng-model="vendedorCobrador.NomVen" 40 ng-model="vendedorCobrador.NomVen"
41 foca-focus="focused == 1" 41 foca-focus="focused == 1"
42 ng-focus="focused = 1" 42 ng-focus="focused = 1"
43 ng-keypress="next($event.keyCode)" 43 ng-keypress="next($event.keyCode)"
44 autocomplete="off" 44 autocomplete="off"
45 uppercase-only 45 uppercase-only
46 /> 46 />
47 </div> 47 </div>
48 </div> 48 </div>
49 <div class="form-group d-flex mb-2 col-md-6"> 49 <div class="form-group d-flex mb-2 col-md-6">
50 <label class="col-form-label col-md-4">Domicilio</label> 50 <label class="col-form-label col-md-4">Domicilio</label>
51 <div class="input-group col-md-8 pl-0"> 51 <div class="input-group col-md-8 pl-0">
52 <input 52 <input
53 class="form-control form-control-sm" 53 class="form-control form-control-sm"
54 type="text" 54 type="text"
55 teclado-virtual 55 teclado-virtual
56 ng-model="vendedorCobrador.DomVen" 56 ng-model="vendedorCobrador.DomVen"
57 ng-required="true" 57 ng-required="true"
58 foca-focus="focused == 2" 58 foca-focus="focused == 2"
59 ng-focus="focused = 2" 59 ng-focus="focused = 2"
60 ng-keypress="next($event.keyCode)" 60 ng-keypress="next($event.keyCode)"
61 autocomplete="off" 61 autocomplete="off"
62 uppercase-only 62 uppercase-only
63 /> 63 />
64 </div> 64 </div>
65 </div> 65 </div>
66 <div class="form-group d-flex mb-2 col-md-6"> 66 <div class="form-group d-flex mb-2 col-md-6">
67 <label class="col-form-label col-md-4">Código postal</label> 67 <label class="col-form-label col-md-4">Código postal</label>
68 <div class="input-group col-md-8 pl-0"> 68 <div class="input-group col-md-8 pl-0">
69 <input 69 <input
70 class="form-control form-control-sm" 70 class="form-control form-control-sm"
71 foca-tipo-input 71 foca-tipo-input
72 teclado-virtual 72 teclado-virtual
73 ng-model="vendedorCobrador.CPoVen" 73 ng-model="vendedorCobrador.CPoVen"
74 ng-required="true" 74 ng-required="true"
75 foca-focus="focused == 3" 75 foca-focus="focused == 3"
76 ng-focus="focused = 3" 76 ng-focus="focused = 3"
77 ng-keypress="next($event.keyCode)" 77 ng-keypress="next($event.keyCode)"
78 autocomplete="off" 78 autocomplete="off"
79 string-to-number 79 string-to-number
80 /> 80 />
81 </div> 81 </div>
82 </div> 82 </div>
83 <div class="form-group d-flex mb-2 col-md-6"> 83 <div class="form-group d-flex mb-2 col-md-6">
84 <label class="col-form-label col-md-4">Provincia</label> 84 <label class="col-form-label col-md-4">Provincia</label>
85 <div class="input-group col-md-8 pl-0"> 85 <div class="input-group col-md-8 pl-0">
86 <input 86 <input
87 type="text" 87 type="text"
88 class="form-control form-control-sm" 88 class="form-control form-control-sm"
89 ng-model="vendedorCobrador.provincia.NOMBRE" 89 ng-model="vendedorCobrador.provincia.NOMBRE"
90 ng-keypress="seleccionarProvincia($event.keyCode)" 90 ng-keypress="seleccionarProvincia($event.keyCode)"
91 ng-required="true" 91 ng-required="true"
92 foca-focus="focused == 4" 92 foca-focus="focused == 4"
93 ng-focus="focused = 4" 93 ng-focus="focused = 4"
94 teclado-virtual 94 teclado-virtual
95 /> 95 />
96 <div class="input-group-append"> 96 <div class="input-group-append">
97 <button 97 <button
98 ladda="searchLoading" 98 ladda="searchLoading"
99 class="btn btn-outline-secondary form-control-sm" 99 class="btn btn-outline-secondary form-control-sm"
100 type="button" 100 type="button"
101 ng-click="seleccionarProvincia(13)" 101 ng-click="seleccionarProvincia(13)"
102 > 102 >
103 <i class="fa fa-search" aria-hidden="true"></i> 103 <i class="fa fa-search" aria-hidden="true"></i>
104 </button> 104 </button>
105 </div> 105 </div>
106 </div> 106 </div>
107 </div> 107 </div>
108 <div class="form-group d-flex mb-2 col-md-6"> 108 <div class="form-group d-flex mb-2 col-md-6">
109 <label class="col-form-label col-md-4">Localidad</label> 109 <label class="col-form-label col-md-4">Localidad</label>
110 <div class="input-group col-md-8 pl-0"> 110 <div class="input-group col-md-8 pl-0">
111 <input 111 <input
112 type="text" 112 type="text"
113 class="form-control form-control-sm" 113 class="form-control form-control-sm"
114 ng-model="vendedorCobrador.localidad.NOMBRE" 114 ng-model="vendedorCobrador.localidad.NOMBRE"
115 ng-keypress="seleccionarLocalidad($event.keyCode)" 115 ng-keypress="seleccionarLocalidad($event.keyCode)"
116 ng-required="true" 116 ng-required="true"
117 foca-focus="focused == 5" 117 foca-focus="focused == 5"
118 ng-focus="focused = 5" 118 ng-focus="focused = 5"
119 teclado-virtual 119 teclado-virtual
120 autocomplete="off" 120 autocomplete="off"
121 /> 121 />
122 <div class="input-group-append"> 122 <div class="input-group-append">
123 <button 123 <button
124 ladda="searchLoading" 124 ladda="searchLoading"
125 class="btn btn-outline-secondary form-control-sm" 125 class="btn btn-outline-secondary form-control-sm"
126 type="button" 126 type="button"
127 ng-click="seleccionarLocalidad(13)" 127 ng-click="seleccionarLocalidad(13)"
128 > 128 >
129 <i class="fa fa-search" aria-hidden="true"></i> 129 <i class="fa fa-search" aria-hidden="true"></i>
130 </button> 130 </button>
131 </div> 131 </div>
132 </div> 132 </div>
133 </div> 133 </div>
134 <div class="form-group d-flex mb-2 col-md-6"> 134 <div class="form-group d-flex mb-2 col-md-6">
135 <label class="col-form-label col-md-4">Teléfono</label> 135 <label class="col-form-label col-md-4">Teléfono</label>
136 <div class="input-group col-md-8 pl-0"> 136 <div class="input-group col-md-8 pl-0">
137 <input 137 <input
138 class="form-control form-control-sm" 138 class="form-control form-control-sm"
139 foca-tipo-input 139 foca-tipo-input
140 teclado-virtual 140 teclado-virtual
141 ng-model="vendedorCobrador.TelVen" 141 ng-model="vendedorCobrador.TelVen"
142 ng-required="true" 142 ng-required="true"
143 foca-focus="focused == 6" 143 foca-focus="focused == 6"
144 ng-focus="focused = 6" 144 ng-focus="focused = 6"
145 ng-keypress="next($event.keyCode)" 145 ng-keypress="next($event.keyCode)"
146 autocomplete="off" 146 autocomplete="off"
147 string-to-number 147 string-to-number
148 /> 148 />
149 </div> 149 </div>
150 </div> 150 </div>
151 <div class="form-group d-flex mb-2 col-md-6"> 151 <div class="form-group d-flex mb-2 col-md-6">
152 <label class="col-form-label col-md-4">DNI</label> 152 <label class="col-form-label col-md-4">DNI</label>
153 <div class="input-group col-md-8 pl-0"> 153 <div class="input-group col-md-8 pl-0">
154 <input 154 <input
155 class="form-control form-control-sm" 155 class="form-control form-control-sm"
156 foca-tipo-input 156 foca-tipo-input
157 teclado-virtual 157 teclado-virtual
158 ng-model="vendedorCobrador.DNI" 158 ng-model="vendedorCobrador.DNI"
159 ng-required="true" 159 ng-required="true"
160 foca-focus="focused == 7" 160 foca-focus="focused == 7"
161 ng-focus="focused = 7" 161 ng-focus="focused = 7"
162 ng-keypress="next($event.keyCode)" 162 ng-keypress="next($event.keyCode)"
163 autocomplete="off" 163 autocomplete="off"
164 string-to-number 164 string-to-number
165 /> 165 />
166 </div> 166 </div>
167 </div> 167 </div>
168 <div class="form-group d-flex mb-2 col-md-6" 168 <div class="form-group d-flex mb-2 col-md-6"
169 ng-show="vendedorCobrador.rol == 1 || vendedorCobrador.rol == 3"> 169 ng-show="vendedorCobrador.rol == 1 || vendedorCobrador.rol == 3">
170 <label class="col-form-label col-md-4">Porcentaje de comisión <span ng-show="vendedorCobrador.rol == 3">vendedor</span></label> 170 <label class="col-form-label col-md-4">Porcentaje de comisión <span ng-show="vendedorCobrador.rol == 3">vendedor</span></label>
171 <div class="input-group col-md-8 pl-0"> 171 <div class="input-group col-md-8 pl-0">
172 <input 172 <input
173 class="form-control form-control-sm" 173 class="form-control form-control-sm"
174 foca-tipo-input 174 foca-tipo-input
175 teclado-virtual 175 teclado-virtual
176 ng-model="vendedorCobrador.ComVen" 176 ng-model="vendedorCobrador.ComVen"
177 ng-required="true" 177 ng-required="true"
178 foca-focus="focused == 10" 178 foca-focus="focused == 10"
179 ng-focus="focused = 10" 179 ng-focus="focused = 10"
180 ng-keypress="next($event.keyCode)" 180 ng-keypress="next($event.keyCode)"
181 autocomplete="off" 181 autocomplete="off"
182 string-to-number 182 string-to-number
183 /> 183 />
184 </div> 184 </div>
185 </div> 185 </div>
186 <div class="form-group d-flex mb-2 col-md-6" 186 <div class="form-group d-flex mb-2 col-md-6"
187 ng-show="vendedorCobrador.rol == 2 || vendedorCobrador.rol == 3"> 187 ng-show="vendedorCobrador.rol == 2 || vendedorCobrador.rol == 3">
188 <label class="col-form-label col-md-4">Porcentaje de comisión <span ng-show="vendedorCobrador.rol == 3">cobrador</span></label> 188 <label class="col-form-label col-md-4">Porcentaje de comisión <span ng-show="vendedorCobrador.rol == 3">cobrador</span></label>
189 <div class="input-group col-md-8 pl-0"> 189 <div class="input-group col-md-8 pl-0">
190 <input 190 <input
191 class="form-control form-control-sm" 191 class="form-control form-control-sm"
192 foca-tipo-input 192 foca-tipo-input
193 teclado-virtual 193 teclado-virtual
194 ng-model="vendedorCobrador.comisionCobrador" 194 ng-model="vendedorCobrador.comisionCobrador"
195 ng-required="true" 195 ng-required="true"
196 foca-focus="focused == 10" 196 foca-focus="focused == 10"
197 ng-focus="focused = 10" 197 ng-focus="focused = 10"
198 ng-keypress="next($event.keyCode)" 198 ng-keypress="next($event.keyCode)"
199 autocomplete="off" 199 autocomplete="off"
200 string-to-number 200 string-to-number
201 /> 201 />
202 </div> 202 </div>
203 </div> 203 </div>
204 <div class="ml-auto w-50"> 204 <div class="ml-auto w-50">
205 <button 205 <button
206 class="btn btn-primary float-right mr-3" 206 class="btn btn-primary float-right mr-3"
207 type="button" 207 type="button"
208 ng-click="cambiarContrasenia()" 208 ng-click="cambiarPassword()"
209 ng-show="edicion" 209 ng-show="edicion"
210 >Cambiar contraseña</button> 210 >Cambiar contraseña</button>
211 </div> 211 </div>
212 </div> 212 </div>
213 </form> 213 </form>
214 </div> 214 </div>
215 </div> 215 </div>
216 216