diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index 49e1eb8c8..378d4f4b5 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -112,9 +112,14 @@ export default { console.error("No insurance companies found"); return; } - const parentAccountNumber = this.getParentAccountNumber(parentAccountName); - this.selectedAccountNumber = parentAccountNumber; - this.selectedAccountName = this.getParentAccountName(parentAccountNumber); + if (parentAccountName) { + const parentAccountNumber = this.getParentAccountNumber(parentAccountName); + this.selectedAccountNumber = parentAccountNumber; + this.selectedAccountName = this.getParentAccountName(parentAccountNumber); + } else { + this.selectedAccountNumber = ""; + this.selectedAccountName = ""; + } }, }, mounted() { @@ -145,6 +150,9 @@ export default { select: function (event, ui) { select(ui.item.value); }, + change: function (event, ui) { + select(ui?.item?.value); + }, }); }, 0); }, diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 55a8149e3..a15de8311 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -20,7 +20,7 @@ @@ -44,7 +44,7 @@ import { storeActions } from "@/constants/store-actions"; import { Form, defineRule } from "vee-validate"; import baseMixin from "@/mixins/base-mixin.js"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; - +import { applicationConfig } from "@/constants/application-config"; import store from "@/store"; export default { @@ -84,9 +84,22 @@ export default { originalList: [], }; }, + computed: { + isParentAccountNumber() { + return !!this.parentAccountNumber; + }, + }, methods: { + isCashParentAccountNumber() { + return ( + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER.toString() === + store.getters.order?.payment?.parentAccountNumber.toString() + ); + }, parentAccountNumberFromStore() { - const accountNumber = store.getters.order?.payment?.parentAccountNumber.toString(); + const accountNumber = !this.isCashParentAccountNumber() + ? store.getters.order?.payment?.parentAccountNumber.toString() + : ""; return accountNumber; }, arePagePrerequisitesValid() {