{# 错帐处理 (Error Accounting) Page PURPOSE: This page provides a management interface for handling accounting errors and exceptions. It allows operators to review, correct, and resolve accounting discrepancies. INTENDED WORKFLOW: 1. An accounting exception is detected (manually or automatically): - wrong_account: Transaction posted to incorrect account/subject - duplicate_entry: Same transaction recorded more than once - missing_entry: Expected transaction not found in records - amount_mismatch: Debit/credit amounts don't balance or differ from source 2. Operator reviews the error log table (error_accounting_log): - Each row shows: timestamp, error type, original transaction info, status - Filter by status (pending/resolved) to prioritize work 3. Operator selects an error record and chooses a correction action: - reverse_entry: Create a reversing journal entry to cancel the original - adjust_entry: Create an adjustment entry to correct the amount/account - mark_resolved: Flag as resolved without further action (e.g., duplicate already fixed) 4. The correction is recorded with an audit trail linking back to the original error. DATA SOURCE: - Table: error_accounting_log - Expected fields: id, timestamp, error_type, original_trans_id, original_subject, original_amount, original_summary, error_description, status, resolved_at, resolved_by, correction_action TOOLBAR ACTIONS: - 报告错帐: Opens a form to manually report a new accounting error - 全部: Show all error records (no filter) - 待处理: Filter to show only pending/unresolved errors - 已处理: Filter to show only resolved errors ROW ACTIONS (on click): - 冲正 (reverse_entry): Reverse the original transaction - 调整 (adjust_entry): Create an adjustment/correction entry - 标记已处理 (mark_resolved): Mark as resolved #} { "widgettype": "VBox", "id": "error_accounting_page", "options": { "width": "100%", "height": "100%", "gap": "12px", "padding": "16px" }, "subwidgets": [ { "widgettype": "VBox", "id": "error_acc_header", "options": { "bgcolor": "#1E293B", "padding": "20px", "borderRadius": "12px", "border": "1px solid #334155", "gap": "8px" }, "subwidgets": [ { "widgettype": "HBox", "options": { "alignItems": "center", "justifyContent": "space-between" }, "subwidgets": [ { "widgettype": "VBox", "options": {"gap": "4px"}, "subwidgets": [ { "widgettype": "Text", "options": { "text": "错帐处理", "fontSize": "22px", "fontWeight": "700", "color": "#F1F5F9" } }, { "widgettype": "Text", "options": { "text": "会计差错管理 — 发现、纠正并解决帐务异常记录", "fontSize": "13px", "color": "#94A3B8" } } ] } ] } ] }, { "widgettype": "HBox", "id": "error_acc_toolbar", "options": { "bgcolor": "#1E293B", "padding": "12px 16px", "borderRadius": "10px", "border": "1px solid #334155", "alignItems": "center", "gap": "10px" }, "subwidgets": [ { "widgettype": "Button", "id": "btn_report_error", "options": { "label": "报告错帐", "bgcolor": "#EF4444", "color": "#FFFFFF", "borderRadius": "6px", "padding": "8px 16px", "fontWeight": "600" }, "binds": [{ "wid": "self", "event": "click", "actiontype": "urlwidget", "target": "PopupWindow", "popup_options": { "title": "报告错帐", "width": "560px", "height": "600px" }, "options": { "url": "{{entire_url('/accounting/error_accounting_report.ui')}}" } }] }, { "widgettype": "Filler" }, { "widgettype": "Text", "options": { "text": "筛选:", "fontSize": "13px", "color": "#94A3B8" } }, { "widgettype": "Button", "id": "btn_filter_all", "options": { "label": "全部", "bgcolor": "#3B82F6", "color": "#FFFFFF", "borderRadius": "6px", "padding": "6px 12px" }, "binds": [{ "wid": "self", "event": "click", "actiontype": "script", "script": "const tab = bricks.getWidgetById('error_acc_tabular'); if(tab) { tab.render({}); }" }] }, { "widgettype": "Button", "id": "btn_filter_pending", "options": { "label": "待处理", "bgcolor": "#F59E0B", "color": "#FFFFFF", "borderRadius": "6px", "padding": "6px 12px" }, "binds": [{ "wid": "self", "event": "click", "actiontype": "script", "script": "const tab = bricks.getWidgetById('error_acc_tabular'); if(tab) { tab.render({status: 'pending'}); }" }] }, { "widgettype": "Button", "id": "btn_filter_resolved", "options": { "label": "已处理", "bgcolor": "#22C55E", "color": "#FFFFFF", "borderRadius": "6px", "padding": "6px 12px" }, "binds": [{ "wid": "self", "event": "click", "actiontype": "script", "script": "const tab = bricks.getWidgetById('error_acc_tabular'); if(tab) { tab.render({status: 'resolved'}); }" }] } ] }, { "widgettype": "VBox", "id": "error_acc_table_container", "options": { "bgcolor": "#1E293B", "borderRadius": "10px", "border": "1px solid #334155", "width": "100%", "flex": "1" }, "subwidgets": [ { "widgettype": "HBox", "options": { "bgcolor": "#0F172A", "padding": "10px 16px", "borderRadius": "10px 10px 0 0", "alignItems": "center" }, "subwidgets": [ { "widgettype": "Text", "options": {"text": "时间", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 16} }, { "widgettype": "Text", "options": {"text": "错帐类型", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 12} }, { "widgettype": "Text", "options": {"text": "原始交易", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 20} }, { "widgettype": "Text", "options": {"text": "金额", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 10} }, { "widgettype": "Text", "options": {"text": "说明", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 24} }, { "widgettype": "Text", "options": {"text": "状态", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 8} }, { "widgettype": "Text", "options": {"text": "操作", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8", "cwidth": 10} } ] }, { "widgettype": "Tabular", "id": "error_acc_tabular", "options": { "width": "100%", "height": "100%", "css": "filler", "data_url": "{{entire_url('/accounting/error_accounting_log.dspy')}}", "editable": false, "page_rows": 50, "row_options": { "browserfields": { "exclouded": ["row_num_"] }, "fields": [ { "name": "timestamp", "title": "时间", "type": "timestamp", "uitype": "timestamp", "datatype": "timestamp", "label": "时间", "cwidth": 16 }, { "name": "error_type", "title": "错帐类型", "type": "str", "length": 20, "uitype": "str", "datatype": "str", "label": "错帐类型", "cwidth": 12 }, { "name": "original_summary", "title": "原始交易", "type": "str", "length": 100, "uitype": "str", "datatype": "str", "label": "原始交易", "cwidth": 20 }, { "name": "original_amount", "title": "金额", "type": "float", "length": 18, "dec": 4, "uitype": "float", "datatype": "float", "label": "金额", "cwidth": 10 }, { "name": "error_description", "title": "说明", "type": "str", "length": 200, "uitype": "str", "datatype": "str", "label": "说明", "cwidth": 24 }, { "name": "status", "title": "状态", "type": "str", "length": 10, "uitype": "str", "datatype": "str", "label": "状态", "cwidth": 8 } ] } } }, { "widgettype": "VBox", "id": "error_acc_empty_hint", "options": { "padding": "20px", "alignItems": "center", "bgcolor": "#1E293B" }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "如表格为空,表示暂无错帐记录。请点击「报告错帐」按钮手动添加,或确认 error_accounting_log 数据源已配置。", "fontSize": "13px", "color": "#64748B" } } ] } ] }, { "widgettype": "VBox", "id": "error_acc_legend", "options": { "bgcolor": "#1E293B", "padding": "16px", "borderRadius": "10px", "border": "1px solid #334155", "gap": "8px" }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "错帐类型说明", "fontSize": "14px", "fontWeight": "600", "color": "#F1F5F9" } }, { "widgettype": "HBox", "options": { "gap": "16px", "alignItems": "center" }, "subwidgets": [ { "widgettype": "HBox", "options": {"gap": "6px", "alignItems": "center"}, "subwidgets": [ { "widgettype": "HBox", "options": { "bgcolor": "#EF444433", "padding": "2px 8px", "borderRadius": "4px" }, "subwidgets": [ { "widgettype": "Text", "options": {"text": "科目错误", "fontSize": "12px", "color": "#EF4444"} } ] }, { "widgettype": "Text", "options": {"text": "wrong_account", "fontSize": "11px", "color": "#64748B"} } ] }, { "widgettype": "HBox", "options": {"gap": "6px", "alignItems": "center"}, "subwidgets": [ { "widgettype": "HBox", "options": { "bgcolor": "#F59E0B33", "padding": "2px 8px", "borderRadius": "4px" }, "subwidgets": [ { "widgettype": "Text", "options": {"text": "重复入帐", "fontSize": "12px", "color": "#F59E0B"} } ] }, { "widgettype": "Text", "options": {"text": "duplicate_entry", "fontSize": "11px", "color": "#64748B"} } ] }, { "widgettype": "HBox", "options": {"gap": "6px", "alignItems": "center"}, "subwidgets": [ { "widgettype": "HBox", "options": { "bgcolor": "#8B5CF633", "padding": "2px 8px", "borderRadius": "4px" }, "subwidgets": [ { "widgettype": "Text", "options": {"text": "漏记", "fontSize": "12px", "color": "#8B5CF6"} } ] }, { "widgettype": "Text", "options": {"text": "missing_entry", "fontSize": "11px", "color": "#64748B"} } ] }, { "widgettype": "HBox", "options": {"gap": "6px", "alignItems": "center"}, "subwidgets": [ { "widgettype": "HBox", "options": { "bgcolor": "#3B82F633", "padding": "2px 8px", "borderRadius": "4px" }, "subwidgets": [ { "widgettype": "Text", "options": {"text": "金额不符", "fontSize": "12px", "color": "#3B82F6"} } ] }, { "widgettype": "Text", "options": {"text": "amount_mismatch", "fontSize": "11px", "color": "#64748B"} } ] } ] }, { "widgettype": "HBox", "options": { "gap": "16px", "alignItems": "center", "marginTop": "4px" }, "subwidgets": [ { "widgettype": "Text", "options": { "text": "纠正操作: 冲正(reverse_entry) | 调整(adjust_entry) | 标记已处理(mark_resolved)", "fontSize": "12px", "color": "#94A3B8" } } ] } ] } ] }