From 500ddc94c76d1289294b1890e65e5ea4134c07f2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 18 Oct 2018 16:48:28 +0530 Subject: [PATCH 1/2] fix(gle): GL Entry for invoices before introduction of rounding_adjustment (#15732) --- .../accounts/doctype/purchase_invoice/purchase_invoice.py | 5 ++++- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 5d11797a5c..dcfd8bb7ea 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -363,7 +363,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 27d35eb74f..a6cd352b14 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -641,7 +641,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, From 24fe7286fcbab4f930df3bae76a0030c7bc8a249 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Fri, 19 Oct 2018 12:48:16 +0000 Subject: [PATCH 2/2] bumped to version 10.1.61 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index bae7915e31..d44bf40a9f 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'''