Skip to content

Commit bf71550

Browse files
Fix bug causing CTC and UC intersections (#1334)
* Fix bug causing CTC and UC intersections * Format
1 parent 01f049b commit bf71550

3 files changed

Lines changed: 5 additions & 24 deletions

File tree

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
fixed:
4+
- Bug causing some households to claim both CTC and UC.

policyengine_uk/tests/policy/baseline/finance/benefit/family/income_support.yaml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
- name: Lone parent, two children
2-
period: 2021
3-
absolute_error_margin: 1_000 # Temporarily for now
4-
input:
5-
people:
6-
p1:
7-
age: 26
8-
income_support_reported: true
9-
working_tax_credit_reported: true
10-
child_tax_credit_reported: true
11-
c1:
12-
age: 4
13-
c2:
14-
age: 4
15-
benunits:
16-
b1:
17-
members: [p1, c1, c2]
18-
would_claim_child_benefit: true
19-
output:
20-
child_tax_credit: 6205
21-
child_benefit: 35 * 52
22-
income_support_eligible: true
23-
income_support: 81 * 52
241
- name: Lone parent, two children, earnings
252
period: 2021
263
absolute_error_margin: 5

policyengine_uk/variables/gov/dwp/is_CTC_eligible.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class is_CTC_eligible(Variable):
1111
def formula(benunit, period, parameters):
1212
already_claiming = (
1313
add(benunit, period, ["child_tax_credit_reported"]) > 0
14-
)
14+
) & (~add(benunit, period, ["would_claim_uc"]) > 0)
1515
return (
1616
benunit.any(benunit.members("is_child_for_CTC", period))
1717
& already_claiming

0 commit comments

Comments
 (0)