Commit 8bebd222c3dabbb7bd7ac15706633a1b5eb5ecc1
Exists in
master
and in
1 other branch
Merge branch 'master' of git.focasoftware.com:angular/autoservicio
Showing
3 changed files
Show diff stats
src/app/components/comanda/comanda.component.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | 'bg-success swing-out-top-bck': comanda.estado === 3 |
10 | 10 | }"> |
11 | 11 | <div class="card-body p-2"> |
12 | - <p class="h5 card-title text-center mb-1">{{comanda.id}}.</p> | |
12 | + <p class="h5 card-title text-center mb-1">{{comanda.id.toString().slice(comanda.id.toString().length - 2)}}.</p> | |
13 | 13 | <p |
14 | 14 | *ngFor="let detalle of comanda.detalles" |
15 | 15 | [ngClass]=" |
src/app/components/confirmacion-carrito/confirmacion-carrito.component.ts
... | ... | @@ -81,6 +81,11 @@ export class ConfirmacionCarritoComponent implements OnInit, OnDestroy { |
81 | 81 | |
82 | 82 | pagar(medioPago: string) { |
83 | 83 | |
84 | + if (medioPago == 'electronico') { | |
85 | + | |
86 | + this.verQR = true; | |
87 | + } | |
88 | + | |
84 | 89 | this.productoService.pagar(medioPago) |
85 | 90 | .subscribe(() => { |
86 | 91 | |
... | ... | @@ -92,7 +97,6 @@ export class ConfirmacionCarritoComponent implements OnInit, OnDestroy { |
92 | 97 | } else if (medioPago == 'electronico') { |
93 | 98 | |
94 | 99 | this.compraConQRfinalizada = true; |
95 | - this.verQR = true; | |
96 | 100 | } |
97 | 101 | |
98 | 102 | setTimeout(() => { |
src/app/components/inicio/inicio.component.ts
... | ... | @@ -92,8 +92,10 @@ export class InicioComponent implements OnInit, AfterViewInit { |
92 | 92 | |
93 | 93 | confirmarProducto() { |
94 | 94 | |
95 | - var producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar; | |
95 | + let producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar; | |
96 | + | |
96 | 97 | producto.cantidad = producto.cantidad ? producto.cantidad : 1; |
98 | + | |
97 | 99 | this.productoService.setProductos(producto); |
98 | 100 | this.productoService.productoAcargar = this.promoAcargar = this.productoAcargar = undefined; |
99 | 101 | this.productoService.esPromoPersonalizada = false; |
... | ... | @@ -147,8 +149,17 @@ export class InicioComponent implements OnInit, AfterViewInit { |
147 | 149 | |
148 | 150 | productosPersonalizados($event: Producto[]) { |
149 | 151 | |
150 | - var productosPersonalizados = $event; | |
151 | - this.promoAcargar.productos = productosPersonalizados; | |
152 | + let productosPersonalizados = $event; | |
153 | + | |
154 | + productosPersonalizados.forEach(productoElegido => { | |
155 | + | |
156 | + this.promoAcargar.productos = this.promoAcargar.productos.filter(productoPromo => { | |
157 | + return productoPromo.idSinonimo != productoElegido.idSinonimo; | |
158 | + }); | |
159 | + }); | |
160 | + | |
161 | + this.promoAcargar.productos = this.promoAcargar.productos.concat(productosPersonalizados); | |
162 | + | |
152 | 163 | this.confirmarProducto(); |
153 | 164 | } |
154 | 165 |