Commit 3acd4e2d3f25bc7e24417977cbb737b76a34be0c
Exists in
master
Merge branch 'master' of https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido
# Conflicts: # gulpfile.js # index.html # package.json # src/js/app.js # src/js/controller.js
Showing
7 changed files
Show diff stats
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const clean = require('gulp-clean'); | 2 | const clean = require('gulp-clean'); |
3 | const concat = require('gulp-concat'); | 3 | const concat = require('gulp-concat'); |
4 | const htmlmin = require('gulp-htmlmin'); | 4 | const htmlmin = require('gulp-htmlmin'); |
5 | const rename = require('gulp-rename'); | 5 | const rename = require('gulp-rename'); |
6 | const uglify = require('gulp-uglify'); | 6 | const uglify = require('gulp-uglify'); |
7 | const gulp = require('gulp'); | 7 | const gulp = require('gulp'); |
8 | const pump = require('pump'); | 8 | const pump = require('pump'); |
9 | const jshint = require('gulp-jshint'); | 9 | const jshint = require('gulp-jshint'); |
10 | const replace = require('gulp-replace'); | 10 | const replace = require('gulp-replace'); |
11 | const connect = require('gulp-connect'); | 11 | const connect = require('gulp-connect'); |
12 | 12 | ||
13 | var paths = { | 13 | var paths = { |
14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
17 | dist: 'dist/' | 17 | dist: 'dist/' |
18 | }; | 18 | }; |
19 | 19 | ||
20 | gulp.task('templates', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], function() { |
21 | return pump( | 21 | return pump( |
22 | [ | 22 | [ |
23 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
24 | htmlmin(), | 24 | htmlmin(), |
25 | templateCache('views.js', { | 25 | templateCache('views.js', { |
26 | module: 'focaCrearNotaPedido', | 26 | module: 'focaCrearNotaPedido', |
27 | root: '' | 27 | root: '' |
28 | }), | 28 | }), |
29 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
30 | ] | 30 | ] |
31 | ); | 31 | ); |
32 | }); | 32 | }); |
33 | 33 | ||
34 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
35 | return pump( | 35 | return pump( |
36 | [ | 36 | [ |
37 | gulp.src([ | 37 | gulp.src([ |
38 | paths.srcJS, | 38 | paths.srcJS, |
39 | 'tmp/views.js' | 39 | 'tmp/views.js' |
40 | ]), | 40 | ]), |
41 | concat('foca-crear-nota-pedido.js'), | 41 | concat('foca-crear-nota-pedido.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
44 | rename('foca-crear-nota-pedido.min.js'), | 44 | rename('foca-crear-nota-pedido.min.js'), |
45 | uglify(), | 45 | uglify(), |
46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ | 46 | replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ |
47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ | 47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ | 48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio",'+ |
49 | '"focaSeguimiento","angular-ladda"', ''), | 49 | '"focaModalMoneda","focaModalCotizacion","focaSeguimiento","angular-ladda"', ''), |
50 | gulp.dest(paths.dist) | 50 | gulp.dest(paths.dist) |
51 | ] | 51 | ] |
52 | ); | 52 | ); |
53 | }); | 53 | }); |
54 | 54 | ||
55 | gulp.task('clean', function(){ | 55 | gulp.task('clean', function(){ |
56 | return gulp.src(['tmp', 'dist'], {read: false}) | 56 | return gulp.src(['tmp', 'dist'], {read: false}) |
57 | .pipe(clean()); | 57 | .pipe(clean()); |
58 | }); | 58 | }); |
59 | 59 | ||
60 | gulp.task('pre-commit', function() { | 60 | gulp.task('pre-commit', function() { |
61 | return pump( | 61 | return pump( |
62 | [ | 62 | [ |
63 | gulp.src(paths.srcJS), | 63 | gulp.src(paths.srcJS), |
64 | jshint('.jshintrc'), | 64 | jshint('.jshintrc'), |
65 | jshint.reporter('default'), | 65 | jshint.reporter('default'), |
66 | jshint.reporter('fail') | 66 | jshint.reporter('fail') |
67 | ] | 67 | ] |
68 | ); | 68 | ); |
69 | 69 | ||
70 | gulp.start('uglify'); | 70 | gulp.start('uglify'); |
71 | }); | 71 | }); |
72 | 72 | ||
73 | gulp.task('webserver', function() { | 73 | gulp.task('webserver', function() { |
74 | pump [ | 74 | pump [ |
75 | connect.server({port: 3000}) | 75 | connect.server({port: 3300, host: '0.0.0.0'}) |
76 | ] | 76 | ] |
77 | }); | 77 | }); |
78 | 78 | ||
79 | gulp.task('clean-post-install', function() { | 79 | gulp.task('clean-post-install', function() { |
80 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 80 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
81 | 'index.html'], {read: false}) | 81 | 'index.html'], {read: false}) |
82 | .pipe(clean()); | 82 | .pipe(clean()); |
83 | }); | 83 | }); |
84 | 84 | ||
85 | gulp.task('default', ['webserver']); | 85 | gulp.task('default', ['webserver']); |
86 | 86 | ||
87 | gulp.task('watch', function() { | 87 | gulp.task('watch', function() { |
88 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 88 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
89 | }); | 89 | }); |
90 | 90 |
index.html
1 | <html ng-app="focaCrearNotaPedido"> | 1 | <html ng-app="focaCrearNotaPedido"> |
2 | <head> | 2 | <head> |
3 | <meta charset="UTF-8"/> | 3 | <meta charset="UTF-8"/> |
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
5 | 5 | ||
6 | <!--CSS--> | 6 | <!--CSS--> |
7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> |
8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> |
9 | <link href="node_modules/ladda/dist/ladda-themeless.min.css" rel="stylesheet"> | 9 | <link href="node_modules/ladda/dist/ladda-themeless.min.css" rel="stylesheet"> |
10 | 10 | ||
11 | <!--VENDOR JS--> | 11 | <!--VENDOR JS--> |
12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | 12 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | 13 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
14 | <script src="node_modules/angular/angular.min.js"></script> | 14 | <script src="node_modules/angular/angular.min.js"></script> |
15 | <script src="node_modules/angular-route/angular-route.min.js"></script> | 15 | <script src="node_modules/angular-route/angular-route.min.js"></script> |
16 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | 16 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
17 | <script src="node_modules/ladda/dist/spin.min.js"></script> | 17 | <script src="node_modules/ladda/dist/spin.min.js"></script> |
18 | <script src="node_modules/ladda/dist/ladda.min.js"></script> | 18 | <script src="node_modules/ladda/dist/ladda.min.js"></script> |
19 | <script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script> | 19 | <script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script> |
20 | 20 | ||
21 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | 21 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> |
22 | <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> | 22 | <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> |
23 | <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> | 23 | <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> |
24 | <script src="node_modules/foca-modal-proveedor/dist/foca-modal-proveedor.min.js"></script> | 24 | <script src="node_modules/foca-modal-proveedor/dist/foca-modal-proveedor.min.js"></script> |
25 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> | 25 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> |
26 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> | 26 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> |
27 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> | 27 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> |
28 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> | 28 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> |
29 | <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> | 29 | <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> |
30 | <script src="node_modules/foca-modal-moneda/dist/foca-modal-moneda.min.js"></script> | ||
31 | <script src="node_modules/foca-modal-cotizacion/dist/foca-modal-cotizacion.min.js"></script> | ||
30 | <script src="node_modules/foca-seguimiento/dist/foca-seguimiento.min.js"></script> | 32 | <script src="node_modules/foca-seguimiento/dist/foca-seguimiento.min.js"></script> |
31 | 33 | ||
32 | <script src="src/js/app.js"></script> | 34 | <script src="src/js/app.js"></script> |
33 | <script src="src/js/controller.js"></script> | 35 | <script src="src/js/controller.js"></script> |
34 | <script src="src/js/service.js"></script> | 36 | <script src="src/js/service.js"></script> |
35 | <script src="src/js/route.js"></script> | 37 | <script src="src/js/route.js"></script> |
36 | 38 | ||
37 | <script src="src/etc/develop.js"></script> | 39 | <script src="src/etc/develop.js"></script> |
38 | </head> | 40 | </head> |
39 | <body> | 41 | <body> |
40 | <div ng-view class="container-fluid"></div> | 42 | <div ng-view class="container-fluid"></div> |
41 | </body> | 43 | </body> |
42 | </html> | 44 | </html> |
43 | 45 |
package.json
1 | { | 1 | { |
2 | "name": "foca-crear-nota-pedido", | 2 | "name": "foca-crear-nota-pedido", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Listado y ABM nota de pedidos", | 4 | "description": "Listado y ABM nota de pedidos", |
5 | "main": "index.js", | 5 | "main": "index.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
9 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
10 | "postinstall": "npm run compile && gulp clean-post-install", | 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" | 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" |
12 | }, | 12 | }, |
13 | "pre-commit": [ | 13 | "pre-commit": [ |
14 | "gulp-pre-commit" | 14 | "gulp-pre-commit" |
15 | ], | 15 | ], |
16 | "repository": { | 16 | "repository": { |
17 | "type": "git", | 17 | "type": "git", |
18 | "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" | 18 | "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" |
19 | }, | 19 | }, |
20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
21 | "license": "ISC", | 21 | "license": "ISC", |
22 | "peerDependencies": { | 22 | "peerDependencies": { |
23 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", | 23 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", |
24 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 24 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
25 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", | 25 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", |
26 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", | 26 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", |
27 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git" | 27 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git" |
28 | "foca-seguimiento": "git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git" | 28 | "foca-seguimiento": "git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git" |
29 | }, | 29 | }, |
30 | "devDependencies": { | 30 | "devDependencies": { |
31 | "angular": "^1.7.5", | 31 | "angular": "^1.7.5", |
32 | "angular-ladda": "^0.4.3", | 32 | "angular-ladda": "^0.4.3", |
33 | "angular-route": "^1.7.5", | 33 | "angular-route": "^1.7.5", |
34 | "bootstrap": "^4.1.3", | 34 | "bootstrap": "^4.1.3", |
35 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", | 35 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", |
36 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 36 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
37 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", | 37 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", |
38 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", | ||
38 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", | 39 | "foca-modal-cotizacion": "git+https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git", |
39 | "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", | 40 | "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", |
41 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", | ||
40 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", | 42 | "foca-modal-moneda": "git+https://debo.suite.repo/modulos-npm/foca-modal-moneda.git", |
41 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", | 43 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
42 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", | 44 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", |
43 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", | 45 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
44 | "foca-seguimiento": "git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git", | 46 | "foca-seguimiento": "git+https://debo.suite.repo/modulos-npm/foca-seguimiento.git", |
45 | "font-awesome": "^4.7.0", | 47 | "font-awesome": "^4.7.0", |
46 | "gulp": "^3.9.1", | 48 | "gulp": "^3.9.1", |
47 | "gulp-angular-templatecache": "^2.2.2", | 49 | "gulp-angular-templatecache": "^2.2.2", |
48 | "gulp-clean": "^0.4.0", | 50 | "gulp-clean": "^0.4.0", |
49 | "gulp-concat": "^2.6.1", | 51 | "gulp-concat": "^2.6.1", |
50 | "gulp-connect": "^5.6.1", | 52 | "gulp-connect": "^5.6.1", |
51 | "gulp-htmlmin": "^5.0.1", | 53 | "gulp-htmlmin": "^5.0.1", |
52 | "gulp-jshint": "^2.1.0", | 54 | "gulp-jshint": "^2.1.0", |
53 | "gulp-rename": "^1.4.0", | 55 | "gulp-rename": "^1.4.0", |
54 | "gulp-replace": "^1.0.0", | 56 | "gulp-replace": "^1.0.0", |
55 | "gulp-sequence": "^1.0.0", | 57 | "gulp-sequence": "^1.0.0", |
56 | "gulp-uglify": "^3.0.1", | 58 | "gulp-uglify": "^3.0.1", |
57 | "gulp-uglify-es": "^1.0.4", | 59 | "gulp-uglify-es": "^1.0.4", |
58 | "jasmine-core": "^3.3.0", | 60 | "jasmine-core": "^3.3.0", |
59 | "jquery": "^3.3.1", | 61 | "jquery": "^3.3.1", |
60 | "jshint": "^2.9.6", | 62 | "jshint": "^2.9.6", |
61 | "ladda": "1.0.6", | 63 | "ladda": "1.0.6", |
62 | "pre-commit": "^1.2.2", | 64 | "pre-commit": "^1.2.2", |
63 | "pump": "^3.0.0", | 65 | "pump": "^3.0.0", |
64 | "ui-bootstrap4": "^3.0.5" | 66 | "ui-bootstrap4": "^3.0.5" |
65 | } | 67 | } |
66 | } | 68 | } |
67 | 69 |
src/js/app.js
1 | angular.module('focaCrearNotaPedido', [ | 1 | angular.module('focaCrearNotaPedido', [ |
2 | 'ngRoute', | 2 | 'ngRoute', |
3 | 'ui.bootstrap', | 3 | 'ui.bootstrap', |
4 | 'focaModalVendedores', | 4 | 'focaModalVendedores', |
5 | 'focaBusquedaProductos', | 5 | 'focaBusquedaProductos', |
6 | 'focaModalProveedor', | 6 | 'focaModalProveedor', |
7 | 'focaBusquedaCliente', | 7 | 'focaBusquedaCliente', |
8 | 'focaModalPrecioCondicion', | 8 | 'focaModalPrecioCondicion', |
9 | 'focaModalFlete', | 9 | 'focaModalFlete', |
10 | 'focaDirectivas', | 10 | 'focaDirectivas', |
11 | 'focaModal', | 11 | 'focaModal', |
12 | 'focaModalDomicilio', | 12 | 'focaModalDomicilio', |
13 | 'focaSeguimiento', | 13 | 'focaModalMoneda', |
14 | 'focaModalCotizacion', | ||
15 | 'focaSeguimiento', | ||
14 | 'angular-ladda' | 16 | 'angular-ladda' |
15 | ]); | 17 | ]); |
16 | 18 |
src/js/controller.js
1 | angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', | 1 | angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
2 | [ | 2 | [ |
3 | '$scope', '$uibModal', '$location', '$filter', 'crearNotaPedidoService', | 3 | '$scope', '$uibModal', '$location', '$filter', 'crearNotaPedidoService', |
4 | 'focaModalService', 'focaSeguimientoService', | 4 | 'focaModalService', 'focaSeguimientoService', |
5 | function( | 5 | function( |
6 | $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService, | 6 | $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService, |
7 | focaSeguimientoService | 7 | focaSeguimientoService |
8 | ) { | 8 | ) { |
9 | $scope.botonera = [ | 9 | $scope.botonera = [ |
10 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, | 10 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, |
11 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, | 11 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, |
12 | {texto: 'Proveedor', accion: function() {$scope.seleccionarProveedor();}}, | 12 | {texto: 'Proveedor', accion: function() {$scope.seleccionarProveedor();}}, |
13 | {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, | 13 | {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, |
14 | { | 14 | { |
15 | texto: 'Precios y condiciones', | 15 | texto: 'Precios y condiciones', |
16 | accion: function() {$scope.abrirModalListaPrecio();}}, | 16 | accion: function() {$scope.abrirModalListaPrecio();}}, |
17 | {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, | 17 | {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, |
18 | {texto: '', accion: function() {}}, | 18 | {texto: '', accion: function() {}}, |
19 | {texto: '', accion: function() {}} | 19 | {texto: '', accion: function() {}} |
20 | ]; | 20 | ]; |
21 | $scope.datepickerAbierto = false; | 21 | $scope.datepickerAbierto = false; |
22 | 22 | ||
23 | $scope.show = false; | 23 | $scope.show = false; |
24 | $scope.cargando = true; | 24 | $scope.cargando = true; |
25 | $scope.dateOptions = { | 25 | $scope.dateOptions = { |
26 | maxDate: new Date(), | 26 | maxDate: new Date(), |
27 | minDate: new Date(2010, 0, 1) | 27 | minDate: new Date(2010, 0, 1) |
28 | }; | 28 | }; |
29 | 29 | ||
30 | $scope.notaPedido = { | 30 | $scope.notaPedido = { |
31 | vendedor: {}, | 31 | vendedor: {}, |
32 | cliente: {}, | ||
32 | cliente: {}, | 33 | proveedor: {}, |
33 | domicilio: {dom: ''}, | 34 | domicilio: {dom: ''}, |
35 | moneda: {}, | ||
34 | moneda: {detalle: ''} | 36 | cotizacion: {} |
37 | }; | ||
38 | var monedaPorDefecto; | ||
39 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' | ||
40 | crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) { | ||
41 | monedaPorDefecto = { | ||
42 | id: res.data[0].ID, | ||
43 | detalle: res.data[0].DETALLE, | ||
44 | simbolo: res.data[0].SIMBOLO, | ||
45 | cotizaciones: res.data[0].cotizaciones | ||
46 | }; | ||
47 | addCabecera('Moneda:', monedaPorDefecto.detalle); | ||
48 | addCabecera('Fecha cotizacion:', | ||
49 | new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); | ||
50 | addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].COTIZACION); | ||
51 | $scope.notaPedido.moneda = monedaPorDefecto; | ||
52 | $scope.notaPedido.cotizacion = monedaPorDefecto.cotizaciones[0]; | ||
35 | }; | 53 | }); |
36 | 54 | ||
37 | $scope.cabecera = []; | 55 | $scope.cabecera = []; |
38 | $scope.showCabecera = true; | 56 | $scope.showCabecera = true; |
39 | 57 | ||
40 | $scope.now = new Date(); | 58 | $scope.now = new Date(); |
41 | $scope.puntoVenta = Math.round(Math.random() * 10000); | 59 | $scope.puntoVenta = Math.round(Math.random() * 10000); |
42 | $scope.comprobante = Math.round(Math.random() * 1000000); | 60 | $scope.comprobante = Math.round(Math.random() * 1000000); |
43 | 61 | ||
44 | $scope.articulosTabla = []; | 62 | $scope.articulosTabla = []; |
45 | var idLista; | 63 | $scope.idLista = undefined; |
64 | //La pantalla solo se usa para cargar pedidos | ||
65 | //var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | ||
46 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | 66 | |
47 | crearNotaPedidoService.getPrecioCondicion().then( | 67 | crearNotaPedidoService.getPrecioCondicion().then( |
48 | function(res) { | 68 | function(res) { |
49 | $scope.precioCondiciones = res.data; | 69 | $scope.precioCondiciones = res.data; |
50 | } | 70 | } |
51 | ); | 71 | ); |
52 | if (notaPedidoTemp !== undefined) { | 72 | //La pantalla solo se usa para cargar pedidos |
53 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); | 73 | // if (notaPedidoTemp !== undefined) { |
54 | $scope.notaPedido = notaPedidoTemp; | 74 | // notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); |
55 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); | 75 | // $scope.notaPedido = notaPedidoTemp; |
56 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); | 76 | // $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); |
57 | idLista = $scope.notaPedido.precioCondicion; | 77 | // $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); |
58 | crearNotaPedidoService | 78 | // $scope.idLista = $scope.notaPedido.precioCondicion; |
59 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( | 79 | // crearNotaPedidoService |
60 | function(res) { | 80 | // .getArticulosByIdNotaPedido($scope.notaPedido.id).then( |
61 | $scope.articulosTabla = res.data; | 81 | // function(res) { |
62 | } | 82 | // $scope.articulosTabla = res.data; |
83 | // } | ||
63 | ); | 84 | // ); |
64 | //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO | 85 | //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO |
65 | //(NO REQUERIDO EN ESTA VERSION) | 86 | //(NO REQUERIDO EN ESTA VERSION) |
66 | // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( | 87 | // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( |
67 | // function(res) { | 88 | // function(res) { |
68 | // $scope.notaPedido.domicilio = res.data; | 89 | // $scope.notaPedido.domicilio = res.data; |
69 | // } | 90 | // } |
70 | // ); | 91 | // ); |
71 | } else { | 92 | // } else { |
72 | $scope.notaPedido.fechaCarga = new Date(); | 93 | // $scope.notaPedido.fechaCarga = new Date(); |
73 | $scope.notaPedido.bomba = '0'; | 94 | // $scope.notaPedido.bomba = '0'; |
74 | $scope.notaPedido.flete = '0'; | 95 | // $scope.notaPedido.flete = '0'; |
75 | idLista = undefined; | 96 | // $scope.idLista = undefined; |
76 | } | 97 | // } |
77 | //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO | 98 | //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO |
78 | // $scope.addNewDom = function() { | 99 | // $scope.addNewDom = function() { |
79 | // $scope.notaPedido.domicilio.push({ 'id': 0 }); | 100 | // $scope.notaPedido.domicilio.push({ 'id': 0 }); |
80 | // }; | 101 | // }; |
81 | // $scope.removeNewChoice = function(choice) { | 102 | // $scope.removeNewChoice = function(choice) { |
82 | // if ($scope.notaPedido.domicilio.length > 1) { | 103 | // if ($scope.notaPedido.domicilio.length > 1) { |
83 | // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( | 104 | // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( |
84 | // function(c) { | 105 | // function(c) { |
85 | // return c.$$hashKey === choice.$$hashKey; | 106 | // return c.$$hashKey === choice.$$hashKey; |
86 | // } | 107 | // } |
87 | // ), 1); | 108 | // ), 1); |
88 | // } | 109 | // } |
110 | // }; | ||
89 | // }; | 111 | |
90 | $scope.crearNotaPedido = function() { | 112 | $scope.crearNotaPedido = function() { |
91 | if($scope.articulosTabla.length === 0) { | 113 | if(!$scope.notaPedido.vendedor.codigo) { |
114 | focaModalService.alert('Ingrese Vendedor'); | ||
115 | return; | ||
116 | } else if(!$scope.notaPedido.cliente.id) { | ||
117 | focaModalService.alert('Ingrese Cliente'); | ||
118 | return; | ||
119 | } else if(!$scope.notaPedido.proveedor.codigo) { | ||
120 | focaModalService.alert('Ingrese Proveedor'); | ||
121 | return; | ||
122 | } else if(!$scope.notaPedido.moneda.id) { | ||
123 | focaModalService.alert('Ingrese Moneda'); | ||
124 | return; | ||
125 | } else if(!$scope.notaPedido.cotizacion.ID) { | ||
126 | focaModalService.alert('Ingrese Cotización'); | ||
127 | return; | ||
128 | } else if(!$scope.plazosPagos) { | ||
129 | focaModalService.alert('Ingrese Precios y Condiciones'); | ||
130 | return; | ||
131 | } else if(!$scope.notaPedido.flete) { | ||
132 | focaModalService.alert('Ingrese Flete'); | ||
133 | return; | ||
134 | } else if(!$scope.notaPedido.domicilio.id) { | ||
135 | focaModalService.aler('Ingrese Domicilio'); | ||
136 | return; | ||
137 | } else if($scope.articulosTabla.length === 0) { | ||
92 | focaModalService.alert('Debe cargar almenos un articulo'); | 138 | focaModalService.alert('Debe cargar al menos un articulo'); |
93 | return; | ||
94 | } | ||
95 | if($scope.notaPedido.domicilio.id === undefined) { | ||
96 | $scope.notaPedido.domicilio.id = 0; | 139 | return; |
97 | } | 140 | } |
98 | var date = new Date(); | 141 | var date = new Date(); |
99 | var notaPedido = { | 142 | var notaPedido = { |
100 | id: 0, | 143 | id: 0, |
101 | fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) | 144 | fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) |
102 | .toISOString().slice(0, 19).replace('T', ' '), | 145 | .toISOString().slice(0, 19).replace('T', ' '), |
103 | vendedor: $scope.notaPedido.vendedor.nombre, | 146 | idVendedor: $scope.notaPedido.vendedor.codigo, |
104 | idCliente: $scope.notaPedido.cliente.id, | 147 | idCliente: $scope.notaPedido.cliente.id, |
105 | domicilio: $scope.notaPedido.domicilio, | 148 | idProveedor: $scope.notaPedido.proveedor.codigo, |
149 | idDomicilio: $scope.notaPedido.domicilio.id, | ||
106 | bomba: $scope.notaPedido.bomba, | 150 | idCotizacion: $scope.notaPedido.cotizacion.ID, |
151 | flete: $scope.notaPedido.flete, | ||
152 | fob: $scope.notaPedido.fob, | ||
153 | bomba: $scope.notaPedido.bomba, | ||
107 | flete: $scope.notaPedido.flete, | 154 | kilometros: $scope.notaPedido.kilometros, |
108 | total: $scope.getTotal() | 155 | total: $scope.getTotal() |
109 | }; | 156 | }; |
110 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( | 157 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( |
111 | function(data) { | 158 | function(data) { |
112 | focaSeguimientoService.guardarPosicion('crear nota pedido', ''); | ||
113 | if($scope.notaPedido.flete === 1) { | ||
114 | var flete = { | ||
115 | idNotaPedido: data.data.id, | ||
116 | idTransportista: $scope.notaPedido.fleteId, | ||
117 | idChofer: $scope.notaPedido.chofer.id, | ||
118 | idVehiculo: $scope.notaPedido.vehiculo.id, | ||
119 | kilometros: $scope.notaPedido.kilometros, | ||
120 | costoKilometro: $scope.notaPedido.costoUnitarioKmFlete | ||
121 | }; | ||
122 | crearNotaPedidoService.crearFlete(flete); | 159 | focaSeguimientoService.guardarPosicion('crear nota pedido', ''); |
123 | } | 160 | var articulosNotaPedido = $scope.articulosTabla; |
124 | var articulosNotaPedido = $scope.articulosTabla; | 161 | for(var i = 0; i < articulosNotaPedido.length; i++) { |
162 | delete articulosNotaPedido[i].editCantidad; | ||
125 | for(var i = 0; i < articulosNotaPedido.length; i++) { | 163 | delete articulosNotaPedido[i].editPrecio; |
126 | delete articulosNotaPedido[i].edit; | 164 | articulosNotaPedido[i].idNotaPedido = data.data.id; |
127 | articulosNotaPedido[i].idNotaPedido = data.data.id; | 165 | crearNotaPedidoService |
128 | crearNotaPedidoService | 166 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]); |
129 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]); | 167 | } |
130 | } | 168 | var plazos = $scope.plazosPagos; |
131 | var plazos = $scope.plazosPagos; | 169 | for(var j = 0; j < plazos.length; j++) { |
132 | for(var j = 0; j < plazos.length; j++) { | 170 | var json = { |
133 | var json = { | 171 | idPedido: data.data.id, |
134 | idPedido: data.data.id, | 172 | dias: plazos[j].dias |
135 | dias: plazos[j].dias | 173 | }; |
136 | }; | 174 | crearNotaPedidoService.crearPlazosParaNotaPedido(json); |
137 | crearNotaPedidoService.crearPlazosParaNotaPedido(json); | 175 | } |
138 | } | 176 | focaModalService.alert('Nota pedido creada'); |
177 | $scope.cabecera = []; | ||
178 | addCabecera('Moneda:', $scope.notaPedido.moneda.detalle); | ||
179 | addCabecera( | ||
180 | 'Fecha cotizacion:', | ||
181 | $filter('date')($scope.notaPedido.cotizacion.FECHA, 'dd/MM/yyyy') | ||
182 | ); | ||
183 | addCabecera('Cotizacion:', $scope.notaPedido.cotizacion.cotizacion); | ||
184 | $scope.notaPedido.vendedor = {}; | ||
185 | $scope.notaPedido.cliente = {}; | ||
186 | $scope.notaPedido.proveedor = {}; | ||
187 | $scope.notaPedido.domicilio = {}; | ||
188 | $scope.notaPedido.flete = null; | ||
189 | $scope.notaPedido.fob = null; | ||
190 | $scope.notaPedido.bomba = null; | ||
191 | $scope.notaPedido.kilometros = null; | ||
139 | focaModalService.alert('Nota pedido creada'); | 192 | $scope.articulosTabla = []; |
140 | $scope.limpiarPantalla(); | 193 | } |
141 | } | 194 | ); |
142 | ); | 195 | }; |
143 | }; | 196 | |
144 | 197 | $scope.seleccionarArticulo = function() { | |
145 | $scope.seleccionarArticulo = function() { | 198 | if ($scope.idLista === undefined) { |
146 | if (idLista === undefined) { | 199 | focaModalService.alert( |
147 | focaModalService.alert( | 200 | 'Primero seleccione una lista de precio y condicion'); |
148 | 'Primero seleccione una lista de precio y condicion'); | 201 | return; |
149 | return; | 202 | } |
150 | } | 203 | var modalInstance = $uibModal.open( |
151 | var modalInstance = $uibModal.open( | 204 | { |
152 | { | 205 | ariaLabelledBy: 'Busqueda de Productos', |
153 | ariaLabelledBy: 'Busqueda de Productos', | 206 | templateUrl: 'modal-busqueda-productos.html', |
154 | templateUrl: 'modal-busqueda-productos.html', | 207 | controller: 'modalBusquedaProductosCtrl', |
208 | resolve: { | ||
209 | idLista: function() { return $scope.idLista; }, | ||
210 | cotizacion: $scope.notaPedido.cotizacion.COTIZACION | ||
155 | controller: 'modalBusquedaProductosCtrl', | 211 | }, |
156 | resolve: { idLista: function() { return idLista; } }, | 212 | size: 'lg' |
157 | size: 'lg' | 213 | } |
158 | } | 214 | ); |
159 | ); | 215 | modalInstance.result.then( |
160 | modalInstance.result.then( | 216 | function(producto) { |
161 | function(producto) { | 217 | var newArt = |
162 | var newArt = | 218 | { |
163 | { | 219 | id: 0, |
164 | id: 0, | 220 | codigo: producto.codigo, |
165 | codigo: producto.codigo, | 221 | sector: producto.sector, |
166 | sector: producto.sector, | 222 | sectorCodigo: producto.sector + '-' + producto.codigo, |
167 | sectorCodigo: producto.sector + '-' + producto.codigo, | 223 | descripcion: producto.descripcion, |
168 | descripcion: producto.descripcion, | 224 | item: $scope.articulosTabla.length + 1, |
169 | item: $scope.articulosTabla.length + 1, | 225 | nombre: producto.descripcion, |
170 | nombre: producto.descripcion, | 226 | precio: parseFloat(producto.precio.toFixed(2)), |
171 | precio: producto.precio.toFixed(2), | 227 | costoUnitario: producto.costo, |
228 | editCantidad: false, | ||
172 | costoUnitario: producto.costo, | 229 | editPrecio: false |
173 | edit: false | 230 | }; |
174 | }; | 231 | $scope.articuloACargar = newArt; |
175 | $scope.articuloACargar = newArt; | 232 | $scope.cargando = false; |
176 | $scope.cargando = false; | 233 | }, function() { |
177 | }, function() { | 234 | // funcion ejecutada cuando se cancela el modal |
178 | // funcion ejecutada cuando se cancela el modal | 235 | } |
179 | } | 236 | ); |
180 | ); | 237 | }; |
181 | }; | 238 | |
182 | 239 | $scope.seleccionarVendedor = function() { | |
183 | $scope.seleccionarVendedor = function() { | 240 | var modalInstance = $uibModal.open( |
184 | var modalInstance = $uibModal.open( | 241 | { |
185 | { | 242 | ariaLabelledBy: 'Busqueda de Vendedores', |
186 | ariaLabelledBy: 'Busqueda de Vendedores', | 243 | templateUrl: 'modal-vendedores.html', |
187 | templateUrl: 'modal-vendedores.html', | 244 | controller: 'modalVendedoresCtrl', |
188 | controller: 'modalVendedoresCtrl', | 245 | size: 'lg' |
189 | size: 'lg' | 246 | } |
190 | } | 247 | ); |
191 | ); | 248 | modalInstance.result.then( |
192 | modalInstance.result.then( | 249 | function(vendedor) { |
193 | function(vendedor) { | 250 | addCabecera('Vendedor:', vendedor.NomVen); |
194 | addCabecera('Vendedor:', vendedor.NomVen); | 251 | $scope.notaPedido.vendedor.codigo = vendedor.CodVen; |
195 | $scope.notaPedido.vendedor.nombre = vendedor.NomVen; | 252 | }, function() { |
196 | }, function() { | 253 | |
197 | 254 | } | |
198 | } | 255 | ); |
199 | ); | 256 | }; |
200 | }; | 257 | |
201 | 258 | $scope.seleccionarProveedor = function() { | |
202 | $scope.seleccionarProveedor = function() { | 259 | var modalInstance = $uibModal.open( |
203 | var modalInstance = $uibModal.open( | 260 | { |
204 | { | 261 | ariaLabelledBy: 'Busqueda de Proveedor', |
205 | ariaLabelledBy: 'Busqueda de Proveedor', | 262 | templateUrl: 'modal-proveedor.html', |
206 | templateUrl: 'modal-proveedor.html', | 263 | controller: 'focaModalProveedorCtrl', |
207 | controller: 'focaModalProveedorCtrl', | 264 | size: 'lg' |
208 | size: 'lg' | 265 | } |
209 | } | 266 | ); |
210 | ); | 267 | modalInstance.result.then( |
211 | modalInstance.result.then( | 268 | function(proveedor) { |
212 | function(proveedor) { | 269 | $scope.notaPedido.proveedor.codigo = proveedor.COD; |
213 | $scope.notaPedido.proveedor = proveedor.NOM; | 270 | addCabecera('Proveedor:', proveedor.NOM); |
214 | addCabecera('Proveedor:', proveedor.NOM); | 271 | }, function() { |
215 | }, function() { | 272 | |
216 | 273 | } | |
217 | } | 274 | ); |
218 | ); | 275 | }; |
219 | }; | 276 | |
277 | $scope.seleccionarCliente = function() { | ||
220 | 278 | ||
221 | $scope.seleccionarCliente = function() { | 279 | var modalInstance = $uibModal.open( |
222 | var modalInstance = $uibModal.open( | 280 | { |
223 | { | 281 | ariaLabelledBy: 'Busqueda de Cliente', |
224 | ariaLabelledBy: 'Busqueda de Cliente', | 282 | templateUrl: 'foca-busqueda-cliente-modal.html', |
225 | templateUrl: 'foca-busqueda-cliente-modal.html', | 283 | controller: 'focaBusquedaClienteModalController', |
226 | controller: 'focaBusquedaClienteModalController', | 284 | size: 'lg' |
227 | size: 'lg' | 285 | } |
228 | } | 286 | ); |
229 | ); | 287 | modalInstance.result.then( |
230 | modalInstance.result.then( | ||
231 | function(cliente) { | ||
232 | $scope.notaPedido.cliente.nombre = cliente.nom; | 288 | function(cliente) { |
233 | $scope.notaPedido.cliente.id = cliente.cod; | 289 | crearNotaPedidoService.getDomiciliosByIdCliente(cliente.cod).then( |
234 | crearNotaPedidoService.getDomiciliosByIdCliente(cliente.cod).then( | 290 | function(data) { |
235 | function(data) { | 291 | if(data.data.length === 0){ |
236 | if(data.data.length === 0){ | 292 | focaModalService |
237 | focaModalService | 293 | .alert('El cliente no tienen domicilios de entrega') |
238 | .alert('El cliente no tienen domicilios de entrega') | 294 | .then( |
239 | .then( | 295 | function() { |
240 | function() { | ||
241 | $scope.seleccionarCliente(); | 296 | $scope.seleccionarCliente(); |
242 | $scope.notaPedido.cliente = {nombre: ''}; | 297 | } |
243 | } | 298 | ); |
244 | ); | 299 | return; |
245 | return; | 300 | } |
246 | } | ||
247 | var modalInstanceDomicilio = $uibModal.open( | ||
248 | { | ||
249 | ariaLabelledBy: 'Busqueda de Domicilios', | ||
250 | templateUrl: 'modal-domicilio.html', | ||
251 | controller: 'focaModalDomicilioController', | ||
252 | resolve: { idCliente: function() { return cliente.cod; }}, | ||
253 | size: 'lg', | ||
254 | backdrop: 'static', | ||
255 | } | ||
256 | ); | ||
257 | modalInstanceDomicilio.result.then( | ||
258 | function(domicilio) { | ||
259 | focaModalService.alert('Domicilio elegido' + domicilio.dom); | ||
260 | }, function() { | ||
261 | $scope.notaPedido.cliente.nombre = ''; | ||
262 | $scope.notaPedido.cliente.id = ''; | ||
263 | removeCabecera('Cliente:'); | ||
264 | $scope.seleccionarCliente(); | ||
265 | return; | ||
266 | } | 301 | $scope.abrirModalDomicilios(cliente); |
267 | ); | 302 | } |
268 | } | ||
269 | ); | 303 | ); |
304 | }, function() { | ||
305 | |||
306 | } | ||
307 | ); | ||
270 | addCabecera('Cliente:', cliente.nom); | 308 | }; |
309 | |||
310 | $scope.abrirModalDomicilios = function(cliente) { | ||
311 | var modalInstanceDomicilio = $uibModal.open( | ||
312 | { | ||
313 | ariaLabelledBy: 'Busqueda de Domicilios', | ||
314 | templateUrl: 'modal-domicilio.html', | ||
315 | controller: 'focaModalDomicilioController', | ||
316 | resolve: { idCliente: function() { return cliente.cod; }}, | ||
317 | size: 'lg', | ||
318 | } | ||
319 | ); | ||
320 | modalInstanceDomicilio.result.then( | ||
321 | function(domicilio) { | ||
322 | $scope.notaPedido.domicilio.id = domicilio.id; | ||
323 | $scope.notaPedido.cliente.id = cliente.cod; | ||
324 | addCabecera('Cliente:', cliente.nom); | ||
325 | addCabecera('Domicilio:', domicilio.dom); | ||
326 | }, function() { | ||
327 | $scope.seleccionarCliente(); | ||
271 | }, function() { | 328 | return; |
272 | 329 | } | |
273 | } | 330 | ); |
274 | ); | 331 | }; |
275 | }; | 332 | |
276 | 333 | $scope.mostrarFichaCliente = function() { | |
277 | $scope.mostrarFichaCliente = function() { | 334 | $uibModal.open( |
278 | $uibModal.open( | 335 | { |
279 | { | 336 | ariaLabelledBy: 'Datos del Cliente', |
280 | ariaLabelledBy: 'Datos del Cliente', | 337 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', |
281 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', | 338 | controller: 'focaCrearNotaPedidoFichaClienteController', |
282 | controller: 'focaCrearNotaPedidoFichaClienteController', | 339 | size: 'lg' |
283 | size: 'lg' | 340 | } |
284 | } | 341 | ); |
285 | ); | 342 | }; |
286 | }; | 343 | |
287 | 344 | $scope.getTotal = function() { | |
288 | $scope.getTotal = function() { | 345 | var total = 0; |
289 | var total = 0; | 346 | var arrayTempArticulos = $scope.articulosTabla; |
290 | var arrayTempArticulos = $scope.articulosTabla; | 347 | for (var i = 0; i < arrayTempArticulos.length; i++) { |
291 | for (var i = 0; i < arrayTempArticulos.length; i++) { | 348 | total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad; |
292 | total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad; | 349 | } |
293 | } | 350 | return parseFloat(total.toFixed(2)); |
294 | return total.toFixed(2); | 351 | }; |
295 | }; | 352 | |
296 | 353 | $scope.getSubTotal = function() { | |
297 | $scope.getSubTotal = function() { | 354 | if($scope.articuloACargar) { |
298 | if($scope.articuloACargar) { | 355 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
299 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; | 356 | } |
300 | } | 357 | }; |
301 | }; | 358 | |
302 | 359 | $scope.abrirModalListaPrecio = function() { | |
303 | $scope.abrirModalListaPrecio = function() { | 360 | var modalInstance = $uibModal.open( |
304 | var modalInstance = $uibModal.open( | 361 | { |
305 | { | 362 | ariaLabelledBy: 'Busqueda de Precio Condición', |
306 | ariaLabelledBy: 'Busqueda de Precio Condición', | 363 | templateUrl: 'modal-precio-condicion.html', |
307 | templateUrl: 'modal-precio-condicion.html', | 364 | controller: 'focaModalPrecioCondicionController', |
308 | controller: 'focaModalPrecioCondicionController', | 365 | size: 'lg' |
309 | size: 'lg' | 366 | } |
310 | } | 367 | ); |
311 | ); | 368 | modalInstance.result.then( |
312 | modalInstance.result.then( | 369 | function(precioCondicion) { |
313 | function(precioCondicion) { | 370 | var cabecera = ''; |
314 | var cabecera = ''; | 371 | var plazosConcat = ''; |
315 | var plazosConcat = ''; | 372 | if(!Array.isArray(precioCondicion)) { |
316 | if(!Array.isArray(precioCondicion)) { | 373 | $scope.plazosPagos = precioCondicion.plazoPago; |
317 | $scope.plazosPagos = precioCondicion.plazoPago; | 374 | $scope.idLista = precioCondicion.idListaPrecio; |
318 | idLista = precioCondicion.idListaPrecio; | 375 | for(var i = 0; i < precioCondicion.plazoPago.length; i++) { |
319 | for(var i = 0; i < precioCondicion.plazoPago.length; i++) { | 376 | plazosConcat += precioCondicion.plazoPago[i].dias + ' '; |
320 | plazosConcat += precioCondicion.plazoPago[i].dias + ' '; | 377 | } |
321 | } | 378 | cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); |
322 | cabecera = precioCondicion.nombre + ' ' + plazosConcat.trim(); | 379 | } else { //Cuando se ingresan los plazos manualmente |
323 | } else { //Cuando se ingresan los plazos manualmente | 380 | $scope.idLista = -1; //-1, el modal productos busca todos los productos |
324 | idLista = -1; //-1, el modal productos busca todos los productos | 381 | $scope.plazosPagos = precioCondicion; |
325 | $scope.plazosPagos = precioCondicion; | 382 | for(var j = 0; j < precioCondicion.length; j++) { |
326 | for(var j = 0; j < precioCondicion.length; j++) { | 383 | plazosConcat += precioCondicion[j].dias + ' '; |
327 | plazosConcat += precioCondicion[j].dias + ' '; | 384 | } |
328 | } | 385 | cabecera = 'Ingreso manual ' + plazosConcat.trim(); |
329 | cabecera = 'Ingreso manual ' + plazosConcat.trim(); | 386 | } |
330 | } | 387 | $scope.articulosTabla = []; |
331 | $scope.articulosTabla = []; | 388 | addCabecera('Precios y condiciones:', cabecera); |
332 | addCabecera('Precios y condiciones:', cabecera); | 389 | }, function() { |
333 | }, function() { | 390 | |
334 | 391 | } | |
335 | } | 392 | ); |
336 | ); | 393 | }; |
337 | }; | 394 | |
338 | 395 | $scope.abrirModalFlete = function() { | |
339 | $scope.abrirModalFlete = function() { | 396 | var modalInstance = $uibModal.open( |
340 | var modalInstance = $uibModal.open( | 397 | { |
341 | { | 398 | ariaLabelledBy: 'Busqueda de Flete', |
342 | ariaLabelledBy: 'Busqueda de Flete', | 399 | templateUrl: 'modal-flete.html', |
343 | templateUrl: 'modal-flete.html', | 400 | controller: 'focaModalFleteController', |
344 | controller: 'focaModalFleteController', | 401 | size: 'lg', |
345 | size: 'lg', | 402 | resolve: { |
346 | resolve: { | 403 | parametrosFlete: |
347 | parametrosFlete: | 404 | function() { |
348 | function() { | 405 | return { |
349 | return { | 406 | flete: $scope.notaPedido.flete ? '1' : |
407 | ($scope.notaPedido.fob ? 'FOB' : | ||
408 | ($scope.notaPedido.flete === undefined ? null : '0')), | ||
409 | bomba: $scope.notaPedido.bomba ? '1' : | ||
350 | flete: $scope.notaPedido.flete, | 410 | ($scope.notaPedido.bomba === undefined ? null : '0'), |
351 | bomba: $scope.notaPedido.bomba, | 411 | kilometros: $scope.notaPedido.kilometros |
352 | kilometros: $scope.notaPedido.kilometros | 412 | }; |
353 | }; | 413 | } |
354 | } | 414 | } |
355 | } | 415 | } |
356 | } | 416 | ); |
357 | ); | 417 | modalInstance.result.then( |
358 | modalInstance.result.then( | 418 | function(datos) { |
419 | $scope.notaPedido.flete = datos.flete; | ||
359 | function(datos) { | 420 | $scope.notaPedido.fob = datos.FOB; |
360 | $scope.notaPedido.flete = datos.flete; | 421 | $scope.notaPedido.bomba = datos.bomba; |
361 | $scope.notaPedido.bomba = datos.bomba; | 422 | $scope.notaPedido.kilometros = datos.kilometros; |
362 | $scope.notaPedido.kilometros = datos.kilometros; | 423 | |
363 | 424 | addCabecera('Flete:', datos.flete ? 'Si' : | |
364 | addCabecera('Flete:', datos.flete); | 425 | ($scope.notaPedido.fob ? 'FOB' : 'No')); |
365 | if(datos.flete === 'si') { | 426 | if(datos.flete) { |
427 | addCabecera('Bomba:', datos.bomba ? 'Si' : 'No'); | ||
366 | addCabecera('Bomba:', datos.bomba); | 428 | addCabecera('Kilometros:', datos.kilometros ? 'Si' : 'No'); |
367 | addCabecera('Kilometros:', datos.kilometros); | 429 | } else { |
368 | } else { | 430 | removeCabecera('Bomba:'); |
431 | removeCabecera('Kilometros:'); | ||
432 | $scope.notaPedido.fob = false; | ||
433 | $scope.notaPedido.bomba = false; | ||
369 | removeCabecera('Bomba:'); | 434 | $scope.notaPedido.kilometros = null; |
370 | removeCabecera('Kilometros:'); | 435 | } |
371 | } | 436 | }, function() { |
372 | }, function() { | 437 | |
373 | 438 | } | |
374 | } | 439 | ); |
375 | ); | 440 | }; |
376 | }; | 441 | |
377 | 442 | $scope.abrirModalMoneda = function() { | |
378 | $scope.abrirModalMoneda = function() { | 443 | var modalInstance = $uibModal.open( |
379 | var modalInstance = $uibModal.open( | 444 | { |
380 | { | 445 | ariaLabelledBy: 'Busqueda de Moneda', |
381 | ariaLabelledBy: 'Busqueda de Moneda', | 446 | templateUrl: 'modal-moneda.html', |
382 | templateUrl: 'modal-moneda.html', | 447 | controller: 'focaModalMonedaController', |
383 | controller: 'focaModalMonedaController', | 448 | size: 'lg' |
384 | size: 'lg' | 449 | } |
385 | } | 450 | ); |
386 | ); | 451 | modalInstance.result.then( |
387 | modalInstance.result.then( | 452 | function(moneda) { |
388 | function(moneda) { | ||
389 | $scope.notaPedido.moneda = { | ||
390 | id: moneda.ID, | ||
391 | detalle: moneda.DETALLE, | ||
392 | simbolo: moneda.SIMBOLO | ||
393 | }; | ||
394 | |||
395 | addCabecera('Moneda:', moneda.DETALLE); | 453 | $scope.abrirModalCotizacion(moneda); |
396 | $scope.abrirModalCotizacion(moneda.ID); | 454 | }, function() { |
397 | }, function() { | 455 | |
398 | 456 | } | |
399 | } | 457 | ); |
400 | ); | 458 | }; |
401 | }; | 459 | |
402 | 460 | $scope.abrirModalCotizacion = function(moneda) { | |
403 | $scope.abrirModalCotizacion = function(idMoneda) { | 461 | var modalInstance = $uibModal.open( |
404 | var modalInstance = $uibModal.open( | 462 | { |
405 | { | 463 | ariaLabelledBy: 'Busqueda de Cotización', |
406 | ariaLabelledBy: 'Busqueda de Cotización', | 464 | templateUrl: 'modal-cotizacion.html', |
407 | templateUrl: 'modal-cotizacion.html', | 465 | controller: 'focaModalCotizacionController', |
408 | controller: 'focaModalCotizacionController', | 466 | size: 'lg', |
409 | size: 'lg', | 467 | resolve: {idMoneda: function() {return moneda.ID;}} |
410 | resolve: {idMoneda: function() {return idMoneda;}} | 468 | } |
411 | } | 469 | ); |
412 | ); | 470 | modalInstance.result.then( |
471 | function(cotizacion) { | ||
472 | var articulosTablaTemp = $scope.articulosTabla; | ||
473 | for(var i = 0; i < articulosTablaTemp.length; i++) { | ||
474 | articulosTablaTemp[i].precio = articulosTablaTemp[i].precio * | ||
475 | $scope.notaPedido.cotizacion.COTIZACION; | ||
476 | articulosTablaTemp[i].precio = articulosTablaTemp[i].precio / | ||
477 | cotizacion.COTIZACION; | ||
478 | } | ||
479 | $scope.articulosTabla = articulosTablaTemp; | ||
480 | $scope.notaPedido.moneda = { | ||
481 | id: moneda.ID, | ||
482 | detalle: moneda.DETALLE, | ||
483 | simbolo: moneda.SIMBOLO | ||
413 | modalInstance.result.then( | 484 | }; |
414 | function(cotizacion) { | 485 | $scope.notaPedido.cotizacion = { |
415 | $scope.notaPedido.cotizacion = { | 486 | ID: cotizacion.ID, |
487 | COTIZACION: cotizacion.COTIZACION, | ||
416 | id: cotizacion.ID, | 488 | FECHA: cotizacion.fecha |
417 | cotizacion: cotizacion.COTIZACION | 489 | }; |
418 | }; | 490 | addCabecera('Moneda:', moneda.DETALLE); |
419 | 491 | addCabecera( | |
420 | addCabecera( | 492 | 'Fecha cotizacion:', |
421 | 'Fecha cotizacion:', | 493 | $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') |
422 | $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | 494 | ); |
423 | ); | 495 | addCabecera('Cotizacion:', cotizacion.COTIZACION); |
424 | addCabecera('Cotizacion:', cotizacion.COTIZACION); | 496 | }, function() { |
425 | }, function() { | 497 | |
426 | 498 | } | |
427 | } | 499 | ); |
428 | ); | 500 | }; |
429 | }; | 501 | |
430 | 502 | $scope.agregarATabla = function(key) { | |
431 | $scope.agregarATabla = function(key) { | 503 | if(key === 13) { |
432 | if(key === 13) { | 504 | if($scope.articuloACargar.cantidad === undefined || |
433 | if($scope.articuloACargar.cantidad === undefined || | 505 | $scope.articuloACargar.cantidad === 0 || |
434 | $scope.articuloACargar.cantidad === 0 || | 506 | $scope.articuloACargar.cantidad === null ){ |
435 | $scope.articuloACargar.cantidad === null ){ | 507 | focaModalService.alert('El valor debe ser al menos 1'); |
436 | focaModalService.alert('El valor debe ser al menos 1'); | 508 | return; |
437 | return; | 509 | } |
438 | } | 510 | delete $scope.articuloACargar.sectorCodigo; |
439 | delete $scope.articuloACargar.sectorCodigo; | 511 | $scope.articulosTabla.push($scope.articuloACargar); |
440 | $scope.articulosTabla.push($scope.articuloACargar); | 512 | $scope.cargando = true; |
441 | $scope.cargando = true; | 513 | } |
442 | } | 514 | }; |
443 | }; | 515 | |
444 | 516 | $scope.quitarArticulo = function(key) { | |
445 | $scope.quitarArticulo = function(key) { | 517 | $scope.articulosTabla.splice(key, 1); |
446 | $scope.articulosTabla.splice(key, 1); | 518 | }; |
447 | }; | 519 | |
448 | 520 | $scope.editarArticulo = function(key, articulo) { | |
449 | $scope.editarArticulo = function(key, articulo) { | 521 | if(key === 13) { |
450 | if(key === 13) { | 522 | if(articulo.cantidad === null || articulo.cantidad === 0 || |
451 | if(articulo.cantidad === null || articulo.cantidad === 0 || | 523 | articulo.cantidad === undefined){ |
452 | articulo.cantidad === undefined){ | 524 | focaModalService.alert('El valor debe ser al menos 1'); |
453 | focaModalService.alert('El valor debe ser al menos 1'); | 525 | return; |
454 | return; | 526 | } |
527 | articulo.editCantidad = false; | ||
455 | } | 528 | articulo.editPrecio = false; |
456 | articulo.edit = false; | 529 | } |
457 | } | 530 | }; |
458 | }; | 531 | |
459 | 532 | $scope.cambioEdit = function(articulo, propiedad) { | |
533 | if(propiedad === 'cantidad') { | ||
534 | articulo.editCantidad = true; | ||
535 | } else if(propiedad === 'precio') { | ||
536 | articulo.editPrecio = true; | ||
460 | $scope.cambioEdit = function(articulo) { | 537 | } |
461 | articulo.edit = true; | 538 | }; |
462 | }; | 539 | |
463 | 540 | $scope.limpiarFlete = function() { | |
464 | $scope.limpiarFlete = function() { | 541 | $scope.notaPedido.fleteNombre = ''; |
465 | $scope.notaPedido.fleteNombre = ''; | 542 | $scope.notaPedido.chofer = ''; |
466 | $scope.notaPedido.chofer = ''; | 543 | $scope.notaPedido.vehiculo = ''; |
467 | $scope.notaPedido.vehiculo = ''; | 544 | $scope.notaPedido.kilometros = ''; |
468 | $scope.notaPedido.kilometros = ''; | 545 | $scope.notaPedido.costoUnitarioKmFlete = ''; |
469 | $scope.notaPedido.costoUnitarioKmFlete = ''; | 546 | $scope.choferes = ''; |
470 | $scope.choferes = ''; | 547 | $scope.vehiculos = ''; |
471 | $scope.vehiculos = ''; | 548 | }; |
472 | }; | 549 | |
473 | 550 | $scope.limpiarPantalla = function() { | |
474 | $scope.limpiarPantalla = function() { | 551 | $scope.limpiarFlete(); |
475 | $scope.limpiarFlete(); | 552 | $scope.notaPedido.flete = '0'; |
476 | $scope.notaPedido.flete = '0'; | 553 | $scope.notaPedido.bomba = '0'; |
477 | $scope.notaPedido.bomba = '0'; | 554 | $scope.notaPedido.precioCondicion = ''; |
478 | $scope.notaPedido.precioCondicion = ''; | 555 | $scope.articulosTabla = []; |
479 | $scope.articulosTabla = []; | 556 | $scope.notaPedido.vendedor.nombre = ''; |
480 | $scope.notaPedido.vendedor.nombre = ''; | 557 | $scope.notaPedido.cliente = {nombre: ''}; |
481 | $scope.notaPedido.cliente = {nombre: ''}; | 558 | $scope.notaPedido.domicilio = {dom: ''}; |
482 | $scope.notaPedido.domicilio = {dom: ''}; | 559 | $scope.domiciliosCliente = []; |
483 | $scope.domiciliosCliente = []; | 560 | }; |
484 | }; | 561 | |
485 | 562 | $scope.resetFilter = function() { | |
486 | $scope.resetFilter = function() { | 563 | $scope.articuloACargar = {}; |
487 | $scope.articuloACargar = {}; | 564 | $scope.cargando = true; |
488 | $scope.cargando = true; | 565 | }; |
489 | }; | 566 | |
490 | 567 | $scope.selectFocus = function($event) { | |
491 | $scope.selectFocus = function($event) { | 568 | $event.target.select(); |
492 | $event.target.select(); | 569 | }; |
493 | }; | 570 | |
494 | 571 | $scope.salir = function() { | |
495 | $scope.salir = function() { | 572 | $location.path('/'); |
496 | $location.path('/'); | 573 | }; |
497 | }; | 574 | |
498 | 575 | function addCabecera(label, valor) { | |
499 | function addCabecera(label, valor) { | 576 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); |
500 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); | 577 | if(propiedad.length === 1) { |
501 | if(propiedad.length === 1) { | 578 | propiedad[0].valor = valor; |
502 | propiedad[0].valor = valor; | 579 | } else { |
503 | } else { | 580 | $scope.cabecera.push({label: label, valor: valor}); |
504 | $scope.cabecera.push({label: label, valor: valor}); | 581 | } |
505 | } | 582 | } |
506 | } | 583 | |
507 | 584 | function removeCabecera(label) { | |
508 | function removeCabecera(label) { | 585 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); |
src/js/service.js
1 | angular.module('focaCrearNotaPedido') | 1 | angular.module('focaCrearNotaPedido') |
2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
3 | var route = API_ENDPOINT.URL; | 3 | var route = API_ENDPOINT.URL; |
4 | return { | 4 | return { |
5 | crearNotaPedido: function(notaPedido) { | 5 | crearNotaPedido: function(notaPedido) { |
6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); | 6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); |
7 | }, | 7 | }, |
8 | obtenerNotaPedido: function() { | 8 | obtenerNotaPedido: function() { |
9 | return $http.get(route +'/nota-pedido'); | 9 | return $http.get(route +'/nota-pedido'); |
10 | }, | 10 | }, |
11 | setNotaPedido: function(notaPedido) { | 11 | setNotaPedido: function(notaPedido) { |
12 | this.notaPedido = notaPedido; | 12 | this.notaPedido = notaPedido; |
13 | }, | 13 | }, |
14 | clearNotaPedido: function() { | 14 | clearNotaPedido: function() { |
15 | this.notaPedido = undefined; | 15 | this.notaPedido = undefined; |
16 | }, | 16 | }, |
17 | getNotaPedido: function() { | 17 | getNotaPedido: function() { |
18 | return this.notaPedido; | 18 | return this.notaPedido; |
19 | }, | 19 | }, |
20 | getArticulosByIdNotaPedido: function(id) { | 20 | getArticulosByIdNotaPedido: function(id) { |
21 | return $http.get(route+'/articulos/nota-pedido/'+id); | 21 | return $http.get(route+'/articulos/nota-pedido/'+id); |
22 | }, | 22 | }, |
23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { | 23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { |
24 | return $http.post(route + '/articulos/nota-pedido', | 24 | return $http.post(route + '/articulos/nota-pedido', |
25 | {articuloNotaPedido: articuloNotaPedido}); | 25 | {articuloNotaPedido: articuloNotaPedido}); |
26 | }, | 26 | }, |
27 | getDomiciliosByIdNotaPedido: function(id) { | 27 | getDomiciliosByIdNotaPedido: function(id) { |
28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
29 | }, | 29 | }, |
30 | getDomiciliosByIdCliente: function(id) { | 30 | getDomiciliosByIdCliente: function(id) { |
31 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) | 31 | var idTipoEntrega = 2;//Solo traigo los domicilios que tienen tipo 2 (tipo entrega) |
32 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); | 32 | return $http.get(route + '/domicilio/tipo/' + idTipoEntrega + '/cliente/' + id ); |
33 | }, | 33 | }, |
34 | getPrecioCondicion: function() { | 34 | getPrecioCondicion: function() { |
35 | return $http.get(route + '/precio-condicion'); | 35 | return $http.get(route + '/precio-condicion'); |
36 | }, | 36 | }, |
37 | getPrecioCondicionById: function(id) { | 37 | getPrecioCondicionById: function(id) { |
38 | return $http.get(route + '/precio-condicion/' + id); | 38 | return $http.get(route + '/precio-condicion/' + id); |
39 | }, | 39 | }, |
40 | getPlazoPagoByPrecioCondicion: function(id) { | 40 | getPlazoPagoByPrecioCondicion: function(id) { |
41 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 41 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
42 | }, | 42 | }, |
43 | crearFlete: function(flete) { | 43 | crearFlete: function(flete) { |
44 | return $http.post(route + '/flete', {flete : flete}); | 44 | return $http.post(route + '/flete', {flete : flete}); |
45 | }, | 45 | }, |
46 | crearPlazosParaNotaPedido: function(plazos) { | 46 | crearPlazosParaNotaPedido: function(plazos) { |
47 | return $http.post(route + '/plazo-pago/nota-pedido', plazos); | 47 | return $http.post(route + '/plazo-pago/nota-pedido', plazos); |
48 | }, | ||
49 | getCotizacionByIdMoneda: function(id) { | ||
50 | return $http.get(route + '/moneda/' + id); | ||
48 | } | 51 | } |
49 | }; | 52 | }; |
50 | }]); | 53 | }]); |
51 | 54 |
src/views/nota-pedido.html
1 | <div class="crear-nota-pedido"> | 1 | <div class="crear-nota-pedido"> |
2 | <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> | 2 | <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> |
3 | <div class="row"> | 3 | <div class="row"> |
4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> | 4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> |
5 | <div class="row p-1 panel-informativo"> | 5 | <div class="row p-1 panel-informativo"> |
6 | <div class="col-12"> | 6 | <div class="col-12"> |
7 | <div class="row"> | 7 | <div class="row"> |
8 | <div class="col-12 col-sm-4 nota-pedido"> | 8 | <div class="col-12 col-sm-4 nota-pedido"> |
9 | <h5>NOTA DE PEDIDO</h5> | 9 | <h5>NOTA DE PEDIDO</h5> |
10 | </div> | 10 | </div> |
11 | <div class="col-6 col-sm-4 numero-pedido">Nº {{puntoVenta}}-{{comprobante}}</div> | 11 | <div class="col-5 col-sm-4 numero-pedido" |
12 | <div class="col-6 col-sm-4 text-right crear-nota-pedido-fecha"> | 12 | >Nº {{puntoVenta}}-{{comprobante}} |
13 | </div> | ||
14 | <div class="col-7 col-sm-4 text-right"> | ||
13 | Fecha: | 15 | Fecha: |
14 | <span | 16 | <span |
15 | ng-show="!datepickerAbierto" | 17 | ng-show="!datepickerAbierto" |
16 | ng-bind="now | date:'dd/MM/yyyy HH:mm'" | 18 | ng-bind="now | date:'dd/MM/yyyy HH:mm'" |
17 | ng-click="datepickerAbierto = true" | 19 | ng-click="datepickerAbierto = true" |
18 | > | 20 | > |
19 | </span> | 21 | </span> |
20 | <input | 22 | <input |
21 | ng-show="datepickerAbierto" | 23 | ng-show="datepickerAbierto" |
22 | type="date" | 24 | type="date" |
23 | ng-model="now" | 25 | ng-model="now" |
24 | ng-change="datepickerAbierto = false" | 26 | ng-change="datepickerAbierto = false" |
25 | ng-blur="datepickerAbierto = false" | 27 | ng-blur="datepickerAbierto = false" |
26 | class="form-control form-control-sm col-8 float-right" | 28 | class="form-control form-control-sm col-8 float-right" |
27 | foca-focus="datepickerAbierto" | 29 | foca-focus="datepickerAbierto" |
28 | hasta-hoy | 30 | hasta-hoy |
29 | /> | 31 | /> |
30 | </div> | 32 | </div> |
31 | </div> | 33 | </div> |
32 | <div class="row"> | 34 | <div class="row"> |
33 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> | 35 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> |
34 | <span class="label" ng-bind="cab.label"></span> | 36 | <span class="label" ng-bind="cab.label"></span> |
35 | <span class="valor" ng-bind="cab.valor"></span> | 37 | <span class="valor" ng-bind="cab.valor"></span> |
36 | </div> | 38 | </div> |
37 | <a | 39 | <a |
38 | class="btn col-12 btn-secondary d-sm-none" | 40 | class="btn col-12 btn-secondary d-sm-none" |
39 | ng-show="cabecera.length > 0" | 41 | ng-show="cabecera.length > 0" |
40 | ng-click="showCabecera = !showCabecera" | 42 | ng-click="showCabecera = !showCabecera" |
41 | > | 43 | > |
42 | <i | 44 | <i |
43 | class="fa fa-chevron-down" | 45 | class="fa fa-chevron-down" |
44 | ng-hide="showCabecera" | 46 | ng-hide="showCabecera" |
45 | aria-hidden="true" | 47 | aria-hidden="true" |
46 | > | 48 | > |
47 | </i> | 49 | </i> |
48 | <i | 50 | <i |
49 | class="fa fa-chevron-up" | 51 | class="fa fa-chevron-up" |
50 | ng-show="showCabecera" | 52 | ng-show="showCabecera" |
51 | aria-hidden="true"> | 53 | aria-hidden="true"> |
52 | </i> | 54 | </i> |
53 | </a> | 55 | </a> |
54 | </div> | 56 | </div> |
55 | </div> | 57 | </div> |
56 | </div> | 58 | </div> |
57 | <div class="row p-1 botonera-secundaria"> | 59 | <div class="row p-1 botonera-secundaria"> |
58 | <div class="col-12"> | 60 | <div class="col-12"> |
59 | <div class="row"> | 61 | <div class="row"> |
60 | <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera"> | 62 | <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera"> |
61 | <button | 63 | <button |
62 | type="button" | 64 | type="button" |
63 | class="btn btn-default btn-block btn-xs text-left py-2" | 65 | class="btn btn-default btn-block btn-xs text-left py-2" |
64 | ng-click="boton.accion()" | 66 | ng-click="boton.accion()" |
65 | ng-class="{'d-none d-sm-block': boton.texto == ''}" | 67 | ng-class="{'d-none d-sm-block': boton.texto == ''}" |
66 | > | 68 | > |
67 | <i | 69 | <i |
68 | class="fa fa-arrow-circle-right" | 70 | class="fa fa-arrow-circle-right" |
69 | ng-show="boton.texto != ''" | 71 | ng-show="boton.texto != ''" |
70 | ></i> | 72 | ></i> |
71 | | 73 | |
72 | {{boton.texto}} | 74 | {{boton.texto}} |
73 | </button> | 75 | </button> |
74 | </div> | 76 | </div> |
75 | </div> | 77 | </div> |
76 | </div> | 78 | </div> |
77 | </div> | 79 | </div> |
78 | </div> | 80 | </div> |
79 | </div> | 81 | </div> |
80 | </form> | 82 | </form> |
81 | <div class="row"> | 83 | <div class="row"> |
82 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 84 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
83 | <!-- PC --> | 85 | <!-- PC --> |
84 | <div class="row grilla-articulo align-items-end"> | 86 | <div class="row grilla-articulo align-items-end d-none d-sm-flex"> |
85 | <table class="table tabla-articulo table-striped table-sm table-dark mb-0"> | 87 | <table class="table tabla-articulo table-striped table-sm table-dark"> |
86 | <thead> | 88 | <thead> |
87 | <tr class="d-flex"> | 89 | <tr class="d-flex"> |
88 | <th class="">#</th> | 90 | <th class="">#</th> |
89 | <th class="col">Código</th> | 91 | <th class="col">Código</th> |
90 | <th class="col-4">Descripción</th> | 92 | <th class="col-4">Descripción</th> |
91 | <th class="col text-right">Cantidad</th> | 93 | <th class="col text-right">Cantidad</th> |
92 | <th class="col text-right">Precio Unitario</th> | 94 | <th class="col text-right">Precio Unitario</th> |
93 | <th class="col text-right">SubTotal</th> | 95 | <th class="col text-right">SubTotal</th> |
94 | <th class="text-right"> | 96 | <th class="text-right"> |
95 | <button | 97 | <button |
96 | class="btn btn-outline-secondary selectable" | 98 | class="btn btn-outline-secondary selectable" |
97 | ng-click="show = !show; masMenos()" | 99 | ng-click="show = !show; masMenos()" |
98 | > | 100 | > |
99 | <i | 101 | <i |
100 | class="fa fa-chevron-down" | 102 | class="fa fa-chevron-down" |
101 | ng-show="show" | 103 | ng-show="show" |
102 | aria-hidden="true" | 104 | aria-hidden="true" |
103 | > | 105 | > |
104 | </i> | 106 | </i> |
105 | <i | 107 | <i |
106 | class="fa fa-chevron-up" | 108 | class="fa fa-chevron-up" |
107 | ng-hide="show" | 109 | ng-hide="show" |
108 | aria-hidden="true"> | 110 | aria-hidden="true"> |
109 | </i> | 111 | </i> |
110 | </button> | 112 | </button> |
111 | </th> | 113 | </th> |
112 | </tr> | 114 | </tr> |
113 | </thead> | 115 | </thead> |
114 | <tbody class="tabla-articulo-body"> | 116 | <tbody class="tabla-articulo-body"> |
115 | <tr | 117 | <tr |
116 | ng-repeat="(key, articulo) in articulosTabla" | 118 | ng-repeat="(key, articulo) in articulosTabla" |
117 | ng-show="show || key == (articulosTabla.length - 1)" | 119 | ng-show="show || key == (articulosTabla.length - 1)" |
118 | class="d-flex" | 120 | class="d-flex" |
119 | > | 121 | > |
120 | <td ng-bind="key + 1"></td> | 122 | <td ng-bind="key + 1"></td> |
121 | <td | 123 | <td |
122 | class="col" | 124 | class="col" |
123 | ng-bind="articulo.sector + '-' + articulo.codigo" | 125 | ng-bind="articulo.sector + '-' + articulo.codigo" |
124 | ></td> | 126 | ></td> |
125 | <td | 127 | <td |
126 | class="col-4" | 128 | class="col-4" |
127 | ng-bind="articulo.descripcion" | 129 | ng-bind="articulo.descripcion" |
128 | ></td> | 130 | ></td> |
129 | <td class="col text-right"> | 131 | <td class="col text-right"> |
130 | <input | 132 | <input |
131 | ng-show="articulo.edit" | 133 | ng-show="articulo.editCantidad" |
132 | ng-model="articulo.cantidad" | 134 | ng-model="articulo.cantidad" |
133 | class="form-control" | 135 | class="form-control" |
134 | type="number" | 136 | type="number" |
135 | min="1" | 137 | min="1" |
136 | foca-focus="articulo.edit" | 138 | foca-focus="articulo.editCantidad" |
137 | ng-keypress="editarArticulo($event.keyCode, articulo)" | 139 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
138 | ng-focus="selectFocus($event)" | 140 | ng-focus="selectFocus($event)" |
139 | > | 141 | > |
140 | <i | 142 | <i |
141 | class="selectable" | 143 | class="selectable" |
142 | ng-click="cambioEdit(articulo)" | 144 | ng-click="cambioEdit(articulo, 'cantidad')" |
143 | ng-hide="articulo.edit" | 145 | ng-hide="articulo.editCantidad" |
144 | ng-bind="articulo.cantidad"> | 146 | ng-bind="articulo.cantidad"> |
145 | </i> | 147 | </i> |
146 | </td> | 148 | </td> |
147 | <td | 149 | <td class="col text-right"> |
148 | class="col text-right" | 150 | <input |
149 | ng-bind="articulo.precio | currency: '$'" | 151 | ng-show="articulo.editPrecio" |
150 | ></td> | 152 | ng-model="articulo.precio" |
153 | class="form-control" | ||
154 | type="number" | ||
155 | min="1" | ||
156 | step="0.01" | ||
157 | foca-focus="articulo.editPrecio" | ||
158 | ng-keypress="editarArticulo($event.keyCode, articulo)" | ||
159 | ng-focus="selectFocus($event)" | ||
160 | > | ||
161 | <i | ||
162 | class="selectable" | ||
163 | ng-click="idLista == -1 && cambioEdit(articulo, 'precio')" | ||
164 | ng-hide="articulo.editPrecio" | ||
165 | ng-bind="articulo.precio | currency: '$'"> | ||
166 | </i> | ||
167 | </td> | ||
151 | <td | 168 | <td |
152 | class="col text-right" | 169 | class="col text-right" |
153 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> | 170 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> |
154 | </td> | 171 | </td> |
155 | <td class="text-center"> | 172 | <td class="text-center"> |
156 | <button | 173 | <button |
157 | class="btn btn-outline-secondary" | 174 | class="btn btn-outline-secondary" |
158 | ng-click="quitarArticulo(key)" | 175 | ng-click="quitarArticulo(key)" |
159 | > | 176 | > |
160 | <i class="fa fa-trash"></i> | 177 | <i class="fa fa-trash"></i> |
161 | </button> | 178 | </button> |
162 | </td> | 179 | </td> |
163 | </tr> | 180 | </tr> |
164 | </tbody> | 181 | </tbody> |
165 | <tfoot> | 182 | <tfoot> |
166 | <tr ng-show="!cargando" class="d-flex"> | 183 | <tr ng-show="!cargando" class="d-flex"> |
167 | <td | 184 | <td |
168 | class="align-middle" | 185 | class="align-middle" |
169 | ng-bind="articulosTabla.length + 1" | 186 | ng-bind="articulosTabla.length + 1" |
170 | ></td> | 187 | ></td> |
171 | <td class="col"> | 188 | <td class="col"> |
172 | <input | 189 | <input |
173 | class="form-control" | 190 | class="form-control" |
174 | ng-model="articuloACargar.sectorCodigo" | 191 | ng-model="articuloACargar.sectorCodigo" |
175 | readonly | 192 | readonly |
176 | > | 193 | > |
177 | </td> | 194 | </td> |
178 | <td class="col-4 tabla-articulo-descripcion"> | 195 | <td class="col-4 tabla-articulo-descripcion"> |
179 | <input | 196 | <input |
180 | class="form-control" | 197 | class="form-control" |
181 | ng-model="articuloACargar.descripcion" | 198 | ng-model="articuloACargar.descripcion" |
182 | readonly | 199 | readonly |
183 | > | 200 | > |
184 | </td> | 201 | </td> |
185 | <td class="col text-right"> | 202 | <td class="col text-right"> |
186 | <input | 203 | <input |
187 | class="form-control" | 204 | class="form-control" |
188 | type="number" | 205 | type="number" |
189 | min="1" | 206 | min="1" |
190 | ng-model="articuloACargar.cantidad" | 207 | ng-model="articuloACargar.cantidad" |
191 | foca-focus="!cargando" | 208 | foca-focus="!cargando" |
192 | esc-key="resetFilter()" | 209 | esc-key="resetFilter()" |
193 | ng-keypress="agregarATabla($event.keyCode)" | 210 | ng-keypress="agregarATabla($event.keyCode)" |
194 | > | 211 | > |
195 | </td> | 212 | </td> |
196 | <td class="col text-right"> | 213 | <td class="col text-right"> |
197 | <input | 214 | <input |
198 | class="form-control" | 215 | class="form-control" |
199 | ng-value="articuloACargar.precio | currency: '$'" | 216 | ng-value="articuloACargar.precio | currency: '$'" |
217 | ng-show="idLista != -1" | ||
200 | readonly | 218 | readonly |
201 | > | 219 | > |
220 | <input | ||
221 | class="form-control" | ||
222 | type="number" | ||
223 | step="0.01" | ||
224 | ng-model="articuloACargar.precio" | ||
225 | esc-key="resetFilter()" | ||
226 | ng-keypress="agregarATabla($event.keyCode)" | ||
227 | ng-show="idLista == -1" | ||
228 | > | ||
202 | </td> | 229 | </td> |
203 | <td class="col text-right"> | 230 | <td class="col text-right"> |
204 | <input | 231 | <input |
205 | class="form-control" | 232 | class="form-control" |
206 | ng-value="getSubTotal() | currency: '$'" | 233 | ng-value="getSubTotal() | currency: '$'" |
207 | readonly | 234 | readonly |
208 | ></td> | 235 | ></td> |
209 | <td class="text-center align-middle"> | 236 | <td class="text-center align-middle"> |
210 | <button | 237 | <button |
211 | class="btn btn-outline-secondary" | 238 | class="btn btn-outline-secondary" |
212 | ng-click="agregarATabla(13)" | 239 | ng-click="agregarATabla(13)" |
213 | > | 240 | > |
214 | <i class="fa fa-save"></i> | 241 | <i class="fa fa-save"></i> |
215 | </button> | 242 | </button> |
216 | </td> | 243 | </td> |
217 | </tr> | 244 | </tr> |
218 | <tr ng-show="cargando" class="d-flex"> | 245 | <tr ng-show="cargando" class="d-flex"> |
219 | <td colspan="7" class="col-12"> | 246 | <td colspan="7" class="col-12"> |
220 | <input | 247 | <input |
221 | placeholder="Seleccione Articulo" | 248 | placeholder="Seleccione Articulo" |
222 | class="form-control form-control-sm" | 249 | class="form-control form-control-sm" |
223 | readonly | 250 | readonly |
224 | ng-click="seleccionarArticulo()" | 251 | ng-click="seleccionarArticulo()" |
225 | /> | 252 | /> |
226 | </td> | 253 | </td> |
227 | </tr> | 254 | </tr> |
228 | <tr class="d-flex"> | 255 | <tr class="d-flex"> |
229 | <td colspan="4"> | 256 | <td colspan="4" class="no-border-top"> |
230 | <strong>Cantidad Items:</strong> | 257 | <strong>Items:</strong> |
231 | <a ng-bind="articulosTabla.length"></a> | 258 | <a ng-bind="articulosTabla.length"></a> |
232 | </td> | 259 | </td> |
233 | <td class="text-right ml-auto table-celda-total"><h3>Total:</h3></td> | 260 | <td class="text-right ml-auto table-celda-total no-border-top"> |
234 | <td class="table-celda-total text-right" colspan="1"> | 261 | <h3>Total:</h3> |
262 | </td> | ||
263 | <td class="table-celda-total text-right no-border-top" colspan="1"> | ||
235 | <h3>{{getTotal() | currency: '$'}}</h3> | 264 | <h3>{{getTotal() | currency: '$'}}</h3> |
236 | </td> | 265 | </td> |
237 | <td class="text-right"> | 266 | <td class="text-right no-border-top"> |
238 | <button | 267 | <button |
239 | type="button" | 268 | type="button" |
240 | class="btn btn-default btn-sm" | 269 | class="btn btn-default btn-sm" |
241 | > | 270 | > |
242 | Totales | 271 | Totales |
243 | </button> | 272 | </button> |
244 | </td> | 273 | </td> |
245 | </tr> | 274 | </tr> |
246 | </tfoot> | 275 | </tfoot> |
247 | </table> | 276 | </table> |
248 | </div> | 277 | </div> |
278 | |||
279 | <!-- MOBILE --> | ||
280 | <div class="row d-sm-none"> | ||
281 | <table class="table table-sm table-striped table-dark margin-bottom-mobile"> | ||
282 | <thead> | ||
283 | <tr class="d-flex"> | ||
284 | <th class="">#</th> | ||
285 | <th class="col px-0"> | ||
286 | <div class="d-flex"> | ||
287 | <div class="col-4 px-1">Código</div> | ||
288 | <div class="col-8 px-1">Descripción</div> | ||
289 | </div> | ||
290 | <div class="d-flex"> | ||
291 | <div class="col-3 px-1">Cantidad</div> | ||
292 | <div class="col px-1 text-right">P. Uni.</div> | ||
293 | <div class="col px-1 text-right">Subtotal</div> | ||
294 | </div> | ||
295 | </th> | ||
296 | <th class="text-center tamaño-boton"> | ||
297 | | ||
298 | </th> | ||
299 | </tr> | ||
300 | </thead> | ||
301 | <tbody> | ||
302 | <tr | ||
303 | ng-repeat="(key, articulo) in articulosTabla" | ||
304 | ng-show="show || key == articulosTabla.length - 1" | ||
305 | > | ||
306 | <td class="w-100 align-middle d-flex p-0"> | ||
307 | <div class="align-middle p-1"> | ||
308 | <span ng-bind="key+1" class="align-middle"></span> | ||
309 | </div> | ||
310 | <div class="col px-0"> | ||
311 | <div class="d-flex"> | ||
312 | <div class="col-4 px-1"> | ||
313 | <span | ||
314 | ng-bind="articulo.sector + '-' + articulo.codigo" | ||
315 | ></span> | ||
316 | </div> | ||
317 | <div class="col-8 px-1"> | ||
318 | <span ng-bind="articulo.descripcion"></span> | ||
319 | </div> | ||
320 | </div> | ||
321 | <div class="d-flex"> | ||
322 | <div class="col-3 px-1"> | ||
323 | <span ng-bind="'x' + articulo.cantidad"></span> | ||
324 | </div> | ||
325 | <div class="col-3 px-1 text-right"> | ||
326 | <span ng-bind="articulo.precio | currency: '$'"></span> | ||
327 | </div> | ||
328 | <div class="col px-1 text-right"> | ||
329 | <span | ||
330 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'" | ||
331 | > | ||
332 | </span> | ||
333 | </div> | ||
334 | </div> | ||
335 | </div> | ||
336 | <div class="align-middle p-1"> | ||
337 | <button | ||
338 | class="btn btn-outline-secondary" | ||
339 | ng-click="quitarArticulo(key)" | ||
340 | > | ||
341 | <i class="fa fa-trash"></i> | ||
342 | </button> | ||
343 | </div> | ||
344 | </td> | ||
345 | </tr> | ||
346 | </tbody> | ||
347 | <tfoot> | ||
348 | <!-- CARGANDO ITEM --> | ||
349 | <tr ng-show="!cargando" class="d-flex"> | ||
350 | <td | ||
351 | class="align-middle p-1" | ||
352 | ng-bind="articulosTabla.length + 1" | ||
353 | ></td> | ||
354 | <td class="col p-0"> | ||
355 | <div class="d-flex"> | ||
356 | <div class="col-4 px-1"> | ||
357 | <span | ||
358 | ng-bind="articuloACargar.sectorCodigo" | ||
359 | ></span> | ||
360 | </div> | ||
361 | <div class="col-8 px-1"> | ||
362 | <span ng-bind="articuloACargar.descripcion"></span> | ||
363 | </div> | ||
364 | </div> | ||
365 | <div class="d-flex"> | ||
366 | <div class="col-3 px-1 m-1"> | ||
367 | <input | ||
368 | class="form-control p-1" | ||
369 | type="number" | ||
370 | min="1" | ||
371 | ng-model="articuloACargar.cantidad" | ||
372 | foca-focus="!cargando" | ||
373 | ng-keypress="agregarATabla($event.keyCode)" | ||
374 | style="height: auto; line-height: 1.1em" | ||
375 | > | ||
376 | </div> | ||
377 | <div class="col-3 px-1 text-right"> | ||
378 | <span ng-bind="articuloACargar.precio | currency: '$'"></span> | ||
379 | </div> | ||
380 | <div class="col px-1 text-right"> | ||
381 | <span | ||
382 | ng-bind="getSubTotal() | currency: '$'" | ||
383 | > | ||
384 | </span> | ||
385 | </div> | ||
386 | </div> | ||
387 | </td> | ||
388 | <td class="text-center align-middle"> | ||
389 | <button | ||
390 | class="btn btn-outline-secondary" | ||
391 | ng-click="agregarATabla(13)" | ||
392 | > | ||
393 | <i class="fa fa-save"></i> | ||
394 | </button> | ||
395 | </td> | ||
396 | </tr> | ||
397 | <!-- SELECCIONAR PRODUCTO --> | ||
398 | <tr ng-show="cargando" class="d-flex"> | ||
399 | <td class="col-12"> | ||
400 | <input | ||
401 | placeholder="Seleccione Articulo" | ||
402 | class="form-control form-control-sm" | ||
403 | readonly | ||
404 | ng-click="seleccionarArticulo()" | ||
405 | /> | ||
406 | </td> | ||
407 | </tr> | ||
408 | <!-- TOOGLE EXPANDIR --> | ||
409 | <tr> | ||
410 | <td class="col"> | ||
411 | <button | ||
412 | class="btn btn-outline-secondary selectable w-100" | ||
413 | ng-click="show = !show; masMenos()" | ||
414 | ng-show="articulosTabla.length > 0" | ||
415 | > | ||
416 | <i | ||
417 | class="fa fa-chevron-down" | ||
418 | ng-hide="show" | ||
419 | aria-hidden="true" | ||
420 | > | ||
421 | </i> | ||
422 | <i | ||
423 | class="fa fa-chevron-up" | ||
424 | ng-show="show" | ||
425 | aria-hidden="true"> | ||
426 | </i> | ||
427 | </button> | ||
428 | </td> | ||
429 | </tr> | ||
430 | <!-- FOOTER --> | ||
431 | <tr class="d-flex"> | ||
432 | <td class="align-middle no-border-top" colspan="2"> | ||
433 | <strong>Cantidad Items:</strong> | ||
434 | <a ng-bind="articulosTabla.length"></a> | ||
435 | </td> | ||
436 | <td class="text-right ml-auto table-celda-total no-border-top"> | ||
437 | <h3>Total:</h3> | ||
438 | </td> | ||
439 | <td class="table-celda-total text-right no-border-top"> | ||
440 | <h3>{{getTotal() | currency: '$'}}</h3> | ||
441 | </td> | ||
442 | </tr> | ||
443 | </tfoot> | ||
444 | </table> | ||
445 | </div> | ||
249 | </div> | 446 | </div> |
250 | <div class="col-auto my-2 col-lg-2 botonera-lateral"> | 447 | <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> |
251 | <div class="row align-items-end"> | 448 | <div class="row align-items-end"> |
252 | <div class="col-12"> | 449 | <div class="col-12"> |
253 | <button | 450 | <button |
254 | ng-click="crearNotaPedido()" | 451 | ng-click="crearNotaPedido()" |
255 | type="submit" | 452 | type="submit" |
256 | title="Crear nota pedido" | 453 | title="Crear nota pedido" |
257 | class="btn btn-default btn-block mb-2"> | 454 | class="btn btn-default btn-block mb-2"> |
258 | Guardar | 455 | Guardar |
259 | </button> | 456 | </button> |
260 | <button | 457 | <button |
261 | ng-click="salir()" | 458 | ng-click="salir()" |
262 | type="button" | 459 | type="button" |
263 | title="Salir" | 460 | title="Salir" |
264 | class="btn btn-default btn-block"> | 461 | class="btn btn-default btn-block"> |
265 | Salir | 462 | Salir |
266 | </button> | 463 | </button> |
267 | </div> | 464 | </div> |
268 | </div> | 465 | </div> |
269 | </div> | 466 | </div> |
270 | </div> | 467 | </div> |
468 | <div class="row d-md-none fixed-bottom"> | ||
469 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> | ||
470 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> | ||
471 | <span class="mr-3 ml-auto" ng-click="crearNotaPedido()">Guardar</span> | ||
472 | </div> | ||
473 | </div> | ||
271 | </div> | 474 | </div> |
272 | 475 |