diff --git a/ury_pulse/ury_pulse/doctype/ury_daily_p_and_l/ury_daily_p_and_l.py b/ury_pulse/ury_pulse/doctype/ury_daily_p_and_l/ury_daily_p_and_l.py index d14f587..b88acaa 100644 --- a/ury_pulse/ury_pulse/doctype/ury_daily_p_and_l/ury_daily_p_and_l.py +++ b/ury_pulse/ury_pulse/doctype/ury_daily_p_and_l/ury_daily_p_and_l.py @@ -493,6 +493,16 @@ def before_submit(self): self.append("indirect_expenses_breakup", {"breakup": expense.expense, "amount": expense.amount,"percent":expense_percent}) self.total_indirect_expenses += expense.amount + # Append indirect monthly fixed expenses + for expense in report_settings.monthly_fixed_expenses: + expense_amount = round((expense.amount/days),2) + if self.net_sales != 0.0: + expense_percent = round(((expense_amount / self.net_sales) * 100),3) + else: + expense_percent = 0.0 + self.append("indirect_expenses_breakup", {"breakup": expense.expense, "amount": expense_amount,"percent":expense_percent}) + self.total_indirect_expenses += expense_amount + # Calculate and append percentage expenses for expense in report_settings.percentage_expenses: if expense.percentage_type in ["Gross Sales", "Net Sales"]: diff --git a/ury_pulse/ury_pulse/doctype/ury_report_settings/ury_report_settings.json b/ury_pulse/ury_pulse/doctype/ury_report_settings/ury_report_settings.json index 2440ed6..d7ffcce 100644 --- a/ury_pulse/ury_pulse/doctype/ury_report_settings/ury_report_settings.json +++ b/ury_pulse/ury_pulse/doctype/ury_report_settings/ury_report_settings.json @@ -18,6 +18,7 @@ "indirect_expense_section", "electricity_charges", "indirect_fixed_expenses", + "monthly_fixed_expenses", "percentage_expenses", "employee_costs_section", "employee_costs", @@ -131,11 +132,18 @@ "fieldtype": "Table", "label": "Employee Costs", "options": "URY Fixed Expenses" + }, + { + "description": "Monthly Fixed", + "fieldname": "monthly_fixed_expenses", + "fieldtype": "Table", + "label": "Monthly Fixed Expenses", + "options": "URY Fixed Expenses" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-01-09 15:20:17.567008", + "modified": "2024-03-22 15:34:04.572515", "modified_by": "Administrator", "module": "URY Pulse", "name": "URY Report Settings",