Fix: account dropdown empty and save buttons unresponsive in قيد جديد screen#6
Draft
Fix: account dropdown empty and save buttons unresponsive in قيد جديد screen#6
Conversation
- openNewJournalInline() is now async and always fetches fresh leaf accounts from /accounts/leaf endpoint, fixing empty dropdown when navigating from Dashboard (which doesn't preload accounts) - Fetch cost centers if not already loaded when opening new journal - Show clear Arabic error messages on API failure instead of empty dropdown - initJournalForm(): add defensive boolean filter for MySQL TINYINT values and log warning when no accounts are available - renderJeLines(): show user-friendly Arabic warning when no leaf accounts found - submitJournalEntry(): add client-side pre-validation with clear Arabic messages before sending to server (date, description, account selection) Agent-Logs-Url: https://github.com/moded12/acc3/sessions/453d1f48-488f-4261-8596-5b0609d83af9 Co-authored-by: moded12 <162719285+moded12@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix account selection dropdown in new entry screen
Fix: account dropdown empty and save buttons unresponsive in قيد جديد screen
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
openNewJournalInline()readERP_DATA.accountssynchronously, which is[]on the Dashboard page (DashboardController passes no accounts). This caused a permanently empty account dropdown on the most common navigation path, and save buttons appeared unresponsive because server-side validation errors weren't clearly surfaced.Changes
views/layouts/main.php—openNewJournalInline()async; always fetches fresh data from/accounts/leaf(pre-filtered:is_leaf=1 AND is_active=1 AND allow_direct_posting=1) instead of relying on staleERP_DATA.accounts/cost-centers/listif not already loadedalertErroron fetch failurepublic/assets/js/erp.jsinitJournalForm(): defensive boolean filter handles MySQL TINYINT values returned as0/1,"0"/"1", or native boolean; logs console warning when resulting account list is emptyrenderJeLines(): renders a user-visible Arabic warning row instead of a silent empty<select>when no accounts pass the filtersubmitJournalEntry(): adds client-side pre-validation (date, description, all lines must have an account selected) with specific ArabicalertWarningmessages before any network request, preventing silent non-response when the form is incompleteOriginal prompt
افتح متابعة دقيقة لإصلاح قائمة اختيار الحساب في شاشة قيد جديد في المستودع moded12/acc3 (Sprint 2 blocker).
المشكلة الحالية حسب المستخدم:
المطلوب:
تحقيق متوقع:
اختبارات قبول:
A) فتح شاشة قيد جديد، الضغط على خانة الحساب في السطر الأول -> تظهر قائمة تحتوي حسابات نهائية نشطة (مثل الصندوق [1100]، رأس المال المدفوع [3101]) إذا كانت موجودة بالنظام.
B) اختيار حساب من القائمة يملأ الخانة ويؤثر على الحسابات/الإجماليات بدون أخطاء.
C) إذا لم توجد حسابات نهائية نشطة، أظهر رسالة واضحة للمستخدم بدل قائمة فارغة.
D) في حال فشل API، لا يحدث crash في console، وتظهر رسالة خطأ واضحة.
أنشئ Pull Request متابعة أو تحديث PR قائم لإصلاح هذه المشكلة فقط كجزء من إصلاحات Sprint 2 blocker.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: هذه شاشتي اين اذهب لنقل التعديلات الى مستودعي ؟
Assistant: أنت الآن في المكان الصحيح تمامًا.
الذي ينقص فقط هو أن هذا الـ PR ما زال بحالة:
Draft
ولهذا لن يظهر زر الدمج الآن.
ماذا تفعل الآن بالضبط؟
الخطوة 1: تحويل الـ PR من Draft إلى Ready
في أعلى يمين العنوان تقريبًا، عندك زر يظهر:
اضغط عليه.
ثم اختر:
Ready for review
أو ما يعادلها لتحويله من Draft إلى PR جاهز.
بعد تحويله إلى Ready
سيظهر لك عادة أحد الأزرار التالية أسفل الصفحة أو في الأعلى:
أو
ماذا تختار؟
أنصحك بـ:
Squash and merge
لأنه:
الترتيب الكامل خطوة بخطوة
1) من نفس الصفحة:
اضغط:
Not ready
2) حوّله إلى:
Ready for review
3) راجع سريعًا:
4) انزل لأسفل الصفحة
ستجد زر:
Squash and merge
أو
Merge pull request
5) اضغط:
Squash and merge
6) ثم اضغط:
Confirm squash and merge
بعد الدمج
التعديلات تصبح داخل:
mainفي مستودعك:
moded12/acc3إذا عندك نسخة محلية على جهازك
بعد الدمج نفّذ:
مهم جدًا
قبل الدمج أنصحك تعمل هذا سريعًا:
افتح تبويب:
Files changed
وتأكد من أن التعديلات منطقية بالنسبة لك.
ملخص سريع جدًا
من شاشتك الحالية:
اضغط أولًا:
Not ready
ثم:
Ready for review
ثم:
Squash and merge
إذا تريد، بعد أن تضغط Ready for review أرسل لي لقطة الشاشة التالية،
وأقول لك بالضبط أين تضغط للدمج النهائي.
User: تمام تم التحديث وتم النقل الى السيرفر خاصتي بنجاح . لنرى ونستعرض ما حققنا بهذا الخطوة
Assistant: ممتاز. بهذه الخطوة تم اعتماد التعديلات ودمجها ورفعها إلى السيرفر.
والآن نستعرض ماذا تحقق فعليًا في هذه المرحلة قبل أن نكمل.
ما الذي تحقق في هذه الخطوة؟
اسم المرحلة
Sprint 1.5 + بداية Sprint 2
أولًا: ما الذي تحقق في دليل الحسابات؟
1) إصلاح لوحة تفاصيل الحساب عند الضغط المفرد
كان سابقًا:
الآن المتوقع أنه أصبح:
مثل:
2) إضافة بحث آلي Live Search في دليل الحسابات
أصبح من المفترض أن:
أمثلة:
1100صنالصندوق111210ويفترض أن تظهر الحسابات المطابقة فورًا.
3) تثبيت التعامل مع الشجرة بشكل أفضل
تم تحسين استقرار الشجرة بحيث:
ثانيًا: ما الذي بدأ في Sp...
This pull request was created from Copilot chat.