<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

  <module name="human-resource" package="com.axelor.apps.hr.db"/>

  <entity name="HrBatch" lang="java" cacheable="true">
  	
  	<!-- HEADER -->
  	<string name="code" title="Code" namecolumn="true" unique="true"/>
    <integer name="actionSelect" title="Action" required="true" selection="ihr.batch.action.select"/>
    <many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" />
    
    <!-- OTHERS INFORMATIONS   -->
    <string name="description" title="Description" large="true" />
    <one-to-many name="batchList" ref="com.axelor.apps.base.db.Batch" mappedBy="hrBatch" title="Batchs" />
    
    
 	<!--  Leave Management  -->
  	<many-to-one name="leaveReason" ref="com.axelor.apps.hr.db.LeaveReason" title="Leave Reason"/>
      <decimal name="dayNumber" title="Number of days" scale="4" precision="8"/>
  	<date name="startDate" title="Start date"/>
  	<date name="endDate" title="End date"/>
 	<string name="comments" title="Comment" />
	<many-to-many name="employeeSet" ref="com.axelor.apps.hr.db.Employee" title="Employees"/>
	<many-to-many name="planningSet" ref="com.axelor.apps.base.db.WeeklyPlanning" title="Plannings"/>
	<boolean name="useWeeklyPlanningCoef" title="Use weekly plannning coef." />
	
	
	<!--  Seniority Leave Management  -->
	<date name="referentialDate" title="Referential date for seniority" />
	
	
	<!--  Payroll Preparation Generation -->
	<many-to-one name="period" ref="com.axelor.apps.base.db.Period" title="Period" />
	
	
	<!-- Payroll Preparation Export -->
	<integer name="payrollPreparationExportTypeSelect" title="Export type" selection="hr.batch.payroll.preparation.export.type.select" />
	<boolean name="exportAlreadyExported" title="Also export already exported payroll preparations" />
	
  	<integer name="employmentContractExportTypeSelect" title="Export type" selection="hr.batch.employment.contract.export.type.select"/>
    
    <!-- Timesheet Reminder -->
    <long name="daysBeforeReminder" title="Number of days before reminder" />
    <many-to-one name="template" ref="com.axelor.apps.message.db.Template" title="Template"/>
  	
  	<extra-code><![CDATA[
	
	   	// ACTION TYPE
		public static final int ACTION_LEAVE_MANAGEMENT = 1;
		public static final int ACTION_SENIORITY_LEAVE_MANAGEMENT = 2;
		public static final int ACTION_PAYROLL_PREPARATION_GENERATION = 3;
		public static final int ACTION_PAYROLL_PREPARATION_EXPORT = 4;
		public static final int ACTION_LEAVE_MANAGEMENT_RESET = 5;
		public static final int ACTION_EMPLOYMENT_CONTRACT_EXPORT = 6;
        public static final int ACTION_TIMESHEET_REMINDER = 7;
		
		//PAYROLL PREPARATION EXPORT TYPE SELECT
		public static final int EXPORT_TYPE_STANDARD = 1;
		public static final int EXPORT_TYPE_NIBELIS = 2;

		//EMPLOYMENT CONTRACT EXPORT TYPE SELECT
		public static final int EMPLOYMENT_CONTRACT_EXPORT_TYPE_SILAE = 1;
        
	]]></extra-code>
  	
  </entity>
  
</domain-models>