Skip to content

Commit

Permalink
Merge pull request #364 from shibaken/main
Browse files Browse the repository at this point in the history
shibaken/main to dbca-wa/main
  • Loading branch information
jawaidm authored Nov 2, 2023
2 parents 36b17d3 + c357ae7 commit 4843173
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions mooringlicensing/components/proposals/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,16 @@ def get(self, request, format=None):
else:
# Amendment/Renewal
if proposal.approval:
vooas = proposal.approval.child_obj.get_current_vessel_ownership_on_approvals()
existing_vessel_ids = [] # Store id of the vessel that belongs to the proposal.approval
for vessel_ownership_on_approval in vooas:
existing_vessel_ids.append(vessel_ownership_on_approval.vessel_ownership.vessel.id)
if proposal.approval.child_obj.code == 'ml':
vooas = proposal.approval.child_obj.get_current_vessel_ownership_on_approvals()
for vessel_ownership_on_approval in vooas:
existing_vessel_ids.append(vessel_ownership_on_approval.vessel_ownership.vessel.id)
else:
v_details = proposal.approval.child_obj.current_proposal.latest_vessel_details
v_ownership = proposal.approval.child_obj.current_proposal.vessel_ownership
if v_details and not v_ownership.end_date:
existing_vessel_ids.append(v_details.vessel.id)

if allow_add_new_vessel:
# Customer wants to add a new vessel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ from '@/utils/hooks'
},
},
mounted: function () {
this.resetCurrentVessel();
},
created: function() {
if (this.proposal && !this.proposal.keep_existing_vessel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
values:null,
profile: {},
uuid: 0,
keepCurrentVessel: true,
keepCurrentVessel: false,
showPaymentTab: true,
showInsuranceTab: true,
higherVesselCategory: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
profile: {},
uuid: 0,
mooringAuthorisationUuid: 0,
keepCurrentVessel: true,
keepCurrentVessel: false,
changeMooring: false,
showPaymentTab: false,
showInsuranceTab: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default {
values: null,
profile: {},
uuid: 0,
keepCurrentVessel: true,
keepCurrentVessel: false,
mooringPreferenceChanged: false,
vesselOwnershipChanged: false,
//vesselLength: null,
Expand Down

0 comments on commit 4843173

Please sign in to comment.