From b37f4a157c451c571792286dcff2490e0981458a Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Wed, 17 Jul 2019 14:53:25 +0530 Subject: [PATCH 1/3] fix precision --- erpnext/controllers/taxes_and_totals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index e018dd23961..a1972aa16de 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -329,7 +329,7 @@ class calculate_taxes_and_totals(object): self.doc.round_floats_in(self.doc, ["taxes_and_charges_added", "taxes_and_charges_deducted"]) - self.doc.base_grand_total = flt(self.doc.grand_total * self.doc.conversion_rate) \ + self.doc.base_grand_total = flt(self.doc.grand_total * self.doc.conversion_rate, self.doc.precision("base_grand_total")) \ if (self.doc.taxes_and_charges_added or self.doc.taxes_and_charges_deducted) \ else self.doc.base_net_total From fddef7bd5c084a12fe7ea7cf6d40423ae3109023 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 17 Jul 2019 20:34:50 +0530 Subject: [PATCH 2/3] fix: offline pos syncing issue for customer --- erpnext/accounts/doctype/sales_invoice/pos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 3e013f5d6b3..e2f99d6ea3f 100755 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -451,6 +451,10 @@ def make_customer_and_address(customers): def add_customer(data): + customer = data.get('full_name') or data.get('customer') + if frappe.db.exists("Customer", customer.strip()): + return customer.strip() + customer_doc = frappe.new_doc('Customer') customer_doc.customer_name = data.get('full_name') or data.get('customer') customer_doc.customer_pos_id = data.get('customer_pos_id') From 7a1a0fb5fb74ec4aa13fcf24b3f1d613d11221f3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 17 Jul 2019 21:20:05 +0530 Subject: [PATCH 3/3] fix: cost center not able to access --- erpnext/accounts/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index e8acd1e9ad5..a719b1ad5f7 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -721,7 +721,6 @@ def get_children(doctype, parent, company, is_root=False): parent_fieldname = 'parent_' + doctype.lower().replace(' ', '_') fields = [ 'name as value', - 'root_type', 'is_group as expandable' ] filters = [['docstatus', '<', 2]] @@ -729,11 +728,11 @@ def get_children(doctype, parent, company, is_root=False): filters.append(['ifnull(`{0}`,"")'.format(parent_fieldname), '=', '' if is_root else parent]) if is_root: - fields += ['report_type', 'account_currency'] if doctype == 'Account' else [] + fields += ['root_type', 'report_type', 'account_currency'] if doctype == 'Account' else [] filters.append(['company', '=', company]) else: - fields += ['account_currency'] if doctype == 'Account' else [] + fields += ['root_type', 'account_currency'] if doctype == 'Account' else [] fields += [parent_fieldname + ' as parent'] acc = frappe.get_list(doctype, fields=fields, filters=filters)