feat(fusion_clock): multi-day leave requests (date range)

Request Leave now takes a From/To date range instead of a single day (the To
field is optional -> single-day). Added date_to to fusion.clock.leave.request
(start kept as leave_date), with overlap detection on submit and a date_to >=
leave_date constraint. The absence check and reports now treat a leave as
covering its whole span. The form shows two date inputs; the controller accepts
date_from/date_to (the old single leave_date payload is still honoured). A
migration backfills date_to = leave_date for existing rows.

Live and verified on entech 19.0.3.13.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-30 23:01:19 -04:00
parent 87639a12b5
commit 6a9c7c74ea
10 changed files with 128 additions and 27 deletions

View File

@@ -8,6 +8,7 @@
<field name="arch" type="xml">
<list>
<field name="leave_date"/>
<field name="date_to"/>
<field name="employee_id"/>
<field name="reason"/>
<field name="state" decoration-success="state == 'reviewed'"
@@ -34,6 +35,7 @@
<group>
<field name="employee_id"/>
<field name="leave_date"/>
<field name="date_to"/>
<field name="created_from"/>
</group>
<group>

View File

@@ -423,9 +423,18 @@
<div class="fclk-wizard-field">
<label class="fclk-wizard-label" for="fclk-leave-date">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
Leave Date <span class="fclk-wizard-required">*</span>
Leave Dates <span class="fclk-wizard-required">*</span>
</label>
<input type="date" id="fclk-leave-date" class="fclk-wizard-input"/>
<div class="fclk-leave-daterange">
<div class="fclk-leave-daterange-col">
<span class="fclk-leave-daterange-cap">From</span>
<input type="date" id="fclk-leave-date" class="fclk-wizard-input"/>
</div>
<div class="fclk-leave-daterange-col">
<span class="fclk-leave-daterange-cap">To <small>(optional)</small></span>
<input type="date" id="fclk-leave-date-to" class="fclk-wizard-input"/>
</div>
</div>
</div>
<div class="fclk-wizard-field">
<label class="fclk-wizard-label" for="fclk-leave-reason">