diff --git a/src/app/bpe/bp-view/bp-data-service.ts b/src/app/bpe/bp-view/bp-data-service.ts index b0c6e3946..0377dcd6c 100755 --- a/src/app/bpe/bp-view/bp-data-service.ts +++ b/src/app/bpe/bp-view/bp-data-service.ts @@ -582,6 +582,19 @@ export class BPDataService { return companyWorkflow[companyWorkflow.length - 1] == processId; } + // checks whether the given process is in the workflow or not + isProcessPresentInTheWorkflow(processId: string, sellerSettings: CompanySettings = null) { + if (sellerSettings == null) { + sellerSettings = this.getCompanySettings(); + } + let companyWorkflow = sellerSettings.negotiationSettings.company.processID; + // if there is no workflow specified, then consider the default flow which contains the all processes + if (!companyWorkflow || companyWorkflow.length == 0) { + return true; + } + return companyWorkflow.indexOf(processId) != -1; + } + // it retrieves the company's business workflow through settings and construct a workflow map // key is the id of process and value is true/false (whether this process is included in company's workflow or not) getCompanyWorkflowMap(companyWorkflow: string[]) { diff --git a/src/app/bpe/bp-view/negotiation/negotiation-request.component.html b/src/app/bpe/bp-view/negotiation/negotiation-request.component.html index 3c62fc42d..4713b4fc6 100644 --- a/src/app/bpe/bp-view/negotiation/negotiation-request.component.html +++ b/src/app/bpe/bp-view/negotiation/negotiation-request.component.html @@ -72,8 +72,8 @@
diff --git a/src/app/bpe/bp-view/negotiation/negotiation-request.component.ts b/src/app/bpe/bp-view/negotiation/negotiation-request.component.ts index 56326f49b..108c54d0d 100644 --- a/src/app/bpe/bp-view/negotiation/negotiation-request.component.ts +++ b/src/app/bpe/bp-view/negotiation/negotiation-request.component.ts @@ -179,7 +179,7 @@ export class NegotiationRequestComponent implements OnInit { } } - if (!this.doesManufacturerOfferHasPrice() || this.isNegotiatingAnyTerm() || this.bpDataService.isFinalProcessInTheWorkflow("Negotiation")) { + if (!this.doesManufacturerOfferHasPrice() || this.isNegotiatingAnyTerm() || !this.bpDataService.isProcessPresentInTheWorkflow('Order')) { // final check on the rfq const rfq: RequestForQuotation = this.rfq; diff --git a/src/app/bpe/bp-view/negotiation/negotiation-response.component.html b/src/app/bpe/bp-view/negotiation/negotiation-response.component.html index d47a45b2e..d68f5a1d0 100644 --- a/src/app/bpe/bp-view/negotiation/negotiation-response.component.html +++ b/src/app/bpe/bp-view/negotiation/negotiation-response.component.html @@ -89,7 +89,7 @@
-
+
@@ -100,7 +100,7 @@
-
+
diff --git a/src/app/bpe/bp-view/transport-negotiation/transport-negotiation-response.component.ts b/src/app/bpe/bp-view/transport-negotiation/transport-negotiation-response.component.ts index c57f6bb47..a8189888e 100644 --- a/src/app/bpe/bp-view/transport-negotiation/transport-negotiation-response.component.ts +++ b/src/app/bpe/bp-view/transport-negotiation/transport-negotiation-response.component.ts @@ -113,7 +113,7 @@ export class TransportNegotiationResponseComponent implements OnInit { isRequestNewQuotationDisabled(): boolean { return this.isLoading() || this.processMetadata.collaborationStatus == "COMPLETED" || this.processMetadata.collaborationStatus == "CANCELLED" - || (this.bpDataService.isFinalProcessInTheWorkflow('Negotiation') && this.quotation.documentStatusCode.name == NEGOTIATION_RESPONSES.ACCEPTED); + || (!this.bpDataService.isProcessPresentInTheWorkflow('Transport_Execution_Plan') && this.quotation.documentStatusCode.name == NEGOTIATION_RESPONSES.ACCEPTED); } isLoading(): boolean { diff --git a/src/app/bpe/shopping-cart/shopping-cart.component.ts b/src/app/bpe/shopping-cart/shopping-cart.component.ts index 7ab8f0085..96b20956e 100644 --- a/src/app/bpe/shopping-cart/shopping-cart.component.ts +++ b/src/app/bpe/shopping-cart/shopping-cart.component.ts @@ -545,7 +545,7 @@ export class ShoppingCartComponent implements OnInit { let sellerId: string = UBLModelUtils.getLinePartyId(cartLine); return !component.wrapper.lineDiscountPriceWrapper.itemPrice.hasPrice() || component.isNegotiatingAnyTerm() || - this.bpDataService.isFinalProcessInTheWorkflow('Negotiation', this.sellersSettings.get(sellerId)); + !this.bpDataService.isProcessPresentInTheWorkflow('Order', this.sellersSettings.get(sellerId)); } } }