Merged PR 1153: #2970 Fix Remission Display CTAs on List Elements

#2970 Fix Remission Display CTAs on List Elements
This commit is contained in:
Nino Righi
2022-03-30 10:08:51 +00:00
committed by Andreas Schickinger
parent ffad6aa939
commit 05916031ad
2 changed files with 10 additions and 6 deletions

View File

@@ -72,15 +72,11 @@
<ng-container *ngIf="!!returnDto; else removeItem">
<div class="grid grid-flow-col justify-self-end gap-2">
<button
*ngIf="item.inStock === 0 && item.remissionQuantity > 0"
class="text-brand text-lg font-bold px-6 py-3"
(click)="addProductToShippingDocument()"
>
<button *ngIf="enableChangeRemissionQuantity" class="text-brand text-lg font-bold px-6 py-3" (click)="addProductToShippingDocument()">
Remi-Menge / Platzierung ändern
</button>
<button
*ngIf="item.inStock > 0 && item.remissionQuantity > 0"
*ngIf="enableToRemit"
class="bg-white border-brand border-solid border-2 text-brand font-bold text-lg px-6 py-3 rounded-full"
(click)="remit()"
>

View File

@@ -27,6 +27,14 @@ export class RemissionListItemComponent implements OnDestroy {
return this.returnDto?.receipts?.find((_) => true)?.data;
}
get enableToRemit() {
return this.item.inStock > 0 && this.item.remissionQuantity > 0;
}
get enableChangeRemissionQuantity() {
return this.enableToRemit ? this.item.inStock > 0 && this.item.remissionQuantity > 0 : this.item.remissionQuantity > 0;
}
constructor(
private _modal: UiModalService,
private _remissionService: DomainRemissionService,