admin: cancel a pending order, refund a paid one
There was no way to take an order back: staff could only edit the status by hand, and turning 'paid' into 'failed' left the credits, heart days or subscription days the order had given. Two OrderAdmin actions now do it: - cancel a pending order (a payment that does arrive later still counts); - refund a paid order, after a confirmation page: takes back the pack's unspent credits (never below zero), its heart days, or the plan's subscription days, and undoes the referrer's commission. The money itself is returned in the Zarinpal / Bazaar panel; the action says so. Status is read-only in the order form. Steps in docs/operations.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,7 +86,8 @@ class QuestionCredit(models.Model):
|
||||
ردیفِ ۱− فقط وقتی پاک میشود که خودِ سوال پس گرفته شود: جوابِ ناموفق یا جوابی که از کش آمد و
|
||||
به API نرسید. اعتبار منقضی نمیشود (تصمیمِ صاحبِ پروژه).
|
||||
"""
|
||||
REASON_CHOICES = [('purchase', 'خرید'), ('question', 'سوال'), ('grant', 'هدیهی ادمین')]
|
||||
# «refund»: ردیفِ منفیِ بازپرداختِ سفارش (payment.services.refund_order)؛ فقط اعتبارِ خرجنشده را پس میگیرد.
|
||||
REASON_CHOICES = [('purchase', 'خرید'), ('question', 'سوال'), ('grant', 'هدیهی ادمین'), ('refund', 'بازپرداخت')]
|
||||
|
||||
user_id = models.IntegerField(db_index=True) # ارجاع سبک به accounts.User
|
||||
delta = models.IntegerField()
|
||||
|
||||
Reference in New Issue
Block a user