diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 5e11c11..e469634 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -37,12 +37,12 @@ const routes: Routes = [
path: 'pago-tarjeta',
loadChildren: () => import('./modules/pago-tarjeta/pago-tarjeta.module').then(m => m.PagoTarjetaModule)
},
- {
- path: 'mensaje-final',
- loadChildren: () => import('./modules/mensaje-final/mensaje-final.module').then(m => m.MensajeFinalModule)
- },
]
},
+ {
+ path: 'mensaje-final',
+ loadChildren: () => import('./modules/mensaje-final/mensaje-final.module').then(m => m.MensajeFinalModule)
+ },
{ path: '**', redirectTo: '', pathMatch: 'full' },
];
diff --git a/src/app/modules/forma-pago/forma-pago.component.html b/src/app/modules/forma-pago/forma-pago.component.html
index 196cd8c..dcdf9a9 100644
--- a/src/app/modules/forma-pago/forma-pago.component.html
+++ b/src/app/modules/forma-pago/forma-pago.component.html
@@ -50,7 +50,7 @@
+ (click)="medioPago(4)">
PRESENTÁ EL TICKET EN CAJA Y AGUARDÁ TU PEDIDO
-
Número de pedido {{023}}
+
Número de pedido {{articuloService.idComanda}}
@@ -49,5 +49,20 @@
+
+
+
+
FINALIZAR
+

+
+
+
diff --git a/src/app/modules/mensaje-final/mensaje-final.component.ts b/src/app/modules/mensaje-final/mensaje-final.component.ts
index e977129..f531e36 100644
--- a/src/app/modules/mensaje-final/mensaje-final.component.ts
+++ b/src/app/modules/mensaje-final/mensaje-final.component.ts
@@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
+import { ArticuloService } from 'src/app/services/articulo/articulo.service';
+import { Router } from '@angular/router';
@Component({
selector: 'app-mensaje-final',
@@ -7,9 +9,20 @@ import { Component, OnInit } from '@angular/core';
})
export class MensajeFinalComponent implements OnInit {
- constructor() { }
+ constructor(
+ public articuloService: ArticuloService,
+ private router: Router,
+ ) { }
ngOnInit() {
+ setTimeout(() => {
+ this.goToSplash();
+ }, 10000)
+ }
+
+ goToSplash() {
+ this.articuloService.cleanShoppingCar();
+ this.router.navigate(['']);
}
}
diff --git a/src/app/modules/pago-tarjeta/pago-tarjeta.component.ts b/src/app/modules/pago-tarjeta/pago-tarjeta.component.ts
index 22eea8d..4c78640 100644
--- a/src/app/modules/pago-tarjeta/pago-tarjeta.component.ts
+++ b/src/app/modules/pago-tarjeta/pago-tarjeta.component.ts
@@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
+import { ArticuloService } from 'src/app/services/articulo/articulo.service';
+import { Router } from '@angular/router';
@Component({
selector: 'app-pago-tarjeta',
@@ -7,9 +9,20 @@ import { Component, OnInit } from '@angular/core';
})
export class PagoTarjetaComponent implements OnInit {
- constructor() { }
+ constructor(
+ private articuloService: ArticuloService,
+ private router: Router,
+ ) { }
ngOnInit() {
+ let dataPago = {
+ pedidoAnombreDe: ''
+ }
+ this.articuloService.pay(dataPago)
+ .subscribe((res: any) => {
+ this.articuloService.idComanda = res.data;
+ this.router.navigate(['mensaje-final']);
+ }, err => console.error(err));
}
}
diff --git a/src/app/modules/seleccion-articulos/seleccion-articulos.component.ts b/src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
index c570ce9..c9d4254 100644
--- a/src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
+++ b/src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
@@ -119,8 +119,11 @@ export class SeleccionArticulosComponent implements OnInit {
}
elegirArticulo(articulo: IArticulo) {
- articulo.cantidad = 1;
- this.articuloService.setArticulo(articulo);
+ this.articuloService.getById(articulo.id)
+ .subscribe((res: IArticulo) => {
+ res.cantidad = 1;
+ this.articuloService.setArticulo(res);
+ }, err => console.error(err));
}
increaseShow() {
diff --git a/src/app/services/articulo/articulo.service.ts b/src/app/services/articulo/articulo.service.ts
index c8be819..234b8d7 100644
--- a/src/app/services/articulo/articulo.service.ts
+++ b/src/app/services/articulo/articulo.service.ts
@@ -13,6 +13,8 @@ export class ArticuloService {
mostrar: string;
esPromoPersonalizada: boolean = false;
urlDeboSuite = APP_SETTINGS.apiDeboSuite;
+ medioPago: number;
+ idComanda: number;
constructor(
private http: HttpClient,
@@ -46,14 +48,14 @@ export class ArticuloService {
return new Observable((observer) => {
this.clienteService.getById(-1)
.subscribe(cliente => {
- let puntoVenta = parseInt(localStorage.getItem('impresoraPVE'));
+ let puntoVenta = 9998;
this.markArticuloInPromoAsRemoved();
- this.http.post(`${this.urlDeboSuite}/comprobante/guardar/${dataPago.medioPago}`, {
+ this.http.post(`${this.urlDeboSuite}/comprobante/guardar/${this.medioPago}`, {
productos: this.carrito,
cliente: cliente,
origen: 'autoservicio',
codigoVendedor: 5,
- puntoVenta: dataPago.medioPago === 9 ? -1 * puntoVenta : puntoVenta,
+ puntoVenta: this.medioPago === 9 ? -1 * puntoVenta : puntoVenta,
pedidoAnombreDe: dataPago.pedidoAnombreDe,
numeroPlanilla: '11111',
})