Browse Source

Update pages that depend on companybuy

pull/2755/head
Manny Dinssa 9 months ago
parent
commit
327736d7e8
  1. 7
      app/models/form/sales/pages/buyer_live.rb
  2. 20
      app/models/form/sales/pages/joint_purchase.rb

7
app/models/form/sales/pages/buyer_live.rb

@ -2,9 +2,10 @@ class Form::Sales::Pages::BuyerLive < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_live"
@depends_on = [{
"companybuy" => 2,
}]
end
def depends_on
[{ "companybuy" => 2 }] unless form.start_year_2025_or_later?
end
def questions

20
app/models/form/sales/pages/joint_purchase.rb

@ -2,11 +2,21 @@ class Form::Sales::Pages::JointPurchase < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "joint_purchase"
@depends_on = [
{ "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
{ "companybuy" => 2 },
]
end
def depends_on
if form.start_year_2025_or_later?
[
{ "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
]
else
[
{ "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
{ "companybuy" => 2 },
]
end
end
def questions

Loading…
Cancel
Save