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

  <entity name="DebtRecovery" lang="java">
  
    <one-to-one name="accountingSituation" ref="com.axelor.apps.account.db.AccountingSituation"/> 
  	<many-to-one name="debtRecoveryMethod" ref="com.axelor.apps.account.db.DebtRecoveryMethod" title="Debt recovery method"/>
	<many-to-one name="debtRecoveryMethodLine" ref="com.axelor.apps.account.db.DebtRecoveryMethodLine" title="Active level" />
	<date name="debtRecoveryDate" title="Last debt recovery date"/>
	<date name="referenceDate" title="Reference Date"/>
	<one-to-many name="debtRecoveryHistoryList" ref="com.axelor.apps.account.db.DebtRecoveryHistory" mappedBy="debtRecovery" title="Debt recovery history list"/>
	<boolean name="setToIrrecoverableOk" title="Shift to irrecoverable"/>
	<boolean name="unknownAddressOk" title="Address unknown"/>
	<decimal name="balanceDue" title="Partner Balance due"/>
	<decimal name="balanceDueDebtRecovery" title="Balance due recoverable"/>
	<many-to-one name="waitDebtRecoveryMethodLine" ref="com.axelor.apps.account.db.DebtRecoveryMethodLine" title="Level to apply / awaiting" />
	<many-to-many name="invoiceDebtRecoverySet" ref="com.axelor.apps.account.db.Invoice" title="Invoice concerned by the debt recovery"/>
	<many-to-many name="paymentScheduleLineDebtRecoverySet" ref="com.axelor.apps.account.db.PaymentScheduleLine" title="Schedule line concerned by the debt recovery"/>
  	<boolean name="deceasedPartnerOk" title="Owner deceased"/>
	<many-to-many name="batchSet" ref="com.axelor.apps.base.db.Batch" title="Batches"/>
	<many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" />
	<many-to-one name="currency" ref="com.axelor.apps.base.db.Currency" title="Currency"/>

    <string name="name" namecolumn="true" search="referenceDate,id" title="Name">
	   	<![CDATA[
	   		String name = "";
	    	if(referenceDate != null)
	    		name += id + " - "+referenceDate.toString();
	 		return name; 
	    ]]>
    </string>
    
  </entity>

</domain-models>