diff --git a/erpnext/__init__.py b/erpnext/__init__.py index e61c0d13f6..699dcf3996 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.60' +__version__ = '10.1.61' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index f5983c326f..b14597d3a0 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -379,7 +379,10 @@ class PurchaseInvoice(BuyingController): return gl_entries def make_supplier_gl_entry(self, gl_entries): - grand_total = self.rounded_total or self.grand_total + # Checked both rounding_adjustment and rounded_total + # because rounded_total had value even before introcution of posting GLE based on rounded total + grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total + if grand_total: # Didnot use base_grand_total to book rounding loss gle grand_total_in_company_currency = flt(grand_total * self.conversion_rate, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 7f755dd92b..607051e50a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -716,7 +716,9 @@ class SalesInvoice(SellingController): return gl_entries def make_customer_gl_entry(self, gl_entries): - grand_total = self.rounded_total or self.grand_total + # Checked both rounding_adjustment and rounded_total + # because rounded_total had value even before introcution of posting GLE based on rounded total + grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total if grand_total: # Didnot use base_grand_total to book rounding loss gle grand_total_in_company_currency = flt(grand_total * self.conversion_rate,