feat: 总部驾驶舱增加理论/实际净利润、净利率、食材成本率指标
This commit is contained in:
@@ -26,10 +26,18 @@ router.get('/overview', async (req: AuthRequest, res) => {
|
||||
round(sum(card_fee_expense)::numeric, 2) AS total_card_fee,
|
||||
round(sum(repair_clean_expense)::numeric, 2) AS total_repair,
|
||||
round(sum(actual_food_cost)::numeric, 2) AS total_food_cost,
|
||||
round(sum(theoretical_cost)::numeric, 2) AS total_theoretical_cost,
|
||||
round(sum(actual_store_contribution)::numeric, 2) AS total_contribution,
|
||||
round(sum(theoretical_store_contribution)::numeric, 2) AS total_theoretical_contribution,
|
||||
round(sum(received) - sum(theoretical_cost) - sum(operating_expense), 2) AS theoretical_net_profit,
|
||||
round(sum(received) - sum(actual_food_cost) - sum(operating_expense), 2) AS actual_net_profit,
|
||||
round(sum(area_sqm)::numeric, 2) AS total_area,
|
||||
round((1 - sum(operating_expense) / nullif(sum(received), 0)) * 100, 2) AS overall_expense_rate_pct,
|
||||
round((1 - (sum(actual_food_cost) + sum(operating_expense)) / nullif(sum(received), 0)) * 100, 2) AS overall_contribution_rate_pct,
|
||||
round((sum(received) - sum(theoretical_cost) - sum(operating_expense)) / nullif(sum(received), 0) * 100, 2) AS theoretical_net_margin_pct,
|
||||
round((sum(received) - sum(actual_food_cost) - sum(operating_expense)) / nullif(sum(received), 0) * 100, 2) AS actual_net_margin_pct,
|
||||
round(sum(theoretical_cost) / nullif(sum(received), 0) * 100, 2) AS theoretical_food_cost_rate_pct,
|
||||
round(sum(actual_food_cost) / nullif(sum(received), 0) * 100, 2) AS actual_food_cost_rate_pct,
|
||||
round(sum(wage_expense) / nullif(sum(received), 0) * 100, 2) AS overall_wage_rate_pct,
|
||||
round(sum(rent_expense) / nullif(sum(received), 0) * 100, 2) AS overall_rent_rate_pct,
|
||||
round(sum(utility_expense) / nullif(sum(received), 0) * 100, 2) AS overall_utility_rate_pct
|
||||
|
||||
Reference in New Issue
Block a user