We decided to create HR Letters through ERPNext. As in Job Offer doctype, We have created doctypes for Increment Letter, Warning Letters, Confirmation Letters, etc. and defined fields for the variables data. And created templates for letters in Terms and Conditions section according to information on Terms and Conditions section.
On Job Offer Doctype, when selecting the letter template, all the variable fields are filling automatically from the entered values and letter is automatically generated. After all, we can edit the letter contents in that text editor field.
your event goes like this. when you change the name of the letter execute some code : get the letter from the database with its values , then insert the to the fields you want
@bahaou Thanks for your suggestion. Can you please provide the script, because i’m new to erpnext scripts. Just used the customizations from Interface level.
I created a Doctype Named : Salary Increment Letter, In that doctype I have three fields named : employee_name, effective_date, basic_salary. I manually enter the values to those fields.
Then I have created a Link Field named “select_terms” to select the predefined letter template. When selecting the template, I need to load the letter to Text Editor field named “terms” with automatically filling the above field values.
Letter Formats are created in “Terms and Conditions” doctype.
Letter format example :
Date: {{ effective_date}}
From:
HR Manager,
TSH (Pvt) Ltd.
To:
{{ employee_name }},
Confirmation of Salary Increment
Dear {{employee_name}},
We are pleased to inform you that, the management has decided to bring your salary up to with effective date from {{effective_date}} considering your performance throughout the period from your confirmation.