<?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="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"/>
		<bind to="resetDate" eval="call:com.axelor.apps.base.service.app.AppBaseService:getTodayDate()"/>
	</input>

    <input file="base_cancelReason.csv" separator=";" type="com.axelor.apps.base.db.CancelReason" search="self.importId = :importId">
        <bind to="freeText" eval="false" />
        <bind to="applicationType" eval="'com.axelor.apps.stock.db.StockMove'" />
    </input>

	<input file="supplychain_mrpForecast.csv" separator=";" type="com.axelor.apps.supplychain.db.MrpForecast">
		<bind column="forecastDate" to="forecastDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(forecastDate)"/>
	</input>
	
	<input file="supplychain_supplyChainConfig.csv" separator=";" type="com.axelor.apps.supplychain.db.SupplyChainConfig"/>

	<input file="base_appSupplychain.csv" separator=";" type="com.axelor.apps.base.db.AppSupplychain" search="self.code = :code"  call="com.axelor.csv.script.ImportSupplyChain:importSupplyChain"/>

	<input file="sale_saleOrder.csv" separator=";" search="self.importId = :importId" type="com.axelor.apps.sale.db.SaleOrder">
		<bind to="creationDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(creationDate)" column="creationDate"/>
		<bind to="confirmationDateTime" eval="call:com.axelor.csv.script.ImportDateTime:importDateTime(confirmationDateTime)" column="confirmationDateTime"/>
		<bind to="shipmentDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(shipmentDate)" column="shipmentDate"/>
	</input>
	
	<input file="sale_saleOrderLine.csv" separator=";"  type="com.axelor.apps.sale.db.SaleOrderLine" search="self.importId = :importId" call="com.axelor.csv.script.ImportSaleOrderLine:importSaleOrderLine">
		<bind to="priceDiscounted" eval="price" />
	</input>

	<input file="sale_saleOrder.csv" separator=";" search="self.importId = :importId" type="com.axelor.apps.sale.db.SaleOrder" call="com.axelor.csv.script.ImportSupplyChain:importSaleOrderFromSupplyChain">
        <bind to="creationDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(creationDate)" column="creationDate"/>
        <bind to="confirmationDateTime" eval="call:com.axelor.csv.script.ImportDateTime:importDateTime(confirmationDateTime)" column="confirmationDateTime"/>
        <bind to="shipmentDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(shipmentDate)" column="shipmentDate"/>
	</input>
	
	<input file="purchase_purchaseOrder.csv" separator=";" search="self.importId = :importId" type="com.axelor.apps.purchase.db.PurchaseOrder">
		<bind to="createdOn" eval="call:com.axelor.csv.script.ImportDateTime:importDateTime(creationDate)" column="creationDate"/>
 		<bind to="deliveryDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(deliveryDate)" column="deliveryDate"/>
 		<bind to="orderDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(orderDate)" column="orderDate"/>
 	</input>
	
 	<input file="purchase_purchaseOrderLine.csv" separator=";" search="self.importId = :importId" type="com.axelor.apps.purchase.db.PurchaseOrderLine" call="com.axelor.apps.purchase.script.ImportPurchaseOrderLine:importPurchaseOrderLine">
 		<bind to="desiredDelivDate" eval="call:com.axelor.csv.script.ImportDateTime:importDateTime(desiredDelivDate)" column="desiredDelivDate"/>
 		<bind to="estimatedDelivDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(estimatedDelivDate)" column="estimatedDelivDate"/>
 	</input>

 	<input file="purchase_purchaseOrder.csv" separator=";" search="self.importId = :importId"  type="com.axelor.apps.purchase.db.PurchaseOrder" call="com.axelor.csv.script.ImportSupplyChain:importPurchaseOrderFromSupplyChain">
		<bind to="createdOn" eval="call:com.axelor.csv.script.ImportDateTime:importDateTime(creationDate)" column="creationDate"/>
 		<bind to="deliveryDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(deliveryDate)" column="deliveryDate"/>
 		<bind to="orderDate" eval="call:com.axelor.csv.script.ImportDateTime:importDate(orderDate)" column="orderDate"/>
 	</input>
    
    <input file="account_budgetDistribution.csv" separator=";" type="com.axelor.apps.account.db.BudgetDistribution" search="self.importId = :importId" >
		<bind to="createdOn" eval="call:com.axelor.csv.script.ImportDateTime:importDate(createdOn)" column="createdOn"/>
	</input>
	
	<input file="account_accountConfig.csv" separator=";" type="com.axelor.apps.account.db.AccountConfig" search="self.importId = :importId" update="true"/>
	
</csv-inputs>

