Commit f4c819c10638d75d8fa71c24bb27c718233ff32f
Exists in
master
Merge branch 'master' into 'master'
Master See merge request modulos-npm/foca-crear-nota-pedido!13
Showing
3 changed files
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', 'focaModalService', | 3 | ['$scope', '$uibModal', '$location', 'crearNotaPedidoService', 'focaModalService', |
4 | function($scope, $uibModal, $location, crearNotaPedidoService, focaModalService) { | 4 | function($scope, $uibModal, $location, crearNotaPedidoService, focaModalService) { |
5 | $scope.show = false; | 5 | $scope.show = false; |
6 | $scope.edit = false; | 6 | $scope.cargando = true; |
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 | $scope.notaPedido = { | 11 | $scope.notaPedido = { |
12 | vendedor: {}, | 12 | vendedor: {}, |
13 | cliente: {} | 13 | cliente: {} |
14 | }; | 14 | }; |
15 | $scope.articulosTabla = []; | 15 | $scope.articulosTabla = []; |
16 | var idLista; | 16 | var idLista; |
17 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); | 17 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); |
18 | $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1); | 18 | $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1); |
19 | crearNotaPedidoService.getPrecioCondicion().then( | 19 | crearNotaPedidoService.getPrecioCondicion().then( |
20 | function(res) { | 20 | function(res) { |
21 | $scope.precioCondiciones = res.data; | 21 | $scope.precioCondiciones = res.data; |
22 | } | 22 | } |
23 | ); | 23 | ); |
24 | if (notaPedidoTemp !== undefined) { | 24 | if (notaPedidoTemp !== undefined) { |
25 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); | 25 | notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); |
26 | $scope.notaPedido = notaPedidoTemp; | 26 | $scope.notaPedido = notaPedidoTemp; |
27 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); | 27 | $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); |
28 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); | 28 | $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); |
29 | idLista = $scope.notaPedido.precioCondicion; | 29 | idLista = $scope.notaPedido.precioCondicion; |
30 | crearNotaPedidoService | 30 | crearNotaPedidoService |
31 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( | 31 | .getArticulosByIdNotaPedido($scope.notaPedido.id).then( |
32 | function(res) { | 32 | function(res) { |
33 | $scope.articulosTabla = res.data; | 33 | $scope.articulosTabla = res.data; |
34 | } | 34 | } |
35 | ); | 35 | ); |
36 | crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( | 36 | crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( |
37 | function(res) { | 37 | function(res) { |
38 | $scope.notaPedido.domicilio = res.data; | 38 | $scope.notaPedido.domicilio = res.data; |
39 | } | 39 | } |
40 | ); | 40 | ); |
41 | } else { | 41 | } else { |
42 | $scope.notaPedido.fechaCarga = new Date(); | 42 | $scope.notaPedido.fechaCarga = new Date(); |
43 | $scope.notaPedido.domicilio = [{ id: 0 }]; | 43 | $scope.notaPedido.domicilio = [{ id: 0 }]; |
44 | $scope.notaPedido.bomba = '1'; | 44 | $scope.notaPedido.bomba = '1'; |
45 | $scope.notaPedido.flete = '0'; | 45 | $scope.notaPedido.flete = '0'; |
46 | idLista = undefined; | 46 | idLista = undefined; |
47 | } | 47 | } |
48 | $scope.addNewDom = function() { | 48 | $scope.addNewDom = function() { |
49 | $scope.notaPedido.domicilio.push({ 'id': 0 }); | 49 | $scope.notaPedido.domicilio.push({ 'id': 0 }); |
50 | }; | 50 | }; |
51 | $scope.removeNewChoice = function(choice) { | 51 | $scope.removeNewChoice = function(choice) { |
52 | if ($scope.notaPedido.domicilio.length > 1) { | 52 | if ($scope.notaPedido.domicilio.length > 1) { |
53 | $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( | 53 | $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex( |
54 | function(c) { | 54 | function(c) { |
55 | return c.$$hashKey === choice.$$hashKey; | 55 | return c.$$hashKey === choice.$$hashKey; |
56 | } | 56 | } |
57 | ), 1); | 57 | ), 1); |
58 | } | 58 | } |
59 | }; | 59 | }; |
60 | $scope.crearNotaPedido = function() { | 60 | $scope.crearNotaPedido = function() { |
61 | var notaPedido = { | 61 | var notaPedido = { |
62 | id: 0, | 62 | id: 0, |
63 | precioCondicion: $scope.notaPedido.precioCondicion, | ||
64 | fechaCarga: $scope.notaPedido.fechaCarga, | 63 | fechaCarga: $scope.notaPedido.fechaCarga, |
65 | vendedor: $scope.notaPedido.vendedor, | 64 | vendedor: $scope.notaPedido.vendedor.nombre, |
66 | cliente: $scope.notaPedido.cliente, | 65 | cliente: $scope.notaPedido.cliente.nombre, |
67 | producto: $scope.notaPedido.producto, | 66 | domicilio: $scope.notaPedido.domicilio.id, |
67 | precioCondicion: $scope.notaPedido.precioCondicion, | ||
68 | bomba: $scope.notaPedido.bomba, | 68 | bomba: $scope.notaPedido.bomba, |
69 | petrolera: $scope.notaPedido.petrolera, | ||
70 | domicilio: $scope.notaPedido.domicilio, | ||
71 | kilometros: $scope.notaPedido.kilometros, | ||
72 | jurisdiccionIIBB: $scope.notaPedido.jurisdiccionIIBB, | ||
73 | costoFinanciacion: $scope.notaPedido.costoFinanciacion, | ||
74 | flete: $scope.notaPedido.flete, | 69 | flete: $scope.notaPedido.flete, |
75 | costoUnitarioKmFlete: $scope.notaPedido.costoUnitarioKmFlete, | 70 | total: $scope.getTotal() |
76 | total: $scope.articulosTabla[0].subTotal | ||
77 | }; | 71 | }; |
78 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( | 72 | crearNotaPedidoService.crearNotaPedido(notaPedido).then( |
79 | function() { | 73 | function() { |
80 | focaModalService('Nota pedido creada'); | 74 | focaModalService.alert('Nota pedido creada'); |
81 | $location.path('/venta-nota-pedido'); | 75 | // $location.path('/venta-nota-pedido'); |
76 | // var flete = { | ||
77 | // idNotaPedido: data.data.id, | ||
78 | // idTransportista: $scope.notaPedido.fleteId, | ||
79 | // idChofer: $scope.chofer.id, | ||
80 | // idVehiculo: $scope.vehiculo.id, | ||
81 | // kilometros: $scope.notaPedido.kilometros, | ||
82 | // costoKilometro: $scope.notaPedido.costoUnitarioKmFlete | ||
83 | // }; | ||
84 | //TO DO - Insert de flete | ||
82 | } | 85 | } |
83 | ); | 86 | ); |
84 | var articulosNotaPedido = $scope.articulosTabla; | 87 | var articulosNotaPedido = $scope.articulosTabla; |
85 | for(var i = 0; i< articulosNotaPedido.length;i++) { | 88 | for(var i = 0; i< articulosNotaPedido.length;i++) { |
86 | crearNotaPedidoService | 89 | crearNotaPedidoService |
87 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( | 90 | .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( |
88 | function() { | 91 | function() { |
89 | return; | 92 | return; |
90 | } | 93 | } |
91 | ); | 94 | ); |
92 | } | 95 | } |
96 | |||
93 | }; | 97 | }; |
94 | $scope.siguienteTab = function() { | 98 | $scope.siguienteTab = function() { |
95 | $scope.active = 1; | 99 | $scope.active = 1; |
96 | }; | 100 | }; |
97 | $scope.seleccionarArticulo = function() { | 101 | $scope.seleccionarArticulo = function() { |
98 | if (idLista === undefined) { | 102 | if (idLista === undefined) { |
99 | focaModalService.alert( | 103 | focaModalService.alert( |
100 | 'primero seleccione una lista de precio y condicion'); | 104 | 'primero seleccione una lista de precio y condicion'); |
101 | return; | 105 | return; |
102 | } | 106 | } |
103 | var modalInstance = $uibModal.open( | 107 | var modalInstance = $uibModal.open( |
104 | { | 108 | { |
105 | ariaLabelledBy: 'Busqueda de Productos', | 109 | ariaLabelledBy: 'Busqueda de Productos', |
106 | templateUrl: 'modal-busqueda-productos.html', | 110 | templateUrl: 'modal-busqueda-productos.html', |
107 | controller: 'modalBusquedaProductosCtrl', | 111 | controller: 'modalBusquedaProductosCtrl', |
108 | resolve: { idLista: function() { return idLista; } }, | 112 | resolve: { idLista: function() { return idLista; } }, |
109 | size: 'lg' | 113 | size: 'lg' |
110 | } | 114 | } |
111 | ); | 115 | ); |
112 | modalInstance.result.then( | 116 | modalInstance.result.then( |
113 | function(producto) { | 117 | function(producto) { |
114 | var newArt = | 118 | var newArt = |
115 | { | 119 | { |
116 | id: 0, | 120 | id: 0, |
117 | codigo: producto.codigo, | 121 | codigo: producto.codigo, |
118 | sector: producto.sector, | 122 | sector: producto.sector, |
119 | descripcion: producto.descripcion, | 123 | descripcion: producto.descripcion, |
120 | item: $scope.articulosTabla.length + 1, | 124 | item: $scope.articulosTabla.length + 1, |
121 | nombre: producto.descripcion, | 125 | nombre: producto.descripcion, |
122 | precio: producto.precio.toFixed(2), | 126 | precio: producto.precio.toFixed(2), |
123 | costoUnitario: producto.costo, | 127 | costoUnitario: producto.costo, |
124 | cantidad: 1 | 128 | edit: false |
125 | }; | 129 | }; |
126 | $scope.articuloACargar = newArt; | 130 | $scope.articuloACargar = newArt; |
131 | $scope.cargando = false; | ||
127 | }, function() { | 132 | }, function() { |
128 | // funcion ejecutada cuando se cancela el modal | 133 | // funcion ejecutada cuando se cancela el modal |
129 | } | 134 | } |
130 | ); | 135 | ); |
131 | }; | 136 | }; |
132 | $scope.seleccionarVendedor = function() { | 137 | $scope.seleccionarVendedor = function() { |
133 | var modalInstance = $uibModal.open( | 138 | var modalInstance = $uibModal.open( |
134 | { | 139 | { |
135 | ariaLabelledBy: 'Busqueda de Vendedores', | 140 | ariaLabelledBy: 'Busqueda de Vendedores', |
136 | templateUrl: 'modal-vendedores.html', | 141 | templateUrl: 'modal-vendedores.html', |
137 | controller: 'modalVendedoresCtrl', | 142 | controller: 'modalVendedoresCtrl', |
138 | size: 'lg' | 143 | size: 'lg' |
139 | } | 144 | } |
140 | ); | 145 | ); |
141 | modalInstance.result.then( | 146 | modalInstance.result.then( |
142 | function(vendedor) { | 147 | function(vendedor) { |
143 | $scope.notaPedido.vendedor.nombre = vendedor.NomVen; | 148 | $scope.notaPedido.vendedor.nombre = vendedor.NomVen; |
144 | }, function() { | 149 | }, function() { |
145 | 150 | ||
146 | } | 151 | } |
147 | ); | 152 | ); |
148 | }; | 153 | }; |
149 | $scope.seleccionarPetrolera = function() { | 154 | $scope.seleccionarPetrolera = function() { |
150 | var modalInstance = $uibModal.open( | 155 | var modalInstance = $uibModal.open( |
151 | { | 156 | { |
152 | ariaLabelledBy: 'Busqueda de Petrolera', | 157 | ariaLabelledBy: 'Busqueda de Petrolera', |
153 | templateUrl: 'modal-petroleras.html', | 158 | templateUrl: 'modal-petroleras.html', |
154 | controller: 'modalPetrolerasCtrl', | 159 | controller: 'modalPetrolerasCtrl', |
155 | size: 'lg' | 160 | size: 'lg' |
156 | } | 161 | } |
157 | ); | 162 | ); |
158 | modalInstance.result.then( | 163 | modalInstance.result.then( |
159 | function(petrolera) { | 164 | function(petrolera) { |
160 | $scope.notaPedido.petrolera = petrolera.NOM; | 165 | $scope.notaPedido.petrolera = petrolera.NOM; |
161 | }, function() { | 166 | }, function() { |
162 | 167 | ||
163 | } | 168 | } |
164 | ); | 169 | ); |
165 | }; | 170 | }; |
166 | $scope.seleccionarCliente = function() { | 171 | $scope.seleccionarCliente = function() { |
167 | var modalInstance = $uibModal.open( | 172 | var modalInstance = $uibModal.open( |
168 | { | 173 | { |
169 | ariaLabelledBy: 'Busqueda de Cliente', | 174 | ariaLabelledBy: 'Busqueda de Cliente', |
170 | templateUrl: 'foca-busqueda-cliente-modal.html', | 175 | templateUrl: 'foca-busqueda-cliente-modal.html', |
171 | controller: 'focaBusquedaClienteModalController', | 176 | controller: 'focaBusquedaClienteModalController', |
172 | size: 'lg' | 177 | size: 'lg' |
173 | } | 178 | } |
174 | ); | 179 | ); |
175 | modalInstance.result.then( | 180 | modalInstance.result.then( |
176 | function(cliente) { | 181 | function(cliente) { |
177 | $scope.notaPedido.cliente.nombre = cliente.nom; | 182 | $scope.notaPedido.cliente.nombre = cliente.nom; |
178 | }, function() { | 183 | }, function() { |
179 | 184 | ||
180 | } | 185 | } |
181 | ); | 186 | ); |
182 | }; | 187 | }; |
183 | $scope.mostrarFichaCliente = function() { | 188 | $scope.mostrarFichaCliente = function() { |
184 | $uibModal.open( | 189 | $uibModal.open( |
185 | { | 190 | { |
186 | ariaLabelledBy: 'Datos del Cliente', | 191 | ariaLabelledBy: 'Datos del Cliente', |
187 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', | 192 | templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', |
188 | controller: 'focaCrearNotaPedidoFichaClienteController', | 193 | controller: 'focaCrearNotaPedidoFichaClienteController', |
189 | size: 'lg' | 194 | size: 'lg' |
190 | } | 195 | } |
191 | ); | 196 | ); |
192 | }; | 197 | }; |
193 | $scope.obtenerDomicilios = function(id) { | 198 | $scope.obtenerDomicilios = function(id) { |
194 | crearNotaPedidoService.getDomicilios(id).then( | 199 | crearNotaPedidoService.getDomicilios(id).then( |
195 | function(res) { | 200 | function(res) { |
196 | $scope.notaPedido.domicilio = res.data; | 201 | $scope.notaPedido.domicilio = res.data; |
197 | } | 202 | } |
198 | ); | 203 | ); |
199 | }; | 204 | }; |
200 | $scope.getTotal = function() { | 205 | $scope.getTotal = function() { |
201 | var total = 0; | 206 | var total = 0; |
202 | var array = $scope.articulosTabla; | 207 | var array = $scope.articulosTabla; |
203 | for (var i = 0; i < array.length; i++) { | 208 | for (var i = 0; i < array.length; i++) { |
204 | total += array[i].precio * array[i].cantidad; | 209 | total += array[i].precio * array[i].cantidad; |
205 | } | 210 | } |
206 | return total.toFixed(2); | 211 | return total.toFixed(2); |
207 | }; | 212 | }; |
208 | $scope.getSubTotal = function() { | 213 | $scope.getSubTotal = function() { |
209 | if($scope.articuloACargar) { | 214 | if($scope.articuloACargar) { |
210 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; | 215 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
211 | } | 216 | } |
212 | }; | 217 | }; |
213 | $scope.cargarArticulos = function() { | 218 | $scope.cargarArticulos = function() { |
214 | idLista = $scope.notaPedido.precioCondicion; | 219 | idLista = $scope.notaPedido.precioCondicion; |
215 | $scope.articulosTabla = []; | 220 | $scope.articulosTabla = []; |
216 | }; | 221 | }; |
217 | $scope.abrirModalListaPrecio = function() { | 222 | $scope.abrirModalListaPrecio = function() { |
218 | var modalInstance = $uibModal.open( | 223 | var modalInstance = $uibModal.open( |
219 | { | 224 | { |
220 | ariaLabelledBy: 'Busqueda de Precio Condición', | 225 | ariaLabelledBy: 'Busqueda de Precio Condición', |
221 | templateUrl: 'modal-precio-condicion.html', | 226 | templateUrl: 'modal-precio-condicion.html', |
222 | controller: 'focaModalPrecioCondicionController', | 227 | controller: 'focaModalPrecioCondicionController', |
223 | size: 'lg' | 228 | size: 'lg' |
224 | } | 229 | } |
225 | ); | 230 | ); |
226 | modalInstance.result.then( | 231 | modalInstance.result.then( |
227 | function(precioCondicion) { | 232 | function(precioCondicion) { |
228 | $scope.notaPedido.precioCondicion = precioCondicion.nombre; | 233 | $scope.notaPedido.precioCondicion = precioCondicion.nombre; |
229 | idLista = precioCondicion.idListaPrecio; | 234 | idLista = precioCondicion.idListaPrecio; |
230 | $scope.articulosTabla = []; | 235 | $scope.articulosTabla = []; |
231 | }, function() { | 236 | }, function() { |
232 | 237 | ||
233 | } | 238 | } |
234 | ); | 239 | ); |
235 | }; | 240 | }; |
236 | $scope.abrirModalFlete = function() { | 241 | $scope.abrirModalFlete = function() { |
237 | if($scope.notaPedido.flete === '1') { | 242 | if($scope.notaPedido.flete === '1') { |
238 | var modalInstance = $uibModal.open( | 243 | var modalInstance = $uibModal.open( |
239 | { | 244 | { |
240 | ariaLabelledBy: 'Busqueda de Flete', | 245 | ariaLabelledBy: 'Busqueda de Flete', |
241 | templateUrl: 'modal-flete.html', | 246 | templateUrl: 'modal-flete.html', |
242 | controller: 'focaModalFleteController', | 247 | controller: 'focaModalFleteController', |
243 | size: 'lg' | 248 | size: 'lg' |
244 | } | 249 | } |
245 | ); | 250 | ); |
246 | modalInstance.result.then( | 251 | modalInstance.result.then( |
247 | function(flete) { | 252 | function(flete) { |
248 | $scope.choferes = ''; | 253 | $scope.choferes = ''; |
249 | $scope.vehiculos = ''; | 254 | $scope.vehiculos = ''; |
255 | $scope.notaPedido.chofer = ''; | ||
256 | $scope.notaPedido.vehiculo = ''; | ||
257 | $scope.notaPedido.costoUnitarioKmFlete = ''; | ||
250 | $scope.notaPedido.fleteNombre = flete.nombre; | 258 | $scope.notaPedido.fleteNombre = flete.nombre; |
251 | $scope.notaPedido.costoUnitarioKmFlete = flete.costoKilometro; | 259 | $scope.notaPedido.fleteId = flete.id; |
252 | $scope.choferes = flete.chofer; | 260 | $scope.choferes = flete.chofer; |
253 | $scope.vehiculos = flete.vehiculo; | 261 | $scope.vehiculos = flete.vehiculo; |
254 | }, function() { | 262 | }, function() { |
255 | 263 | ||
256 | } | 264 | } |
257 | ); | 265 | ); |
258 | } | 266 | } |
259 | }; | 267 | }; |
260 | $scope.agregarATabla = function(key) { | 268 | $scope.agregarATabla = function(key) { |
261 | if(key === 13) { | 269 | if(key === 13) { |
270 | if($scope.articuloACargar.cantidad === undefined || | ||
271 | $scope.articuloACargar.cantidad === 0 || | ||
272 | $scope.articuloACargar.cantidad === null ){ | ||
273 | focaModalService.alert('El valor debe ser al menos 1'); | ||
274 | return; | ||
275 | } | ||
262 | $scope.articulosTabla.unshift($scope.articuloACargar); | 276 | $scope.articulosTabla.unshift($scope.articuloACargar); |
263 | $scope.articuloACargar = undefined; | 277 | $scope.cargando = true; |
264 | } | 278 | } |
265 | }; | 279 | }; |
266 | $scope.quitarArticulo = function(key) { | 280 | $scope.quitarArticulo = function(key) { |
267 | $scope.articulosTabla.splice(key, 1); | 281 | $scope.articulosTabla.splice(key, 1); |
268 | }; | 282 | }; |
269 | $scope.editarArticulo = function(key) { | 283 | $scope.editarArticulo = function(key, articulo) { |
270 | if(key === 13) { | 284 | if(key === 13) { |
271 | $scope.edit = false; | 285 | if(articulo.cantidad === null || articulo.cantidad === 0 || |
272 | } | 286 | articulo.cantidad === undefined){ |
287 | focaModalService.alert('El valor debe ser al menos 1'); | ||
288 | return; | ||
289 | } | ||
290 | articulo.edit = false; | ||
291 | } | ||
273 | }; | 292 | }; |
274 | $scope.cambioEdit = function() { | 293 | $scope.cambioEdit = function(articulo) { |
275 | $scope.edit = !$scope.edit ? true : false; | 294 | articulo.edit = true; |
276 | }; | 295 | }; |
277 | $scope.limpiarFlete = function() { | 296 | $scope.limpiarFlete = function() { |
278 | $scope.notaPedido.fleteNombre = ''; | 297 | $scope.notaPedido.fleteNombre = ''; |
279 | $scope.notaPedido.chofer = ''; | 298 | $scope.notaPedido.chofer = ''; |
280 | $scope.notaPedido.vehiculo = ''; | 299 | $scope.notaPedido.vehiculo = ''; |
281 | $scope.notaPedido.kilometros = ''; | 300 | $scope.notaPedido.kilometros = ''; |
282 | $scope.notaPedido.costoUnitarioKmFlete = ''; | 301 | $scope.notaPedido.costoUnitarioKmFlete = ''; |
283 | }; | 302 | }; |
284 | $scope.crearPedidoDemo = function() { | 303 | $scope.crearPedidoDemo = function() { |
285 | focaModalService.alert('Pedido Creado'); | 304 | focaModalService.alert('Pedido Creado'); |
286 | $scope.notaPedido.precioCondicion = ''; | 305 | $scope.notaPedido.precioCondicion = ''; |
287 | $scope.articulosTabla = []; | 306 | $scope.articulosTabla = []; |
288 | $scope.notaPedido.fleteNombre = ''; | 307 | $scope.notaPedido.fleteNombre = ''; |
289 | $scope.notaPedido.chofer = ''; | 308 | $scope.notaPedido.chofer = ''; |
290 | $scope.notaPedido.vehiculo = ''; | 309 | $scope.notaPedido.vehiculo = ''; |
291 | $scope.notaPedido.kilometros = ''; | 310 | $scope.notaPedido.kilometros = ''; |
292 | $scope.notaPedido.costoUnitarioKmFlete = ''; | 311 | $scope.notaPedido.costoUnitarioKmFlete = ''; |
293 | $scope.notaPedido.vendedor.nombre = ''; | 312 | $scope.notaPedido.vendedor.nombre = ''; |
294 | $scope.notaPedido.cliente.nombre = ''; | 313 | $scope.notaPedido.cliente.nombre = ''; |
295 | $scope.domicilio.dom = ''; | 314 | $scope.domicilio.dom = ''; |
296 | $scope.notaPedido.flete = 0; | 315 | $scope.notaPedido.flete = 0; |
297 | }; | 316 | }; |
317 | $scope.resetFilter = function() { | ||
318 | $scope.articuloACargar = {}; | ||
319 | $scope.cargando = true; | ||
320 | }; | ||
298 | } | 321 | } |
299 | ] | 322 | ] |
300 | ) | 323 | ) |
301 | .controller('notaPedidoListaCtrl', [ | 324 | .controller('notaPedidoListaCtrl', [ |
302 | '$scope', | 325 | '$scope', |
303 | 'crearNotaPedidoService', | 326 | 'crearNotaPedidoService', |
304 | '$location', | 327 | '$location', |
305 | function($scope, crearNotaPedidoService, $location) { | 328 | function($scope, crearNotaPedidoService, $location) { |
306 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 329 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
307 | $scope.notaPedidos = datos.data; | 330 | $scope.notaPedidos = datos.data; |
308 | }); | 331 | }); |
309 | $scope.editar = function(notaPedido) { | 332 | $scope.editar = function(notaPedido) { |
310 | crearNotaPedidoService.setNotaPedido(notaPedido); | 333 | crearNotaPedidoService.setNotaPedido(notaPedido); |
311 | $location.path('/venta-nota-pedido/abm/'); | 334 | $location.path('/venta-nota-pedido/abm/'); |
312 | }; | 335 | }; |
313 | $scope.crearPedido = function() { | 336 | $scope.crearPedido = function() { |
314 | crearNotaPedidoService.clearNotaPedido(); | 337 | crearNotaPedidoService.clearNotaPedido(); |
315 | $location.path('/venta-nota-pedido/abm/'); | 338 | $location.path('/venta-nota-pedido/abm/'); |
316 | }; | 339 | }; |
317 | } | 340 | } |
318 | ]) | 341 | ]) |
319 | .controller('focaCrearNotaPedidoFichaClienteController', [ | 342 | .controller('focaCrearNotaPedidoFichaClienteController', [ |
320 | '$scope', | 343 | '$scope', |
321 | 'crearNotaPedidoService', | 344 | 'crearNotaPedidoService', |
322 | '$location', | 345 | '$location', |
323 | function($scope, crearNotaPedidoService, $location) { | 346 | function($scope, crearNotaPedidoService, $location) { |
324 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | 347 | crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { |
325 | $scope.notaPedidos = datos.data; | 348 | $scope.notaPedidos = datos.data; |
326 | }); | 349 | }); |
327 | $scope.editar = function(notaPedido) { | 350 | $scope.editar = function(notaPedido) { |
328 | crearNotaPedidoService.setNotaPedido(notaPedido); | 351 | crearNotaPedidoService.setNotaPedido(notaPedido); |
329 | $location.path('/venta-nota-pedido/abm/'); | 352 | $location.path('/venta-nota-pedido/abm/'); |
330 | }; | 353 | }; |
src/js/service.js
1 | angular.module('focaCrearNotaPedido') | 1 | angular.module('focaCrearNotaPedido') |
2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
3 | var route = API_ENDPOINT.URL; | 3 | var route = API_ENDPOINT.URL; |
4 | return { | 4 | return { |
5 | crearNotaPedido: function(notaPedido) { | 5 | crearNotaPedido: function(notaPedido) { |
6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); | 6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); |
7 | }, | 7 | }, |
8 | obtenerNotaPedido: function() { | 8 | obtenerNotaPedido: function() { |
9 | return $http.get(route +'/nota-pedido'); | 9 | return $http.get(route +'/nota-pedido'); |
10 | }, | 10 | }, |
11 | setNotaPedido: function(notaPedido) { | 11 | setNotaPedido: function(notaPedido) { |
12 | this.notaPedido = notaPedido; | 12 | this.notaPedido = notaPedido; |
13 | }, | 13 | }, |
14 | clearNotaPedido: function() { | 14 | clearNotaPedido: function() { |
15 | this.notaPedido = undefined; | 15 | this.notaPedido = undefined; |
16 | }, | 16 | }, |
17 | getNotaPedido: function() { | 17 | getNotaPedido: function() { |
18 | return this.notaPedido; | 18 | return this.notaPedido; |
19 | }, | 19 | }, |
20 | getArticulosByIdNotaPedido: function(id) { | 20 | getArticulosByIdNotaPedido: function(id) { |
21 | return $http.get(route+'/articulos/nota-pedido/'+id); | 21 | return $http.get(route+'/articulos/nota-pedido/'+id); |
22 | }, | 22 | }, |
23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { | 23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { |
24 | return $http.post(route + '/articulos/nota-pedido', | 24 | return $http.post(route + '/articulos/nota-pedido', |
25 | {articuloNotaPedido: articuloNotaPedido}); | 25 | {articuloNotaPedido: articuloNotaPedido}); |
26 | }, | 26 | }, |
27 | getDomiciliosByIdNotaPedido: function(id) { | 27 | getDomiciliosByIdNotaPedido: function(id) { |
28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
29 | }, | 29 | }, |
30 | //EN DESARROLLO | 30 | //EN DESARROLLO |
31 | getDomicilios: function(id) { | 31 | getDomicilios: function(id) { |
32 | // return $http.get(route + '/'+id) | 32 | // return $http.get(route + '/'+id) |
33 | id='le asigno un valor para pasar pre commit'; | 33 | id='le asigno un valor para pasar pre commit'; |
34 | var domicilio = [ | 34 | var domicilio = [ |
35 | { | 35 | { |
36 | id: 1, | 36 | id: 1, |
37 | dom: 'RISSO PATRON 781' | 37 | dom: 'RISSO PATRON 781' |
38 | }, | 38 | }, |
39 | { | 39 | { |
40 | id: 2, | 40 | id: 2, |
41 | dom: 'MARIANO MORENO 533' | 41 | dom: 'MARIANO MORENO 533' |
42 | }, | 42 | }, |
43 | { | 43 | { |
44 | id: 3, | 44 | id: 3, |
45 | dom: 'SALTA 796' | 45 | dom: 'SALTA 796' |
46 | } | 46 | } |
47 | ]; | 47 | ]; |
48 | return domicilio; | 48 | return domicilio; |
49 | }, | 49 | }, |
50 | getPrecioCondicion: function() { | 50 | getPrecioCondicion: function() { |
51 | return $http.get(route + '/precio-condicion'); | 51 | return $http.get(route + '/precio-condicion'); |
52 | }, | 52 | }, |
53 | getPrecioCondicionById: function(id) { | 53 | getPrecioCondicionById: function(id) { |
54 | return $http.get(route + '/precio-condicion/' + id); | 54 | return $http.get(route + '/precio-condicion/' + id); |
55 | }, | 55 | }, |
56 | getPlazoPagoByPrecioCondicion: function(id) { | 56 | getPlazoPagoByPrecioCondicion: function(id) { |
57 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 57 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
58 | }, | ||
59 | crearFlete: function(flete) { | ||
60 | return $http.post(route + '/flete', {flete : flete}); | ||
58 | } | 61 | } |
59 | }; | 62 | }; |
60 | }]); | 63 | }]); |
61 | 64 |
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="seleccionarCliente()" | 49 | ng-click="seleccionarCliente()" |
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 | ng-model="domicilio.dom" | 62 | ng-model="domicilio" |
63 | ng-click="abrirModalDomicilio()" | ||
64 | placeholder="Seleccione Domicilio" | 63 | placeholder="Seleccione Domicilio" |
65 | uib-typeahead=" | ||
66 | domi.dom | ||
67 | for domi | ||
68 | in domiciliosCliente | ||
69 | " | ||
70 | typeahead-min-length="0" | 64 | typeahead-min-length="0" |
65 | uib-typeahead="domi as domi.dom for domi in domiciliosCliente" | ||
71 | > | 66 | > |
72 | </div> | 67 | </div> |
73 | <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"> |
74 | <input | 69 | <input |
75 | class="form-control selectable" | 70 | class="form-control selectable" |
76 | type="text" | 71 | type="text" |
77 | readonly="true" | 72 | readonly="true" |
78 | ng-model="notaPedido.precioCondicion" | 73 | ng-model="notaPedido.precioCondicion" |
79 | ng-click="abrirModalListaPrecio()" | 74 | ng-click="abrirModalListaPrecio()" |
80 | placeholder="Seleccione Lista de precio" | 75 | placeholder="Seleccione Lista de precio" |
81 | > | 76 | > |
82 | </div> | 77 | </div> |
83 | <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"> |
84 | <label>Bomba</label> | 79 | <label>Bomba</label> |
85 | <div class="form-check custom-radio custom-control-inline"> | 80 | <div class="form-check custom-radio custom-control-inline"> |
86 | <input | 81 | <input |
87 | class="form-check-input" | 82 | class="form-check-input" |
88 | type="radio" | 83 | type="radio" |
89 | name="radioBomba" | 84 | name="radioBomba" |
90 | value="1" | 85 | value="1" |
91 | ng-model="notaPedido.bomba"> | 86 | ng-model="notaPedido.bomba"> |
92 | <label class="form-check-label">Si</label> | 87 | <label class="form-check-label">Si</label> |
93 | </div> | 88 | </div> |
94 | <div class="form-check custom-radio custom-control-inline"> | 89 | <div class="form-check custom-radio custom-control-inline"> |
95 | <input | 90 | <input |
96 | class="form-check-input" | 91 | class="form-check-input" |
97 | type="radio" | 92 | type="radio" |
98 | name="radioBomba" | 93 | name="radioBomba" |
99 | value="0" | 94 | value="0" |
100 | ng-model="notaPedido.bomba"> | 95 | ng-model="notaPedido.bomba"> |
101 | <label class="form-check-label">No</label> | 96 | <label class="form-check-label">No</label> |
102 | </div> | 97 | </div> |
103 | </div> | 98 | </div> |
104 | <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"> |
105 | <label>Flete</label> | 100 | <label>Flete</label> |
106 | <div class="form-check custom-radio custom-control-inline"> | 101 | <div class="form-check custom-radio custom-control-inline"> |
107 | <input | 102 | <input |
108 | ng-change="limpiarFlete()" | 103 | ng-change="limpiarFlete()" |
109 | class="form-check-input" | 104 | class="form-check-input" |
110 | type="radio" | 105 | type="radio" |
111 | name="radioFlete" | 106 | name="radioFlete" |
112 | value="1" | 107 | value="1" |
113 | ng-model="notaPedido.flete"> | 108 | ng-model="notaPedido.flete"> |
114 | <label class="form-check-label">Si</label> | 109 | <label class="form-check-label">Si</label> |
115 | </div> | 110 | </div> |
116 | <div class="form-check custom-radio custom-control-inline"> | 111 | <div class="form-check custom-radio custom-control-inline"> |
117 | <input | 112 | <input |
118 | class="form-check-input" | 113 | class="form-check-input" |
119 | type="radio" | 114 | type="radio" |
120 | name="radioFlete" | 115 | name="radioFlete" |
121 | value="0" | 116 | value="0" |
122 | ng-model="notaPedido.flete"> | 117 | ng-model="notaPedido.flete"> |
123 | <label class="form-check-label">No</label> | 118 | <label class="form-check-label">No</label> |
124 | </div> | 119 | </div> |
125 | </div> | 120 | </div> |
126 | <div class="form-group col-12 col-sm-6 col-md-4"> | 121 | <div class="form-group col-12 col-sm-6 col-md-4"> |
127 | <input | 122 | <input |
128 | class="form-control selectable" | 123 | class="form-control selectable" |
129 | type="text" | 124 | type="text" |
130 | readonly="true" | 125 | readonly="true" |
131 | ng-show="notaPedido.flete == 1" | 126 | ng-show="notaPedido.flete == 1" |
132 | ng-model="notaPedido.fleteNombre" | 127 | ng-model="notaPedido.fleteNombre" |
133 | ng-click="abrirModalFlete()" | 128 | ng-click="abrirModalFlete()" |
134 | placeholder="Seleccione Flete" | 129 | placeholder="Seleccione Flete" |
135 | > | 130 | > |
136 | </div> | 131 | </div> |
137 | <div class="form-group col-12 col-sm-6 col-md-4"> | 132 | <div class="form-group col-12 col-sm-6 col-md-4"> |
138 | <input | 133 | <input |
139 | class="form-control selectable" | 134 | class="form-control selectable" |
140 | type="text" | 135 | type="text" |
141 | ng-show="notaPedido.flete == 1" | 136 | ng-show="notaPedido.flete == 1" |
142 | ng-model="notaPedido.chofer" | 137 | ng-model="notaPedido.chofer" |
143 | placeholder="Seleccione Chofer" | 138 | placeholder="Seleccione Chofer" |
144 | uib-typeahead="chofer.nombre for chofer in choferes" | 139 | uib-typeahead="chofer as chofer.nombre for chofer in choferes" |
145 | typeahead-min-length="0" | 140 | typeahead-min-length="0" |
146 | > | 141 | > |
147 | </div> | 142 | </div> |
148 | <div class="form-group col-12 col-sm-6 col-md-4"> | 143 | <div class="form-group col-12 col-sm-6 col-md-4"> |
149 | <input | 144 | <input |
150 | class="form-control selectable" | 145 | class="form-control selectable" |
151 | type="text" | 146 | type="text" |
152 | ng-show="notaPedido.flete == 1" | 147 | ng-show="notaPedido.flete == 1" |
153 | ng-model="notaPedido.vehiculo" | 148 | ng-model="notaPedido.vehiculo" |
154 | placeholder="Seleccione Vehículo" | 149 | placeholder="Seleccione Vehículo" |
155 | uib-typeahead="vehiculo.tractor for vehiculo in vehiculos" | 150 | uib-typeahead="vehiculo as vehiculo.tractor for vehiculo in vehiculos" |
156 | typeahead-min-length="0" | 151 | typeahead-min-length="0" |
157 | > | 152 | > |
158 | </div> | 153 | </div> |
159 | <div class="form-group col-12 col-sm-6 col-md-4"> | 154 | <div class="form-group col-12 col-sm-6 col-md-4"> |
160 | <input | 155 | <input |
161 | class="form-control selectable" | 156 | class="form-control selectable" |
162 | type="number" | 157 | type="number" |
163 | step="0.01" | 158 | step="0.01" |
164 | ng-show="notaPedido.flete == 1" | 159 | ng-show="notaPedido.flete == 1" |
165 | ng-model="notaPedido.costoUnitarioKmFlete" | 160 | ng-model="notaPedido.costoUnitarioKmFlete" |
166 | placeholder="Costo por kilómetro" | 161 | placeholder="Costo por kilómetro" |
167 | > | 162 | > |
168 | </div> | 163 | </div> |
169 | <div class="form-group col-12 col-sm-6 col-md-4"> | 164 | <div class="form-group col-12 col-sm-6 col-md-4"> |
170 | <input | 165 | <input |
171 | class="form-control selectable" | 166 | class="form-control selectable" |
172 | type="number" | 167 | type="number" |
173 | step="0.1" | 168 | step="0.1" |
174 | ng-show="notaPedido.flete == 1" | 169 | ng-show="notaPedido.flete == 1" |
175 | ng-model="notaPedido.kilometros" | 170 | ng-model="notaPedido.kilometros" |
176 | placeholder="Kilómetros recorridos" | 171 | placeholder="Kilómetros recorridos" |
177 | > | 172 | > |
178 | </div> | 173 | </div> |
179 | </div> | 174 | </div> |
180 | </div> | 175 | </div> |
181 | <div class="col-auto my-2"> | 176 | <div class="col-auto my-2"> |
182 | <button ng-click="crearPedidoDemo()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> | 177 | <button |
178 | ng-click="crearNotaPedido()" | ||
179 | type="button" | ||
180 | title="Crear nota pedido" | ||
181 | class="btn btn-primary float-right"> | ||
182 | Guardar | ||
183 | </button> | ||
183 | </div> | 184 | </div> |
184 | </div> | 185 | </div> |
185 | <div class="row"> | 186 | <div class="row"> |
186 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 187 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
187 | <div class="row"> | 188 | <div class="row"> |
188 | </div> | 189 | </div> |
189 | <div class="row"> | 190 | <div class="row"> |
190 | <table class="table table-striped table-sm"> | 191 | <table class="table table-striped table-sm"> |
191 | <thead> | 192 | <thead> |
192 | <tr> | 193 | <tr> |
193 | <th>Sector</th> | 194 | <th>Sector</th> |
194 | <th>Código</th> | 195 | <th>Código</th> |
195 | <th>Descripción</th> | 196 | <th>Descripción</th> |
196 | <th>Precio Unitario</th> | 197 | <th>Precio Unitario</th> |
197 | <th>Cantidad</th> | 198 | <th>Cantidad</th> |
198 | <th>SubTotal</th> | 199 | <th>SubTotal</th> |
199 | <th> | 200 | <th> |
200 | <button class="btn btn-outline-secondary selectable" style="float: right;" ng-click="show = !show; masMenos()" > | 201 | <button class="btn btn-outline-secondary selectable" style="float: right;" ng-click="show = !show; masMenos()" > |
201 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> | 202 | <i class="fa fa-chevron-down" ng-hide="show" aria-hidden="true"></i> |
202 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> | 203 | <i class="fa fa-chevron-up" ng-show="show" aria-hidden="true"></i> |
203 | </button> | 204 | </button> |
204 | </th> | 205 | </th> |
205 | </tr> | 206 | </tr> |
206 | </thead> | 207 | </thead> |
207 | <tbody> | 208 | <tbody> |
208 | <tr ng-show="!articuloACargar"> | 209 | <tr ng-show="cargando"> |
209 | <td colspan="2"><input placeholder="Seleccione Articulo" class="form-control" readonly ng-click="seleccionarArticulo()"></td> | 210 | <td colspan="2"><input |
211 | placeholder="Seleccione Articulo" | ||
212 | class="form-control" | ||
213 | readonly | ||
214 | ng-click="seleccionarArticulo()"></td> | ||
210 | <td></td> | 215 | <td></td> |
211 | <td></td> | 216 | <td></td> |
212 | <td></td> | 217 | <td></td> |
213 | <td></td> | 218 | <td></td> |
214 | <td></td> | 219 | <td></td> |
215 | </tr> | 220 | </tr> |
216 | <tr ng-show="articuloACargar"> | 221 | <tr ng-show="!cargando"> |
217 | <td><input | 222 | <td><input |
218 | class="form-control" | 223 | class="form-control" |
219 | ng-model="articuloACargar.sector" | 224 | ng-model="articuloACargar.sector" |
220 | readonly></td> | 225 | readonly></td> |
221 | <td><input | 226 | <td><input |
222 | class="form-control" | 227 | class="form-control" |
223 | ng-model="articuloACargar.codigo" | 228 | ng-model="articuloACargar.codigo" |
224 | readonly></td> | 229 | readonly></td> |
225 | <td><input | 230 | <td><input |
226 | class="form-control" | 231 | class="form-control" |
227 | ng-model="articuloACargar.descripcion" | 232 | ng-model="articuloACargar.descripcion" |
228 | readonly></td> | 233 | readonly></td> |
229 | <td><input | 234 | <td><input |
230 | class="form-control" | 235 | class="form-control" |
231 | ng-value="articuloACargar.precio | currency:'$'" | 236 | ng-value="articuloACargar.precio | currency:'$'" |
232 | readonly></td> | 237 | readonly></td> |
233 | <td><input | 238 | <td><input |
234 | class="form-control" | 239 | class="form-control" |
235 | type="number" | 240 | type="number" |
236 | min="1" | 241 | min="1" |
237 | value="1" | ||
238 | ng-model="articuloACargar.cantidad" | 242 | ng-model="articuloACargar.cantidad" |
239 | foca-focus="articuloACargar.cantidad == 1" | 243 | foca-focus="!cargando" |
244 | esc-key="resetFilter()" | ||
240 | ng-keypress="agregarATabla($event.keyCode)"></td> | 245 | ng-keypress="agregarATabla($event.keyCode)"></td> |
241 | <td><input | 246 | <td><input |
242 | class="form-control" | 247 | class="form-control" |
243 | ng-value="getSubTotal() | currency:'$'" | 248 | ng-value="getSubTotal() | currency:'$'" |
244 | readonly></td> | 249 | readonly></td> |
245 | <td class="text-center"><button | 250 | <td class="text-center"><button |
246 | class="btn btn-outline-secondary btn-sm" | 251 | class="btn btn-outline-secondary btn-sm" |
247 | ng-click="agregarATabla(13)"> | 252 | ng-click="agregarATabla(13)"> |
248 | <i class="fa fa-save"></i> | 253 | <i class="fa fa-save"></i> |
249 | </button></td> | 254 | </button></td> |
250 | </tr> | 255 | </tr> |
251 | <tr ng-repeat="(key, articulo) in articulosTabla" ng-show="show || key == 0"> | 256 | <tr ng-repeat="(key, articulo) in articulosTabla" ng-show="show || key == 0"> |
252 | <td ng-bind="articulo.sector"></td> | 257 | <td ng-bind="articulo.sector"></td> |
253 | <td ng-bind="articulo.codigo"></td> | 258 | <td ng-bind="articulo.codigo"></td> |
254 | <td ng-bind="articulo.descripcion"></td> | 259 | <td ng-bind="articulo.descripcion"></td> |
255 | <td ng-bind="articulo.precio | currency:'$'"></td> | 260 | <td ng-bind="articulo.precio | currency:'$'"></td> |
256 | <td><input | 261 | <td><input |
257 | ng-show="edit" | 262 | ng-show="articulo.edit" |
258 | ng-model="articulo.cantidad" | 263 | ng-model="articulo.cantidad" |
259 | class="form-control" | 264 | class="form-control" |
260 | type="number" | 265 | type="number" |
261 | min="1" | 266 | min="1" |
262 | value="1" | 267 | foca-focus="articulo.edit" |
263 | foca-focus="edit" | 268 | ng-keypress="editarArticulo($event.keyCode, articulo)"> |
264 | ng-keypress="editarArticulo($event.keyCode)"> | 269 | <i |
265 | <i class="selectable" ng-click="cambioEdit()" ng-hide="edit" ng-bind="articulo.cantidad"></i> | 270 | class="selectable" |
271 | ng-click="cambioEdit(articulo)" | ||
272 | ng-hide="articulo.edit" | ||
273 | ng-bind="articulo.cantidad"> | ||
274 | </i> | ||
266 | </td> | 275 | </td> |
267 | <td ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"></td> | 276 | <td ng-bind="(articulo.precio * articulo.cantidad) | currency: '$'"></td> |
268 | <td class="text-center"> | 277 | <td class="text-center"> |
269 | <button class="btn btn-outline-secondary btn-sm" ng-click="quitarArticulo(key)"> | 278 | <button class="btn btn-outline-secondary btn-sm" ng-click="quitarArticulo(key)"> |
270 | <i class="fa fa-trash"></i> | 279 | <i class="fa fa-trash"></i> |
271 | </button> | 280 | </button> |
272 | </td> | 281 | </td> |
273 | </tr> | 282 | </tr> |
274 | </tbody> | 283 | </tbody> |
275 | <tfoot> | 284 | <tfoot> |
276 | <tr class="table-secondary"> | 285 | <tr class="table-secondary"> |
277 | <td colspan="5"><b>Cantidad Items:</b> <a ng-bind="articulosTabla.length"></a> </td> | 286 | <td colspan="5"><b>Cantidad Items:</b> <a ng-bind="articulosTabla.length"></a> </td> |
278 | <td colspan="3">{{getTotal() | currency:'$'}}</td> | 287 | <td colspan="3">{{getTotal() | currency:'$'}}</td> |
279 | </tr> | 288 | </tr> |
280 | </tfoot> | 289 | </tfoot> |
281 | </table> | 290 | </table> |
282 | </div> | 291 | </div> |
283 | </div> | 292 | </div> |
284 | </div> | 293 | </div> |
285 | 294 | ||
286 | <!-- | 295 | <!-- |
287 | <form name="formCrearNota"> | 296 | <form name="formCrearNota"> |
288 | <uib-tabset active="active"> | 297 | <uib-tabset active="active"> |
289 | <uib-tab index="0" heading="General"> | 298 | <uib-tab index="0" heading="General"> |
290 | <input type="hidden" name="id" ng-model="notaPedido.id" /> | 299 | <input type="hidden" name="id" ng-model="notaPedido.id" /> |
291 | <div> | 300 | <div> |
292 | <div class="col-auto my-2"> | 301 | <div class="col-auto my-2"> |
293 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> | 302 | <button type="submit" title="Siguiente" class="btn btn-primary float-right">Siguiente</button> |
294 | </div> | 303 | </div> |
295 | </div> | 304 | </div> |
296 | <br> | 305 | <br> |
297 | <br> | 306 | <br> |
298 | <div class="row"> | 307 | <div class="row"> |
299 | <div class="col-md-2"> | 308 | <div class="col-md-2"> |
300 | <div class="col-auto"> | 309 | <div class="col-auto"> |
301 | <label>Fecha de carga</label> | 310 | <label>Fecha de carga</label> |
302 | </div> | 311 | </div> |
303 | </div> | 312 | </div> |
304 | <div class="col-md-3"> | 313 | <div class="col-md-3"> |
305 | <div class="col-auto"> | 314 | <div class="col-auto"> |
306 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> | 315 | <input type="date" class="form-control" ng-model="notaPedido.fechaCarga" ng-required="true"> |
307 | </div> | 316 | </div> |
308 | </div> | 317 | </div> |
309 | <div class="col-md-2"> | 318 | <div class="col-md-2"> |
310 | <div class="col-auto"> | 319 | <div class="col-auto"> |
311 | <label>Kilómetros</label> | 320 | <label>Kilómetros</label> |
312 | </div> | 321 | </div> |
313 | </div> | 322 | </div> |
314 | <div class="col-md-3"> | 323 | <div class="col-md-3"> |
315 | <div class="col-auto"> | 324 | <div class="col-auto"> |
316 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" | 325 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Kilómetros recorridos para la entrega en el cliente" |
317 | ng-model="notaPedido.kilometros" ng-required="true"> | 326 | ng-model="notaPedido.kilometros" ng-required="true"> |
318 | </div> | 327 | </div> |
319 | </div> | 328 | </div> |
320 | </div> | 329 | </div> |
321 | <div class="row my-3"> | 330 | <div class="row my-3"> |
322 | <div class="col-md-2"> | 331 | <div class="col-md-2"> |
323 | <div class="col-auto"> | 332 | <div class="col-auto"> |
324 | <label>Jurisdicción de IIBB</label> | 333 | <label>Jurisdicción de IIBB</label> |
325 | </div> | 334 | </div> |
326 | </div> | 335 | </div> |
327 | <div class="col-md-3"> | 336 | <div class="col-md-3"> |
328 | <div class="col-auto"> | 337 | <div class="col-auto"> |
329 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" | 338 | <input type="text" class="form-control" placeholder="Jurisdicción de IIBB donde se realiza la entrega" |
330 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> | 339 | ng-model="notaPedido.jurisdiccionIIBB" ng-required="true"> |
331 | </div> | 340 | </div> |
332 | </div> | 341 | </div> |
333 | <div class="col-md-2"> | 342 | <div class="col-md-2"> |
334 | <div class="col-auto"> | 343 | <div class="col-auto"> |
335 | <label>Costo de financiación</label> | 344 | <label>Costo de financiación</label> |
336 | </div> | 345 | </div> |
337 | </div> | 346 | </div> |
338 | <div class="col-md-3"> | 347 | <div class="col-md-3"> |
339 | <div class="col-auto"> | 348 | <div class="col-auto"> |
340 | <div class="input-group mb-2"> | 349 | <div class="input-group mb-2"> |
341 | <div class="input-group-prepend"> | 350 | <div class="input-group-prepend"> |
342 | <div class="input-group-text">$</div> | 351 | <div class="input-group-text">$</div> |
343 | </div> | 352 | </div> |
344 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" | 353 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo de financiación" |
345 | ng-model="notaPedido.costoFinanciacion"> | 354 | ng-model="notaPedido.costoFinanciacion"> |
346 | </div> | 355 | </div> |
347 | </div> | 356 | </div> |
348 | </div> | 357 | </div> |
349 | </div> | 358 | </div> |
350 | <div class="row"> | 359 | <div class="row"> |
351 | <div class="col-md-2"> | 360 | <div class="col-md-2"> |
352 | <div class="col-auto"> | 361 | <div class="col-auto"> |
353 | <label>Bomba</label> | 362 | <label>Bomba</label> |
354 | </div> | 363 | </div> |
355 | </div> | 364 | </div> |
356 | <div class="col-md-1"> | 365 | <div class="col-md-1"> |
357 | <div class="col-auto"> | 366 | <div class="col-auto"> |
358 | <div class="form-check custom-radio custom-control-inline"> | 367 | <div class="form-check custom-radio custom-control-inline"> |
359 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> | 368 | <input class="form-check-input" type="radio" name="radioBomba" value="1" ng-model="notaPedido.bomba"> |
360 | <label class="form-check-label"> | 369 | <label class="form-check-label"> |
361 | Si | 370 | Si |
362 | </label> | 371 | </label> |
363 | </div> | 372 | </div> |
364 | <div class="form-check custom-radio custom-control-inline"> | 373 | <div class="form-check custom-radio custom-control-inline"> |
365 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> | 374 | <input class="form-check-input" type="radio" name="radioBomba" value="0" ng-model="notaPedido.bomba"> |
366 | <label class="form-check-label"> | 375 | <label class="form-check-label"> |
367 | No | 376 | No |
368 | </label> | 377 | </label> |
369 | </div> | 378 | </div> |
370 | </div> | 379 | </div> |
371 | </div> | 380 | </div> |
372 | <div class="col-md-1"> | 381 | <div class="col-md-1"> |
373 | <div class="col-auto"> | 382 | <div class="col-auto"> |
374 | <label>Flete</label> | 383 | <label>Flete</label> |
375 | </div> | 384 | </div> |
376 | </div> | 385 | </div> |
377 | <div class="col-md-1"> | 386 | <div class="col-md-1"> |
378 | <div class="col-auto"> | 387 | <div class="col-auto"> |
379 | <div class="form-check custom-radio custom-control-inline"> | 388 | <div class="form-check custom-radio custom-control-inline"> |
380 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> | 389 | <input class="form-check-input" type="radio" name="radioFlete" value="1" ng-model="notaPedido.flete"> |
381 | <label class="form-check-label"> | 390 | <label class="form-check-label"> |
382 | Si | 391 | Si |
383 | </label> | 392 | </label> |
384 | </div> | 393 | </div> |
385 | <div class="form-check custom-radio custom-control-inline"> | 394 | <div class="form-check custom-radio custom-control-inline"> |
386 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> | 395 | <input class="form-check-input" type="radio" name="radioFlete" value="0" ng-model="notaPedido.flete"> |
387 | <label class="form-check-label"> | 396 | <label class="form-check-label"> |
388 | FOB | 397 | FOB |
389 | </label> | 398 | </label> |
390 | </div> | 399 | </div> |
391 | </div> | 400 | </div> |
392 | </div> | 401 | </div> |
393 | <div class="col-md-2"> | 402 | <div class="col-md-2"> |
394 | <div class="col-auto"> | 403 | <div class="col-auto"> |
395 | <label>Costo unitario kilometro flete</label> | 404 | <label>Costo unitario kilometro flete</label> |
396 | </div> | 405 | </div> |
397 | </div> | 406 | </div> |
398 | <div class="col-md-3"> | 407 | <div class="col-md-3"> |
399 | <div class="col-auto"> | 408 | <div class="col-auto"> |
400 | <div class="input-group mb-2"> | 409 | <div class="input-group mb-2"> |
401 | <div class="input-group-prepend"> | 410 | <div class="input-group-prepend"> |
402 | <div class="input-group-text">$</div> | 411 | <div class="input-group-text">$</div> |
403 | </div> | 412 | </div> |
404 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" | 413 | <input type="number" min="0" step="0.01" class="form-control" placeholder="Costo unitario del kilometro del flete" |
405 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> | 414 | ng-model="notaPedido.costoUnitarioKmFlete" ng-required="true"> |
406 | </div> | 415 | </div> |
407 | </div> | 416 | </div> |
408 | </div> | 417 | </div> |
409 | </div> | 418 | </div> |
410 | <div class="row my-3"> | 419 | <div class="row my-3"> |
411 | <div class="col-md-2"> | 420 | <div class="col-md-2"> |
412 | <div class="col-auto"> | 421 | <div class="col-auto"> |
413 | <label>Vendedor</label> | 422 | <label>Vendedor</label> |
414 | </div> | 423 | </div> |
415 | </div> | 424 | </div> |
416 | <div class="col-md-3"> | 425 | <div class="col-md-3"> |
417 | <div class="col-auto"> | 426 | <div class="col-auto"> |
418 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" | 427 | <input type="text" class="form-control" placeholder="Seleccione vendedor" ng-model="notaPedido.vendedor" |
419 | ng-click="seleccionarVendedor()" readonly> | 428 | ng-click="seleccionarVendedor()" readonly> |
420 | </div> | 429 | </div> |
421 | </div> | 430 | </div> |
422 | <div class="col-md-2"> | 431 | <div class="col-md-2"> |
423 | <div class="col-auto"> | 432 | <div class="col-auto"> |
424 | <label>Petrolera</label> | 433 | <label>Petrolera</label> |
425 | </div> | 434 | </div> |
426 | </div> | 435 | </div> |
427 | <div class="col-md-3"> | 436 | <div class="col-md-3"> |
428 | <div class="col-auto"> | 437 | <div class="col-auto"> |
429 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" | 438 | <input type="text" class="form-control" placeholder="Seleccione petrolera" ng-model="notaPedido.petrolera" |
430 | ng-click="seleccionarPetrolera()" readonly> | 439 | ng-click="seleccionarPetrolera()" readonly> |
431 | </div> | 440 | </div> |
432 | </div> | 441 | </div> |
433 | </div> | 442 | </div> |
434 | </div> | 443 | </div> |
435 | <div class="row"> | 444 | <div class="row"> |
436 | <div class="col-md-2"> | 445 | <div class="col-md-2"> |
437 | <div class="col-auto"> | 446 | <div class="col-auto"> |
438 | <label>Cliente</label> | 447 | <label>Cliente</label> |
439 | </div> | 448 | </div> |
440 | </div> | 449 | </div> |
441 | <div class="col-md-3"> | 450 | <div class="col-md-3"> |
442 | <div class="col-auto"> | 451 | <div class="col-auto"> |
443 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" | 452 | <input type="text" class="form-control" placeholder="Seleccione cliente" ng-model="notaPedido.cliente" |
444 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> | 453 | ng-click="seleccionarCliente()" ng-change="obtenerDomicilios()" readonly> |
445 | </div> | 454 | </div> |
446 | </div> | 455 | </div> |
447 | <div class="col-md-2"> | 456 | <div class="col-md-2"> |
448 | <div class="col-auto"> | 457 | <div class="col-auto"> |
449 | <label>Domicilio</label> | 458 | <label>Domicilio</label> |
450 | </div> | 459 | </div> |
451 | </div> | 460 | </div> |
452 | <div class="col-md-4"> | 461 | <div class="col-md-4"> |
453 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> | 462 | <div class="col-md-12 row" ng-repeat="domicilio in notaPedido.domicilio"> |
454 | <div class="col-auto"> | 463 | <div class="col-auto"> |
455 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" | 464 | <input type="text" ng-model="domicilio.dom" placeholder="Domicilio" uib-typeahead=" |
456 | domi.dom | 465 | domi.dom |
457 | for domi | 466 | for domi |
458 | in domiciliosCliente | 467 | in domiciliosCliente |
459 | " | 468 | " |
460 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" | 469 | typeahead-no-results="sinResultados" typeahead-min-length="0" typeahead-on-select="seleccionar($item)" |
461 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> | 470 | class="form-control mb-2" ng-disabled="domicilio.id > 0" ng-required="true"> |
462 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> | 471 | <i ng-show="cargandoClientes" class="fas fa-sync"></i> |
463 | <div ng-show="sinResultados"> | 472 | <div ng-show="sinResultados"> |
464 | No se encontraron resultados. | 473 | No se encontraron resultados. |
465 | </div> | 474 | </div> |
466 | </div> | 475 | </div> |
467 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> | 476 | <a class="btn" ng-click="removeNewChoice(domicilio)" ng-if="domicilio.id==0">-</a> |
468 | <a class="btn" ng-click="addNewDom()">+</a> | 477 | <a class="btn" ng-click="addNewDom()">+</a> |
469 | </div> | 478 | </div> |
470 | </div> | 479 | </div> |
471 | </div> | 480 | </div> |
472 | </uib-tab> | 481 | </uib-tab> |
473 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> | 482 | <uib-tab index="1" heading="Producto" disable="formCrearNota.$invalid"> |
474 | <div> | 483 | <div> |
475 | <div class="col-auto my-2"> | 484 | <div class="col-auto my-2"> |
476 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> | 485 | <button ng-click="crearNotaPedido()" type="button" title="Crear nota pedido" class="btn btn-primary float-right">Crear</button> |
477 | </div> | 486 | </div> |
478 | </div> | 487 | </div> |
479 | <br> | 488 | <br> |
480 | <br> | 489 | <br> |
481 | <div class="row"> | 490 | <div class="row"> |
482 | <div class="col-md-2"> | 491 | <div class="col-md-2"> |
483 | <div class="col-auto"> | 492 | <div class="col-auto"> |
484 | <label>Precios y condiciones</label> | 493 | <label>Precios y condiciones</label> |
485 | </div> | 494 | </div> |
486 | </div> | 495 | </div> |
487 | <div class="col-md-4"> | 496 | <div class="col-md-4"> |
488 | <div class="col-auto"> | 497 | <div class="col-auto"> |
489 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> | 498 | <select class="form-control" ng-change="cargarArticulos()" ng-model="notaPedido.precioCondicion" ng-options="preCond.id as preCond.nombre for preCond in precioCondiciones"> |
490 | </select> | 499 | </select> |
491 | </div> | 500 | </div> |
492 | </div> | 501 | </div> |
493 | <div class="col-md-2"> | 502 | <div class="col-md-2"> |
494 | <div class="col-auto"> | 503 | <div class="col-auto"> |
495 | <label>Producto</label> | 504 | <label>Producto</label> |
496 | </div> | 505 | </div> |
497 | </div> | 506 | </div> |
498 | <div class="col-md-4"> | 507 | <div class="col-md-4"> |
499 | <div class="col-auto"> | 508 | <div class="col-auto"> |
500 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" | 509 | <input type="text" class="form-control" placeholder="Seleccione producto" ng-model="notaPedido.producto" |
501 | ng-click="seleccionarArticulo()" readonly> | 510 | ng-click="seleccionarArticulo()" readonly> |
502 | </div> | 511 | </div> |
503 | </div> | 512 | </div> |
504 | </div> | 513 | </div> |
505 | <div class="col-md-12"> | 514 | <div class="col-md-12"> |
506 | <table class="table my-3 table-hover table-nonfluid"> | 515 | <table class="table my-3 table-hover table-nonfluid"> |
507 | <thead> | 516 | <thead> |
508 | <tr> | 517 | <tr> |
509 | <th>Código</th> | 518 | <th>Código</th> |
510 | <th>Nombre</th> | 519 | <th>Nombre</th> |
511 | <th>Precio unitario</th> | 520 | <th>Precio unitario</th> |
512 | <th>Costo unitario bruto</th> | 521 | <th>Costo unitario bruto</th> |
513 | <th>Cantidad</th> | 522 | <th>Cantidad</th> |
514 | <th>Subtotal</th> | 523 | <th>Subtotal</th> |
515 | </tr> | 524 | </tr> |
516 | </thead> | 525 | </thead> |
517 | <tbody> | 526 | <tbody> |
518 | <tr ng-repeat="articulo in articulosTabla"> | 527 | <tr ng-repeat="articulo in articulosTabla"> |
519 | <td ng-bind="articulo.codigo"></td> | 528 | <td ng-bind="articulo.codigo"></td> |
520 | <td ng-bind="articulo.nombre"></td> | 529 | <td ng-bind="articulo.nombre"></td> |
521 | <td ng-bind="articulo.precio"></td> | 530 | <td ng-bind="articulo.precio"></td> |
522 | <td ng-bind="articulo.costoUnitario"></td> | 531 | <td ng-bind="articulo.costoUnitario"></td> |
523 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> | 532 | <td><input ng-model="articulo.cantidad" class="form-control" type="number" min="0" value="1"></td> |
524 | <td ng-bind="getSubTotal(articulo.item)"></td> | 533 | <td ng-bind="getSubTotal(articulo.item)"></td> |