v1.8.0: warehouse module (16 commits), docházka mzda model, leave_type=holiday removal, api.ts race fix
Highlights: - Warehouse module: receipts, issues, reservations, inventory, reports, dashboard, master data (categories, suppliers, locations), FIFO service, integration tests - Docházka: mzda PDF counting model (Odpracováno / Vč. svátků / Přesčas / Svátek / So/Ne / Noc) with Czech weekday names and decimal hours - AttendanceAdmin/AttendanceHistory KPI cards unified to mzda formula with fund bar colored by delta, badges for Práce/Dov/Nem/Sv/Nep - Remove leave_type=holiday entirely (auto-computed from Czech public holidays) - Allow multiple work shifts per day (overlap detection only) - Pre-flight refresh in api.ts eliminates spurious 401s on fresh page loads - Prisma: company_settings gets 6 nullable columns for warehouse numbering (PRI/VYD/INV prefixes, default patterns); migration seeds defaults
This commit is contained in:
@@ -4,6 +4,7 @@ import { useQuery } from "@tanstack/react-query";
|
||||
import { useAlert } from "../context/AlertContext";
|
||||
import { useAuth } from "../context/AuthContext";
|
||||
import Forbidden from "../components/Forbidden";
|
||||
import AdminDatePicker from "../components/AdminDatePicker";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import Pagination from "../components/Pagination";
|
||||
import useDebounce from "../hooks/useDebounce";
|
||||
@@ -14,7 +15,7 @@ import {
|
||||
warehouseIssueListOptions,
|
||||
type WarehouseIssue,
|
||||
} from "../lib/queries/warehouse";
|
||||
import { projectListOptions } from "../lib/queries/projects";
|
||||
import { projectListOptions, type Project } from "../lib/queries/projects";
|
||||
|
||||
const PER_PAGE = 20;
|
||||
|
||||
@@ -171,7 +172,6 @@ export default function WarehouseIssues() {
|
||||
setPage(1);
|
||||
}}
|
||||
className="admin-form-select"
|
||||
style={{ minWidth: 140 }}
|
||||
>
|
||||
<option value="">Všechny stavy</option>
|
||||
<option value="DRAFT">Návrh</option>
|
||||
@@ -188,36 +188,31 @@ export default function WarehouseIssues() {
|
||||
setPage(1);
|
||||
}}
|
||||
className="admin-form-select"
|
||||
style={{ minWidth: 180 }}
|
||||
>
|
||||
<option value="">Všechny projekty</option>
|
||||
{projects.map((p) => (
|
||||
{projects.map((p: Project) => (
|
||||
<option key={p.id} value={p.id}>
|
||||
{p.project_number} – {p.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
<input
|
||||
type="date"
|
||||
<AdminDatePicker
|
||||
mode="date"
|
||||
value={dateFrom}
|
||||
onChange={(e) => {
|
||||
setDateFrom(e.target.value);
|
||||
onChange={(val) => {
|
||||
setDateFrom(val);
|
||||
setPage(1);
|
||||
}}
|
||||
className="admin-form-input"
|
||||
style={{ width: 140 }}
|
||||
placeholder="Od"
|
||||
/>
|
||||
<input
|
||||
type="date"
|
||||
<AdminDatePicker
|
||||
mode="date"
|
||||
value={dateTo}
|
||||
onChange={(e) => {
|
||||
setDateTo(e.target.value);
|
||||
onChange={(val) => {
|
||||
setDateTo(val);
|
||||
setPage(1);
|
||||
}}
|
||||
className="admin-form-input"
|
||||
style={{ width: 140 }}
|
||||
placeholder="Do"
|
||||
/>
|
||||
{hasActiveFilters && (
|
||||
@@ -284,7 +279,7 @@ export default function WarehouseIssues() {
|
||||
<th>Stav</th>
|
||||
<th>Vydal</th>
|
||||
<th>Vytvořeno</th>
|
||||
<th className="text-right">Řádků</th>
|
||||
<th>Položek</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -317,8 +312,8 @@ export default function WarehouseIssues() {
|
||||
<td className="admin-mono">
|
||||
{formatDate(issue.created_at)}
|
||||
</td>
|
||||
<td className="admin-mono text-right">
|
||||
{issue.lines?.length ?? 0}
|
||||
<td className="admin-mono">
|
||||
{issue._count?.items ?? 0}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user