mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
[merge] merged with master
This commit is contained in:
@@ -83,9 +83,14 @@ wn.module_page["Selling"] = [
|
||||
},
|
||||
{
|
||||
label: wn._("Price List"),
|
||||
description: wn._("Mupltiple Item prices."),
|
||||
description: wn._("Multiple Price list."),
|
||||
doctype:"Price List"
|
||||
},
|
||||
{
|
||||
label: wn._("Item Price"),
|
||||
description: wn._("Multiple Item prices."),
|
||||
doctype:"Item Price"
|
||||
},
|
||||
{
|
||||
label: wn._("Sales BOM"),
|
||||
description: wn._("Bundle items at time of sale."),
|
||||
@@ -166,6 +171,11 @@ wn.module_page["Selling"] = [
|
||||
right: true,
|
||||
icon: "icon-list",
|
||||
items: [
|
||||
{
|
||||
"label":wn._("Lead Details"),
|
||||
route: "query-report/Lead Details",
|
||||
doctype: "Lead"
|
||||
},
|
||||
{
|
||||
"label":wn._("Customer Addresses And Contacts"),
|
||||
route: "query-report/Customer Addresses And Contacts",
|
||||
|
||||
0
selling/report/lead_details/__init__.py
Normal file
0
selling/report/lead_details/__init__.py
Normal file
22
selling/report/lead_details/lead_details.txt
Normal file
22
selling/report/lead_details/lead_details.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-10-22 11:58:16",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-10-22 12:08:18",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"is_standard": "Yes",
|
||||
"name": "__common__",
|
||||
"query": "SELECT\n `tabLead`.name as \"Lead Id:Link/Lead:120\",\n `tabLead`.lead_name as \"Lead Name::120\",\n\t`tabLead`.company_name as \"Company Name::120\",\n\t`tabLead`.status as \"Status::120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n\t`tabLead`.phone as \"Phone::100\",\n\t`tabLead`.mobile_no as \"Mobile No::100\",\n\t`tabLead`.email_id as \"Email Id::120\",\n\t`tabLead`.lead_owner as \"Lead Owner::120\",\n\t`tabLead`.source as \"Source::120\",\n\t`tabLead`.territory as \"Territory::120\"\nFROM\n\t`tabLead`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.lead=`tabLead`.name\n\t)\nWHERE\n\t`tabLead`.docstatus<2\nORDER BY\n\t`tabLead`.name asc",
|
||||
"ref_doctype": "Lead",
|
||||
"report_name": "Lead Details",
|
||||
"report_type": "Query Report"
|
||||
},
|
||||
{
|
||||
"doctype": "Report",
|
||||
"name": "Lead Details"
|
||||
}
|
||||
]
|
||||
@@ -153,7 +153,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
item_code: function(doc, cdt, cdn) {
|
||||
var me = this;
|
||||
var item = wn.model.get_doc(cdt, cdn);
|
||||
if(item.item_code || item.barcode) {
|
||||
if(item.item_code || item.barcode || item.serial_no) {
|
||||
if(!this.validate_company_and_party("customer")) {
|
||||
cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove();
|
||||
} else {
|
||||
@@ -164,6 +164,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
args: {
|
||||
item_code: item.item_code,
|
||||
barcode: item.barcode,
|
||||
serial_no: item.serial_no,
|
||||
warehouse: item.warehouse,
|
||||
doctype: me.frm.doc.doctype,
|
||||
parentfield: item.parentfield,
|
||||
|
||||
@@ -40,7 +40,9 @@ def get_item_details(args):
|
||||
args = webnotes._dict(args)
|
||||
|
||||
if args.barcode:
|
||||
args.item_code = _get_item_code(args.barcode)
|
||||
args.item_code = _get_item_code(barcode=args.barcode)
|
||||
elif not args.item_code and args.serial_no:
|
||||
args.item_code = _get_item_code(serial_no=args.serial_no)
|
||||
|
||||
item_bean = webnotes.bean("Item", args.item_code)
|
||||
|
||||
@@ -88,15 +90,17 @@ def _get_serial_nos_by_fifo(args, item_bean):
|
||||
"qty": cint(args.qty)
|
||||
}))
|
||||
|
||||
def _get_item_code(barcode):
|
||||
item_code = webnotes.conn.sql_list("""select name from `tabItem` where barcode=%s""", barcode)
|
||||
def _get_item_code(barcode=None, serial_no=None):
|
||||
if barcode:
|
||||
input_type = "Barcode"
|
||||
item_code = webnotes.conn.sql_list("""select name from `tabItem` where barcode=%s""", barcode)
|
||||
elif serial_no:
|
||||
input_type = "Serial No"
|
||||
item_code = webnotes.conn.sql_list("""select item_code from `tabSerial No`
|
||||
where name=%s""", serial_no)
|
||||
|
||||
if not item_code:
|
||||
msgprint(_("No Item found with Barcode") + ": %s" % barcode, raise_exception=True)
|
||||
|
||||
elif len(item_code) > 1:
|
||||
msgprint(_("Items") + " %s " % comma_and(item_code) +
|
||||
_("have the same Barcode") + " %s" % barcode, raise_exception=True)
|
||||
msgprint(_("No Item found with ") + input_type + ": %s" % (barcode or serial_no), raise_exception=True)
|
||||
|
||||
return item_code[0]
|
||||
|
||||
@@ -142,9 +146,8 @@ def _get_basic_details(args, item_bean, warehouse_fieldname):
|
||||
return out
|
||||
|
||||
def _get_price_list_rate(args, item_bean, meta):
|
||||
ref_rate = webnotes.conn.sql("""select ip.ref_rate from `tabItem Price` ip,
|
||||
`tabPrice List` pl where ip.parent = pl.name and ip.parent=%s and
|
||||
ip.item_code=%s and pl.buying_or_selling='Selling'""",
|
||||
ref_rate = webnotes.conn.sql("""select ref_rate from `tabItem Price`
|
||||
where price_list=%s and item_code=%s and buying_or_selling='Selling'""",
|
||||
(args.selling_price_list, args.item_code), as_dict=1)
|
||||
|
||||
if not ref_rate:
|
||||
|
||||
@@ -27,9 +27,8 @@ def get_product_info(item_code):
|
||||
else:
|
||||
in_stock = -1
|
||||
|
||||
price = price_list and webnotes.conn.sql("""select ip.ref_rate, pl.currency from
|
||||
`tabItem Price` ip, `tabPrice List` pl where ip.parent = pl.name and
|
||||
ip.item_code=%s and ip.parent=%s""",
|
||||
price = price_list and webnotes.conn.sql("""select ref_rate, currency from
|
||||
`tabItem Price` where item_code=%s and price_list=%s""",
|
||||
(item_code, price_list), as_dict=1) or []
|
||||
|
||||
price = price and price[0] or None
|
||||
|
||||
Reference in New Issue
Block a user