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 | 2x 2x 2x 2x 4x 4x 4x 4x | import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { AttributeHelper } from 'ish-core/models/attribute/attribute.helper';
import { Requisition, RequisitionViewer } from '../../../models/requisition/requisition.model';
@Component({
selector: 'ish-requisition-summary',
templateUrl: './requisition-summary.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RequisitionSummaryComponent implements OnInit {
@Input({ required: true }) requisition: Requisition;
@Input() view: RequisitionViewer = 'buyer';
costCenterName: string;
customerApproverCount: number;
ngOnInit() {
this.costCenterName = AttributeHelper.getAttributeValueByAttributeName(
this.requisition?.attributes,
'BusinessObjectAttributes#Order_CostCenter_Name'
);
this.customerApproverCount = this.getCustomerApproverCount();
}
private getCustomerApproverCount() {
return this.requisition?.approval?.statusCode === 'PENDING'
? this.requisition?.approval?.customerApproval.approvers?.length || 1
: this.requisition?.approval?.approvers?.length || 1;
}
}
|