Commit 46dbc26d7cb62d2f41a0500da31acf4d0e646a06
Exists in
master
Merge branch 'master' into 'develop'
Master(mpuebla) See merge request !93
Showing
2 changed files
Show diff stats
package.json
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | "description": "Listado y ABM nota de pedidos", |
| 5 | 5 | "main": "index.js", |
| 6 | 6 | "scripts": { |
| 7 | + "refresh": "gulp uglify && cp tmp/foca-crear-nota-pedido.js ../wrapper-demo/node_modules/foca-crear-nota-pedido/dist/foca-crear-nota-pedido.min.js", | |
| 7 | 8 | "test": "test.html", |
| 8 | 9 | "compile": "gulp uglify", |
| 9 | 10 | "gulp-pre-commit": "gulp pre-commit", |
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 | } |