Commit 8c656f6b867ab396adae97754778c3e60cfe86d1
Exists in
master
Merge branch 'develop' into 'master'
Develop See merge request !89
Showing
4 changed files
Show diff stats
src/js/businessService.js
src/js/controller.js
| ... | ... | @@ -20,6 +20,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 20 | 20 | $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) |
| 21 | 21 | { |
| 22 | 22 | config(); |
| 23 | + var cotizacionPArgentino = {}; | |
| 23 | 24 | |
| 24 | 25 | function config() { |
| 25 | 26 | // PARAMETROS INICIALES PARA FUNCIONAMIENTO DEL PROGRAMA |
| ... | ... | @@ -37,7 +38,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 37 | 38 | maxDate: new Date(), |
| 38 | 39 | minDate: new Date(2010, 0, 1) |
| 39 | 40 | }; |
| 40 | - | |
| 41 | + | |
| 41 | 42 | //SETEO BOTONERA LATERAL |
| 42 | 43 | $timeout(function() { |
| 43 | 44 | focaBotoneraLateralService.showSalir(false); |
| ... | ... | @@ -50,26 +51,18 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 50 | 51 | if (APP === 'distribuidor') { |
| 51 | 52 | $scope.idVendedor = focaLoginService.getLoginData().vendedorCobrador; |
| 52 | 53 | } |
| 53 | - //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' | |
| 54 | - //Trabajo con el proveedor YPF, por eso uso siempre la primera | |
| 55 | - | |
| 56 | - var promiseMoneda = crearNotaPedidoService.getCotizacionByIdMoneda(1); | |
| 57 | - var promiseProveedor = crearNotaPedidoService.getProveedorById(1); | |
| 58 | 54 | |
| 59 | - Promise.all([promiseMoneda, promiseProveedor]).then(function(res) { | |
| 60 | - var monedaPorDefecto = res[0].data[0]; | |
| 61 | - $scope.notaPedido.cotizacion = Object.assign( | |
| 62 | - {moneda: monedaPorDefecto}, | |
| 63 | - monedaPorDefecto.cotizaciones[0] | |
| 64 | - ); | |
| 65 | - $scope.inicial.cotizacion = $scope.notaPedido.cotizacion; | |
| 66 | - var proveedorPorDefecto = res[1].data[0]; | |
| 67 | - $scope.notaPedido.proveedor = Object.assign( | |
| 68 | - {proveedor: proveedorPorDefecto} | |
| 69 | - ); | |
| 70 | - $scope.inicial.proveedor = $scope.notaPedido.proveedor; | |
| 71 | - | |
| 72 | - $timeout(function() {getLSNotaPedido();}); | |
| 55 | + crearNotaPedidoService.getParametros().then(function(res) { | |
| 56 | + var parametros = JSON.parse(res.data[0].jsonText); | |
| 57 | + if ($localStorage.notaPedido) { | |
| 58 | + $timeout(function() { getLSNotaPedido();} ); | |
| 59 | + } else { | |
| 60 | + for (var property in parametros) { | |
| 61 | + $scope.notaPedido[property] = parametros[property]; | |
| 62 | + $scope.inicial[property] = parametros[property]; | |
| 63 | + } | |
| 64 | + setearNotaPedido($scope.notaPedido); | |
| 65 | + } | |
| 73 | 66 | }); |
| 74 | 67 | |
| 75 | 68 | init(); |
| ... | ... | @@ -89,9 +82,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 89 | 82 | cotizacion: {}, |
| 90 | 83 | articulosNotaPedido: [], |
| 91 | 84 | notaPedidoPlazo: [], |
| 92 | - notaPedidoPuntoDescarga: { | |
| 93 | - puntoDescarga: {} | |
| 94 | - } | |
| 85 | + notaPedidoPuntoDescarga: [] | |
| 95 | 86 | }; |
| 96 | 87 | $scope.idLista = undefined; |
| 97 | 88 | |
| ... | ... | @@ -122,6 +113,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 122 | 113 | }); |
| 123 | 114 | |
| 124 | 115 | $scope.notaPedido.vendedor = vendedor; |
| 116 | + $scope.inicial.vendedor = $scope.notaPedido.vendedor; | |
| 125 | 117 | } |
| 126 | 118 | ); |
| 127 | 119 | } |
| ... | ... | @@ -230,7 +222,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 230 | 222 | focaBotoneraLateralService.endGuardar(true); |
| 231 | 223 | $scope.saveLoading = false; |
| 232 | 224 | |
| 233 | - init(); | |
| 225 | + config(); | |
| 234 | 226 | }, function(error) { |
| 235 | 227 | focaModalService.alert('Hubo un error al crear la nota de pedido'); |
| 236 | 228 | focaBotoneraLateralService.endGuardar(); |
| ... | ... | @@ -297,7 +289,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 297 | 289 | editCantidad: false, |
| 298 | 290 | editPrecio: false, |
| 299 | 291 | rubro: producto.CodRub, |
| 300 | - exentoUnitario: producto.precio, | |
| 301 | 292 | ivaUnitario: producto.IMPIVA, |
| 302 | 293 | impuestoInternoUnitario: producto.ImpInt, |
| 303 | 294 | impuestoInterno1Unitario: producto.ImpInt2, |
| ... | ... | @@ -305,8 +296,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 305 | 296 | precioLista: producto.precio, |
| 306 | 297 | combustible: 1, |
| 307 | 298 | facturado: 0, |
| 308 | - idArticulo: producto.id | |
| 299 | + idArticulo: producto.id, | |
| 300 | + tasaIva: producto.tasaIVA | |
| 309 | 301 | }; |
| 302 | + | |
| 303 | + newArt.exentoUnitario = newArt.ivaUnitario ? 0 : producto.neto; | |
| 304 | + newArt.netoUnitario = newArt.ivaUnitario ? producto.neto : 0; | |
| 305 | + | |
| 310 | 306 | $scope.articuloACargar = newArt; |
| 311 | 307 | $scope.cargando = false; |
| 312 | 308 | }, function() { |
| ... | ... | @@ -339,7 +335,14 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 339 | 335 | ); |
| 340 | 336 | modalInstance.result.then( |
| 341 | 337 | function(puntoDescarga) { |
| 342 | - $scope.notaPedido.notaPedidoPuntoDescarga = puntoDescarga; | |
| 338 | + | |
| 339 | + puntoDescarga.forEach(function(punto) { | |
| 340 | + $scope.notaPedido.notaPedidoPuntoDescarga.push( | |
| 341 | + { | |
| 342 | + puntoDescarga: punto | |
| 343 | + } | |
| 344 | + ) | |
| 345 | + }); | |
| 343 | 346 | |
| 344 | 347 | $scope.$broadcast('addCabecera', { |
| 345 | 348 | label: 'Puntos de descarga:', |
| ... | ... | @@ -403,6 +406,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 403 | 406 | $scope.notaPedido.bomba = false; |
| 404 | 407 | $scope.notaPedido.kilometros = null; |
| 405 | 408 | } |
| 409 | + | |
| 410 | + $filter('filter')($scope.botonera, | |
| 411 | + { label: 'Proveedor'})[0].checked = true; | |
| 406 | 412 | }, function() { |
| 407 | 413 | $scope.seleccionarTransportista(); |
| 408 | 414 | } |
| ... | ... | @@ -548,26 +554,24 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 548 | 554 | domicilio.Localidad + ', ' + domicilio.Provincia; |
| 549 | 555 | $scope.notaPedido.domicilioStamp = domicilioStamp; |
| 550 | 556 | |
| 551 | - $scope.notaPedido.notaPedidoPuntoDescarga = domicilio.puntoDescarga; | |
| 552 | - | |
| 553 | 557 | $scope.$broadcast('addCabecera', { |
| 554 | 558 | label: 'Cliente:', |
| 555 | 559 | valor: $filter('rellenarDigitos')(cliente.cod, 5) + ' - ' + cliente.nom |
| 556 | 560 | }); |
| 561 | + | |
| 557 | 562 | $scope.$broadcast('addCabecera', { |
| 558 | 563 | label: 'Domicilio:', |
| 559 | 564 | valor: domicilioStamp |
| 560 | 565 | }); |
| 566 | + | |
| 561 | 567 | if (domicilio.verPuntos) { |
| 562 | 568 | delete $scope.notaPedido.domicilio.verPuntos; |
| 563 | 569 | $scope.seleccionarPuntosDeDescarga(); |
| 564 | - } else { | |
| 565 | - crearNotaPedidoService | |
| 566 | - .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) | |
| 567 | - .then(function(res) { | |
| 568 | - if (res.data.length) $scope.seleccionarPuntosDeDescarga(); | |
| 569 | - }); | |
| 570 | 570 | } |
| 571 | + | |
| 572 | + // Seteo checked en botonera | |
| 573 | + $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = true; | |
| 574 | + | |
| 571 | 575 | }, function() { |
| 572 | 576 | $scope.seleccionarCliente(true); |
| 573 | 577 | return; |
| ... | ... | @@ -598,11 +602,12 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 598 | 602 | return; |
| 599 | 603 | } |
| 600 | 604 | if ($scope.notaPedido.articulosNotaPedido.length !== 0) { |
| 601 | - focaModalService.confirm('Se perderan los productos ingresados').then(function(data) { | |
| 602 | - if (data) { | |
| 603 | - abrirModal(); | |
| 604 | - } | |
| 605 | - }); | |
| 605 | + focaModalService.confirm('Se perderan los productos ingresados') | |
| 606 | + .then(function(data) { | |
| 607 | + if (data) { | |
| 608 | + abrirModal(); | |
| 609 | + } | |
| 610 | + }); | |
| 606 | 611 | } else if (validarNotaRemitada()) { |
| 607 | 612 | abrirModal(); |
| 608 | 613 | } |
| ... | ... | @@ -650,6 +655,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 650 | 655 | label: 'Precios y condiciones:', |
| 651 | 656 | valor: cabecera |
| 652 | 657 | }); |
| 658 | + | |
| 659 | + $filter('filter')($scope.botonera, | |
| 660 | + { label: 'Precios y Condiciones'})[0].checked = true; | |
| 653 | 661 | }, function() { |
| 654 | 662 | |
| 655 | 663 | } |
| ... | ... | @@ -676,9 +684,21 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 676 | 684 | }; |
| 677 | 685 | focaModalService.modal(parametrosModal).then( |
| 678 | 686 | function(moneda) { |
| 679 | - $scope.abrirModalCotizacion(moneda); | |
| 680 | - }, function() { | |
| 681 | 687 | |
| 688 | + if (moneda.ID !== 1) { | |
| 689 | + $scope.abrirModalCotizacion(moneda); | |
| 690 | + return; | |
| 691 | + } | |
| 692 | + | |
| 693 | + crearNotaPedidoService.getCotizacionByIdMoneda(1) | |
| 694 | + .then(function (res) { | |
| 695 | + | |
| 696 | + cotizacionPArgentino = res.data[0].cotizaciones[0]; | |
| 697 | + cotizacionPArgentino.moneda = moneda; | |
| 698 | + | |
| 699 | + actualizarCabeceraMoneda(cotizacionPArgentino); | |
| 700 | + $scope.notaPedido.cotizacion = cotizacionPArgentino; | |
| 701 | + }); | |
| 682 | 702 | } |
| 683 | 703 | ); |
| 684 | 704 | } |
| ... | ... | @@ -715,40 +735,45 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 715 | 735 | ); |
| 716 | 736 | modalInstance.result.then( |
| 717 | 737 | function(cotizacion) { |
| 718 | - var articulosTablaTemp = $scope.notaPedido.articulosNotaPedido || []; | |
| 719 | - for (var i = 0; i < articulosTablaTemp.length; i++) { | |
| 720 | - articulosTablaTemp[i].precio = articulosTablaTemp[i].precio * | |
| 721 | - $scope.notaPedido.cotizacion.VENDEDOR; | |
| 722 | - articulosTablaTemp[i].precio = articulosTablaTemp[i].precio / | |
| 723 | - cotizacion.VENDEDOR; | |
| 724 | - } | |
| 725 | - $scope.notaPedido.articulosNotaPedido = articulosTablaTemp; | |
| 738 | + | |
| 739 | + cotizacion.moneda = moneda; | |
| 740 | + actualizarCabeceraMoneda(cotizacion); | |
| 741 | + | |
| 726 | 742 | $scope.notaPedido.cotizacion = cotizacion; |
| 727 | - $scope.notaPedido.cotizacion.moneda = moneda; | |
| 728 | - if (moneda.DETALLE === 'PESOS ARGENTINOS') { | |
| 729 | - $scope.$broadcast('removeCabecera', 'Moneda:'); | |
| 730 | - $scope.$broadcast('removeCabecera', 'Fecha cotizacion:'); | |
| 731 | - $scope.$broadcast('removeCabecera', 'Cotizacion:'); | |
| 732 | - } else { | |
| 733 | - $scope.$broadcast('addCabecera', { | |
| 734 | - label: 'Moneda:', | |
| 735 | - valor: moneda.DETALLE | |
| 736 | - }); | |
| 737 | - $scope.$broadcast('addCabecera', { | |
| 738 | - label: 'Fecha cotizacion:', | |
| 739 | - valor: $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | |
| 740 | - }); | |
| 741 | - $scope.$broadcast('addCabecera', { | |
| 742 | - label: 'Cotizacion:', | |
| 743 | - valor: $filter('number')(cotizacion.VENDEDOR, '2') | |
| 744 | - }); | |
| 745 | - } | |
| 743 | + $filter('filter')($scope.botonera, { label: 'Moneda'})[0].checked = true; | |
| 746 | 744 | }, function() { |
| 747 | 745 | |
| 748 | 746 | } |
| 749 | 747 | ); |
| 750 | 748 | }; |
| 751 | 749 | |
| 750 | + function actualizarCabeceraMoneda (cotizacion) { | |
| 751 | + | |
| 752 | + $scope.notaPedido.articulosNotaPedido.forEach(function(art) { | |
| 753 | + art.precio = (art.precio * $scope.notaPedido.cotizacion.VENDEDOR).toFixed(4); | |
| 754 | + art.precio = (art.precio / cotizacion.VENDEDOR).toFixed(4); | |
| 755 | + }); | |
| 756 | + | |
| 757 | + if (cotizacion.moneda.DETALLE === 'PESOS ARGENTINOS') { | |
| 758 | + $scope.$broadcast('removeCabecera', 'Moneda:'); | |
| 759 | + $scope.$broadcast('removeCabecera', 'Fecha cotizacion:'); | |
| 760 | + $scope.$broadcast('removeCabecera', 'Cotizacion:'); | |
| 761 | + } else { | |
| 762 | + $scope.$broadcast('addCabecera', { | |
| 763 | + label: 'Moneda:', | |
| 764 | + valor: cotizacion.moneda.DETALLE | |
| 765 | + }); | |
| 766 | + $scope.$broadcast('addCabecera', { | |
| 767 | + label: 'Fecha cotizacion:', | |
| 768 | + valor: $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | |
| 769 | + }); | |
| 770 | + $scope.$broadcast('addCabecera', { | |
| 771 | + label: 'Cotizacion:', | |
| 772 | + valor: $filter('number')(cotizacion.VENDEDOR, '2') | |
| 773 | + }); | |
| 774 | + } | |
| 775 | + } | |
| 776 | + | |
| 752 | 777 | $scope.agregarATabla = function(key) { |
| 753 | 778 | if (key === 13) { |
| 754 | 779 | if ($scope.articuloACargar.cantidad === undefined || |
| ... | ... | @@ -767,7 +792,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 767 | 792 | $scope.notaPedido.articulosNotaPedido.splice(key, 1); |
| 768 | 793 | }; |
| 769 | 794 | |
| 770 | - $scope.editarArticulo = function(key, articulo, tmpCantidad, tmpPrecio) { | |
| 795 | + $scope.editarArticulo = function(key, articulo, tmpCantidad, tmpPrecio) { | |
| 771 | 796 | if (key === 13) { |
| 772 | 797 | if (!articulo.cantidad || !articulo.precio) { |
| 773 | 798 | focaModalService.alert('Los valores deben ser al menos 1'); |
| ... | ... | @@ -785,8 +810,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 785 | 810 | |
| 786 | 811 | $scope.cancelarEditar = function(articulo) { |
| 787 | 812 | $scope.tmpCantidad = articulo.cantidad; |
| 788 | - $scope.tmpPrecio = articulo.precio; | |
| 789 | - articulo.editCantidad = articulo.editPrecio = false; | |
| 813 | + $scope.tmpPrecio = articulo.precio; | |
| 814 | + articulo.editCantidad = articulo.editPrecio = false; | |
| 790 | 815 | }; |
| 791 | 816 | |
| 792 | 817 | $scope.cambioEdit = function(articulo, propiedad) { |
| ... | ... | @@ -827,6 +852,17 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 827 | 852 | articulo.precio = parseFloat(articulo.precio); |
| 828 | 853 | }; |
| 829 | 854 | |
| 855 | + // TODO: quitar watch usar función de articulos pedido cuando se haga | |
| 856 | + $scope.$watch('notaPedido.articulosNotaPedido', function() { | |
| 857 | + if ($scope.notaPedido.articulosNotaPedido.length) { | |
| 858 | + $filter('filter')($scope.botonera, | |
| 859 | + { label: 'Productos'})[0].checked = true; | |
| 860 | + } else { | |
| 861 | + $filter('filter')($scope.botonera, | |
| 862 | + { label: 'Productos'})[0].checked = false; | |
| 863 | + } | |
| 864 | + }, true); | |
| 865 | + | |
| 830 | 866 | function setearNotaPedido(notaPedido) { |
| 831 | 867 | //añado cabeceras |
| 832 | 868 | $scope.notaPedido = notaPedido; |
| ... | ... | @@ -858,6 +894,10 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 858 | 894 | }); |
| 859 | 895 | } |
| 860 | 896 | |
| 897 | + if (notaPedido.cotizacion.moneda) { | |
| 898 | + $filter('filter')($scope.botonera, { label: 'Moneda'})[0].checked = true; | |
| 899 | + } | |
| 900 | + | |
| 861 | 901 | if (notaPedido.vendedor.NUM) { |
| 862 | 902 | cabeceras.push({ |
| 863 | 903 | label: 'Vendedor:', |
| ... | ... | @@ -875,6 +915,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 875 | 915 | label: 'Domicilio:', |
| 876 | 916 | valor: notaPedido.domicilioStamp |
| 877 | 917 | }); |
| 918 | + | |
| 919 | + $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = true; | |
| 878 | 920 | } |
| 879 | 921 | |
| 880 | 922 | if (notaPedido.proveedor.COD) { |
| ... | ... | @@ -883,6 +925,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 883 | 925 | valor: $filter('rellenarDigitos')(notaPedido.proveedor.COD, 5) + |
| 884 | 926 | ' - ' + notaPedido.proveedor.NOM |
| 885 | 927 | }); |
| 928 | + | |
| 929 | + $filter('filter')($scope.botonera, { label: 'Proveedor'})[0].checked = true; | |
| 886 | 930 | } |
| 887 | 931 | |
| 888 | 932 | if (notaPedido.notaPedidoPlazo.length) { |
| ... | ... | @@ -892,6 +936,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 892 | 936 | notaPedidoBusinessService |
| 893 | 937 | .plazoToString(notaPedido.notaPedidoPlazo) |
| 894 | 938 | }); |
| 939 | + | |
| 940 | + $filter('filter')($scope.botonera, | |
| 941 | + { label: 'Precios y condiciones'})[0].checked = true; | |
| 895 | 942 | } |
| 896 | 943 | |
| 897 | 944 | if (notaPedido.flete !== undefined) { |
| ... | ... | @@ -927,7 +974,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 927 | 974 | |
| 928 | 975 | if (notaPedido.idPrecioCondicion > 0) { |
| 929 | 976 | $scope.idLista = notaPedido.precioCondicion.idListaPrecio; |
| 930 | - } else { | |
| 977 | + } else if (notaPedido.idPrecioCondicion) { | |
| 931 | 978 | $scope.idLista = -1; |
| 932 | 979 | } |
| 933 | 980 | |
| ... | ... | @@ -939,9 +986,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 939 | 986 | notaPedido.numeroNotaPedido, 8 |
| 940 | 987 | ); |
| 941 | 988 | |
| 942 | - if (notaPedido.notaPedidoPuntoDescarga) { | |
| 989 | + if (notaPedido.notaPedidoPuntoDescarga.length) { | |
| 943 | 990 | var puntos = []; |
| 944 | - notaPedido.notaPedidoPuntoDescarga.forEach(function(notaPedidoPuntoDescarga, idx, arr) { | |
| 991 | + notaPedido.notaPedidoPuntoDescarga.forEach(function(notaPedidoPuntoDescarga) { | |
| 945 | 992 | puntos.push(notaPedidoPuntoDescarga.puntoDescarga); |
| 946 | 993 | }); |
| 947 | 994 | cabeceras.push({ |
| ... | ... | @@ -950,10 +997,17 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 950 | 997 | }); |
| 951 | 998 | } |
| 952 | 999 | |
| 1000 | + if ($scope.notaPedido.articulosNotaPedido.length) { | |
| 1001 | + $scope.notaPedido.articulosNotaPedido.forEach(function (articulo) { | |
| 1002 | + articulo.precio = | |
| 1003 | + (articulo.precio / $scope.notaPedido.cotizacion.VENDEDOR).toFixed(4); | |
| 1004 | + }); | |
| 1005 | + } | |
| 1006 | + | |
| 953 | 1007 | addArrayCabecera(cabeceras); |
| 954 | 1008 | } |
| 955 | 1009 | |
| 956 | - function getCabeceraPuntoDescarga(puntoDescarga){ | |
| 1010 | + function getCabeceraPuntoDescarga(puntoDescarga) { | |
| 957 | 1011 | var puntosStamp = ''; |
| 958 | 1012 | puntoDescarga.forEach(function(punto, idx, arr) { |
| 959 | 1013 | puntosStamp += punto.descripcion; |
| ... | ... | @@ -1009,13 +1063,14 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 1009 | 1063 | } |
| 1010 | 1064 | |
| 1011 | 1065 | function deleteCliente() { |
| 1012 | - delete $scope.notaPedido.domicilioStamp; | |
| 1013 | - delete $scope.notaPedido.notaPedidoPuntoDescarga; | |
| 1066 | + $scope.notaPedido.domicilioStamp = ''; | |
| 1067 | + $scope.notaPedido.notaPedidoPuntoDescarga = []; | |
| 1014 | 1068 | $scope.notaPedido.domicilio = {dom: ''}; |
| 1015 | 1069 | $scope.notaPedido.cliente = {}; |
| 1016 | 1070 | $scope.$broadcast('removeCabecera', 'Cliente:'); |
| 1017 | 1071 | $scope.$broadcast('removeCabecera', 'Domicilio:'); |
| 1018 | 1072 | $scope.$broadcast('removeCabecera', 'Puntos de descarga:'); |
| 1073 | + $filter('filter')($scope.botonera, { label: 'Cliente'})[0].checked = false; | |
| 1019 | 1074 | } |
| 1020 | 1075 | } |
| 1021 | 1076 | ]); |
src/js/service.js
| ... | ... | @@ -97,7 +97,9 @@ angular.module('focaCrearNotaPedido') |
| 97 | 97 | }, |
| 98 | 98 | getProveedorById: function(id) { |
| 99 | 99 | return $http.get(API_ENDPOINT.URL + '/proveedor/' + id); |
| 100 | + }, | |
| 101 | + getParametros: function() { | |
| 102 | + return $http.get(API_ENDPOINT.URL + '/parametros/' + 'notaPedido') | |
| 100 | 103 | } |
| 101 | - | |
| 102 | 104 | }; |
| 103 | 105 | }]); |
src/views/nota-pedido.html
| ... | ... | @@ -94,7 +94,7 @@ |
| 94 | 94 | ng-model="tmpPrecio" |
| 95 | 95 | class="form-control" |
| 96 | 96 | foca-tipo-input |
| 97 | - min="1" | |
| 97 | + min="0" | |
| 98 | 98 | step="0.0001" |
| 99 | 99 | foca-focus="articulo.editPrecio" |
| 100 | 100 | ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);" |
| ... | ... | @@ -163,14 +163,14 @@ |
| 163 | 163 | ng-model="articuloACargar.cantidad" |
| 164 | 164 | foca-focus="!cargando" |
| 165 | 165 | esc-key="resetFilter()" |
| 166 | - ng-keypress="agregarATabla($event.keyCode)" | |
| 166 | + ng-keypress="agregarATabla($event.keyCode)" | |
| 167 | 167 | teclado-virtual |
| 168 | 168 | > |
| 169 | 169 | </td> |
| 170 | 170 | <td class="col text-right"> |
| 171 | 171 | <input |
| 172 | 172 | class="form-control" |
| 173 | - ng-value="articuloACargar.precio | number: 2" | |
| 173 | + ng-value="articuloACargar.precio | number: 4" | |
| 174 | 174 | ng-show="idLista != -1" |
| 175 | 175 | readonly |
| 176 | 176 | > |
| ... | ... | @@ -215,7 +215,7 @@ |
| 215 | 215 | <td class="text-right no-border-top"> |
| 216 | 216 | <button |
| 217 | 217 | type="button" |
| 218 | - class="btn btn-default btn-sm" | |
| 218 | + class="btn btn-sm" | |
| 219 | 219 | > |
| 220 | 220 | Totales |
| 221 | 221 | </button> |