Skip to content

Instantly share code, notes, and snippets.

@rmehta
Created July 16, 2014 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmehta/62f3efdf97be541b7b6b to your computer and use it in GitHub Desktop.
Save rmehta/62f3efdf97be541b7b6b to your computer and use it in GitHub Desktop.
Allow fixed delivery dates: ERPNext Custom Script Example
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