商品 {index + 1}
工费附加项目(选填)
{line.charges.map((c, i) => (
updateCharge(i, charge => Model.changeChargeType(charge, type))}
/>
updateCharge(i, charge => ({ ...charge, customName }))}
/>
updateCharge(i, charge => Model.setChargeAmount(charge, value))}
/>
{c.costRemoved && (
)}
))}
内部成本 · 客户单据不显示
{line.legacy ? (
<>
>
) : (
)}
);
}
export function EditFees({ store, state, update }: { store: FormStore; state: LedgerState; update: UpdateForm }) {
const { form, summary } = store,
presets = form.presets;
const hasLinkedCost = (kind: string) =>
form.feeRows.some(
row => row.funding && (row.key === Fees.presetKey(kind) || Fees.checkboxCategory(row.note) === categories[kind]),
);
return (
实际费用(内部)
update(f => ({ ...f, fees_date }))}
/>
{presets && (
{Model.presetCatalogView(form, state).map(item => (
{item.byQuantity && (
update(f => Model.setPresetQuantity(f, item.kind, q))}
/>
)}
))}
)}
{form.feeRows.map((row, i) => {
const edit = (key: 'note' | 'payer' | 'amount' | 'date', value: string) =>
update(f => Model.editFeeRow(f, i, key, value));
const ref = row.funding;
return (
{row.key.startsWith('manual:') && !row.automatic ? (
edit('note', v)}
/>
) : (
{row.note}
)}
{Model.feeSourceText(row)}
edit('amount', v)}
/>
edit('payer', v)}
/>
edit('date', v)}
/>
{!row.automatic && (
)}
{ref && (
)}
);
})}
update(f => ({ ...f, credit_card_fee_payer: v }))}
/>
{summary.feesText}
);
}