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

  <entity name="PurchaseOrderSupplierLine" lang="java">
  
  	<many-to-one name="purchaseOrderLine" ref="com.axelor.apps.purchase.db.PurchaseOrderLine" title="Purchase order" index="idx_suppmanage_po_supp_line_po_line"/>
  	
  	<decimal name="availableQty" title="Available qty" default="0"/>
  	
  	<decimal name="price" title="Unit price" initParam="true"/>
  	
  	<string name="comments" title="Comments" large="true"/>
  	
	<date name="estimatedDelivDate" title="Estim. delivery date"/>  	
  	
  	<integer name="stateSelect" title="State" selection="isuppliermanagement.purchase.order.supplier.line.state.select" initParam="true"/>
  	
  	<many-to-one name="supplierPartner" ref="com.axelor.apps.base.db.Partner" title="Supplier" initParam="true" index="idx_suppmanage_po_supp_line_supp_partner"/>
  	
	<!-- sophal -->	
	<many-to-one name="taxLine" ref="com.axelor.apps.account.db.TaxLine" title="Tax"/>
	<!-- Total HT -->	
	<decimal name="exTaxTotal" title="Total W.T." scale="2" precision="20" readonly="true"/>
	<!-- Total T.V.A. -->
	<decimal name="taxTotal" title="Total Tax" scale="2" precision="20" readonly="true"/>
	<!-- Total T.T.C -->
	<decimal name="inTaxTotal" title="Total A.T.I." scale="2" precision="20" readonly="true"/>
	<many-to-one name="currency" ref="com.axelor.apps.base.db.Currency" title="Currency"/>
	
	<many-to-one name="acceptedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Accepted by"/> 
  	<date name="acceptanceDate" title="Acceptance date" readonly="true"/>

	<many-to-one name="refusedByUser" ref="com.axelor.auth.db.User" readonly="true" title="Refused by"/> 
  	<date name="refusalDate" title="refusal date" readonly="true"/>

	<!-- sophal -->
	
  	<extra-code><![CDATA[
	
	   	//STATE SELECT
	   	public static final int STATE_REQUESTED = 1;
        public static final int STATE_SUBMITTED = 2;
        public static final int STATE_ACCEPTED = 3;
        public static final int STATE_NOT_ACCEPTED = 4;
        public static final int STATE_CANCELED = 5;
	  ]]>
	</extra-code>
  	
  	
  </entity>

</domain-models>
