Commit 165431d34b9f0d4cd6ee337bd8c23b1bd7ef1249
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-crear-nota-pedido!7
Showing
6 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"', ''), | 47 | '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion"', ''), |
| 48 | gulp.dest(paths.dist) | 48 | gulp.dest(paths.dist) |
| 49 | ] | 49 | ] |
| 50 | ); | 50 | ); |
| 51 | }); | 51 | }); |
| 52 | 52 | ||
| 53 | gulp.task('clean', function(){ | 53 | gulp.task('clean', function(){ |
| 54 | return gulp.src(['tmp', 'dist'], {read: false}) | 54 | return gulp.src(['tmp', 'dist'], {read: false}) |
| 55 | .pipe(clean()); | 55 | .pipe(clean()); |
| 56 | }); | 56 | }); |
| 57 | 57 | ||
| 58 | gulp.task('pre-commit', function() { | 58 | gulp.task('pre-commit', function() { |
| 59 | return pump( | 59 | return pump( |
| 60 | [ | 60 | [ |
| 61 | gulp.src(paths.srcJS), | 61 | gulp.src(paths.srcJS), |
| 62 | jshint('.jshintrc'), | 62 | jshint('.jshintrc'), |
| 63 | jshint.reporter('default'), | 63 | jshint.reporter('default'), |
| 64 | jshint.reporter('fail') | 64 | jshint.reporter('fail') |
| 65 | ] | 65 | ] |
| 66 | ); | 66 | ); |
| 67 | 67 | ||
| 68 | gulp.start('uglify'); | 68 | gulp.start('uglify'); |
| 69 | }); | 69 | }); |
| 70 | 70 | ||
| 71 | gulp.task('webserver', function() { | 71 | gulp.task('webserver', function() { |
| 72 | pump [ | 72 | pump [ |
| 73 | connect.server({port: 3000}) | 73 | connect.server({port: 3000}) |
| 74 | ] | 74 | ] |
| 75 | }); | 75 | }); |
| 76 | 76 | ||
| 77 | gulp.task('clean-post-install', function() { | 77 | gulp.task('clean-post-install', function() { |
| 78 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 78 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
| 79 | 'index.html'], {read: false}) | 79 | 'index.html'], {read: false}) |
| 80 | .pipe(clean()); | 80 | .pipe(clean()); |
| 81 | }); | 81 | }); |
| 82 | 82 | ||
| 83 | gulp.task('default', ['webserver']); | 83 | gulp.task('default', ['webserver']); |
| 84 | 84 |
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-petroleras/dist/foca-modal-petroleras.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 | 23 | ||
| 23 | <script src="src/js/app.js"></script> | 24 | <script src="src/js/app.js"></script> |
| 24 | <script src="src/js/controller.js"></script> | 25 | <script src="src/js/controller.js"></script> |
| 25 | <script src="src/js/service.js"></script> | 26 | <script src="src/js/service.js"></script> |
| 26 | <script src="src/js/route.js"></script> | 27 | <script src="src/js/route.js"></script> |
| 27 | 28 | ||
| 28 | <script src="src/etc/develop.js"></script> | 29 | <script src="src/etc/develop.js"></script> |
| 29 | </head> | 30 | </head> |
| 30 | <body> | 31 | <body> |
| 31 | <div ng-view class="container-fluid"></div> | 32 | <div ng-view class="container-fluid"></div> |
| 32 | </body> | 33 | </body> |
| 33 | </html> | 34 | </html> |
| 34 | 35 |
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/nguarnieri/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git" | 11 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/nguarnieri/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" |
| 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/nguarnieri/foca-modal-busqueda-productos", | 25 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", |
| 26 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", | 26 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.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-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", | 35 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", |
| 36 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", | 36 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", |
| 37 | "foca-modal-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", | ||
| 37 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", | 38 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
| 38 | "font-awesome": "^4.7.0", | 39 | "font-awesome": "^4.7.0", |
| 39 | "gulp": "^3.9.1", | 40 | "gulp": "^3.9.1", |
| 40 | "gulp-angular-templatecache": "^2.2.2", | 41 | "gulp-angular-templatecache": "^2.2.2", |
| 41 | "gulp-clean": "^0.4.0", | 42 | "gulp-clean": "^0.4.0", |
| 42 | "gulp-concat": "^2.6.1", | 43 | "gulp-concat": "^2.6.1", |
| 43 | "gulp-connect": "^5.6.1", | 44 | "gulp-connect": "^5.6.1", |
| 44 | "gulp-htmlmin": "^5.0.1", | 45 | "gulp-htmlmin": "^5.0.1", |
| 45 | "gulp-jshint": "^2.1.0", | 46 | "gulp-jshint": "^2.1.0", |
| 46 | "gulp-rename": "^1.4.0", | 47 | "gulp-rename": "^1.4.0", |
| 47 | "gulp-replace": "^1.0.0", | 48 | "gulp-replace": "^1.0.0", |
| 48 | "gulp-sequence": "^1.0.0", | 49 | "gulp-sequence": "^1.0.0", |
| 49 | "gulp-uglify": "^3.0.1", | 50 | "gulp-uglify": "^3.0.1", |
| 50 | "gulp-uglify-es": "^1.0.4", | 51 | "gulp-uglify-es": "^1.0.4", |
| 51 | "jasmine-core": "^3.2.1", | 52 | "jasmine-core": "^3.2.1", |
| 52 | "jquery": "^3.3.1", | 53 | "jquery": "^3.3.1", |
| 53 | "jshint": "^2.9.6", | 54 | "jshint": "^2.9.6", |
| 54 | "pre-commit": "^1.2.2", | 55 | "pre-commit": "^1.2.2", |
| 55 | "pump": "^3.0.0", | 56 | "pump": "^3.0.0", |
| 56 | "ui-bootstrap4": "^3.0.5" | 57 | "ui-bootstrap4": "^3.0.5" |
| 57 | } | 58 | } |
| 58 | } | 59 | } |
| 59 | 60 |
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 | 'focaModalPetroleras', |
| 7 | 'focaBusquedaCliente' | 7 | 'focaBusquedaCliente', |
| 8 | 'focaModalPrecioCondicion' | ||
| 8 | ]); | 9 | ]); |
| 9 | 10 |
src/js/controller.js
| 1 | angular.module('focaCrearNotaPedido') | 1 | angular.module('focaCrearNotaPedido') |
| 2 | .controller('notaPedidoCtrl', | 2 | .controller('notaPedidoCtrl', |
| 3 | ['$scope', '$uibModal', '$location', 'crearNotaPedidoService', | 3 | ['$scope', '$uibModal', '$location', 'crearNotaPedidoService', |
| 4 | function($scope, $uibModal, $location, crearNotaPedidoService) { | 4 | function($scope, $uibModal, $location, crearNotaPedidoService) { |
| 5 | $scope.show = false; | 5 | $scope.show = false; |
| 6 | 6 | ||
| 7 | $scope.dateOptions = { | 7 | $scope.dateOptions = { |
| 8 | maxDate: new Date(), | 8 | maxDate: new Date(), |
| 9 | minDate: new Date(2010,0,1) | 9 | minDate: new Date(2010,0,1) |
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | $scope.notaPedido = {}; | 12 | $scope.notaPedido = {}; |
| 13 | $scope.articulosTabla = []; | 13 | $scope.articulosTabla = []; |
| 14 | var idLista; | 14 | var idLista; |
| 15 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | 15 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); |
| 16 | $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1); | 16 | $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1); |
| 17 | crearNotaPedidoService.getPrecioCondicion().then( | 17 | crearNotaPedidoService.getPrecioCondicion().then( |
| 18 | function(res) { | 18 | function(res) { |
| 19 | $scope.precioCondiciones = res.data; | 19 | $scope.precioCondiciones = res.data; |
| 20 | } | 20 | } |
| 21 | ); | 21 | ); |
| 22 | if (notaPedidoTemp !== undefined) { | 22 | if (notaPedidoTemp !== undefined) { |
| 23 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); | 23 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); |
| 24 | $scope.notaPedido = notaPedidoTemp; | 24 | $scope.notaPedido = notaPedidoTemp; |
| 25 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); | 25 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); |
| 26 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); | 26 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); |
| 27 | idLista = $scope.notaPedido.precioCondicion; | 27 | idLista = $scope.notaPedido.precioCondicion; |
| 28 | crearNotaPedidoService | 28 | crearNotaPedidoService |
| 29 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( | 29 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( |
| 30 | function(res) { | 30 | function(res) { |
| 31 | $scope.articulosTabla = res.data; | 31 | $scope.articulosTabla = res.data; |
| 32 | } | 32 | } |
| 33 | ); | 33 | ); |
| 34 | crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( | 34 | crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( |
| 35 | function(res) { | 35 | function(res) { |
| 36 | $scope.notaPedido.domicilio = res.data; | 36 | $scope.notaPedido.domicilio = res.data; |
| 37 | } | 37 | } |
| 38 | ); | 38 | ); |
| 39 | } else { | 39 | } else { |
| 40 | $scope.notaPedido.fechaCarga = new Date(); | 40 | $scope.notaPedido.fechaCarga = new Date(); |
| 41 | $scope.notaPedido.domicilio = [{ id: 0 }]; | 41 | $scope.notaPedido.domicilio = [{ id: 0 }]; |
| 42 | $scope.notaPedido.bomba = '1'; | 42 | $scope.notaPedido.bomba = '1'; |
| 43 | $scope.notaPedido.flete = '1'; | 43 | $scope.notaPedido.flete = '1'; |
| 44 | idLista = undefined; | 44 | idLista = undefined; |
| 45 | } | 45 | } |
| 46 | $scope.addNewDom = function() { | 46 | $scope.addNewDom = function() { |
| 47 | $scope.notaPedido.domicilio.push({ 'id': 0 }); | 47 | $scope.notaPedido.domicilio.push({ 'id': 0 }); |
| 48 | }; | 48 | }; |
| 49 | $scope.removeNewChoice = function(choice) { | 49 | $scope.removeNewChoice = function(choice) { |
| 50 | if ($scope.notaPedido.domicilio.length > 1) { | 50 | if ($scope.notaPedido.domicilio.length > 1) { |
| 51 | $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( | 51 | $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( |
| 52 | function(c) { | 52 | function(c) { |
| 53 | return c.$$hashKey === choice.$$hashKey; | 53 | return c.$$hashKey === choice.$$hashKey; |
| 54 | } | 54 | } |
| 55 | ), 1); | 55 | ), 1); |
| 56 | } | 56 | } |
| 57 | }; | 57 | }; |
| 58 | $scope.crearNotaPedido = function() { | 58 | $scope.crearNotaPedido = function() { |
| 59 | var notaPedido = { | 59 | var notaPedido = { |
| 60 | id: 0, | 60 | id: 0, |
| 61 | precioCondicion: $scope.notaPedido.precioCondicion, | 61 | precioCondicion: $scope.notaPedido.precioCondicion, |
| 62 | fechaCarga: $scope.notaPedido.fechaCarga, | 62 | fechaCarga: $scope.notaPedido.fechaCarga, |
| 63 | vendedor: $scope.notaPedido.vendedor, | 63 | vendedor: $scope.notaPedido.vendedor, |
| 64 | cliente: $scope.notaPedido.cliente, | 64 | cliente: $scope.notaPedido.cliente, |
| 65 | producto: $scope.notaPedido.producto, | 65 | producto: $scope.notaPedido.producto, |
| 66 | bomba: $scope.notaPedido.bomba, | 66 | bomba: $scope.notaPedido.bomba, |
| 67 | petrolera: $scope.notaPedido.petrolera, | 67 | petrolera: $scope.notaPedido.petrolera, |
| 68 | domicilio: $scope.notaPedido.domicilio, | 68 | domicilio: $scope.notaPedido.domicilio, |
| 69 | kilometros: $scope.notaPedido.kilometros, | 69 | kilometros: $scope.notaPedido.kilometros, |
| 70 | jurisdiccionIIBB: $scope.notaPedido.jurisdiccionIIBB, | 70 | jurisdiccionIIBB: $scope.notaPedido.jurisdiccionIIBB, |
| 71 | costoFinanciacion: $scope.notaPedido.costoFinanciacion, | 71 | costoFinanciacion: $scope.notaPedido.costoFinanciacion, |
| 72 | flete: $scope.notaPedido.flete, | 72 | flete: $scope.notaPedido.flete, |
| 73 | costoUnitarioKmFlete: $scope.notaPedido.costoUnitarioKmFlete, | 73 | costoUnitarioKmFlete: $scope.notaPedido.costoUnitarioKmFlete, |
| 74 | total: $scope.articulosTabla[0].subTotal | 74 | total: $scope.articulosTabla[0].subTotal |
| 75 | }; | 75 | }; |
| 76 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( | 76 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( |
| 77 | function() { | 77 | function() { |
| 78 | alert('Nota pedido creada'); | 78 | alert('Nota pedido creada'); |
| 79 | $location.path('/venta-nota-pedido'); | 79 | $location.path('/venta-nota-pedido'); |
| 80 | } | 80 | } |
| 81 | ); | 81 | ); |
| 82 | var articulosNotaPedido = $scope.articulosTabla; | 82 | var articulosNotaPedido = $scope.articulosTabla; |
| 83 | for(var i = 0; i< articulosNotaPedido.length;i++) { | 83 | for(var i = 0; i< articulosNotaPedido.length;i++) { |
| 84 | crearNotaPedidoService | 84 | crearNotaPedidoService |
| 85 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( | 85 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( |
| 86 | function() { | 86 | function() { |
| 87 | return; | 87 | return; |
| 88 | } | 88 | } |
| 89 | ); | 89 | ); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | }; | 92 | }; |
| 93 | $scope.siguienteTab = function() { | 93 | $scope.siguienteTab = function() { |
| 94 | $scope.active = 1; | 94 | $scope.active = 1; |
| 95 | }; | 95 | }; |
| 96 | $scope.seleccionarArticulo = function() { | 96 | $scope.seleccionarArticulo = function() { |
| 97 | if (idLista === undefined) { | 97 | if (idLista === undefined) { |
| 98 | alert('primero seleccione una lista de precio y condicion'); | 98 | alert('primero seleccione una lista de precio y condicion'); |
| 99 | return; | 99 | return; |
| 100 | } | 100 | } |
| 101 | var modalInstance = $uibModal.open( | 101 | var modalInstance = $uibModal.open( |
| 102 | { | 102 | { |
| 103 | ariaLabelledBy: 'Busqueda de Productos', | 103 | ariaLabelledBy: 'Busqueda de Productos', |
| 104 | templateUrl: 'modal-busqueda-productos.html', | 104 | templateUrl: 'modal-busqueda-productos.html', |
| 105 | controller: 'modalBusquedaProductosCtrl', | 105 | controller: 'modalBusquedaProductosCtrl', |
| 106 | resolve: { idLista: function() { return idLista; } }, | 106 | resolve: { idLista: function() { return idLista; } }, |
| 107 | size: 'lg' | 107 | size: 'lg' |
| 108 | } | 108 | } |
| 109 | ); | 109 | ); |
| 110 | modalInstance.result.then( | 110 | modalInstance.result.then( |
| 111 | function(producto) { | 111 | function(producto) { |
| 112 | var newArt = | 112 | var newArt = |
| 113 | { | 113 | { |
| 114 | id: 0, | 114 | id: 0, |
| 115 | codigo: producto.FiltroSectorCodigo, | 115 | codigo: producto.FiltroSectorCodigo, |
| 116 | item: $scope.articulosTabla.length + 1, | 116 | item: $scope.articulosTabla.length + 1, |
| 117 | nombre: producto.descripcion, | 117 | nombre: producto.descripcion, |
| 118 | precio: producto.precio, | 118 | precio: producto.precio, |
| 119 | costoUnitario: producto.costo, | 119 | costoUnitario: producto.costo, |
| 120 | cantidad: 1 | 120 | cantidad: 1 |
| 121 | }; | 121 | }; |
| 122 | $scope.articulosTabla.unshift(newArt); | 122 | $scope.articulosTabla.unshift(newArt); |
| 123 | }, function() { | 123 | }, function() { |
| 124 | // funcion ejecutada cuando se cancela el modal | 124 | // funcion ejecutada cuando se cancela el modal |
| 125 | } | 125 | } |
| 126 | ); | 126 | ); |
| 127 | }; | 127 | }; |
| 128 | $scope.seleccionarVendedor = function() { | 128 | $scope.seleccionarVendedor = function() { |
| 129 | var modalInstance = $uibModal.open( | 129 | var modalInstance = $uibModal.open( |
| 130 | { | 130 | { |
| 131 | ariaLabelledBy: 'Busqueda de Vendedores', | 131 | ariaLabelledBy: 'Busqueda de Vendedores', |
| 132 | templateUrl: 'modal-vendedores.html', | 132 | templateUrl: 'modal-vendedores.html', |
| 133 | controller: 'modalVendedoresCtrl', | 133 | controller: 'modalVendedoresCtrl', |
| 134 | size: 'lg' | 134 | size: 'lg' |
| 135 | } | 135 | } |
| 136 | ); | 136 | ); |
| 137 | modalInstance.result.then( | 137 | modalInstance.result.then( |
| 138 | function(vendedor) { | 138 | function(vendedor) { |
| 139 | $scope.notaPedido.vendedor = vendedor.NomVen; | 139 | $scope.notaPedido.vendedor = vendedor.NomVen; |
| 140 | }, function() { | 140 | }, function() { |
| 141 | 141 | ||
| 142 | } | 142 | } |
| 143 | ); | 143 | ); |
| 144 | }; | 144 | }; |
| 145 | $scope.seleccionarPetrolera = function() { | 145 | $scope.seleccionarPetrolera = function() { |
| 146 | var modalInstance = $uibModal.open( | 146 | var modalInstance = $uibModal.open( |
| 147 | { | 147 | { |
| 148 | ariaLabelledBy: 'Busqueda de Petrolera', | 148 | ariaLabelledBy: 'Busqueda de Petrolera', |
| 149 | templateUrl: 'modal-petroleras.html', | 149 | templateUrl: 'modal-petroleras.html', |
| 150 | controller: 'modalPetrolerasCtrl', | 150 | controller: 'modalPetrolerasCtrl', |
| 151 | size: 'lg' | 151 | size: 'lg' |
| 152 | } | 152 | } |
| 153 | ); | 153 | ); |
| 154 | modalInstance.result.then( | 154 | modalInstance.result.then( |
| 155 | function(petrolera) { | 155 | function(petrolera) { |
| 156 | $scope.notaPedido.petrolera = petrolera.NOM; | 156 | $scope.notaPedido.petrolera = petrolera.NOM; |
| 157 | }, function() { | 157 | }, function() { |
| 158 | 158 | ||
| 159 | } | 159 | } |
| 160 | ); | 160 | ); |
| 161 | }; | 161 | }; |
| 162 | $scope.seleccionarCliente = function() { | 162 | $scope.seleccionarCliente = function() { |
| 163 | var modalInstance = $uibModal.open( | 163 | var modalInstance = $uibModal.open( |
| 164 | { | 164 | { |
| 165 | ariaLabelledBy: 'Busqueda de Cliente', | 165 | ariaLabelledBy: 'Busqueda de Cliente', |
| 166 | templateUrl: 'foca-busqueda-cliente-modal.html', | 166 | templateUrl: 'foca-busqueda-cliente-modal.html', |
| 167 | controller: 'focaBusquedaClienteModalController', | 167 | controller: 'focaBusquedaClienteModalController', |
| 168 | size: 'lg' | 168 | size: 'lg' |
| 169 | } | 169 | } |
| 170 | ); | 170 | ); |
| 171 | modalInstance.result.then( | 171 | modalInstance.result.then( |
| 172 | function(cliente) { | 172 | function(cliente) { |
| 173 | $scope.notaPedido.cliente = cliente.nom; | 173 | $scope.notaPedido.cliente = cliente.nom; |
| 174 | }, function() { | 174 | }, function() { |
| 175 | 175 | ||
| 176 | } | 176 | } |
| 177 | ); | 177 | ); |
| 178 | }; | 178 | }; |
| 179 | $scope.obtenerDomicilios = function(id) { | 179 | $scope.obtenerDomicilios = function(id) { |
| 180 | crearNotaPedidoService.getDomicilios(id).then( | 180 | crearNotaPedidoService.getDomicilios(id).then( |
| 181 | function(res) { | 181 | function(res) { |
| 182 | $scope.notaPedido.domicilio = res.data; | 182 | $scope.notaPedido.domicilio = res.data; |
| 183 | } | 183 | } |
| 184 | ); | 184 | ); |
| 185 | }; | 185 | }; |
| 186 | $scope.getSubTotal = function(item) { | 186 | $scope.getSubTotal = function(item) { |
| 187 | var subTotal = 0; | 187 | var subTotal = 0; |
| 188 | var array = $scope.articulosTabla.filter( | 188 | var array = $scope.articulosTabla.filter( |
| 189 | function(a) { | 189 | function(a) { |
| 190 | return a.item <= item; | 190 | return a.item <= item; |
| 191 | } | 191 | } |
| 192 | ); | 192 | ); |
| 193 | for (var i = 0; i < array.length; i++) { | 193 | for (var i = 0; i < array.length; i++) { |
| 194 | subTotal += array[i].precio * array[i].cantidad; | 194 | subTotal += array[i].precio * array[i].cantidad; |
| 195 | } | 195 | } |
| 196 | return subTotal.toFixed(2); | 196 | return subTotal.toFixed(2); |
| 197 | }; | 197 | }; |
| 198 | $scope.cargarArticulos = function() { | 198 | $scope.cargarArticulos = function() { |
| 199 | idLista = $scope.notaPedido.precioCondicion; | 199 | idLista = $scope.notaPedido.precioCondicion; |
| 200 | $scope.articulosTabla = []; | 200 | $scope.articulosTabla = []; |
| 201 | }; | 201 | }; |
| 202 | $scope.abrirModalListaPrecio = function() { | ||
| 203 | var modalInstance = $uibModal.open( | ||
| 204 | { | ||
| 205 | ariaLabelledBy: 'Busqueda de Precio Condición', | ||
| 206 | templateUrl: 'modal-precio-condicion.html', | ||
| 207 | controller: 'focaModalPrecioCondicionController', | ||
| 208 | size: 'lg' | ||
| 209 | } | ||
| 210 | ); | ||
| 211 | modalInstance.result.then( | ||
| 212 | function(precioCondicion) { | ||
| 213 | $scope.notaPedido.precioCondicion = precioCondicion.nombre; | ||
| 214 | }, function() { | ||
| 215 | |||
| 216 | } | ||
| 217 | ); | ||
| 218 | }; | ||
| 202 | } | 219 | } |
| 203 | ] | 220 | ] |
| 204 | ) | 221 | ) |
| 205 | .controller('notaPedidoListaCtrl', [ | 222 | .controller('notaPedidoListaCtrl', [ |
| 206 | '$scope', | 223 | '$scope', |
| 207 | 'crearNotaPedidoService', | 224 | 'crearNotaPedidoService', |
| 208 | '$location', | 225 | '$location', |
| 209 | function($scope, crearNotaPedidoService, $location) { | 226 | function($scope, crearNotaPedidoService, $location) { |
| 210 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 227 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
| 211 | $scope.notaPedidos = datos.data; | 228 | $scope.notaPedidos = datos.data; |
| 212 | }); | 229 | }); |
| 213 | $scope.editar = function(notaPedido) { | 230 | $scope.editar = function(notaPedido) { |
| 214 | crearNotaPedidoService.setNotaPedido(notaPedido); | 231 | crearNotaPedidoService.setNotaPedido(notaPedido); |
| 215 | $location.path('/venta-nota-pedido/abm/'); | 232 | $location.path('/venta-nota-pedido/abm/'); |
| 216 | }; | 233 | }; |
| 217 | $scope.crearPedido = function() { | 234 | $scope.crearPedido = function() { |
| 218 | crearNotaPedidoService.clearNotaPedido(); | 235 | crearNotaPedidoService.clearNotaPedido(); |
| 219 | $location.path('/venta-nota-pedido/abm/'); | 236 | $location.path('/venta-nota-pedido/abm/'); |
| 220 | }; | 237 | }; |
| 221 | } | 238 | } |
| 222 | ]); | 239 | ]); |
| 223 | 240 |
src/views/nota-pedido.html
| 1 | <div class="row"> | 1 | <div class="row"> |
| 2 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 2 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
| 3 | <div class="row bg-secondary p-3"> | 3 | <div class="row bg-secondary p-3"> |
| 4 | <div class="form-group col-12 col-sm-6 col-md-4"> | 4 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 5 | <div class="input-group"> | 5 | <div class="input-group"> |
| 6 | <input | 6 | <input |
| 7 | type="text" | 7 | type="text" |
| 8 | class="form-control" | 8 | class="form-control" |
| 9 | uib-datepicker-popup="dd/MM/yyyy" | 9 | uib-datepicker-popup="dd/MM/yyyy" |
| 10 | ng-model="notaPedido.fechaCarga" | 10 | ng-model="notaPedido.fechaCarga" |
| 11 | is-open="popup1.opened" | 11 | is-open="popup1.opened" |
| 12 | datepicker-options="dateOptions" | 12 | datepicker-options="dateOptions" |
| 13 | close-text="Cerrar" | 13 | close-text="Cerrar" |
| 14 | current-text="Hoy" | 14 | current-text="Hoy" |
| 15 | clear-text="Borrar" | 15 | clear-text="Borrar" |
| 16 | alt-input-formats="altInputFormats" | 16 | alt-input-formats="altInputFormats" |
| 17 | /> | 17 | /> |
| 18 | <span class="input-group-append"> | 18 | <span class="input-group-append"> |
| 19 | <button type="button" class="btn btn-default" ng-click="popup1.opened = true"> | 19 | <button type="button" class="btn btn-default" ng-click="popup1.opened = true"> |
| 20 | <i class="fa fa-calendar"></i> | 20 | <i class="fa fa-calendar"></i> |
| 21 | </button> | 21 | </button> |
| 22 | </span> | 22 | </span> |
| 23 | </div> | 23 | </div> |
| 24 | </div> | 24 | </div> |
| 25 | <div class="form-group col-12 col-sm-6 col-md-4"> | 25 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 26 | <input | 26 | <input |
| 27 | class="form-control selectable" | 27 | class="form-control selectable" |
| 28 | type="text" | 28 | type="text" |
| 29 | readonly="true" | 29 | readonly="true" |
| 30 | ng-bind="cliente.nombre" | 30 | ng-bind="cliente.nombre" |
| 31 | ng-click="seleccionarVendedor()" | 31 | ng-click="seleccionarVendedor()" |
| 32 | placeholder="Seleccione Vendedor" | 32 | placeholder="Seleccione Vendedor" |
| 33 | > | 33 | > |
| 34 | </div> | 34 | </div> |
| 35 | <div class="form-group col-12 col-sm-6 col-md-4"> | 35 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 36 | <input | 36 | <input |
| 37 | class="form-control selectable" | 37 | class="form-control selectable" |
| 38 | type="text" | 38 | type="text" |
| 39 | readonly="true" | 39 | readonly="true" |
| 40 | ng-bind="vendedor.nombre" | 40 | ng-bind="vendedor.nombre" |
| 41 | ng-click="seleccionarCliente()" | 41 | ng-click="seleccionarCliente()" |
| 42 | placeholder="Seleccione Cliente" | 42 | placeholder="Seleccione Cliente" |
| 43 | > | 43 | > |
| 44 | </div> | 44 | </div> |
| 45 | <div class="form-group col-12 col-sm-6 col-md-4"> | 45 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 46 | <input | 46 | <input |
| 47 | class="form-control selectable" | 47 | class="form-control selectable" |
| 48 | type="text" | 48 | type="text" |
| 49 | readonly="true" | 49 | readonly="true" |
| 50 | ng-bind="vendedor.nombre" | 50 | ng-bind="vendedor.nombre" |
| 51 | ng-click="abrirModalDomicilio()" | 51 | ng-click="abrirModalDomicilio()" |
| 52 | placeholder="Seleccione Domicilio" | 52 | placeholder="Seleccione Domicilio" |
| 53 | > | 53 | > |
| 54 | </div> | 54 | </div> |
| 55 | <div class="form-group col-12 col-sm-6 col-md-4"> | 55 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 56 | <input | 56 | <input |
| 57 | class="form-control selectable" | 57 | class="form-control selectable" |
| 58 | type="text" | 58 | type="text" |
| 59 | readonly="true" | 59 | readonly="true" |
| 60 | ng-bind="vendedor.nombre" | 60 | ng-bind="notaPedido.precioCondicion" |
| 61 | ng-click="abrirModalListaPrecio()" | 61 | ng-click="abrirModalListaPrecio()" |
| 62 | placeholder="Seleccione Lista de precio" | 62 | placeholder="Seleccione Lista de precio" |
| 63 | > | 63 | > |
| 64 | </div> | 64 | </div> |
| 65 | </div> | 65 | </div> |
| 66 | </div> | 66 | </div> |
| 67 | </div> | 67 | </div> |
| 68 | <div class="row"> | 68 | <div class="row"> |
| 69 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 69 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
| 70 | <div class="row"> | 70 | <div class="row"> |
| 71 | 71 | ||
| 72 | </div> | 72 | </div> |
| 73 | <div class="row"> | 73 | <div class="row"> |
| 74 | <table class="table table-striped table-sm"> | 74 | <table class="table table-striped table-sm"> |
| 75 | <thead> | 75 | <thead> |
| 76 | <tr> | 76 | <tr> |
| 77 | <th>Sector</th> | 77 | <th>Sector</th> |
| 78 | <th>Código</th> | 78 | <th>Código</th> |
| 79 | <th>Descripción</th> | 79 | <th>Descripción</th> |
| 80 | <th>Cantidad</th> | 80 | <th>Cantidad</th> |
| 81 | <th>Precio Unitario</th> | 81 | <th>Precio Unitario</th> |
| 82 | <th>SubTotal</th> | 82 | <th>SubTotal</th> |
| 83 | <th></th> | 83 | <th></th> |
| 84 | <th></th> | 84 | <th></th> |
| 85 | </tr> | 85 | </tr> |
| 86 | </thead> | 86 | </thead> |
| 87 | <tbody> | 87 | <tbody> |
| 88 | <tr> | 88 | <tr> |
| 89 | <td colspan="2"><input class="form-control" readonly></td> | 89 | <td colspan="2"><input class="form-control" readonly></td> |
| 90 | <td></td> | 90 | <td></td> |
| 91 | <td></td> | 91 | <td></td> |
| 92 | <td></td> | 92 | <td></td> |
| 93 | <td></td> | 93 | <td></td> |
| 94 | <td></td> | 94 | <td></td> |
| 95 | <td></td> | 95 | <td></td> |
| 96 | </tr> | 96 | </tr> |
| 97 | <tr style="cursor: pointer;" ng-click="show = !show"> | 97 | <tr style="cursor: pointer;" ng-click="show = !show"> |
| 98 | <td>1</td> | 98 | <td>1</td> |
| 99 | <td>1</td> | 99 | <td>1</td> |
| 100 | <td>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...</td> | 100 | <td>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...</td> |
| 101 | <td>{{10000 | number: 2}}</td> | 101 | <td>{{10000 | number: 2}}</td> |
| 102 | <td>{{1000000000 | currency:'$'}}</td> | 102 | <td>{{1000000000 | currency:'$'}}</td> |
| 103 | <td>{{1000000000 | currency:'$'}}</td> | 103 | <td>{{1000000000 | currency:'$'}}</td> |
| 104 | <td></td> | 104 | <td></td> |
| 105 | <td> | 105 | <td> |
| 106 | <button class="btn btn-outline-secondary" style="float: right;"> | 106 | <button class="btn btn-outline-secondary" style="float: right;"> |
| 107 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> | 107 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> |
| 108 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> | 108 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> |
| 109 | </button> | 109 | </button> |
| 110 | </td> | 110 | </td> |
| 111 | </tr> | 111 | </tr> |
| 112 | <tr ng-show="show"> | 112 | <tr ng-show="show"> |
| 113 | <td>1</td> | 113 | <td>1</td> |
| 114 | <td>2</td> | 114 | <td>2</td> |
| 115 | <td>Lorem Ipsum</td> | 115 | <td>Lorem Ipsum</td> |
| 116 | <td>1</td> | 116 | <td>1</td> |
| 117 | <td>{{1000000000 | currency:'U$D'}}</td> | 117 | <td>{{1000000000 | currency:'U$D'}}</td> |
| 118 | <td>{{10 | currency:'$'}}</td> | 118 | <td>{{10 | currency:'$'}}</td> |
| 119 | <td></td> | 119 | <td></td> |
| 120 | <td></td> | 120 | <td></td> |
| 121 | </tr> | 121 | </tr> |
| 122 | <tr ng-show="show"> | 122 | <tr ng-show="show"> |
| 123 | <td>1</td> | 123 | <td>1</td> |
| 124 | <td>2</td> | 124 | <td>2</td> |
| 125 | <td>Lorem Ipsum</td> | 125 | <td>Lorem Ipsum</td> |
| 126 | <td>1</td> | 126 | <td>1</td> |
| 127 | <td>{{10 | currency:'$'}}</td> | 127 | <td>{{10 | currency:'$'}}</td> |
| 128 | <td>{{10 | currency:'$'}}</td> | 128 | <td>{{10 | currency:'$'}}</td> |
| 129 | <td></td> | 129 | <td></td> |
| 130 | <td></td> | 130 | <td></td> |
| 131 | </tr> | 131 | </tr> |
| 132 | </tbody> | 132 | </tbody> |
| 133 | <tfoot> | 133 | <tfoot> |
| 134 | <tr class="table-secondary"> | 134 | <tr class="table-secondary"> |
| 135 | <td colspan="5"><b>Cantidad Items:</b> 3</td> | 135 | <td colspan="5"><b>Cantidad Items:</b> 3</td> |
| 136 | <td colspan="3">{{30 | currency:'$'}}</td> | 136 | <td colspan="3">{{30 | currency:'$'}}</td> |
| 137 | </tr> | 137 | </tr> |
| 138 | </tfoot> | 138 | </tfoot> |
| 139 | </table> | 139 | </table> |
| 140 | </div> | 140 | </div> |
| 141 | </div> | 141 | </div> |
| 142 | </div> | 142 | </div> |
| 143 | 143 | ||
| 144 | <!-- | 144 | <!-- |
| 145 | <form name="formCrearNota"> | 145 | <form name="formCrearNota"> |
| 146 | <uib-tabset active="active"> | 146 | <uib-tabset active="active"> |
| 147 | <uib-tab index="0" heading="General"> | 147 | <uib-tab index="0" heading="General"> |
| 148 | <input type="hidden" name="id" ng-model="notaPedido.id" /> | 148 | <input type="hidden" name="id" ng-model="notaPedido.id" /> |
| 149 | <div> | 149 | <div> |
| 150 | <div class="col-auto my-2"> | 150 | <div class="col-auto my-2"> |
| 151 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> | 151 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> |
| 152 | </div> | 152 | </div> |
| 153 | </div> | 153 | </div> |
| 154 | <br> | 154 | <br> |
| 155 | <br> | 155 | <br> |
| 156 | <div class="row"> | 156 | <div class="row"> |
| 157 | <div class="col-md-2"> | 157 | <div class="col-md-2"> |
| 158 | <div class="col-auto"> | 158 | <div class="col-auto"> |
| 159 | <label>Fecha de carga</label> | 159 | <label>Fecha de carga</label> |
| 160 | </div> | 160 | </div> |
| 161 | </div> | 161 | </div> |
| 162 | <div class="col-md-3"> | 162 | <div class="col-md-3"> |
| 163 | <div class="col-auto"> | 163 | <div class="col-auto"> |
| 164 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> | 164 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> |
| 165 | </div> | 165 | </div> |
| 166 | </div> | 166 | </div> |
| 167 | <div class="col-md-2"> | 167 | <div class="col-md-2"> |
| 168 | <div class="col-auto"> | 168 | <div class="col-auto"> |
| 169 | <label>Kilómetros</label> | 169 | <label>Kilómetros</label> |
| 170 | </div> | 170 | </div> |
| 171 | </div> | 171 | </div> |
| 172 | <div class="col-md-3"> | 172 | <div class="col-md-3"> |
| 173 | <div class="col-auto"> | 173 | <div class="col-auto"> |
| 174 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" | 174 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" |
| 175 | ng-model="notaPedido.kilometros" ng-required="true"> | 175 | ng-model="notaPedido.kilometros" ng-required="true"> |
| 176 | </div> | 176 | </div> |
| 177 | </div> | 177 | </div> |
| 178 | </div> | 178 | </div> |
| 179 | <div class="row my-3"> | 179 | <div class="row my-3"> |
| 180 | <div class="col-md-2"> | 180 | <div class="col-md-2"> |
| 181 | <div class="col-auto"> | 181 | <div class="col-auto"> |
| 182 | <label>Jurisdicción de IIBB</label> | 182 | <label>Jurisdicción de IIBB</label> |
| 183 | </div> | 183 | </div> |
| 184 | </div> | 184 | </div> |
| 185 | <div class="col-md-3"> | 185 | <div class="col-md-3"> |
| 186 | <div class="col-auto"> | 186 | <div class="col-auto"> |
| 187 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" | 187 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" |
| 188 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> | 188 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> |
| 189 | </div> | 189 | </div> |
| 190 | </div> | 190 | </div> |
| 191 | <div class="col-md-2"> | 191 | <div class="col-md-2"> |
| 192 | <div class="col-auto"> | 192 | <div class="col-auto"> |
| 193 | <label>Costo de financiación</label> | 193 | <label>Costo de financiación</label> |
| 194 | </div> | 194 | </div> |
| 195 | </div> | 195 | </div> |
| 196 | <div class="col-md-3"> | 196 | <div class="col-md-3"> |
| 197 | <div class="col-auto"> | 197 | <div class="col-auto"> |
| 198 | <div class="input-group mb-2"> | 198 | <div class="input-group mb-2"> |
| 199 | <div class="input-group-prepend"> | 199 | <div class="input-group-prepend"> |
| 200 | <div class="input-group-text">$</div> | 200 | <div class="input-group-text">$</div> |
| 201 | </div> | 201 | </div> |
| 202 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" | 202 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" |
| 203 | ng-model="notaPedido.costoFinanciacion"> | 203 | ng-model="notaPedido.costoFinanciacion"> |
| 204 | </div> | 204 | </div> |
| 205 | </div> | 205 | </div> |
| 206 | </div> | 206 | </div> |
| 207 | </div> | 207 | </div> |
| 208 | <div class="row"> | 208 | <div class="row"> |
| 209 | <div class="col-md-2"> | 209 | <div class="col-md-2"> |
| 210 | <div class="col-auto"> | 210 | <div class="col-auto"> |
| 211 | <label>Bomba</label> | 211 | <label>Bomba</label> |
| 212 | </div> | 212 | </div> |
| 213 | </div> | 213 | </div> |
| 214 | <div class="col-md-1"> | 214 | <div class="col-md-1"> |
| 215 | <div class="col-auto"> | 215 | <div class="col-auto"> |
| 216 | <div class="form-check custom-radio custom-control-inline"> | 216 | <div class="form-check custom-radio custom-control-inline"> |
| 217 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> | 217 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> |
| 218 | <label class="form-check-label"> | 218 | <label class="form-check-label"> |
| 219 | Si | 219 | Si |
| 220 | </label> | 220 | </label> |
| 221 | </div> | 221 | </div> |
| 222 | <div class="form-check custom-radio custom-control-inline"> | 222 | <div class="form-check custom-radio custom-control-inline"> |
| 223 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> | 223 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> |
| 224 | <label class="form-check-label"> | 224 | <label class="form-check-label"> |
| 225 | No | 225 | No |
| 226 | </label> | 226 | </label> |
| 227 | </div> | 227 | </div> |
| 228 | </div> | 228 | </div> |
| 229 | </div> | 229 | </div> |
| 230 | <div class="col-md-1"> | 230 | <div class="col-md-1"> |
| 231 | <div class="col-auto"> | 231 | <div class="col-auto"> |
| 232 | <label>Flete</label> | 232 | <label>Flete</label> |
| 233 | </div> | 233 | </div> |
| 234 | </div> | 234 | </div> |
| 235 | <div class="col-md-1"> | 235 | <div class="col-md-1"> |
| 236 | <div class="col-auto"> | 236 | <div class="col-auto"> |
| 237 | <div class="form-check custom-radio custom-control-inline"> | 237 | <div class="form-check custom-radio custom-control-inline"> |
| 238 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> | 238 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> |
| 239 | <label class="form-check-label"> | 239 | <label class="form-check-label"> |
| 240 | Si | 240 | Si |
| 241 | </label> | 241 | </label> |
| 242 | </div> | 242 | </div> |
| 243 | <div class="form-check custom-radio custom-control-inline"> | 243 | <div class="form-check custom-radio custom-control-inline"> |
| 244 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> | 244 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> |
| 245 | <label class="form-check-label"> | 245 | <label class="form-check-label"> |
| 246 | FOB | 246 | FOB |
| 247 | </label> | 247 | </label> |
| 248 | </div> | 248 | </div> |
| 249 | </div> | 249 | </div> |
| 250 | </div> | 250 | </div> |
| 251 | <div class="col-md-2"> | 251 | <div class="col-md-2"> |
| 252 | <div class="col-auto"> | 252 | <div class="col-auto"> |
| 253 | <label>Costo unitario kilometro flete</label> | 253 | <label>Costo unitario kilometro flete</label> |
| 254 | </div> | 254 | </div> |
| 255 | </div> | 255 | </div> |
| 256 | <div class="col-md-3"> | 256 | <div class="col-md-3"> |
| 257 | <div class="col-auto"> | 257 | <div class="col-auto"> |
| 258 | <div class="input-group mb-2"> | 258 | <div class="input-group mb-2"> |
| 259 | <div class="input-group-prepend"> | 259 | <div class="input-group-prepend"> |
| 260 | <div class="input-group-text">$</div> | 260 | <div class="input-group-text">$</div> |
| 261 | </div> | 261 | </div> |
| 262 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" | 262 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" |
| 263 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> | 263 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> |
| 264 | </div> | 264 | </div> |
| 265 | </div> | 265 | </div> |
| 266 | </div> | 266 | </div> |
| 267 | </div> | 267 | </div> |
| 268 | <div class="row my-3"> | 268 | <div class="row my-3"> |
| 269 | <div class="col-md-2"> | 269 | <div class="col-md-2"> |
| 270 | <div class="col-auto"> | 270 | <div class="col-auto"> |
| 271 | <label>Vendedor</label> | 271 | <label>Vendedor</label> |
| 272 | </div> | 272 | </div> |
| 273 | </div> | 273 | </div> |
| 274 | <div class="col-md-3"> | 274 | <div class="col-md-3"> |
| 275 | <div class="col-auto"> | 275 | <div class="col-auto"> |
| 276 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" | 276 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" |
| 277 | ng-click="seleccionarVendedor()" readonly> | 277 | ng-click="seleccionarVendedor()" readonly> |
| 278 | </div> | 278 | </div> |
| 279 | </div> | 279 | </div> |
| 280 | <div class="col-md-2"> | 280 | <div class="col-md-2"> |
| 281 | <div class="col-auto"> | 281 | <div class="col-auto"> |
| 282 | <label>Petrolera</label> | 282 | <label>Petrolera</label> |
| 283 | </div> | 283 | </div> |
| 284 | </div> | 284 | </div> |
| 285 | <div class="col-md-3"> | 285 | <div class="col-md-3"> |
| 286 | <div class="col-auto"> | 286 | <div class="col-auto"> |
| 287 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" | 287 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" |
| 288 | ng-click="seleccionarPetrolera()" readonly> | 288 | ng-click="seleccionarPetrolera()" readonly> |
| 289 | </div> | 289 | </div> |
| 290 | </div> | 290 | </div> |
| 291 | </div> | 291 | </div> |
| 292 | </div> | 292 | </div> |
| 293 | <div class="row"> | 293 | <div class="row"> |
| 294 | <div class="col-md-2"> | 294 | <div class="col-md-2"> |
| 295 | <div class="col-auto"> | 295 | <div class="col-auto"> |
| 296 | <label>Cliente</label> | 296 | <label>Cliente</label> |
| 297 | </div> | 297 | </div> |
| 298 | </div> | 298 | </div> |
| 299 | <div class="col-md-3"> | 299 | <div class="col-md-3"> |
| 300 | <div class="col-auto"> | 300 | <div class="col-auto"> |
| 301 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" | 301 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" |
| 302 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> | 302 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> |
| 303 | </div> | 303 | </div> |
| 304 | </div> | 304 | </div> |
| 305 | <div class="col-md-2"> | 305 | <div class="col-md-2"> |
| 306 | <div class="col-auto"> | 306 | <div class="col-auto"> |
| 307 | <label>Domicilio</label> | 307 | <label>Domicilio</label> |
| 308 | </div> | 308 | </div> |
| 309 | </div> | 309 | </div> |
| 310 | <div class="col-md-4"> | 310 | <div class="col-md-4"> |
| 311 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> | 311 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> |
| 312 | <div class="col-auto"> | 312 | <div class="col-auto"> |
| 313 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" | 313 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" |
| 314 | domi.dom | 314 | domi.dom |
| 315 | for domi | 315 | for domi |
| 316 | in domiciliosCliente | 316 | in domiciliosCliente |
| 317 | " | 317 | " |
| 318 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" | 318 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" |
| 319 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> | 319 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> |
| 320 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> | 320 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> |
| 321 | <div ng-show="sinResultados"> | 321 | <div ng-show="sinResultados"> |
| 322 | No se encontraron resultados. | 322 | No se encontraron resultados. |
| 323 | </div> | 323 | </div> |
| 324 | </div> | 324 | </div> |
| 325 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> | 325 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> |
| 326 | <a class="btn" ng-click="addNewDom()">+</a> | 326 | <a class="btn" ng-click="addNewDom()">+</a> |
| 327 | </div> | 327 | </div> |
| 328 | </div> | 328 | </div> |
| 329 | </div> | 329 | </div> |
| 330 | </uib-tab> | 330 | </uib-tab> |
| 331 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> | 331 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> |
| 332 | <div> | 332 | <div> |
| 333 | <div class="col-auto my-2"> | 333 | <div class="col-auto my-2"> |
| 334 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> | 334 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> |
| 335 | </div> | 335 | </div> |
| 336 | </div> | 336 | </div> |
| 337 | <br> | 337 | <br> |
| 338 | <br> | 338 | <br> |
| 339 | <div class="row"> | 339 | <div class="row"> |
| 340 | <div class="col-md-2"> | 340 | <div class="col-md-2"> |
| 341 | <div class="col-auto"> | 341 | <div class="col-auto"> |
| 342 | <label>Precios y condiciones</label> | 342 | <label>Precios y condiciones</label> |
| 343 | </div> | 343 | </div> |
| 344 | </div> | 344 | </div> |
| 345 | <div class="col-md-4"> | 345 | <div class="col-md-4"> |
| 346 | <div class="col-auto"> | 346 | <div class="col-auto"> |
| 347 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> | 347 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> |
| 348 | </select> | 348 | </select> |
| 349 | </div> | 349 | </div> |
| 350 | </div> | 350 | </div> |
| 351 | <div class="col-md-2"> | 351 | <div class="col-md-2"> |
| 352 | <div class="col-auto"> | 352 | <div class="col-auto"> |
| 353 | <label>Producto</label> | 353 | <label>Producto</label> |
| 354 | </div> | 354 | </div> |
| 355 | </div> | 355 | </div> |
| 356 | <div class="col-md-4"> | 356 | <div class="col-md-4"> |
| 357 | <div class="col-auto"> | 357 | <div class="col-auto"> |
| 358 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" | 358 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" |
| 359 | ng-click="seleccionarArticulo()" readonly> | 359 | ng-click="seleccionarArticulo()" readonly> |
| 360 | </div> | 360 | </div> |
| 361 | </div> | 361 | </div> |
| 362 | </div> | 362 | </div> |
| 363 | <div class="col-md-12"> | 363 | <div class="col-md-12"> |
| 364 | <table class="table my-3 table-hover table-nonfluid"> | 364 | <table class="table my-3 table-hover table-nonfluid"> |
| 365 | <thead> | 365 | <thead> |
| 366 | <tr> | 366 | <tr> |
| 367 | <th>Código</th> | 367 | <th>Código</th> |
| 368 | <th>Nombre</th> | 368 | <th>Nombre</th> |
| 369 | <th>Precio unitario</th> | 369 | <th>Precio unitario</th> |
| 370 | <th>Costo unitario bruto</th> | 370 | <th>Costo unitario bruto</th> |
| 371 | <th>Cantidad</th> | 371 | <th>Cantidad</th> |
| 372 | <th>Subtotal</th> | 372 | <th>Subtotal</th> |
| 373 | </tr> | 373 | </tr> |
| 374 | </thead> | 374 | </thead> |
| 375 | <tbody> | 375 | <tbody> |
| 376 | <tr ng-repeat="articulo in articulosTabla"> | 376 | <tr ng-repeat="articulo in articulosTabla"> |
| 377 | <td ng-bind="articulo.codigo"></td> | 377 | <td ng-bind="articulo.codigo"></td> |
| 378 | <td ng-bind="articulo.nombre"></td> | 378 | <td ng-bind="articulo.nombre"></td> |
| 379 | <td ng-bind="articulo.precio"></td> | 379 | <td ng-bind="articulo.precio"></td> |
| 380 | <td ng-bind="articulo.costoUnitario"></td> | 380 | <td ng-bind="articulo.costoUnitario"></td> |
| 381 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> | 381 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> |
| 382 | <td ng-bind="getSubTotal(articulo.item)"></td> | 382 | <td ng-bind="getSubTotal(articulo.item)"></td> |
| 383 | </tr> | 383 | </tr> |
| 384 | </tbody> | 384 | </tbody> |
| 385 | </table> | 385 | </table> |
| 386 | </div> | 386 | </div> |
| 387 | </uib-tab> | 387 | </uib-tab> |
| 388 | </uib-tabset> | 388 | </uib-tabset> |
| 389 | </form>--> | 389 | </form>--> |