Skip to content

Commit

Permalink
refactor: checkbox to toggle parent doc cost center preference
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Apr 28, 2023
1 parent 0f3b06c commit 4ccce93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ def make_gle_for_rounding_adjustment(self, gl_entries):
and not self.is_internal_transfer()
):
round_off_account, round_off_cost_center = get_round_off_account_and_cost_center(
self.company, "Sales Invoice", self.name
self.company, "Sales Invoice", self.name, self.use_company_roundoff_cost_center
)

gl_entries.append(
Expand All @@ -1476,7 +1476,9 @@ def make_gle_for_rounding_adjustment(self, gl_entries):
self.rounding_adjustment, self.precision("rounding_adjustment")
),
"credit": flt(self.base_rounding_adjustment, self.precision("base_rounding_adjustment")),
"cost_center": self.cost_center or round_off_cost_center,
"cost_center": round_off_cost_center
if self.use_company_roundoff_cost_center
else (self.cost_center or round_off_cost_center),
},
item=self,
)
Expand Down

0 comments on commit 4ccce93

Please sign in to comment.