Debit and Credit not equal for Purchase Invoice - v11.x.x-develop (513cd18) (develop)

In the latest build while saving the Purchase invoice we are getting an error that Debit and Credit not equal for Purchase Invoice .

Stack Trace:

File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/init.py”, line 942, in call
return fn(*args, **newargs)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 841, in submit
self._submit()
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 830, in _submit
self.save()
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 311, in _save
self.run_post_save_methods()
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 901, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 765, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 1040, in composer
return composed(self, method, *args, **kwargs)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 1023, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/model/document.py”, line 759, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/erp_healthcare/frappe-bench/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py”, line 317, in on_submit
self.make_gl_entries()
File “/home/erp_healthcare/frappe-bench/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py”, line 332, in make_gl_entries
update_outstanding=update_outstanding, merge_entries=False)
File “/home/erp_healthcare/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 19, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File “/home/erp_healthcare/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 87, in save_entries
round_off_debit_credit(gl_map)
File “/home/erp_healthcare/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 135, in round_off_debit_credit
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/init.py”, line 327, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/init.py”, line 313, in msgprint
_raise_exception()
File “/home/erp_healthcare/frappe-bench/apps/frappe/frappe/init.py”, line 286, in _raise_exception
raise raise_exception(msg)
ValidationError: Debit and Credit not equal for Purchase Invoice

-Amit