Commit 9e2be9728b6cbaeffa956843e775a03d5424a781
1 parent
113f641f79
Exists in
master
Save Remito - Editar campos precio / cantidad
Showing
3 changed files
with
12 additions
and
4 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -122,6 +122,8 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 122 | 122 | //añado cabeceras |
| 123 | 123 | $scope.remitoIsDirty = true; |
| 124 | 124 | $scope.notaPedido.id = notaPedido.id; |
| 125 | + $scope.notaPedido = notaPedido; | |
| 126 | + $scope.cliente = notaPedido.cliente; | |
| 125 | 127 | $scope.$broadcast('removeCabecera', 'Bomba:'); |
| 126 | 128 | $scope.$broadcast('removeCabecera', 'Kilometros:'); |
| 127 | 129 | var puntosDescarga = []; |
| ... | ... | @@ -193,6 +195,8 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 193 | 195 | { label: 'Nota pedido' })[0].checked = true; |
| 194 | 196 | $filter('filter')($scope.botonera, |
| 195 | 197 | { label: 'Precios y condiciones' })[0].checked = true; |
| 198 | + $filter('filter')($scope.botonera, | |
| 199 | + { label: 'Domicilio de Entrega' })[0].checked = true; | |
| 196 | 200 | |
| 197 | 201 | if (notaPedido.observaciones) { |
| 198 | 202 | $filter('filter')($scope.botonera, |
| ... | ... | @@ -395,7 +399,6 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 395 | 399 | crearRemitoService.crearPlazosParaRemito(json); |
| 396 | 400 | } |
| 397 | 401 | } |
| 398 | - | |
| 399 | 402 | abrirModalMail(data.data.id, |
| 400 | 403 | $scope.remito.cliente, |
| 401 | 404 | $filter('comprobante')([ |
| ... | ... | @@ -609,7 +612,8 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 609 | 612 | controller: 'focaModalDomicilioController', |
| 610 | 613 | size: 'lg', |
| 611 | 614 | resolve: { |
| 612 | - idCliente: function () { return cliente.cod; }, | |
| 615 | + idCliente: function () { return $scope.notaPedido.cliente ? $scope.notaPedido.cliente.COD : | |
| 616 | + cliente.cod; }, | |
| 613 | 617 | esNuevo: function () { return cliente.esNuevo; } |
| 614 | 618 | } |
| 615 | 619 | } |
| ... | ... | @@ -972,6 +976,9 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 972 | 976 | var valorAEditar = bandera === 'precio' ? articulo.precio : articulo.cantidad; |
| 973 | 977 | var tempValor = bandera === 'precio' ? articulo.tmpPrecio |
| 974 | 978 | : articulo.tmpCantidad; |
| 979 | + if (tempValor === undefined) { | |
| 980 | + return; | |
| 981 | + } | |
| 975 | 982 | if (tempValor === '') { |
| 976 | 983 | focaModalService.alert('Los valores deben ser al menos 1'); |
| 977 | 984 | return; |
src/js/service.js
| ... | ... | @@ -8,7 +8,7 @@ angular.module('focaCrearRemito') |
| 8 | 8 | }, |
| 9 | 9 | crearRemito: function(remito) { |
| 10 | 10 | // TODO: Cambiar para usar el servicio /remito |
| 11 | - return $http.post(route + '/remito', remito); | |
| 11 | + return $http.post(route + '/remito/guardar', remito); | |
| 12 | 12 | }, |
| 13 | 13 | getRemitoById: function(id) { |
| 14 | 14 | return $http.get(route + '/remito/obtener/' + id); |
src/views/remito.html
| ... | ... | @@ -119,7 +119,8 @@ |
| 119 | 119 | </button> |
| 120 | 120 | <button |
| 121 | 121 | class="btn btn-outline-light" |
| 122 | - ng-click="editarArticulo(13, articulo)" | |
| 122 | + ng-click="editarArticulo(13, articulo, 'cantidad'); | |
| 123 | + editarArticulo(13, articulo, 'precio')" | |
| 123 | 124 | ng-show="articulo.editCantidad || articulo.editPrecio" |
| 124 | 125 | > |
| 125 | 126 | <i class="fa fa-save"></i> |