Commit 4ce4edd31a9613a37ea6766b277b94a68d235bae
Exists in
master
Merge branch 'master' of https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido
Showing
3 changed files
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
| ... | ... | @@ -17,6 +17,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 17 | 17 | {texto: '', accion: function() {}}, |
| 18 | 18 | {texto: '', accion: function() {}} |
| 19 | 19 | ]; |
| 20 | + $scope.datepickerAbierto = false; | |
| 20 | 21 | |
| 21 | 22 | $scope.show = false; |
| 22 | 23 | $scope.cargando = true; |
| ... | ... | @@ -101,7 +102,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 101 | 102 | vendedor: $scope.notaPedido.vendedor.nombre, |
| 102 | 103 | idCliente: $scope.notaPedido.cliente.id, |
| 103 | 104 | domicilio: $scope.notaPedido.domicilio, |
| 104 | - precioCondicion: $scope.notaPedido.precioCondicion, | |
| 105 | 105 | bomba: $scope.notaPedido.bomba, |
| 106 | 106 | flete: $scope.notaPedido.flete, |
| 107 | 107 | total: $scope.getTotal() |
| ... | ... | @@ -301,11 +301,25 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 301 | 301 | ); |
| 302 | 302 | modalInstance.result.then( |
| 303 | 303 | function(precioCondicion) { |
| 304 | - $scope.notaPedido.precioCondicion = precioCondicion.nombre; | |
| 305 | - idLista = precioCondicion.idListaPrecio; | |
| 304 | + var cabecera = ''; | |
| 305 | + var plazosConcat = ''; | |
| 306 | + if(!Array.isArray(precioCondicion)) { | |
| 307 | + $scope.plazosPagos = precioCondicion.plazoPago; | |
| 308 | + idLista = precioCondicion.idListaPrecio; | |
| 309 | + for(var i = 0; i < precioCondicion.plazoPago.length; i++) { | |
| 310 | + plazosConcat += precioCondicion.plazoPago[i].dias + ' '; | |
| 311 | + } | |
| 312 | + cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); | |
| 313 | + } else { //Cuando se ingresan los plazos manualmente | |
| 314 | + idLista = -1; //-1, el modal productos busca todos los productos | |
| 315 | + $scope.notaPedido.plazoPago = precioCondicion; | |
| 316 | + for(var j = 0; j < precioCondicion.length; j++) { | |
| 317 | + plazosConcat += precioCondicion[j].dias + ' '; | |
| 318 | + } | |
| 319 | + cabecera = 'Ingreso manual ' + plazosConcat.trim(); | |
| 320 | + } | |
| 306 | 321 | $scope.articulosTabla = []; |
| 307 | - | |
| 308 | - addCabecera('Precios y condiciones:', precioCondicion.nombre); | |
| 322 | + addCabecera('Precios y condiciones:', cabecera); | |
| 309 | 323 | }, function() { |
| 310 | 324 | |
| 311 | 325 | } |
src/views/nota-pedido.html
| 1 | 1 | <div class="crear-nota-pedido"> |
| 2 | - <form name="formCrearNota" ng-submit="crearNotaPedido()"> | |
| 2 | + <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> | |
| 3 | 3 | <div class="row"> |
| 4 | 4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> |
| 5 | 5 | <div class="row p-1 panel-informativo"> |
| ... | ... | @@ -9,8 +9,23 @@ |
| 9 | 9 | <h5>NOTA DE PEDIDO</h5> |
| 10 | 10 | </div> |
| 11 | 11 | <div class="col-6 col-sm-4 numero-pedido">Nº {{puntoVenta}}-{{comprobante}}</div> |
| 12 | - <div class="col-6 col-sm-4 text-right"> | |
| 13 | - Fecha: {{ now | date:'dd/MM/yyyy HH:mm'}} | |
| 12 | + <div class="col-6 col-sm-4 text-right crear-nota-pedido-fecha"> | |
| 13 | + Fecha: | |
| 14 | + <span | |
| 15 | + ng-show="!datepickerAbierto" | |
| 16 | + ng-bind="now | date:'dd/MM/yyyy HH:mm'" | |
| 17 | + ng-click="datepickerAbierto = true" | |
| 18 | + > | |
| 19 | + </span> | |
| 20 | + <input | |
| 21 | + ng-show="datepickerAbierto" | |
| 22 | + type="date" | |
| 23 | + ng-model="now" | |
| 24 | + ng-change="datepickerAbierto = false" | |
| 25 | + ng-blur="datepickerAbierto = false" | |
| 26 | + class="form-control form-control-sm col-8 float-right" | |
| 27 | + foca-focus="datepickerAbierto" | |
| 28 | + /> | |
| 14 | 29 | </div> |
| 15 | 30 | </div> |
| 16 | 31 | <div class="row"> |
| ... | ... | @@ -66,7 +81,7 @@ |
| 66 | 81 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
| 67 | 82 | <!-- PC --> |
| 68 | 83 | <div class="row grilla-articulo align-items-end"> |
| 69 | - <table class="table tabla-articulo table-striped table-sm table-dark"> | |
| 84 | + <table class="table tabla-articulo table-striped table-sm table-dark mb-0"> | |
| 70 | 85 | <thead> |
| 71 | 86 | <tr class="d-flex"> |
| 72 | 87 | <th class="">#</th> |