Retention Bonus - menu, validate
This commit is contained in:
parent
7d394c14ce
commit
819c3b1bf6
@ -106,6 +106,10 @@ def get_data():
|
||||
"type": "doctype",
|
||||
"name": "Employee Incentive",
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Retention Bonus",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -2,6 +2,15 @@
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Retention Bonus', {
|
||||
setup: function(frm) {
|
||||
frm.set_query("employee", function() {
|
||||
return {
|
||||
filters: {
|
||||
"status": "Active"
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
|
@ -5,10 +5,12 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from frappe.utils import getdate
|
||||
|
||||
class RetentionBonus(Document):
|
||||
def on_submit(self):
|
||||
pass
|
||||
|
||||
def on_cancel(self):
|
||||
pass
|
||||
def validate(self):
|
||||
if frappe.get_value("Employee", self.employee, "status") == "Left":
|
||||
frappe.throw(_("Cannot create Retention Bonus for left Employees"))
|
||||
if getdate(self.bonus_payment_date) < getdate():
|
||||
frappe.throw(_("Bonus Payment Date cannot be a past date"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user