diff --git a/accounting/creditlimit.py b/accounting/creditlimit.py index 269acf2..83bf0e8 100644 --- a/accounting/creditlimit.py +++ b/accounting/creditlimit.py @@ -56,9 +56,9 @@ async def get_my_credit_list(sor, orgid): ELSE 0 END as usage_pct FROM credit_limit cl - LEFT JOIN organization org ON cl.orgid = org.id - LEFT JOIN account acc ON cl.accountid = acc.id - LEFT JOIN subject sub ON acc.subjectid = sub.id + LEFT JOIN organization org ON cl.orgid = org.id COLLATE utf8mb4_unicode_ci + LEFT JOIN account acc ON cl.accountid = acc.id COLLATE utf8mb4_unicode_ci + LEFT JOIN subject sub ON acc.subjectid = sub.id COLLATE utf8mb4_unicode_ci WHERE cl.orgid = ${orgid}$ ORDER BY cl.created_at DESC """ @@ -88,9 +88,9 @@ async def get_all_customer_credits(sor, orgid, status_filter=None): ELSE 0 END as usage_pct FROM credit_limit cl - LEFT JOIN organization org ON cl.orgid = org.id - LEFT JOIN account acc ON cl.accountid = acc.id - LEFT JOIN subject sub ON acc.subjectid = sub.id + LEFT JOIN organization org ON cl.orgid = org.id COLLATE utf8mb4_unicode_ci + LEFT JOIN account acc ON cl.accountid = acc.id COLLATE utf8mb4_unicode_ci + LEFT JOIN subject sub ON acc.subjectid = sub.id COLLATE utf8mb4_unicode_ci {where_clause} ORDER BY cl.updated_at DESC """ diff --git a/accounting/stats.py b/accounting/stats.py index 27f5afc..d4ef350 100644 --- a/accounting/stats.py +++ b/accounting/stats.py @@ -42,7 +42,7 @@ async def get_accounting_stats(request): sql_today = """ SELECT COALESCE(SUM(amount), 0) as total FROM acc_detail a - JOIN account b ON a.accountid = b.id + JOIN account b ON a.accountid = b.id COLLATE utf8mb4_unicode_ci WHERE b.orgid = ${orgid}$ AND a.acc_dir = 1 AND a.acc_date >= ${from_date}$ @@ -60,7 +60,7 @@ async def get_accounting_stats(request): sql_month = """ SELECT COALESCE(SUM(amount), 0) as total FROM acc_detail a - JOIN account b ON a.accountid = b.id + JOIN account b ON a.accountid = b.id COLLATE utf8mb4_unicode_ci WHERE b.orgid = ${orgid}$ AND a.acc_dir = 1 AND a.acc_date >= ${from_date}$ diff --git a/wwwroot/billing.dspy b/wwwroot/billing.dspy index 4f78cc2..2d1bda4 100644 --- a/wwwroot/billing.dspy +++ b/wwwroot/billing.dspy @@ -21,8 +21,8 @@ async with get_sor_context(request._run_ns, 'accounting') as sor: sql = """select d.acc_date, d.acc_timestamp, d.acc_dir, d.summary, d.amount, d.balance, s.name as subject_name from acc_detail d -join account a on d.accountid = a.id -join subject s on a.subjectid = s.id +join account a on d.accountid = a.id COLLATE utf8mb4_unicode_ci +join subject s on a.subjectid = s.id COLLATE utf8mb4_unicode_ci where a.orgid = ${orgid}$ and d.acc_date >= ${start_date}$ and d.acc_date <= ${end_date}$""" diff --git a/wwwroot/billing.ui b/wwwroot/billing.ui index 3dea29b..216602b 100644 --- a/wwwroot/billing.ui +++ b/wwwroot/billing.ui @@ -22,13 +22,13 @@ { "name":"start_date", "label":"开始日期", - "uitype":"str", + "uitype":"date", "value":"{{start_date}}" }, { "name":"end_date", "label":"结束日期", - "uitype":"str", + "uitype":"date", "value":"{{end_date}}" } ], diff --git a/wwwroot/credit_limit/hub.ui b/wwwroot/credit_limit/hub.ui index e1af8d7..08f0369 100644 --- a/wwwroot/credit_limit/hub.ui +++ b/wwwroot/credit_limit/hub.ui @@ -28,18 +28,17 @@ "widgettype": "VBox", "options": { "bgcolor": "#1E293B", - "padding": "16px", + "padding": "12px", "borderRadius": "10px", "border": "1px solid #334155", - "flex": "1", - "minHeight": "100px" + "flex": "none" }, "subwidgets": [ { "widgettype": "HBox", "options": { "alignItems": "center", - "marginBottom": "8px" + "marginBottom": "6px" }, "subwidgets": [ { @@ -57,7 +56,7 @@ "widgettype": "Text", "options": { "text": "¥{{'%.2f' % cstats.total_credit}}", - "fontSize": "26px", + "fontSize": "22px", "fontWeight": "700", "color": "#3B82F6", "lineHeight": "1.2" @@ -69,7 +68,7 @@ "text": "授信总额度", "fontSize": "13px", "color": "#94A3B8", - "marginTop": "4px" + "marginTop": "2px" } } ] @@ -78,18 +77,17 @@ "widgettype": "VBox", "options": { "bgcolor": "#1E293B", - "padding": "16px", + "padding": "12px", "borderRadius": "10px", "border": "1px solid #334155", - "flex": "1", - "minHeight": "100px" + "flex": "none" }, "subwidgets": [ { "widgettype": "HBox", "options": { "alignItems": "center", - "marginBottom": "8px" + "marginBottom": "6px" }, "subwidgets": [ { @@ -107,7 +105,7 @@ "widgettype": "Text", "options": { "text": "¥{{'%.2f' % cstats.total_used}}", - "fontSize": "26px", + "fontSize": "22px", "fontWeight": "700", "color": "#F59E0B", "lineHeight": "1.2" @@ -119,7 +117,7 @@ "text": "已用额度", "fontSize": "13px", "color": "#94A3B8", - "marginTop": "4px" + "marginTop": "2px" } } ] @@ -128,18 +126,17 @@ "widgettype": "VBox", "options": { "bgcolor": "#1E293B", - "padding": "16px", + "padding": "12px", "borderRadius": "10px", "border": "1px solid #334155", - "flex": "1", - "minHeight": "100px" + "flex": "none" }, "subwidgets": [ { "widgettype": "HBox", "options": { "alignItems": "center", - "marginBottom": "8px" + "marginBottom": "6px" }, "subwidgets": [ { @@ -157,7 +154,7 @@ "widgettype": "Text", "options": { "text": "¥{{'%.2f' % cstats.total_available}}", - "fontSize": "26px", + "fontSize": "22px", "fontWeight": "700", "color": "#22C55E", "lineHeight": "1.2" @@ -169,7 +166,7 @@ "text": "剩余额度", "fontSize": "13px", "color": "#94A3B8", - "marginTop": "4px" + "marginTop": "2px" } } ] @@ -178,18 +175,17 @@ "widgettype": "VBox", "options": { "bgcolor": "#1E293B", - "padding": "16px", + "padding": "12px", "borderRadius": "10px", "border": "1px solid #334155", - "flex": "1", - "minHeight": "100px" + "flex": "none" }, "subwidgets": [ { "widgettype": "HBox", "options": { "alignItems": "center", - "marginBottom": "8px" + "marginBottom": "6px" }, "subwidgets": [ { @@ -207,7 +203,7 @@ "widgettype": "Text", "options": { "text": "{{cstats.usage_pct}}%", - "fontSize": "26px", + "fontSize": "22px", "fontWeight": "700", "color": "#A78BFA", "lineHeight": "1.2" @@ -219,7 +215,7 @@ "text": "额度使用率 ({{cstats.active_count}}/{{cstats.customer_count}}户)", "fontSize": "13px", "color": "#94A3B8", - "marginTop": "4px" + "marginTop": "2px" } } ] @@ -294,7 +290,8 @@ "id": "credit_content", "options": { "width": "100%", - "flex": "1" + "css": "filler", + "marginTop": "8px" } } ] diff --git a/wwwroot/credit_limit/index.ui b/wwwroot/credit_limit/index.ui index cbf0dd8..647325e 100644 --- a/wwwroot/credit_limit/index.ui +++ b/wwwroot/credit_limit/index.ui @@ -1,7 +1,7 @@ { "widgettype": "VBox", "options": { - "cheight": 40, + "height": "100%", "width": "100%" }, "subwidgets": [