Merge branch 'version-12-hotfix' into iss_ful_fix_v12

This commit is contained in:
Himanshu 2019-07-26 06:58:59 +00:00 committed by GitHub
commit b4ecd29015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View File

@ -123,7 +123,9 @@ class Account(NestedSet):
doc.flags.ignore_root_company_validation = True doc.flags.ignore_root_company_validation = True
doc.update({ doc.update({
"company": company, "company": company,
"account_currency": None, # parent account's currency should be passed down to child account's curreny
# if it is None, it picks it up from default company currency, which might be unintended
"account_currency": self.account_currency,
"parent_account": parent_acc_name_map[company] "parent_account": parent_acc_name_map[company]
}) })
doc.save() doc.save()

View File

@ -58,8 +58,7 @@ def get_columns():
{ {
"fieldname": "payment_document", "fieldname": "payment_document",
"label": _("Payment Document Type"), "label": _("Payment Document Type"),
"fieldtype": "Link", "fieldtype": "Data",
"options": "DocType",
"width": 220 "width": 220
}, },
{ {

View File

@ -161,8 +161,9 @@ class Gstr1Report(object):
"gst_category": ["in", ["Registered Regular", "Deemed Export", "SEZ"]] "gst_category": ["in", ["Registered Regular", "Deemed Export", "SEZ"]]
}) })
conditions += """ and ifnull(gst_category, '') != 'Overseas' and is_return != 1 if customers:
and customer in ({0})""".format(", ".join([frappe.db.escape(c.name) for c in customers])) conditions += """ and ifnull(gst_category, '') != 'Overseas' and is_return != 1
and customer in ({0})""".format(", ".join([frappe.db.escape(c.name) for c in customers]))
if self.filters.get("type_of_business") in ("B2C Large", "B2C Small"): if self.filters.get("type_of_business") in ("B2C Large", "B2C Small"):
b2c_limit = frappe.db.get_single_value('GST Settings', 'b2c_limit') b2c_limit = frappe.db.get_single_value('GST Settings', 'b2c_limit')
@ -174,11 +175,11 @@ class Gstr1Report(object):
"gst_category": ["in", ["Unregistered"]] "gst_category": ["in", ["Unregistered"]]
}) })
if self.filters.get("type_of_business") == "B2C Large": if self.filters.get("type_of_business") == "B2C Large" and customers:
conditions += """ and SUBSTR(place_of_supply, 1, 2) != SUBSTR(company_gstin, 1, 2) conditions += """ and SUBSTR(place_of_supply, 1, 2) != SUBSTR(company_gstin, 1, 2)
and grand_total > {0} and is_return != 1 and customer in ({1})""".\ and grand_total > {0} and is_return != 1 and customer in ({1})""".\
format(flt(b2c_limit), ", ".join([frappe.db.escape(c.name) for c in customers])) format(flt(b2c_limit), ", ".join([frappe.db.escape(c.name) for c in customers]))
elif self.filters.get("type_of_business") == "B2C Small": elif self.filters.get("type_of_business") == "B2C Small" and customers:
conditions += """ and ( conditions += """ and (
SUBSTR(place_of_supply, 1, 2) = SUBSTR(company_gstin, 1, 2) SUBSTR(place_of_supply, 1, 2) = SUBSTR(company_gstin, 1, 2)
or grand_total <= {0}) and is_return != 1 and customer in ({1})""".\ or grand_total <= {0}) and is_return != 1 and customer in ({1})""".\