From 699874f14171cb89a7fffce5292b187e9ad96702 Mon Sep 17 00:00:00 2001 From: Tosin Date: Thu, 12 Sep 2024 13:34:24 +0100 Subject: [PATCH 1/4] EMP-483 Fixed CRM5 capital details --- server/services/config/crm5DisplayConfig.json | 33 +++---------------- .../customDisplay/crm5/crm5CapitalDetails.njk | 24 ++++++++++++++ .../customDisplay/customDisplay.njk | 3 ++ 3 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 server/views/components/customDisplay/crm5/crm5CapitalDetails.njk diff --git a/server/services/config/crm5DisplayConfig.json b/server/services/config/crm5DisplayConfig.json index 1f47bd26..26229cac 100644 --- a/server/services/config/crm5DisplayConfig.json +++ b/server/services/config/crm5DisplayConfig.json @@ -174,35 +174,10 @@ "subsections": [ { "title": "Capital Details", - "fields": [ - { - "label": "Is your client under 18 years old?", - "apiField": "CapitalDetails.isUnder18" - }, - { - "label": "Does your client or partner (if living with client as couple) get Income Support, Income Based Job Seeker's Allowance, Income Related Employment and Support Allowance or Guarantee State Pension Credit?", - "apiField": "CapitalDetails.hasIncomeSupport" - }, - { - "label": "How many dependants does your client have?", - "apiField": "CapitalDetails.numOfDependants" - }, - { - "label": "Client", - "apiField": "CapitalDetails.clientSavings", - "type": "currency" - }, - { - "label": "Partner", - "apiField": "CapitalDetails.partnerSavings", - "type": "currency" - }, - { - "label": "Total", - "apiField": "CapitalDetails.totalSavings", - "type": "currency" - } - ] + "customDisplay": { + "name": "crm5CapitalDetails", + "apiField": "CapitalDetails" + } } ] }, diff --git a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk new file mode 100644 index 00000000..67fd0f3e --- /dev/null +++ b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk @@ -0,0 +1,24 @@ +{% from "../../formField.njk" import formField %} +{% from "../../formFieldHeading.njk" import formFieldHeading %} + +{% macro crm5CapitalDetails(data) %} + +
+
+

Capital Details

