@davoodmehraban89 / Aram / commits / 0e0e65b
Fork 0

feat(desktop): add searchable paginated detail grid with source evidence

davoodmehraban89 committed Oct 31, 2026 at 21:38 UTC 0e0e65b029da676726e6f70f56fa9981118fd067
1 file changed +91 -1
backend/src/aram_backend/desktop_five_statement.py
+91 -1
@@ -149,9 +149,10 @@ class FiveStatementWindow(tk.Tk):
149 self.tabs.pack(fill="both", expand=True)
150 main = ttk.Frame(self.tabs, padding=12)
151 figures = ttk.Frame(self.tabs, padding=12)
152 + details = ttk.Frame(self.tabs, padding=12)
153 limitations = ttk.Frame(self.tabs, padding=18)
154 help_tab = ttk.Frame(self.tabs, padding=18)
154 - for tab, title in zip((main, figures, limitations, help_tab), TAB_NAMES):
155 + for tab, title in zip((main, figures, details, limitations, help_tab), TAB_NAMES):
156 self.tabs.add(tab, text=title)
157
158 ttk.Label(main, textvariable=self.workbook_label, anchor="e").pack(
@@ -243,6 +244,95 @@ class FiveStatementWindow(tk.Tk):
244 figure_area.grid_columnconfigure(0, weight=1)
245 figure_area.grid_rowconfigure(0, weight=1)
246
247 + ttk.Label(
248 + details,
249 + text="ریز اقلام و ردگیری منبع — فقط خواندنی و غیررسمی",
250 + font=("Tahoma", 11, "bold"), anchor="e",
251 + ).pack(fill="x", pady=(0, 7))
252 + controls = ttk.Frame(details)
253 + controls.pack(fill="x", pady=(0, 8))
254 + self.detail_filter_var = tk.StringVar(value="همه")
255 + self.detail_filter_combo = ttk.Combobox(
256 + controls, textvariable=self.detail_filter_var, state="readonly",
257 + values=(
258 + "همه", "ترازنامه", "سود و زیان",
259 + "تغییرات حقوق مالکانه", "جریان وجوه نقد", "تراز آزمایشی",
260 + ),
261 + width=22,
262 + )
263 + self.detail_filter_combo.pack(side="right", padx=4)
264 + self.detail_filter_combo.bind(
265 + "<<ComboboxSelected>>", lambda event: self._apply_detail_filter(),
266 + )
267 + self.detail_search_var = tk.StringVar(value="")
268 + self.detail_search_entry = ttk.Entry(
269 + controls, textvariable=self.detail_search_var, width=28,
270 + )
271 + self.detail_search_entry.pack(side="right", padx=4)
272 + self.detail_search_entry.bind(
273 + "<Return>", lambda event: self._apply_detail_filter(),
274 + )
275 + self.detail_search_button = ttk.Button(
276 + controls, text="جستجو", command=self._apply_detail_filter,
277 + )
278 + self.detail_search_button.pack(side="right", padx=4)
279 + self.detail_status = tk.StringVar(value="پس از اجرای کنترل، ریز اقلام نمایش داده می‌شود")
280 + ttk.Label(details, textvariable=self.detail_status, anchor="e").pack(
281 + fill="x", pady=(0, 6),
282 + )
283 + detail_area = ttk.Frame(details)
284 + detail_area.pack(fill="both", expand=True)
285 + detail_columns = (
286 + "statement", "item", "reference", "source", "opening",
287 + "debit", "credit", "movement", "closing", "trace", "state",
288 + )
289 + self.detail_tree = ttk.Treeview(
290 + detail_area, columns=detail_columns, show="headings",
291 + style="Aram.Treeview",
292 + )
293 + detail_headers = (
294 + ("statement", "صورت مالی", 150),
295 + ("item", "شرح / حساب / فعالیت", 190),
296 + ("reference", "یادداشت / شناسه", 190),
297 + ("source", "مواجهه / ردیف منبع", 180),
298 + ("opening", "افتتاحیه / منبع", 130),
299 + ("debit", "بدهکار / ورودی", 130),
300 + ("credit", "بستانکار / خروجی", 130),
301 + ("movement", "تغییر", 130),
302 + ("closing", "اختتامیه / ارائه", 150),
303 + ("trace", "مدرک / سیاست / ردگیری", 330),
304 + ("state", "وضعیت", 160),
305 + )
306 + for key, heading, width in detail_headers:
307 + self.detail_tree.heading(key, text=heading)
308 + self.detail_tree.column(key, width=width, minwidth=80, anchor="e")
309 + detail_y = ttk.Scrollbar(
310 + detail_area, orient="vertical", command=self.detail_tree.yview,
311 + )
312 + detail_x = ttk.Scrollbar(
313 + detail_area, orient="horizontal", command=self.detail_tree.xview,
314 + )
315 + self.detail_tree.configure(
316 + yscrollcommand=detail_y.set, xscrollcommand=detail_x.set,
317 + )
318 + self.detail_tree.grid(row=0, column=0, sticky="nsew")
319 + detail_y.grid(row=0, column=1, sticky="ns")
320 + detail_x.grid(row=1, column=0, sticky="ew")
321 + detail_area.grid_columnconfigure(0, weight=1)
322 + detail_area.grid_rowconfigure(0, weight=1)
323 + paging = ttk.Frame(details)
324 + paging.pack(fill="x", pady=(7, 0))
325 + self.detail_prev_button = ttk.Button(
326 + paging, text="صفحه قبل", command=lambda: self._change_detail_page(-1),
327 + state="disabled",
328 + )
329 + self.detail_prev_button.pack(side="right", padx=4)
330 + self.detail_next_button = ttk.Button(
331 + paging, text="صفحه بعد", command=lambda: self._change_detail_page(1),
332 + state="disabled",
333 + )
334 + self.detail_next_button.pack(side="right", padx=4)
335 +
336 for item in (
337 "• موفقیت آزمون به‌معنای کامل‌بودن سندها، مانده‌ها یا نگاشت‌های حسابداری نیست.",
338 "• طبقه‌بندی جریان نقد به ریزاسناد جفت‌شده و فهرست حساب‌های نقد نیاز دارد.",