<?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="AccountingBatch" lang="java">
  	
  	<!-- HEADER -->
  	<string name="code" title="Code" namecolumn="true" unique="true"/>
    <integer name="actionSelect" title="Action" required="true" selection="iaccounting.batch.action.select"/>
    <many-to-one name="company" ref="com.axelor.apps.base.db.Company" required="true" title="Company" />
    <many-to-one name="bankDetails" ref="com.axelor.apps.base.db.BankDetails" title="BBAN/IBAN to use"/>
    
    <many-to-one name="currency" ref="com.axelor.apps.base.db.Currency" title="Currency"/>
	<many-to-one name="paymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="Payment Mode"/>
  	<date name="dueDate" />
  	<boolean name="includeOtherBankAccounts" />

    <!-- REIMBURSEMENT -->
    <integer name="reimbursementTypeSelect" title="Reimbursement batch type" selection="ireimbursement.batch.type.select"/>
    <integer name="reimbursementExportTypeSelect" title="Treatment/Operation type" selection="ireimbursement.batch.export.type.select"/>
    
    <!-- DEBT RECOVERY -->
    <integer name="debtRecoveryTypeSelect" title="Debt recovery batch type" selection="idebt.recovery.batch.type.select"/>


    
    <!--  CUSTOMER ACCOUNT -->
    <boolean name="updateCustAccountOk" title="Customer balance"/>
    <boolean name="updateDueCustAccountOk" title="Due balance"/>
    <boolean name="updateDueDebtRecoveryCustAccountOk" title="Due balance recoverable"/>
    
    <!--     MOVE LINE EXPORT -->
    <integer name="moveLineExportTypeSelect" title="Export type" selection="accounting.report.type.select.export"/>
    <date name="startDate" title="Start date"/>
    <date name="endDate" title="End date"/>
    
    <!-- OTHERS INFORMATION -->
    <string name="description" title="Description" large="true" />
    <one-to-many name="batchList" ref="com.axelor.apps.base.db.Batch" mappedBy="accountingBatch" title="Batchs" />
    
    <!-- CREDIT TRANSFER -->
  	<integer name="creditTransferTypeSelect" title="Credit Transfer batch type" selection="iaccount.account.batch.transfer.type.select"/>
  	<many-to-one name="period" ref="com.axelor.apps.base.db.Period" title="Period"/>
	<integer name="customerReimbursementTypeSelect" title="Customer reimbursement type"
		default="1" required="true"
		selection="iaccount.account.batch.transfer.customer.reimbursement.type.select" />
		
	<!-- CLOSE/OPEN ANNUAL ACCOUNTS -->
	<boolean name="openYear" title="Open the year accounts"/>
	<boolean name="closeYear" title="Close the year accounts"/>
	<many-to-one name="year" ref="com.axelor.apps.base.db.Year" title="Year"/>
    <many-to-many name="accountSet" ref="Account" title="Accounting.Accounts"/>
<!--     <many-to-many name="journalSet" ref="Journal" title="Journals"/> -->
    <boolean name="allocatePerPartner" title="Allocate per partner"/>
	 <string name="moveDescription" title="Move description"/>


  	<extra-code><![CDATA[
	
	   	// ACTION TYPE
		public static final int ACTION_REIMBURSEMENT = 11;
		public static final int ACTION_DEBT_RECOVERY = 14;
		public static final int ACTION_DOUBTFUL_CUSTOMER = 16;
		public static final int ACTION_ACCOUNT_CUSTOMER = 17;
		public static final int ACTION_MOVE_LINE_EXPORT = 18;
		public static final int ACTION_CREDIT_TRANSFER = 19;
		public static final int ACTION_REALIZE_FIXED_ASSET_LINES = 20;
		public static final int ACTION_CLOSE_ANNUAL_ACCOUNTS_OF_PAST_YEAR = 21;
		public static final int ACTION_OPEN_ANNUAL_ACCOUNTS_OF_NEXT_YEAR = 22;
		
		// REIMBURSEMENT TYPE
		public static final int REIMBURSEMENT_TYPE_EXPORT = 1;
		public static final int REIMBURSEMENT_TYPE_IMPORT = 2;
		
		// REIMBURSEMENT EXPORT TYPE
		public static final int REIMBURSEMENT_EXPORT_TYPE_GENERATE = 1;
		public static final int REIMBURSEMNT_EXPORT_TYPE_EXPORT = 2;

		// INTERBANK PAYMENT ORDER TYPE
		public static final int INTERBANK_PAYMENT_ORDER_TYPE_IMPORT = 1;
		public static final int INTERBANK_PAYMENT_ORDER_TYPE_REJECT_IMPORT = 2;

		// DEBT RECOVERY TYPE
		public static final int DEBT_RECOVERY_TYPE = 1;
		
		// CREDIT TRANSFER TYPE
		public static final int CREDIT_TRANSFER_EXPENSE_PAYMENT = 1;
		public static final int CREDIT_TRANSFER_SUPPLIER_PAYMENT = 2;
		public static final int CREDIT_TRANSFER_CUSTOMER_REIMBURSEMENT = 3;

		// CUSTOMER REIMBURSEMENT TYPE
		public static final int CUSTOMER_REIMBURSEMENT_CUSTOMER_REFUND = 1;
		public static final int CUSTOMER_REIMBURSEMENT_PARTNER_CREDIT_BALANCE = 2;

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

</domain-models>