+
+
+
+ {{ formField({ label: "Is your client under 18 years old?", value: data.isUnder18 } ) }} + + {% if data.isUnder18 === "No" %} + {{ formField({ label: "Does your client or partner (if living with client as couple) get Income Support, Income Based Job Seeker's Allowance, Income Related Employment and Support Allowance or Guarantee State Pension Credit?", value: data.hasIncomeSupport } ) }} + {{ formField({ label: "How many dependants does your client have?", value: data.numOfDependants } ) }} + {{ formField({ label: "Client", value: data.clientSavings } ) }} + {{ formField({ label: "Partner", value: data.partnerSavings } ) }} + {{ formField({ label: "Total", value: data.totalSavings } ) }} + {% endif %} +
+
+
+{% endmacro %} \ No newline at end of file diff --git a/server/views/components/customDisplay/customDisplay.njk b/server/views/components/customDisplay/customDisplay.njk index 26efbb41..8f6d4cae 100644 --- a/server/views/components/customDisplay/customDisplay.njk +++ b/server/views/components/customDisplay/customDisplay.njk @@ -3,6 +3,7 @@ {% from "./crm4/crm4AlternativeQuotes.njk" import crm4AlternativeQuotes %} {% from "./crm4/crm4OfficeUseOnly.njk" import crm4OfficeUseOnly %} {% from "./crm5/crm5CaseDetails.njk" import crm5CaseDetails %} +{% from "./crm5/crm5CapitalDetails.njk" import crm5CapitalDetails %} {% from "./crm5/crm5OfficeUseOnly.njk" import crm5OfficeUseOnly %} {% from "./crm7/crm7CaseDisposal.njk" import crm7CaseDisposal %} {% from "./crm7/crm7Disbursements.njk" import crm7Disbursements %} @@ -38,6 +39,8 @@ {# CRM 5 #} {% elif params.name === 'crm5CaseDetails' %} {{ crm5CaseDetails(params.value) }} + {% elif params.name === 'crm5CapitalDetails' %} + {{ crm5CapitalDetails(params.value) }} {% elif params.name === 'crm5OfficeUseOnly' %} {{ crm5OfficeUseOnly(params.value) }} From 07f33e0a850034b7b1625e5c0c0875dd4d8cb358 Mon Sep 17 00:00:00 2001 From: Tosin Date: Thu, 12 Sep 2024 14:04:13 +0100 Subject: [PATCH 2/4] EMP-483: Minor change --- .../customDisplay/crm5/crm5CapitalDetails.njk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk index 67fd0f3e..0e46685b 100644 --- a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk +++ b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk @@ -9,16 +9,16 @@
- {{ formField({ label: "Is your client under 18 years old?", value: data.isUnder18 } ) }} + {{ formField({ label: "Is your client under 18 years old?", value: data.isUnder18 }) }} {% if data.isUnder18 === "No" %} {{ formField({ label: "Does your client or partner (if living with client as couple) get Income Support, Income Based Job Seeker's Allowance, Income Related Employment and Support Allowance or Guarantee State Pension Credit?", value: data.hasIncomeSupport } ) }} - {{ formField({ label: "How many dependants does your client have?", value: data.numOfDependants } ) }} - {{ formField({ label: "Client", value: data.clientSavings } ) }} - {{ formField({ label: "Partner", value: data.partnerSavings } ) }} - {{ formField({ label: "Total", value: data.totalSavings } ) }} + {{ formField({ label: "How many dependants does your client have?", value: data.numOfDependants }) }} + {{ formField({ label: "Client", value: data.clientSavings }) }} + {{ formField({ label: "Partner", value: data.partnerSavings }) }} + {{ formField({ label: "Total", value: data.totalSavings }) }} {% endif %}
-{% endmacro %} \ No newline at end of file +{% endmacro %} From 3942bdf9d897dfbca469a8f538a8183fba74b565 Mon Sep 17 00:00:00 2001 From: Tosin Date: Mon, 16 Sep 2024 16:21:26 +0100 Subject: [PATCH 3/4] EMP-483 fix amount formatting --- server/services/config/crm5DisplayConfig.json | 1 - .../components/customDisplay/crm5/crm5CapitalDetails.njk | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/services/config/crm5DisplayConfig.json b/server/services/config/crm5DisplayConfig.json index 7692276a..b43fd9b5 100644 --- a/server/services/config/crm5DisplayConfig.json +++ b/server/services/config/crm5DisplayConfig.json @@ -213,7 +213,6 @@ ], "subsections": [ { - "title": "Capital Details", "customDisplay": { "name": "crm5CapitalDetails", "apiField": "CapitalDetails" diff --git a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk index 0e46685b..34840127 100644 --- a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk +++ b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk @@ -14,9 +14,10 @@ {% if data.isUnder18 === "No" %} {{ formField({ label: "Does your client or partner (if living with client as couple) get Income Support, Income Based Job Seeker's Allowance, Income Related Employment and Support Allowance or Guarantee State Pension Credit?", value: data.hasIncomeSupport } ) }} {{ formField({ label: "How many dependants does your client have?", value: data.numOfDependants }) }} - {{ formField({ label: "Client", value: data.clientSavings }) }} - {{ formField({ label: "Partner", value: data.partnerSavings }) }} - {{ formField({ label: "Total", value: data.totalSavings }) }} + {{ formFieldHeading("Give the total savings and other capital which your client has (and their partner, if relevant) (include equity in home above £100,000 after allowing for mortgage(s) up to the value of £100,000)") }} + {{ formField({ label: "Client", value: data.clientSavings, type: "currency" }) }} + {{ formField({ label: "Partner", value: data.partnerSavings, type: "currency" }) }} + {{ formField({ label: "Total", value: data.totalSavings, type: "currency" }) }} {% endif %} From c1db2ec7c23e8aad347a58cfab09fd31204b9d70 Mon Sep 17 00:00:00 2001 From: Tosin Date: Mon, 16 Sep 2024 16:22:58 +0100 Subject: [PATCH 4/4] EMP-483 minor change --- .../views/components/customDisplay/crm5/crm5CapitalDetails.njk | 1 + 1 file changed, 1 insertion(+) diff --git a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk index 34840127..0f58034e 100644 --- a/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk +++ b/server/views/components/customDisplay/crm5/crm5CapitalDetails.njk @@ -14,6 +14,7 @@ {% if data.isUnder18 === "No" %} {{ formField({ label: "Does your client or partner (if living with client as couple) get Income Support, Income Based Job Seeker's Allowance, Income Related Employment and Support Allowance or Guarantee State Pension Credit?", value: data.hasIncomeSupport } ) }} {{ formField({ label: "How many dependants does your client have?", value: data.numOfDependants }) }} + {{ formFieldHeading("Give the total savings and other capital which your client has (and their partner, if relevant) (include equity in home above £100,000 after allowing for mortgage(s) up to the value of £100,000)") }} {{ formField({ label: "Client", value: data.clientSavings, type: "currency" }) }} {{ formField({ label: "Partner", value: data.partnerSavings, type: "currency" }) }}