Update: 2026-05-12 01:40:41
This commit is contained in:
@@ -1751,14 +1751,20 @@
|
||||
x-text="parseFloat(inv.grand_total).toLocaleString() + ' JOD'"></td>
|
||||
<td style="text-align:center;">
|
||||
<span class="badge"
|
||||
:class="inv.status==='extracted' ? 'badge-blue' : (inv.status==='approved' ? 'badge-teal' : (inv.status==='rejected'||inv.status==='failed'?'badge-red':'badge-gray'))"
|
||||
x-text="inv.status === 'approved' ? '✓ مدققة' : (inv.status === 'extracted' ? 'جاهزة للتدقيق' : (inv.status === 'rejected' ? 'مرفوضة' : inv.status))">
|
||||
:class="inv.status==='extracted' ? 'badge-blue' : (inv.status==='approved' ? 'badge-teal' : (inv.status==='submitted' ? 'badge-purple' : (inv.status==='rejected'||inv.status==='failed'?'badge-red':'badge-gray')))"
|
||||
x-text="inv.status === 'approved' ? '✓ مدققة' : (inv.status === 'submitted' ? '🚀 مُرسلة للفوترة' : (inv.status === 'extracted' ? 'جاهزة للتدقيق' : (inv.status === 'rejected' ? 'مرفوضة' : inv.status)))">
|
||||
</span>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
<button @click="viewInvoice(inv.id)" class="btn-table-action btn-ta-navy">
|
||||
👁️ عرض
|
||||
</button>
|
||||
<button @click="submitToJoFotara(inv.id)"
|
||||
x-show="inv.status === 'approved'"
|
||||
class="btn-table-action btn-ta-teal"
|
||||
style="margin-right:4px;">
|
||||
📤 جوفوترا
|
||||
</button>
|
||||
<button @click="deleteInvoice(inv.id)" class="btn-table-action btn-ta-red" style="margin-right:4px;">
|
||||
🗑️ حذف
|
||||
</button>
|
||||
@@ -3230,6 +3236,29 @@
|
||||
}
|
||||
},
|
||||
|
||||
async submitToJoFotara(id) {
|
||||
if (this.isBusy) return;
|
||||
this.isBusy = true;
|
||||
try {
|
||||
const res = await fetch('/index.php?route=v1/invoices/submit-jofotara', {
|
||||
method: 'POST',
|
||||
headers: { 'Authorization': 'Bearer ' + this.token(), 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ invoice_id: id })
|
||||
});
|
||||
const json = await res.json();
|
||||
this.isBusy = false;
|
||||
if (json.success) {
|
||||
alert('تم إرسال الفاتورة لجوفتورة بنجاح!');
|
||||
this.loadAll();
|
||||
} else {
|
||||
this.showError(json.message);
|
||||
}
|
||||
} catch (e) {
|
||||
this.isBusy = false;
|
||||
this.showError('حدث خطأ أثناء الإرسال لجوفتورة');
|
||||
}
|
||||
},
|
||||
|
||||
async updateInvoice() {
|
||||
if (!this.currentInvoice || this.isBusy) return;
|
||||
this.isBusy = true;
|
||||
|
||||
Reference in New Issue
Block a user