diff --git a/src/js/businessService.js b/src/js/businessService.js index 6d84094..f022816 100644 --- a/src/js/businessService.js +++ b/src/js/businessService.js @@ -22,6 +22,11 @@ angular.module('focaCrearNotaPedido') idVendedor: idVendedor }; crearNotaPedidoService.crearEstadoParaNotaPedido(estado); + }, + calcularArticulos: function(articulos, cotizacion) { + for(var i = 0; i < articulos.length; i++) { + articulos[i].precio = articulos[i].precio / cotizacion; + } } }; }]); diff --git a/src/js/controller.js b/src/js/controller.js index 9f801b3..a903e27 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -161,7 +161,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', nombreCliente: $scope.notaPedido.cliente.NOM, cuitCliente: $scope.notaPedido.cliente.CUIT, idProveedor: $scope.notaPedido.proveedor.COD, - idDomicilio: $scope.notaPedido.domicilio.id, + //idDomicilio: $scope.notaPedido.domicilio.id,TODO GUARDAR DOMICILIO ID idCotizacion: $scope.notaPedido.cotizacion.ID, idPrecioCondicion: $scope.notaPedido.idPrecioCondicion, cotizacion: $scope.notaPedido.cotizacion.VENDEDOR, @@ -256,16 +256,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', removeCabecera('Cotizacion:'); var cabeceras = [ { - label: 'Moneda', + label: 'Moneda:', valor: notaPedido.cotizacion[0].moneda[0].DETALLE }, { - label: 'Fecha cotizacion', + label: 'Fecha cotizacion:', valor: $filter('date')(notaPedido.cotizacion[0].FECHA, 'dd/MM/yyyy') }, { - label: 'Cotizacion', + label: 'Cotizacion:', valor: notaPedido.cotizacion[0].VENDEDOR }, { @@ -321,6 +321,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', cabeceras.push(cabeceraBomba); } $scope.articulosTabla = notaPedido.articulosNotaPedido; + notaPedidoBusinessService.calcularArticulos($scope.articulosTabla, + notaPedido.cotizacion[0].VENDEDOR); if(notaPedido.precioCondicion.length > 0) { $scope.idLista = notaPedido.precioCondicion[0].idListaPrecio; } else { diff --git a/src/views/nota-pedido.html b/src/views/nota-pedido.html index 4a633a0..7ab2a8f 100644 --- a/src/views/nota-pedido.html +++ b/src/views/nota-pedido.html @@ -481,7 +481,9 @@ ng-click="crearNotaPedido()" type="submit" title="Crear nota pedido" - class="btn btn-default btn-block mb-2"> + class="btn btn-default btn-block mb-2" + ng-disabled="notaPedido.idRemito" + > Guardar