The Doctype I was deleted. The folder and table on mysql also i deleted. Then i create same doctype. I have a new problem, the doctype does not show up. I search on global search, does not show up.
Ohh I see. But when I put this code into my .js file,
frappe.ui.form.on("Employee Receipt", {
validate: function(frm) {
frm.set_value("balance_need_to_pay", (frm.doc.total_need_to_pay - frm.doc.payment));
frm.refresh_field("balance_need_to_pay");
if (frm.doc.status == "Outstanding") {
if (frm.doc.total_need_to_pay <= frm.doc.payment) {
msgprint("total need to pay must more than payment");
}
}
if (frm.doc.date < get_today()) {
msgprint("You can not select past date in From Date");
validate = false;
}
}
}