Commit 44e9157d362b3393e138c81212b1fb080b79ce49
1 parent
275df735ff
Exists in
master
and in
1 other branch
numero remito verdadero
Showing
5 changed files
with
34 additions
and
8 deletions
Show diff stats
index.html
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
14 | 14 | <script src="node_modules/angular/angular.min.js"></script> |
15 | 15 | <script src="node_modules/angular-route/angular-route.min.js"></script> |
16 | + <script src="node_modules/angular-cookies/angular-cookies.min.js"></script> | |
16 | 17 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
17 | 18 | <script src="node_modules/ladda/dist/spin.min.js"></script> |
18 | 19 | <script src="node_modules/ladda/dist/ladda.min.js"></script> |
... | ... | @@ -28,6 +29,7 @@ |
28 | 29 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> |
29 | 30 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> |
30 | 31 | <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> |
32 | + <script src="./node_modules/foca-configuracion/dist/foca-configuracion.min.js"></script> | |
31 | 33 | <script src="node_modules/foca-modal-moneda/dist/foca-modal-moneda.min.js"></script> |
32 | 34 | <script src="node_modules/foca-modal-cotizacion/dist/foca-modal-cotizacion.min.js"></script> |
33 | 35 | <script src="node_modules/foca-seguimiento/dist/foca-seguimiento.min.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-ladda ladda@1.0.6 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-proveedor.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 git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git git+https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git" | |
11 | + "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 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-proveedor.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 git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git git+https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git git+https://debo.suite.repo/modulos-npm/foca-configuracion.git" | |
12 | 12 | }, |
13 | 13 | "pre-commit": [ |
14 | 14 | "gulp-pre-commit" |
... | ... | @@ -63,6 +63,8 @@ |
63 | 63 | "ladda": "1.0.6", |
64 | 64 | "pre-commit": "^1.2.2", |
65 | 65 | "pump": "^3.0.0", |
66 | - "ui-bootstrap4": "^3.0.5" | |
66 | + "ui-bootstrap4": "^3.0.5", | |
67 | + "angular-cookies": "^1.7.5", | |
68 | + "foca-configuracion": "git+https://debo.suite.repo/modulos-npm/foca-configuracion.git" | |
67 | 69 | } |
68 | 70 | } |
src/js/app.js
1 | 1 | angular.module('focaCrearRemito', [ |
2 | 2 | 'ngRoute', |
3 | + 'ngCookies', | |
3 | 4 | 'ui.bootstrap', |
4 | 5 | 'focaModalVendedores', |
5 | 6 | 'focaBusquedaProductos', |
... | ... | @@ -12,7 +13,6 @@ angular.module('focaCrearRemito', [ |
12 | 13 | 'focaModalDomicilio', |
13 | 14 | 'focaModalMoneda', |
14 | 15 | 'focaModalCotizacion', |
15 | - 'focaSeguimiento', | |
16 | - 'angular-ladda', | |
17 | - 'cordovaGeolocationModule' | |
16 | + 'focaConfiguracion', | |
17 | + 'angular-ladda' | |
18 | 18 | ]); |
src/js/controller.js
1 | 1 | angular.module('focaCrearRemito') .controller('remitoController', |
2 | 2 | [ |
3 | 3 | '$scope', '$uibModal', '$location', '$filter', 'crearRemitoService', |
4 | - 'focaModalService', 'focaSeguimientoService', 'remitoBusinessService', | |
4 | + 'focaModalService', 'remitoBusinessService', | |
5 | 5 | function( |
6 | 6 | $scope, $uibModal, $location, $filter, crearRemitoService, focaModalService, |
7 | - focaSeguimientoService, remitoBusinessService | |
7 | + remitoBusinessService | |
8 | 8 | ) { |
9 | 9 | $scope.botonera = [ |
10 | 10 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, |
... | ... | @@ -69,6 +69,17 @@ angular.module('focaCrearRemito') .controller('remitoController', |
69 | 69 | $scope.precioCondiciones = res.data; |
70 | 70 | } |
71 | 71 | ); |
72 | + | |
73 | + crearRemitoService.getNumeroRemito().then( | |
74 | + function(res) { | |
75 | + $scope.puntoVenta = rellenar(res.data.sucursal, 4); | |
76 | + $scope.comprobante = rellenar(res.data.numeroNotaPedido, 8); | |
77 | + }, | |
78 | + function(err) { | |
79 | + focaModalService.alert('La terminal no esta configurada correctamente'); | |
80 | + console.info(err); | |
81 | + } | |
82 | + ); | |
72 | 83 | //La pantalla solo se usa para cargar remitos |
73 | 84 | // if (remitoTemp !== undefined) { |
74 | 85 | // remitoTemp.fechaCarga = new Date(remitoTemp.fechaCarga); |
... | ... | @@ -164,7 +175,6 @@ angular.module('focaCrearRemito') .controller('remitoController', |
164 | 175 | function(data) { |
165 | 176 | remitoBusinessService.addArticulos($scope.articulosTabla, |
166 | 177 | data.data.id, $scope.remito.cotizacion.COTIZACION); |
167 | - focaSeguimientoService.guardarPosicion('crear nota remito', ''); | |
168 | 178 | var plazos = $scope.plazosPagos; |
169 | 179 | for(var j = 0; j < plazos.length; j++) { |
170 | 180 | var json = { |
... | ... | @@ -580,6 +590,15 @@ angular.module('focaCrearRemito') .controller('remitoController', |
580 | 590 | $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); |
581 | 591 | } |
582 | 592 | } |
593 | + | |
594 | + function rellenar(relleno, longitud) { | |
595 | + relleno = '' + relleno; | |
596 | + while (relleno.length < longitud) { | |
597 | + relleno = '0' + relleno; | |
598 | + } | |
599 | + | |
600 | + return relleno; | |
601 | + } | |
583 | 602 | } |
584 | 603 | ] |
585 | 604 | ) |
src/js/service.js
... | ... | @@ -52,6 +52,9 @@ angular.module('focaCrearRemito') |
52 | 52 | }, |
53 | 53 | crearEstadoParaRemito: function(estado) { |
54 | 54 | return $http.post(route + '/estado', {estado: estado}); |
55 | + }, | |
56 | + getNumeroRemito: function() { | |
57 | + return $http.get(route + '/nota-pedido/numero-siguiente'); | |
55 | 58 | } |
56 | 59 | }; |
57 | 60 | }]); |