Commit 3c606dad17aa9dbcfc73d65f02532ac033193a9e

Authored by Eric Fernandez
1 parent 0c64837dea
Exists in master

avances

... ... @@ -7,7 +7,7 @@
7 7 <author email="dev@cordova.apache.org" href="http://cordova.io">
8 8 Apache Cordova Team
9 9 </author>
10   - <icon src="/src/img/logo.png" platform="android" />
  10 + <icon src="/src/assets/img/logo.png" platform="android" />
11 11 <content src="index.html" />
12 12 <plugin name="cordova-plugin-whitelist" spec="1" />
13 13 <access origin="*" />
... ... @@ -55,4 +55,4 @@
55 55 "android"
56 56 ]
57 57 }
58 58 -}
  59 +}
59 60 \ No newline at end of file
src/app/app.component.html
1 1 <!--The content below is only a placeholder and can be replaced.-->
2 2 <div style="text-align:center" class="body-background container">
  3 + <app-nombre-empresa></app-nombre-empresa>
3 4 <router-outlet></router-outlet>
4 5 </div>
src/app/app.module.ts
... ... @@ -2,25 +2,29 @@ import { BrowserModule } from &#39;@angular/platform-browser&#39;;
2 2 import { NgModule } from '@angular/core';
3 3 import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
4 4 import { HttpClientModule } from '@angular/common/http';
  5 +import { FormsModule } from '@angular/forms';
5 6  
6 7 import { AppRoutingModule } from './app-routing.module';
7 8 import { AppComponent } from './app.component';
8 9 import { AppBotonera } from './botonera/botonera.component';
9 10 import { ComprobantesComponent } from './comprobantes/comprobantes.component';
  11 +import { NombreEmpresaComponent } from './nombre-empresa/nombre-empresa.component';
10 12  
11 13 @NgModule({
12 14 declarations: [
13 15 AppComponent,
14 16 AppBotonera,
15   - ComprobantesComponent
  17 + ComprobantesComponent,
  18 + NombreEmpresaComponent
16 19 ],
17 20 imports: [
18 21 BrowserModule,
19 22 AppRoutingModule,
20 23 NgbModule,
21   - HttpClientModule
  24 + HttpClientModule,
  25 + FormsModule
22 26 ],
23 27 providers: [],
24   - bootstrap: [AppComponent, AppBotonera]
  28 + bootstrap: [AppComponent]
25 29 })
26 30 export class AppModule { }
src/app/botonera/botonera.component.html
... ... @@ -23,20 +23,20 @@
23 23 </a>
24 24 </div>
25 25 <div class="row d-md-none fixed-bottom">
26   - <div class="w-100 d-flex px-3 acciones-mobile">
27   - <a
28   - class="btn btn-outline-dark btn-lg mr-2"
29   - href="javascript:void()"
30   - ng-click="showTerminal()"
31   - >
32   - <i class="fa fa-info-circle" aria-hidden="true"></i>
33   - </a>
34   - <a class="btn btn-outline-dark btn-lg"
35   - href="javascript:void()"
36   - ng-click="logout()"
37   - >
38   - <i class="fa fa-power-off" aria-hidden="true"></i>
39   - </a>
40   - </div>
  26 + <div class="w-100 d-flex px-3 acciones-mobile">
  27 + <a
  28 + class="btn btn-outline-dark btn-lg mr-2"
  29 + href="javascript:void()"
  30 + ng-click="showTerminal()"
  31 + >
  32 + <i class="fa fa-info-circle" aria-hidden="true"></i>
  33 + </a>
  34 + <a class="btn btn-outline-dark btn-lg"
  35 + href="javascript:void()"
  36 + ng-click="logout()"
  37 + >
  38 + <i class="fa fa-power-off" aria-hidden="true"></i>
  39 + </a>
  40 + </div>
41 41 </div>
42 42 </div>
src/app/botonera/botonera.component.spec.ts
... ... @@ -1,25 +0,0 @@
1   -import { async, ComponentFixture, TestBed } from '@angular/core/testing';
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   -});
src/app/comprobantes/comprobantes.component.css
src/app/comprobantes/comprobantes.component.html
1   -<ul>
2   - <li *ngFor="let comprobante of comprobantes">
3   - {{comprobante}}
4   - </li>
5   -</ul>
  1 +<div class="row panel-informativo">
  2 + <div class="col-12">
  3 + <div class="row titulares">
  4 + <div class="col-12 col-sm numero-pedido text-center text-md-left border border-white align-middle ng-binding ng-scope">
  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>
src/app/comprobantes/comprobantes.component.spec.ts
... ... @@ -1,25 +0,0 @@
1   -import { async, ComponentFixture, TestBed } from '@angular/core/testing';
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   -});
src/app/comprobantes/comprobantes.component.ts
... ... @@ -3,14 +3,90 @@ import { Component, OnInit } from &#39;@angular/core&#39;;
3 3 @Component({
4 4 selector: 'app-comprobantes',
5 5 templateUrl: './comprobantes.component.html',
6   - styleUrls: ['./comprobantes.component.css']
  6 + styleUrls: ['./comprobantes.component.scss']
7 7 })
8 8 export class ComprobantesComponent implements OnInit {
9 9  
10 10 constructor() { }
11 11  
12 12 ngOnInit() {
  13 +
  14 + this.obtenerConsulta()
13 15 }
14 16  
  17 + filter = '';
15 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 }
... ... @@ -6,7 +6,7 @@
6 6 <base href="./">
7 7  
8 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 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 12 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>