[item price] item price made as an individual master and removed from price list

This commit is contained in:
Akhilesh Darjee
2013-10-18 14:24:21 +05:30
parent 04638a5f77
commit fcd70d04f3
22 changed files with 312 additions and 364 deletions

View File

@@ -6,6 +6,7 @@ cur_frm.cscript.refresh = function(doc) {
// read only if any stock ledger entry exists
cur_frm.cscript.make_dashboard()
cur_frm.cscript.edit_prices_button();
cur_frm.toggle_display("naming_series", sys_defaults.item_naming_by=="Naming Series"
&& doc.__islocal)
@@ -28,6 +29,15 @@ cur_frm.cscript.make_dashboard = function() {
return;
}
cur_frm.cscript.edit_prices_button = function() {
cur_frm.add_custom_button("Edit Prices", function() {
wn.route_options = {
"item_code": cur_frm.doc.name
};
wn.set_route("Report", "Item Price");
}, "icon-money");
}
cur_frm.cscript.item_code = function(doc) {
if(!doc.item_name) cur_frm.set_value("item_name", doc.item_code);
if(!doc.description) cur_frm.set_value("description", doc.item_code);

View File

@@ -57,10 +57,9 @@ def get_price_list():
rate = {}
price_list = webnotes.conn.sql("""select ip.item_code, pl.buying_or_selling,
concat(pl.name, " - ", pl.currency, " ", ip.ref_rate) as price
from `tabItem Price` ip, `tabPrice List` pl where
ip.parent = pl.name and pl.docstatus<2""", as_dict=1)
price_list = webnotes.conn.sql("""select item_code, buying_or_selling,
concat(price_list, " - ", currency, " ", ref_rate) as price
from `tabItem Price`""", as_dict=1)
for j in price_list:
if j.price: