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