All files / projects/requisition-management/src/app/pages/requisition-detail/requisition-cost-center-approval requisition-cost-center-approval.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 1132x                                                                                                                                                                                                                                
@if (costCenter) { @if (costCenter?.costCenterOwner.email === (userEmail$ | async)) {
<ish-info-box class="infobox-wrapper col-12">
  <div class="d-flex align-items-start">
    <h2 class="h3 pe-2">
      {{ 'approval.detailspage.costcenter.approval.heading' | translate }}
    </h2>
    <ish-lazy-budget-info />
  </div>
  <div class="row">
    <div class="col-md-6">
      <dl class="row dl-horizontal dl-separator">
        <dt class="col-6">{{ 'approval.detailspage.cost_center.label' | translate }}</dt>
        <dd class="col-6">{{ costCenter.costCenterId }} {{ costCenter.name }}</dd>
      </dl>
    </div>
  </div>
 
  <div class="row section">
    <div class="col-md-6 pt-1">
      <dl class="row dl-horizontal dl-separator">
        <!-- prettier-ignore -->
        <dt class="col-6">{{ 'approval.detailspage.costcenter.budget.label' | translate: { '0': costCenter.budgetPeriod } }}</dt>
        <dd class="col-6">
          <strong>
            @if (costCenter?.budget) {
            {{ costCenter.budget | ishPrice }}
            } @else {
            {{ 'account.budget.unlimited' | translate }}
            }
          </strong>
        </dd>
      </dl>
      @if (costCenter.spentBudget && ccVal) {
      <dl class="row dl-horizontal dl-separator">
        <dt class="col-6">{{ 'account.budget.already_spent.label' | translate }}</dt>
        <dd class="col-6" [ngClass]="{ 'text-danger': ccVal.spentPercentage > 1 }">
          {{ costCenter.spentBudget | ishPrice }} ({{ ccVal.spentPercentage | percent }})
        </dd>
      </dl>
      } @if (requisition.approval.statusCode !== 'APPROVED' && ccVal) {
      <dl class="row dl-horizontal dl-separator">
        <!-- prettier-ignore -->
        <dt class="col-6">{{ 'approval.detailspage.budget.including_order.label' | translate : { recurring: !requisition.requisitionNo } }}</dt>
        <dd class="col-6" [ngClass]="{ 'text-danger': ccVal.spentPercentageIncludingThisRequisition > 1 }">
          {{ ccVal.spentBudgetIncludingThisRequisition | ishPrice }} ({{
            ccVal.spentPercentageIncludingThisRequisition | percent
          }})
        </dd>
      </dl>
      }
    </div>
    @if (costCenter.budget) {
    <div class="col-md-6 mb-2">
      <ish-budget-bar
        [budget]="costCenter.budget"
        [spentBudget]="costCenter.spentBudget"
        [additionalAmount]="orderTotal"
      />
    </div>
    }
  </div>
 
  @if (buyer) {
  <div class="row" data-testing-id="cost-center-buyer-budget">
    <div class="col-md-6">
      <dl class="row dl-horizontal dl-separator">
        <!-- prettier-ignore -->
        <dt class="col-6">{{ 'approval.detailspage.buyer.budget.label' | translate: { '0': buyer.budgetPeriod } }}</dt>
        <dd class="col-6">
          <strong>
            @if (buyer?.budget) {
            {{ buyer.budget | ishPrice }}
            } @else {
            {{ 'account.budget.unlimited' | translate }}
            }
          </strong>
        </dd>
      </dl>
      @if (buyer.spentBudget) {
      <dl class="row dl-horizontal dl-separator">
        <dt class="col-6">{{ 'account.budget.already_spent.label' | translate }}</dt>
        <dd class="col-6" [ngClass]="{ 'text-danger': bVal.spentPercentage > 1 }">
          {{ buyer.spentBudget | ishPrice }} ({{ bVal.spentPercentage | percent }})
        </dd>
      </dl>
      } @if (requisition.approval.statusCode !== 'APPROVED') {
      <dl class="row dl-horizontal dl-separator">
        <!-- prettier-ignore -->
        <dt class="col-6">{{ 'approval.detailspage.budget.including_order.label' | translate : { recurring: !requisition.requisitionNo } }}</dt>
        <dd class="col-6" [ngClass]="{ 'text-danger': bVal.spentPercentageIncludingThisRequisition > 1 }">
          {{ bVal.spentBudgetIncludingThisRequisition | ishPrice }} ({{
            bVal.spentPercentageIncludingThisRequisition | percent
          }})
        </dd>
      </dl>
      }
    </div>
    @if (buyer.budget) {
    <div class="col-md-6 mb-2">
      <ish-budget-bar [budget]="buyer.budget" [spentBudget]="buyer.spentBudget" [additionalAmount]="orderTotal" />
    </div>
    }
  </div>
  } @if (requisition.recurrence) {
  <div class="row mb-3">
    <div class="col-md-6">
      <ish-order-recurrence [recurrence]="requisition.recurrence" labelCssClass="col-6" valueCssClass="col-6" />
    </div>
  </div>
  }
</ish-info-box>
} }