diff --git a/projects/requisition-management/src/app/services/requisition-management-breadcrumb/requisition-management-breadcrumb.service.ts b/projects/requisition-management/src/app/services/requisition-management-breadcrumb/requisition-management-breadcrumb.service.ts index ee040e9298..72f914b47b 100644 --- a/projects/requisition-management/src/app/services/requisition-management-breadcrumb/requisition-management-breadcrumb.service.ts +++ b/projects/requisition-management/src/app/services/requisition-management-breadcrumb/requisition-management-breadcrumb.service.ts @@ -4,10 +4,10 @@ import { TranslateService } from '@ngx-translate/core'; import { EMPTY, Observable, of } from 'rxjs'; import { map, switchMap, withLatestFrom } from 'rxjs/operators'; +import { AccountFacade } from 'ish-core/facades/account.facade'; import { AppFacade } from 'ish-core/facades/app.facade'; import { BreadcrumbItem } from 'ish-core/models/breadcrumb-item/breadcrumb-item.interface'; import { selectRouteParam } from 'ish-core/store/core/router'; -import { log } from 'ish-core/utils/dev/operators'; import { whenFalsy, whenTruthy } from 'ish-core/utils/operators'; import { RequisitionManagementFacade } from '../../facades/requisition-management.facade'; @@ -18,6 +18,7 @@ export class RequisitionManagementBreadcrumbService { private appFacade: AppFacade, private store: Store, private requisitionManagementFacade: RequisitionManagementFacade, + private accountFacade: AccountFacade, private translateService: TranslateService ) {} @@ -25,7 +26,6 @@ export class RequisitionManagementBreadcrumbService { return this.appFacade.routingInProgress$.pipe( whenFalsy(), withLatestFrom(this.appFacade.path$.pipe(whenTruthy())), - log('path'), switchMap(([, path]) => { if (path.endsWith('/buyer')) { return of([{ key: 'account.requisitions.requisitions' }]); @@ -66,6 +66,21 @@ export class RequisitionManagementBreadcrumbService { ) ); } + if (path.includes('/recurring-orders/')) { + return this.accountFacade.selectedRecurringOrder$.pipe( + whenTruthy(), + withLatestFrom(this.translateService.get('account.recurring_order.details.breadcrumb')), + map(([recurringOrder, translation]) => [ + { + key: 'account.recurring_orders.breadcrumb', + link: [`/account/recurring-orders`], + }, + { + text: `${translation} - ${recurringOrder.number}`, + }, + ]) + ); + } return EMPTY; }) ); diff --git a/src/app/core/models/recurring-order/recurring-order.interface.ts b/src/app/core/models/recurring-order/recurring-order.interface.ts index 985b575a82..1a6105d6ba 100644 --- a/src/app/core/models/recurring-order/recurring-order.interface.ts +++ b/src/app/core/models/recurring-order/recurring-order.interface.ts @@ -1,6 +1,8 @@ import { AddressData } from 'ish-core/models/address/address.interface'; import { Link } from 'ish-core/models/link/link.model'; +import { OrderLineItem } from 'ish-core/models/order/order.model'; import { PriceData } from 'ish-core/models/price/price.interface'; +import { ShippingMethod } from 'ish-core/models/shipping-method/shipping-method.model'; import { UserData } from 'ish-core/models/user/user.interface'; export interface RecurringOrderData extends Omit { @@ -11,7 +13,7 @@ export interface RecurringOrderData extends OmitRecurring Order Details +

{{ 'account.recurring_order.heading' | translate }}

+ +

+ {{ 'account.recurring_order.subtitle' | translate }} +

+ +
+ +
+
+
+
{{ 'account.recurring_order.details.order_number.label' | translate }}
+
{{ recurringOrder.number }}
+
+ +
+
{{ 'account.recurring_order.details.requisition_number.label' | translate }}
+
{{ recurringOrder.number }}
+
+ +
+
{{ 'account.recurring_order.details.creation_date.label' | translate }}
+
{{ recurringOrder.creationDate | ishDate }}
+
+ +
+
{{ 'account.recurring_order.details.last_order_date.label' | translate }}
+
+ {{ recurringOrder.lastOrderDate ? (recurringOrder.lastOrderDate | ishDate) : '-' }} +
+
+ +
+
{{ 'account.recurring_order.details.next_order_date.label' | translate }}
+
+ {{ recurringOrder.nextOrderDate ? (recurringOrder.nextOrderDate | ishDate) : '-' }} +
+
+ +
+
{{ 'account.recurring_order.details.status.label' | translate }}
+
+ {{ 'account.recurring_order.details.expired.text' }} + +
+
+
+
+
+
{{ 'account.recurring_order.details.order_count.label' | translate }}
+
{{ recurringOrder.orderCount }}
+
+ +
+
{{ 'account.recurring_order.details.last_placed_orders.label' | translate }}
+
+
+
+
+ +
+ + + + + + +
+
{{ 'account.recurring_order.details.cost_center.label' | translate }}
+
{{ recurringOrder.costCenter }}
+
+
+
{{ 'account.recurring_order.details.project_number.label' | translate }}
+
+
+
+
{{ 'account.recurring_order.details.basket_number.label' | translate }}
+
+
+
+
{{ 'account.recurring_order.details.order_frequency.label' | translate }}
+
{{ recurringOrder.recurrence.interval | ishFrequency }}
+
+
+
{{ 'account.recurring_order.details.start_date.label' | translate }}
+
+ {{ recurringOrder.recurrence.startDate }} +
+
+
+
{{ 'account.recurring_order.details.end_date.label' | translate }}
+
{{ recurringOrder.lastOrderDate ? (recurringOrder.lastOrderDate | ishDate) : '-' }}
+
+
+
+ +
+ + + + + + + + +
+ +
+ + + + + + + +
+

{{ recurringOrder.payment.status }}

+
+

+ {{ recurringOrder.payment.displayName }}
{{ recurringOrder.payment.paymentInstrument.accountIdentifier }} + + {{ recurringOrder.payment.paymentInstrument }} + +

+
+
+
+ + +
{{ recurringOrder | json }}
diff --git a/src/app/pages/account-recurring-order/account-recurring-order-page.component.ts b/src/app/pages/account-recurring-order/account-recurring-order-page.component.ts index f43e9af1d8..f7d8664730 100644 --- a/src/app/pages/account-recurring-order/account-recurring-order-page.component.ts +++ b/src/app/pages/account-recurring-order/account-recurring-order-page.component.ts @@ -17,4 +17,8 @@ export class AccountRecurringOrderPageComponent implements OnInit { ngOnInit() { this.recurringOrder$ = this.accountFacade.selectedRecurringOrder$; } + + switchActiveStatus(recurringOrder: { id: string; active: boolean }) { + this.accountFacade.switchActiveStatusRecurringOrder(recurringOrder.id, recurringOrder.active); + } } diff --git a/src/app/pages/account-recurring-orders/recurring-order-list/recurring-order-list.component.html b/src/app/pages/account-recurring-orders/recurring-order-list/recurring-order-list.component.html index a3ba3e5465..793e84433a 100644 --- a/src/app/pages/account-recurring-orders/recurring-order-list/recurring-order-list.component.html +++ b/src/app/pages/account-recurring-orders/recurring-order-list/recurring-order-list.component.html @@ -76,7 +76,7 @@ *cdkCellDef="let recurringOrder" [attr.data-label]="'account.recurring_orders.table.next_order_date' | translate" > - {{ recurringOrder.nextOrderDate | ishDate }} + {{ recurringOrder.nextOrderDate ? (recurringOrder.nextOrderDate | ishDate) : '-' }} @@ -99,11 +99,15 @@ - + {{ + 'account.recurring_orders.expired.text' | translate + }} + + diff --git a/src/assets/i18n/en_US.json b/src/assets/i18n/en_US.json index 9862635894..87fc854e31 100644 --- a/src/assets/i18n/en_US.json +++ b/src/assets/i18n/en_US.json @@ -405,7 +405,32 @@ "account.quotes.widget.responded.label": "Responded quotes", "account.quotes.widget.submitted.label": "Sent requests", "account.quotes.widget.view_all_quotes.link": "View all quotes", - "account.recurring_orders.breadcrumb": "Recurring orders", + "account.recurring_order.details.additional_info.heading": "Additional information", + "account.recurring_order.details.basket_number.label": "Basket number", + "account.recurring_order.details.billing_address.heading": "Invoice address", + "account.recurring_order.details.breadcrumb": "Recurring order", + "account.recurring_order.details.buyer_info.heading": "Buyer", + "account.recurring_order.details.cost_center.label": "Cost center", + "account.recurring_order.details.creation_date.label": "Creation date", + "account.recurring_order.details.end_date.label": "Until", + "account.recurring_order.details.expired.text": "Ended", + "account.recurring_order.details.last_order_date.label": "Last order date", + "account.recurring_order.details.last_placed_orders.label": "Last placed orders", + "account.recurring_order.details.next_order_date.label": "Next order date", + "account.recurring_order.details.order_count.label": "Order count", + "account.recurring_order.details.order_frequency.label": "Recur every", + "account.recurring_order.details.order_number.label": "Recurring order no.", + "account.recurring_order.details.payment_method.heading": "Payment method", + "account.recurring_order.details.project_number.label": "Project number", + "account.recurring_order.details.requisition_number.label": "Requisition no.", + "account.recurring_order.details.shipping_address.heading": "Shipping address", + "account.recurring_order.details.shipping_method.heading": "Shipping method", + "account.recurring_order.details.start_date.label": "Start from", + "account.recurring_order.details.status.label": "Status", + "account.recurring_order.heading": "Recurring Order Details", + "account.recurring_order.subtitle": "Below are details about the item(s) in your recurring order. If you ordered more than one item, please note that some items may display a different shipping method and/or status because they are shipped in a separate package.", + "account.recurring_orders.breadcrumb": "Recurring Order", + "account.recurring_orders.expired.text": "Ended", "account.recurring_orders.heading": "Recurring orders", "account.recurring_orders.navigation.link": "Recurring orders", "account.recurring_orders.no_placed_orders_message": "You have not placed a recurring order yet.",