<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">

	<form name="importation-folder-form" title="Dossier d'importation" model="com.axelor.apps.purchase.db.ImportationFolder" onLoad="action-purchase-importation-folder-method-compute">
		<panel name="mainPanel" >
		<field name="statusSelect" widget="nav-select" readonly="true" default="1" colSpan="12" showTitle="false"/>
			<field name="name" showTitle="false" readonly="true" colSpan="10">
			<viewer depends="statusSelect,name"><![CDATA[
			<h3>
			<span x-translate>Dossier d'importation</span>
			{{record.name}}
			</h3>
		]]></viewer>
		</field>
		<spacer colSpan="12" />  
		<field name="progress"  max="100" min="0" colSpan="12"  widget="SelectProgress">
			<editor>
			<field name="progress" showTitle="false" colSpan="3"/>
			</editor>
		</field>
		<spacer colSpan="12" />
		<field name="containerNumber" title="N° Contenaire" colSpan="12" css="label-bold bold large"/>
		<spacer colSpan="12" />
		
		<panel title="Supply Chain" colSpan="12">
				<field name="priority" selection="purchase.importation.folder.priority.select" default="1" />
					<field name="label" title="libelle" />
				<field name="created_by" title="Traite par" />
				<field name="supplierPartner" form-view="partner-form" grid-view="partner-grid" title="Code fournisseur"/>
					<field name="estimdatedBoardingDate" title="DATE D'EMBARQUEMENT PREVU" />      
					<field name="reception_sophal_date" title="RECEPTION MAGASIN SOPHAL" />
		</panel>
		
		<field name="d_10_date" title="Date d10" />
		<field name="valorisation" title="Type de valorisation"/>
		<field name="currency" title="Devise" />
		<field name="contract" title="Type de contrat" />
		
		<panel title="Logistique" colSpan="12">
			<field name="transmissionPoToSupplier" title="Date transmission BC au fournisseur" />
			<field name="forwardingPartner" form-view="partner-form" grid-view="partner-grid" title="Code transitaire"/>
			<field name="boardingDate" title="Date embarquement"/>
			<field name="arrivalGoodiDate" title="Date arrivee marchandise"/>
			<field name="arrivalDocDate" title="Date arrivee document"/>
			<field name="invoiceDirectDebitDate" title="Date domiciliation facture"/>
		</panel>
		
		<panel title="Transit" colSpan="12">
				<field name="folderReceptionDate" title="Date reception dossier"/>
					<field name="arrivalNoticeDate" title="Date avis arrivee"/>
					<field name="liquidation_date" title="DATE DE LIQUIDATION" />
					<field name="clearanceStartDate" title="DATE DEBUT DEDOUANEMENT" />
					<field name="liquidation_date" title="DATE DE LIQUIDATION" />
					<field name="reception_sophal_date" title="ARRIVEE SOPHAL" />
		</panel>

	</panel>
	<panel-tabs name="mainPanelTab">
			<panel-related name="purchaseOrderPanel" field="purchaseOrderList" form-grid="purchase-order-grid" form-view="purchase-order-form" />
			
			<panel title="Description">
				<field name="notes" title="Notes"  colSpan="12" widget="html" />
			</panel>
			<panel title="Shipping mode">
					<field name="shipmentMode"  form-view="shipment-mode-form" grid-view="shipment-mode-grid"  />
					<field name="freightCarrierMode" form-view="freight-carrier-mode-form" grid-view="freight-carrier-mode-grid" title="Mode de transport" />
			</panel>
		</panel-tabs>
	<panel name="actionsPanel" sidebar="true">
		<button name="prepareBtn" title="PREPARATION" onClick="save,action-importation-folder-record-preparation,save" />
		<button name="openedBtn" title="ENTAMÉ" onClick="save,action-importation-folder-record-entamee,save" />
		<button name="closeBtn" title="LOGISTIQUE" onClick="save,action-importation-folder-record-logistique,save" />
		<button name="closeBtn" title="TRANSIT" onClick="save,action-importation-folder-record-transit,save" />
		<button name="closeBtn" title="RECEPTION" onClick="save,action-importation-folder-record-reception,save" />
		<button name="cancelBtn" title="Cancel" class="danger" css="btn-danger" icon="fa-times" onClick="save,action-importation-folder-record-cancel,save" />
	</panel>
	<panel name="intaxTotalPanel" sidebar="true" readonly="true">
		<field name="purchaseOrderList" showTitle="false" colSpan="12">
		<viewer depends="exTaxTotal,currency.symbol,taxTotal,inTaxTotal"><![CDATA[         
								<dl class="dl-horizontal">
								<dt>{{record.purchaseOrderSeq }}</dt>
						<dt x-translate>Total W.T.</dt>
						<dd>{{record.exTaxTotal}}  {{record.currency.symbol}}</dd>
						<dt x-translate>Total tax</dt>
						<dd>{{record.taxTotal}}  {{record.currency.symbol}}</dd>
						<dt class="order-subtotal-total" x-translate>Total A.T.I.</dt>
						<dd class="order-subtotal-total">{{record.inTaxTotal}}  {{record.currency.symbol}}</dd>    
				</dl>
				]]>
			</viewer>
		</field>    
		
	<panel sidebar="true">
			<field name="self" showTitle="false" readonly="true" >
		<viewer  depends="amount,taxAmount,totalAmount">
			<![CDATA[         
								<dl class="dl-horizontal">
						<dt x-translate>Total W.T.</dt>
						<dd>{{record.amount}}  DZD</dd>
						<dt x-translate>Total tax</dt>
						<dd>{{record.taxAmount}}  DZD</dd>
						<dt class="order-subtotal-total" x-translate>Total A.T.I.</dt>
						<dd class="order-subtotal-total">{{record.totalAmount}}  DZD</dd>    
				</dl>
				]]>
		</viewer>
		</field>
	
		</panel>
	</panel>
	
	<panel sidebar="true" title="Suivi" canCollapse="true" collapseIf="true">
		<field name="createdOn"/>
		<field name="createdBy"/>
		<field name="updatedOn"/>
		<field name="updatedBy"/>
	</panel>
	<panel sidebar="true">
	</panel>
		<panel-mail>
		<mail-messages limit="4" />
		<mail-followers />
		</panel-mail>
	</form>



	<grid name="importation-folder-grid" title="Dossier d'importation" model="com.axelor.apps.purchase.db.ImportationFolder">
		<field name="importationFolderSeq"/>
		<field name="forwardingPartner"/>
		<field name="supplierPartner"/>
		<field name="containerNumber"/>
		<field name="boardingDate"/>
		<field name="arrivalGoodiDate"/>
		<field name="arrivalDocDate"/>
		<field name="invoiceDirectDebitDate"/>
		<field name="folderReceptionDate"/>
		<field name="arrivalNoticeDate"/>
	</grid>

	<kanban name="importation-folder-kanban" title="Dossier d'importation" model="com.axelor.apps.purchase.db.ImportationFolder" columnBy="statusSelect" sequenceBy="orderByState" draggable="true" limit="10">
		<field name="importationFolderSeq"/>
		<field name="forwardingPartner"/>
		<field name="supplierPartner"/>
		<field name="containerNumber"/>
		<field name="boardingDate"/>
		<field name="progress"/>
		<field name="arrivalGoodiDate" />
		<hilite color="danger" if="progress == 0" />
		<hilite color="success" if="progress == 100" />
		<hilite color="info" if="progress &gt;= 50" />
		<hilite color="warning" if="progress &gt; 0" />
		<template><![CDATA[
    <h4>{{arrivalGoodiDate}}</h4>
    <div class="card-footer">
    		<i class='fa fa-clock-o'></i> <span>{{arrivalGoodiDate|date:'yyyy-MM-dd HH:mm:ss'}}</span>
    </div>
    ]]>		
	</template>
	</kanban>


	<action-record name="action-importation-folder-record-draft" model="com.axelor.apps.purchase.db.ImportationFolder">
		<field name="statusSelect" expr="1"/>
	</action-record>

	<action-record name="action-importation-folder-record-open" model="com.axelor.apps.purchase.db.ImportationFolder">
		<field name="statusSelect" expr="2"/>
	</action-record>

	<action-record name="action-importation-folder-record-close" model="com.axelor.apps.purchase.db.ImportationFolder">
		<field name="statusSelect" expr="3"/>
	</action-record>

	<action-record name="action-importation-folder-record-cancel" model="com.axelor.apps.purchase.db.ImportationFolder">
		<field name="statusSelect" expr="4"/>
	</action-record>

</object-views>
