Commit 1194dd7f405463e2f802c960297f3f10f5abe83a
Exists in
master
Merge remote-tracking branch 'upstream/master'
Showing
8 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 | '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion",'+ | 47 | '"focaModalProveedor","focaBusquedaCliente","focaModalPrecioCondicion",'+ |
48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio"', ''), | 48 | '"focaModalFlete","focaDirectivas","focaModal","focaModalDomicilio"', ''), |
49 | gulp.dest(paths.dist) | 49 | gulp.dest(paths.dist) |
50 | ] | 50 | ] |
51 | ); | 51 | ); |
52 | }); | 52 | }); |
53 | 53 | ||
54 | gulp.task('clean', function(){ | 54 | gulp.task('clean', function(){ |
55 | return gulp.src(['tmp', 'dist'], {read: false}) | 55 | return gulp.src(['tmp', 'dist'], {read: false}) |
56 | .pipe(clean()); | 56 | .pipe(clean()); |
57 | }); | 57 | }); |
58 | 58 | ||
59 | gulp.task('pre-commit', function() { | 59 | gulp.task('pre-commit', function() { |
60 | return pump( | 60 | return pump( |
61 | [ | 61 | [ |
62 | gulp.src(paths.srcJS), | 62 | gulp.src(paths.srcJS), |
63 | jshint('.jshintrc'), | 63 | jshint('.jshintrc'), |
64 | jshint.reporter('default'), | 64 | jshint.reporter('default'), |
65 | jshint.reporter('fail') | 65 | jshint.reporter('fail') |
66 | ] | 66 | ] |
67 | ); | 67 | ); |
68 | 68 | ||
69 | gulp.start('uglify'); | 69 | gulp.start('uglify'); |
70 | }); | 70 | }); |
71 | 71 | ||
72 | gulp.task('webserver', function() { | 72 | gulp.task('webserver', function() { |
73 | pump [ | 73 | pump [ |
74 | connect.server({port: 3000}) | 74 | connect.server({port: 3000}) |
75 | ] | 75 | ] |
76 | }); | 76 | }); |
77 | 77 | ||
78 | gulp.task('clean-post-install', function() { | 78 | gulp.task('clean-post-install', function() { |
79 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 79 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
80 | 'index.html'], {read: false}) | 80 | 'index.html'], {read: false}) |
81 | .pipe(clean()); | 81 | .pipe(clean()); |
82 | }); | 82 | }); |
83 | 83 | ||
84 | gulp.task('default', ['webserver']); | 84 | gulp.task('default', ['webserver']); |
85 | 85 | ||
86 | gulp.task('watch', function() { | 86 | gulp.task('watch', function() { |
87 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 87 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
88 | }); | 88 | }); |
89 | 89 |
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 | 9 | ||
10 | <!--VENDOR JS--> | 10 | <!--VENDOR JS--> |
11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | 11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | 12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
13 | <script src="node_modules/angular/angular.min.js"></script> | 13 | <script src="node_modules/angular/angular.min.js"></script> |
14 | <script src="node_modules/angular-route/angular-route.min.js"></script> | 14 | <script src="node_modules/angular-route/angular-route.min.js"></script> |
15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | 15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
16 | 16 | ||
17 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | 17 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> |
18 | <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> | 18 | <script src="node_modules/foca-modal-vendedores/dist/foca-modal-vendedores.min.js"></script> |
19 | <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> | 19 | <script src="node_modules/foca-modal-busqueda-productos/dist/foca-busqueda-productos.min.js"></script> |
20 | <script src="node_modules/foca-modal-petroleras/dist/foca-modal-petroleras.min.js"></script> | 20 | <script src="node_modules/foca-modal-proveedor/dist/foca-modal-proveedor.min.js"></script> |
21 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> | 21 | <script src="node_modules/foca-busqueda-cliente/dist/foca-busqueda-cliente.min.js"></script> |
22 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> | 22 | <script src="node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js"></script> |
23 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> | 23 | <script src="node_modules/foca-modal-flete/dist/foca-modal-flete.min.js"></script> |
24 | <script src="node_modules/foca-modal/dist/foca-modal.min.js"></script> | 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 | <script src="node_modules/foca-modal-domicilio/dist/foca-modal-domicilios.min.js"></script> |
26 | 26 | ||
27 | <script src="src/js/app.js"></script> | 27 | <script src="src/js/app.js"></script> |
28 | <script src="src/js/controller.js"></script> | 28 | <script src="src/js/controller.js"></script> |
29 | <script src="src/js/service.js"></script> | 29 | <script src="src/js/service.js"></script> |
30 | <script src="src/js/route.js"></script> | 30 | <script src="src/js/route.js"></script> |
31 | 31 | ||
32 | <script src="src/etc/develop.js"></script> | 32 | <script src="src/etc/develop.js"></script> |
33 | </head> | 33 | </head> |
34 | <body> | 34 | <body> |
35 | <div ng-view class="container-fluid"></div> | 35 | <div ng-view class="container-fluid"></div> |
36 | </body> | 36 | </body> |
37 | </html> | 37 | </html> |
38 | 38 |
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-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" | 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-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" |
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-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.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 | }, | 28 | }, |
29 | "devDependencies": { | 29 | "devDependencies": { |
30 | "angular": "^1.7.5", | 30 | "angular": "^1.7.5", |
31 | "angular-route": "^1.7.5", | 31 | "angular-route": "^1.7.5", |
32 | "bootstrap": "^4.1.3", | 32 | "bootstrap": "^4.1.3", |
33 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", | 33 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", |
34 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 34 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
35 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", | 35 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", |
36 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/modulos-npm/foca-modal-busqueda-productos", | 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 | "foca-modal-domicilio": "git+https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git", |
38 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", | 38 | "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", |
39 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", | 39 | "foca-modal-proveedor": "git+https://debo.suite.repo/modulos-npm/foca-modal-proveedor.git", |
40 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", | 40 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
41 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", | 41 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
42 | "font-awesome": "^4.7.0", | 42 | "font-awesome": "^4.7.0", |
43 | "gulp": "^3.9.1", | 43 | "gulp": "^3.9.1", |
44 | "gulp-angular-templatecache": "2.2.2", | 44 | "gulp-angular-templatecache": "2.2.2", |
45 | "gulp-clean": "^0.4.0", | 45 | "gulp-clean": "^0.4.0", |
46 | "gulp-concat": "^2.6.1", | 46 | "gulp-concat": "^2.6.1", |
47 | "gulp-connect": "^5.6.1", | 47 | "gulp-connect": "^5.6.1", |
48 | "gulp-htmlmin": "^5.0.1", | 48 | "gulp-htmlmin": "^5.0.1", |
49 | "gulp-jshint": "^2.1.0", | 49 | "gulp-jshint": "^2.1.0", |
50 | "gulp-rename": "^1.4.0", | 50 | "gulp-rename": "^1.4.0", |
51 | "gulp-replace": "^1.0.0", | 51 | "gulp-replace": "^1.0.0", |
52 | "gulp-sequence": "^1.0.0", | 52 | "gulp-sequence": "^1.0.0", |
53 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
54 | "gulp-uglify-es": "^1.0.4", | 54 | "gulp-uglify-es": "^1.0.4", |
55 | "jasmine-core": "^3.2.1", | 55 | "jasmine-core": "^3.2.1", |
56 | "jquery": "^3.3.1", | 56 | "jquery": "^3.3.1", |
57 | "jshint": "^2.9.6", | 57 | "jshint": "^2.9.6", |
58 | "pre-commit": "^1.2.2", | 58 | "pre-commit": "^1.2.2", |
59 | "pump": "^3.0.0", | 59 | "pump": "^3.0.0", |
60 | "ui-bootstrap4": "^3.0.5" | 60 | "ui-bootstrap4": "^3.0.5" |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 |
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 | 'focaModalPetroleras', | 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 | ]); | 13 | ]); |
14 | 14 |
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', | 4 | 'focaModalService', |
5 | function( | 5 | function( |
6 | $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService | 6 | $scope, $uibModal, $location, $filter, crearNotaPedidoService, focaModalService |
7 | ) { | 7 | ) { |
8 | $scope.botonera = [ | 8 | $scope.botonera = [ |
9 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, | 9 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, |
10 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, | 10 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, |
11 | {texto: 'Proveedor', accion: function() {}}, | 11 | {texto: 'Proveedor', accion: function() {$scope.seleccionarProveedor();}}, |
12 | {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, | 12 | {texto: 'Moneda', accion: function() {$scope.abrirModalMoneda();}}, |
13 | { | 13 | { |
14 | texto: 'Precios y condiciones', | 14 | texto: 'Precios y condiciones', |
15 | accion: function() {$scope.abrirModalListaPrecio();}}, | 15 | accion: function() {$scope.abrirModalListaPrecio();}}, |
16 | {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, | 16 | {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, |
17 | {texto: '', accion: function() {}}, | 17 | {texto: '', accion: function() {}}, |
18 | {texto: '', accion: function() {}} | 18 | {texto: '', accion: function() {}} |
19 | ]; | 19 | ]; |
20 | 20 | ||
21 | $scope.show = false; | 21 | $scope.show = false; |
22 | $scope.cargando = true; | 22 | $scope.cargando = true; |
23 | $scope.dateOptions = { | 23 | $scope.dateOptions = { |
24 | maxDate: new Date(), | 24 | maxDate: new Date(), |
25 | minDate: new Date(2010, 0, 1) | 25 | minDate: new Date(2010, 0, 1) |
26 | }; | 26 | }; |
27 | 27 | ||
28 | $scope.notaPedido = { | 28 | $scope.notaPedido = { |
29 | vendedor: {}, | 29 | vendedor: {}, |
30 | cliente: {}, | 30 | cliente: {}, |
31 | domicilio: {dom: ''}, | 31 | domicilio: {dom: ''}, |
32 | moneda: {detalle: ''} | 32 | moneda: {detalle: ''} |
33 | }; | 33 | }; |
34 | 34 | ||
35 | $scope.cabecera = []; | 35 | $scope.cabecera = []; |
36 | 36 | ||
37 | $scope.now = new Date(); | 37 | $scope.now = new Date(); |
38 | $scope.puntoVenta = Math.round(Math.random() * 10000); | 38 | $scope.puntoVenta = Math.round(Math.random() * 10000); |
39 | $scope.comprobante = Math.round(Math.random() * 1000000); | 39 | $scope.comprobante = Math.round(Math.random() * 1000000); |
40 | 40 | ||
41 | $scope.articulosTabla = []; | 41 | $scope.articulosTabla = []; |
42 | var idLista; | 42 | var idLista; |
43 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | 43 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); |
44 | crearNotaPedidoService.getPrecioCondicion().then( | 44 | crearNotaPedidoService.getPrecioCondicion().then( |
45 | function(res) { | 45 | function(res) { |
46 | $scope.precioCondiciones = res.data; | 46 | $scope.precioCondiciones = res.data; |
47 | } | 47 | } |
48 | ); | 48 | ); |
49 | if (notaPedidoTemp !== undefined) { | 49 | if (notaPedidoTemp !== undefined) { |
50 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); | 50 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); |
51 | $scope.notaPedido = notaPedidoTemp; | 51 | $scope.notaPedido = notaPedidoTemp; |
52 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); | 52 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); |
53 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); | 53 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); |
54 | idLista = $scope.notaPedido.precioCondicion; | 54 | idLista = $scope.notaPedido.precioCondicion; |
55 | crearNotaPedidoService | 55 | crearNotaPedidoService |
56 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( | 56 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( |
57 | function(res) { | 57 | function(res) { |
58 | $scope.articulosTabla = res.data; | 58 | $scope.articulosTabla = res.data; |
59 | } | 59 | } |
60 | ); | 60 | ); |
61 | //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO | 61 | //TODO DOMICILIOS QUE SE CARGAN AL EDITAR NOTA DE PEDIDO |
62 | //(NO REQUERIDO EN ESTA VERSION) | 62 | //(NO REQUERIDO EN ESTA VERSION) |
63 | // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( | 63 | // crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( |
64 | // function(res) { | 64 | // function(res) { |
65 | // $scope.notaPedido.domicilio = res.data; | 65 | // $scope.notaPedido.domicilio = res.data; |
66 | // } | 66 | // } |
67 | // ); | 67 | // ); |
68 | } else { | 68 | } else { |
69 | $scope.notaPedido.fechaCarga = new Date(); | 69 | $scope.notaPedido.fechaCarga = new Date(); |
70 | $scope.notaPedido.bomba = '0'; | 70 | $scope.notaPedido.bomba = '0'; |
71 | $scope.notaPedido.flete = '0'; | 71 | $scope.notaPedido.flete = '0'; |
72 | idLista = undefined; | 72 | idLista = undefined; |
73 | } | 73 | } |
74 | //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO | 74 | //TO DO - FUNCIONES PARA MULTIPLES DOMICILIOS NO IMPLEMENTADAS EN ESTA DEMO |
75 | // $scope.addNewDom = function() { | 75 | // $scope.addNewDom = function() { |
76 | // $scope.notaPedido.domicilio.push({ 'id': 0 }); | 76 | // $scope.notaPedido.domicilio.push({ 'id': 0 }); |
77 | // }; | 77 | // }; |
78 | // $scope.removeNewChoice = function(choice) { | 78 | // $scope.removeNewChoice = function(choice) { |
79 | // if ($scope.notaPedido.domicilio.length > 1) { | 79 | // if ($scope.notaPedido.domicilio.length > 1) { |
80 | // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( | 80 | // $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( |
81 | // function(c) { | 81 | // function(c) { |
82 | // return c.$$hashKey === choice.$$hashKey; | 82 | // return c.$$hashKey === choice.$$hashKey; |
83 | // } | 83 | // } |
84 | // ), 1); | 84 | // ), 1); |
85 | // } | 85 | // } |
86 | // }; | 86 | // }; |
87 | $scope.crearNotaPedido = function() { | 87 | $scope.crearNotaPedido = function() { |
88 | if($scope.articulosTabla.length === 0) { | 88 | if($scope.articulosTabla.length === 0) { |
89 | focaModalService.alert('Debe cargar almenos un articulo'); | 89 | focaModalService.alert('Debe cargar almenos un articulo'); |
90 | return; | 90 | return; |
91 | } | 91 | } |
92 | if($scope.notaPedido.domicilio.id === undefined) { | 92 | if($scope.notaPedido.domicilio.id === undefined) { |
93 | $scope.notaPedido.domicilio.id = 0; | 93 | $scope.notaPedido.domicilio.id = 0; |
94 | } | 94 | } |
95 | var date = new Date(); | 95 | var date = new Date(); |
96 | var notaPedido = { | 96 | var notaPedido = { |
97 | id: 0, | 97 | id: 0, |
98 | fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) | 98 | fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) |
99 | .toISOString().slice(0, 19).replace('T', ' '), | 99 | .toISOString().slice(0, 19).replace('T', ' '), |
100 | vendedor: $scope.notaPedido.vendedor.nombre, | 100 | vendedor: $scope.notaPedido.vendedor.nombre, |
101 | idCliente: $scope.notaPedido.cliente.id, | 101 | idCliente: $scope.notaPedido.cliente.id, |
102 | domicilio: $scope.notaPedido.domicilio, | 102 | domicilio: $scope.notaPedido.domicilio, |
103 | precioCondicion: $scope.notaPedido.precioCondicion, | 103 | precioCondicion: $scope.notaPedido.precioCondicion, |
104 | bomba: $scope.notaPedido.bomba, | 104 | bomba: $scope.notaPedido.bomba, |
105 | flete: $scope.notaPedido.flete, | 105 | flete: $scope.notaPedido.flete, |
106 | total: $scope.getTotal() | 106 | total: $scope.getTotal() |
107 | }; | 107 | }; |
108 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( | 108 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( |
109 | function(data) { | 109 | function(data) { |
110 | focaModalService.alert('Nota pedido creada'); | 110 | focaModalService.alert('Nota pedido creada'); |
111 | if($scope.notaPedido.flete === 1) { | 111 | if($scope.notaPedido.flete === 1) { |
112 | var flete = { | 112 | var flete = { |
113 | idNotaPedido: data.data.id, | 113 | idNotaPedido: data.data.id, |
114 | idTransportista: $scope.notaPedido.fleteId, | 114 | idTransportista: $scope.notaPedido.fleteId, |
115 | idChofer: $scope.notaPedido.chofer.id, | 115 | idChofer: $scope.notaPedido.chofer.id, |
116 | idVehiculo: $scope.notaPedido.vehiculo.id, | 116 | idVehiculo: $scope.notaPedido.vehiculo.id, |
117 | kilometros: $scope.notaPedido.kilometros, | 117 | kilometros: $scope.notaPedido.kilometros, |
118 | costoKilometro: $scope.notaPedido.costoUnitarioKmFlete | 118 | costoKilometro: $scope.notaPedido.costoUnitarioKmFlete |
119 | }; | 119 | }; |
120 | crearNotaPedidoService.crearFlete(flete); | 120 | crearNotaPedidoService.crearFlete(flete); |
121 | } | 121 | } |
122 | var articulosNotaPedido = $scope.articulosTabla; | 122 | var articulosNotaPedido = $scope.articulosTabla; |
123 | for(var i = 0; i < articulosNotaPedido.length; i++) { | 123 | for(var i = 0; i < articulosNotaPedido.length; i++) { |
124 | delete articulosNotaPedido[i].edit; | 124 | delete articulosNotaPedido[i].edit; |
125 | articulosNotaPedido[i].idNotaPedido = data.data.id; | 125 | articulosNotaPedido[i].idNotaPedido = data.data.id; |
126 | crearNotaPedidoService | 126 | crearNotaPedidoService |
127 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]); | 127 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]); |
128 | } | 128 | } |
129 | $scope.limpiarPantalla(); | 129 | $scope.limpiarPantalla(); |
130 | } | 130 | } |
131 | ); | 131 | ); |
132 | }; | 132 | }; |
133 | 133 | ||
134 | $scope.seleccionarArticulo = function() { | 134 | $scope.seleccionarArticulo = function() { |
135 | if (idLista === undefined) { | 135 | if (idLista === undefined) { |
136 | focaModalService.alert( | 136 | focaModalService.alert( |
137 | 'Primero seleccione una lista de precio y condicion'); | 137 | 'Primero seleccione una lista de precio y condicion'); |
138 | return; | 138 | return; |
139 | } | 139 | } |
140 | var modalInstance = $uibModal.open( | 140 | var modalInstance = $uibModal.open( |
141 | { | 141 | { |
142 | ariaLabelledBy: 'Busqueda de Productos', | 142 | ariaLabelledBy: 'Busqueda de Productos', |
143 | templateUrl: 'modal-busqueda-productos.html', | 143 | templateUrl: 'modal-busqueda-productos.html', |
144 | controller: 'modalBusquedaProductosCtrl', | 144 | controller: 'modalBusquedaProductosCtrl', |
145 | resolve: { idLista: function() { return idLista; } }, | 145 | resolve: { idLista: function() { return idLista; } }, |
146 | size: 'lg' | 146 | size: 'lg' |
147 | } | 147 | } |
148 | ); | 148 | ); |
149 | modalInstance.result.then( | 149 | modalInstance.result.then( |
150 | function(producto) { | 150 | function(producto) { |
151 | var newArt = | 151 | var newArt = |
152 | { | 152 | { |
153 | id: 0, | 153 | id: 0, |
154 | codigo: producto.codigo, | 154 | codigo: producto.codigo, |
155 | sector: producto.sector, | 155 | sector: producto.sector, |
156 | sectorCodigo: producto.sector + '-' + producto.codigo, | 156 | sectorCodigo: producto.sector + '-' + producto.codigo, |
157 | descripcion: producto.descripcion, | 157 | descripcion: producto.descripcion, |
158 | item: $scope.articulosTabla.length + 1, | 158 | item: $scope.articulosTabla.length + 1, |
159 | nombre: producto.descripcion, | 159 | nombre: producto.descripcion, |
160 | precio: producto.precio.toFixed(2), | 160 | precio: producto.precio.toFixed(2), |
161 | costoUnitario: producto.costo, | 161 | costoUnitario: producto.costo, |
162 | edit: false | 162 | edit: false |
163 | }; | 163 | }; |
164 | $scope.articuloACargar = newArt; | 164 | $scope.articuloACargar = newArt; |
165 | $scope.cargando = false; | 165 | $scope.cargando = false; |
166 | }, function() { | 166 | }, function() { |
167 | // funcion ejecutada cuando se cancela el modal | 167 | // funcion ejecutada cuando se cancela el modal |
168 | } | 168 | } |
169 | ); | 169 | ); |
170 | }; | 170 | }; |
171 | 171 | ||
172 | $scope.seleccionarVendedor = function() { | 172 | $scope.seleccionarVendedor = function() { |
173 | var modalInstance = $uibModal.open( | 173 | var modalInstance = $uibModal.open( |
174 | { | 174 | { |
175 | ariaLabelledBy: 'Busqueda de Vendedores', | 175 | ariaLabelledBy: 'Busqueda de Vendedores', |
176 | templateUrl: 'modal-vendedores.html', | 176 | templateUrl: 'modal-vendedores.html', |
177 | controller: 'modalVendedoresCtrl', | 177 | controller: 'modalVendedoresCtrl', |
178 | size: 'lg' | 178 | size: 'lg' |
179 | } | 179 | } |
180 | ); | 180 | ); |
181 | modalInstance.result.then( | 181 | modalInstance.result.then( |
182 | function(vendedor) { | 182 | function(vendedor) { |
183 | addCabecera('Vendedor:', vendedor.NomVen); | 183 | addCabecera('Vendedor:', vendedor.NomVen); |
184 | $scope.notaPedido.vendedor.nombre = vendedor.NomVen; | 184 | $scope.notaPedido.vendedor.nombre = vendedor.NomVen; |
185 | }, function() { | 185 | }, function() { |
186 | 186 | ||
187 | } | 187 | } |
188 | ); | 188 | ); |
189 | }; | 189 | }; |
190 | 190 | ||
191 | $scope.seleccionarPetrolera = function() { | 191 | $scope.seleccionarProveedor = function() { |
192 | var modalInstance = $uibModal.open( | 192 | var modalInstance = $uibModal.open( |
193 | { | 193 | { |
194 | ariaLabelledBy: 'Busqueda de Petrolera', | 194 | ariaLabelledBy: 'Busqueda de Proveedor', |
195 | templateUrl: 'modal-petroleras.html', | 195 | templateUrl: 'modal-proveedor.html', |
196 | controller: 'modalPetrolerasCtrl', | 196 | controller: 'focaModalProveedorCtrl', |
197 | size: 'lg' | 197 | size: 'lg' |
198 | } | 198 | } |
199 | ); | 199 | ); |
200 | modalInstance.result.then( | 200 | modalInstance.result.then( |
201 | function(petrolera) { | 201 | function(proveedor) { |
202 | $scope.notaPedido.petrolera = petrolera.NOM; | 202 | $scope.notaPedido.proveedor = proveedor.NOM; |
203 | addCabecera('Proveedor:', proveedor.NOM); | ||
203 | }, function() { | 204 | }, function() { |
204 | 205 | ||
205 | } | 206 | } |
206 | ); | 207 | ); |
207 | }; | 208 | }; |
208 | 209 | ||
209 | $scope.seleccionarCliente = function() { | 210 | $scope.seleccionarCliente = function() { |
210 | var modalInstance = $uibModal.open( | 211 | var modalInstance = $uibModal.open( |
211 | { | 212 | { |
212 | ariaLabelledBy: 'Busqueda de Cliente', | 213 | ariaLabelledBy: 'Busqueda de Cliente', |
213 | templateUrl: 'foca-busqueda-cliente-modal.html', | 214 | templateUrl: 'foca-busqueda-cliente-modal.html', |
214 | controller: 'focaBusquedaClienteModalController', | 215 | controller: 'focaBusquedaClienteModalController', |
215 | size: 'lg' | 216 | size: 'lg' |
216 | } | 217 | } |
217 | ); | 218 | ); |
218 | modalInstance.result.then( | 219 | modalInstance.result.then( |
219 | function(cliente) { | 220 | function(cliente) { |
220 | $scope.notaPedido.cliente.nombre = cliente.nom; | 221 | $scope.notaPedido.cliente.nombre = cliente.nom; |
221 | $scope.notaPedido.cliente.id = cliente.cod; | 222 | $scope.notaPedido.cliente.id = cliente.cod; |
222 | crearNotaPedidoService.getDomiciliosByIdCliente(cliente.cod).then( | 223 | crearNotaPedidoService.getDomiciliosByIdCliente(cliente.cod).then( |
223 | function(data) { | 224 | function(data) { |
224 | if(data.data.length === 0){ | 225 | if(data.data.length === 0){ |
225 | focaModalService | 226 | focaModalService |
226 | .alert('El cliente no tienen domicilios de entrega') | 227 | .alert('El cliente no tienen domicilios de entrega') |
227 | .then( | 228 | .then( |
228 | function() { | 229 | function() { |
229 | $scope.seleccionarCliente(); | 230 | $scope.seleccionarCliente(); |
230 | $scope.notaPedido.cliente = {nombre: ''}; | 231 | $scope.notaPedido.cliente = {nombre: ''}; |
231 | } | 232 | } |
232 | ); | 233 | ); |
233 | return; | 234 | return; |
234 | } | 235 | } |
235 | var modalInstanceDomicilio = $uibModal.open( | 236 | var modalInstanceDomicilio = $uibModal.open( |
236 | { | 237 | { |
237 | ariaLabelledBy: 'Busqueda de Domicilios', | 238 | ariaLabelledBy: 'Busqueda de Domicilios', |
238 | templateUrl: 'modal-domicilio.html', | 239 | templateUrl: 'modal-domicilio.html', |
239 | controller: 'focaModalDomicilioController', | 240 | controller: 'focaModalDomicilioController', |
240 | resolve: { idCliente: function() { return cliente.cod; }}, | 241 | resolve: { idCliente: function() { return cliente.cod; }}, |
241 | size: 'lg', | 242 | size: 'lg', |
242 | backdrop: 'static', | 243 | backdrop: 'static', |
243 | } | 244 | } |
244 | ); | 245 | ); |
245 | modalInstanceDomicilio.result.then( | 246 | modalInstanceDomicilio.result.then( |
246 | function(domicilio) { | 247 | function(domicilio) { |
247 | focaModalService.alert('Domicilio elegido' + domicilio.dom); | 248 | focaModalService.alert('Domicilio elegido' + domicilio.dom); |
248 | }, function() { | 249 | }, function() { |
249 | $scope.notaPedido.cliente.nombre = ''; | 250 | $scope.notaPedido.cliente.nombre = ''; |
250 | $scope.notaPedido.cliente.id = ''; | 251 | $scope.notaPedido.cliente.id = ''; |
251 | removeCabecera('Cliente:'); | 252 | removeCabecera('Cliente:'); |
252 | $scope.seleccionarCliente(); | 253 | $scope.seleccionarCliente(); |
253 | return; | 254 | return; |
254 | } | 255 | } |
255 | ); | 256 | ); |
256 | } | 257 | } |
257 | ); | 258 | ); |
258 | addCabecera('Cliente:', cliente.nom); | 259 | addCabecera('Cliente:', cliente.nom); |
259 | }, function() { | 260 | }, function() { |
260 | 261 | ||
261 | } | 262 | } |
262 | ); | 263 | ); |
263 | }; | 264 | }; |
264 | 265 | ||
265 | $scope.mostrarFichaCliente = function() { | 266 | $scope.mostrarFichaCliente = function() { |
266 | $uibModal.open( | 267 | $uibModal.open( |
267 | { | 268 | { |
268 | ariaLabelledBy: 'Datos del Cliente', | 269 | ariaLabelledBy: 'Datos del Cliente', |
269 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', | 270 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', |
270 | controller: 'focaCrearNotaPedidoFichaClienteController', | 271 | controller: 'focaCrearNotaPedidoFichaClienteController', |
271 | size: 'lg' | 272 | size: 'lg' |
272 | } | 273 | } |
273 | ); | 274 | ); |
274 | }; | 275 | }; |
275 | 276 | ||
276 | $scope.getTotal = function() { | 277 | $scope.getTotal = function() { |
277 | var total = 0; | 278 | var total = 0; |
278 | var arrayTempArticulos = $scope.articulosTabla; | 279 | var arrayTempArticulos = $scope.articulosTabla; |
279 | for (var i = 0; i < arrayTempArticulos.length; i++) { | 280 | for (var i = 0; i < arrayTempArticulos.length; i++) { |
280 | total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad; | 281 | total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad; |
281 | } | 282 | } |
282 | return total.toFixed(2); | 283 | return total.toFixed(2); |
283 | }; | 284 | }; |
284 | 285 | ||
285 | $scope.getSubTotal = function() { | 286 | $scope.getSubTotal = function() { |
286 | if($scope.articuloACargar) { | 287 | if($scope.articuloACargar) { |
287 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; | 288 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
288 | } | 289 | } |
289 | }; | 290 | }; |
290 | 291 | ||
291 | $scope.abrirModalListaPrecio = function() { | 292 | $scope.abrirModalListaPrecio = function() { |
292 | var modalInstance = $uibModal.open( | 293 | var modalInstance = $uibModal.open( |
293 | { | 294 | { |
294 | ariaLabelledBy: 'Busqueda de Precio Condición', | 295 | ariaLabelledBy: 'Busqueda de Precio Condición', |
295 | templateUrl: 'modal-precio-condicion.html', | 296 | templateUrl: 'modal-precio-condicion.html', |
296 | controller: 'focaModalPrecioCondicionController', | 297 | controller: 'focaModalPrecioCondicionController', |
297 | size: 'lg' | 298 | size: 'lg' |
298 | } | 299 | } |
299 | ); | 300 | ); |
300 | modalInstance.result.then( | 301 | modalInstance.result.then( |
301 | function(precioCondicion) { | 302 | function(precioCondicion) { |
302 | $scope.notaPedido.precioCondicion = precioCondicion.nombre; | 303 | $scope.notaPedido.precioCondicion = precioCondicion.nombre; |
303 | idLista = precioCondicion.idListaPrecio; | 304 | idLista = precioCondicion.idListaPrecio; |
304 | $scope.articulosTabla = []; | 305 | $scope.articulosTabla = []; |
305 | 306 | ||
306 | addCabecera('Precios y condiciones:', precioCondicion.nombre); | 307 | addCabecera('Precios y condiciones:', precioCondicion.nombre); |
307 | }, function() { | 308 | }, function() { |
308 | 309 | ||
309 | } | 310 | } |
310 | ); | 311 | ); |
311 | }; | 312 | }; |
312 | 313 | ||
313 | $scope.abrirModalFlete = function() { | 314 | $scope.abrirModalFlete = function() { |
314 | var modalInstance = $uibModal.open( | 315 | var modalInstance = $uibModal.open( |
315 | { | 316 | { |
316 | ariaLabelledBy: 'Busqueda de Flete', | 317 | ariaLabelledBy: 'Busqueda de Flete', |
317 | templateUrl: 'modal-flete.html', | 318 | templateUrl: 'modal-flete.html', |
318 | controller: 'focaModalFleteController', | 319 | controller: 'focaModalFleteController', |
319 | size: 'lg', | 320 | size: 'lg', |
320 | resolve: { | 321 | resolve: { |
321 | parametrosFlete: | 322 | parametrosFlete: |
322 | function() { | 323 | function() { |
323 | return { | 324 | return { |
324 | flete: $scope.notaPedido.flete, | 325 | flete: $scope.notaPedido.flete, |
325 | bomba: $scope.notaPedido.bomba, | 326 | bomba: $scope.notaPedido.bomba, |
326 | kilometros: $scope.notaPedido.kilometros | 327 | kilometros: $scope.notaPedido.kilometros |
327 | }; | 328 | }; |
328 | } | 329 | } |
329 | } | 330 | } |
330 | } | 331 | } |
331 | ); | 332 | ); |
332 | modalInstance.result.then( | 333 | modalInstance.result.then( |
333 | function(datos) { | 334 | function(datos) { |
334 | $scope.notaPedido.flete = datos.flete; | 335 | $scope.notaPedido.flete = datos.flete; |
335 | $scope.notaPedido.bomba = datos.bomba; | 336 | $scope.notaPedido.bomba = datos.bomba; |
336 | $scope.notaPedido.kilometros = datos.kilometros; | 337 | $scope.notaPedido.kilometros = datos.kilometros; |
337 | 338 | ||
338 | addCabecera('Flete:', datos.flete); | 339 | addCabecera('Flete:', datos.flete); |
339 | if(datos.flete === 'si') { | 340 | if(datos.flete === 'si') { |
340 | addCabecera('Bomba:', datos.bomba); | 341 | addCabecera('Bomba:', datos.bomba); |
341 | addCabecera('Kilometros:', datos.kilometros); | 342 | addCabecera('Kilometros:', datos.kilometros); |
342 | } else { | 343 | } else { |
343 | removeCabecera('Bomba:'); | 344 | removeCabecera('Bomba:'); |
344 | removeCabecera('Kilometros:'); | 345 | removeCabecera('Kilometros:'); |
345 | } | 346 | } |
346 | }, function() { | 347 | }, function() { |
347 | 348 | ||
348 | } | 349 | } |
349 | ); | 350 | ); |
350 | }; | 351 | }; |
351 | 352 | ||
352 | $scope.abrirModalMoneda = function() { | 353 | $scope.abrirModalMoneda = function() { |
353 | var modalInstance = $uibModal.open( | 354 | var modalInstance = $uibModal.open( |
354 | { | 355 | { |
355 | ariaLabelledBy: 'Busqueda de Moneda', | 356 | ariaLabelledBy: 'Busqueda de Moneda', |
356 | templateUrl: 'modal-moneda.html', | 357 | templateUrl: 'modal-moneda.html', |
357 | controller: 'focaModalMonedaController', | 358 | controller: 'focaModalMonedaController', |
358 | size: 'lg' | 359 | size: 'lg' |
359 | } | 360 | } |
360 | ); | 361 | ); |
361 | modalInstance.result.then( | 362 | modalInstance.result.then( |
362 | function(moneda) { | 363 | function(moneda) { |
363 | $scope.notaPedido.moneda = { | 364 | $scope.notaPedido.moneda = { |
364 | id: moneda.ID, | 365 | id: moneda.ID, |
365 | detalle: moneda.DETALLE, | 366 | detalle: moneda.DETALLE, |
366 | simbolo: moneda.SIMBOLO | 367 | simbolo: moneda.SIMBOLO |
367 | }; | 368 | }; |
368 | 369 | ||
369 | addCabecera('Moneda:', moneda.DETALLE); | 370 | addCabecera('Moneda:', moneda.DETALLE); |
370 | }, function() { | 371 | }, function() { |
371 | 372 | ||
372 | } | 373 | } |
373 | ); | 374 | ); |
374 | }; | 375 | }; |
375 | 376 | ||
376 | $scope.agregarATabla = function(key) { | 377 | $scope.agregarATabla = function(key) { |
377 | if(key === 13) { | 378 | if(key === 13) { |
378 | if($scope.articuloACargar.cantidad === undefined || | 379 | if($scope.articuloACargar.cantidad === undefined || |
379 | $scope.articuloACargar.cantidad === 0 || | 380 | $scope.articuloACargar.cantidad === 0 || |
380 | $scope.articuloACargar.cantidad === null ){ | 381 | $scope.articuloACargar.cantidad === null ){ |
381 | focaModalService.alert('El valor debe ser al menos 1'); | 382 | focaModalService.alert('El valor debe ser al menos 1'); |
382 | return; | 383 | return; |
383 | } | 384 | } |
384 | delete $scope.articuloACargar.sectorCodigo; | 385 | delete $scope.articuloACargar.sectorCodigo; |
385 | $scope.articulosTabla.push($scope.articuloACargar); | 386 | $scope.articulosTabla.push($scope.articuloACargar); |
386 | $scope.cargando = true; | 387 | $scope.cargando = true; |
387 | } | 388 | } |
388 | }; | 389 | }; |
389 | 390 | ||
390 | $scope.quitarArticulo = function(key) { | 391 | $scope.quitarArticulo = function(key) { |
391 | $scope.articulosTabla.splice(key, 1); | 392 | $scope.articulosTabla.splice(key, 1); |
392 | }; | 393 | }; |
393 | 394 | ||
394 | $scope.editarArticulo = function(key, articulo) { | 395 | $scope.editarArticulo = function(key, articulo) { |
395 | if(key === 13) { | 396 | if(key === 13) { |
396 | if(articulo.cantidad === null || articulo.cantidad === 0 || | 397 | if(articulo.cantidad === null || articulo.cantidad === 0 || |
397 | articulo.cantidad === undefined){ | 398 | articulo.cantidad === undefined){ |
398 | focaModalService.alert('El valor debe ser al menos 1'); | 399 | focaModalService.alert('El valor debe ser al menos 1'); |
399 | return; | 400 | return; |
400 | } | 401 | } |
401 | articulo.edit = false; | 402 | articulo.edit = false; |
402 | } | 403 | } |
403 | }; | 404 | }; |
404 | 405 | ||
405 | $scope.cambioEdit = function(articulo) { | 406 | $scope.cambioEdit = function(articulo) { |
406 | articulo.edit = true; | 407 | articulo.edit = true; |
407 | }; | 408 | }; |
408 | 409 | ||
409 | $scope.limpiarFlete = function() { | 410 | $scope.limpiarFlete = function() { |
410 | $scope.notaPedido.fleteNombre = ''; | 411 | $scope.notaPedido.fleteNombre = ''; |
411 | $scope.notaPedido.chofer = ''; | 412 | $scope.notaPedido.chofer = ''; |
412 | $scope.notaPedido.vehiculo = ''; | 413 | $scope.notaPedido.vehiculo = ''; |
413 | $scope.notaPedido.kilometros = ''; | 414 | $scope.notaPedido.kilometros = ''; |
414 | $scope.notaPedido.costoUnitarioKmFlete = ''; | 415 | $scope.notaPedido.costoUnitarioKmFlete = ''; |
415 | $scope.choferes = ''; | 416 | $scope.choferes = ''; |
416 | $scope.vehiculos = ''; | 417 | $scope.vehiculos = ''; |
417 | }; | 418 | }; |
418 | 419 | ||
419 | $scope.limpiarPantalla = function() { | 420 | $scope.limpiarPantalla = function() { |
420 | $scope.limpiarFlete(); | 421 | $scope.limpiarFlete(); |
421 | $scope.notaPedido.flete = '0'; | 422 | $scope.notaPedido.flete = '0'; |
422 | $scope.notaPedido.bomba = '0'; | 423 | $scope.notaPedido.bomba = '0'; |
423 | $scope.notaPedido.precioCondicion = ''; | 424 | $scope.notaPedido.precioCondicion = ''; |
424 | $scope.articulosTabla = []; | 425 | $scope.articulosTabla = []; |
425 | $scope.notaPedido.vendedor.nombre = ''; | 426 | $scope.notaPedido.vendedor.nombre = ''; |
426 | $scope.notaPedido.cliente = {nombre: ''}; | 427 | $scope.notaPedido.cliente = {nombre: ''}; |
427 | $scope.notaPedido.domicilio = {dom: ''}; | 428 | $scope.notaPedido.domicilio = {dom: ''}; |
428 | $scope.domiciliosCliente = []; | 429 | $scope.domiciliosCliente = []; |
429 | }; | 430 | }; |
430 | 431 | ||
431 | $scope.resetFilter = function() { | 432 | $scope.resetFilter = function() { |
432 | $scope.articuloACargar = {}; | 433 | $scope.articuloACargar = {}; |
433 | $scope.cargando = true; | 434 | $scope.cargando = true; |
434 | }; | 435 | }; |
435 | 436 | ||
436 | $scope.selectFocus = function($event) { | 437 | $scope.selectFocus = function($event) { |
437 | $event.target.select(); | 438 | $event.target.select(); |
438 | }; | 439 | }; |
439 | 440 | ||
440 | $scope.salir = function() { | 441 | $scope.salir = function() { |
441 | $location.path('/'); | 442 | $location.path('/'); |
442 | }; | 443 | }; |
443 | 444 | ||
444 | function addCabecera(label, valor) { | 445 | function addCabecera(label, valor) { |
445 | var propiedad = $filter('filter')($scope.cabecera, {label: label}); | 446 | var propiedad = $filter('filter')($scope.cabecera, {label: label}); |
446 | if(propiedad.length === 1) { | 447 | if(propiedad.length === 1) { |
447 | propiedad[0].valor = valor; | 448 | propiedad[0].valor = valor; |
448 | } else { | 449 | } else { |
449 | $scope.cabecera.push({label: label, valor: valor}); | 450 | $scope.cabecera.push({label: label, valor: valor}); |
450 | } | 451 | } |
451 | } | 452 | } |
452 | 453 | ||
453 | function removeCabecera(label) { | 454 | function removeCabecera(label) { |
454 | var propiedad = $filter('filter')($scope.cabecera, {label: label}); | 455 | var propiedad = $filter('filter')($scope.cabecera, {label: label}); |
455 | if(propiedad.length === 1){ | 456 | if(propiedad.length === 1){ |
456 | $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); | 457 | $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); |
457 | } | 458 | } |
458 | } | 459 | } |
459 | } | 460 | } |
460 | ] | 461 | ] |
461 | ) | 462 | ) |
462 | .controller('notaPedidoListaCtrl', [ | 463 | .controller('notaPedidoListaCtrl', [ |
463 | '$scope', | 464 | '$scope', |
464 | 'crearNotaPedidoService', | 465 | 'crearNotaPedidoService', |
465 | '$location', | 466 | '$location', |
466 | function($scope, crearNotaPedidoService, $location) { | 467 | function($scope, crearNotaPedidoService, $location) { |
467 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 468 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
468 | $scope.notaPedidos = datos.data; | 469 | $scope.notaPedidos = datos.data; |
469 | }); | 470 | }); |
470 | $scope.editar = function(notaPedido) { | 471 | $scope.editar = function(notaPedido) { |
471 | crearNotaPedidoService.setNotaPedido(notaPedido); | 472 | crearNotaPedidoService.setNotaPedido(notaPedido); |
472 | $location.path('/venta-nota-pedido/abm/'); | 473 | $location.path('/venta-nota-pedido/abm/'); |
473 | }; | 474 | }; |
474 | $scope.crearPedido = function() { | 475 | $scope.crearPedido = function() { |
475 | crearNotaPedidoService.clearNotaPedido(); | 476 | crearNotaPedidoService.clearNotaPedido(); |
476 | $location.path('/venta-nota-pedido/abm/'); | 477 | $location.path('/venta-nota-pedido/abm/'); |
477 | }; | 478 | }; |
478 | } | 479 | } |
479 | ]) | 480 | ]) |
480 | .controller('focaCrearNotaPedidoFichaClienteController', [ | 481 | .controller('focaCrearNotaPedidoFichaClienteController', [ |
481 | '$scope', | 482 | '$scope', |
482 | 'crearNotaPedidoService', | 483 | 'crearNotaPedidoService', |
483 | '$location', | 484 | '$location', |
484 | function($scope, crearNotaPedidoService, $location) { | 485 | function($scope, crearNotaPedidoService, $location) { |
485 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 486 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
486 | $scope.notaPedidos = datos.data; | 487 | $scope.notaPedidos = datos.data; |
487 | }); | 488 | }); |
488 | $scope.editar = function(notaPedido) { | 489 | $scope.editar = function(notaPedido) { |
489 | crearNotaPedidoService.setNotaPedido(notaPedido); | 490 | crearNotaPedidoService.setNotaPedido(notaPedido); |
490 | $location.path('/venta-nota-pedido/abm/'); | 491 | $location.path('/venta-nota-pedido/abm/'); |
491 | }; | 492 | }; |
492 | $scope.crearPedido = function() { | 493 | $scope.crearPedido = function() { |
493 | crearNotaPedidoService.clearNotaPedido(); | 494 | crearNotaPedidoService.clearNotaPedido(); |
494 | $location.path('/venta-nota-pedido/abm/'); | 495 | $location.path('/venta-nota-pedido/abm/'); |
495 | }; | 496 | }; |
496 | } | 497 | } |
497 | ]); | 498 | ]); |
498 | 499 |
src/views/nota-pedido-lista.html
1 | <table class="table table-sm table-hover table-nonfluid"> | 1 | <table class="table table-sm table-hover table-nonfluid"> |
2 | <thead> | 2 | <thead> |
3 | <tr> | 3 | <tr> |
4 | <th>Código</th> | 4 | <th>Código</th> |
5 | <th>Vendedor</th> | 5 | <th>Vendedor</th> |
6 | <th>Cliente</th> | 6 | <th>Cliente</th> |
7 | <th>Petrolera</th> | 7 | <th>Proveedor</th> |
8 | <th>Total</th> | 8 | <th>Total</th> |
9 | <th><button class="btn btn-primary" ng-click="crearPedido()">Crear</button></th> | 9 | <th><button class="btn btn-primary" ng-click="crearPedido()">Crear</button></th> |
10 | </tr> | 10 | </tr> |
11 | </thead> | 11 | </thead> |
12 | <tbody> | 12 | <tbody> |
13 | <tr ng-repeat="item in notaPedidos"> | 13 | <tr ng-repeat="item in notaPedidos"> |
14 | <td ng-bind="item.id"></td> | 14 | <td ng-bind="item.id"></td> |
15 | <td ng-bind="item.vendedor"></td> | 15 | <td ng-bind="item.vendedor"></td> |
16 | <td ng-bind="item.cliente"></td> | 16 | <td ng-bind="item.cliente"></td> |
17 | <td ng-bind="item.petrolera"></td> | 17 | <td ng-bind="item.proveedor"></td> |
18 | <td ng-bind="(item.total | 0) | currency"></td> | 18 | <td ng-bind="(item.total | 0) | currency"></td> |
19 | <td> | 19 | <td> |
20 | <button class="btn btn-info" ng-show="false" ng-click="editar(item)"><i class="fa fa-edit"></i></button> | 20 | <button class="btn btn-info" ng-show="false" ng-click="editar(item)"><i class="fa fa-edit"></i></button> |
21 | <!-- <button class="btn btn-danger" ng-click="borrar(item.id)"><i class="fa fa-trash"></i></button> --> | 21 | <!-- <button class="btn btn-danger" ng-click="borrar(item.id)"><i class="fa fa-trash"></i></button> --> |
22 | </td> | 22 | </td> |
23 | </tr> | 23 | </tr> |
24 | </tbody> | 24 | </tbody> |
25 | </table> | 25 | </table> |
26 | 26 |
src/views/nota-pedido.html
1 | <div class="crear-nota-pedido"> | 1 | <div class="crear-nota-pedido"> |
2 | <form name="formCrearNota" ng-submit="crearNotaPedido()"> | 2 | <form name="formCrearNota" ng-submit="crearNotaPedido()"> |
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-5"> | 8 | <div class="col-5"> |
9 | <div class="h6">NOTA DE PEDIDO</div> | 9 | <div class="h6">NOTA DE PEDIDO</div> |
10 | </div> | 10 | </div> |
11 | <div class="col-3">Nº {{puntoVenta}}-{{comprobante}}</div> | 11 | <div class="col-3">Nº {{puntoVenta}}-{{comprobante}}</div> |
12 | <div class="col-4 text-right"> | 12 | <div class="col-4 text-right"> |
13 | Fecha: {{ now | date:'dd/MM/yyyy HH:mm'}} | 13 | Fecha: {{ now | date:'dd/MM/yyyy HH:mm'}} |
14 | </div> | 14 | </div> |
15 | </div> | 15 | </div> |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-auto" ng-repeat="cab in cabecera"> | 17 | <div class="col-auto" ng-repeat="cab in cabecera"> |
18 | <span class="label" ng-bind="cab.label"></span> | 18 | <span class="label" ng-bind="cab.label"></span> |
19 | <span class="valor" ng-bind="cab.valor"></span> | 19 | <span class="valor" ng-bind="cab.valor"></span> |
20 | </div> | 20 | </div> |
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
23 | </div> | 23 | </div> |
24 | <div class="row p-1 botonera-secundaria"> | 24 | <div class="row p-1 botonera-secundaria"> |
25 | <div class="col-12"> | 25 | <div class="col-12"> |
26 | <div class="row"> | 26 | <div class="row"> |
27 | <div class="col-3 px-0 py-0" ng-repeat="boton in botonera"> | 27 | <div class="col-3 px-0 py-0" ng-repeat="boton in botonera"> |
28 | <button | 28 | <button |
29 | type="button" | 29 | type="button" |
30 | class="btn btn-default btn-block btn-xs text-left py-2" | 30 | class="btn btn-default btn-block btn-xs text-left py-2" |
31 | ng-click="boton.accion()" | 31 | ng-click="boton.accion()" |
32 | > | 32 | > |
33 | <i | 33 | <i |
34 | class="fa fa-arrow-circle-right" | 34 | class="fa fa-arrow-circle-right" |
35 | ng-show="boton.texto != ''" | 35 | ng-show="boton.texto != ''" |
36 | ></i> | 36 | ></i> |
37 | | 37 | |
38 | {{boton.texto}} | 38 | {{boton.texto}} |
39 | </button> | 39 | </button> |
40 | </div> | 40 | </div> |
41 | </div> | 41 | </div> |
42 | </div> | 42 | </div> |
43 | </div> | 43 | </div> |
44 | </div> | 44 | </div> |
45 | </div> | 45 | </div> |
46 | </form> | 46 | </form> |
47 | <div class="row"> | 47 | <div class="row"> |
48 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 48 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
49 | <div class="row grilla-articulo align-items-end"> | 49 | <div class="row grilla-articulo align-items-end"> |
50 | <table class="table table-striped table-sm table-dark tabla-articulo"> | 50 | <table class="table table-striped table-sm table-dark tabla-articulo"> |
51 | <thead> | 51 | <thead> |
52 | <tr> | 52 | <tr> |
53 | <th class="tabla-articulo-numero">#</th> | 53 | <th class="tabla-articulo-numero">#</th> |
54 | <th class="tabla-articulo-codigo">Código</th> | 54 | <th class="tabla-articulo-codigo">Código</th> |
55 | <th class="tabla-articulo-descripcion">Descripción</th> | 55 | <th class="tabla-articulo-descripcion">Descripción</th> |
56 | <th class="tabla-articulo-cantidad text-right">Cantidad</th> | 56 | <th class="tabla-articulo-cantidad text-right">Cantidad</th> |
57 | <th class="tabla-articulo-precio text-right">Precio Unitario</th> | 57 | <th class="tabla-articulo-precio text-right">Precio Unitario</th> |
58 | <th class="tabla-articulo-subtotal text-right">SubTotal</th> | 58 | <th class="tabla-articulo-subtotal text-right">SubTotal</th> |
59 | <th class="tabla-articulo-boton text-right"> | 59 | <th class="tabla-articulo-boton text-right"> |
60 | <button | 60 | <button |
61 | class="btn btn-outline-secondary selectable" | 61 | class="btn btn-outline-secondary selectable" |
62 | ng-click="show = !show; masMenos()" | 62 | ng-click="show = !show; masMenos()" |
63 | > | 63 | > |
64 | <i | 64 | <i |
65 | class="fa fa-chevron-down" | 65 | class="fa fa-chevron-down" |
66 | ng-show="show" | 66 | ng-show="show" |
67 | aria-hidden="true" | 67 | aria-hidden="true" |
68 | > | 68 | > |
69 | </i> | 69 | </i> |
70 | <i | 70 | <i |
71 | class="fa fa-chevron-up" | 71 | class="fa fa-chevron-up" |
72 | ng-hide="show" | 72 | ng-hide="show" |
73 | aria-hidden="true"> | 73 | aria-hidden="true"> |
74 | </i> | 74 | </i> |
75 | </button> | 75 | </button> |
76 | </th> | 76 | </th> |
77 | </tr> | 77 | </tr> |
78 | </thead> | 78 | </thead> |
79 | <tbody class="tabla-articulo-body"> | 79 | <tbody class="tabla-articulo-body"> |
80 | <tr | 80 | <tr |
81 | ng-repeat="(key, articulo) in articulosTabla" | 81 | ng-repeat="(key, articulo) in articulosTabla" |
82 | ng-show="show || key == (articulosTabla.length - 1)" | 82 | ng-show="show || key == (articulosTabla.length - 1)" |
83 | > | 83 | > |
84 | <td class="tabla-articulo-numero" ng-bind="key + 1"></td> | 84 | <td class="tabla-articulo-numero" ng-bind="key + 1"></td> |
85 | <td | 85 | <td |
86 | class="tabla-articulo-codigo" | 86 | class="tabla-articulo-codigo" |
87 | ng-bind="articulo.sector + '-' + articulo.codigo" | 87 | ng-bind="articulo.sector + '-' + articulo.codigo" |
88 | ></td> | 88 | ></td> |
89 | <td | 89 | <td |
90 | class="tabla-articulo-descripcion" | 90 | class="tabla-articulo-descripcion" |
91 | ng-bind="articulo.descripcion" | 91 | ng-bind="articulo.descripcion" |
92 | ></td> | 92 | ></td> |
93 | <td class="tabla-articulo-cantidad text-right"> | 93 | <td class="tabla-articulo-cantidad text-right"> |
94 | <input | 94 | <input |
95 | ng-show="articulo.edit" | 95 | ng-show="articulo.edit" |
96 | ng-model="articulo.cantidad" | 96 | ng-model="articulo.cantidad" |
97 | class="form-control" | 97 | class="form-control" |
98 | type="number" | 98 | type="number" |
99 | min="1" | 99 | min="1" |
100 | foca-focus="articulo.edit" | 100 | foca-focus="articulo.edit" |
101 | ng-keypress="editarArticulo($event.keyCode, articulo)" | 101 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
102 | ng-focus="selectFocus($event)" | 102 | ng-focus="selectFocus($event)" |
103 | > | 103 | > |
104 | <i | 104 | <i |
105 | class="selectable" | 105 | class="selectable" |
106 | ng-click="cambioEdit(articulo)" | 106 | ng-click="cambioEdit(articulo)" |
107 | ng-hide="articulo.edit" | 107 | ng-hide="articulo.edit" |
108 | ng-bind="articulo.cantidad"> | 108 | ng-bind="articulo.cantidad"> |
109 | </i> | 109 | </i> |
110 | </td> | 110 | </td> |
111 | <td | 111 | <td |
112 | class="tabla-articulo-precio text-right" | 112 | class="tabla-articulo-precio text-right" |
113 | ng-bind="articulo.precio | currency: '$'" | 113 | ng-bind="articulo.precio | currency: '$'" |
114 | ></td> | 114 | ></td> |
115 | <td | 115 | <td |
116 | class="tabla-articulo-subtotal text-right" | 116 | class="tabla-articulo-subtotal text-right" |
117 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> | 117 | ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"> |
118 | </td> | 118 | </td> |
119 | <td class="tabla-articulo-boton text-center"> | 119 | <td class="tabla-articulo-boton text-center"> |
120 | <button | 120 | <button |
121 | class="btn btn-outline-secondary btn-sm" | 121 | class="btn btn-outline-secondary btn-sm" |
122 | ng-click="quitarArticulo(key)" | 122 | ng-click="quitarArticulo(key)" |
123 | > | 123 | > |
124 | <i class="fa fa-trash"></i> | 124 | <i class="fa fa-trash"></i> |
125 | </button> | 125 | </button> |
126 | </td> | 126 | </td> |
127 | </tr> | 127 | </tr> |
128 | </tbody> | 128 | </tbody> |
129 | <tfoot> | 129 | <tfoot> |
130 | <tr ng-show="!cargando"> | 130 | <tr ng-show="!cargando"> |
131 | <td | 131 | <td |
132 | class="tabla-articulo-numero align-middle" | 132 | class="tabla-articulo-numero align-middle" |
133 | ng-bind="articulosTabla.length + 1" | 133 | ng-bind="articulosTabla.length + 1" |
134 | ></td> | 134 | ></td> |
135 | <td class="tabla-articulo-codigo"> | 135 | <td class="tabla-articulo-codigo"> |
136 | <input | 136 | <input |
137 | class="form-control" | 137 | class="form-control" |
138 | ng-model="articuloACargar.sectorCodigo" | 138 | ng-model="articuloACargar.sectorCodigo" |
139 | readonly | 139 | readonly |
140 | > | 140 | > |
141 | </td> | 141 | </td> |
142 | <td class="tabla-articulo-descripcion"> | 142 | <td class="tabla-articulo-descripcion"> |
143 | <input | 143 | <input |
144 | class="form-control" | 144 | class="form-control" |
145 | ng-model="articuloACargar.descripcion" | 145 | ng-model="articuloACargar.descripcion" |
146 | readonly | 146 | readonly |
147 | > | 147 | > |
148 | </td> | 148 | </td> |
149 | <td class="tabla-articulo-cantidad text-right"> | 149 | <td class="tabla-articulo-cantidad text-right"> |
150 | <input | 150 | <input |
151 | class="form-control" | 151 | class="form-control" |
152 | type="number" | 152 | type="number" |
153 | min="1" | 153 | min="1" |
154 | ng-model="articuloACargar.cantidad" | 154 | ng-model="articuloACargar.cantidad" |
155 | foca-focus="!cargando" | 155 | foca-focus="!cargando" |
156 | esc-key="resetFilter()" | 156 | esc-key="resetFilter()" |
157 | ng-keypress="agregarATabla($event.keyCode)" | 157 | ng-keypress="agregarATabla($event.keyCode)" |
158 | > | 158 | > |
159 | </td> | 159 | </td> |
160 | <td class="tabla-articulo-precio text-right"> | 160 | <td class="tabla-articulo-precio text-right"> |
161 | <input | 161 | <input |
162 | class="form-control" | 162 | class="form-control" |
163 | ng-value="articuloACargar.precio | currency: '$'" | 163 | ng-value="articuloACargar.precio | currency: '$'" |
164 | readonly | 164 | readonly |
165 | > | 165 | > |
166 | </td> | 166 | </td> |
167 | <td class="tabla-articulo-subtotal text-right"> | 167 | <td class="tabla-articulo-subtotal text-right"> |
168 | <input | 168 | <input |
169 | class="form-control" | 169 | class="form-control" |
170 | ng-value="getSubTotal() | currency: '$'" | 170 | ng-value="getSubTotal() | currency: '$'" |
171 | readonly | 171 | readonly |
172 | ></td> | 172 | ></td> |
173 | <td class="tabla-articulo-boton text-center align-middle"> | 173 | <td class="tabla-articulo-boton text-center align-middle"> |
174 | <button | 174 | <button |
175 | class="btn btn-outline-secondary" | 175 | class="btn btn-outline-secondary" |
176 | ng-click="agregarATabla(13)" | 176 | ng-click="agregarATabla(13)" |
177 | > | 177 | > |
178 | <i class="fa fa-save"></i> | 178 | <i class="fa fa-save"></i> |
179 | </button> | 179 | </button> |
180 | </td> | 180 | </td> |
181 | </tr> | 181 | </tr> |
182 | <tr ng-show="cargando"> | 182 | <tr ng-show="cargando"> |
183 | <td colspan="7"> | 183 | <td colspan="7"> |
184 | <input | 184 | <input |
185 | placeholder="Seleccione Articulo" | 185 | placeholder="Seleccione Articulo" |
186 | class="form-control form-control-sm" | 186 | class="form-control form-control-sm" |
187 | readonly | 187 | readonly |
188 | ng-click="seleccionarArticulo()" | 188 | ng-click="seleccionarArticulo()" |
189 | /> | 189 | /> |
190 | </td> | 190 | </td> |
191 | </tr> | 191 | </tr> |
192 | <tr class=""> | 192 | <tr class=""> |
193 | <td colspan="4"> | 193 | <td colspan="4"> |
194 | <strong>Cantidad Items:</strong> | 194 | <strong>Cantidad Items:</strong> |
195 | <a ng-bind="articulosTabla.length"></a> | 195 | <a ng-bind="articulosTabla.length"></a> |
196 | </td> | 196 | </td> |
197 | <td class="text-right table-celda-total"><h3>Total:</h3></td> | 197 | <td class="text-right table-celda-total"><h3>Total:</h3></td> |
198 | <td class="table-celda-total text-right" colspan="1"> | 198 | <td class="table-celda-total text-right" colspan="1"> |
199 | <h3>{{getTotal() | currency: '$'}}</h3> | 199 | <h3>{{getTotal() | currency: '$'}}</h3> |
200 | </td> | 200 | </td> |
201 | <td class="text-right"> | 201 | <td class="text-right"> |
202 | <button | 202 | <button |
203 | type="button" | 203 | type="button" |
204 | class="btn btn-default btn-sm" | 204 | class="btn btn-default btn-sm" |
205 | > | 205 | > |
206 | Totales | 206 | Totales |
207 | </button> | 207 | </button> |
208 | </td> | 208 | </td> |
209 | </tr> | 209 | </tr> |
210 | </tfoot> | 210 | </tfoot> |
211 | </table> | 211 | </table> |
212 | </div> | 212 | </div> |
213 | </div> | 213 | </div> |
214 | <div class="col-auto my-2 col-lg-2 botonera-lateral"> | 214 | <div class="col-auto my-2 col-lg-2 botonera-lateral"> |
215 | <div class="row align-items-end"> | 215 | <div class="row align-items-end"> |
216 | <div class="col-12"> | 216 | <div class="col-12"> |
217 | <button | 217 | <button |
218 | ng-click="crearNotaPedido()" | 218 | ng-click="crearNotaPedido()" |
219 | type="submit" | 219 | type="submit" |
220 | title="Crear nota pedido" | 220 | title="Crear nota pedido" |
221 | class="btn btn-default btn-block mb-2"> | 221 | class="btn btn-default btn-block mb-2"> |
222 | Guardar | 222 | Guardar |
223 | </button> | 223 | </button> |
224 | <button | 224 | <button |
225 | ng-click="salir()" | 225 | ng-click="salir()" |
226 | type="button" | 226 | type="button" |
227 | title="Salir" | 227 | title="Salir" |
228 | class="btn btn-default btn-block"> | 228 | class="btn btn-default btn-block"> |
229 | Salir | 229 | Salir |
230 | </button> | 230 | </button> |
231 | </div> | 231 | </div> |
232 | </div> | 232 | </div> |
233 | </div> | 233 | </div> |
234 | </div> | 234 | </div> |
235 | </div> | 235 | </div> |
236 | 236 |