diff --git a/recommendations/Costs.py b/recommendations/Costs.py index e1b16899..69ff6073 100644 --- a/recommendations/Costs.py +++ b/recommendations/Costs.py @@ -298,51 +298,25 @@ class Costs: :return: A dictionary containing detailed cost breakdown. """ - labour_hours = material["labour_hours_per_unit"] * floor_area - # Assume a team of 1 person - labour_days = labour_hours / 8 - if material["is_installer_quote"]: total_cost = material["total_cost"] * floor_area return { "total": total_cost, - "labour_hours": labour_hours, - "labour_days": labour_days, + "labour_hours": 8, + "labour_days": 1, } - material_cost_per_m2 = material["material_cost"] - - # We inflate material costs due to recent price increases - material_cost_per_m2 = material_cost_per_m2 * 1.5 - - base_material_cost = material_cost_per_m2 * floor_area - labour_cost = material["labour_cost"] * floor_area * self.labour_adjustment_factor - - subtotal_before_profit = base_material_cost + labour_cost - - # We use high risk contingency because of the possibility of access issues and clearing existing insulation - contingency_cost = subtotal_before_profit * self.HIGH_RISK_CONTINGENCY - preliminaries_cost = subtotal_before_profit * self.PRELIMINARIES - profit_cost = subtotal_before_profit * self.PROFIT_MARGIN - - subtotal_before_vat = subtotal_before_profit + contingency_cost + preliminaries_cost + profit_cost - - vat_cost = subtotal_before_vat * self.VAT_RATE - - total_cost = subtotal_before_vat + vat_cost + total_including_vat = material["total_cost"] * floor_area + total_excluding_vat = total_including_vat / (1 + self.VAT_RATE) + vat_cost = total_including_vat - total_excluding_vat return { - "total": total_cost, - "subtotal": subtotal_before_vat, + "total": total_including_vat, + "subtotal": total_excluding_vat, "vat": vat_cost, - "contingency": contingency_cost, - "preliminaries": preliminaries_cost, - "material": base_material_cost, - "profit": profit_cost, - "labour_hours": labour_hours, - "labour_cost": labour_cost, - "labour_days": labour_days + "labour_hours": 8, + "labour_days": 1 } def solid_wall_insulation(self, wall_area, material): diff --git a/recommendations/RoofRecommendations.py b/recommendations/RoofRecommendations.py index 6635dd51..8c7e2291 100644 --- a/recommendations/RoofRecommendations.py +++ b/recommendations/RoofRecommendations.py @@ -44,10 +44,11 @@ class RoofRecommendations: self.recommendations = [] self.loft_insulation_materials = [ - part for part in materials if part["type"] == "loft_insulation" + part for part in materials if (part["type"] == "loft_insulation") and (part["is_installer_quote"]) ] self.loft_non_insulation_materials = [] + # We don't have proper installer quotes for flat roof insulation self.flat_roof_insulation_materials = [ part for part in materials if part["type"] == "flat_roof_insulation" ] @@ -266,7 +267,6 @@ class RoofRecommendations: lowest_selected_u_value = None recommendations = [] for _, insulation_material_group in insulation_materials.groupby("description"): - for _, material in insulation_material_group.iterrows(): # We make sure we hit a depth of 270mm. We should factor in any existing insulation if the