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