Commit e93d9a1b525a7d32e32f1286cf00cac1bd7ca522

Authored by Eric
1 parent cf96528377
Exists in master and in 1 other branch develop

importes, pausar

Showing 1 changed file with 32 additions and 12 deletions   Show diff stats
src/js/controller.js
... ... @@ -57,7 +57,11 @@ angular.module('focaCrearRemito') .controller('remitoController',
57 57 $scope.remito.fob = false;
58 58 $scope.remito.bomba = false;
59 59  
60   - $timeout(function() {getLSRemito();});
  60 + $scope.inicial.flete = false;
  61 + $scope.inicial.fob = false;
  62 + $scope.inicial.bomba = false;
  63 +
  64 + $timeout(function() { getLSRemito(); });
61 65 });
62 66 //SETEO BOTONERA LATERAL
63 67 $timeout(function() {
... ... @@ -309,28 +313,28 @@ angular.module('focaCrearRemito') .controller('remitoController',
309 313 observaciones: $scope.remito.observaciones,
310 314 numeroRemito: parseInt($scope.comprobante),
311 315 sucursal: parseInt($scope.puntoVenta),
312   - responsabilidadIvaCliente: 0,//TODO CAMPO IVA CLIENTES
  316 + responsabilidadIvaCliente: $scope.remito.cliente.IVA,
313 317 descuento: 0,//TODO,
314   - importeNeto: 0,//TODO SUMATORIA NETO * CANTIDAD ARTICULOS
315   - importeExento: 0,//TODO SUMATORIA EXENTO * CANTIDAD ARTICULOS
316   - importeIva: 0,//TODO SUMATORIA IVA * CANTIDAD ARTICULOS
  318 + importeNeto: getImporte('netoUnitario'),
  319 + importeExento: getImporte('exentoUnitario'),
  320 + importeIva: getImporte('ivaUnitario'),
317 321 importeIvaServicios: 0,//TODO
318   - importeImpuestoInterno: 0,//SUMA importeImpuestoInterno * CANT ARTICULO
319   - importeImpuestoInterno1: 0,//SUMA importeImpuestoInterno1 * CANT ARTICULO
320   - importeImpuestoInterno2: 0,//SUMA importeImpuestoInterno2 * CANT ARTICULO
  322 + importeImpuestoInterno: getImporte('impuestoInternoUnitario'),
  323 + importeImpuestoInterno1: getImporte('impuestoInterno1Unitario'),
  324 + importeImpuestoInterno2: getImporte('impuestoInterno2Unitario'),
321 325 percepcion: 0,//TODO
322 326 percepcionIva: 0,//TODO
323 327 redondeo: 0,//TODO
324 328 anulado: false,
325   - planilla: 0,//TODO DDMMYYYY
326   - lugar: 0,//SUCURSAL
  329 + planilla: $filter('date')($scope.now, 'ddMMyyyy'),
  330 + lugar: parseInt($scope.puntoVenta),
327 331 cuentaMadre: 0,//TODO
328 332 cuentaContable: 0,//TODO
329 333 asiento: 0,//TODO
330 334 e_hd: '',//TODO
331 335 c_hd: '',
332 336 numeroLiquidoProducto: 0,//TODO
333   - estado: 0,//TODO
  337 + estado: 0,
334 338 destinoVenta: 0,//TODO
335 339 operacionTipo: 0, //TODO
336 340 },
... ... @@ -607,7 +611,8 @@ angular.module('focaCrearRemito') .controller('remitoController',
607 611 CUIT: cliente.cuit,
608 612 NOM: cliente.nom,
609 613 MAIL: cliente.mail,
610   - MOD: cliente.mod
  614 + MOD: cliente.mod,
  615 + IVA: cliente.iva
611 616 };
612 617  
613 618 var domicilioStamp =
... ... @@ -1160,5 +1165,20 @@ angular.module('focaCrearRemito') .controller('remitoController',
1160 1165 }
1161 1166 });
1162 1167 }
  1168 + //recibo la propiedad por la cual quiero obtener el valor
  1169 + function getImporte(propiedad) {
  1170 + var importe = 0;
  1171 +
  1172 + $scope.articulosFiltro().forEach(function (articulo) {
  1173 +
  1174 + if (articulo[propiedad]) {
  1175 + importe += articulo[propiedad] * articulo.cantidad;
  1176 + }
  1177 + return;
  1178 +
  1179 + });
  1180 +
  1181 + return importe;
  1182 + }
1163 1183 }
1164 1184 ]);