Commit 38b25c9d8e646ed4f947793bd9041bcbc70417b3
Exists in
master
and in
1 other branch
merge from upstream
Showing
6 changed files
Show diff stats
gulpfile.js
| ... | ... | @@ -45,7 +45,7 @@ gulp.task('uglify', ['templates'], function() { |
| 45 | 45 | uglify(), |
| 46 | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
| 47 | 47 | '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
| 48 | - '"focaModalFlete","focaDirectivas","focaModal"', ''), | |
| 48 | + '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio"', ''), | |
| 49 | 49 | gulp.dest(paths.dist) |
| 50 | 50 | ] |
| 51 | 51 | ); |
| ... | ... | @@ -82,3 +82,7 @@ gulp.task('clean-post-install', function() { |
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | 84 | gulp.task('default', ['webserver']); |
| 85 | + | |
| 86 | +gulp.task('watch', function() { | |
| 87 | + gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | |
| 88 | +}); |
index.html
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> |
| 23 | 23 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> |
| 24 | 24 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> |
| 25 | + <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> | |
| 25 | 26 | |
| 26 | 27 | <script src="src/js/app.js"></script> |
| 27 | 28 | <script src="src/js/controller.js"></script> |
package.json
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | "compile": "gulp uglify", |
| 9 | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 10 | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | - "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete git+https://debo.suite.repo/modulos-npm/foca-modal.git" | |
| 11 | + "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete git+https://debo.suite.repo/modulos-npm/foca-modal.git git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git" | |
| 12 | 12 | }, |
| 13 | 13 | "pre-commit": [ |
| 14 | 14 | "gulp-pre-commit" |
| ... | ... | @@ -34,6 +34,7 @@ |
| 34 | 34 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
| 35 | 35 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", |
| 36 | 36 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", |
| 37 | + "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", | |
| 37 | 38 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", |
| 38 | 39 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", |
| 39 | 40 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
src/js/app.js
src/js/controller.js
| 1 | 1 | angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 2 | 2 | [ |
| 3 | - '$scope', '$uibModal', '$location', 'crearNotaPedidoService', 'focaModalService', | |
| 4 | - function($scope, $uibModal, $location, crearNotaPedidoService, focaModalService) { | |
| 3 | + '$scope', '$uibModal', '$location', '$filter', 'crearNotaPedidoService', | |
| 4 | + 'focaModalService', | |
| 5 | + function( | |
| 6 | + $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService | |
| 7 | + ) { | |
| 5 | 8 | $scope.botonera = [ |
| 6 | 9 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, |
| 7 | 10 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, |
| 11 | + {texto: 'Proveedor', accion: function() {}}, | |
| 8 | 12 | {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, |
| 9 | 13 | { |
| 10 | 14 | texto: 'Precios y condiciones', |
| 11 | 15 | accion: function() {$scope.abrirModalListaPrecio();}}, |
| 12 | 16 | {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, |
| 13 | - {texto: 'Bomba', accion: function() {}}, | |
| 14 | - {texto: 'Detalle', accion: function() {}}, | |
| 15 | - {texto: 'Totales', accion: function() {}} | |
| 17 | + {texto: '', accion: function() {}}, | |
| 18 | + {texto: '', accion: function() {}} | |
| 16 | 19 | ]; |
| 17 | 20 | |
| 18 | 21 | $scope.show = false; |
| ... | ... | @@ -228,10 +231,29 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 228 | 231 | ); |
| 229 | 232 | return; |
| 230 | 233 | } |
| 231 | - $scope.domiciliosCliente = data.data; | |
| 234 | + var modalInstanceDomicilio = $uibModal.open( | |
| 235 | + { | |
| 236 | + ariaLabelledBy: 'Busqueda de Domicilios', | |
| 237 | + templateUrl: 'modal-domicilio.html', | |
| 238 | + controller: 'focaModalDomicilioController', | |
| 239 | + resolve: { idCliente: function() { return cliente.cod; }}, | |
| 240 | + size: 'lg', | |
| 241 | + backdrop: 'static', | |
| 242 | + } | |
| 243 | + ); | |
| 244 | + modalInstanceDomicilio.result.then( | |
| 245 | + function(domicilio) { | |
| 246 | + focaModalService.alert('Domicilio elegido' + domicilio.dom); | |
| 247 | + }, function() { | |
| 248 | + $scope.notaPedido.cliente.nombre = ''; | |
| 249 | + $scope.notaPedido.cliente.id = ''; | |
| 250 | + removeCabecera('Cliente:'); | |
| 251 | + $scope.seleccionarCliente(); | |
| 252 | + return; | |
| 253 | + } | |
| 254 | + ); | |
| 232 | 255 | } |
| 233 | 256 | ); |
| 234 | - | |
| 235 | 257 | addCabecera('Cliente:', cliente.nom); |
| 236 | 258 | }, function() { |
| 237 | 259 | |
| ... | ... | @@ -293,18 +315,33 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 293 | 315 | ariaLabelledBy: 'Busqueda de Flete', |
| 294 | 316 | templateUrl: 'modal-flete.html', |
| 295 | 317 | controller: 'focaModalFleteController', |
| 296 | - size: 'lg' | |
| 318 | + size: 'lg', | |
| 319 | + resolve: { | |
| 320 | + parametrosFlete: | |
| 321 | + function() { | |
| 322 | + return { | |
| 323 | + flete: $scope.notaPedido.flete, | |
| 324 | + bomba: $scope.notaPedido.bomba, | |
| 325 | + kilometros: $scope.notaPedido.kilometros | |
| 326 | + }; | |
| 327 | + } | |
| 328 | + } | |
| 297 | 329 | } |
| 298 | 330 | ); |
| 299 | 331 | modalInstance.result.then( |
| 300 | - function(flete) { | |
| 301 | - $scope.limpiarFlete(); | |
| 302 | - $scope.notaPedido.fleteNombre = flete.nombre; | |
| 303 | - $scope.notaPedido.fleteId = flete.id; | |
| 304 | - $scope.choferes = flete.chofer; | |
| 305 | - $scope.vehiculos = flete.vehiculo; | |
| 306 | - | |
| 307 | - addCabecera('Flete:', flete.nombre); | |
| 332 | + function(datos) { | |
| 333 | + $scope.notaPedido.flete = datos.flete; | |
| 334 | + $scope.notaPedido.bomba = datos.bomba; | |
| 335 | + $scope.notaPedido.kilometros = datos.kilometros; | |
| 336 | + | |
| 337 | + addCabecera('Flete:', datos.flete); | |
| 338 | + if(datos.flete === 'si') { | |
| 339 | + addCabecera('Bomba:', datos.bomba); | |
| 340 | + addCabecera('Kilometros:', datos.kilometros); | |
| 341 | + } else { | |
| 342 | + removeCabecera('Bomba:'); | |
| 343 | + removeCabecera('Kilometros:'); | |
| 344 | + } | |
| 308 | 345 | }, function() { |
| 309 | 346 | |
| 310 | 347 | } |
| ... | ... | @@ -403,22 +440,18 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 403 | 440 | }; |
| 404 | 441 | |
| 405 | 442 | function addCabecera(label, valor) { |
| 406 | - let existe = false; | |
| 407 | - | |
| 408 | - for (var i = $scope.cabecera.length - 1; i >= 0; i--) { | |
| 409 | - if ($scope.cabecera[i].label === label) { | |
| 410 | - $scope.cabecera[i].valor = valor; | |
| 411 | - existe = true; | |
| 412 | - break; | |
| 413 | - } | |
| 414 | - | |
| 443 | + var propiedad = $filter('filter')($scope.cabecera, {label: label}); | |
| 444 | + if(propiedad.length === 1) { | |
| 445 | + propiedad[0].valor = valor; | |
| 446 | + } else { | |
| 447 | + $scope.cabecera.push({label: label, valor: valor}); | |
| 415 | 448 | } |
| 416 | - | |
| 417 | - if (!existe) { | |
| 418 | - $scope.cabecera.push({ | |
| 419 | - label: label, | |
| 420 | - valor: valor | |
| 421 | - }); | |
| 449 | + } | |
| 450 | + | |
| 451 | + function removeCabecera(label) { | |
| 452 | + var propiedad = $filter('filter')($scope.cabecera, {label: label}); | |
| 453 | + if(propiedad.length === 1){ | |
| 454 | + $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); | |
| 422 | 455 | } |
| 423 | 456 | } |
| 424 | 457 | } |
src/views/nota-pedido.html
| ... | ... | @@ -5,13 +5,13 @@ |
| 5 | 5 | <div class="row p-1 panel-informativo"> |
| 6 | 6 | <div class="col-12"> |
| 7 | 7 | <div class="row"> |
| 8 | - <div class="col-3"> | |
| 9 | - {{ now | date:'dd/MM/yyyy HH:mm'}} | |
| 8 | + <div class="col-5"> | |
| 9 | + <div class="h4">NOTA DE PEDIDO</div> | |
| 10 | 10 | </div> |
| 11 | - <div class="col-6 text-center"> | |
| 12 | - <div class="h2">NOTA DE PEDIDO</div> | |
| 11 | + <div class="col-3">Nº {{puntoVenta}}-{{comprobante}}</div> | |
| 12 | + <div class="col-4 text-right"> | |
| 13 | + Fecha: {{ now | date:'dd/MM/yyyy HH:mm'}} | |
| 13 | 14 | </div> |
| 14 | - <div class="col-3 text-right">{{puntoVenta}}-{{comprobante}}</div> | |
| 15 | 15 | </div> |
| 16 | 16 | <div class="row"> |
| 17 | 17 | <div class="col-auto" ng-repeat="cab in cabecera"> |
| ... | ... | @@ -22,13 +22,23 @@ |
| 22 | 22 | </div> |
| 23 | 23 | </div> |
| 24 | 24 | <div class="row p-1 botonera-secundaria"> |
| 25 | - <div class=" col-12 col-sm-6 col-md-3 botonera" ng-repeat="boton in botonera"> | |
| 26 | - <button | |
| 27 | - type="button" | |
| 28 | - class="btn btn-default btn-block btn-xs" | |
| 29 | - ng-bind="boton.texto" | |
| 30 | - ng-click="boton.accion()" | |
| 31 | - ></button> | |
| 25 | + <div class="col-12"> | |
| 26 | + <div class="row"> | |
| 27 | + <div class="col-3 px-0 py-0" ng-repeat="boton in botonera"> | |
| 28 | + <button | |
| 29 | + type="button" | |
| 30 | + class="btn btn-default btn-block btn-xs text-left py-2" | |
| 31 | + ng-click="boton.accion()" | |
| 32 | + > | |
| 33 | + <i | |
| 34 | + class="fa fa-arrow-circle-right" | |
| 35 | + ng-show="boton.texto != ''" | |
| 36 | + ></i> | |
| 37 | + | |
| 38 | + {{boton.texto}} | |
| 39 | + </button> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 32 | 42 | </div> |
| 33 | 43 | </div> |
| 34 | 44 | </div> |
| ... | ... | @@ -40,11 +50,10 @@ |
| 40 | 50 | <table class="table table-striped table-sm table-dark"> |
| 41 | 51 | <thead> |
| 42 | 52 | <tr> |
| 43 | - <th>Sector</th> | |
| 44 | 53 | <th>Código</th> |
| 45 | 54 | <th>Descripción</th> |
| 46 | - <th>Precio Unitario</th> | |
| 47 | 55 | <th>Cantidad</th> |
| 56 | + <th>Precio Unitario</th> | |
| 48 | 57 | <th>SubTotal</th> |
| 49 | 58 | <th> |
| 50 | 59 | <button |
| ... | ... | @@ -71,21 +80,13 @@ |
| 71 | 80 | <tr ng-show="!cargando"> |
| 72 | 81 | <td><input |
| 73 | 82 | class="form-control" |
| 74 | - ng-model="articuloACargar.sector" | |
| 75 | - readonly></td> | |
| 76 | - <td><input | |
| 77 | - class="form-control" | |
| 78 | - ng-model="articuloACargar.codigo" | |
| 83 | + ng-model="articuloACargar.sector + '-' + articuloACargar.codigo" | |
| 79 | 84 | readonly></td> |
| 80 | 85 | <td><input |
| 81 | 86 | class="form-control" |
| 82 | 87 | ng-model="articuloACargar.descripcion" |
| 83 | 88 | readonly></td> |
| 84 | - <td><input | |
| 85 | - class="form-control" | |
| 86 | - ng-value="articuloACargar.precio | currency: '$'" | |
| 87 | - readonly></td> | |
| 88 | - <td><input | |
| 89 | + <td class="text-right"><input | |
| 89 | 90 | class="form-control" |
| 90 | 91 | type="number" |
| 91 | 92 | min="1" |
| ... | ... | @@ -93,7 +94,11 @@ |
| 93 | 94 | foca-focus="!cargando" |
| 94 | 95 | esc-key="resetFilter()" |
| 95 | 96 | ng-keypress="agregarATabla($event.keyCode)"></td> |
| 96 | - <td><input | |
| 97 | + <td class="text-right"><input | |
| 98 | + class="form-control" | |
| 99 | + ng-value="articuloACargar.precio | currency: '$'" | |
| 100 | + readonly></td> | |
| 101 | + <td class="text-right"><input | |
| 97 | 102 | class="form-control" |
| 98 | 103 | ng-value="getSubTotal() | currency: '$'" |
| 99 | 104 | readonly></td> |
| ... | ... | @@ -107,11 +112,9 @@ |
| 107 | 112 | ng-repeat="(key, articulo) in articulosTabla" |
| 108 | 113 | ng-show="show || key == 0" |
| 109 | 114 | > |
| 110 | - <td ng-bind="articulo.sector"></td> | |
| 111 | - <td ng-bind="articulo.codigo"></td> | |
| 115 | + <td ng-bind="articulo.sector + '-' + articulo.codigo"></td> | |
| 112 | 116 | <td ng-bind="articulo.descripcion"></td> |
| 113 | - <td ng-bind="articulo.precio | currency: '$'"></td> | |
| 114 | - <td><input | |
| 117 | + <td class="text-right"><input | |
| 115 | 118 | ng-show="articulo.edit" |
| 116 | 119 | ng-model="articulo.cantidad" |
| 117 | 120 | class="form-control" |
| ... | ... | @@ -128,7 +131,9 @@ |
| 128 | 131 | ng-bind="articulo.cantidad"> |
| 129 | 132 | </i> |
| 130 | 133 | </td> |
| 134 | + <td class="text-right" ng-bind="articulo.precio | currency: '$'"></td> | |
| 131 | 135 | <td |
| 136 | + class="text-right" | |
| 132 | 137 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> |
| 133 | 138 | </td> |
| 134 | 139 | <td class="text-center"> |
| ... | ... | @@ -141,7 +146,7 @@ |
| 141 | 146 | </td> |
| 142 | 147 | </tr> |
| 143 | 148 | <tr ng-show="cargando"> |
| 144 | - <td colspan="7"> | |
| 149 | + <td colspan="6"> | |
| 145 | 150 | <input |
| 146 | 151 | placeholder="Seleccione Articulo" |
| 147 | 152 | class="form-control form-control-sm" |
| ... | ... | @@ -153,7 +158,7 @@ |
| 153 | 158 | </tbody> |
| 154 | 159 | <tfoot> |
| 155 | 160 | <tr class=""> |
| 156 | - <td colspan="4"> | |
| 161 | + <td colspan="3"> | |
| 157 | 162 | <strong>Cantidad Items:</strong> |
| 158 | 163 | <a ng-bind="articulosTabla.length"></a> |
| 159 | 164 | </td> |
| ... | ... | @@ -161,29 +166,38 @@ |
| 161 | 166 | <td class="table-celda-total text-right" colspan="1"> |
| 162 | 167 | <h3>{{getTotal() | currency: '$'}}</h3> |
| 163 | 168 | </td> |
| 164 | - <td colspan="2"></td> | |
| 169 | + <td colspan="2" class="text-right"> | |
| 170 | + <button | |
| 171 | + type="button" | |
| 172 | + class="btn btn-default btn-sm" | |
| 173 | + > | |
| 174 | + Totales | |
| 175 | + </button> | |
| 176 | + </td> | |
| 165 | 177 | </tr> |
| 166 | 178 | </tfoot> |
| 167 | 179 | </table> |
| 168 | 180 | </div> |
| 169 | 181 | </div> |
| 170 | - <div class="col-auto my-2"> | |
| 171 | - <button | |
| 172 | - ng-click="crearNotaPedido()" | |
| 173 | - type="submit" | |
| 174 | - title="Crear nota pedido" | |
| 175 | - class="btn btn-default"> | |
| 176 | - Guardar | |
| 177 | - </button> | |
| 178 | - <br/> | |
| 179 | - <br/> | |
| 180 | - <button | |
| 181 | - ng-click="salir()" | |
| 182 | - type="button" | |
| 183 | - title="Salir" | |
| 184 | - class="btn btn-default"> | |
| 185 | - Salir | |
| 186 | - </button> | |
| 182 | + <div class="col-auto my-2 col-lg-2 botonera-lateral"> | |
| 183 | + <div class="row align-items-end"> | |
| 184 | + <div class="col-12"> | |
| 185 | + <button | |
| 186 | + ng-click="crearNotaPedido()" | |
| 187 | + type="submit" | |
| 188 | + title="Crear nota pedido" | |
| 189 | + class="btn btn-default btn-block mb-2"> | |
| 190 | + Guardar | |
| 191 | + </button> | |
| 192 | + <button | |
| 193 | + ng-click="salir()" | |
| 194 | + type="button" | |
| 195 | + title="Salir" | |
| 196 | + class="btn btn-default btn-block"> | |
| 197 | + Salir | |
| 198 | + </button> | |
| 199 | + </div> | |
| 200 | + </div> | |
| 187 | 201 | </div> |
| 188 | 202 | </div> |
| 189 | 203 | </div> |