Commit 71ac1c0cd300a7757b49adac37f80388001929a6
1 parent
436b00177a
Exists in
master
and in
1 other branch
agrega los plazo a la cabecera
Showing
2 changed files
with
21 additions
and
8 deletions
Show diff stats
package.json
| ... | ... | @@ -36,12 +36,12 @@ |
| 36 | 36 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", |
| 37 | 37 | "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", |
| 38 | 38 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", |
| 39 | - "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", | |
| 40 | 39 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
| 40 | + "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", | |
| 41 | 41 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
| 42 | 42 | "font-awesome": "^4.7.0", |
| 43 | 43 | "gulp": "^3.9.1", |
| 44 | - "gulp-angular-templatecache": "2.2.2", | |
| 44 | + "gulp-angular-templatecache": "^2.2.2", | |
| 45 | 45 | "gulp-clean": "^0.4.0", |
| 46 | 46 | "gulp-concat": "^2.6.1", |
| 47 | 47 | "gulp-connect": "^5.6.1", |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | "gulp-sequence": "^1.0.0", |
| 53 | 53 | "gulp-uglify": "^3.0.1", |
| 54 | 54 | "gulp-uglify-es": "^1.0.4", |
| 55 | - "jasmine-core": "^3.2.1", | |
| 55 | + "jasmine-core": "^3.3.0", | |
| 56 | 56 | "jquery": "^3.3.1", |
| 57 | 57 | "jshint": "^2.9.6", |
| 58 | 58 | "pre-commit": "^1.2.2", |
src/js/controller.js
| ... | ... | @@ -100,7 +100,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 100 | 100 | vendedor: $scope.notaPedido.vendedor.nombre, |
| 101 | 101 | idCliente: $scope.notaPedido.cliente.id, |
| 102 | 102 | domicilio: $scope.notaPedido.domicilio, |
| 103 | - precioCondicion: $scope.notaPedido.precioCondicion, | |
| 104 | 103 | bomba: $scope.notaPedido.bomba, |
| 105 | 104 | flete: $scope.notaPedido.flete, |
| 106 | 105 | total: $scope.getTotal() |
| ... | ... | @@ -300,11 +299,25 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 300 | 299 | ); |
| 301 | 300 | modalInstance.result.then( |
| 302 | 301 | function(precioCondicion) { |
| 303 | - $scope.notaPedido.precioCondicion = precioCondicion.nombre; | |
| 304 | - idLista = precioCondicion.idListaPrecio; | |
| 302 | + var cabecera = ''; | |
| 303 | + var plazosConcat = ''; | |
| 304 | + if(!Array.isArray(precioCondicion)) { | |
| 305 | + $scope.plazosPagos = precioCondicion.plazoPago; | |
| 306 | + idLista = precioCondicion.idListaPrecio; | |
| 307 | + for(var i = 0; i < precioCondicion.plazoPago.length; i++) { | |
| 308 | + plazosConcat += precioCondicion.plazoPago[i].dias + ' '; | |
| 309 | + } | |
| 310 | + cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); | |
| 311 | + } else { //Cuando se ingresan los plazos manualmente | |
| 312 | + idLista = -1; //-1, el modal productos busca todos los productos | |
| 313 | + $scope.notaPedido.plazoPago = precioCondicion; | |
| 314 | + for(var j = 0; j < precioCondicion.length; j++) { | |
| 315 | + plazosConcat += precioCondicion[j].dias + ' '; | |
| 316 | + } | |
| 317 | + cabecera = 'Ingreso manual ' + plazosConcat.trim(); | |
| 318 | + } | |
| 305 | 319 | $scope.articulosTabla = []; |
| 306 | - | |
| 307 | - addCabecera('Precios y condiciones:', precioCondicion.nombre); | |
| 320 | + addCabecera('Precios y condiciones:', cabecera); | |
| 308 | 321 | }, function() { |
| 309 | 322 | |
| 310 | 323 | } |