Merge branch 'develop'
This commit is contained in:
commit
9bfa0ab7eb
@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = '8.0.5'
|
__version__ = '8.0.6'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -218,17 +218,18 @@ class GrossProfitGenerator(object):
|
|||||||
def get_average_buying_rate(self, row, item_code):
|
def get_average_buying_rate(self, row, item_code):
|
||||||
if not item_code in self.average_buying_rate:
|
if not item_code in self.average_buying_rate:
|
||||||
if item_code in self.non_stock_items:
|
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`
|
from `tabPurchase Invoice Item`
|
||||||
where item_code = %s and docstatus=1""", item_code)[0][0])
|
where item_code = %s and docstatus=1""", item_code)[0][0])
|
||||||
else:
|
else:
|
||||||
average_buying_rate = get_incoming_rate(row)
|
average_buying_rate = get_incoming_rate(row)
|
||||||
if not average_buying_rate:
|
if not average_buying_rate:
|
||||||
average_buying_rate = get_valuation_rate(item_code, row.warehouse,
|
average_buying_rate = get_valuation_rate(item_code, row.warehouse,
|
||||||
row.parenttype, row.parent, allow_zero_rate=True,
|
row.parenttype, row.parent, allow_zero_rate=True,
|
||||||
currency=self.filters.currency)
|
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]
|
return self.average_buying_rate[item_code]
|
||||||
|
|
||||||
|
@ -327,11 +327,10 @@ def get_pos_profile_item_details(company, args, pos_profile=None):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_pos_profile(company):
|
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
|
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`
|
pos_profile = frappe.db.sql("""select * from `tabPOS Profile`
|
||||||
where ifnull(user,'') = '' and company = %s""", company, as_dict=1)
|
where ifnull(user,'') = '' and company = %s""", company, as_dict=1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user