Commit 948cdeb9e1f38d8ad8f924773ade0e6dc54ec9e2
1 parent
2888ed0ea4
Exists in
master
and in
1 other branch
arreglo modal agregar cliente
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -648,7 +648,7 @@ angular.module('focaBusquedaCliente') |
648 | 648 | .guardarCliente(cliente) |
649 | 649 | .then(function (res) { |
650 | 650 | var cliente = { |
651 | - cod: res.data.COD, | |
651 | + COD: res.data.COD, | |
652 | 652 | cuit: res.data.CUIT, |
653 | 653 | esNuevo: res.data.esNuevo, |
654 | 654 | nom: res.data.NOM |
... | ... | @@ -662,7 +662,7 @@ angular.module('focaBusquedaCliente') |
662 | 662 | |
663 | 663 | function crearCopia() { |
664 | 664 | var cliente = angular.copy($scope.cliente); |
665 | - cliente.COD = cliente.codigo; | |
665 | + cliente.COD = cliente.codigo ? cliente.codigo : 0; | |
666 | 666 | cliente.CPO = cliente.CPO; |
667 | 667 | cliente.PCX = parseInt(cliente.provincia.ID); |
668 | 668 | cliente.LOX = parseInt(cliente.localidad.ID); |
... | ... | @@ -676,7 +676,7 @@ angular.module('focaBusquedaCliente') |
676 | 676 | cliente.FPA = cliente.formaPago.ID; |
677 | 677 | cliente.VEN = $scope.vendedor.id; |
678 | 678 | cliente.CUIT = `${cliente.cuit1}-${cliente.cuit2}-${cliente.cuit3}`; |
679 | - cliente.idCobrador = cliente.cobrador.ID; | |
679 | + cliente.idCobrador = cliente.cobrador.id; | |
680 | 680 | |
681 | 681 | delete cliente.codigo; |
682 | 682 | delete cliente.provincia; |
src/js/service.js
... | ... | @@ -18,7 +18,7 @@ angular.module('focaBusquedaCliente') |
18 | 18 | return $http.get(API_ENDPOINT.URL + '/cliente-codigo/' + cod ); |
19 | 19 | }, |
20 | 20 | guardarCliente: function (cliente) { |
21 | - return $http.post(API_ENDPOINT.URL + '/cliente', { cliente: cliente }); | |
21 | + return $http.post(API_ENDPOINT.URL + '/cliente', { cliente:cliente }); | |
22 | 22 | } |
23 | 23 | }; |
24 | 24 | }]); |