Skip to content

Commit

Permalink
feat: monthly fixed expenses in Daily P and L
Browse files Browse the repository at this point in the history
  • Loading branch information
jabir-tridz committed Mar 22, 2024
1 parent 8ebf0bb commit bed8bfd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ury_pulse/ury_pulse/doctype/ury_daily_p_and_l/ury_daily_p_and_l.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"indirect_expense_section",
"electricity_charges",
"indirect_fixed_expenses",
"monthly_fixed_expenses",
"percentage_expenses",
"employee_costs_section",
"employee_costs",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit bed8bfd

Please sign in to comment.