Commit 10fa6be8684bd0bd52565b56c935d6759eaf10d4

Authored by Luis Suarez
Exists in develop

Merge branch 'develop' of http://git.focasoftware.com/angular/autoservicio-axion into develop

update version
1 1 {
2 2 "name": "autoservicio-axion",
3   - "version": "1.0.0",
  3 + "version": "1.0.1",
4 4 "main": "main.js",
5 5 "scripts": {
6 6 "ng": "ng",
src/app/modules/comanda/comanda.component.html
... ... @@ -55,7 +55,7 @@
55 55 </p>
56 56 <div *ngFor="let componente of detalle.componentes">
57 57 <p *ngIf="componente.DetArt !== 'Producto ingrediente general'">
58   - <small>{{componente.DetArt.toLowerCase()}}</small>
  58 + <small>{{componente.MktDesc ? componente.MktDesc.toLowerCase() : componente.DetArt.toLowerCase()}}</small>
59 59 </p>
60 60 </div>
61 61 </div>
src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts
... ... @@ -3,6 +3,7 @@ import { ICategoria } from &#39;src/app/interfaces/ICategoria&#39;;
3 3 import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service';
4 4 import { CategoriaService } from 'src/app/services/categoria/categoria.service';
5 5 import { APP_SETTINGS } from 'src/etc/AppSettings';
  6 +import { DateExtension } from 'src/app/utils/dateExtension';
6 7  
7 8 @Component({
8 9 selector: 'app-filtro-categorias',
... ... @@ -87,12 +88,8 @@ export class FiltroCategoriasComponent implements OnInit {
87 88 }, 500);
88 89 }
89 90  
90   - validarFecha(fechaInicioString: string, fechaFinString: string) {
91   - const fechaInicio = new Date(fechaInicioString);
92   - const fechaFin = new Date(fechaFinString);
93   - const fechaAux = Date.now();
94   - const fechaHoy = new Date(fechaAux);
95   - return (fechaHoy >= fechaInicio && fechaHoy <= fechaFin) ? true : false;
  91 + validarFecha(fechaInicio: string, fechaFin: string) {
  92 + return DateExtension.ValidateDateRange(fechaInicio, fechaFin);
96 93 }
97 94  
98 95 mediaPantalla() {
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... ... @@ -40,6 +40,7 @@
40 40 <!-- ARTICULO -->
41 41 <div
42 42 *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"
  43 + [hidden]="validarFecha(articulo.FECHA_VIGENCIA_DESDE, articulo.FECHA_VIGENCIA_HASTA)"
43 44 class="col px-2 my-1 my-md-3 h-auto">
44 45 <div
45 46 class="swing-in-top-fwd btn-effect card h-auto"
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
... ... @@ -13,6 +13,7 @@ import { FiltroCategoriasComponent } from &#39;./filtro-categorias/filtro-categorias
13 13 import * as _ from 'lodash';
14 14 import { ANIMATIONS } from 'src/app/utils/animations';
15 15 import { NoStockComponent } from './no-stock/no-stock.component';
  16 +import { DateExtension } from 'src/app/utils/dateExtension';
16 17  
17 18 @Component({
18 19 selector: 'app-seleccion-articulos',
... ... @@ -188,6 +189,11 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes
188 189 this.showQuantity += 100;
189 190 }
190 191  
  192 +
  193 + validarFecha(fechaInicio: string, fechaFin: string) {
  194 + return DateExtension.ValidateDateRange(fechaInicio, fechaFin);
  195 + }
  196 +
191 197 @HostListener('scroll', ['$event'])
192 198 scrollEvent(event: Event) {
193 199 clearTimeout(this.inactiveScreen.timerReposo);
src/app/services/articulo/articulo.service.ts
... ... @@ -87,7 +87,8 @@ export class ArticuloService {
87 87 pedidoAnombreDe: dataPago.pedidoAnombreDe,
88 88 numeroPlanilla: APP_SETTINGS.numeroPlanilla,
89 89 pedidoParaLlevar: localStorage.getItem('pedidoParaLlevar'),
90   - terminal: APP_SETTINGS.terminal
  90 + terminal: APP_SETTINGS.terminal,
  91 + contactLess: true,
91 92 })
92 93 .subscribe((data) => {
93 94 observer.next(data);
src/app/utils/dateExtension.ts
... ... @@ -0,0 +1,11 @@
  1 +export class DateExtension {
  2 +
  3 + public static ValidateDateRange(dateStart: string, dateEnd: string) {
  4 + if (dateEnd === null) return false;
  5 + const today = Date.now();
  6 + const timeStart = new Date(dateStart).getTime();
  7 + const timeEnd = new Date(dateEnd).getTime();
  8 + return (timeStart <= today && today <= timeEnd) ? false : true;
  9 + }
  10 +
  11 +}