Commit 3c606dad17aa9dbcfc73d65f02532ac033193a9e

Authored by Eric Fernandez
1 parent 0c64837dea
Exists in master

avances

1 <?xml version='1.0' encoding='utf-8'?> 1 <?xml version='1.0' encoding='utf-8'?>
2 <widget id="com.focasoftware.comprobantes" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> 2 <widget id="com.focasoftware.comprobantes" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3 <name>Gestión comprobantes</name> 3 <name>Gestión comprobantes</name>
4 <description> 4 <description>
5 Gestion de comprobantes 5 Gestion de comprobantes
6 </description> 6 </description>
7 <author email="dev@cordova.apache.org" href="http://cordova.io"> 7 <author email="dev@cordova.apache.org" href="http://cordova.io">
8 Apache Cordova Team 8 Apache Cordova Team
9 </author> 9 </author>
10 <icon src="/src/img/logo.png" platform="android" /> 10 <icon src="/src/assets/img/logo.png" platform="android" />
11 <content src="index.html" /> 11 <content src="index.html" />
12 <plugin name="cordova-plugin-whitelist" spec="1" /> 12 <plugin name="cordova-plugin-whitelist" spec="1" />
13 <access origin="*" /> 13 <access origin="*" />
14 <allow-intent href="http://*/*" /> 14 <allow-intent href="http://*/*" />
15 <allow-intent href="https://*/*" /> 15 <allow-intent href="https://*/*" />
16 <allow-intent href="tel:*" /> 16 <allow-intent href="tel:*" />
17 <allow-intent href="sms:*" /> 17 <allow-intent href="sms:*" />
18 <allow-intent href="mailto:*" /> 18 <allow-intent href="mailto:*" />
19 <allow-intent href="geo:*" /> 19 <allow-intent href="geo:*" />
20 <platform name="android"> 20 <platform name="android">
21 <allow-intent href="market:*" /> 21 <allow-intent href="market:*" />
22 </platform> 22 </platform>
23 <platform name="ios"> 23 <platform name="ios">
24 <allow-intent href="itms:*" /> 24 <allow-intent href="itms:*" />
25 <allow-intent href="itms-apps:*" /> 25 <allow-intent href="itms-apps:*" />
26 </platform> 26 </platform>
27 </widget> 27 </widget>
28 28
1 { 1 {
2 "name": "distribucion-comprobantes", 2 "name": "distribucion-comprobantes",
3 "version": "0.0.0", 3 "version": "0.0.0",
4 "scripts": { 4 "scripts": {
5 "ng": "ng", 5 "ng": "ng",
6 "start": "ng serve", 6 "start": "ng serve",
7 "build": "ng build", 7 "build": "ng build",
8 "test": "ng test", 8 "test": "ng test",
9 "lint": "ng lint", 9 "lint": "ng lint",
10 "e2e": "ng e2e" 10 "e2e": "ng e2e"
11 }, 11 },
12 "private": true, 12 "private": true,
13 "dependencies": { 13 "dependencies": {
14 "@angular/animations": "~8.0.0", 14 "@angular/animations": "~8.0.0",
15 "@angular/common": "~8.0.0", 15 "@angular/common": "~8.0.0",
16 "@angular/compiler": "~8.0.0", 16 "@angular/compiler": "~8.0.0",
17 "@angular/core": "~8.0.0", 17 "@angular/core": "~8.0.0",
18 "@angular/forms": "~8.0.0", 18 "@angular/forms": "~8.0.0",
19 "@angular/platform-browser": "~8.0.0", 19 "@angular/platform-browser": "~8.0.0",
20 "@angular/platform-browser-dynamic": "~8.0.0", 20 "@angular/platform-browser-dynamic": "~8.0.0",
21 "@angular/router": "~8.0.0", 21 "@angular/router": "~8.0.0",
22 "@ng-bootstrap/ng-bootstrap": "^4.2.0", 22 "@ng-bootstrap/ng-bootstrap": "^4.2.0",
23 "cordova-android": "^8.0.0", 23 "cordova-android": "^8.0.0",
24 "font-awesome": "^4.7.0", 24 "font-awesome": "^4.7.0",
25 "rxjs": "~6.4.0", 25 "rxjs": "~6.4.0",
26 "tslib": "^1.9.0", 26 "tslib": "^1.9.0",
27 "zone.js": "~0.9.1" 27 "zone.js": "~0.9.1"
28 }, 28 },
29 "devDependencies": { 29 "devDependencies": {
30 "@angular-devkit/build-angular": "~0.800.0", 30 "@angular-devkit/build-angular": "~0.800.0",
31 "@angular/cli": "~8.0.0", 31 "@angular/cli": "~8.0.0",
32 "@angular/compiler-cli": "~8.0.0", 32 "@angular/compiler-cli": "~8.0.0",
33 "@angular/language-service": "~8.0.0", 33 "@angular/language-service": "~8.0.0",
34 "@types/node": "~8.9.4", 34 "@types/node": "~8.9.4",
35 "@types/jasmine": "~3.3.8", 35 "@types/jasmine": "~3.3.8",
36 "@types/jasminewd2": "~2.0.3", 36 "@types/jasminewd2": "~2.0.3",
37 "codelyzer": "^5.0.0", 37 "codelyzer": "^5.0.0",
38 "jasmine-core": "~3.4.0", 38 "jasmine-core": "~3.4.0",
39 "jasmine-spec-reporter": "~4.2.1", 39 "jasmine-spec-reporter": "~4.2.1",
40 "karma": "~4.1.0", 40 "karma": "~4.1.0",
41 "karma-chrome-launcher": "~2.2.0", 41 "karma-chrome-launcher": "~2.2.0",
42 "karma-coverage-istanbul-reporter": "~2.0.1", 42 "karma-coverage-istanbul-reporter": "~2.0.1",
43 "karma-jasmine": "~2.0.1", 43 "karma-jasmine": "~2.0.1",
44 "karma-jasmine-html-reporter": "^1.4.0", 44 "karma-jasmine-html-reporter": "^1.4.0",
45 "protractor": "~5.4.0", 45 "protractor": "~5.4.0",
46 "ts-node": "~7.0.0", 46 "ts-node": "~7.0.0",
47 "tslint": "~5.15.0", 47 "tslint": "~5.15.0",
48 "typescript": "~3.4.3" 48 "typescript": "~3.4.3"
49 }, 49 },
50 "cordova": { 50 "cordova": {
51 "plugins": { 51 "plugins": {
52 "cordova-plugin-whitelist": {} 52 "cordova-plugin-whitelist": {}
53 }, 53 },
54 "platforms": [ 54 "platforms": [
55 "android" 55 "android"
56 ] 56 ]
57 } 57 }
58 } 58 }
59
src/app/app.component.html
1 <!--The content below is only a placeholder and can be replaced.--> 1 <!--The content below is only a placeholder and can be replaced.-->
2 <div style="text-align:center" class="body-background container"> 2 <div style="text-align:center" class="body-background container">
3 <app-nombre-empresa></app-nombre-empresa>
3 <router-outlet></router-outlet> 4 <router-outlet></router-outlet>
4 </div> 5 </div>
5 6
src/app/app.module.ts
1 import { BrowserModule } from '@angular/platform-browser'; 1 import { BrowserModule } from '@angular/platform-browser';
2 import { NgModule } from '@angular/core'; 2 import { NgModule } from '@angular/core';
3 import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 3 import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
4 import { HttpClientModule } from '@angular/common/http'; 4 import { HttpClientModule } from '@angular/common/http';
5 import { FormsModule } from '@angular/forms';
5 6
6 import { AppRoutingModule } from './app-routing.module'; 7 import { AppRoutingModule } from './app-routing.module';
7 import { AppComponent } from './app.component'; 8 import { AppComponent } from './app.component';
8 import { AppBotonera } from './botonera/botonera.component'; 9 import { AppBotonera } from './botonera/botonera.component';
9 import { ComprobantesComponent } from './comprobantes/comprobantes.component'; 10 import { ComprobantesComponent } from './comprobantes/comprobantes.component';
11 import { NombreEmpresaComponent } from './nombre-empresa/nombre-empresa.component';
10 12
11 @NgModule({ 13 @NgModule({
12 declarations: [ 14 declarations: [
13 AppComponent, 15 AppComponent,
14 AppBotonera, 16 AppBotonera,
15 ComprobantesComponent 17 ComprobantesComponent,
18 NombreEmpresaComponent
16 ], 19 ],
17 imports: [ 20 imports: [
18 BrowserModule, 21 BrowserModule,
19 AppRoutingModule, 22 AppRoutingModule,
20 NgbModule, 23 NgbModule,
21 HttpClientModule 24 HttpClientModule,
25 FormsModule
22 ], 26 ],
23 providers: [], 27 providers: [],
24 bootstrap: [AppComponent, AppBotonera] 28 bootstrap: [AppComponent]
25 }) 29 })
26 export class AppModule { } 30 export class AppModule { }
27 31
src/app/botonera/botonera.component.html
1 <div class="col-6"> 1 <div class="col-6">
2 <img src="assets/img/logo.png" class="botonera-principal-logo"> 2 <img src="assets/img/logo.png" class="botonera-principal-logo">
3 </div> 3 </div>
4 <div class="pt-5 row"> 4 <div class="pt-5 row">
5 <div class="swiper col-12"> 5 <div class="swiper col-12">
6 <a class="botonera-principal-comprobante" routerLink="/comprobantes"> 6 <a class="botonera-principal-comprobante" routerLink="/comprobantes">
7 <span>Lista comprobantes</span> 7 <span>Lista comprobantes</span>
8 </a> 8 </a>
9 </div> 9 </div>
10 <div class="d-none d-sm-block"> 10 <div class="d-none d-sm-block">
11 <a 11 <a
12 class="btn btn-outline-dark mt-5 btn-lg" 12 class="btn btn-outline-dark mt-5 btn-lg"
13 href="javascript:void()" 13 href="javascript:void()"
14 ng-click="showTerminal()" 14 ng-click="showTerminal()"
15 > 15 >
16 <i class="fa fa-info-circle" aria-hidden="true"></i> 16 <i class="fa fa-info-circle" aria-hidden="true"></i>
17 </a> 17 </a>
18 <a class="btn btn-outline-dark mt-5 btn-lg" 18 <a class="btn btn-outline-dark mt-5 btn-lg"
19 href="javascript:void()" 19 href="javascript:void()"
20 ng-click="logout()" 20 ng-click="logout()"
21 > 21 >
22 <i class="fa fa-power-off" aria-hidden="true"></i> 22 <i class="fa fa-power-off" aria-hidden="true"></i>
23 </a> 23 </a>
24 </div> 24 </div>
25 <div class="row d-md-none fixed-bottom"> 25 <div class="row d-md-none fixed-bottom">
26 <div class="w-100 d-flex px-3 acciones-mobile"> 26 <div class="w-100 d-flex px-3 acciones-mobile">
27 <a 27 <a
28 class="btn btn-outline-dark btn-lg mr-2" 28 class="btn btn-outline-dark btn-lg mr-2"
29 href="javascript:void()" 29 href="javascript:void()"
30 ng-click="showTerminal()" 30 ng-click="showTerminal()"
31 > 31 >
32 <i class="fa fa-info-circle" aria-hidden="true"></i> 32 <i class="fa fa-info-circle" aria-hidden="true"></i>
33 </a> 33 </a>
34 <a class="btn btn-outline-dark btn-lg" 34 <a class="btn btn-outline-dark btn-lg"
35 href="javascript:void()" 35 href="javascript:void()"
36 ng-click="logout()" 36 ng-click="logout()"
37 > 37 >
38 <i class="fa fa-power-off" aria-hidden="true"></i> 38 <i class="fa fa-power-off" aria-hidden="true"></i>
39 </a> 39 </a>
40 </div> 40 </div>
41 </div> 41 </div>
42 </div> 42 </div>
43 43
src/app/botonera/botonera.component.spec.ts
1 import { async, ComponentFixture, TestBed } from '@angular/core/testing'; File was deleted
2
3 import { BotoneraComponent } from './botonera.component';
4
5 describe('BotoneraComponent', () => {
6 let component: BotoneraComponent;
7 let fixture: ComponentFixture<BotoneraComponent>;
8
9 beforeEach(async(() => {
10 TestBed.configureTestingModule({
11 declarations: [ BotoneraComponent ]
12 })
13 .compileComponents();
14 }));
15
16 beforeEach(() => {
17 fixture = TestBed.createComponent(BotoneraComponent);
18 component = fixture.componentInstance;
19 fixture.detectChanges();
20 });
21
22 it('should create', () => {
23 expect(component).toBeTruthy();
24 });
25 });
26 1 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
src/app/comprobantes/comprobantes.component.css
src/app/comprobantes/comprobantes.component.html
1 <ul> 1 <div class="row panel-informativo">
2 <li *ngFor="let comprobante of comprobantes"> 2 <div class="col-12">
3 {{comprobante}} 3 <div class="row titulares">
4 </li> 4 <div class="col-12 col-sm numero-pedido text-center text-md-left border border-white align-middle ng-binding ng-scope">
5 </ul> 5 Recepción
6 <button
7 class="btn btn-xs btn-outline-light float-right"
8 type="button"
9 ng-click="$ctrl.busqueda()"
10 ng-if="$ctrl.busqueda"
11 title="Buscar"
12 >
13 <i class="fa fa-search"></i>
14 </button>
15 </div>
16 <div class="col-7 col-sm border border-white align-middle">
17 Fecha:
18 <span
19 ng-click="datepickerAbierto = true"
20 >&nbsp;{{ fecha | date: 'dd/MM/yyyy' }}</span>
21 </div>
22 <div class="col-5 col-sm border border-white border-right-0 align-middle">
23 Hora:
24 <span
25 ng-click="datepickerAbierto = true"
26 >&nbsp;{{ fecha | date: 'shortTime'}}</span>
27 </div>
28 </div>
29 </div>
30 </div>
31
32 <form>
33 <div class="row border">
34 <div class="col-6 col-sm-3 d-flex">
35 <strong>Letra Factura:&nbsp;</strong>
36 <label>{{cabecera.TIP}}</label>
37 </div>
38 <div class="col-6 col-sm-3 d-flex">
39 <strong>Tipo Factura:&nbsp;</strong>
40 <label>{{cabecera.TCO}}</label>
41 </div>
42 <div class="col-6 col-sm-3 d-flex">
43 <strong>Sucursal:&nbsp;</strong>
44 <label>{{cabecera.SUC}}</label>
45 </div>
46 <div class="col-6 col-sm-3 d-flex">
47 <strong>Número:&nbsp;</strong>
48 <label>{{cabecera.NCO}}</label>
49 </div>
50 <div class="col-6 col-sm-3 d-flex">
51 <strong>Cuit:&nbsp;</strong>
52 <label>{{cabecera.CUI}}</label>
53 </div>
54 <div class="col-12 col-sm-3 d-flex">
55 <strong>Nombre:&nbsp;</strong>
56 <label>{{cabecera.NOM}}</label>
57 </div>
58 </div>
59 <div class="row">
60 <input
61 type="text"
62 class="form-control-sm col-12"
63 placeholder="Busque producto por nombre, codigo"
64 (keyup)="filtrar($event)"/>
65 </div>
66 <div class="row">
67 <table class="table table-dark">
68 <thead>
69 <tr>
70 <th>Rechazar</th>
71 <th>Producto</th>
72 <th>Cantidad</th>
73 <th>Aceptar</th>
74 </tr>
75 </thead>
76 <tbody>
77 <tr *ngFor="let articulo of articulosFiltro" [ngClass]="{'bg-success': articulo.done}">
78 <th><button type="button" class="" (click)="articulo.input = true">
79 <i class="fa fa-window-close"></i>
80 </button></th>
81 <th>{{articulo.LI0}}</th>
82 <th *ngIf="!articulo.input">{{articulo.CAN}}</th>
83 <th *ngIf="articulo.input">
84 <input class="form-control-sm col-12"/>
85 </th>
86 <th><button type="button" class="" (click)="articulo.done = true">
87 <i class="fa fa-check"></i>
88 </button></th>
89 </tr>
90 </tbody>
91 <tfoot>
92 <nav *ngIf="articulosFiltro.length > 0" class="mr-auto">
93 <ul class="pagination pagination-sm justify-content mb-0">
94 <li class="page-item" [ngClass]="{'disabled': pagina == 1}">
95 <a class="page-link" href="javascript:void();" (click)="paginar(articulosFiltro); pagina - 1">
96 <span aria-hidden="true">&laquo;</span>
97 <span class="sr-only">Anterior</span>
98 </a>
99 </li>
100 <li
101 class="page-item"
102 *ngFor="let pagina of paginas; index as i"
103 [ngClass]="{'active': pagina == currentPage}"
104 >
105 <a
106 class="page-link"
107 href="javascript:void();"
108 (click)="selectPage(pagina)"
109 >{{pagina}}</a>
110 </li>
111 <li class="page-item" [ngClass]="{'disabled': currentPage == lastPage}">
112 <a class="page-link" href="javascript:void();" (click)="paginar(articulosFiltro); pagina + 1">
113 <span aria-hidden="true">&raquo;</span>
114 <span class="sr-only">Siguiente</span>
115 </a>
116 </li>
117 </ul>
118 </nav>
119 </tfoot>
120 </table>
121 </div>
122 </form>
6 123
src/app/comprobantes/comprobantes.component.spec.ts
1 import { async, ComponentFixture, TestBed } from '@angular/core/testing'; File was deleted
2
3 import { ComprobantesComponent } from './comprobantes.component';
4
5 describe('ComprobantesComponent', () => {
6 let component: ComprobantesComponent;
7 let fixture: ComponentFixture<ComprobantesComponent>;
8
9 beforeEach(async(() => {
10 TestBed.configureTestingModule({
11 declarations: [ ComprobantesComponent ]
12 })
13 .compileComponents();
14 }));
15
16 beforeEach(() => {
17 fixture = TestBed.createComponent(ComprobantesComponent);
18 component = fixture.componentInstance;
19 fixture.detectChanges();
20 });
21
22 it('should create', () => {
23 expect(component).toBeTruthy();
24 });
25 });
26 1 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
src/app/comprobantes/comprobantes.component.ts
1 import { Component, OnInit } from '@angular/core'; 1 import { Component, OnInit } from '@angular/core';
2 2
3 @Component({ 3 @Component({
4 selector: 'app-comprobantes', 4 selector: 'app-comprobantes',
5 templateUrl: './comprobantes.component.html', 5 templateUrl: './comprobantes.component.html',
6 styleUrls: ['./comprobantes.component.css'] 6 styleUrls: ['./comprobantes.component.scss']
7 }) 7 })
8 export class ComprobantesComponent implements OnInit { 8 export class ComprobantesComponent implements OnInit {
9 9
10 constructor() { } 10 constructor() { }
11 11
12 ngOnInit() { 12 ngOnInit() {
13
14 this.obtenerConsulta()
13 } 15 }
14 16
17 filter = '';
15 comprobantes = [1, 2, 3]; 18 comprobantes = [1, 2, 3];
19 cabecera = {};
20 cuerpo = [];
21 articulosFiltro = [];
22 pagina = 1;
23 paginas = [];
24
25 fecha = new Date();
26
27 filtrar(event: any) {
28 var filtro = this.cuerpo.filter((param)=> {
29 return (param.LI0).toLocaleUpperCase().includes((event.target.value).toLocaleUpperCase());
30 });
31
32 this.paginar(filtro, this.pagina);
33 this.paginas.length = Math.round(filtro.length / 5);
34 }
35
36 paginar(filtro: any, pagina: any) {
37 this.articulosFiltro = filtro.slice(
38 filtro.length - 1 * pagina, filtro.length * this.pagina + 4);
39 }
40
41 obtenerConsulta() {
42
43 setTimeout(() => {
44 this.cabecera = {
45 TIP: 'A',
46 TCO: 'FT',
47 SUC: 623,
48 NCO: 53979,
49 COD: 1,
50 FEC: new Date(),
51 NOM: 'POTIGIAN GOLOCINAS',
52 CUI: '30-54775125-2'
53 };
54
55 this.cuerpo = [
56 {
57 LI0: 'Mantel Combo Bolso CocaCola',
58 CAN: 5
59 },
60 {
61 LI0: 'Papas',
62 CAN: 5
63 },
64 {
65 LI0: 'Peras',
66 CAN: 5
67 },
68 {
69 LI0: 'Cafe',
70 CAN: 5
71 },
72 {
73 LI0: 'Menta',
74 CAN: 5
75 },
76 {
77 LI0: 'Fernet',
78 CAN: 5
79 },
80 {
81 LI0: 'Birra',
82 CAN: 5
83 }
84 ];
85
86 this.articulosFiltro = this.cuerpo;
87
88 this.paginar(this.articulosFiltro);
89 }, 500);
90 }
91
16 } 92 }
17 93
1 <!doctype html> 1 <!doctype html>
2 <html lang="en"> 2 <html lang="en">
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>DistribucionComprobantes</title> 5 <title>DistribucionComprobantes</title>
6 <base href="./"> 6 <base href="./">
7 7
8 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 <link rel="icon" type="image/x-icon" href="./img/logo.png"> 9 <link rel="icon" type="image/x-icon" href="assets/img/logo.png">
10 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> 10 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
11 11
12 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> 12 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
13 13
14 <script type="text/javascript" src="cordova.js"></script> 14 <script type="text/javascript" src="cordova.js"></script>
15 </head> 15 </head>
16 <body> 16 <body>
17 <app></app> 17 <app></app>
18 </body> 18 </body>
19 </html> 19 </html>
20 20