From d6fa7f6b0a7ceb95387b37eca82c1d67da08217a Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Fri, 21 Jun 2019 14:54:58 -0300 Subject: [PATCH] catch error --- .gitignore | 4 ++++ angular.json | 2 +- package.json | 5 +++-- src/app/boton-service.service.ts | 4 ++-- src/app/botonera/botonera.component.html | 8 ++++---- src/app/botonera/botonera.component.ts | 3 ++- .../busqueda-comprobante.component.html | 3 +++ .../busqueda-comprobante.component.ts | 16 ---------------- src/app/comprobantes/comprobantes.component.html | 12 ++++++------ src/app/comprobantes/comprobantes.component.ts | 14 +++++++++++--- src/app/login/login.component.html | 8 ++++---- src/app/login/login.component.ts | 1 + src/etc/AppSetings.ts | 2 +- 13 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 54a26cb..34b8fa0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /dist /tmp /out-tsc + # Only exists if Bazel was run /bazel-out @@ -47,3 +48,6 @@ testem.log # System Files .DS_Store Thumbs.db + +# config +/etc/AppSeting.ts diff --git a/angular.json b/angular.json index c6a3a8e..1f1f25a 100644 --- a/angular.json +++ b/angular.json @@ -116,4 +116,4 @@ } }}, "defaultProject": "distribucion-comprobantes" -} \ No newline at end of file +} diff --git a/package.json b/package.json index 8db8df8..a2f7a43 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "build": "ng build", "test": "ng test", "lint": "ng lint", - "e2e": "ng e2e" + "e2e": "ng e2e", + "apkToDrop": "cp ./platforms/android/app/build/outputs/apk/debug/app-debug.apk C:/Users/Usuario/Dropbox/Apks_PlanexDEBO/v0.0.1" }, "private": true, "dependencies": { @@ -56,4 +57,4 @@ "android" ] } -} +} \ No newline at end of file diff --git a/src/app/boton-service.service.ts b/src/app/boton-service.service.ts index 64e3446..5925979 100644 --- a/src/app/boton-service.service.ts +++ b/src/app/boton-service.service.ts @@ -1,12 +1,12 @@ import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; +// import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class BotonServiceService { - constructor(private http: String) { } + constructor(/*private http: String*/) { } getBotones() { // return this.http.get('http://localhost:5555/comprobantes'); diff --git a/src/app/botonera/botonera.component.html b/src/app/botonera/botonera.component.html index 2cbb8db..5bfd933 100644 --- a/src/app/botonera/botonera.component.html +++ b/src/app/botonera/botonera.component.html @@ -11,13 +11,13 @@ @@ -27,13 +27,13 @@ diff --git a/src/app/botonera/botonera.component.ts b/src/app/botonera/botonera.component.ts index f7d3fbb..81b3a09 100644 --- a/src/app/botonera/botonera.component.ts +++ b/src/app/botonera/botonera.component.ts @@ -8,6 +8,7 @@ import { BotonServiceService } from 'src/app/boton-service.service'; }) export class AppBotonera { - botones = new BotonServiceService('').getBotones(); + botones = new BotonServiceService().getBotones(); paginas = [1]; + } diff --git a/src/app/busqueda-comprobante/busqueda-comprobante.component.html b/src/app/busqueda-comprobante/busqueda-comprobante.component.html index e242d92..6cb1570 100644 --- a/src/app/busqueda-comprobante/busqueda-comprobante.component.html +++ b/src/app/busqueda-comprobante/busqueda-comprobante.component.html @@ -15,6 +15,9 @@ + + Por el momento no hay elementos aqui + {{comprobante.cabecera.TCO + '-' + comprobante.cabecera.TIP + '-' + rellenar(4, comprobante.cabecera.SUC) + '-' + rellenar(8, comprobante.cabecera.NCO)}} diff --git a/src/app/busqueda-comprobante/busqueda-comprobante.component.ts b/src/app/busqueda-comprobante/busqueda-comprobante.component.ts index 958dec3..7240375 100644 --- a/src/app/busqueda-comprobante/busqueda-comprobante.component.ts +++ b/src/app/busqueda-comprobante/busqueda-comprobante.component.ts @@ -19,22 +19,6 @@ export class BusquedaComprobanteComponent implements OnInit { ngOnInit() { this.comprobanteService.getComprobantes().subscribe((data: Array) => { this.comprobantes = data; - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); - this.comprobantes.push(this.comprobantes[0]); - this.comprobantes.push(this.comprobantes[1]); this.paginar(); }); } diff --git a/src/app/comprobantes/comprobantes.component.html b/src/app/comprobantes/comprobantes.component.html index 716d8fc..a038a4f 100644 --- a/src/app/comprobantes/comprobantes.component.html +++ b/src/app/comprobantes/comprobantes.component.html @@ -32,27 +32,27 @@
Letra Factura:  - +
Tipo Factura:  - +
Sucursal:  - +
Número:  - +
Cuit:  - +
Nombre:  - +
diff --git a/src/app/comprobantes/comprobantes.component.ts b/src/app/comprobantes/comprobantes.component.ts index 85cb5f5..84baed0 100644 --- a/src/app/comprobantes/comprobantes.component.ts +++ b/src/app/comprobantes/comprobantes.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit} from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { BusquedaComprobanteComponent } from '../busqueda-comprobante/busqueda-comprobante.component'; import { ComprobanteService } from './comprobantes.service'; +import { Router } from '@angular/router'; @Component({ templateUrl: './comprobantes.component.html', @@ -10,7 +11,10 @@ import { ComprobanteService } from './comprobantes.service'; }) export class ComprobantesComponent implements OnInit { - constructor(private modalService: NgbModal, public comprobanteService: ComprobanteService) { } + constructor( + private modalService: NgbModal, + public comprobanteService: ComprobanteService, + public router: Router) { } ngOnInit() { } @@ -54,7 +58,7 @@ export class ComprobantesComponent implements OnInit { }).length; } - guardarComprobante(event: any) { + guardarComprobante() { if (this.getCantidadArticulosByEstado('pendiente')) { alert('No deben quedar articulos pendientes'); @@ -63,7 +67,11 @@ export class ComprobantesComponent implements OnInit { this.comprobanteService .saveComprobantes({cabecera: this.cabecera, cuerpo: this.cuerpo}) .subscribe(data => { - console.log(data); + alert('Comprobante guardado con éxito'); + this.router.navigateByUrl('/home'); + }, err => { + alert('Algo salió mal'); + console.log(err); }); } diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index 5b422fb..d9dda3b 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -8,7 +8,7 @@ Contraseña
@@ -56,7 +56,7 @@
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 511679c..a1d162f 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -10,6 +10,7 @@ import { Router } from '@angular/router'; export class LoginComponent implements OnInit { loginLoading: boolean = false; + configuracionEstacion: boolean = false; usuario: object = {}; constructor(private loginService: LoginService, private router: Router) { } diff --git a/src/etc/AppSetings.ts b/src/etc/AppSetings.ts index 4be5f56..5366258 100644 --- a/src/etc/AppSetings.ts +++ b/src/etc/AppSetings.ts @@ -1,3 +1,3 @@ export class AppSetings { - public static END_POINT='http://localhost:6060/gateway-debo'; + public static END_POINT='http://10.231.45.234:6060/gateway-debo'; } -- 1.9.1