From 2c892c7e7f993e1a1a6398f4025fce74288dcdc3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Apr 2017 12:05:35 +0530 Subject: [PATCH 1/4] Indentation fixed in gross profit report --- erpnext/accounts/report/gross_profit/gross_profit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 7dffd0a83e..a79f98d895 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -225,10 +225,10 @@ class GrossProfitGenerator(object): average_buying_rate = get_incoming_rate(row) if not average_buying_rate: average_buying_rate = get_valuation_rate(item_code, row.warehouse, - row.parenttype, row.parent, allow_zero_rate=True, - currency=self.filters.currency) + row.parenttype, row.parent, allow_zero_rate=True, + currency=self.filters.currency) - self.average_buying_rate[item_code] = average_buying_rate + self.average_buying_rate[item_code] = average_buying_rate return self.average_buying_rate[item_code] From 731efe3a958494126f21ed5a97e9a68052d7dce9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Apr 2017 12:11:36 +0530 Subject: [PATCH 2/4] Minor fix in gross profit report --- erpnext/accounts/report/gross_profit/gross_profit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index a79f98d895..4b28f1f35d 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -218,7 +218,8 @@ class GrossProfitGenerator(object): def get_average_buying_rate(self, row, item_code): if not item_code in self.average_buying_rate: if item_code in self.non_stock_items: - self.average_buying_rate[item_code] = flt(frappe.db.sql("""select sum(base_net_amount) / sum(qty * conversion_factor) + self.average_buying_rate[item_code] = flt(frappe.db.sql(""" + select sum(base_net_amount) / sum(qty * conversion_factor) from `tabPurchase Invoice Item` where item_code = %s and docstatus=1""", item_code)[0][0]) else: @@ -228,7 +229,7 @@ class GrossProfitGenerator(object): row.parenttype, row.parent, allow_zero_rate=True, currency=self.filters.currency) - self.average_buying_rate[item_code] = average_buying_rate + self.average_buying_rate[item_code] = flt(average_buying_rate) return self.average_buying_rate[item_code] From c469f2c954acdae358250cb3eb93ae7be45576e3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Apr 2017 13:01:11 +0530 Subject: [PATCH 3/4] Get POS profile fix --- erpnext/stock/get_item_details.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 958da16bac..9b4559e684 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -327,11 +327,10 @@ def get_pos_profile_item_details(company, args, pos_profile=None): @frappe.whitelist() def get_pos_profile(company): - condition = "and company = '%s'"%(company) if company else '' pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where user = %s - {cond}""".format(cond=condition), (frappe.session['user']), as_dict=1) + and company = %s""", (frappe.session['user'], company), as_dict=1) - if not pos_profile and company: + if not pos_profile: pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where ifnull(user,'') = '' and company = %s""", company, as_dict=1) From 17ddd8f3891690867fcc310646fbfc5926440469 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Apr 2017 13:48:13 +0600 Subject: [PATCH 4/4] bumped to version 8.0.6 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index dc2a0fa278..5b6f359981 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.5' +__version__ = '8.0.6' def get_default_company(user=None): '''Get default company for user'''