<?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
  https://axelor.com/xml/ns/domain-models/domain-models_6.0.xsd">

  <module name="human-resource" package="com.axelor.apps.hr.db"/>
  <entity name="DailyReport">
  
    <many-to-one name="employee" ref="com.axelor.apps.hr.db.Employee"/>

    <date name="reportDate"/>

    <!-- Pointage -->
    <datetime name="enter1" required="false"/>
    <datetime name="quit1" required="false"/>
    <datetime name="enter2" required="false"/>
    <datetime name="quit2"  required="false"/>
    <datetime name="enter3" required="false"/>
    <datetime name="quit3"  required="false"/>
    <datetime name="enter4" required="false"/>
    <datetime name="quit4"  required="false"/>
    <datetime name="enter5" required="false"/>
    <datetime name="quit5"  required="false"/>
    <datetime name="enter6" required="false"/>
    <datetime name="quit6"  required="false"/>
    <datetime name="lastQuit"  required="false"/>

    <!-- -->
    <decimal name="workHours" precision="20" scale="2" /> <!-- Heures de travail -->
    <decimal name="nightHours" precision="20" scale="2" /> <!-- Heures de nuit -->
    <decimal name="breakHours" precision="20" scale="2" /> <!-- Heures de pause -->
    <decimal name="extraHours50" precision="20" scale="2" /> <!-- Heures supplémentaires à 50% -->
    <decimal name="extraHours100" precision="20" scale="2" /> <!-- Heures supplémentaires à 100% -->
    <decimal name="absenceHours" precision="20" scale="2" /> <!-- Heures d'absence -->

    <!-- -->
    <decimal name="lateArrival" title ="Late arrival" precision="20" scale="2" />
    <decimal name="earlyDeparture" title ="Early departure" precision="20" scale="2" />

    <boolean name="isAuthorizedAbsence" default="False"/>
    <boolean name="isAuthorizedLateArrival" default="False"/>
    <boolean name="isAuthorizedEarlyDeparture" default="False"/>


    <decimal name="itp" precision="20" scale="2" />
    <decimal name="nuissance" precision="20" scale="2" />
    <integer name="allowance" precision="20" scale="2" /> <!-- Panier -->
    <integer name="allowanceRecall" precision="20" scale="2"/> <!-- Rappel de panier -->

    <boolean name="isFerieDay" default="False"/>
    <boolean name="isValidSupHours" default="False"/>
    <boolean name="isCalculated" default="False"/>
    <boolean name="isTransfaire" title="Transfaire"/>
    <boolean name="hasItp" title="Transfaire"/>
    <boolean name="hasNuissance" title="Transfaire"/>
    <boolean name="isChangeTheShift" default="False"/>
    <boolean name="isWeekend" default="False"/>
    <boolean name="isChanged" default="False"/>
    <boolean name="isClosed" default="False"/>
    <boolean name="breakNotInTheAllowedRange" default="False"/>
    

    <!--  -->
    <boolean name="deduceSupHours50" default="False"/>
    <boolean name="deduceSupHours100" default="False"/>
    <boolean name="deduceItp" default="False"/>
    <boolean name="deduceNuissance" default="False"/>

    <decimal name="supHours50ToDeduce" precision="20" scale="2"/>
    <decimal name="supHours100ToDeduce" precision="20" scale="2"/>
    <decimal name="itpToDeduce" precision="20" scale="2"/>
    <decimal name="nuissanceToDeduce" precision="20" scale="2"/>
  

    <many-to-one name="shift" title="Shift" ref="com.axelor.apps.hr.db.Shift" mappedBy="dailyReportList"/>
    <one-to-many name="supHoursList" title="Sup Hours" ref="com.axelor.apps.hr.db.ExtraHours" />
    <one-to-many name="authorizationList" title="Autorization" ref="com.axelor.apps.hr.db.Authorization" mappedBy="dailyReport"/>
    <many-to-one name="leaveRequest" title="Leave" ref="com.axelor.apps.hr.db.LeaveRequest" mappedBy="dailyReport"/>
    <many-to-one name="absence" title="Absence" ref="com.axelor.apps.hr.db.Absence" mappedBy="dailyReport"/>
    <many-to-one name="monthlyReport" title="Monthly Report" ref="com.axelor.apps.hr.db.MonthlyReport" mappedBy="dailyReports"/>

    <many-to-many name="absenceSet" title="Absences" ref="com.axelor.apps.hr.db.Absence"/>

    <unique-constraint columns="employee,reportDate"/>
    <track>
        <field name="enter1"/>
        <field name="enter2"/>
        <field name="enter3"/>
        <field name="enter4"/>
        <field name="enter5"/>
        <field name="enter6"/>
        <field name="quit1"/>
        <field name="quit2"/>
        <field name="quit3"/>
        <field name="quit4"/>
        <field name="quit5"/>
        <field name="quit6"/>
        <field name="shift"/>
        <field name="isValidSupHours"/>
        <field name="isAuthorizedAbsence"/>
        <field name="deduceSupHours50"/>
        <field name="deduceSupHours100"/>
        <field name="deduceItp"/>
        <field name="deduceNuissance"/>
        <field name="supHours50ToDeduce"/>
        <field name="supHours100ToDeduce"/>
        <field name="itpToDeduce"/>
        <field name="nuissanceToDeduce"/>
	  </track>
  </entity>
</domain-models>
