Commit 47c65ce5d8e909f2a5d26f0a8fc581912212a33d
1 parent
2e1c1db0c9
Exists in
master
- Agregué ícono lupa a los campos vendedor y cliente.
- Agregué implementación parcial de ficha cliente.
Showing
4 changed files
with
167 additions
and
45 deletions
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 | "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", | 9 | "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", |
10 | "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 jquery jshint pump" | 10 | "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 jquery jshint pump" |
11 | }, | 11 | }, |
12 | "repository": { | 12 | "repository": { |
13 | "type": "git", | 13 | "type": "git", |
14 | "url": "https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git" | 14 | "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" |
15 | }, | 15 | }, |
16 | "author": "Foca Software", | 16 | "author": "Foca Software", |
17 | "license": "ISC", | 17 | "license": "ISC", |
18 | "dependencies": { | 18 | "dependencies": { |
19 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git", | 19 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
20 | "foca-modal-busqueda-productos": "git+https://192.168.0.11/nguarnieri/foca-modal-busqueda-productos", | 20 | "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", |
21 | "foca-modal-petroleras": "git+https://192.168.0.11/modulos-npm/foca-modal-petroleras.git", | 21 | "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", |
22 | "foca-modal-vendedores": "git+https://192.168.0.11/modulos-npm/foca-modal-vendedores.git", | 22 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
23 | "jquery": "^3.3.x" | 23 | "jquery": "^3.3.x" |
24 | }, | 24 | }, |
25 | "devDependencies": { | 25 | "devDependencies": { |
26 | "angular": "^1.7.5", | 26 | "angular": "^1.7.5", |
27 | "angular-route": "^1.7.5", | 27 | "angular-route": "^1.7.5", |
28 | "bootstrap": "^4.1.3", | 28 | "bootstrap": "^4.1.3", |
29 | "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente", | 29 | "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente", |
30 | "font-awesome": "^4.7.0", | 30 | "font-awesome": "^4.7.0", |
31 | "gulp": "^3.9.1", | 31 | "gulp": "^3.9.1", |
32 | "gulp-angular-templatecache": "^2.2.2", | 32 | "gulp-angular-templatecache": "2.2.2", |
33 | "gulp-clean": "^0.4.0", | 33 | "gulp-clean": "^0.4.0", |
34 | "gulp-concat": "^2.6.1", | 34 | "gulp-concat": "^2.6.1", |
35 | "gulp-connect": "^5.6.1", | 35 | "gulp-connect": "^5.6.1", |
36 | "gulp-htmlmin": "^5.0.1", | 36 | "gulp-htmlmin": "^5.0.1", |
37 | "gulp-jshint": "^2.1.0", | 37 | "gulp-jshint": "^2.1.0", |
38 | "gulp-rename": "^1.4.0", | 38 | "gulp-rename": "^1.4.0", |
39 | "gulp-replace": "^1.0.0", | 39 | "gulp-replace": "^1.0.0", |
40 | "gulp-uglify": "^3.0.1", | 40 | "gulp-uglify": "^3.0.1", |
41 | "gulp-uglify-es": "^1.0.4", | 41 | "gulp-uglify-es": "^1.0.4", |
42 | "jasmine-core": "^3.2.1", | 42 | "jasmine-core": "^3.2.1", |
43 | "jshint": "^2.9.6", | 43 | "jshint": "^2.9.6", |
44 | "pre-commit": "^1.2.2", | 44 | "pre-commit": "^1.2.2", |
45 | "pump": "^3.0.0", | 45 | "pump": "^3.0.0", |
46 | "ui-bootstrap4": "^3.0.5" | 46 | "ui-bootstrap4": "^3.0.5" |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 |
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(res) { | 80 | function(res) { |
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.crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( | 87 | crearNotaPedidoService |
85 | function(res) { | 88 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( |
86 | return; | 89 | function(res) { |
87 | } | 90 | return; |
88 | ) | 91 | } |
92 | ) | ||
89 | } | 93 | } |
90 | 94 | ||
91 | } | 95 | } |
92 | $scope.siguienteTab = function() { | 96 | $scope.siguienteTab = function() { |
93 | $scope.active = 1; | 97 | $scope.active = 1; |
94 | } | 98 | } |
95 | $scope.seleccionarArticulo = function() { | 99 | $scope.seleccionarArticulo = function() { |
96 | if (idLista == undefined) { | 100 | if (idLista == undefined) { |
97 | alert('primero seleccione una lista de precio y condicion'); | 101 | alert('primero seleccione una lista de precio y condicion'); |
98 | return; | 102 | return; |
99 | } | 103 | } |
100 | var modalInstance = $uibModal.open( | 104 | var modalInstance = $uibModal.open( |
101 | { | 105 | { |
102 | ariaLabelledBy: 'Busqueda de Productos', | 106 | ariaLabelledBy: 'Busqueda de Productos', |
103 | templateUrl: 'modal-busqueda-productos.html', | 107 | templateUrl: 'modal-busqueda-productos.html', |
104 | controller: 'modalBusquedaProductosCtrl', | 108 | controller: 'modalBusquedaProductosCtrl', |
105 | resolve: { idLista: function() { return idLista } }, | 109 | resolve: { idLista: function() { return idLista } }, |
106 | size: 'lg' | 110 | size: 'lg' |
107 | } | 111 | } |
108 | ) | 112 | ) |
109 | modalInstance.result.then( | 113 | modalInstance.result.then( |
110 | function(producto) { | 114 | function(producto) { |
111 | var newArt = | 115 | var newArt = |
112 | { | 116 | { |
113 | id: 0, | 117 | id: 0, |
114 | codigo: producto.FiltroSectorCodigo, | 118 | codigo: producto.FiltroSectorCodigo, |
115 | item: $scope.articulosTabla.length + 1, | 119 | item: $scope.articulosTabla.length + 1, |
116 | nombre: producto.descripcion, | 120 | nombre: producto.descripcion, |
117 | precio: producto.precio, | 121 | precio: producto.precio, |
118 | costoUnitario: producto.costo, | 122 | costoUnitario: producto.costo, |
119 | cantidad: 1 | 123 | cantidad: 1 |
120 | } | 124 | } |
121 | $scope.articulosTabla.unshift(newArt); | 125 | $scope.articulosTabla.unshift(newArt); |
122 | }, function() { | 126 | }, function() { |
123 | // funcion ejecutada cuando se cancela el modal | 127 | // funcion ejecutada cuando se cancela el modal |
124 | } | 128 | } |
125 | ); | 129 | ); |
126 | } | 130 | } |
127 | $scope.seleccionarVendedor = function() { | 131 | $scope.seleccionarVendedor = function() { |
128 | var modalInstance = $uibModal.open( | 132 | var modalInstance = $uibModal.open( |
129 | { | 133 | { |
130 | ariaLabelledBy: 'Busqueda de Vendedores', | 134 | ariaLabelledBy: 'Busqueda de Vendedores', |
131 | templateUrl: 'modal-vendedores.html', | 135 | templateUrl: 'modal-vendedores.html', |
132 | controller: 'modalVendedoresCtrl', | 136 | controller: 'modalVendedoresCtrl', |
133 | size: 'lg' | 137 | size: 'lg' |
134 | } | 138 | } |
135 | ) | 139 | ) |
136 | modalInstance.result.then( | 140 | modalInstance.result.then( |
137 | function(vendedor) { | 141 | function(vendedor) { |
138 | $scope.notaPedido.vendedor = vendedor.NomVen; | 142 | $scope.notaPedido.vendedor.nombre = vendedor.NomVen; |
139 | }, function() { | 143 | }, function() { |
140 | 144 | ||
141 | } | 145 | } |
142 | ); | 146 | ); |
143 | } | 147 | } |
144 | $scope.seleccionarPetrolera = function() { | 148 | $scope.seleccionarPetrolera = function() { |
145 | var modalInstance = $uibModal.open( | 149 | var modalInstance = $uibModal.open( |
146 | { | 150 | { |
147 | ariaLabelledBy: 'Busqueda de Petrolera', | 151 | ariaLabelledBy: 'Busqueda de Petrolera', |
148 | templateUrl: 'modal-petroleras.html', | 152 | templateUrl: 'modal-petroleras.html', |
149 | controller: 'modalPetrolerasCtrl', | 153 | controller: 'modalPetrolerasCtrl', |
150 | size: 'lg' | 154 | size: 'lg' |
151 | } | 155 | } |
152 | ) | 156 | ) |
153 | modalInstance.result.then( | 157 | modalInstance.result.then( |
154 | function(petrolera) { | 158 | function(petrolera) { |
155 | $scope.notaPedido.petrolera = petrolera.NOM; | 159 | $scope.notaPedido.petrolera = petrolera.NOM; |
156 | }, function() { | 160 | }, function() { |
157 | 161 | ||
158 | } | 162 | } |
159 | ); | 163 | ); |
160 | } | 164 | } |
161 | $scope.seleccionarCliente = function() { | 165 | $scope.seleccionarCliente = function() { |
162 | var modalInstance = $uibModal.open( | 166 | var modalInstance = $uibModal.open( |
163 | { | 167 | { |
164 | ariaLabelledBy: 'Busqueda de Cliente', | 168 | ariaLabelledBy: 'Busqueda de Cliente', |
165 | templateUrl: 'foca-busqueda-cliente-modal.html', | 169 | templateUrl: 'foca-busqueda-cliente-modal.html', |
166 | controller: 'focaBusquedaClienteModalController', | 170 | controller: 'focaBusquedaClienteModalController', |
167 | size: 'lg' | 171 | size: 'lg' |
168 | } | 172 | } |
169 | ) | 173 | ) |
170 | modalInstance.result.then( | 174 | modalInstance.result.then( |
171 | function(cliente) { | 175 | function(cliente) { |
172 | $scope.notaPedido.cliente = cliente.nom; | 176 | $scope.notaPedido.cliente.nombre = cliente.nom; |
173 | }, function() { | 177 | }, function() { |
174 | 178 | ||
175 | } | 179 | } |
176 | ); | 180 | ); |
177 | } | 181 | }; |
182 | $scope.mostrarFichaCliente = function() { | ||
183 | $uibModal.open( | ||
184 | { | ||
185 | ariaLabelledBy: 'Datos del Cliente', | ||
186 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', | ||
187 | controller: 'focaCrearNotaPedidoFichaClienteController', | ||
188 | size: 'lg' | ||
189 | } | ||
190 | ); | ||
191 | }; | ||
178 | $scope.obtenerDomicilios = function(id) { | 192 | $scope.obtenerDomicilios = function(id) { |
179 | crearNotaPedidoService.getDomicilios(id).then( | 193 | crearNotaPedidoService.getDomicilios(id).then( |
180 | function(res) { | 194 | function(res) { |
181 | $scope.notaPedido.domicilio = res.data; | 195 | $scope.notaPedido.domicilio = res.data; |
182 | } | 196 | } |
183 | ) | 197 | ) |
184 | } | 198 | } |
185 | $scope.getSubTotal = function(item) { | 199 | $scope.getSubTotal = function(item) { |
186 | var subTotal = 0; | 200 | var subTotal = 0; |
187 | var array = $scope.articulosTabla.filter( | 201 | var array = $scope.articulosTabla.filter( |
188 | function(a) { | 202 | function(a) { |
189 | return a.item <= item; | 203 | return a.item <= item; |
190 | } | 204 | } |
191 | ); | 205 | ); |
192 | for (var i = 0; i < array.length; i++) { | 206 | for (var i = 0; i < array.length; i++) { |
193 | subTotal += array[i].precio * array[i].cantidad | 207 | subTotal += array[i].precio * array[i].cantidad |
194 | } | 208 | } |
195 | return subTotal.toFixed(2); | 209 | return subTotal.toFixed(2); |
196 | } | 210 | } |
197 | $scope.cargarArticulos = function() { | 211 | $scope.cargarArticulos = function() { |
198 | idLista = $scope.notaPedido.precioCondicion; | 212 | idLista = $scope.notaPedido.precioCondicion; |
199 | $scope.articulosTabla = []; | 213 | $scope.articulosTabla = []; |
200 | } | 214 | } |
201 | } | 215 | } |
202 | ] | 216 | ] |
203 | ) | 217 | ) |
204 | .controller('notaPedidoListaCtrl', [ | 218 | .controller('notaPedidoListaCtrl', [ |
205 | '$scope', | 219 | '$scope', |
206 | 'crearNotaPedidoService', | 220 | 'crearNotaPedidoService', |
207 | '$location', | 221 | '$location', |
208 | function($scope, crearNotaPedidoService, $location) { | 222 | function($scope, crearNotaPedidoService, $location) { |
209 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 223 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
210 | $scope.notaPedidos = datos.data; | 224 | $scope.notaPedidos = datos.data; |
211 | }); | 225 | }); |
212 | $scope.editar = function(notaPedido) { | 226 | $scope.editar = function(notaPedido) { |
213 | crearNotaPedidoService.setNotaPedido(notaPedido); | 227 | crearNotaPedidoService.setNotaPedido(notaPedido); |
214 | $location.path('/venta-nota-pedido/abm/'); | 228 | $location.path('/venta-nota-pedido/abm/'); |
215 | } | 229 | } |
216 | $scope.crearPedido = function() { | 230 | $scope.crearPedido = function() { |
217 | crearNotaPedidoService.clearNotaPedido(); | 231 | crearNotaPedidoService.clearNotaPedido(); |
218 | $location.path('/venta-nota-pedido/abm/'); | 232 | $location.path('/venta-nota-pedido/abm/'); |
219 | } | 233 | } |
220 | } | 234 | } |
221 | ]) | 235 | ]) |
236 | .controller('focaCrearNotaPedidoFichaClienteController', [ | ||
237 | '$scope', | ||
238 | 'crearNotaPedidoService', | ||
239 | '$location', | ||
240 | function($scope, crearNotaPedidoService, $location) { | ||
241 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | ||
242 | $scope.notaPedidos = datos.data; | ||
243 | }); | ||
244 | $scope.editar = function(notaPedido) { | ||
245 | crearNotaPedidoService.setNotaPedido(notaPedido); | ||
246 | $location.path('/venta-nota-pedido/abm/'); | ||
247 | } | ||
248 | $scope.crearPedido = function() { | ||
249 | crearNotaPedidoService.clearNotaPedido(); | ||
250 | $location.path('/venta-nota-pedido/abm/'); | ||
251 | } | ||
252 | } | ||
253 | ]); | ||
222 | 254 |
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="vendedor.nombre" | 73 | ng-bind="vendedor.nombre" |
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> |