Merge branch 'hotfix' into hotfix-customer-item-price-report
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -717,7 +717,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]]
|
||||
@@ -725,11 +724,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user