Skip to content

Commit

Permalink
Merge pull request #285 from ministryofjustice/EMP-483-crm-5-defects-…
Browse files Browse the repository at this point in the history
…capital-details-page

EMP-483: CRM 5 defects - capital details page
  • Loading branch information
muyinatech committed Sep 16, 2024
2 parents 6a8a588 + c1db2ec commit f80ee1c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
34 changes: 4 additions & 30 deletions server/services/config/crm5DisplayConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,36 +213,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"
}
}
]
},
Expand Down
26 changes: 26 additions & 0 deletions server/views/components/customDisplay/crm5/crm5CapitalDetails.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% from "../../formField.njk" import formField %}
{% from "../../formFieldHeading.njk" import formFieldHeading %}

{% macro crm5CapitalDetails(data) %}

<div class="govuk-form-group govuk-summary-card govuk-!-margin-bottom-6">
<div class="govuk-summary-card__title-wrapper">
<h3 class="govuk-summary-card__title">Capital Details</h3>
</div>
<div class="govuk-summary-card__content">
<dl class="govuk-summary-list">
{{ 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 }) }}

{{ 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 %}
</dl>
</div>
</div>
{% endmacro %}
3 changes: 3 additions & 0 deletions server/views/components/customDisplay/customDisplay.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down Expand Up @@ -39,6 +40,8 @@
{# CRM 5 #}
{% elif params.name === 'crm5CaseDetails' %}
{{ crm5CaseDetails(params.value) }}
{% elif params.name === 'crm5CapitalDetails' %}
{{ crm5CapitalDetails(params.value) }}
{% elif params.name === 'crm5OfficeUseOnly' %}
{{ crm5OfficeUseOnly(params.value) }}

Expand Down

0 comments on commit f80ee1c

Please sign in to comment.