Skip to content

Commit

Permalink
Cleanup + added fix for new note
Browse files Browse the repository at this point in the history
  • Loading branch information
JazzarKarim committed Dec 1, 2023
1 parent 5bfbe34 commit 8bd7a04
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/components/Amalgamation/AmalgamatingBusinesses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ import { BusinessIF, BusinessLookupIF, EmptyBusinessLookup } from '@/interfaces'
})
export default class AmalgamatingBusinesses extends Mixins(CommonMixin) {
@Getter(useStore) getAmalgamatingBusinesses!: Array<BusinessIF>
@Getter(useStore) isAmalgamationFilingHorizontal!: boolean
@Getter(useStore) isRoleStaff!: boolean
@Action(useStore) setAmalgamatingBusinesses!: (x: Array<BusinessIF>) => void
Expand Down Expand Up @@ -191,6 +192,16 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) {
// this.addAmalgatingForeignBusinessDisabled = true
}
// Add to the amalgamating businesses array.
// If EP (A type), cannot be part of short form horizontal amalgamation.
pushToAmalgamatingBusinesses (business: any): void {
if (this.isAmalgamationFilingHorizontal) {
if (business.legalType !== 'A') this.amalgamatingBuinesses.push(business)
} else {
this.amalgamatingBuinesses.push(business)
}
}
async setAmalgamatingBusiness (businessLookup: BusinessLookupIF): Promise<void> {
// Get the amalgamating business information
// Will have a different format depending on the business
Expand Down Expand Up @@ -221,11 +232,9 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) {
const filteredBusinesses = this.amalgamatingBuinesses.filter(function (id) {
return id.identifier === business.identifier
})
if (filteredBusinesses.length === 0) {
this.amalgamatingBuinesses.push(business)
}
if (filteredBusinesses.length === 0) this.pushToAmalgamatingBusinesses(business)
} else {
this.amalgamatingBuinesses.push(business)
this.pushToAmalgamatingBusinesses(business)
}
// Set the amalgamated businesses array in the store.
Expand Down

0 comments on commit 8bd7a04

Please # to comment.