From e1d620b1685dab17fc2851c3a6bf0e3dcb352eba Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 4 Mar 2015 16:01:45 +0530 Subject: [PATCH 1/5] Offer Letter - New Doctype added and job_applicant naming changed --- erpnext/config/hr.py | 5 + .../doctype/job_applicant/job_applicant.json | 11 +- erpnext/hr/doctype/offer_letter/__init__.py | 0 .../hr/doctype/offer_letter/offer_letter.js | 14 ++ .../hr/doctype/offer_letter/offer_letter.json | 233 ++++++++++++++++++ .../hr/doctype/offer_letter/offer_letter.py | 13 + .../doctype/offer_letter/test_offer_letter.py | 11 + 7 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 erpnext/hr/doctype/offer_letter/__init__.py create mode 100644 erpnext/hr/doctype/offer_letter/offer_letter.js create mode 100644 erpnext/hr/doctype/offer_letter/offer_letter.json create mode 100644 erpnext/hr/doctype/offer_letter/offer_letter.py create mode 100644 erpnext/hr/doctype/offer_letter/test_offer_letter.py diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py index 4353733a31..608e1bb5fa 100644 --- a/erpnext/config/hr.py +++ b/erpnext/config/hr.py @@ -47,6 +47,11 @@ def get_data(): "name": "Job Opening", "description": _("Opening for a Job."), }, + { + "type": "doctype", + "name": "Offer Letter", + "description": _("Offer candidate a Job."), + }, ] }, { diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.json b/erpnext/hr/doctype/job_applicant/job_applicant.json index fbedc1f0b4..3ba3012f3d 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.json +++ b/erpnext/hr/doctype/job_applicant/job_applicant.json @@ -1,5 +1,9 @@ { +<<<<<<< HEAD "autoname": "", +======= + "autoname": "JA-.######", +>>>>>>> Offer Letter - New Doctype added and job_applicant naming changed "creation": "2013-01-29 19:25:37", "description": "Applicant for a Job", "docstatus": 0, @@ -66,7 +70,11 @@ ], "icon": "icon-user", "idx": 1, +<<<<<<< HEAD "modified": "2015-03-23 05:42:02.016041", +======= + "modified": "2015-03-04 15:30:02.663549", +>>>>>>> Offer Letter - New Doctype added and job_applicant naming changed "modified_by": "Administrator", "module": "HR", "name": "Job Applicant", @@ -85,5 +93,6 @@ "share": 1, "write": 1 } - ] + ], + "title_field": "applicant_name" } \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter/__init__.py b/erpnext/hr/doctype/offer_letter/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.js b/erpnext/hr/doctype/offer_letter/offer_letter.js new file mode 100644 index 0000000000..9b057a2a40 --- /dev/null +++ b/erpnext/hr/doctype/offer_letter/offer_letter.js @@ -0,0 +1,14 @@ +// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +cur_frm.cscript.job_applicant = function() { + frappe.call({ + doc: cur_frm.doc, + method: "set_applicant_name", + callback: function(r) { + if(!r.exe){ + refresh_field("applicant_name"); + } + } + }); +} \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.json b/erpnext/hr/doctype/offer_letter/offer_letter.json new file mode 100644 index 0000000000..7d7f27a81c --- /dev/null +++ b/erpnext/hr/doctype/offer_letter/offer_letter.json @@ -0,0 +1,233 @@ +{ + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "OL-.######", + "creation": "2015-03-04 14:20:17.662207", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "allow_on_submit": 0, + "fieldname": "job_applicant", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Job Applicant", + "no_copy": 0, + "options": "Job Applicant", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "applicant_name", + "fieldtype": "Data", + "label": "Applicant Name", + "permlevel": 0, + "precision": "", + "read_only": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Awaiting Response\nAccepted\nRejected ", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "fieldname": "desgnation", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Designation", + "no_copy": 0, + "options": "Designation", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "section_break_4", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "fieldname": "expected_joining_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Expected Joining Date", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "column_break_7", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "description": "In months.", + "fieldname": "probation_period", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Probation Period", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "section_break_9", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "fieldname": "salary", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Salary", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "fieldname": "terms", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Terms", + "no_copy": 0, + "options": "Terms and Conditions", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Offer Letter", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 1, + "issingle": 0, + "istable": 0, + "modified": "2015-03-04 15:51:12.341615", + "modified_by": "Administrator", + "module": "HR", + "name": "Offer Letter", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "apply_user_permissions": 0, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 0, + "export": 0, + "import": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "HR Manager", + "set_user_permissions": 0, + "share": 0, + "submit": 1, + "write": 1 + }, + { + "create": 1, + "permlevel": 0, + "read": 1, + "role": "HR User", + "write": 1 + } + ], + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "job_applicant" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.py b/erpnext/hr/doctype/offer_letter/offer_letter.py new file mode 100644 index 0000000000..e41efbec77 --- /dev/null +++ b/erpnext/hr/doctype/offer_letter/offer_letter.py @@ -0,0 +1,13 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class OfferLetter(Document): + def validate(self): + self.set_applicant_name() + + def set_applicant_name(self): + self.applicant_name = frappe.db.get_value("Job Applicant", self.job_applicant, "applicant_name") diff --git a/erpnext/hr/doctype/offer_letter/test_offer_letter.py b/erpnext/hr/doctype/offer_letter/test_offer_letter.py new file mode 100644 index 0000000000..69d2df691e --- /dev/null +++ b/erpnext/hr/doctype/offer_letter/test_offer_letter.py @@ -0,0 +1,11 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +# test_records = frappe.get_test_records('Offer Letter') + +class TestOfferLetter(unittest.TestCase): + pass From 8ca547b7f29ccd5ca8c5a6f36243cb0166e92f20 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 4 Mar 2015 16:36:19 +0530 Subject: [PATCH 2/5] terms view added --- .../hr/doctype/offer_letter/offer_letter.js | 12 +++++++++ .../hr/doctype/offer_letter/offer_letter.json | 26 +++++++++++++++++-- .../hr/doctype/offer_letter/offer_letter.py | 3 +++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.js b/erpnext/hr/doctype/offer_letter/offer_letter.js index 9b057a2a40..7979efdfa7 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.js +++ b/erpnext/hr/doctype/offer_letter/offer_letter.js @@ -11,4 +11,16 @@ cur_frm.cscript.job_applicant = function() { } } }); +} + +cur_frm.cscript.terms = function() { + frappe.call({ + doc: cur_frm.doc, + method: "set_view_terms", + callback: function(r) { + if(!r.exe){ + refresh_field("view_terms"); + } + } + }); } \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.json b/erpnext/hr/doctype/offer_letter/offer_letter.json index 7d7f27a81c..7e2baa3d07 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.json +++ b/erpnext/hr/doctype/offer_letter/offer_letter.json @@ -153,6 +153,20 @@ "permlevel": 0, "precision": "" }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "section_break_14", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, { "allow_on_submit": 0, "fieldname": "terms", @@ -173,6 +187,14 @@ "search_index": 0, "set_only_once": 0 }, + { + "fieldname": "view_terms", + "fieldtype": "Text Editor", + "label": "View Terms", + "options": "view_terms", + "permlevel": 0, + "precision": "" + }, { "fieldname": "amended_from", "fieldtype": "Link", @@ -191,7 +213,7 @@ "is_submittable": 1, "issingle": 0, "istable": 0, - "modified": "2015-03-04 15:51:12.341615", + "modified": "2015-03-04 16:30:16.012258", "modified_by": "Administrator", "module": "HR", "name": "Offer Letter", @@ -229,5 +251,5 @@ "read_only_onload": 0, "sort_field": "modified", "sort_order": "DESC", - "title_field": "job_applicant" + "title_field": "applicant_name" } \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.py b/erpnext/hr/doctype/offer_letter/offer_letter.py index e41efbec77..ddf945934f 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.py +++ b/erpnext/hr/doctype/offer_letter/offer_letter.py @@ -11,3 +11,6 @@ class OfferLetter(Document): def set_applicant_name(self): self.applicant_name = frappe.db.get_value("Job Applicant", self.job_applicant, "applicant_name") + + def set_view_terms(self): + self.view_terms = frappe.db.get_value("Terms and Conditions", self.terms, "terms") \ No newline at end of file From aca5cb6513683e4f1f9ebf5c060932dd90323abf Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 5 Mar 2015 11:30:55 +0530 Subject: [PATCH 3/5] [fixes] offer letter --- .../hr/doctype/job_applicant/job_applicant.js | 4 -- .../hr/doctype/offer_letter/offer_letter.js | 30 +++---------- .../hr/doctype/offer_letter/offer_letter.json | 44 +++++++++---------- .../hr/doctype/offer_letter/offer_letter.py | 9 +--- 4 files changed, 28 insertions(+), 59 deletions(-) diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.js b/erpnext/hr/doctype/job_applicant/job_applicant.js index ee0acc5fd3..ed594d9c63 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.js +++ b/erpnext/hr/doctype/job_applicant/job_applicant.js @@ -5,7 +5,3 @@ // for communication cur_frm.email_field = "email_id"; -cur_frm.cscript = { - refresh: function(doc) { - }, -} diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.js b/erpnext/hr/doctype/offer_letter/offer_letter.js index 7979efdfa7..62cfc83bc4 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.js +++ b/erpnext/hr/doctype/offer_letter/offer_letter.js @@ -1,26 +1,10 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -cur_frm.cscript.job_applicant = function() { - frappe.call({ - doc: cur_frm.doc, - method: "set_applicant_name", - callback: function(r) { - if(!r.exe){ - refresh_field("applicant_name"); - } - } - }); -} - -cur_frm.cscript.terms = function() { - frappe.call({ - doc: cur_frm.doc, - method: "set_view_terms", - callback: function(r) { - if(!r.exe){ - refresh_field("view_terms"); - } - } - }); -} \ No newline at end of file +frappe.ui.form.on("Offer Letter", { + select_terms: function(frm) { + frappe.model.get_value("Terms and Conditions", frm.doc.select_terms, "terms", function(value) { + frm.set_value("terms", value.terms); + }); + } +}); diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.json b/erpnext/hr/doctype/offer_letter/offer_letter.json index 7e2baa3d07..4014c44c1a 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.json +++ b/erpnext/hr/doctype/offer_letter/offer_letter.json @@ -1,8 +1,8 @@ { "allow_copy": 0, - "allow_import": 0, + "allow_import": 1, "allow_rename": 0, - "autoname": "OL-.######", + "autoname": "Offer-.#####", "creation": "2015-03-04 14:20:17.662207", "custom": 0, "docstatus": 0, @@ -22,7 +22,7 @@ "options": "Job Applicant", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -33,6 +33,7 @@ "fieldname": "applicant_name", "fieldtype": "Data", "label": "Applicant Name", + "options": "job_applicant.applicant_name", "permlevel": 0, "precision": "", "read_only": 1 @@ -49,7 +50,8 @@ "label": "Status", "options": "Awaiting Response\nAccepted\nRejected ", "permlevel": 0, - "precision": "" + "precision": "", + "print_hide": 1 }, { "allow_on_submit": 0, @@ -159,7 +161,8 @@ "label": "Company", "options": "Company", "permlevel": 0, - "precision": "" + "precision": "", + "print_hide": 1 }, { "fieldname": "section_break_14", @@ -169,18 +172,18 @@ }, { "allow_on_submit": 0, - "fieldname": "terms", + "fieldname": "select_terms", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, - "label": "Terms", + "label": "Select Terms", "no_copy": 0, "options": "Terms and Conditions", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -188,10 +191,10 @@ "set_only_once": 0 }, { - "fieldname": "view_terms", + "fieldname": "terms", "fieldtype": "Text Editor", - "label": "View Terms", - "options": "view_terms", + "label": "Terms", + "options": "", "permlevel": 0, "precision": "" }, @@ -213,7 +216,7 @@ "is_submittable": 1, "issingle": 0, "istable": 0, - "modified": "2015-03-04 16:30:16.012258", + "modified": "2015-03-05 00:54:34.719300", "modified_by": "Administrator", "module": "HR", "name": "Offer Letter", @@ -227,24 +230,17 @@ "create": 1, "delete": 1, "email": 0, - "export": 0, - "import": 0, + "export": 1, + "import": 1, "permlevel": 0, - "print": 0, + "print": 1, "read": 1, - "report": 0, - "role": "HR Manager", + "report": 1, + "role": "HR User", "set_user_permissions": 0, "share": 0, "submit": 1, "write": 1 - }, - { - "create": 1, - "permlevel": 0, - "read": 1, - "role": "HR User", - "write": 1 } ], "read_only": 0, diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.py b/erpnext/hr/doctype/offer_letter/offer_letter.py index ddf945934f..b3eb865f14 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.py +++ b/erpnext/hr/doctype/offer_letter/offer_letter.py @@ -6,11 +6,4 @@ import frappe from frappe.model.document import Document class OfferLetter(Document): - def validate(self): - self.set_applicant_name() - - def set_applicant_name(self): - self.applicant_name = frappe.db.get_value("Job Applicant", self.job_applicant, "applicant_name") - - def set_view_terms(self): - self.view_terms = frappe.db.get_value("Terms and Conditions", self.terms, "terms") \ No newline at end of file + pass From 496e277d8aa1663aeb766c3e492d8002c436fbab Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 9 Mar 2015 18:30:43 +0530 Subject: [PATCH 4/5] print format added --- .../doctype/job_applicant/job_applicant.json | 9 +- .../hr/doctype/offer_letter/offer_letter.json | 116 ++++-------------- .../hr/doctype/offer_letter_terms/__init__.py | 0 .../offer_letter_terms.json | 75 +++++++++++ .../offer_letter_terms/offer_letter_terms.py | 9 ++ erpnext/hr/doctype/offer_term/__init__.py | 0 erpnext/hr/doctype/offer_term/offer_term.json | 70 +++++++++++ erpnext/hr/doctype/offer_term/offer_term.py | 9 ++ .../hr/doctype/offer_term/test_offer_term.py | 11 ++ erpnext/hr/print_format/__init__.py | 0 .../hr/print_format/offer_letter/__init__.py | 0 .../offer_letter/offer_letter.json | 16 +++ 12 files changed, 216 insertions(+), 99 deletions(-) create mode 100644 erpnext/hr/doctype/offer_letter_terms/__init__.py create mode 100644 erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json create mode 100644 erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py create mode 100644 erpnext/hr/doctype/offer_term/__init__.py create mode 100644 erpnext/hr/doctype/offer_term/offer_term.json create mode 100644 erpnext/hr/doctype/offer_term/offer_term.py create mode 100644 erpnext/hr/doctype/offer_term/test_offer_term.py create mode 100644 erpnext/hr/print_format/__init__.py create mode 100644 erpnext/hr/print_format/offer_letter/__init__.py create mode 100644 erpnext/hr/print_format/offer_letter/offer_letter.json diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.json b/erpnext/hr/doctype/job_applicant/job_applicant.json index 3ba3012f3d..f35cacda07 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.json +++ b/erpnext/hr/doctype/job_applicant/job_applicant.json @@ -1,9 +1,5 @@ { -<<<<<<< HEAD - "autoname": "", -======= "autoname": "JA-.######", ->>>>>>> Offer Letter - New Doctype added and job_applicant naming changed "creation": "2013-01-29 19:25:37", "description": "Applicant for a Job", "docstatus": 0, @@ -70,11 +66,7 @@ ], "icon": "icon-user", "idx": 1, -<<<<<<< HEAD "modified": "2015-03-23 05:42:02.016041", -======= - "modified": "2015-03-04 15:30:02.663549", ->>>>>>> Offer Letter - New Doctype added and job_applicant naming changed "modified_by": "Administrator", "module": "HR", "name": "Job Applicant", @@ -94,5 +86,6 @@ "write": 1 } ], + "search_fields": "applicant_name", "title_field": "applicant_name" } \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.json b/erpnext/hr/doctype/offer_letter/offer_letter.json index 4014c44c1a..e98ab6b4c2 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.json +++ b/erpnext/hr/doctype/offer_letter/offer_letter.json @@ -5,6 +5,7 @@ "autoname": "Offer-.#####", "creation": "2015-03-04 14:20:17.662207", "custom": 0, + "default_print_format": "Offer Letter", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -36,7 +37,8 @@ "options": "job_applicant.applicant_name", "permlevel": 0, "precision": "", - "read_only": 1 + "read_only": 1, + "reqd": 1 }, { "fieldname": "column_break_3", @@ -45,6 +47,7 @@ "precision": "" }, { + "allow_on_submit": 1, "fieldname": "status", "fieldtype": "Select", "label": "Status", @@ -55,7 +58,7 @@ }, { "allow_on_submit": 0, - "fieldname": "desgnation", + "fieldname": "designation", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, @@ -69,92 +72,10 @@ "print_hide": 0, "read_only": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0 }, - { - "fieldname": "section_break_4", - "fieldtype": "Section Break", - "permlevel": 0, - "precision": "" - }, - { - "allow_on_submit": 0, - "fieldname": "expected_joining_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Expected Joining Date", - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0 - }, - { - "fieldname": "column_break_7", - "fieldtype": "Column Break", - "permlevel": 0, - "precision": "" - }, - { - "allow_on_submit": 0, - "description": "In months.", - "fieldname": "probation_period", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Probation Period", - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0 - }, - { - "fieldname": "section_break_9", - "fieldtype": "Section Break", - "permlevel": 0, - "precision": "" - }, - { - "allow_on_submit": 0, - "fieldname": "salary", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Salary", - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0 - }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break", - "permlevel": 0, - "precision": "" - }, { "fieldname": "company", "fieldtype": "Link", @@ -162,7 +83,22 @@ "options": "Company", "permlevel": 0, "precision": "", - "print_hide": 1 + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "section_break_4", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "offer_terms", + "fieldtype": "Table", + "label": "Offer Terms", + "options": "Offer Letter Terms", + "permlevel": 0, + "precision": "" }, { "fieldname": "section_break_14", @@ -216,7 +152,7 @@ "is_submittable": 1, "issingle": 0, "istable": 0, - "modified": "2015-03-05 00:54:34.719300", + "modified": "2015-03-10 11:41:24.870015", "modified_by": "Administrator", "module": "HR", "name": "Offer Letter", @@ -225,11 +161,10 @@ "permissions": [ { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, - "email": 0, + "email": 1, "export": 1, "import": 1, "permlevel": 0, @@ -237,8 +172,7 @@ "read": 1, "report": 1, "role": "HR User", - "set_user_permissions": 0, - "share": 0, + "share": 1, "submit": 1, "write": 1 } diff --git a/erpnext/hr/doctype/offer_letter_terms/__init__.py b/erpnext/hr/doctype/offer_letter_terms/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json b/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json new file mode 100644 index 0000000000..70a7e611ac --- /dev/null +++ b/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json @@ -0,0 +1,75 @@ +{ + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "creation": "2015-03-05 12:53:45.342292", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "fields": [ + { + "allow_on_submit": 0, + "fieldname": "offer_term", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Offer Term", + "no_copy": 0, + "options": "Offer Term", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0 + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "permlevel": 0, + "precision": "" + }, + { + "allow_on_submit": 0, + "fieldname": "value", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Value", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "modified": "2015-03-10 18:28:01.978680", + "modified_by": "Administrator", + "module": "HR", + "name": "Offer Letter Terms", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py b/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py new file mode 100644 index 0000000000..f98cc9feee --- /dev/null +++ b/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py @@ -0,0 +1,9 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class OfferLetterTerms(Document): + pass diff --git a/erpnext/hr/doctype/offer_term/__init__.py b/erpnext/hr/doctype/offer_term/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/doctype/offer_term/offer_term.json b/erpnext/hr/doctype/offer_term/offer_term.json new file mode 100644 index 0000000000..61e45a4b4d --- /dev/null +++ b/erpnext/hr/doctype/offer_term/offer_term.json @@ -0,0 +1,70 @@ +{ + "allow_copy": 0, + "allow_import": 1, + "allow_rename": 0, + "autoname": "field:offer_term", + "creation": "2015-03-05 13:00:30.900471", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "allow_on_submit": 0, + "fieldname": "offer_term", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Offer Term", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "modified": "2015-03-10 18:19:23.032194", + "modified_by": "Administrator", + "module": "HR", + "name": "Offer Term", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 0, + "export": 0, + "import": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "HR User", + "set_user_permissions": 0, + "share": 0, + "submit": 0, + "write": 1 + } + ], + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/offer_term/offer_term.py b/erpnext/hr/doctype/offer_term/offer_term.py new file mode 100644 index 0000000000..6a63201106 --- /dev/null +++ b/erpnext/hr/doctype/offer_term/offer_term.py @@ -0,0 +1,9 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class OfferTerm(Document): + pass diff --git a/erpnext/hr/doctype/offer_term/test_offer_term.py b/erpnext/hr/doctype/offer_term/test_offer_term.py new file mode 100644 index 0000000000..d0dd14d1e6 --- /dev/null +++ b/erpnext/hr/doctype/offer_term/test_offer_term.py @@ -0,0 +1,11 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +# test_records = frappe.get_test_records('Offer Term') + +class TestOfferTerm(unittest.TestCase): + pass diff --git a/erpnext/hr/print_format/__init__.py b/erpnext/hr/print_format/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/print_format/offer_letter/__init__.py b/erpnext/hr/print_format/offer_letter/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/print_format/offer_letter/offer_letter.json b/erpnext/hr/print_format/offer_letter/offer_letter.json new file mode 100644 index 0000000000..08ad33398a --- /dev/null +++ b/erpnext/hr/print_format/offer_letter/offer_letter.json @@ -0,0 +1,16 @@ +{ + "creation": "2015-03-05 14:34:26.751210", + "custom_format": 0, + "disabled": 0, + "doc_type": "Offer Letter", + "docstatus": 0, + "doctype": "Print Format", + "html": "{% if letter_head and not no_letterhead %}\n
{{ letter_head }}

