Skip to content

Commit

Permalink
fix: use flag _skip_merge instead of skipping merge based on agains…
Browse files Browse the repository at this point in the history
…t account
  • Loading branch information
vorasmit committed Nov 9, 2024
1 parent fc67374 commit 330edf5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ def make_supplier_gl_entry(self, gl_entries):
self.add_supplier_gl_entry(gl_entries, base_grand_total, grand_total)

def add_supplier_gl_entry(
self, gl_entries, base_grand_total, grand_total, against_account=None, remarks=None
self, gl_entries, base_grand_total, grand_total, against_account=None, remarks=None, skip_merge=False
):
against_voucher = self.name
if self.is_return and self.return_against and not self.update_outstanding_for_self:
Expand All @@ -923,6 +923,7 @@ def add_supplier_gl_entry(
"against_voucher_type": self.doctype,
"project": self.project,
"cost_center": self.cost_center,
"_skip_merge": skip_merge,
}

if remarks:
Expand Down Expand Up @@ -1446,6 +1447,7 @@ def make_gl_entries_for_tax_withholding(self, gl_entries):
-tds_amount,
against_account=row.account_head,
remarks=_("TDS Deducted"),
skip_merge=True,
)

def make_payment_gl_entries(self, gl_entries):
Expand Down
5 changes: 4 additions & 1 deletion erpnext/accounts/general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ def merge_similar_entries(gl_map, precision=None):
merge_properties = get_merge_properties(accounting_dimensions)

for entry in gl_map:
if entry._skip_merge:
merged_gl_map.append(entry)
continue

entry.merge_key = get_merge_key(entry, merge_properties)
# if there is already an entry in this account then just add it
# to that entry
Expand Down Expand Up @@ -291,7 +295,6 @@ def get_merge_properties(dimensions=None):
"project",
"finance_book",
"voucher_no",
"against",
]
if dimensions:
merge_properties.extend(dimensions)
Expand Down
1 change: 0 additions & 1 deletion erpnext/accounts/report/general_ledger/general_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ def update_value_in_dict(data, key, gle):
gle.get("account"),
gle.get("party_type"),
gle.get("party"),
gle.get("against"),
]

if immutable_ledger:
Expand Down

0 comments on commit 330edf5

Please sign in to comment.