DROP VIEW IF EXISTS team_offers_historical_project_list_view;
CREATE VIEW team_offers_historical_project_list_view (
 historical_project_id,
 total_team_amount
) as
 SELECT
        historical_project_id,
        SUM(
            COALESCE(gross_amount,0 ) + COALESCE(reviser_gross_amount,0) + COALESCE(editor_gross_amount, 0) + COALESCE(project_manager_gross_amount, 0)
        ) AS total_team_amount
    FROM
        historical_project_offers
    GROUP BY
        historical_project_id;