\n{% endif %}\n
\n\nDear {{ doc.applicant_name }},

\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n

\n\nYour designation shall be {{ doc.designation }}.\n\n
\n{%- for row in doc.offer_terms -%}\n{{ row.offer_term }}: {{ row.value }}\n
\n{%- endfor -%}\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
\n
\n

\n\nYours truely,\n\n



\n\nAuthorized Signatory\n\n
{{ doc.company }}

\n
\n
\n\t{{doc.terms}}\n
", + "modified": "2015-03-09 18:51:17.400960", + "modified_by": "Administrator", + "name": "Offer Letter", + "owner": "Administrator", + "print_format_builder": 0, + "print_format_type": "Server", + "standard": "Yes" +} \ No newline at end of file From 28b0cc4d0b9972db5fb1fb55023ae397d14ba4da Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 1 Apr 2015 15:13:15 +0530 Subject: [PATCH 5/5] fixes in offer letter --- .../hr/doctype/job_applicant/job_applicant.js | 22 +++++++++++++++++++ .../hr/doctype/job_applicant/job_applicant.py | 5 +++++ .../hr/doctype/offer_letter/offer_letter.json | 18 ++++++++++----- .../__init__.py | 0 .../offer_letter_term.json} | 8 +++---- .../offer_letter_term.py} | 2 +- .../offer_letter/offer_letter.json | 6 ++--- .../page/setup_wizard/install_fixtures.py | 16 +++++++++++++- 8 files changed, 63 insertions(+), 14 deletions(-) rename erpnext/hr/doctype/{offer_letter_terms => offer_letter_term}/__init__.py (100%) rename erpnext/hr/doctype/{offer_letter_terms/offer_letter_terms.json => offer_letter_term/offer_letter_term.json} (90%) rename erpnext/hr/doctype/{offer_letter_terms/offer_letter_terms.py => offer_letter_term/offer_letter_term.py} (87%) diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.js b/erpnext/hr/doctype/job_applicant/job_applicant.js index ed594d9c63..1ca750ad15 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.js +++ b/erpnext/hr/doctype/job_applicant/job_applicant.js @@ -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"); + }); + } + } + + } +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py index 1bdd8fc51e..90b0ec90a2 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant.py @@ -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: diff --git a/erpnext/hr/doctype/offer_letter/offer_letter.json b/erpnext/hr/doctype/offer_letter/offer_letter.json index e98ab6b4c2..ec93bb004b 100644 --- a/erpnext/hr/doctype/offer_letter/offer_letter.json +++ b/erpnext/hr/doctype/offer_letter/offer_letter.json @@ -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", diff --git a/erpnext/hr/doctype/offer_letter_terms/__init__.py b/erpnext/hr/doctype/offer_letter_term/__init__.py similarity index 100% rename from erpnext/hr/doctype/offer_letter_terms/__init__.py rename to erpnext/hr/doctype/offer_letter_term/__init__.py diff --git a/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json b/erpnext/hr/doctype/offer_letter_term/offer_letter_term.json similarity index 90% rename from erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json rename to erpnext/hr/doctype/offer_letter_term/offer_letter_term.json index 70a7e611ac..4ab1911d56 100644 --- a/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.json +++ b/erpnext/hr/doctype/offer_letter_term/offer_letter_term.json @@ -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": [], diff --git a/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py b/erpnext/hr/doctype/offer_letter_term/offer_letter_term.py similarity index 87% rename from erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py rename to erpnext/hr/doctype/offer_letter_term/offer_letter_term.py index f98cc9feee..3396a9d268 100644 --- a/erpnext/hr/doctype/offer_letter_terms/offer_letter_terms.py +++ b/erpnext/hr/doctype/offer_letter_term/offer_letter_term.py @@ -5,5 +5,5 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class OfferLetterTerms(Document): +class OfferLetterTerm(Document): pass diff --git a/erpnext/hr/print_format/offer_letter/offer_letter.json b/erpnext/hr/print_format/offer_letter/offer_letter.json index 08ad33398a..d480159b66 100644 --- a/erpnext/hr/print_format/offer_letter/offer_letter.json +++ b/erpnext/hr/print_format/offer_letter/offer_letter.json @@ -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
{{ letter_head }}

