fix(supply): колонка «Розничная» использует имя системного PriceType
Some checks are pending
Some checks are pending
В таблице позиций приёмки заголовок «Розничная (карточка)» теперь берёт имя из справочника типов цен (priceTypes.find(isSystem)) — так чтобы название совпадало с тем, что отображается в карточке товара и в самом справочнике. Если системного типа нет — фолбэк на IsRetail, а затем «Розничная». Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cd191bd872
commit
4edf7db8cc
|
|
@ -6,7 +6,7 @@ import { api } from '@/lib/api'
|
||||||
import { Button } from '@/components/Button'
|
import { Button } from '@/components/Button'
|
||||||
import { Field, TextInput, TextArea, Select, Checkbox, MoneyInput, NumberInput } from '@/components/Field'
|
import { Field, TextInput, TextArea, Select, Checkbox, MoneyInput, NumberInput } from '@/components/Field'
|
||||||
import { ProductPicker } from '@/components/ProductPicker'
|
import { ProductPicker } from '@/components/ProductPicker'
|
||||||
import { useStores, useCurrencies, useSuppliers } from '@/lib/useLookups'
|
import { useStores, useCurrencies, useSuppliers, usePriceTypes } from '@/lib/useLookups'
|
||||||
import { useOrgSettings } from '@/lib/useOrgSettings'
|
import { useOrgSettings } from '@/lib/useOrgSettings'
|
||||||
import { SupplyStatus, type SupplyDto, type Product } from '@/lib/types'
|
import { SupplyStatus, type SupplyDto, type Product } from '@/lib/types'
|
||||||
|
|
||||||
|
|
@ -53,6 +53,13 @@ export function SupplyEditPage() {
|
||||||
const currencies = useCurrencies()
|
const currencies = useCurrencies()
|
||||||
const org = useOrgSettings()
|
const org = useOrgSettings()
|
||||||
const suppliers = useSuppliers()
|
const suppliers = useSuppliers()
|
||||||
|
const priceTypes = usePriceTypes()
|
||||||
|
// Системный (главный) тип цен — на нём по умолчанию ведётся розница на кассе.
|
||||||
|
// Заголовок колонки «Розничная» подменяется его именем чтобы соответствовать
|
||||||
|
// тому, что увидит пользователь в карточке товара и в справочнике типов цен.
|
||||||
|
const systemPriceTypeName = priceTypes.data?.find((pt) => pt.isSystem)?.name
|
||||||
|
?? priceTypes.data?.find((pt) => pt.isRetail)?.name
|
||||||
|
?? 'Розничная'
|
||||||
|
|
||||||
const [form, setForm] = useState<Form>(emptyForm)
|
const [form, setForm] = useState<Form>(emptyForm)
|
||||||
const [pickerOpen, setPickerOpen] = useState(false)
|
const [pickerOpen, setPickerOpen] = useState(false)
|
||||||
|
|
@ -340,7 +347,7 @@ export function SupplyEditPage() {
|
||||||
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[90px]">Ед.</th>
|
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[90px]">Ед.</th>
|
||||||
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[140px] text-right">Количество</th>
|
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[140px] text-right">Количество</th>
|
||||||
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[140px] text-right">Цена</th>
|
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[140px] text-right">Цена</th>
|
||||||
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[160px] text-right">Розничная (карточка)</th>
|
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[160px] text-right">{systemPriceTypeName} (карточка)</th>
|
||||||
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[160px] text-right">Сумма</th>
|
<th className="py-2 px-3 font-medium text-xs uppercase tracking-wide text-slate-500 w-[160px] text-right">Сумма</th>
|
||||||
<th className="py-2 pl-3 w-[40px]"></th>
|
<th className="py-2 pl-3 w-[40px]"></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue