Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76da3a2106 | ||
|
|
e7e93c06f8 |
@@ -17,7 +17,7 @@ def run_migrations():
|
|||||||
"""
|
"""
|
||||||
from migrations.tables import migrate_create_tables
|
from migrations.tables import migrate_create_tables
|
||||||
from migrations.columns import migrate_add_columns
|
from migrations.columns import migrate_add_columns
|
||||||
from migrations.data_fixes import migrate_fix_task_status, migrate_rename_tenant, migrate_drop_product_fields, migrate_fix_service_fee_standard
|
from migrations.data_fixes import migrate_fix_task_status, migrate_rename_tenant, migrate_drop_product_fields, migrate_fix_service_fee_standard, migrate_fix_expense_status
|
||||||
from migrations.data_split import migrate_data_split
|
from migrations.data_split import migrate_data_split
|
||||||
from migrations.seed import migrate_seed_users, migrate_seed_demo_data
|
from migrations.seed import migrate_seed_users, migrate_seed_demo_data
|
||||||
|
|
||||||
@@ -27,6 +27,7 @@ def run_migrations():
|
|||||||
migrate_rename_tenant()
|
migrate_rename_tenant()
|
||||||
migrate_drop_product_fields()
|
migrate_drop_product_fields()
|
||||||
migrate_fix_service_fee_standard()
|
migrate_fix_service_fee_standard()
|
||||||
|
migrate_fix_expense_status()
|
||||||
migrate_data_split()
|
migrate_data_split()
|
||||||
migrate_seed_users()
|
migrate_seed_users()
|
||||||
migrate_seed_demo_data()
|
migrate_seed_demo_data()
|
||||||
|
|||||||
@@ -92,3 +92,23 @@ def migrate_fix_service_fee_standard():
|
|||||||
print(f"[migrate] project_finances: {affected} 条记录 service_fee_standard 修正为 5")
|
print(f"[migrate] project_finances: {affected} 条记录 service_fee_standard 修正为 5")
|
||||||
finally:
|
finally:
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
|
def migrate_fix_expense_status():
|
||||||
|
"""修正 expense_records 中空的 status 为默认值「计入费用」"""
|
||||||
|
from db import db
|
||||||
|
|
||||||
|
conn = db()
|
||||||
|
try:
|
||||||
|
cur = conn.cursor()
|
||||||
|
cur.execute(
|
||||||
|
"UPDATE expense_records SET status='计入费用' "
|
||||||
|
"WHERE status IS NULL OR status='' OR status='待审批'"
|
||||||
|
)
|
||||||
|
affected = cur.rowcount
|
||||||
|
cur.close()
|
||||||
|
if affected:
|
||||||
|
conn.commit()
|
||||||
|
print(f"[migrate] expense_records: {affected} 条记录 status 修正为 '计入费用'")
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|||||||
@@ -331,6 +331,7 @@ def bootstrap():
|
|||||||
def t_expense_sum(m_range):
|
def t_expense_sum(m_range):
|
||||||
total = 0
|
total = 0
|
||||||
for r in t_expense:
|
for r in t_expense:
|
||||||
|
if (r.get("status") or "") == "暂不计入": continue
|
||||||
m = (r.get("expense_month") or "").strip()
|
m = (r.get("expense_month") or "").strip()
|
||||||
if not m or "-" not in m: continue
|
if not m or "-" not in m: continue
|
||||||
try:
|
try:
|
||||||
@@ -459,6 +460,7 @@ def bootstrap():
|
|||||||
def expense_sum(month_range):
|
def expense_sum(month_range):
|
||||||
total = 0
|
total = 0
|
||||||
for r in expense:
|
for r in expense:
|
||||||
|
if (r.get("status") or "") == "暂不计入": continue
|
||||||
m = (r.get("expense_month") or "").strip()
|
m = (r.get("expense_month") or "").strip()
|
||||||
if not m or "-" not in m: continue
|
if not m or "-" not in m: continue
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<header class="topbar border-b border-slate-200 bg-white px-8 py-5">
|
<header class="topbar border-b border-slate-200 bg-white px-8 py-5">
|
||||||
<div class="flex items-center gap-3 w-full">
|
<div class="flex items-center gap-3 w-full">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<p class="eyebrow text-xs font-semibold uppercase tracking-[0.18em] text-blue-700">OPC Manager <span class="ml-2 text-xs font-normal text-slate-400 tracking-normal">v1.0.0.5</span></p>
|
<p class="eyebrow text-xs font-semibold uppercase tracking-[0.18em] text-blue-700">OPC Manager <span class="ml-2 text-xs font-normal text-slate-400 tracking-normal">v1.0.0.7</span></p>
|
||||||
<div class="flex items-center gap-4 mt-1">
|
<div class="flex items-center gap-4 mt-1">
|
||||||
<h1 class="text-2xl font-semibold" id="workspaceTitle">科普 OPC 工作台</h1>
|
<h1 class="text-2xl font-semibold" id="workspaceTitle">科普 OPC 工作台</h1>
|
||||||
<div class="hidden sm:flex items-center gap-1.5 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-100 rounded-full px-4 py-1.5">
|
<div class="hidden sm:flex items-center gap-1.5 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-100 rounded-full px-4 py-1.5">
|
||||||
|
|||||||
Reference in New Issue
Block a user