All files / projects/requisition-management/src/app/pages/requisition-detail requisition-detail-page.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 1371x                                                                                                                                                                                                                                                                                
@if (view$ | async; as view) {
<div>
  <div class="float-end">
    <ul class="share-tools">
      <li>
        <a
          href="javascript:window.print();"
          class="link-print"
          rel="nofollow"
          [title]="'account.orderdetails.print_link.text' | translate"
        >
          <i class="bi bi-printer-fill"></i>
        </a>
      </li>
    </ul>
  </div>
 
  <h1>
    @if (view === 'approver') {
    {{ 'approval.detailspage.approval.heading' | translate }}
    } @else {
    {{ 'approval.detailspage.requisition.heading' | translate }}
    }
  </h1>
  <ish-error-message [error]="error$ | async" />
 
  @if (requisition$ | async; as requisition) {
  <div class="section loading-container" data-testing-id="order-summary-info">
    <ish-requisition-summary [requisition]="requisition" [view]="view" />
 
    <!-- display approval box in buyer view or for customer approvers only -->
    @if (view === 'buyer') {
    <ish-requisition-buyer-approval [requisition]="requisition" />
    } @else {
 
    <ish-requisition-buyer-approval *ishIsAuthorizedTo="'APP_B2B_ORDER_APPROVAL'" [requisition]="requisition" />
 
    }
 
    <ish-requisition-cost-center-approval [requisition]="requisition" />
 
    <ng-container *ngTemplateOutlet="approvalButtonBar; context: { requisition: requisition }" />
 
    <h1 class="h2">{{ 'approval.detailspage.order_details.heading' | translate }}</h1>
 
    @if ('shipping.messageToMerchant' | ishServerSetting) {
    <div>
      <!-- MessageToMerchant-->
      <ish-basket-merchant-message-view [data]="requisition" />
    </div>
    }
 
    <div class="row d-flex">
      <!-- Invoice Address -->
      <ish-info-box heading="checkout.widget.billing-address.heading" class="infobox-wrapper col-md-6">
        <ish-address [address]="requisition.invoiceToAddress" [displayEmail]="true" />
      </ish-info-box>
 
      <!-- Payment Method -->
      <ish-info-box heading="checkout.widget.payment_method.heading" class="infobox-wrapper col-md-6">
        <p>
          {{ requisition.payment?.displayName }}<br />{{ requisition.payment?.paymentInstrument?.accountIdentifier }}
          @if (!requisition.payment?.displayName && !requisition.payment?.paymentInstrument?.accountIdentifier) {
 
          {{ requisition.payment?.paymentInstrument }}
 
          }
        </p>
      </ish-info-box>
    </div>
 
    <div class="row d-flex">
      <!-- Shipping Address -->
      <ish-info-box heading="checkout.widget.shipping-address.heading" class="infobox-wrapper col-md-6">
        <ish-address [address]="requisition.commonShipToAddress" />
      </ish-info-box>
 
      <!-- Shipping Method -->
      <ish-info-box heading="checkout.widget.shipping_method.heading" class="infobox-wrapper col-md-6">
        <ish-basket-shipping-method [data]="requisition" />
      </ish-info-box>
    </div>
 
    <!-- Line Items -->
    @if (requisition.lineItems?.length > 0) {
    <ish-line-item-list [lineItems]="requisition.lineItems" [editable]="false" lineItemViewType="simple" />
    }
 
    <!-- order summary -->
    <div class="section row">
      <div class="col-12 col-md-6 offset-md-6">
        <div class="cost-summary">
          <h2 class="h3">{{ 'checkout.order_summary.heading' | translate }}</h2>
          <ish-basket-cost-summary [totals]="requisition.totals" />
        </div>
      </div>
    </div>
 
    <ng-container *ngTemplateOutlet="approvalButtonBar; context: { requisition: requisition }" />
 
    <ng-template #approvalButtonBar let-requisition="requisition">
      @if (requisition.approval?.statusCode === 'PENDING' && view === 'approver') {
      <div class="section text-end">
        <button (click)="approveRequisition()" type="button" class="btn btn-primary">
          {{ 'approval.detailspage.approve.button.label' | translate }}
        </button>
        <button (click)="rejectDialog.show()" type="button" class="btn btn-secondary">
          {{ 'approval.detailspage.reject.button.label' | translate }}
        </button>
      </div>
      }
    </ng-template>
    <ish-requisition-reject-dialog #rejectDialog (submitRejectRequisition)="rejectRequisition($event)" />
 
    <div class="section d-flex d-flex justify-content-between">
      <a [routerLink]="['../../' + view, { status: requisition.approval.statusCode }]" class="no-print">
        @if (view === 'buyer') {
 
        {{ 'approval.detailspage.links.return_to_requisitions' | translate }}
 
        } @else {
        {{ 'approval.detailspage.links.return_to_approvals' | translate }}
        }
      </a>
      <a routerLink="/home" class="no-print" data-testing-id="home-link">{{
        'account.orderdetails.links.continue_shopping' | translate
      }}</a>
    </div>
 
    @if (loading$ | async) {
    <ish-loading />
    }
  </div>
  }
</div>
}