diff --git a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html index 85f01a2ab..0541d5c40 100644 --- a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html +++ b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.html @@ -17,6 +17,9 @@ />
+ @if (rewardPoints() !== undefined) { + Prämie + }

{{ i.product.contributors }}

- @if (i.price?.value; as value) { + @if (rewardPoints() !== undefined) { - {{ value.value | currency: value.currency }} - - } - @if (i.price?.vat; as vat) { - - inkl. {{ vat.inPercent }}% MwSt + {{ rewardPoints() | number: '1.0-0' }} Lesepunkte + } @else { + @if (i.price?.value; as value) { + + {{ value.value | currency: value.currency }} + + } + @if (i.price?.vat; as vat) { + + inkl. {{ vat.inPercent }}% MwSt + + } }

@@ -57,7 +70,7 @@ {{ i.product.manufacturer }} | {{ i.product.ean }}
- {{ i.product.publicationDate | date: "dd. MMM yyyy" }} + {{ i.product.publicationDate | date: 'dd. MMM yyyy' }}
diff --git a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts index 69594cc8c..b2c6be8d2 100644 --- a/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts +++ b/libs/oms/feature/return-details/src/lib/return-details-order-group-item/return-details-order-group-item.component.ts @@ -1,31 +1,38 @@ -import { CurrencyPipe, DatePipe, LowerCasePipe } from "@angular/common"; +import { + CurrencyPipe, + DatePipe, + DecimalPipe, + LowerCasePipe, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, computed, inject, input, -} from "@angular/core"; -import { isaActionClose, ProductFormatIconGroup } from "@isa/icons"; +} from '@angular/core'; +import { isaActionClose, ProductFormatIconGroup } from '@isa/icons'; import { getReceiptItemAction, getReceiptItemQuantity, ReceiptItem, ReturnDetailsStore, -} from "@isa/oms/data-access"; -import { ProductImageDirective } from "@isa/shared/product-image"; -import { ItemRowComponent } from "@isa/ui/item-rows"; -import { NgIconComponent, provideIcons } from "@ng-icons/core"; -import { ReturnDetailsOrderGroupItemControlsComponent } from "../return-details-order-group-item-controls/return-details-order-group-item-controls.component"; -import { ProductRouterLinkDirective } from "@isa/shared/product-router-link"; +} from '@isa/oms/data-access'; +import { ProductImageDirective } from '@isa/shared/product-image'; +import { ItemRowComponent } from '@isa/ui/item-rows'; +import { NgIconComponent, provideIcons } from '@ng-icons/core'; +import { ReturnDetailsOrderGroupItemControlsComponent } from '../return-details-order-group-item-controls/return-details-order-group-item-controls.component'; +import { ProductRouterLinkDirective } from '@isa/shared/product-router-link'; +import { LabelComponent } from '@isa/ui/label'; @Component({ - selector: "oms-feature-return-details-order-group-item", - templateUrl: "./return-details-order-group-item.component.html", - styleUrls: ["./return-details-order-group-item.component.scss"], + selector: 'oms-feature-return-details-order-group-item', + templateUrl: './return-details-order-group-item.component.html', + styleUrls: ['./return-details-order-group-item.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [ + DecimalPipe, ItemRowComponent, ProductImageDirective, NgIconComponent, @@ -34,6 +41,7 @@ import { ProductRouterLinkDirective } from "@isa/shared/product-router-link"; LowerCasePipe, ReturnDetailsOrderGroupItemControlsComponent, ProductRouterLinkDirective, + LabelComponent, ], providers: [provideIcons({ ...ProductFormatIconGroup, isaActionClose })], }) @@ -81,7 +89,7 @@ export class ReturnDetailsOrderGroupItemComponent { */ canReturnMessage = computed(() => { const item = this.item(); - const canReturnAction = getReceiptItemAction(item, "canReturn"); + const canReturnAction = getReceiptItemAction(item, 'canReturn'); if (canReturnAction?.description) { return canReturnAction.description; @@ -89,7 +97,7 @@ export class ReturnDetailsOrderGroupItemComponent { const canReturnMessage = this.canReturn()?.message; - return canReturnMessage ?? ""; + return canReturnMessage ?? ''; }); /** @@ -117,4 +125,16 @@ export class ReturnDetailsOrderGroupItemComponent { const item = this.item(); return this.#store.availableQuantityMap()[item.id]; }); + + /** + * The reward points associated with this order item, if any. + * This value is based on item's loyalty information. + * + * @readonly + * @returns {number | undefined} The number of reward points, or undefined if none exist. + */ + rewardPoints = computed(() => { + const item = this.item(); + return item?.loyalty?.value; + }); }