fix(discount): correct edit-form data + calendar clipping + input styling
- List endpoint returned camelCase keys (getArrayResult) so the edit modal read empty discount_type/target_*; return toArray() (snake_case) instead. - Portal the Persian date-picker calendar to body (fixed) so it no longer renders under the modal's overflow-scroll body. - Style the PriceInput/number fields with cp-input in the rule modal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -239,8 +239,8 @@ function RuleModal({ initial, onClose, onSaved }: { initial: DiscountRule | null
|
||||
<div>
|
||||
<label style={labelStyle()}>{f.discount_type === 'percent' ? 'درصد تخفیف (۰ تا ۱۰۰)' : 'مبلغ تخفیف (تومان)'}</label>
|
||||
{f.discount_type === 'percent'
|
||||
? <input className="cp-input" type="number" inputMode="numeric" min={0} max={100} value={f.value} onChange={(e) => set('value', Number(e.target.value) || 0)} />
|
||||
: <PriceInput value={f.value} onChange={(v) => set('value', v)} />}
|
||||
? <input className="cp-input" style={{ width: '100%' }} type="number" inputMode="numeric" min={0} max={100} value={f.value} onChange={(e) => set('value', Number(e.target.value) || 0)} />
|
||||
: <PriceInput className="cp-input" style={{ width: '100%' }} value={f.value} onChange={(v) => set('value', v)} />}
|
||||
</div>
|
||||
<div>
|
||||
<label style={labelStyle()}>اولویت (بزرگتر = مهمتر)</label>
|
||||
@@ -262,7 +262,7 @@ function RuleModal({ initial, onClose, onSaved }: { initial: DiscountRule | null
|
||||
{f.type === 'invoice_amount' && (
|
||||
<div>
|
||||
<label style={labelStyle()}>حداقل مبلغ فاکتور (تومان)</label>
|
||||
<PriceInput value={f.min_amount_toman} onChange={(v) => set('min_amount_toman', v)} />
|
||||
<PriceInput className="cp-input" style={{ width: '100%' }} value={f.min_amount_toman} onChange={(v) => set('min_amount_toman', v)} />
|
||||
</div>
|
||||
)}
|
||||
{f.type === 'specific_patient' && (
|
||||
|
||||
Reference in New Issue
Block a user