Commit 666a338368449af1250c0787e6aa710ecfd0f52c
Exists in
master
Merge branch 'master' into 'master'
Master (pmarco) See merge request modulos-npm/foca-crear-nota-pedido!8
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" | 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-precio-condiciones": "git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git", |
38 | "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", |
39 | "font-awesome": "^4.7.0", | 39 | "font-awesome": "^4.7.0", |
40 | "gulp": "^3.9.1", | 40 | "gulp": "^3.9.1", |
41 | "gulp-angular-templatecache": "^2.2.2", | 41 | "gulp-angular-templatecache": "2.2.2", |
42 | "gulp-clean": "^0.4.0", | 42 | "gulp-clean": "^0.4.0", |
43 | "gulp-concat": "^2.6.1", | 43 | "gulp-concat": "^2.6.1", |
44 | "gulp-connect": "^5.6.1", | 44 | "gulp-connect": "^5.6.1", |
45 | "gulp-htmlmin": "^5.0.1", | 45 | "gulp-htmlmin": "^5.0.1", |
46 | "gulp-jshint": "^2.1.0", | 46 | "gulp-jshint": "^2.1.0", |
47 | "gulp-rename": "^1.4.0", | 47 | "gulp-rename": "^1.4.0", |
48 | "gulp-replace": "^1.0.0", | 48 | "gulp-replace": "^1.0.0", |
49 | "gulp-sequence": "^1.0.0", | 49 | "gulp-sequence": "^1.0.0", |
50 | "gulp-uglify": "^3.0.1", | 50 | "gulp-uglify": "^3.0.1", |
51 | "gulp-uglify-es": "^1.0.4", | 51 | "gulp-uglify-es": "^1.0.4", |
52 | "jasmine-core": "^3.2.1", | 52 | "jasmine-core": "^3.2.1", |
53 | "jquery": "^3.3.1", | 53 | "jquery": "^3.3.1", |
54 | "jshint": "^2.9.6", | 54 | "jshint": "^2.9.6", |
55 | "pre-commit": "^1.2.2", | 55 | "pre-commit": "^1.2.2", |
56 | "pump": "^3.0.0", | 56 | "pump": "^3.0.0", |
57 | "ui-bootstrap4": "^3.0.5" | 57 | "ui-bootstrap4": "^3.0.5" |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 |
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 = '1'; | 46 | $scope.notaPedido.flete = '1'; |
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 | } | 231 | } |
220 | ] | 232 | ] |
221 | ) | 233 | ) |
222 | .controller('notaPedidoListaCtrl', [ | 234 | .controller('notaPedidoListaCtrl', [ |
223 | '$scope', | 235 | '$scope', |
224 | 'crearNotaPedidoService', | 236 | 'crearNotaPedidoService', |
225 | '$location', | 237 | '$location', |
226 | function($scope, crearNotaPedidoService, $location) { | 238 | function($scope, crearNotaPedidoService, $location) { |
227 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 239 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
228 | $scope.notaPedidos = datos.data; | 240 | $scope.notaPedidos = datos.data; |
229 | }); | 241 | }); |
230 | $scope.editar = function(notaPedido) { | 242 | $scope.editar = function(notaPedido) { |
231 | crearNotaPedidoService.setNotaPedido(notaPedido); | 243 | crearNotaPedidoService.setNotaPedido(notaPedido); |
232 | $location.path('/venta-nota-pedido/abm/'); | 244 | $location.path('/venta-nota-pedido/abm/'); |
233 | }; | 245 | }; |
234 | $scope.crearPedido = function() { | 246 | $scope.crearPedido = function() { |
235 | crearNotaPedidoService.clearNotaPedido(); | 247 | crearNotaPedidoService.clearNotaPedido(); |
236 | $location.path('/venta-nota-pedido/abm/'); | 248 | $location.path('/venta-nota-pedido/abm/'); |
237 | }; | 249 | }; |
238 | } | 250 | } |
251 | ]) | ||
252 | .controller('focaCrearNotaPedidoFichaClienteController', [ | ||
253 | '$scope', | ||
254 | 'crearNotaPedidoService', | ||
255 | '$location', | ||
256 | function($scope, crearNotaPedidoService, $location) { | ||
257 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | ||
258 | $scope.notaPedidos = datos.data; | ||
259 | }); | ||
260 | $scope.editar = function(notaPedido) { | ||
261 | crearNotaPedidoService.setNotaPedido(notaPedido); | ||
262 | $location.path('/venta-nota-pedido/abm/'); | ||
263 | } | ||
264 | $scope.crearPedido = function() { | ||
265 | crearNotaPedidoService.clearNotaPedido(); | ||
266 | $location.path('/venta-nota-pedido/abm/'); | ||
267 | } | ||
268 | } | ||
239 | ]); | 269 | ]); |
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-bind="notaPedido.precioCondicion" | 73 | ng-bind="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> | 78 | </div> |
66 | </div> | 79 | </div> |
67 | </div> | 80 | </div> |
68 | <div class="row"> | 81 | <div class="row"> |
69 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 82 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
70 | <div class="row"> | 83 | <div class="row"> |
71 | |||
72 | </div> | 84 | </div> |
73 | <div class="row"> | 85 | <div class="row"> |
74 | <table class="table table-striped table-sm"> | 86 | <table class="table table-striped table-sm"> |
75 | <thead> | 87 | <thead> |
76 | <tr> | 88 | <tr> |
77 | <th>Sector</th> | 89 | <th>Sector</th> |
78 | <th>Código</th> | 90 | <th>Código</th> |
79 | <th>Descripción</th> | 91 | <th>Descripción</th> |
80 | <th>Cantidad</th> | 92 | <th>Cantidad</th> |
81 | <th>Precio Unitario</th> | 93 | <th>Precio Unitario</th> |
82 | <th>SubTotal</th> | 94 | <th>SubTotal</th> |
83 | <th></th> | 95 | <th></th> |
84 | <th></th> | 96 | <th></th> |
85 | </tr> | 97 | </tr> |
86 | </thead> | 98 | </thead> |
87 | <tbody> | 99 | <tbody> |
88 | <tr> | 100 | <tr> |
89 | <td colspan="2"><input class="form-control" readonly></td> | 101 | <td colspan="2"><input class="form-control" readonly ng-click="seleccionarArticulo()"></td> |
90 | <td></td> | 102 | <td></td> |
91 | <td></td> | 103 | <td></td> |
92 | <td></td> | 104 | <td></td> |
93 | <td></td> | 105 | <td></td> |
94 | <td></td> | 106 | <td></td> |
95 | <td></td> | 107 | <td></td> |
96 | </tr> | 108 | </tr> |
97 | <tr style="cursor: pointer;" ng-click="show = !show"> | 109 | <tr style="cursor: pointer;" ng-click="show = !show"> |
98 | <td>1</td> | 110 | <td>1</td> |
99 | <td>1</td> | 111 | <td>1</td> |
100 | <td>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...</td> | 112 | <td>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...</td> |
101 | <td>{{10000 | number: 2}}</td> | 113 | <td>{{10000 | number: 2}}</td> |
102 | <td>{{1000000000 | currency:'$'}}</td> | 114 | <td>{{1000000000 | currency:'$'}}</td> |
103 | <td>{{1000000000 | currency:'$'}}</td> | 115 | <td>{{1000000000 | currency:'$'}}</td> |
104 | <td></td> | 116 | <td></td> |
105 | <td> | 117 | <td> |
106 | <button class="btn btn-outline-secondary" style="float: right;"> | 118 | <button class="btn btn-outline-secondary" style="float: right;"> |
107 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> | 119 | <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> | 120 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> |
109 | </button> | 121 | </button> |
110 | </td> | 122 | </td> |
111 | </tr> | 123 | </tr> |
112 | <tr ng-show="show"> | 124 | <tr ng-show="show"> |
113 | <td>1</td> | 125 | <td>1</td> |
114 | <td>2</td> | 126 | <td>2</td> |
115 | <td>Lorem Ipsum</td> | 127 | <td>Lorem Ipsum</td> |
116 | <td>1</td> | 128 | <td>1</td> |
117 | <td>{{1000000000 | currency:'U$D'}}</td> | 129 | <td>{{1000000000 | currency:'U$D'}}</td> |
118 | <td>{{10 | currency:'$'}}</td> | 130 | <td>{{10 | currency:'$'}}</td> |
119 | <td></td> | 131 | <td></td> |
120 | <td></td> | 132 | <td></td> |
121 | </tr> | 133 | </tr> |
122 | <tr ng-show="show"> | 134 | <tr ng-show="show"> |
123 | <td>1</td> | 135 | <td>1</td> |
124 | <td>2</td> | 136 | <td>2</td> |
125 | <td>Lorem Ipsum</td> | 137 | <td>Lorem Ipsum</td> |
126 | <td>1</td> | 138 | <td>1</td> |
127 | <td>{{10 | currency:'$'}}</td> | 139 | <td>{{10 | currency:'$'}}</td> |
128 | <td>{{10 | currency:'$'}}</td> | 140 | <td>{{10 | currency:'$'}}</td> |
129 | <td></td> | 141 | <td></td> |
130 | <td></td> | 142 | <td></td> |
131 | </tr> | 143 | </tr> |
132 | </tbody> | 144 | </tbody> |
133 | <tfoot> | 145 | <tfoot> |
134 | <tr class="table-secondary"> | 146 | <tr class="table-secondary"> |
135 | <td colspan="5"><b>Cantidad Items:</b> 3</td> | 147 | <td colspan="5"><b>Cantidad Items:</b> 3</td> |
136 | <td colspan="3">{{30 | currency:'$'}}</td> | 148 | <td colspan="3">{{30 | currency:'$'}}</td> |
137 | </tr> | 149 | </tr> |
138 | </tfoot> | 150 | </tfoot> |
139 | </table> | 151 | </table> |
140 | </div> | 152 | </div> |
141 | </div> | 153 | </div> |
142 | </div> | 154 | </div> |
143 | 155 | ||
144 | <!-- | 156 | <!-- |
145 | <form name="formCrearNota"> | 157 | <form name="formCrearNota"> |
146 | <uib-tabset active="active"> | 158 | <uib-tabset active="active"> |
147 | <uib-tab index="0" heading="General"> | 159 | <uib-tab index="0" heading="General"> |
148 | <input type="hidden" name="id" ng-model="notaPedido.id" /> | 160 | <input type="hidden" name="id" ng-model="notaPedido.id" /> |
149 | <div> | 161 | <div> |
150 | <div class="col-auto my-2"> | 162 | <div class="col-auto my-2"> |
151 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> | 163 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> |
152 | </div> | 164 | </div> |
153 | </div> | 165 | </div> |
154 | <br> | 166 | <br> |
155 | <br> | 167 | <br> |
156 | <div class="row"> | 168 | <div class="row"> |
157 | <div class="col-md-2"> | 169 | <div class="col-md-2"> |
158 | <div class="col-auto"> | 170 | <div class="col-auto"> |
159 | <label>Fecha de carga</label> | 171 | <label>Fecha de carga</label> |
160 | </div> | 172 | </div> |
161 | </div> | 173 | </div> |
162 | <div class="col-md-3"> | 174 | <div class="col-md-3"> |
163 | <div class="col-auto"> | 175 | <div class="col-auto"> |
164 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> | 176 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> |
165 | </div> | 177 | </div> |
166 | </div> | 178 | </div> |
167 | <div class="col-md-2"> | 179 | <div class="col-md-2"> |
168 | <div class="col-auto"> | 180 | <div class="col-auto"> |
169 | <label>Kilómetros</label> | 181 | <label>Kilómetros</label> |
170 | </div> | 182 | </div> |
171 | </div> | 183 | </div> |
172 | <div class="col-md-3"> | 184 | <div class="col-md-3"> |
173 | <div class="col-auto"> | 185 | <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" | 186 | <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"> | 187 | ng-model="notaPedido.kilometros" ng-required="true"> |
176 | </div> | 188 | </div> |
177 | </div> | 189 | </div> |
178 | </div> | 190 | </div> |
179 | <div class="row my-3"> | 191 | <div class="row my-3"> |
180 | <div class="col-md-2"> | 192 | <div class="col-md-2"> |
181 | <div class="col-auto"> | 193 | <div class="col-auto"> |
182 | <label>Jurisdicción de IIBB</label> | 194 | <label>Jurisdicción de IIBB</label> |
183 | </div> | 195 | </div> |
184 | </div> | 196 | </div> |
185 | <div class="col-md-3"> | 197 | <div class="col-md-3"> |
186 | <div class="col-auto"> | 198 | <div class="col-auto"> |
187 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" | 199 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" |
188 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> | 200 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> |
189 | </div> | 201 | </div> |
190 | </div> | 202 | </div> |
191 | <div class="col-md-2"> | 203 | <div class="col-md-2"> |
192 | <div class="col-auto"> | 204 | <div class="col-auto"> |
193 | <label>Costo de financiación</label> | 205 | <label>Costo de financiación</label> |
194 | </div> | 206 | </div> |
195 | </div> | 207 | </div> |
196 | <div class="col-md-3"> | 208 | <div class="col-md-3"> |
197 | <div class="col-auto"> | 209 | <div class="col-auto"> |
198 | <div class="input-group mb-2"> | 210 | <div class="input-group mb-2"> |
199 | <div class="input-group-prepend"> | 211 | <div class="input-group-prepend"> |
200 | <div class="input-group-text">$</div> | 212 | <div class="input-group-text">$</div> |
201 | </div> | 213 | </div> |
202 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" | 214 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" |
203 | ng-model="notaPedido.costoFinanciacion"> | 215 | ng-model="notaPedido.costoFinanciacion"> |
204 | </div> | 216 | </div> |
205 | </div> | 217 | </div> |
206 | </div> | 218 | </div> |
207 | </div> | 219 | </div> |
208 | <div class="row"> | 220 | <div class="row"> |
209 | <div class="col-md-2"> | 221 | <div class="col-md-2"> |
210 | <div class="col-auto"> | 222 | <div class="col-auto"> |
211 | <label>Bomba</label> | 223 | <label>Bomba</label> |
212 | </div> | 224 | </div> |
213 | </div> | 225 | </div> |
214 | <div class="col-md-1"> | 226 | <div class="col-md-1"> |
215 | <div class="col-auto"> | 227 | <div class="col-auto"> |
216 | <div class="form-check custom-radio custom-control-inline"> | 228 | <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"> | 229 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> |
218 | <label class="form-check-label"> | 230 | <label class="form-check-label"> |
219 | Si | 231 | Si |
220 | </label> | 232 | </label> |
221 | </div> | 233 | </div> |
222 | <div class="form-check custom-radio custom-control-inline"> | 234 | <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"> | 235 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> |
224 | <label class="form-check-label"> | 236 | <label class="form-check-label"> |
225 | No | 237 | No |
226 | </label> | 238 | </label> |
227 | </div> | 239 | </div> |
228 | </div> | 240 | </div> |
229 | </div> | 241 | </div> |
230 | <div class="col-md-1"> | 242 | <div class="col-md-1"> |
231 | <div class="col-auto"> | 243 | <div class="col-auto"> |
232 | <label>Flete</label> | 244 | <label>Flete</label> |
233 | </div> | 245 | </div> |
234 | </div> | 246 | </div> |
235 | <div class="col-md-1"> | 247 | <div class="col-md-1"> |
236 | <div class="col-auto"> | 248 | <div class="col-auto"> |
237 | <div class="form-check custom-radio custom-control-inline"> | 249 | <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"> | 250 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> |
239 | <label class="form-check-label"> | 251 | <label class="form-check-label"> |
240 | Si | 252 | Si |
241 | </label> | 253 | </label> |
242 | </div> | 254 | </div> |
243 | <div class="form-check custom-radio custom-control-inline"> | 255 | <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"> | 256 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> |
245 | <label class="form-check-label"> | 257 | <label class="form-check-label"> |
246 | FOB | 258 | FOB |
247 | </label> | 259 | </label> |
248 | </div> | 260 | </div> |
249 | </div> | 261 | </div> |
250 | </div> | 262 | </div> |
251 | <div class="col-md-2"> | 263 | <div class="col-md-2"> |
252 | <div class="col-auto"> | 264 | <div class="col-auto"> |
253 | <label>Costo unitario kilometro flete</label> | 265 | <label>Costo unitario kilometro flete</label> |
254 | </div> | 266 | </div> |
255 | </div> | 267 | </div> |
256 | <div class="col-md-3"> | 268 | <div class="col-md-3"> |
257 | <div class="col-auto"> | 269 | <div class="col-auto"> |
258 | <div class="input-group mb-2"> | 270 | <div class="input-group mb-2"> |
259 | <div class="input-group-prepend"> | 271 | <div class="input-group-prepend"> |
260 | <div class="input-group-text">$</div> | 272 | <div class="input-group-text">$</div> |
261 | </div> | 273 | </div> |
262 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" | 274 | <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"> | 275 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> |
264 | </div> | 276 | </div> |
265 | </div> | 277 | </div> |
266 | </div> | 278 | </div> |
267 | </div> | 279 | </div> |
268 | <div class="row my-3"> | 280 | <div class="row my-3"> |
269 | <div class="col-md-2"> | 281 | <div class="col-md-2"> |
270 | <div class="col-auto"> | 282 | <div class="col-auto"> |
271 | <label>Vendedor</label> | 283 | <label>Vendedor</label> |
272 | </div> | 284 | </div> |
273 | </div> | 285 | </div> |
274 | <div class="col-md-3"> | 286 | <div class="col-md-3"> |
275 | <div class="col-auto"> | 287 | <div class="col-auto"> |
276 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" | 288 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" |
277 | ng-click="seleccionarVendedor()" readonly> | 289 | ng-click="seleccionarVendedor()" readonly> |
278 | </div> | 290 | </div> |
279 | </div> | 291 | </div> |
280 | <div class="col-md-2"> | 292 | <div class="col-md-2"> |
281 | <div class="col-auto"> | 293 | <div class="col-auto"> |
282 | <label>Petrolera</label> | 294 | <label>Petrolera</label> |
283 | </div> | 295 | </div> |
284 | </div> | 296 | </div> |
285 | <div class="col-md-3"> | 297 | <div class="col-md-3"> |
286 | <div class="col-auto"> | 298 | <div class="col-auto"> |
287 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" | 299 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" |
288 | ng-click="seleccionarPetrolera()" readonly> | 300 | ng-click="seleccionarPetrolera()" readonly> |
289 | </div> | 301 | </div> |
290 | </div> | 302 | </div> |
291 | </div> | 303 | </div> |
292 | </div> | 304 | </div> |
293 | <div class="row"> | 305 | <div class="row"> |
294 | <div class="col-md-2"> | 306 | <div class="col-md-2"> |
295 | <div class="col-auto"> | 307 | <div class="col-auto"> |
296 | <label>Cliente</label> | 308 | <label>Cliente</label> |
297 | </div> | 309 | </div> |
298 | </div> | 310 | </div> |
299 | <div class="col-md-3"> | 311 | <div class="col-md-3"> |
300 | <div class="col-auto"> | 312 | <div class="col-auto"> |
301 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" | 313 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" |
302 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> | 314 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> |
303 | </div> | 315 | </div> |
304 | </div> | 316 | </div> |
305 | <div class="col-md-2"> | 317 | <div class="col-md-2"> |
306 | <div class="col-auto"> | 318 | <div class="col-auto"> |
307 | <label>Domicilio</label> | 319 | <label>Domicilio</label> |
308 | </div> | 320 | </div> |
309 | </div> | 321 | </div> |
310 | <div class="col-md-4"> | 322 | <div class="col-md-4"> |
311 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> | 323 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> |
312 | <div class="col-auto"> | 324 | <div class="col-auto"> |
313 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" | 325 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" |
314 | domi.dom | 326 | domi.dom |
315 | for domi | 327 | for domi |
316 | in domiciliosCliente | 328 | in domiciliosCliente |
317 | " | 329 | " |
318 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" | 330 | 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"> | 331 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> |
320 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> | 332 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> |
321 | <div ng-show="sinResultados"> | 333 | <div ng-show="sinResultados"> |
322 | No se encontraron resultados. | 334 | No se encontraron resultados. |
323 | </div> | 335 | </div> |
324 | </div> | 336 | </div> |
325 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> | 337 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> |
326 | <a class="btn" ng-click="addNewDom()">+</a> | 338 | <a class="btn" ng-click="addNewDom()">+</a> |
327 | </div> | 339 | </div> |
328 | </div> | 340 | </div> |
329 | </div> | 341 | </div> |
330 | </uib-tab> | 342 | </uib-tab> |
331 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> | 343 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> |
332 | <div> | 344 | <div> |
333 | <div class="col-auto my-2"> | 345 | <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> | 346 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> |
335 | </div> | 347 | </div> |
336 | </div> | 348 | </div> |
337 | <br> | 349 | <br> |
338 | <br> | 350 | <br> |
339 | <div class="row"> | 351 | <div class="row"> |
340 | <div class="col-md-2"> | 352 | <div class="col-md-2"> |
341 | <div class="col-auto"> | 353 | <div class="col-auto"> |
342 | <label>Precios y condiciones</label> | 354 | <label>Precios y condiciones</label> |
343 | </div> | 355 | </div> |
344 | </div> | 356 | </div> |
345 | <div class="col-md-4"> | 357 | <div class="col-md-4"> |
346 | <div class="col-auto"> | 358 | <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"> | 359 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> |
348 | </select> | 360 | </select> |
349 | </div> | 361 | </div> |
350 | </div> | 362 | </div> |
351 | <div class="col-md-2"> | 363 | <div class="col-md-2"> |
352 | <div class="col-auto"> | 364 | <div class="col-auto"> |
353 | <label>Producto</label> | 365 | <label>Producto</label> |
354 | </div> | 366 | </div> |
355 | </div> | 367 | </div> |
356 | <div class="col-md-4"> | 368 | <div class="col-md-4"> |
357 | <div class="col-auto"> | 369 | <div class="col-auto"> |
358 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" | 370 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" |
359 | ng-click="seleccionarArticulo()" readonly> | 371 | ng-click="seleccionarArticulo()" readonly> |
360 | </div> | 372 | </div> |
361 | </div> | 373 | </div> |
362 | </div> | 374 | </div> |
363 | <div class="col-md-12"> | 375 | <div class="col-md-12"> |
364 | <table class="table my-3 table-hover table-nonfluid"> | 376 | <table class="table my-3 table-hover table-nonfluid"> |
365 | <thead> | 377 | <thead> |
366 | <tr> | 378 | <tr> |
367 | <th>Código</th> | 379 | <th>Código</th> |
368 | <th>Nombre</th> | 380 | <th>Nombre</th> |
369 | <th>Precio unitario</th> | 381 | <th>Precio unitario</th> |
370 | <th>Costo unitario bruto</th> | 382 | <th>Costo unitario bruto</th> |
371 | <th>Cantidad</th> | 383 | <th>Cantidad</th> |
372 | <th>Subtotal</th> | 384 | <th>Subtotal</th> |
373 | </tr> | 385 | </tr> |
374 | </thead> | 386 | </thead> |
375 | <tbody> | 387 | <tbody> |
376 | <tr ng-repeat="articulo in articulosTabla"> | 388 | <tr ng-repeat="articulo in articulosTabla"> |
377 | <td ng-bind="articulo.codigo"></td> | 389 | <td ng-bind="articulo.codigo"></td> |
378 | <td ng-bind="articulo.nombre"></td> | 390 | <td ng-bind="articulo.nombre"></td> |
379 | <td ng-bind="articulo.precio"></td> | 391 | <td ng-bind="articulo.precio"></td> |
380 | <td ng-bind="articulo.costoUnitario"></td> | 392 | <td ng-bind="articulo.costoUnitario"></td> |
381 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> | 393 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> |
382 | <td ng-bind="getSubTotal(articulo.item)"></td> | 394 | <td ng-bind="getSubTotal(articulo.item)"></td> |
383 | </tr> | 395 | </tr> |
384 | </tbody> | 396 | </tbody> |
385 | </table> | 397 | </table> |
386 | </div> | 398 | </div> |
387 | </uib-tab> | 399 | </uib-tab> |
388 | </uib-tabset> | 400 | </uib-tabset> |