Skip to content

Commit bf824ba

Browse files
committed
DDCE-7698 Update declare the employee to exclude
1 parent c6fec28 commit bf824ba

File tree

7 files changed

+305
-26
lines changed

7 files changed

+305
-26
lines changed

app/controllers/ExclusionListController.scala

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class ExclusionListController @Inject() (
6565
ninoExclusionSearchFormView: NinoExclusionSearchForm,
6666
noNinoExclusionSearchFormView: NoNinoExclusionSearchForm,
6767
searchResultsView: SearchResults,
68+
searchResultsMPBIKView: SearchResultsMPBIK,
69+
declareEmployeeMPBIKView: DeclareEmployeeMPBIK,
6870
whatNextExclusionView: WhatNextExclusion,
6971
removalConfirmationView: RemovalConfirmation,
7072
whatNextRescindView: WhatNextRescind
@@ -511,17 +513,41 @@ class ExclusionListController @Inject() (
511513
)
512514
)
513515
}
514-
case _ =>
515-
Ok(
516-
searchResultsView(
517-
controllersReferenceData.yearRange,
518-
isCurrentTaxYear,
519-
iabdType,
520-
uniqueListOfMatches,
521-
formMappings.individualSelectionForm,
522-
formType
516+
case n =>
517+
if (mpbikToggle) {
518+
if(n < 1) { //should be == 0
519+
Ok(
520+
declareEmployeeMPBIKView(
521+
controllersReferenceData.yearRange,
522+
isCurrentTaxYear,
523+
iabdType,
524+
uniqueListOfMatches.head
525+
)
526+
)
527+
} else {
528+
Ok(
529+
searchResultsMPBIKView(
530+
controllersReferenceData.yearRange,
531+
isCurrentTaxYear,
532+
iabdType,
533+
uniqueListOfMatches,
534+
formMappings.individualSelectionForm,
535+
formType
536+
)
537+
)
538+
}
539+
} else {
540+
Ok(
541+
searchResultsView(
542+
controllersReferenceData.yearRange,
543+
isCurrentTaxYear,
544+
iabdType,
545+
uniqueListOfMatches,
546+
formMappings.individualSelectionForm,
547+
formType
548+
)
523549
)
524-
)
550+
}
525551
}
526552
}
527553