\n{% endif %}\n
\n\nDear {{ doc.applicant_name }},

\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n

\n\nYour designation shall be {{ doc.designation }}.\n\n
\n{%- for row in doc.offer_terms -%}\n{{ row.offer_term }}: {{ row.value }}\n
\n{%- endfor -%}\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
\n
\n

\n\nYours truely,\n\n



\n\nAuthorized Signatory\n\n
{{ doc.company }}

\n
\n
\n\t{{doc.terms}}\n
", - "modified": "2015-03-09 18:51:17.400960", + "html": "{% if letter_head and not no_letterhead -%}\n
{{ letter_head }}
\n
\n{%- endif %}\n\n
\n

\n\n\nDate: {{ doc.offer_date }}\n

\n\nDear {{ doc.applicant_name }}, \n\n

\n\nWe are pleased to appoint you in the services of {{ doc.company }} on the terms and conditions detailed in this letter.\n\n

\n\nYour designation shall be {{ doc.designation }}.\n\n

\n\n\n\n{%- if doc.offer_terms -%}\n {%- for row in doc.offer_terms -%}\n {{ row.offer_term }}: {{ row.value }}\n\n
\n {%- endfor -%}\n{%- endif -%}\n\n
\n\n\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

\n\n

\n\nYours truly,\n\n



\n\nAuthorized Signatory\n\n
\n\n{{ doc.company }}\n\n\n\n

\n
\n\n\n
{{ doc.terms }}
", + "modified": "2015-04-01 05:22:51.345050", "modified_by": "Administrator", "name": "Offer Letter", "owner": "Administrator", diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py index 7bbe1395f8..f6de099938 100644 --- a/erpnext/setup/page/setup_wizard/install_fixtures.py +++ b/erpnext/setup/page/setup_wizard/install_fixtures.py @@ -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