fixes in offer letter
This commit is contained in:
parent
496e277d8a
commit
28b0cc4d0b
@ -5,3 +5,25 @@
|
||||
|
||||
// for communication
|
||||
cur_frm.email_field = "email_id";
|
||||
|
||||
frappe.ui.form.on("Job Applicant", {
|
||||
refresh: function(frm) {
|
||||
if (!frm.doc.__islocal) {
|
||||
if (frm.doc.__onload && frm.doc.__onload.offer_letter) {
|
||||
frm.add_custom_button(__("View Offer Letter"), function() {
|
||||
frappe.set_route("Form", "Offer Letter", frm.doc.__onload.offer_letter);
|
||||
});
|
||||
} else {
|
||||
frm.add_custom_button(__("Make Offer Letter"), function() {
|
||||
frappe.route_options = {
|
||||
"job_applicant": frm.doc.name,
|
||||
"applicant_name": frm.doc.applicant_name,
|
||||
"designation": frm.doc.job_opening,
|
||||
};
|
||||
new_doc("Offer Letter");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
@ -10,6 +10,11 @@ from frappe import _
|
||||
from frappe.utils import comma_and
|
||||
|
||||
class JobApplicant(Document):
|
||||
def onload(self):
|
||||
offer_letter = frappe.get_all("Offer Letter", filters={"job_applicant": self.name})
|
||||
if offer_letter:
|
||||
self.__onload.offer_letter = offer_letter[0].name
|
||||
|
||||
def autoname(self):
|
||||
keys = filter(None, (self.applicant_name, self.email_id))
|
||||
if not keys:
|
||||
|
@ -56,6 +56,14 @@
|
||||
"precision": "",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"fieldname": "offer_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Offer Date",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"fieldname": "designation",
|
||||
@ -95,8 +103,8 @@
|
||||
{
|
||||
"fieldname": "offer_terms",
|
||||
"fieldtype": "Table",
|
||||
"label": "Offer Terms",
|
||||
"options": "Offer Letter Terms",
|
||||
"label": "Offer Letter Terms",
|
||||
"options": "Offer Letter Term",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
@ -114,7 +122,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Select Terms",
|
||||
"label": "Select Terms and Conditions",
|
||||
"no_copy": 0,
|
||||
"options": "Terms and Conditions",
|
||||
"permlevel": 0,
|
||||
@ -129,7 +137,7 @@
|
||||
{
|
||||
"fieldname": "terms",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Terms",
|
||||
"label": "Terms and Conditions",
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
@ -152,7 +160,7 @@
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-03-10 11:41:24.870015",
|
||||
"modified": "2015-04-01 05:51:39.841591",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Offer Letter",
|
||||
|
@ -37,12 +37,12 @@
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"fieldname": "value",
|
||||
"fieldtype": "Data",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Value",
|
||||
"label": "Value / Description",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@ -61,10 +61,10 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-03-10 18:28:01.978680",
|
||||
"modified": "2015-04-01 03:46:49.530328",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Offer Letter Terms",
|
||||
"name": "Offer Letter Term",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
@ -5,5 +5,5 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class OfferLetterTerms(Document):
|
||||
class OfferLetterTerm(Document):
|
||||
pass
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"creation": "2015-03-05 14:34:26.751210",
|
||||
"custom_format": 0,
|
||||
"custom_format": 1,
|
||||
"disabled": 0,
|
||||
"doc_type": "Offer Letter",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"html": "{% if letter_head and not no_letterhead %}\n<div class=\"letter-head\">{{ letter_head }}</div><hr>\n{% endif %}\n<div class=\"page-break\">\n\nDear {{ doc.applicant_name }}, <br><br>\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n<br><br>\n\nYour designation shall be {{ doc.designation }}.\n\n<br>\n{%- for row in doc.offer_terms -%}\n{{ row.offer_term }}: {{ row.value }}\n<br>\n{%- endfor -%}\n<br>\n\nPlease read the detailed terms as below. If you have any queries, feel free to get in touch with us.\nWe look forward to your long and fruitful career association with our organisation.\nIf you decide to join us, 'Welcome to {{ doc.company }} !'\n\n<br>\n<br>\n<p class=\"strong\">\n\nYours truely,\n\n<br><br><br><br>\n\nAuthorized Signatory\n\n<br>{{ doc.company }}</p>\n</div>\n<div>\n\t{{doc.terms}}\n</div>",
|
||||
"modified": "2015-03-09 18:51:17.400960",
|
||||
"html": "{% if letter_head and not no_letterhead -%}\n <div class=\"letter-head\">{{ letter_head }}</div>\n <hr>\n{%- endif %}\n\n<div class=\"page-break\">\n<p>\n\n<!-- offer letter content starts here, <br> is used to create new lines -->\nDate: {{ doc.offer_date }}\n<br><br>\n\nDear {{ doc.applicant_name }}, \n\n<br><br>\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n<br><br>\n\nYour designation shall be <b>{{ doc.designation }}</b>.\n\n<br><br>\n\n<!-- offer letter terms and description from the table -->\n\n{%- if doc.offer_terms -%}\n {%- for row in doc.offer_terms -%}\n <b>{{ row.offer_term }}:</b> {{ row.value }}\n\n <br>\n {%- endfor -%}\n{%- endif -%}\n\n<br>\n\n<!-- offer letter content continues -->\n\n\nPlease read the detailed terms as below. If you have any queries, feel free to get in touch with us.\nWe look forward to your long and fruitful career association with our organisation.\nIf you decide to join us, 'Welcome to {{ doc.company }} !'\n\n<br><br>\n\n<p class=\"strong\">\n\nYours truly,\n\n<br><br><br><br>\n\nAuthorized Signatory\n\n<br>\n\n{{ doc.company }}\n\n<!-- offer letter content ends here -->\n\n</p>\n</div>\n\n<!-- offer letter terms and conditions -->\n<div> {{ doc.terms }} </div>",
|
||||
"modified": "2015-04-01 05:22:51.345050",
|
||||
"modified_by": "Administrator",
|
||||
"name": "Offer Letter",
|
||||
"owner": "Administrator",
|
||||
|
@ -153,7 +153,21 @@ def install(country=None):
|
||||
|
||||
{'doctype': "Email Account", "email_id": "sales@example.com", "append_to": "Opportunity"},
|
||||
{'doctype': "Email Account", "email_id": "support@example.com", "append_to": "Issue"},
|
||||
{'doctype': "Email Account", "email_id": "jobs@example.com", "append_to": "Job Applicant"}
|
||||
{'doctype': "Email Account", "email_id": "jobs@example.com", "append_to": "Job Applicant"},
|
||||
|
||||
{"doctype": "Offer Term", "offer_term": _("Date of Joining")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Annual Salary")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Probationary Period")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Employee Benefits")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Working Hours")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Stock Options")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Department")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Job Description")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Responsibilities")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Leaves per Year")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Notice Period")},
|
||||
{"doctype": "Offer Term", "offer_term": _("Incentives")},
|
||||
|
||||
]
|
||||
|
||||
from erpnext.setup.page.setup_wizard.fixtures import industry_type
|
||||
|
Loading…
x
Reference in New Issue
Block a user