feat: show preorder payment method during pricing

Admins need the customer's cash or check term before they set the price.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-15 11:25:05 +03:30
co-authored by Cursor
parent 400fecf271
commit ffd08859dd
5 changed files with 35 additions and 3 deletions
+12 -1
View File
@@ -11,10 +11,21 @@ const CASH_PHASE_RAW_STATUSES = new Set([
export function settlementMethodLabel(method?: string | null): string {
if (!method) return 'انتخاب‌نشده'
if (method === 'check') return 'چکی'
if (method === 'cash_check') return 'نقدی-چکی'
if (method === 'cash_check') return 'نصف نقد، نصف چکی'
return 'نقدی'
}
export function settlementPlanLabel(
method?: string | null,
checkTermMonths?: number | null,
): string {
const base = settlementMethodLabel(method)
if ((method === 'check' || method === 'cash_check') && checkTermMonths) {
return `${base} · چک ${checkTermMonths} ماهه`
}
return base
}
export function orderShowsCashActions(
order: { settlementMethod?: SettlementMethod | null; rawStatus?: string },
): boolean {