[price list] Separated Default Price List for Selling and Buying and changed fieldnames

This commit is contained in:
Rushabh Mehta
2013-08-09 18:11:35 +05:30
parent 0b9954059c
commit 4a404e9299
36 changed files with 234 additions and 201 deletions

View File

@@ -119,9 +119,9 @@ class DocType:
elif self.doc.rm_cost_as_per == 'Last Purchase Rate':
rate = arg['last_purchase_rate']
elif self.doc.rm_cost_as_per == "Price List":
if not self.doc.price_list:
if not self.doc.buying_price_list:
webnotes.throw(_("Please select Price List"))
rate = webnotes.conn.get_value("Item Price", {"price_list_name": self.doc.price_list,
rate = webnotes.conn.get_value("Item Price", {"price_list": self.doc.buying_price_list,
"parent": arg["item_code"]}, "ref_rate") or 0
elif self.doc.rm_cost_as_per == 'Standard Rate':
rate = arg['standard_rate']
@@ -255,7 +255,7 @@ class DocType:
(bom_no, item), as_dict =1)
if not bom:
msgprint("""Incorrect BOM No: %s against item: %s at row no: %s.
It may be inactive or cancelled or for some other item.""" %
It may be inactive or not submitted or does not belong to this item.""" %
(bom_no, item, idx), raise_exception = 1)
def check_if_item_repeated(self, item, op, check_list):

View File

@@ -105,7 +105,8 @@ class DocType:
def get_items(self):
so_list = filter(None, [d.sales_order for d in getlist(self.doclist, 'pp_so_details')])
if not so_list:
msgprint("Please enter sales order in the above table", raise_exception=1)
msgprint("Please enter sales order in the above table")
return []
items = sql("""select distinct parent, item_code, reserved_warehouse,
(qty - ifnull(delivered_qty, 0)) as pending_qty
@@ -294,8 +295,12 @@ class DocType:
webnotes.msgprint("Please enter Warehouse for which Material Request will be raised",
raise_exception=1)
bom_dict = self.get_distinct_items_and_boms()[0]
bom_dict = self.get_distinct_items_and_boms()[0]
self.get_raw_materials(bom_dict)
if not self.item_dict:
return
item_projected_qty = self.get_projected_qty()
from accounts.utils import get_fiscal_year
@@ -315,7 +320,6 @@ class DocType:
def get_projected_qty(self):
items = self.item_dict.keys()
item_projected_qty = webnotes.conn.sql("""select item_code, sum(projected_qty)
from `tabBin` where item_code in (%s) group by item_code""" %
(", ".join(["%s"]*len(items)),), tuple(items))