Commit 59676d2f304c4fddd4c1c74b1622efbb9cc22451

Authored by Eric Fernandez
Exists in master

Merge branch 'master' into 'develop'

Master

See merge request !100
src/js/controller.js
... ... @@ -124,6 +124,8 @@ angular.module('focaCrearRemito').controller('remitoController',
124 124 //añado cabeceras
125 125 $scope.remitoIsDirty = true;
126 126 $scope.notaPedido.id = notaPedido.id;
  127 + $scope.notaPedido = notaPedido;
  128 + $scope.cliente = notaPedido.cliente;
127 129 $scope.$broadcast('removeCabecera', 'Bomba:');
128 130 $scope.$broadcast('removeCabecera', 'Kilometros:');
129 131 var puntosDescarga = [];
... ... @@ -195,6 +197,8 @@ angular.module('focaCrearRemito').controller('remitoController',
195 197 { label: 'Nota pedido' })[0].checked = true;
196 198 $filter('filter')($scope.botonera,
197 199 { label: 'Precios y condiciones' })[0].checked = true;
  200 + $filter('filter')($scope.botonera,
  201 + { label: 'Domicilio de Entrega' })[0].checked = true;
198 202  
199 203 if (notaPedido.observaciones) {
200 204 $filter('filter')($scope.botonera,
... ... @@ -306,6 +310,7 @@ angular.module('focaCrearRemito').controller('remitoController',
306 310 focaModalService.alert('Debe cargar al menos un articulo');
307 311 return;
308 312 }
  313 +
309 314 focaBotoneraLateralService.startGuardar();
310 315 $scope.saveLoading = true;
311 316 var save = {
... ... @@ -391,7 +396,6 @@ angular.module('focaCrearRemito').controller('remitoController',
391 396 crearRemitoService.crearPlazosParaRemito(json);
392 397 }
393 398 }
394   -
395 399 abrirModalMail(data.data.id,
396 400 $scope.remito.cliente,
397 401 $filter('comprobante')([
... ... @@ -605,7 +609,8 @@ angular.module('focaCrearRemito').controller('remitoController',
605 609 controller: 'focaModalDomicilioController',
606 610 size: 'lg',
607 611 resolve: {
608   - idCliente: function () { return cliente.cod; },
  612 + idCliente: function () { return $scope.notaPedido.cliente ? $scope.notaPedido.cliente.COD :
  613 + cliente.cod; },
609 614 esNuevo: function () { return cliente.esNuevo; }
610 615 }
611 616 }
... ... @@ -968,6 +973,8 @@ angular.module('focaCrearRemito').controller('remitoController',
968 973 if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) {
969 974 focaModalService.alert('Los valores deben ser al menos 1');
970 975 return;
  976 + } else if (tmpCantidad === "0" || tmpPrecio === "0") {
  977 + focaModalService.alert('Esta ingresando un producto con valor 0');
971 978 } else if (articulo.cantidad < 0 || articulo.precio < 0) {
972 979 focaModalService.alert('Los valores no pueden ser negativos');
973 980 return;
... ... @@ -8,7 +8,7 @@ angular.module(&#39;focaCrearRemito&#39;)
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
... ... @@ -76,9 +76,7 @@
76 76 foca-focus="articulo.editCantidad"
77 77 ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);"
78 78 esc-key="cancelarEditar(articulo)"
79   - ng-focus="selectFocus($event);
80   - tmpCantidad = articulo.cantidad;
81   - tmpPrecio = articulo.precio"
  79 + ng-focus="selectFocus($event); tmpCantidad = articulo.cantidad; tmpPrecio = articulo.precio"
82 80 teclado-virtual
83 81 >
84 82 <i
... ... @@ -124,7 +122,7 @@
124 122 </button>
125 123 <button
126 124 class="btn btn-outline-light"
127   - ng-click="editarArticulo(13, articulo)"
  125 + ng-click="editarArticulo(13, articulo);"
128 126 ng-show="articulo.editCantidad || articulo.editPrecio"
129 127 >
130 128 <i class="fa fa-save"></i>