Files
dbx-main/app/modules/vacation/templates/vacation/form.html
T
king 4b2defac3a feat(vacation): 연차 12/31 소멸 삭제 — 입사일 기준, 연차마다 쓸 수 있는 기한
- store.leave_grants/leave_period/leave_status: 1년 미만 월 1일 = 입사일부터 1년까지, 근속 n년 연차 = 생긴 날부터 1년까지(근로기준법 제60조)
- 승인된 연차·반차를 날짜별(usage_units = compute_days 규칙)로 나눠 그날 쓸 수 있는 연차 중 먼저 소멸하는 것부터 차감, 생기기 전이면 당겨 씀
- 화면: 지금 연차 기간 · 생기는 연차(오늘까지 +앞으로) · 사용 · 오늘 쓸 수 있는 잔여 · 먼저 소멸(날짜·일수), 해 이동 없음, 달력 위 내 연차도 같은 값
- 직접 입력 = 지금 연차 기간이 시작한 해 줄(override_year), 시스템 전 사용 = 2026 줄(도입일에 쓴 것으로)
- 테스트: 규칙(10/12 입사 사례·먼저 소멸·당겨 씀·시스템 전·입사일 없음), 실제 PG, 실제 앱, 브라우저

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 16:27:50 +09:00

77 lines
3.4 KiB
HTML

{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/vacation.css?v=20261027e" />
{#- 날짜 칸 = 프로젝트와 같은 아사나식 날짜 팝업(2026-10-27, erp-datepop) -#}
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<link rel="stylesheet" href="/static/erp-datepop.css?v=20261027a" />{% endblock %}
{% block content %}
<section class="vac">
{% set action = '/vacation/new' if mode == 'new' else '/vacation/' ~ req.id ~ '/edit' %}
<form id="vac-form" method="post" action="{{ action }}" class="erp-card vac-form-card">
<div class="vac-form-grid">
<label class="erp-field"><span>휴가 종류 *</span>
<select class="erp-select" name="vacation_type" id="vac-type" required>
{% for t in vacation_types %}
<option value="{{ t }}" {% if req and req.vacation_type == t %}selected{% endif %}>{{ t }}</option>
{% endfor %}
</select>
</label>
<label class="erp-field"><span>시작일 *</span>
<input class="erp-input" type="date" name="start_date" id="vac-start" required
value="{{ req.start_date if req else default_date }}" />
</label>
<label class="erp-field" id="vac-start-half-field"><span>시작 구분</span>
<select class="erp-select" name="start_half" id="vac-start-half">
{% for h in halves %}
<option value="{{ h }}" {% if req and req.start_half == h %}selected{% endif %}>{{ half_labels[h] }}</option>
{% endfor %}
</select>
</label>
<label class="erp-field" id="vac-end-field"><span>종료일 *</span>
<input class="erp-input" type="date" name="end_date" id="vac-end"
value="{{ req.end_date if req else default_date }}" />
</label>
<label class="erp-field" id="vac-end-half-field"><span>종료 구분</span>
<select class="erp-select" name="end_half" id="vac-end-half">
{% for h in halves %}
<option value="{{ h }}" {% if req and req.end_half == h %}selected{% endif %}>{{ half_labels[h] }}</option>
{% endfor %}
</select>
</label>
</div>
<label class="erp-field vac-full"><span>사유</span>
<textarea class="erp-input" name="reason" rows="3"
placeholder="휴가 사유를 입력하세요.">{{ req.reason if req else '' }}</textarea>
</label>
<div class="vac-days-preview">
예상 사용 일수: <strong id="vac-days-out">—</strong>
<span class="erp-muted">(주말 · 공휴일 제외)</span>
</div>
<div class="erp-page-actions vac-form-actions">
<button type="submit" class="erp-btn erp-btn-primary" name="action" value="submit">제출</button>
<button type="submit" class="erp-btn erp-btn-outline" name="action"
value="{{ 'save' if mode == 'edit' else 'draft' }}">작성중 저장</button>
{% if mode == 'edit' %}
<a class="erp-btn erp-btn-outline" href="/vacation/{{ req.id }}">취소</a>
{% else %}
<a class="erp-btn erp-btn-outline" href="/vacation/">취소</a>
{% endif %}
</div>
</form>
</section>
{% endblock %}
{% block scripts %}<script type="application/json" id="vac-holidays">{{ holidays | tojson }}</script>
<script src="/static/erp-datepop.js?v=20261027b" defer></script>
<script src="/static/vacation.js?v=20261027c" defer></script>{% endblock %}