إعادة اختبار شاملة بعد إغلاق أحمد لـ 14 تذكرة CRITICAL/COMPLIANCE. تم الاختبار الفعلي على moon-erp.elbaset.com عبر HTTP API + قراءة الكود البرمجي للتحقق.
journalentry فقط، بينما المطلوب 20 موديل (Account, FixedAsset, Voucher, Currency, ExchangeRate, TaxRate, FiscalYear, إلخ)ApproveJournalEntry::execute() يفحص $entry->created_by === $userIdcurrency_id=1 (KWD) + exchange_rate=12.5 دون وجود سجل في exchange_rates → HTTP 422GET /api/core/activity-log → HTTP 200 + 463 سجل في الإنتاجjournalentry subject_type موجود.GET /api/accounting/zakat → HTTP 200 (data: [] — قاعدة بيانات نظيفة)GET /api/accounting/withholding-tax → HTTP 200 + /withholding-tax/report"date": "2026-05-19" + "date_hijri": "1447/12/02"ApproveJournalEntry::execute(): if (! $entry->fiscalPeriod->isOpen()) throw...f45d2a35 + integration test أحمد ذكرهReverseJournalEntry::execute(): $existingReversal = $entry->reversals()
->whereIn('status', ['approved', 'posted'])
->exists();
if ($existingReversal) throw .../api/core/activity-log → كل الـ subject_type = journalentry فقطwhereIn('status', ['approved', 'posted']) — لا يفحص draftsallowSelfApprove: true) أو لو دخل user آخر، الـ drafts ممكن تتعتمد كلهاwhereIn('status', ['draft', 'approved', 'posted']) أو إضافة UNIQUE constraint على reversed_entry_id في DBStoreJournalEntryRequest:
debit XOR credit (واحد فقط > 0)SUM(debit) === SUM(credit)SUM(debit) > 0 (no zero JEs)artisan route:listClass "Modules\EInvoicing\Http\Controllers\EInvoicingController" does not exist at Modules/EInvoicing/routes/web.php:7
EInvoiceConfigController, EInvoiceDocumentController ونسي تحديث web.phpartisan route:list وأدوات إدارية أخرى تفشل. أيضاً ممكن يؤثر على cache rebuildModules/EInvoicing/routes/web.php أو استبدال الـ reference بـ controller صحيحaccounting:integrity-check command غير مسجّل في ServiceProviderphp artisan accounting:integrity-check → "Command not defined"CheckAccountingIntegrityCommand.php لكن لم يسجّله في AccountingServiceProvider.php :: $commandsExecuteRecurringEntriesCommand فقطAccountingServiceProvider.php: $this->commands([
ExecuteRecurringEntriesCommand::class,
CheckAccountingIntegrityCommand::class, // ← ADD
]);| تذكرة | الموضوع | الحالة | الدليل |
|---|---|---|---|
| #1558 | ACC-FIX-1 Check workflow GL | FIXED | commit 03ea38a6 — Cash/Collect مُصلَّحان. IssueCheck/BounceCheck dedicated مؤجَّل صراحةً |
| #1559 | ACC-FIX-2 Vouchers stay Draft | FIXED | Approve+Post atomic — Vouchers لا تُترك Draft |
| #1560 | ACC-FIX-3 Petty Cash standalone | FIXED | JE تُنشأ لكل معاملة |
| #1561 | ACC-FIX-4 Fixed Asset Sell/Acquisition | FIXED | JE الاقتناء والبيع مُصلَّحان |
| #1562 | ACC-FIX-5 ReopenFiscalYear + NULL entry_number | FIXED | Reopen ينشئ reversal entries · entry_number = NULL مستحيل بعد Posted |
| #1563 | ACC-FIX-6 SoD + period lock + opening balance | FIXED | تم اختبارهم حياً — SoD يعمل · period check موجود |
| #1564 | ACC-FIX-7 Cost Allocation + Double-Reverse | PARTIAL | Cost allocation ✅ · Double-reverse ينقصه فحص drafts |
| #1565 | ACC-FIX-8 FX rate + recon difference + depreciation idempotency | FIXED | FX rate enforced · recon difference check · depreciation unique constraint |
| #1566 | ACC-FIX-9 Defense-in-depth integrity check | DEPLOY BUG | الكود موجود في CheckAccountingIntegrityCommand.php لكن غير مسجّل في الـ ServiceProvider · cron لا يعمل |
| #1567 | ACC-COMP-1 ZATCA Phase 2 | FIXED (backend) | Backend wiring + integration test · Frontend wizard + PDF declaration مؤجَّلة صراحةً |
| #1568 | ACC-COMP-2 Audit Log (Spatie) | PARTIAL | API + JournalEntry يعملان · 19 موديل آخر بدون LogsActivity trait |
| #1569 | ACC-COMP-3 Zakat module | FIXED (backend) | Endpoints + calculation · Frontend wizard مؤجَّل |
| #1570 | ACC-COMP-4 Withholding Tax | FIXED | Rates + calculator + JE wiring + report |
| #1571 | ACC-COMP-5 SAR decimal + Hijri | PARTIAL | Hijri ✅ · decimal(15,3)→(15,2) مؤجَّل صراحةً بمبرر (KWD يحتاج 3 decimals) |
AccountingServiceProvider + جدولته في Console/Kernel.php يومياًEInvoicing/routes/web.php — حذف السطر المكسور| السيناريو | طلب | استجابة سابقة | استجابة حالية | الحالة |
|---|---|---|---|---|
| JE create unbalanced | POST /journal-entries debit=100, credit=50 | 201 (accepted as draft) | 201 (لا يزال يقبل draft) | UNCHANGED |
| JE approve unbalanced | POST /journal-entries/123/approve | 422 | 422 "القيد غير متوازن" | PASS |
| JE self-approve | POST /journal-entries/126/approve (same user as creator) | 200 (allowed) | 422 "لا يمكن لنفس المستخدم..." | FIXED |
| FX without rate | POST JE با currency_id=KWD, no rate seeded | 201 stored rate=1.0 | 422 "لا يوجد سعر صرف" | FIXED |
| Double-reverse drafts | POST /journal-entries/122/reverse × 2 | 2 reversals created (id 8, 9) | 2 drafts created (id 126, 127) | STILL POSSIBLE |
| Activity log fetch | GET /core/activity-log | 404 | 200 (463 entries) | FIXED |
| Zakat endpoint | GET /accounting/zakat | 404 | 200 (data:[]) | FIXED |
| WHT endpoint | GET /accounting/withholding-tax | 404 | 200 | FIXED |
| Hijri date display | JE response.date_hijri | غير موجود | "1447/12/02" | FIXED |
| Integrity command | php artisan accounting:integrity-check | — | "not defined" | DEPLOY BUG |