@@ -533,19 +559,34 @@ class ExclusionListController @Inject() (
533559
.bindFromRequest()
534560
.fold(
535561
formWithErrors =>
536-
Future.successful(
537-
BadRequest(
538-
searchResultsView(
539-
controllersReferenceData.yearRange,
540-
year,
541-
iabdType,
542-
session.get.listOfMatches.get.pbikExclusionList,
543-
formWithErrors,
544-
formType
562+
if (mpbikToggle) {
563+
Future.successful(
564+
BadRequest(
565+
searchResultsMPBIKView(
566+
controllersReferenceData.yearRange,
567+
year,
568+
iabdType,
569+
session.get.listOfMatches.get.pbikExclusionList,
570+
formWithErrors,
571+
formType
572+
)
573+
)
574+
)
575+
} else {
576+
Future.successful(
577+
BadRequest(
578+
searchResultsView(
579+
controllersReferenceData.yearRange,
580+
year,
581+
iabdType,
582+
session.get.listOfMatches.get.pbikExclusionList,
583+
formWithErrors,
584+
formType
585+
)
545586
)
546587
)
547-
),
548-
values => {
588+
},
589+
values => { //redirect to the DeclareEmployeeMPBIK
549590
val individualsDetails: Option[TracePersonResponse] =
550591
session.get.listOfMatches.get.pbikExclusionList
551592
.find(person => person.nationalInsuranceNumber == values.nino)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@*
2+
* Copyright 2026 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*@
16+
17+
@import utils.TaxDateUtils
18+
@import views.templatemodels.PageTitle
19+
20+
@this(
21+
govukLayoutWrapper: GovukLayoutWrapper,
22+
govukWarningText: GovukWarningText,
23+
formWithCSRF: FormWithCSRF,
24+
taxDateUtils: TaxDateUtils
25+
)
26+
27+
@(
28+
taxYearRange: TaxYearRange,
29+
year: String,
30+
iabdType: IabdType,
31+
employee: TracePersonResponse
32+
)(implicit request: Request[?], messages: Messages)
33+
34+
@expenseOrBenefit = @{messages(s"BenefitInKind.label.${iabdType.id}")}
35+
@govukLayoutWrapper(PageTitle(messages("ExclusionSearchMPBIK.title.single"))) {
36+
37+
<h1 id="title" class="govuk-heading-xl">
38+
<span class="govuk-caption-l">@messages("ExclusionSearchMPBIK.title.span.taxYear.cy0", s"${taxYearRange.cy}", s"${taxYearRange.cyplus1}")</span>
39+
@messages("ExclusionSearchMPBIK.title.single")
40+
</h1>
41+
42+
<h2 class="govuk-heading-m">@expenseOrBenefit</h2>
43+
44+
<p class="govuk-body">@messages("ExclusionImportantMPBIK.Reminder", expenseOrBenefit, taxDateUtils.getDisplayTodayDate())</p>
45+
46+
<div class="govuk-inset-text">
47+
@messages("ExclusionSearchMPBIK.inset.text")
48+
</div>
49+
50+
<dl class="govuk-summary-list">
51+
<div class="govuk-summary-list__row">
52+
<dt class="govuk-summary-list__key">@messages("ExclusionSearchMPBIK.field.employee.name")</dt>
53+
<dd class="govuk-summary-list__value">@employee.fullName</dd>
54+
</div>
55+
<div class="govuk-summary-list__row">
56+
<dt class="govuk-summary-list__key">@messages("ExclusionSearchMPBIK.field.employee.ni")</dt>
57+
<dd class="govuk-summary-list__value">@employee.nationalInsuranceNumber</dd>
58+
</div>
59+
<div class="govuk-summary-list__row">
60+
<dt class="govuk-summary-list__key">@messages("ExclusionSearchMPBIK.field.employee.payrollId")</dt>
61+
<dd class="govuk-summary-list__value">@employee.getWorksPayrollNumber</dd>
62+
</div>
63+
</dl>
64+
65+
@govukWarningText(WarningText(
66+
iconFallbackText = Some(messages("site.warning")),
67+
content = Text(messages("ExclusionSearchMPBIK.warning"))
68+
))
69+
70+
<p id="i-confirm-that" class="govuk-body">
71+
@messages("ExclusionSearchMPBIK.confirmation.p")
72+
</p>
73+
<ul class="govuk-list govuk-list--bullet">
74+
<li>@messages("ExclusionSearchMPBIK.confirmation.bullet1")</li>
75+
<li>@messages("ExclusionSearchMPBIK.confirmation.bullet2")</li>
76+
</ul>
77+
78+
<p id="i-understand-that" class="govuk-body">
79+
@messages("ExclusionSearchMPBIK.understanding.p")
80+
</p>
81+
<ul class="govuk-list govuk-list--bullet">
82+
<li>@messages("ExclusionSearchMPBIK.understanding.bullet1")</li>
83+
</ul>
84+
85+
<div class="govuk-form-group">
86+
<a href="@routes.ExclusionListController.updateExclusions(year, iabdType)" class="govuk-button" role="button" id="button-confirm">@messages("Service.confirmAndContinue")</a>
87+
</div>
88+
89+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
@*
2+
* Copyright 2026 HM Revenue & Customs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*@
16+
17+
@import utils.TaxDateUtils
18+
@import views.templatemodels.PageTitle
19+
20+
@this(
21+
govukLayoutWrapper: GovukLayoutWrapper,
22+
govukWarningText: GovukWarningText,
23+
formWithCSRF: FormWithCSRF,
24+
taxDateUtils: TaxDateUtils
25+
)
26+
27+
@(
28+
taxYearRange: TaxYearRange,
29+
year: String,
30+
iabdType: IabdType,
31+
listOfMatches: List[TracePersonResponse],
32+
listOfMatchesForm: Form[ExclusionNino],
33+
formType: String
34+
)(implicit request: Request[?], messages: Messages)
35+
36+
@govukLayoutWrapper(PageTitle(messages("ExclusionSearchMPBIK.title.multiple"), listOfMatchesForm.hasErrors)) {
37+
38+
@if(listOfMatchesForm("individualNino").hasErrors) {
39+
<div class="govuk-error-summary" role="group" aria-labelledby="error-summary-heading-1" tabindex="-1">
40+
41+
<h2 class="govuk-error-summary__title" id="error-summary-heading-1">
42+
@messages("Service.errorSummary.heading")
43+
</h2>
44+
<div class="govuk-error-summary__body">
45+
<ul class="govuk-list govuk-error-summary__list">
46+
@if(listOfMatchesForm.error("individualNino").get.message.equals("error.required")){
47+
<li><a href="#employee-radio-0">@messages("error.exclusion.multi.selection")</a></li>
48+
}
49+
</ul>
50+
</div>
51+
</div>
52+
}
53+
54+
<h1 id="title" class="govuk-heading-xl">
55+
<span class="govuk-caption-l">@messages("ExclusionSearchMPBIK.form.tax.year", s"${taxYearRange.cy}", s"${taxYearRange.cyplus1}")</span>
56+
@messages("ExclusionSearchMPBIK.title.multiple")
57+
</h1>
58+
59+
@formWithCSRF(action = routes.ExclusionListController.updateMultipleExclusions(year, iabdType, formType)) {
60+
<div class="govuk-form-group @if(listOfMatchesForm("individualNino").hasErrors){govuk-form-group--error}">
61+
<fieldset class="govuk-fieldset" @if(listOfMatchesForm("individualNino").hasErrors){aria-describedby="selection-error"}>
62+
@if(listOfMatchesForm("individualNino").hasErrors) {
63+
<span id="selection-error" class="govuk-error-message">
64+
<span class="govuk-visually-hidden">@messages("Service.error"):</span>
65+
@messages("error.exclusion.multi.selection")
66+
</span>
67+
}
68+
<div class="govuk-radios">
69+
@for(index <- 0 until listOfMatches.length) {
70+
<div class="govuk-radios__item">
71+
<input class="govuk-radios__input" id="employee-radio-@index" type="radio" aria-describedby="employee-hint-@index" name="individualNino" value='@listOfMatches(index).nationalInsuranceNumber'>
72+
<label class="govuk-label govuk-radios__label govuk-label--s" for="employee-radio-@index">
73+
@listOfMatches(index).fullName
74+
</label>
75+
<span id="employee-hint-@index" class="govuk-hint govuk-radios__hint">
76+
@messages("Service.field.nino"): @listOfMatches(index).nationalInsuranceNumber <br>
77+
@messages("Service.field.worksnumber"): @listOfMatches(index).getWorksPayrollNumber
78+
</span>
79+
</div>
80+
}
81+
</div>
82+
</fieldset>
83+
</div>
84+
85+
<input type="submit" class="govuk-button" role="button" id="button-continue" value="@messages("Service.continueMPBIK")">
86+
}
87+
}

conf/messages

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,36 @@ ExclusionRemoval.whatYouNeedToTellYourEmployees.p2 = You also need to tell them
294294
ExclusionRemoval.Service.finish.rescinded = View your excluded employees
295295
ExclusionRemoval.Service.back.overview.ViewYourSummary = View your summary of registered benefits and expenses
296296

297+
#*************************************************************
298+
# Exclusion search MPBIK
299+
#*************************************************************
300+
301+
ExclusionSearchMPBIK.title.multiple = Which employee do you want to exclude?
302+
ExclusionSearchMPBIK.form.tax.year = Tax year April {0} to {1}
303+
304+
#*************************************************************
305+
# Exclusion overview MPBIK
306+
#*************************************************************
307+
308+
ExclusionSearchMPBIK.title.single = Declare the employee to exclude from this benefit
309+
ExclusionSearchMPBIK.title.multiple = Which employee do you want to exclude?
310+
ExclusionSearchMPBIK.title.span.taxYear.cy0 = Tax year April {0} to {1}
311+
ExclusionImportantMPBIK.Reminder = By confirming, you will exclude this employee from having {0} taxed through payroll from {1}.
312+
ExclusionSearchMPBIK.inset.text = From 6 April 2027, employers will have to tax all employee benefits through payroll (except loans and accommodation). Any employees excluded from benefits for the 2026 to 2027 tax year will no longer be excluded from having their benefits taxed through payroll.
313+
314+
ExclusionSearchMPBIK.field.employee.name = Employee name
315+
ExclusionSearchMPBIK.field.employee.ni = National Insurance number (last letter not shown)
316+
ExclusionSearchMPBIK.field.employee.payrollId = Payroll ID or Works number
317+
318+
ExclusionSearchMPBIK.warning = You will not be able to payroll this benefit for this employee again for this tax year.
319+
320+
ExclusionSearchMPBIK.confirmation.p = I confirm that:
321+
ExclusionSearchMPBIK.confirmation.bullet1 = I will report the value of the benefit for this employee on a P11D
322+
ExclusionSearchMPBIK.confirmation.bullet2 = I will send the P11D at the end of the tax year
323+
324+
ExclusionSearchMPBIK.understanding.p = I understand that:
325+
ExclusionSearchMPBIK.understanding.bullet1 = I cannot add this employee back to this benefit for this tax year
326+
297327
#*************************************************************
298328
# Benefits messages
299329
#*************************************************************

conf/messages.cy

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ StartPage.link.agent = Dechrau nawr
105105
# Start Page MPBIK
106106
#*************************************************************
107107

108-
StartPageMPBIK.heading.organisation = Trethu buddiannau a threuliau drwy’r gyflogres
108+
StartPageMPBIK.heading.organisation = Talu buddiannau a threuliau drwy’r gyflogres
109109
StartPageMPBIK.p1.organisation = O XX Tachwedd 2026 ymlaen, byddwch yn gallu defnyddio’r gwasanaeth hwn i gofrestru i drethu benthyciadau a llety drwy’r gyflogres.
110110
StartPageMPBIK.p2.organisation = Os ydych wedi cofrestru buddiannau neu dreuliau, gallwch ddefnyddio’r gwasanaeth hwn i wneud y canlynol:
111111
StartPageMPBIK.p3.organisation = gweld buddiannau a threuliau sydd wedi eu cofrestru ar gyfer y flwyddyn hon
@@ -274,8 +274,6 @@ ExclusionSearch.Fail.Exists.P = Chwilio eto am gyflogai gwahanol
274274

275275
ExclusionSearch.warning = Ni fyddwch yn gallu rhoi’r buddiant neu’r draul sydd dan sylw drwy’r gyflogres ar gyfer y cyflogai hwn eto yn y flwyddyn dreth hon.
276276

277-
ExclusionSearchMPBIK.form.current.tax.year = Blwyddyn dreth Ebrill {0} i {1}
278-
279277
ExclusionImportant.Reminder = Drwy gadarnhau, byddwch yn eithrio’r cyflogai hwn rhag cael ei drethu o ran {0} drwy’r gyflogres o {1} ymlaen.
280278
ExclusionRemovalConfirmation.title = Datgan y cyflogai sydd i’w ychwanegu at y buddiant neu’r draul sydd dan sylw
281279
ExclusionRemovalConfirmation.table.title = Manylion gweithwyr
@@ -294,6 +292,36 @@ ExclusionRemoval.whatYouNeedToTellYourEmployees.p2 = Mae hefyd angen i chi roi g
294292
ExclusionRemoval.Service.finish.rescinded = Bwrw golwg dros eich cyflogeion sydd wedi’u heithrio
295293
ExclusionRemoval.Service.back.overview.ViewYourSummary = Bwrw golwg dros eich crynodeb o fuddiannau a threuliau cofrestredig
296294

295+
#*************************************************************
296+
# Exclusion search MPBIK
297+
#*************************************************************
298+
299+
ExclusionSearchMPBIK.title.multiple = Which employee do you want to exclude?
300+
ExclusionSearchMPBIK.form.tax.year = Tax year April {0} to {1}
301+
302+
#*************************************************************
303+
# Exclusion overview MPBIK
304+
#*************************************************************
305+
306+
ExclusionSearchMPBIK.title.single = Datgan y cyflogai i’w eithrio rhag y buddiant hwn
307+
ExclusionSearchMPBIK.title.multiple = Pa gyflogai ydych am ei eithrio?
308+
ExclusionSearchMPBIK.title.span.taxYear.cy0 = Blwyddyn dreth Ebrill {0} i {1}
309+
ExclusionImportantMPBIK.Reminder = Drwy gadarnhau hyn, byddwch yn eithrio’r cyflogai hwn rhag cael y buddiant canlynol wedi’i drethu drwy’r gyflogres o {1} ymlaen: {0}.
310+
ExclusionSearchMPBIK.inset.text = O 6 Ebrill 2027 ymlaen, bydd angen i gyflogwyr drethu holl fuddiannau cyflogeion drwy’r gyflogres (ac eithrio benthyciadau a llety). Ni fydd buddiannau unrhyw gyflogeion yn cael eu heithrio rhag cael eu trethu drwy’r gyflogres, hyd yn oed os yw’r cyflogeion hynny wedi’u heithrio rhag buddiannau ar gyfer blwyddyn dreth 2026 i 2027.
311+
312+
ExclusionSearchMPBIK.field.employee.name = Enw’r cyflogai
313+
ExclusionSearchMPBIK.field.employee.ni = Rhif Yswiriant Gwladol (heb ddangos y llythyren olaf)
314+
ExclusionSearchMPBIK.field.employee.payrollId = ID y gyflogres neu rif gwaith
315+
316+
ExclusionSearchMPBIK.warning = Ni fydd modd i chi drethu’r buddiant hwn drwy’r gyflogres ar gyfer y cyflogai hwn eto ac ar gyfer y flwyddyn dreth hon.
317+
318+
ExclusionSearchMPBIK.confirmation.p = Rwy’n cadarnhau’r canlynol:
319+
ExclusionSearchMPBIK.confirmation.bullet1 = Byddaf yn rhoi gwybod am werth y buddiant ar gyfer y cyflogai hwn ar P11D
320+
ExclusionSearchMPBIK.confirmation.bullet2 = Byddaf yn anfon y P11D ar ddiwedd y flwyddyn dreth
321+
322+
ExclusionSearchMPBIK.understanding.p = Rwy’n deall y canlynol:
323+
ExclusionSearchMPBIK.understanding.bullet1 = Ni allaf ychwanegu’r cyflogai hwn yn ôl at y buddiant hwn ar gyfer y flwyddyn dreth hon
324+
297325
#*************************************************************
298326
# Benefits Messages
299327
#*************************************************************

0 commit comments

Comments
 (0)