diff --git a/backend/migrations/columns.py b/backend/migrations/columns.py
index a6946fc..e51a19b 100644
--- a/backend/migrations/columns.py
+++ b/backend/migrations/columns.py
@@ -67,7 +67,7 @@ def migrate_add_columns():
_add_column_if_missing(conn, "project_finances", col,
f"ALTER TABLE project_finances ADD COLUMN {col} DOUBLE NOT NULL DEFAULT 0")
- # project_finances 总视图字段:已回款 / 应付 / 已付
+ # project_finances 总视图字段:已回款 / 成本 / 已付
_add_column_if_missing(conn, "project_finances", "total_payment",
"ALTER TABLE project_finances ADD COLUMN total_payment DOUBLE NOT NULL DEFAULT 0")
_add_column_if_missing(conn, "project_finances", "total_cost",
diff --git a/static/modules/finance.js b/static/modules/finance.js
index 54a2d4c..351ed5b 100644
--- a/static/modules/finance.js
+++ b/static/modules/finance.js
@@ -188,7 +188,7 @@ function renderFinance() {
@@ -197,7 +197,7 @@ function renderFinance() {
- | 月份 | 费用类型 | 应付 | 已付 | 备注 | |
+ | 月份 | 费用类型 | 成本 | 已付 | 备注 | |
@@ -238,7 +238,7 @@ function renderFinance() {
{ label: '签约金额', value: ctx => moneyWan(ctx.signTotal), color: 'text-slate-700' },
{ label: '已确收', value: ctx => moneyWan(ctx.sumRev), color: 'text-blue-700' },
{ label: '毛利', value: ctx => money(ctx.sumGross), color: 'text-green-700' },
- { label: '应付', value: ctx => moneyWan(ctx.sumCost), color: 'text-rose-700' },
+ { label: '成本', value: ctx => moneyWan(ctx.sumCost), color: 'text-rose-700' },
{ label: '项目利润', value: ctx => { const v = ctx.sumGross; return { val: moneyWan(v), cls: v >= 0 ? 'text-green-600' : 'text-red-600' }; }, color: null },
{ label: '已回款', value: ctx => moneyWan(ctx.sumPay), color: 'text-amber-700' },
{ label: '已付', value: ctx => moneyWan(ctx.sumPaid), color: 'text-purple-700' },
@@ -261,7 +261,7 @@ function renderFinance() {
'
签约金额 | ' +
'
已确收 | ' +
'
毛利 | ' +
- '
应付 | ' +
+ '
成本 | ' +
'
项目利润 | ' +
'
已回款 | ' +
'
已付 | ' +
@@ -274,7 +274,7 @@ function renderFinance() {
const tbody = rows.length ? `
${rows.join("")}` : `
| ${emptyText} |
`;
return card(`
${cards.map(([l, v, c]) => '
' + l + '' + v + '
').join("")}
`, "p-4") +
- card(`
项目财务明细
合同 → 确收 → 毛利 → 应付 → 项目利润 → 回款 → 已付 → 现金流 → 执行率 → 毛利率 → 回款率 → 付款率
`, "p-4");
+ card(`
项目财务明细
合同 → 确收 → 毛利 → 成本 → 项目利润 → 回款 → 已付 → 现金流 → 执行率 → 毛利率 → 回款率 → 付款率
`, "p-4");
};
const fmtNoUnit = (v) => v ? `
${Number(v||0).toLocaleString('zh-CN')}` : '
—';
diff --git a/static/modules/home.js b/static/modules/home.js
index 3d74a26..09cf137 100644
--- a/static/modules/home.js
+++ b/static/modules/home.js
@@ -75,7 +75,7 @@ function renderHome() {
return '
' + sign + pct + '%';
};
const COLORS = ['text-slate-700','text-blue-600','text-green-600','text-rose-600','text-indigo-600','text-amber-600','text-purple-600','text-cyan-600'];
- const LABELS = ['合同金额','确收金额','确收毛利','应付金额','项目利润','回款金额','已付','现金流'];
+ const LABELS = ['合同金额','确收金额','确收毛利','成本','项目利润','回款金额','已付','现金流'];
const Q_FIELDS = [m.signed_q2||0, m.revenue_q2, m.gross_q2, m.cost_q2||0, m.profit_q2||0, m.payment_q2||0, m.paid_q2||0, m.cashflow_q2||0];
const Q_PREV = [m.signed_prev_q||0, m.revenue_prev_q||0, m.gross_prev_q||0, m.cost_prev_q||0, m.profit_prev_q||0, m.payment_prev_q||0, m.paid_prev_q||0, m.cashflow_prev_q||0];
const M_FIELDS = [m.signed_month||0, m.monthly_revenue, m.monthly_net_profit, m.cost_month||0, m.profit_month||0, m.payment_month||0, m.paid_month||0, m.cashflow_month||0];
@@ -145,7 +145,7 @@ function renderHome() {
return h;
})()}
`, "p-4")}
- ${card(`