Employment contract template

Hi All
How to use an employment contract template?
Does anybody have any example?
In order to be allowed to automatically print contract.

Thanls

not sure what you mean by how to use, or printing automatically

I’ve found a solution using BIRT Template.
however in my Axelor version there is a bug there

oh, what is that, ?

Created a BIRT template with params
Then get template populate params and return PDF.
I can attach the code here

1 « J'aime »

okay fine, not sure what sort of code you saying, please share it or attach

1 « J'aime »

Sure

String fileLink =
ReportFactory.createReport(IReport.EMPLOYEE_HIRING_LETTER, name)
.addParam(“EmployeeName”, employee.getUser().getFullName())
.addParam(“EmployeeNationality”, employee.getNationality().getName())
.addParam(“EmployeeCityBirth”, employee.getBirthCity().getName())
.addParam(“EmployeeCityProvBirth”, employee.getBirthCity().getDepartment().getCode())
.addParam(
“EmployeeBirthDate”,
employee.getBirthDate().format(DateTimeFormatter.ofPattern(DATE_FORMAT)))
.addParam(“EmployeeAddressCity”, defaultAddress.getAddress().getCity().getName())
.addParam(“EmployeeAddressZipCode”, defaultAddress.getAddress().getZip())
.addParam(“EmployeeAddressStreet”, defaultAddress.getAddress().getAddressL4())
.addParam(
“EmployeeAddressProv”,
defaultAddress.getAddress().getCity().getDepartment().getCode())
.addParam(“EmployeeHomeAddressCity”, homeAddress.getAddress().getCity().getName())
.addParam(“EmployeeHomeAddressZipCode”, homeAddress.getAddress().getZip())
.addParam(“EmployeeHomeAddressStreet”, homeAddress.getAddress().getAddressL4())
.addParam(
“EmployeeHomeAddressProv”,
homeAddress.getAddress().getCity().getDepartment().getCode())
.addParam(“EmployeePhone”, employee.getContactPartner().getMobilePhone())
.addParam(“EmployeeSocialSecurityNumber”, employee.getSocialSecurityNumber())
.addParam(“EmployeeIBAN”, employeeBankDetail.getIban())
.addParam(
“EmployeeCompanyName”,
employee.getEmploymentContractList().get(0).getPayCompany().getName())
.addParam(
“EmployeeHiringStartDate”,
employee
.getEmploymentContractList()
.get(0)
.getStartDate()
.format(DateTimeFormatter.ofPattern(DATE_FORMAT)))
.addParam(
“EmployeeEducationQualificationType”,
employee.getEducationQualificationType().getName())
.addParam(
“EmployeeEducationQualificationName”, employee.getEducationQualificationName())
.addParam(
“EmployeeEducationPositionCorrelation”, employee.getEducationPositionCorrelation())
.addParam(“EmployeeEmail”, employee.getContactPartner().getEmailAddress().getAddress())
.addParam(
“EmployeeExtraPensionFundName”,
employee.getExtraPensionFundName() != null
? employee.getExtraPensionFundName()
: BLANK_LINE)
.addParam(
“EmployeeExtraPensionFundStartDate”,
employee.getExtraPensionFundStartDate() != null
? employee
.getExtraPensionFundStartDate()
.format(DateTimeFormatter.ofPattern(DATE_FORMAT))
: BLANK_LINE)
.addParam(“EmployeeEmploymentType”, employmentContract.getEmployment().getName())
.addParam(“EmployeeDisability”, employee.getDisability())
.addParam(“EmployeeHiringType”, employmentContract.getHiringType().getName())
.addParam(
“EmployeeHiringExtraInfo”,
tutorNameIfAvailable != null
? employmentExtraInfoIfAvailabe + " Tutor: " + tutorNameIfAvailable
: employmentExtraInfoIfAvailabe)
.addParam(“EmployeeContractDurationType”, employmentContract.getEndDate())
.addParam(“EmployeeShiftRooster”, employmentContract.getShiftAvailable())
.addParam(“EmployeeNightShift”, employmentContract.getNightShiftAvailable())
.addParam(“EmployeeWeeklyPlanningName”, employee.getWeeklyPlanning().getName())
.addParam(“EmployeePosition”, employmentContract.getPosition().getName())
.addParam(“EmployeeAlreadySamePosition”, employee.getAlreadyWorkedSamePosition())
.addParam(
“EmployeeAlreadySamePositionDescription”,
employee.getAlreadyWorkedSamePosition()
? employee.getAlreadyWorkedSamePositionDescription()
: BLANK_LINE)
.addParam(“EmployeeContractType”, employmentContract.getContractType().getName())
.addParam(“EmployeeGrossYearSalary”, employmentContract.getAnnualGrossSalary())
.addParam(
“EmployeeCompanyDepartmentAddress”,
employmentContract.getCompanyDepartment().getMainAddress().getAddressL4())
.addParam(
“EmployeeCompanyDepartmentCity”,
employmentContract.getCompanyDepartment().getMainAddress().getCity().getName())
.addParam(
“EmployeeCompanyDepartmentCityProv”,
employmentContract
.getCompanyDepartment()
.getMainAddress()
.getCity()
.getDepartment()
.getCode())
.generate()
.getFileLink();

Then I use a simple BRIT design template created with Eclipse BIRT

It’s not aperfect solution! Anyway I’m totally un-skilled with BIRT so I created the simplest solution as possible.
BIRT also allow you to directly read data from DB and populate dynamically fields. (I didn’t had more time to investigate)

1 « J'aime »

I also can send you an example of BIRT Template

1 « J'aime »

@siddique
I don’t know how to attach an rptdesign file, they only allow images.
If you want I can email you. Just send me your email privately and I will send you

1 « J'aime »

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.