This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur_frm.cscript.custom_refresh = function(doc) | |
{ | |
//alert(doc.__islocal ? 0 : 1); | |
cur_frm.toggle_display("next_id", doc.__islocal ? 1 : 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur_frm.cscript.next_id = function(doc) | |
{ | |
doc.item_code = ""; | |
var pattern = ""; | |
pattern = doc.item_group.substring(0,4)+'%'; | |
var query = "SELECT `tabItem`.name FROM `tabItem` WHERE `tabItem`.name LIKE '" + pattern + "' ORDER BY name desc limit 1"; | |
wn.call({ | |
method: "webnotes.widgets.query_builder.runquery", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur_frm.cscript.next_id = function(doc) | |
{ | |
doc.item_code = ""; | |
switch(doc.item_group) | |
{ | |
case "100-XXXXXX - RESISTOR": | |
doc.item_code = "100-"; | |
break; | |
case "110-XXXXXX - CAPACITOR": |