13 lines
569 B
TypeScript
13 lines
569 B
TypeScript
export function tahesabStatusLabel(status?: string, tahesabId?: string | null): string {
|
|||
|
|
if (tahesabId) return 'موفق'
|
||
|
|
if (status === 'failed') return 'ناموفق'
|
||
|
|
if (status === 'success') return 'موفق'
|
||
|
|
// pending = ردیف محلی ساخته شده ولی هنوز در نرمافزار تهحساب ثبت نشده (نه «در صف»)
|
||
|
|
return 'ارسال نشده'
|
||
|
|
}
|
||
|
|
|
||
|
|
export function canRetryTahesab(record: { tahesab_id?: string | null; sync_status?: string }): boolean {
|
||
|
|
return !record.tahesab_id || record.sync_status === 'failed'
|
||
|
|
}
|
||
|
|
|