feat: convert deposit amounts from toman to rials in appointment handling

This commit is contained in:
hamed
2026-07-17 10:21:52 +03:30
parent a0ddb4c0d1
commit fcd7a0596d
9 changed files with 468 additions and 17 deletions
+3 -3
View File
@@ -100,7 +100,7 @@ export default function AppointmentCreatePage() {
// ── بیعانه / وضعیت / توضیحات
const [depositRequired, setDepositRequired] = useState(false);
const [depositRials, setDepositRials] = useState(0);
const [depositToman, setDepositToman] = useState(0);
const [status, setStatus] = useState('pending');
const [note, setNote] = useState('');
@@ -145,7 +145,7 @@ export default function AppointmentCreatePage() {
...(selectedServices.length ? { service_item_uuids: selectedServices.map(s => s.uuid) } : {}),
}),
...(staffUuid ? { staff_uuid: staffUuid } : {}),
...(depositRequired ? { deposit_required: true, deposit_amount_rials: depositRials } : {}),
...(depositRequired ? { deposit_required: true, deposit_amount_rials: tomanToRial(depositToman) } : {}),
...(visitPriceToman > 0 ? { visit_price_rials: tomanToRial(visitPriceToman) } : {}),
...(note.trim() ? { note: note.trim() } : {}),
};
@@ -468,7 +468,7 @@ export default function AppointmentCreatePage() {
<div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'flex-end', gap: 12, margin: '12px 0' }}>
<div style={{ width: 300, maxWidth: '100%' }}>
<label style={label}>مبلغ بیعانه (تومان)</label>
<div className="field" style={{ marginTop: 6, height: 44 }}><PriceInput value={depositRials} onChange={setDepositRials} /></div>
<div className="field" style={{ marginTop: 6, height: 44 }}><PriceInput value={depositToman} onChange={setDepositToman} /></div>
</div>
<WalletChargeLink mobile={effectiveMobile} />
</div>