Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 59 additions & 19 deletions direct-file/backend/src/main/resources/tax/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,67 @@
<Description>Whether the tax year is a leap year</Description>
<Derived>
<Switch>
<!-- TODO: replace this with the calc to determine leap year (e.g. divisible by 4, but not 100 unless also divisible by 400) -->
<Case>
<When>
<Any>
<Equal>
<Left>
<Dependency path="/taxYear" />
</Left>
<Right>
<Int>2024</Int>
</Right>
</Equal>
<Equal>
<Left>
<Dependency path="/taxYear" />
</Left>
<Right>
<Int>2028</Int>
</Right>
</Equal>
</Any>
<Equal>
<Left>
<Modulo>
<Left>
<Dependency path="/taxYear" />
</Left>
<Right>
<Int>400</Int>
</Right>
</Modulo>
</Left>
<Right>
<Int>0</Int>
</Right>
</Equal>
</When>
<Then>
<True />
</Then>
</Case>
<Case>
<When>
<Equal>
<Left>
<Modulo>
<Left>
<Dependency path="/taxYear" />
</Left>
<Right>
<Int>100</Int>
</Right>
</Modulo>
</Left>
<Right>
<Int>0</Int>
</Right>
</Equal>
</When>
<Then>
<False />
</Then>
</Case>
<Case>
<When>
<Equal>
<Left>
<Modulo>
<Left>
<Dependency path="/taxYear" />
</Left>
<Right>
<Int>4</Int>
</Right>
</Modulo>
</Left>
<Right>
<Int>0</Int>
</Right>
</Equal>
</When>
<Then>
<True />
Expand Down
Loading