fix(ui): cross-module mechanical unifications (line-item labels/align, back-tab targets, status-button colors, apply_vat checkbox, currency-from-settings, read-only issued_by, Celkem header, centered offer tabs)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,7 @@ import apiFetch from "../utils/api";
|
||||
import { jsonQuery } from "../lib/apiAdapter";
|
||||
import { offerCustomersOptions, type Customer } from "../lib/queries/offers";
|
||||
import { issuedOrderDetailOptions } from "../lib/queries/issued-orders";
|
||||
import { companySettingsOptions } from "../lib/queries/settings";
|
||||
import { formatCurrency, todayLocalStr } from "../utils/formatters";
|
||||
import { normalizeDateStr } from "../utils/attendanceHelpers";
|
||||
import {
|
||||
@@ -53,6 +54,7 @@ import {
|
||||
DateField,
|
||||
Field,
|
||||
StatusChip,
|
||||
CheckboxField,
|
||||
ConfirmDialog,
|
||||
LoadingState,
|
||||
PageEnter,
|
||||
@@ -80,10 +82,7 @@ const VAT_OPTIONS = [0, 10, 12, 15, 21].map((v) => ({
|
||||
label: `${v}%`,
|
||||
}));
|
||||
|
||||
const CURRENCY_OPTIONS = ["CZK", "EUR", "USD", "GBP"].map((c) => ({
|
||||
value: c,
|
||||
label: c,
|
||||
}));
|
||||
const CURRENCY_FALLBACK = ["CZK", "EUR", "USD", "GBP"];
|
||||
|
||||
const BackIcon = (
|
||||
<svg
|
||||
@@ -548,6 +547,13 @@ export default function IssuedOrderDetail() {
|
||||
const customersQuery = useQuery(offerCustomersOptions());
|
||||
const customers = customersQuery.data ?? [];
|
||||
|
||||
const companySettings = useQuery(companySettingsOptions()).data;
|
||||
// Configurable currency list from company settings (falls back to the
|
||||
// built-in list when settings are empty) — matches Offers/Invoices.
|
||||
const currencyOptions = (
|
||||
companySettings?.available_currencies || CURRENCY_FALLBACK
|
||||
).map((c) => ({ value: c, label: c }));
|
||||
|
||||
const detailQuery = useQuery(issuedOrderDetailOptions(id));
|
||||
const detail = detailQuery.data ?? null;
|
||||
|
||||
@@ -1000,7 +1006,7 @@ export default function IssuedOrderDetail() {
|
||||
onChange={(val) =>
|
||||
setForm((prev) => ({ ...prev, currency: val }))
|
||||
}
|
||||
options={CURRENCY_OPTIONS}
|
||||
options={currencyOptions}
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Jazyk">
|
||||
@@ -1027,29 +1033,18 @@ export default function IssuedOrderDetail() {
|
||||
/>
|
||||
</Field>
|
||||
<Field label="DPH">
|
||||
<Box
|
||||
component="label"
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 0.75,
|
||||
whiteSpace: "nowrap",
|
||||
cursor: editable ? "pointer" : "default",
|
||||
height: 40,
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
<Box sx={{ display: "flex", alignItems: "center", height: 40 }}>
|
||||
<CheckboxField
|
||||
label="Uplatnit DPH"
|
||||
checked={form.apply_vat}
|
||||
disabled={!editable}
|
||||
onChange={(e) =>
|
||||
onChange={(v) =>
|
||||
setForm((prev) => ({
|
||||
...prev,
|
||||
apply_vat: e.target.checked,
|
||||
apply_vat: v,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<Box component="span">Uplatnit DPH</Box>
|
||||
</Box>
|
||||
</Field>
|
||||
</Box>
|
||||
@@ -1057,11 +1052,8 @@ export default function IssuedOrderDetail() {
|
||||
<Field label="Vystavil">
|
||||
<TextField
|
||||
value={form.issued_by}
|
||||
disabled={!editable}
|
||||
onChange={(e) =>
|
||||
setForm((prev) => ({ ...prev, issued_by: e.target.value }))
|
||||
}
|
||||
placeholder="Jméno"
|
||||
InputProps={{ readOnly: true }}
|
||||
sx={{ "& .MuiInputBase-root": { bgcolor: "action.hover" } }}
|
||||
/>
|
||||
</Field>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user