Fix AI mime-type and enable invoice actions

This commit is contained in:
Hamza-Ayed
2026-04-18 02:17:56 +03:00
parent 9f5b202bb2
commit 066df077b1
2 changed files with 32 additions and 6 deletions

View File

@@ -200,23 +200,42 @@ export const InvoicesPage = () => {
</div>
</td>
<td className="px-6 py-4 text-slate-500 text-sm">
{inv.issue_date ? new Date(inv.issue_date).toLocaleDateString('ar-JO') : '---'}
{inv.invoice_date ? new Date(inv.invoice_date).toLocaleDateString('ar-JO') : '---'}
</td>
<td className="px-6 py-4 font-mono font-bold text-slate-800 text-left">
{Number(inv.total_amount).toLocaleString('en-US', { minimumFractionDigits: 3 })}
{Number(inv.grand_total).toLocaleString('en-US', { minimumFractionDigits: 3 })}
</td>
<td className="px-6 py-4"><StatusBadge status={inv.status} /></td>
<td className="px-6 py-4 text-center">
<div className="flex items-center justify-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
<button className="p-2 text-slate-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-all">
<button
onClick={(e) => { e.stopPropagation(); console.log('View Invoice', inv.id); }}
className="p-2 text-slate-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-all"
>
<Eye className="w-4 h-4" />
</button>
{inv.status === 'validated' && (
<button className="p-2 text-emerald-500 hover:text-emerald-600 hover:bg-emerald-50 rounded-lg transition-all" title="إرسال لجو فوترة">
<button
onClick={async (e) => {
e.stopPropagation();
try {
await apiClient.post(`/invoices/${inv.id}/submit`);
alert('تم الإرسال لجو فوترة بنجاح');
fetchData();
} catch (err) {
alert('فشل الإرسال');
}
}}
className="p-2 text-emerald-500 hover:text-emerald-600 hover:bg-emerald-50 rounded-lg transition-all"
title="إرسال لجو فوترة"
>
<Send className="w-4 h-4" />
</button>
)}
<button className="p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-lg transition-all">
<button
onClick={(e) => { e.stopPropagation(); }}
className="p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-lg transition-all"
>
<MoreVertical className="w-4 h-4" />
</button>
</div>