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";
|
||||
@@ -173,7 +174,6 @@ export default function WarehouseReceipts() {
|
||||
setPage(1);
|
||||
}}
|
||||
className="admin-form-select"
|
||||
style={{ minWidth: 140 }}
|
||||
>
|
||||
<option value="">Všechny stavy</option>
|
||||
<option value="DRAFT">Návrh</option>
|
||||
@@ -190,7 +190,6 @@ export default function WarehouseReceipts() {
|
||||
setPage(1);
|
||||
}}
|
||||
className="admin-form-select"
|
||||
style={{ minWidth: 180 }}
|
||||
>
|
||||
<option value="">Všichni dodavatelé</option>
|
||||
{suppliers.map((s) => (
|
||||
@@ -200,26 +199,22 @@ export default function WarehouseReceipts() {
|
||||
))}
|
||||
</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 && (
|
||||
@@ -282,11 +277,11 @@ export default function WarehouseReceipts() {
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Číslo dokladu</th>
|
||||
<th>Dodavatel</th>
|
||||
<th >Dodavatel</th>
|
||||
<th>Stav</th>
|
||||
<th>Dodací list</th>
|
||||
<th>Vytvořeno</th>
|
||||
<th className="text-right">Řádků</th>
|
||||
<th>Položek</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -299,7 +294,9 @@ export default function WarehouseReceipts() {
|
||||
<td className="admin-mono fw-500">
|
||||
{receipt.receipt_number || "—"}
|
||||
</td>
|
||||
<td>{receipt.supplier?.name || "—"}</td>
|
||||
<td >
|
||||
{receipt.supplier?.name || "—"}
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
className={`admin-badge ${STATUS_BADGE[receipt.status] ?? ""}`}
|
||||
@@ -313,8 +310,8 @@ export default function WarehouseReceipts() {
|
||||
<td className="admin-mono">
|
||||
{formatDate(receipt.created_at)}
|
||||
</td>
|
||||
<td className="admin-mono text-right">
|
||||
{receipt.lines?.length ?? 0}
|
||||
<td className="admin-mono">
|
||||
{receipt._count?.items ?? 0}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user