Commit dd6738d0d6f4fbe66a731be0b5bb8e45781390e9
1 parent
2b3acb1761
Exists in
master
Asignando el precio total a una variable.
Showing
2 changed files
with
6 additions
and
7 deletions
Show diff stats
src/app/components/popover-promos/popover-promos.component.html
src/app/components/popover-promos/popover-promos.component.ts
| ... | ... | @@ -28,14 +28,13 @@ export class PopoverPromosComponent implements OnInit { |
| 28 | 28 | this.promoSeleccionada.emit(promo); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - calcularPrecioDePromo(productos: Producto[]) { | |
| 31 | + calcularPrecioDePromo(promo: Promocion) { | |
| 32 | 32 | |
| 33 | - var precio = 0; | |
| 34 | - productos.forEach(producto => { | |
| 35 | - precio += producto.PreVen; | |
| 33 | + promo.precioTotal = 0; | |
| 34 | + promo.productos.forEach(producto => { | |
| 35 | + promo.precioTotal += producto.PreVen; | |
| 36 | 36 | }) |
| 37 | - | |
| 38 | - return precio; | |
| 37 | + return promo.precioTotal; | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | } |