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