diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 7af98ddf934..bb85fedab05 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -1450,7 +1450,7 @@ class SalesInvoice(SellingController): 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( @@ -1462,7 +1462,9 @@ class SalesInvoice(SellingController): 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, )