Commit 0fc4b5f3ea443c4db56a00e15ccdbe8ec5853928
1 parent
da7b3fb548
Exists in
master
Cambio en el seteo de la cabecera precios y condiciones.
Showing
1 changed file
with
17 additions
and
16 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -476,6 +476,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
476 | 476 | ); |
477 | 477 | modalInstance.result.then( |
478 | 478 | function (cliente) { |
479 | + cliente.mod = cliente.mod; | |
479 | 480 | $scope.abrirModalDomicilios(cliente); |
480 | 481 | $scope.cliente = cliente; |
481 | 482 | }, function () { } |
... | ... | @@ -637,27 +638,27 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
637 | 638 | controller: 'focaModalPrecioCondicionController', |
638 | 639 | size: 'lg', |
639 | 640 | resolve: { |
640 | - idListaPrecio: function () { | |
641 | - return $scope.notaPedido.cliente.MOD || null; | |
642 | - } | |
641 | + idListaPrecio: function () { return $scope.notaPedido.cliente.MOD || null; }, | |
642 | + idCliente: function () { return $scope.notaPedido.cliente.COD } | |
643 | 643 | } |
644 | 644 | } |
645 | 645 | ); |
646 | 646 | |
647 | - modalInstance.result.then( | |
648 | - function (precioCondicion) { | |
647 | + modalInstance.result | |
648 | + .then(function (precioCondicion) { | |
649 | 649 | var cabecera = ''; |
650 | 650 | var plazosConcat = ''; |
651 | 651 | if (!Array.isArray(precioCondicion)) { |
652 | 652 | $scope.notaPedido.notaPedidoPlazo = precioCondicion.plazoPago; |
653 | 653 | $scope.notaPedido.precioCondicion = precioCondicion; |
654 | - $scope.notaPedido.idPrecioCondicion = precioCondicion.id; | |
655 | - $scope.idLista = precioCondicion.idListaPrecio; | |
654 | + $scope.notaPedido.idPrecioCondicion = precioCondicion.listaPrecio.ID; | |
655 | + $scope.idLista = precioCondicion.listaPrecio.ID; | |
656 | 656 | for (var i = 0; i < precioCondicion.plazoPago.length; i++) { |
657 | - plazosConcat += precioCondicion.plazoPago[i].dias + ' '; | |
658 | - } | |
659 | - cabecera = $filter('rellenarDigitos')(precioCondicion.id, 4) + | |
660 | - ' - ' + precioCondicion.nombre + ' ' + plazosConcat.trim(); | |
657 | + plazosConcat += precioCondicion.plazoPago[i].dias + ', '; | |
658 | + } | |
659 | + var plazosConcat = plazosConcat.substring(0, plazosConcat.length - 2); | |
660 | + cabecera = $filter('rellenarDigitos')(precioCondicion.listaPrecio.ID, 4) + | |
661 | + ' - ' + precioCondicion.listaPrecio.DES + ' ' + plazosConcat.trim(); | |
661 | 662 | } else { //Cuando se ingresan los plazos manualmente |
662 | 663 | $scope.notaPedido.idPrecioCondicion = 0; |
663 | 664 | //-1, el modal productos busca todos los productos |
... | ... | @@ -676,10 +677,11 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
676 | 677 | |
677 | 678 | $filter('filter')($scope.botonera, |
678 | 679 | { label: 'Precios y Condiciones' })[0].checked = true; |
679 | - }, function () { | |
680 | + }) | |
681 | + .catch(function (e) { | |
682 | + console.log(e); | |
683 | + }) | |
680 | 684 | |
681 | - } | |
682 | - ); | |
683 | 685 | } |
684 | 686 | }; |
685 | 687 | |
... | ... | @@ -794,8 +796,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
794 | 796 | |
795 | 797 | $scope.agregarATabla = function (key) { |
796 | 798 | if (key === 13) { |
797 | - if (!$scope.articuloACargar.cantidad || !$scope.articuloACargar.precio) | |
798 | - { | |
799 | + if (!$scope.articuloACargar.cantidad || !$scope.articuloACargar.precio) { | |
799 | 800 | focaModalService.alert('El valor debe ser al menos 1'); |
800 | 801 | return; |
801 | 802 | } |