<?xml version="1.0" ?>
<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="business-project" package="com.axelor.apps.businessproject.db"/>

  <entity name="InvoicingProject" cacheable="true">
      
    <many-to-one name="project" ref="com.axelor.apps.project.db.Project" title="Business project"/>
    <many-to-many name="logTimesSet" ref="com.axelor.apps.hr.db.TimesheetLine" title="Log Times" />
    <many-to-many name="saleOrderLineSet" ref="com.axelor.apps.sale.db.SaleOrderLine" title="Sale order lines" />
    <many-to-many name="purchaseOrderLineSet" ref="com.axelor.apps.purchase.db.PurchaseOrderLine" title="Purchase order lines" />
    <many-to-many name="expenseLineSet" ref="com.axelor.apps.hr.db.ExpenseLine" title="Expense Lines" />
    <many-to-many name="projectSet" ref="com.axelor.apps.project.db.Project" title="Project" />
    <many-to-many name="teamTaskSet" ref="com.axelor.team.db.TeamTask" title="Tasks" />
		<integer name="logTimesSetPrioritySelect" selection="invoicing.project.priority.select" title="Log Times Priority" default="3"/>
		<integer name="saleOrderLineSetPrioritySelect" selection="invoicing.project.priority.select" title="Sale order lines Priority" default="1"/>
		<integer name="purchaseOrderLineSetPrioritySelect" selection="invoicing.project.priority.select" title="Purchase order lines Priority" default="2"/>
		<integer name="expenseLineSetPrioritySelect" selection="invoicing.project.priority.select" title="Expense Lines Priority" default="4"/>
		<integer name="projectSetPrioritySelect" selection="invoicing.project.priority.select" title="Project Priority" default="5"/>
		<integer name="teamTaskSetPrioritySelect" selection="invoicing.project.priority.select" title="Task Priority" default="6"/>
    <many-to-one name="invoice" ref="com.axelor.apps.account.db.Invoice" title="Invoice generated" />
    <date name="deadlineDate" title="Deadline"/>
    <string name="comments" title="Comments" large="true" />
    <boolean name="attachAnnexToInvoice" title="Attach the Annex to the invoice"/>
    <integer name="statusSelect" title="Status" selection="business.project.invoicing.project.status.select" default="1"/>
    
    <extra-code>
        // STATUS SELECT
      public static final int STATUS_DRAFT = 1;
      public static final int STATUS_GENERATED = 2;
      public static final int STATUS_VALIDATED = 3;
      public static final int STATUS_VENTILATED = 4;
      public static final int STATUS_CANCELED = 5;
    </extra-code>
  </entity>
  
</domain-models>