<?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="crm" package="com.axelor.apps.crm.db"/>

  <entity name="TargetConfiguration" lang="java">
  
    <string name="name" title="Name"/>
    <string name="code" title="Code"/>
    <many-to-one name="user" column="user_id" ref="com.axelor.auth.db.User" title="Assigned to"/>
  	<many-to-one name="team" ref="com.axelor.team.db.Team" title="Team"/>
  	
<!-- Opportunity -->
    <decimal name="opportunityAmountWon" title="Amount Won"/>
    <integer name="opportunityCreatedNumber" title="Created Nbr"/>
    <integer name="opportunityCreatedWon" title="Created Won"/>
    
<!-- Sales order -->
<!-- 	<decimal name="saleOrderAmountWon" title="Amount won"/> -->
<!--     <integer name="saleOrderCreatedNumber" title="Created number"/> -->
<!--     <integer name="saleOrderCreatedWon" title="Created won"/> -->

<!-- Call -->
    <integer name="callEmittedNumber" title="Call emitted Nbr"/>
    <integer name="meetingNumber" title="Meeting Nbr"/>
    
    <integer name="periodTypeSelect" title="Period type" selection="crm.target.configuration.period.type.select"/>
    
    <date name="fromDate" title="Date from" required="true"/>
    <date name="toDate" title="Date to" required="true"/>
    
 	<many-to-many name="batchSet" ref="com.axelor.apps.base.db.Batch" title="Batchs"/>
    
    <extra-code><![CDATA[
        
        //PERIOD TYPE
        public static final int PERIOD_TYPE_NONE = 0;
        public static final int PERIOD_TYPE_MONTHLY = 1;
        public static final int PERIOD_TYPE_WEEKLY = 2;
        public static final int PERIOD_TYPE_DAILY = 3;        

	]]></extra-code>
    
  </entity>
</domain-models>
