Commit ff92a13716511b05effcb1858935405aa1b999f3

Authored by Eric Fernandez
1 parent cc61e65c81
Exists in master

refactor servicios

Showing 1 changed file with 14 additions and 17 deletions   Show diff stats
src/js/controller.js
... ... @@ -214,20 +214,20 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
214 214 var cabeceras = [
215 215 {
216 216 label: 'Moneda:',
217   - valor: notaPedido.cotizacion[0].moneda[0].DETALLE
  217 + valor: notaPedido.cotizacion.moneda.DETALLE
218 218 },
219 219 {
220 220 label: 'Fecha cotizacion:',
221   - valor: $filter('date')(notaPedido.cotizacion[0].FECHA,
  221 + valor: $filter('date')(notaPedido.cotizacion.FECHA,
222 222 'dd/MM/yyyy')
223 223 },
224 224 {
225 225 label: 'Cotizacion:',
226   - valor: notaPedido.cotizacion[0].VENDEDOR
  226 + valor: notaPedido.cotizacion.VENDEDOR
227 227 },
228 228 {
229 229 label: 'Cliente:',
230   - valor: notaPedido.cliente[0].NOM
  230 + valor: notaPedido.cliente.NOM
231 231 },
232 232 {
233 233 label: 'Domicilio:',
... ... @@ -235,16 +235,17 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
235 235 },
236 236 {
237 237 label: 'Vendedor:',
238   - valor: notaPedido.vendedor[0].NomVen
  238 + valor: notaPedido.vendedor.NomVen
239 239 },
240 240 {
241 241 label: 'Proveedor:',
242   - valor: notaPedido.proveedor[0].NOM
  242 + valor: notaPedido.proveedor.NOM
243 243 },
244 244 {
245 245 label: 'Precio condicion:',
246 246 valor: valorPrecioCondicion() + ' ' +
247   - notaPedidoBusinessService.plazoToString(notaPedido.plazoPago)
  247 + notaPedidoBusinessService
  248 + .plazoToString(notaPedido.notaPedidoPlazo)
248 249 },
249 250 {
250 251 label: 'Flete:',
... ... @@ -255,7 +256,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
255 256  
256 257 function valorPrecioCondicion() {
257 258 if(notaPedido.idPrecioCondicion > 0) {
258   - return notaPedido.precioCondicion[0].nombre;
  259 + return notaPedido.precioCondicion.nombre;
259 260 } else {
260 261 return 'Ingreso Manual';
261 262 }
... ... @@ -277,20 +278,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
277 278 }
278 279 $scope.articulosTabla = notaPedido.articulosNotaPedido;
279 280 notaPedidoBusinessService.calcularArticulos($scope.articulosTabla,
280   - notaPedido.cotizacion[0].VENDEDOR);
281   - if(notaPedido.precioCondicion.length > 0) {
282   - $scope.idLista = notaPedido.precioCondicion[0].idListaPrecio;
  281 + notaPedido.cotizacion.VENDEDOR);
  282 + if(notaPedido.idPrecioCondicion > 0) {
  283 + $scope.idLista = notaPedido.precioCondicion.idListaPrecio;
283 284 } else {
284 285 $scope.idLista = -1;
285 286 }
286 287 $scope.comprobante = rellenar(notaPedido.numeroNotaPedido, 8);
287 288 $scope.notaPedido = notaPedido;
288   - $scope.notaPedido.vendedor = notaPedido.vendedor[0];
289   - $scope.notaPedido.cliente = notaPedido.cliente[0];
290   - $scope.notaPedido.proveedor = notaPedido.proveedor[0];
291   - $scope.notaPedido.moneda = notaPedido.cotizacion[0].moneda[0];
292   - $scope.notaPedido.cotizacion = notaPedido.cotizacion[0];
293   - $scope.plazosPagos = notaPedido.plazoPago;
  289 + $scope.notaPedido.moneda = notaPedido.cotizacion.moneda;
  290 + $scope.plazosPagos = notaPedido.notaPedidoPlazo;
294 291 addArrayCabecera(cabeceras);
295 292  
296 293 }, function() {