Merge branch 'master' of github.com:webnotes/erpnext into customer-login

This commit is contained in:
Anand Doshi
2013-09-02 11:13:32 +05:30
26 changed files with 196 additions and 195 deletions

View File

@@ -549,9 +549,7 @@ class DocType(SellingController):
self.values = []
items = get_obj('Sales Common').get_item_list(self)
for d in items:
stock_item = webnotes.conn.sql("SELECT is_stock_item, is_sample_item \
FROM tabItem where name = '%s'"%(d['item_code']), as_dict = 1)
if stock_item[0]['is_stock_item'] == "Yes":
if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
if not d['warehouse']:
msgprint("Message: Please enter Warehouse for item %s as it is stock item." \
% d['item_code'], raise_exception=1)

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:05",
"docstatus": 0,
"modified": "2013-08-09 14:45:42",
"modified": "2013-08-31 10:19:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -179,7 +179,6 @@
"search_index": 1
},
{
"default": "Today",
"description": "Enter the date by which payments from customer is expected against this invoice.",
"doctype": "DocField",
"fieldname": "due_date",

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
from stock.utils import get_buying_amount
from stock.utils import get_buying_amount, get_sales_bom_buying_amount
def execute(filters=None):
if not filters: filters = {}
@@ -21,10 +21,15 @@ def execute(filters=None):
data = []
for row in source:
selling_amount = flt(row.amount)
buying_amount = get_buying_amount(row.item_code, row.parenttype, row.name, row.item_row,
stock_ledger_entries.get((row.item_code, row.warehouse), []),
item_sales_bom.get(row.parenttype, {}).get(row.name, webnotes._dict()))
item_sales_bom_map = item_sales_bom.get(row.parenttype, {}).get(row.name, webnotes._dict())
if item_sales_bom_map.get(row.item_code):
buying_amount = get_sales_bom_buying_amount(row.item_code, row.warehouse,
row.parenttype, row.name, row.item_row, stock_ledger_entries, item_sales_bom_map)
else:
buying_amount = get_buying_amount(row.parenttype, row.name, row.item_row,
stock_ledger_entries.get((row.item_code, row.warehouse), []))
buying_amount = buying_amount > 0 and buying_amount or 0