Created
July 16, 2014 08:31
-
-
Save rmehta/62f3efdf97be541b7b6b to your computer and use it in GitHub Desktop.
Allow fixed delivery dates: ERPNext Custom Script Example
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_validate = function(doc) { | |
var date = doc.delivery_date.split("-")[2]; | |
if(["15", "30"].indexOf(date)===-1) { | |
msgprint("Delivery date must be on 15th or 30th of the month"); | |
throw "Wrong Delivery Date"; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment