Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
38502b9
fix: include expense claim line projects in project total expense claim
ervishnucs Jul 7, 2026
079a4fd
Merge pull request #4865 from aerele/fix-project-total-expense-claim-…
deepeshgarg007 Jul 9, 2026
a8814b9
fix: Korean translations
frappe-pr-bot Jul 9, 2026
158628e
fix: Persian translations
frappe-pr-bot Jul 9, 2026
034490f
fix: Polish translations
frappe-pr-bot Jul 9, 2026
7afed84
fix: Portuguese, Brazilian translations
frappe-pr-bot Jul 9, 2026
cbce728
fix: Swedish translations
frappe-pr-bot Jul 9, 2026
5cd657d
fix: Vietnamese translations
frappe-pr-bot Jul 9, 2026
dbb58fa
fix: Croatian translations
frappe-pr-bot Jul 9, 2026
ee9d9b0
fix: Uzbek translations
frappe-pr-bot Jul 9, 2026
7794489
fix: Esperanto translations
frappe-pr-bot Jul 9, 2026
f9a7a67
fix: Bosnian translations
frappe-pr-bot Jul 9, 2026
7e6ada7
fix: French translations
frappe-pr-bot Jul 9, 2026
003d477
fix: Spanish translations
frappe-pr-bot Jul 9, 2026
a642012
fix: Arabic translations
frappe-pr-bot Jul 9, 2026
b2deff0
fix: Bulgarian translations
frappe-pr-bot Jul 9, 2026
1d76bbe
fix: Czech translations
frappe-pr-bot Jul 9, 2026
333930a
fix: Danish translations
frappe-pr-bot Jul 9, 2026
bcdfe78
fix: German translations
frappe-pr-bot Jul 9, 2026
a622223
fix: Hungarian translations
frappe-pr-bot Jul 9, 2026
a290081
fix: Italian translations
frappe-pr-bot Jul 9, 2026
3e73d3d
fix: Dutch translations
frappe-pr-bot Jul 9, 2026
555ee15
fix: Portuguese translations
frappe-pr-bot Jul 9, 2026
6f6e5db
fix: Russian translations
frappe-pr-bot Jul 9, 2026
8a42e7c
fix: Slovenian translations
frappe-pr-bot Jul 9, 2026
b569320
fix: Serbian (Cyrillic) translations
frappe-pr-bot Jul 9, 2026
a623f71
fix: Turkish translations
frappe-pr-bot Jul 9, 2026
3f44ed9
fix: Chinese Simplified translations
frappe-pr-bot Jul 9, 2026
b31a242
fix: Indonesian translations
frappe-pr-bot Jul 9, 2026
0502737
fix: Thai translations
frappe-pr-bot Jul 9, 2026
a98dda7
fix: Hindi translations
frappe-pr-bot Jul 9, 2026
fc3068d
fix: Burmese translations
frappe-pr-bot Jul 9, 2026
b3ea9d7
fix: Norwegian Bokmal translations
frappe-pr-bot Jul 9, 2026
b8e6213
fix: Serbian (Latin) translations
frappe-pr-bot Jul 9, 2026
8d73132
Merge pull request #4878 from frappe/l10n_develop
deepeshgarg007 Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions hrms/hr/doctype/expense_claim/expense_claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,16 @@ def update_task_and_project(self):
).run()[0][0]

task.save()
elif self.project:
frappe.get_doc("Project", self.project).update_project()

for project in self.get_linked_projects():
frappe.get_doc("Project", project).update_project()

def get_linked_projects(self):
projects = set()
if self.project:
projects.add(self.project)
projects.update(expense.project for expense in self.expenses if expense.project)
return projects

def make_gl_entries(self, cancel=False):
if flt(self.total_sanctioned_amount) > 0:
Expand Down
50 changes: 50 additions & 0 deletions hrms/hr/doctype/expense_claim/test_expense_claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,56 @@ def test_total_expense_claim_for_project(self):
self.assertEqual(frappe.db.get_value("Task", task, "total_expense_claim"), 200)
self.assertEqual(frappe.db.get_value("Project", project, "total_expense_claim"), 200)

def test_total_expense_claim_for_project_set_on_expense_line(self):
project = create_project("_Test Project Line 1", company="_Test Company")

payable_account = get_payable_account(company_name)

expense_claim = make_expense_claim(
payable_account, 300, 200, company_name, "Travel Expenses - _TC3", do_not_submit=True
)
expense_claim.expenses[0].project = project
expense_claim.submit()

self.assertEqual(frappe.db.get_value("Project", project, "total_expense_claim"), 200)

expense_claim.cancel()

self.assertEqual(frappe.db.get_value("Project", project, "total_expense_claim"), 0)

def test_total_expense_claim_for_project_at_document_and_line_level(self):
document_project = create_project("_Test Project Doc Level", company="_Test Company")
line_project = create_project("_Test Project Line 2", company="_Test Company")

payable_account = get_payable_account(company_name)
cost_center = frappe.db.get_value("Company", company_name, "cost_center")

expense_claim = make_expense_claim(
payable_account,
300,
200,
company_name,
"Travel Expenses - _TC3",
project=document_project,
do_not_submit=True,
)
expense_claim.append(
"expenses",
{
"expense_type": "Travel",
"default_account": "Travel Expenses - _TC3",
"currency": expense_claim.currency,
"amount": 500,
"sanctioned_amount": 500,
"cost_center": cost_center,
"project": line_project,
},
)
expense_claim.submit()

self.assertEqual(frappe.db.get_value("Project", document_project, "total_expense_claim"), 200)
self.assertEqual(frappe.db.get_value("Project", line_project, "total_expense_claim"), 500)

def test_expense_claim_status_as_payment_from_journal_entry(self):
# Via Journal Entry
payable_account = get_payable_account(company_name)
Expand Down
Loading
Loading