diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 2b1ffe6cd..b6db3cb73 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -304,8 +304,8 @@ private self.layear = 1 end if is_general_needs? - self.prevten = 2 if managing_organisation.provider_type == "PRP" - self.prevten = 0 if managing_organisation.provider_type == "LA" + self.prevten = 32 if managing_organisation.provider_type == "PRP" + self.prevten = 30 if managing_organisation.provider_type == "LA" end end diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 72bd85641..6c5fde1fc 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -3598,7 +3598,7 @@ "depends_on": [ { "renewal": 0, - "needstype": 1 + "needstype": 0 } ] }, @@ -3624,7 +3624,7 @@ "depends_on": [ { "renewal": 1, - "needstype": 1 + "needstype": 0 } ] }, diff --git a/spec/fixtures/exports/case_logs.xml b/spec/fixtures/exports/case_logs.xml index 80ed8a9db..15d9f0300 100644 --- a/spec/fixtures/exports/case_logs.xml +++ b/spec/fixtures/exports/case_logs.xml @@ -10,7 +10,7 @@ F 2 4 - 2 + 32 0 2 32 diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index 9e4038346..2f7c85c44 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -631,15 +631,15 @@ RSpec.describe CaseLog do case_log.update!({ needstype: 1 }) record_from_db = ActiveRecord::Base.connection.execute("select prevten from case_logs where id=#{case_log.id}").to_a[0] - expect(record_from_db["prevten"]).to eq(2) - expect(case_log["prevten"]).to eq(2) + expect(record_from_db["prevten"]).to eq(32) + expect(case_log["prevten"]).to eq(32) case_log.managing_organisation.update!({ provider_type: "LA" }) case_log.update!({ needstype: 1 }) record_from_db = ActiveRecord::Base.connection.execute("select prevten from case_logs where id=#{case_log.id}").to_a[0] - expect(record_from_db["prevten"]).to eq(0) - expect(case_log["prevten"]).to eq(0) + expect(record_from_db["prevten"]).to eq(30) + expect(case_log["prevten"]).to eq(30) end it "correctly derives and saves referral" do