Commit 8c93aa230a71a6e370bb9b6ef350affbc961005b
1 parent
8fafa96188
Exists in
master
Fix precios según cotización
Showing
3 changed files
with
14 additions
and
5 deletions
Show diff stats
src/js/businessService.js
... | ... | @@ -22,6 +22,11 @@ angular.module('focaCrearNotaPedido') |
22 | 22 | idVendedor: idVendedor |
23 | 23 | }; |
24 | 24 | crearNotaPedidoService.crearEstadoParaNotaPedido(estado); |
25 | + }, | |
26 | + calcularArticulos: function(articulos, cotizacion) { | |
27 | + for(var i = 0; i < articulos.length; i++) { | |
28 | + articulos[i].precio = articulos[i].precio / cotizacion; | |
29 | + } | |
25 | 30 | } |
26 | 31 | }; |
27 | 32 | }]); |
src/js/controller.js
... | ... | @@ -161,7 +161,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
161 | 161 | nombreCliente: $scope.notaPedido.cliente.NOM, |
162 | 162 | cuitCliente: $scope.notaPedido.cliente.CUIT, |
163 | 163 | idProveedor: $scope.notaPedido.proveedor.COD, |
164 | - idDomicilio: $scope.notaPedido.domicilio.id, | |
164 | + //idDomicilio: $scope.notaPedido.domicilio.id,TODO GUARDAR DOMICILIO ID | |
165 | 165 | idCotizacion: $scope.notaPedido.cotizacion.ID, |
166 | 166 | idPrecioCondicion: $scope.notaPedido.idPrecioCondicion, |
167 | 167 | cotizacion: $scope.notaPedido.cotizacion.VENDEDOR, |
... | ... | @@ -256,16 +256,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
256 | 256 | removeCabecera('Cotizacion:'); |
257 | 257 | var cabeceras = [ |
258 | 258 | { |
259 | - label: 'Moneda', | |
259 | + label: 'Moneda:', | |
260 | 260 | valor: notaPedido.cotizacion[0].moneda[0].DETALLE |
261 | 261 | }, |
262 | 262 | { |
263 | - label: 'Fecha cotizacion', | |
263 | + label: 'Fecha cotizacion:', | |
264 | 264 | valor: $filter('date')(notaPedido.cotizacion[0].FECHA, |
265 | 265 | 'dd/MM/yyyy') |
266 | 266 | }, |
267 | 267 | { |
268 | - label: 'Cotizacion', | |
268 | + label: 'Cotizacion:', | |
269 | 269 | valor: notaPedido.cotizacion[0].VENDEDOR |
270 | 270 | }, |
271 | 271 | { |
... | ... | @@ -321,6 +321,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
321 | 321 | cabeceras.push(cabeceraBomba); |
322 | 322 | } |
323 | 323 | $scope.articulosTabla = notaPedido.articulosNotaPedido; |
324 | + notaPedidoBusinessService.calcularArticulos($scope.articulosTabla, | |
325 | + notaPedido.cotizacion[0].VENDEDOR); | |
324 | 326 | if(notaPedido.precioCondicion.length > 0) { |
325 | 327 | $scope.idLista = notaPedido.precioCondicion[0].idListaPrecio; |
326 | 328 | } else { |
src/views/nota-pedido.html
... | ... | @@ -481,7 +481,9 @@ |
481 | 481 | ng-click="crearNotaPedido()" |
482 | 482 | type="submit" |
483 | 483 | title="Crear nota pedido" |
484 | - class="btn btn-default btn-block mb-2"> | |
484 | + class="btn btn-default btn-block mb-2" | |
485 | + ng-disabled="notaPedido.idRemito" | |
486 | + > | |
485 | 487 | Guardar |
486 | 488 | </button> |
487 | 489 | <button |