Commit 6273a021e2401e13f3e363394eaa1c17034f9531
1 parent
039ca2889b
Exists in
develop
Add
Validacion al elegir articulo y sugerir promo que no tiene stock
Showing
2 changed files
with
13 additions
and
2 deletions
Show diff stats
src/app/shared/promocion/promocion.component.html
| ... | ... | @@ -31,7 +31,9 @@ |
| 31 | 31 | </div> |
| 32 | 32 | </div> |
| 33 | 33 | <div class="modal-body" *ngIf="articulosPromo.length"> |
| 34 | - <div class="row no-gutters w-100"> | |
| 34 | + <div | |
| 35 | + class="row no-gutters w-100" | |
| 36 | + *ngIf="promociones.length && !loading"> | |
| 35 | 37 | <div class="col-9 col-9 align-self-center"> |
| 36 | 38 | <p class="text-white"><small>¿TE GUSTARÍA LLEVAR ESTE ARTÍCULO</small></p> |
| 37 | 39 | <p class="h1 text-white">en un combo?</p> |
| ... | ... | @@ -46,6 +48,14 @@ |
| 46 | 48 | class="card-img-top img-fluid rounded-circle"> |
| 47 | 49 | </div> |
| 48 | 50 | </div> |
| 51 | + <div> | |
| 52 | + <div | |
| 53 | + class="row no-gutters w-100" | |
| 54 | + *ngIf="!promociones.length && !loading"> | |
| 55 | + <div class="col-12 text-center"> | |
| 56 | + <p class="text-white"><small>NO HAY PROMOS CON STOCK</small></p> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 49 | 59 | <div |
| 50 | 60 | class="d-flex justify-content-center mt-2" |
| 51 | 61 | *ngIf="loading"> |
src/app/shared/promocion/promocion.component.ts
| ... | ... | @@ -104,8 +104,9 @@ export class PromocionComponent implements OnInit { |
| 104 | 104 | const codigo = this.articulosPromo[0].CodArt; |
| 105 | 105 | this.promocionService.getPromociones(sector, codigo) |
| 106 | 106 | .subscribe((res: IArticulo[]) => { |
| 107 | - this.promociones = res; | |
| 107 | + res = res.filter(a => a.ExiVta > 0); | |
| 108 | 108 | this.loading = false; |
| 109 | + this.promociones = res; | |
| 109 | 110 | }, error => { console.error(error); }); |
| 110 | 111 | } |
| 111 | 112 |