<?xml version="1.0" encoding="UTF-8"?>
<csv-inputs xmlns="http://axelor.com/xml/ns/data-import"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/data-import http://axelor.com/xml/ns/data-import/data-import_5.2.xsd">
  	
  	<input file="account_accountType.csv" separator=";" type="com.axelor.apps.account.db.AccountType"/>
  	
  	<input file="account_fiscalPosition.csv" separator=";" type="com.axelor.apps.account.db.FiscalPosition"/>
  	
  	<input file="account_account.csv" separator=";" type="com.axelor.apps.account.db.Account" />
  	
  	<input file="account_accountEquiv.csv" separator=";" type="com.axelor.apps.account.db.AccountEquiv" />
  	
  	<input file="account_account.csv" separator=";" type="com.axelor.apps.account.db.Account"  search="self.importId = :importId" update="true">
		<bind to="importId" column="importId" />
		<bind to="parentAccount" search="self.code = :parent_code AND self.company.id = 1" update="true">
			<bind to="code" column="parent_code" />
		</bind>
		<bind column="compatibleAccounts" to="compatibleAccountSet" search="self.code in :compatibleAccounts" eval="compatibleAccounts.split('\\|') as List"/>
	</input>
	
	<input file="account_taxEquiv.csv" separator=";" type="com.axelor.apps.account.db.TaxEquiv" search="self.fiscalPosition.code = :fiscalPosition_code AND self.fromTax.code = :fromTax_code AND self.toTax.code = :toTax_code" />
	
	<input file="account_accountingBatch.csv" separator=";" type="com.axelor.apps.account.db.AccountingBatch" search="self.code = :code" >
		<bind to="dueDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(dueDate)" column="dueDate"/>
		<bind to="startDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(startDate)" column="startDate"/>
		<bind to="endDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(endDate)" column="endDate"/>
	</input>

	<input file="account_journalType.csv" separator=";" type="com.axelor.apps.account.db.JournalType" search="self.importId = :importId" />
	
	<input file="account_journal.csv" separator=";" type="com.axelor.apps.account.db.Journal" search="self.importId = :importId" call="com.axelor.csv.script.ImportJournal:importAccountType"/>
     
	<input file="account_paymentMode.csv" separator=";" type="com.axelor.apps.account.db.PaymentMode"  search="self.importId = :importId" />
	
	<input file="account_paymentCondition.csv" separator=";" type="com.axelor.apps.account.db.PaymentCondition" search="self.importId = :importId" />
	
	<input file="account_analyticAxis.csv" separator=";" type="com.axelor.apps.account.db.AnalyticAxis" search="self.importId = :importId" />
	
	<input file="account_analyticAccount.csv" separator=";" type="com.axelor.apps.account.db.AnalyticAccount" search="self.importId = :importId" />
	
	<input file="base_company.csv" separator=";" type="com.axelor.apps.base.db.Company" search="self.importId = :importId" update="true" call="com.axelor.csv.script.UpdateAll:updatePeriod">
		<bind column="importId" to="importId"/>
	</input>
	
	<input file="account_interBankCodeReject.csv" separator=";" type="com.axelor.apps.account.db.InterbankCodeLine">
        <bind column="code_rejet" to="code" />
        <bind column="libelle_rejet" to="name" />
        <bind column="description_rejet" to="description" />
        <bind column="transferCfonbOk" to="transferCfonbOk" eval="transferCfonbOk == 't' ? true : false"/>
        <bind column="prelevement" to="directDebitAndTipCfonbOk" eval="prelevement == 't' ? true : false"/>
        <bind column="prelevement_sepa" to="directDebitSepaOk" eval="prelevement_sepa == 't' ? true : false"/>
        <bind column="lcr_bor" to="lcrBorOk" eval="lcr_bor == 't' ? true : false"/>
        <bind column="cheque" to="chequeOk" eval="cheque == 't' ? true : false"/>
        <bind column="rejet_technique" to="technicalRejectOk" eval="rejet_technique == 't' ? true : false"/>
        <bind to="interbankCode" search="self.code = :code_fichier">
            <bind column="code_fichier" to="code"/>
            <bind column="nom_fichier" to="name"/>
            <bind column="date_fin" to="endDate" eval="date_fin ? date_fin : null"/>
            <bind column="description_fichier" to="description"/>
			<bind to="typeSelect" eval="2"/>
        </bind>
	</input>
	
	<input file="account_interBankCodeOperation.csv" separator=";" type="com.axelor.apps.account.db.InterbankCodeLine">
		<bind column="code_operation" to="code" />
		<bind column="libelle_operation" to="name" />
		<bind column="description_operation" to="description" />
		<bind column="transferCfonbOk" to="transferCfonbOk" eval="transferCfonbOk == 't' ? true : false"/>
		<bind column="prelevement" to="directDebitAndTipCfonbOk" eval="prelevement == 't' ? true : false"/>
		<bind column="prelevement_sepa" to="directDebitSepaOk" eval="prelevement_sepa == 't' ? true : false"/>
		<bind column="lcr_bor" to="lcrBorOk" eval="lcr_bor == 't' ? true : false"/>
		<bind column="cheque" to="chequeOk" eval="cheque == 't' ? true : false"/>
		<bind column="operation_technique" to="technicalRejectOk" eval="rejet_technique == 't' ? true : false"/>
		<bind to="interbankCode" search="self.code = :code_fichier">
			<bind column="code_fichier" to="code"/>
			<bind column="nom_fichier" to="name"/>
			<bind column="date_fin" to="endDate" eval="date_fin ? date_fin : null"/>
			<bind column="description_fichier" to="description"/>
			<bind to="typeSelect" eval="1"/>
		</bind>
	</input>
	
	<input file="account_debtRecoveryLevel.csv" separator=";" type="com.axelor.apps.account.db.DebtRecoveryLevel" search="self.name = :name"/>
	
	<input file="account_debtRecoveryMethod.csv" separator=";" type="com.axelor.apps.account.db.DebtRecoveryMethod" search="self.code = :code"/>
	
	<input file="account_debtRecoveryMethodLine.csv" separator=";" type="com.axelor.apps.account.db.DebtRecoveryMethodLine" />
	
	<input file="account_accountManagement.csv" separator=";" type="com.axelor.apps.account.db.AccountManagement" search="self.importId = :importId">
		<bind search="self.importId = :company_id" to="company" update="true" />
		<bind search="self.code = :cashAccount_code and self.company.importId = :company_id" to="cashAccount" update="true" if="cashAccount_code"/>
 		<bind search="self.code = :saleAccount_code and self.company.importId = :company_id" to="saleAccount" update="true" if="saleAccount_code"/>
 		<bind search="self.code = :purchaseAccount_code and self.company.importId = :company_id" to="purchaseAccount" update="true" if="purchaseAccount_code"/>
 		<bind search="self.importId = :sequence_importId and self.company.importId = :company_id" to="sequence" update="true" if="sequence_importId"/>
 		<bind search="self.importId = :journal_importId and self.company.importId = :company_id" to="journal" update="true" if="journal_importId"/>
  		<bind search="self.importId = :bankDetails_importId" to="bankDetails" update="true" if="bankDetails_importId"/>
	</input>	
	
	<input file="account_cfonbConfig.csv" separator=";" type="com.axelor.apps.account.db.CfonbConfig" search="self.importId = :importId" />
	
	<input file="account_accountConfig.csv" separator=";" type="com.axelor.apps.account.db.AccountConfig" search="self.importId = :importId" />
	
	<input file="account_debtRecoveryConfigLine.csv" separator=";" type="com.axelor.apps.account.db.DebtRecoveryConfigLine" />
	
	<input file="auth_user.csv" separator=";" search="self.importId = :importId" type="com.axelor.auth.db.User" update="true"/>
	
	<input file="base_partner.csv" separator=";" type="com.axelor.apps.base.db.Partner" search="self.importId = :importId" 
	update="true" call="com.axelor.csv.script.ImportPartnerAccount:importAccountingSituation">
		<bind to="isContact" eval="isContact == 'true' ? true : false" />
		<bind to="isCustomer" eval="isCustomer == 'true' ? true : false" />
		<bind to="isSupplier" eval="isSupplier == 'true' ? true : false" />
		<bind to="language" search="self.code = :languageCode"/>
	</input>
	
	<input file="base_company.csv" separator=";" type="com.axelor.apps.base.db.Company" search="self.importId = :importId" update="true">
		<bind column="bankDetailsSet_id" to="bankDetailsSet" search="self.importId in :bankDetailsSet_id" update="true" />
	</input> 
 	
 	<input file="base_appAccount.csv" separator=";" search="self.code = :code" update="true" type="com.axelor.apps.base.db.AppAccount" />
 	
 	<input file="base_sequence.csv" separator=";" type="com.axelor.apps.base.db.Sequence" search="self.importId = :importId" call="com.axelor.csv.script.SequenceScript:computeFullname">
    	<bind to="yearlyResetOk" column="yearlyResetOk" eval="yearlyResetOk == '1' ? true : false"/>
    	<bind to="nextNum" column="nextNum" eval="nextNum?.empty ? '1' : nextNum"/>
    	<bind to="padding" column="padding" eval="padding?.empty ? '1' : padding"/>
    	<bind to="toBeAdded" column="toBeAdded" eval="toBeAdded?.empty ? '1' : toBeAdded"/>
    </input>
    
    <input file="account_fixedAssetType.csv" separator=";" search="self.importId = :importId" type="com.axelor.apps.account.db.FixedAssetType"/>
    
    <input file="account_fixedAssetCategory.csv" separator=";" search="self.importId = :importId" type="com.axelor.apps.account.db.FixedAssetCategory">
    	<bind to="computationMethodSelect" eval="'linear'"/>
    </input>

    <input file="base_bankDetails.csv" separator=";" type="com.axelor.apps.base.db.BankDetails" search="self.importId = :importId">
		<bind to="partner" column="partner_importId" search="self.importId =:partner_importId" update="true" />
		<bind to="isDefault" eval="true" />
	</input>
	
	 <input file="meta_schedule.csv" separator=";" type="com.axelor.meta.db.MetaSchedule"/>
    
</csv-inputs>