diff --git a/public/shell.php b/public/shell.php index b4bbbd8..0a522da 100644 --- a/public/shell.php +++ b/public/shell.php @@ -1647,7 +1647,76 @@ 📊 استيراد Excel (Bulk) -
| الشركة / المورد | @@ -1658,15 +1727,15 @@||||
|---|---|---|---|---|
|
-
لا توجد فواتير مرفوعة بعد +لا توجد فواتير تطابق التصفية لهذا الشهر |
||||
| + :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))"> |
@@ -1790,18 +1859,18 @@
📄 الفواتير
الشهرية
+ x-text="(subscription?.invoices?.used || 0) + ' من ' + (subscription?.invoices?.limit || 0)">
-
+
@@ -1811,14 +1880,17 @@
🏭 الشركات
المدارة
+ x-text="(subscription?.companies?.used || 0) + ' من ' + (subscription?.companies?.limit || 0)">
+
+
+ إجمالي الشركات المسموح بها
+
- إجمالي الشركات المسموح بها
@@ -1826,14 +1898,17 @@
👥 فريق العمل
+ x-text="(subscription?.users?.used || 0) + ' من ' + (subscription?.users?.limit || 0)">
+
+
+ مستخدمين نشطين في النظام
+
- مستخدمين نشطين في النظام
@@ -2746,6 +2821,8 @@
user: JSON.parse(localStorage.getItem('user')),
page: 'dashboard',
users: [], companies: [], invoices: [], tenants: [], subscription: null, plans: [],
+ activeInvoiceTab: 'all', // all, approved, pending, rejected, jofotara
+ invoiceCompanyFilter: '',
showPaymentModal: false,
paymentData: { cliq_alias: '', amount: 0, plan_name: '', reference: '', payment_id: '' },
stats: { total: 0, pending: 0, approved: 0 },
@@ -2773,6 +2850,29 @@
setPage(p) { this.page = p; this.loadAll(); },
title() { return { dashboard: 'الرئيسية', users: 'فريق العمل', companies: 'الشركات', invoices: 'إدارة الفواتير', tenants: 'المكاتب المحاسبية', subscription: 'إدارة الاشتراك' }[this.page] || ''; },
subtitle() { return { dashboard: 'نظرة شاملة على نشاط النظام', users: 'إدارة المستخدمين والصلاحيات', companies: 'إدارة الشركات والربط بالفوترة الحكومية', invoices: 'رفع ومعالجة الفواتير الضريبية', tenants: 'إدارة المكاتب المحاسبية المشتركة', subscription: 'تفاصيل باقتك الحالية واستهلاك الموارد' }[this.page] || ''; },
+
+ get filteredInvoices() {
+ const now = new Date();
+ const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
+
+ return this.invoices.filter(inv => {
+ // 1. Time Filter (Current Month)
+ const invDate = new Date(inv.invoice_date || inv.created_at);
+ if (invDate < startOfMonth) return false;
+
+ // 2. Company Filter
+ if (this.invoiceCompanyFilter && inv.company_id != this.invoiceCompanyFilter) return false;
+
+ // 3. Tab Filter
+ if (this.activeInvoiceTab === 'approved' && inv.status !== 'approved') return false;
+ if (this.activeInvoiceTab === 'pending' && inv.status !== 'extracted' && inv.status !== 'pending') return false;
+ if (this.activeInvoiceTab === 'rejected' && inv.status !== 'rejected' && inv.status !== 'failed') return false;
+ if (this.activeInvoiceTab === 'jofotara' && !inv.jofotara_uuid && !inv.jofotara) return false;
+
+ return true;
+ });
+ },
+
token() { return localStorage.getItem('access_token'); },
showError(msg) { this.globalError = msg; setTimeout(() => this.globalError = '', 8000); },
| |||