Commit c3afddc9b634b20cd15a5fa84f1f68c2ec6324c2
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master(mpuebla) See merge request !36
Showing
2 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -55,7 +55,7 @@ angular.module('focaBusquedaCliente') |
| 55 | 55 | cobrador: { |
| 56 | 56 | NOM: '' |
| 57 | 57 | } |
| 58 | - }; | |
| 58 | + }; | |
| 59 | 59 | $scope.cliente = angular.copy($scope.clienteTemplate); |
| 60 | 60 | $scope.busquedaPress = function (key) { |
| 61 | 61 | if (key === 13) { |
| ... | ... | @@ -154,8 +154,10 @@ angular.module('focaBusquedaCliente') |
| 154 | 154 | $scope.cliente.localidad.NOMBRE = data.LOC; |
| 155 | 155 | $scope.cliente.zona.ID = data.zona.ID; |
| 156 | 156 | $scope.cliente.zona.NOM = data.zona.NOM; |
| 157 | - $scope.cliente.actividad.NOM = data.ACT; | |
| 157 | + $scope.cliente.actividad.NOM = data.actividad.NOM; | |
| 158 | + $scope.cliente.actividad.ID = data.actividad.ID; | |
| 158 | 159 | $scope.cliente.cobrador.NOM = data.cobrador ? data.cobrador.NOM : ''; |
| 160 | + $scope.cliente.cobrador.NUM = data.cobrador ? data.cobrador.NUM : undefined; | |
| 159 | 161 | $scope.cliente.cobrador.ID = data.cobrador ? data.cobrador.id : undefined; |
| 160 | 162 | $scope.vendedor.NOM = data.vendedor.NOM; |
| 161 | 163 | $scope.vendedor.id = data.vendedor.id; |
| ... | ... | @@ -174,7 +176,7 @@ angular.module('focaBusquedaCliente') |
| 174 | 176 | $scope.cliente.formaPago.ID = data.formaPago.ID; |
| 175 | 177 | $scope.cliente.ES_PROS = data.ES_PROS; |
| 176 | 178 | $scope.cliente.ES_MAY = data.ES_MAY; |
| 177 | - $scope.accion = "Cliente"; | |
| 179 | + $scope.accion = "Editar Cliente"; | |
| 178 | 180 | $scope.ingreso = true; |
| 179 | 181 | }) |
| 180 | 182 | .catch(function (e) { console.log(e); }) |
| ... | ... | @@ -252,15 +254,11 @@ angular.module('focaBusquedaCliente') |
| 252 | 254 | if (key === 13) { |
| 253 | 255 | var parametrosModal = { |
| 254 | 256 | searchText: $scope.cliente.localidad.NOMBRE, |
| 255 | - query: '/localidad/' + $scope.cliente.provincia.ID, | |
| 257 | + query: '/localidad/' + parseInt($scope.cliente.provincia.ID), | |
| 256 | 258 | columnas: [ |
| 257 | 259 | { |
| 258 | 260 | propiedad: 'ID', |
| 259 | 261 | nombre: 'Código', |
| 260 | - filtro: { | |
| 261 | - nombre: 'rellenarDigitos', | |
| 262 | - parametro: 3 | |
| 263 | - } | |
| 264 | 262 | }, |
| 265 | 263 | { |
| 266 | 264 | propiedad: 'NOMBRE', |
| ... | ... | @@ -632,24 +630,31 @@ angular.module('focaBusquedaCliente') |
| 632 | 630 | nom: res.data.NOM |
| 633 | 631 | }; |
| 634 | 632 | $scope.select(cliente, true); |
| 633 | + }) | |
| 634 | + .catch(function (e) { | |
| 635 | + console.log(e); | |
| 635 | 636 | }); |
| 636 | 637 | }; |
| 637 | 638 | |
| 638 | 639 | function crearCopia() { |
| 639 | 640 | var cliente = angular.copy($scope.cliente); |
| 640 | - | |
| 641 | - cliente.PCX = cliente.provincia.ID; | |
| 642 | - cliente.LOX = cliente.localidad.ID; | |
| 641 | + cliente.COD = cliente.codigo; | |
| 642 | + cliente.CPO = cliente.CPO; | |
| 643 | + cliente.PCX = parseInt(cliente.provincia.ID); | |
| 644 | + cliente.LOX = parseInt(cliente.localidad.ID); | |
| 645 | + cliente.LOC = cliente.localidad.NOMBRE; | |
| 646 | + cliente.PCI = cliente.provincia.NOMBRE; | |
| 643 | 647 | cliente.IVA = cliente.iva.ID; |
| 644 | 648 | cliente.ACT = cliente.actividad.ID; |
| 645 | - cliente.ZON = cliente.zona.ID; | |
| 649 | + cliente.ZON = (parseInt(cliente.zona.ID)).toString(); | |
| 646 | 650 | cliente.TIP = cliente.tipoFactura.ID; |
| 647 | 651 | cliente.TCO = cliente.tipoComprobante.ID; |
| 648 | 652 | cliente.FPA = cliente.formaPago.ID; |
| 649 | 653 | cliente.VEN = $scope.vendedor.id; |
| 650 | - cliente.CUIT = cliente.cuit1 + cliente.cuit2 + cliente.cuit3; | |
| 654 | + cliente.CUIT = `${cliente.cuit1}-${cliente.cuit2}-${cliente.cuit3}`; | |
| 651 | 655 | cliente.idCobrador = cliente.cobrador.ID; |
| 652 | 656 | |
| 657 | + delete cliente.codigo; | |
| 653 | 658 | delete cliente.provincia; |
| 654 | 659 | delete cliente.localidad; |
| 655 | 660 | delete cliente.iva; |
src/views/foca-busqueda-cliente-modal.html
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | ng-hide="ingreso" |
| 40 | 40 | > |
| 41 | 41 | <button |
| 42 | - ng-show="filters.length >= 1" | |
| 42 | + ng-show="filters.length >= 1 && !ingreso" | |
| 43 | 43 | type="button" |
| 44 | 44 | class="clear-input" |
| 45 | 45 | ng-click="filters = ''" |
| ... | ... | @@ -115,7 +115,7 @@ |
| 115 | 115 | </table> |
| 116 | 116 | |
| 117 | 117 | <form name="formCliente"> |
| 118 | - <fieldset ng-disabled="accion == 'Cliente'"> | |
| 118 | + <fieldset> | |
| 119 | 119 | <uib-tabset class="tabs-right" ng-show="ingreso"> |
| 120 | 120 | <uib-tab heading="Datos cliente"> |
| 121 | 121 | <div class="row"> |
| ... | ... | @@ -627,19 +627,11 @@ |
| 627 | 627 | </ul> |
| 628 | 628 | </nav> |
| 629 | 629 | <button |
| 630 | - ng-hide="accion == 'Cliente'" | |
| 631 | 630 | class="btn btn-sm btn-secondary" |
| 632 | 631 | type="button" |
| 633 | 632 | ng-click="cancel()">Cancelar |
| 634 | 633 | </button> |
| 635 | - <button | |
| 636 | - ng-show="accion == 'Cliente'" | |
| 637 | - class="btn btn-sm btn-secondary" | |
| 638 | - type="button" | |
| 639 | - ng-click="cancel()">Volver | |
| 640 | - </button> | |
| 641 | 634 | <button |
| 642 | - ng-hide="accion == 'Cliente'" | |
| 643 | 635 | class="btn btn-sm btn-primary" |
| 644 | 636 | type="button" |
| 645 | 637 | ng-show="ingreso" |