<?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">
	
	
	<grid name="bank-payment-batch-grid" title="Bank payment batches" model="com.axelor.apps.bankpayment.db.BankPaymentBatch">
		<field name="code"/>
		<field name="actionSelect"/>
		<field name="company" if="__config__.app.getApp('base').getEnableMultiCompany()"/>
		<field name="description"/>
	</grid>
	
	<form name="bank-payment-batch-form" title="Bank payment batch" model="com.axelor.apps.bankpayment.db.BankPaymentBatch">
		<panel name="mainPanel" >
    		<field name="actionSelect"/>
    		<field name="code"/>
    		<field name="company" canEdit="false" widget="SuggestBox" form-view="company-form" grid-view="company-grid" hideIf="actionSelect &gt; 2" hidden="true"/>
  		</panel>
  		
  		 <panel-tabs name="mainPanelTab">
  		 	<panel name="ebicsCertificatePagePanel" title="Ebics certificate page" showIf="actionSelect == 1">
				<field name="template" domain="self.metaModel.name = 'EbicsCertificate' AND self.mediaTypeSelect = 2" requiredIf="actionSelect == 1"/>
				<field name="daysNbr"/>
			</panel>

			<panel name="bankStatementPagePanel" title="Bank statement retrieval configuration" showIf="actionSelect == 2">
				<field name="ebicsPartnerSet" canNew="false" widget="TagSelect" colSpan="12" domain="self.transportEbicsUser.statusSelect = 3"/>
				<field name="bankStatementFileFormatSet" canNew="false" colSpan="12" widget="TagSelect" form-view="bank-statement-file-format-form" grid-view="bank-statement-file-format-grid"/>
			</panel>

    		<panel name="informationPanel" title="Information" >
      			<field name="createdOn" title="Created on"/>
      			<field name="createdBy" title="Created by" form-view="user-form" grid-view="user-grid"/>
      			<field name="description" colSpan="12" />
      			<panel-related name="batchListPanel" field="batchList" colSpan="12" form-view="batch-form" grid-view="batch-grid" readonly="true"/>
    		</panel>
  		</panel-tabs>

		<panel name="actionsPanel" sidebar="true" title="Actions">
			<button name="ebicsCertificateBatchBtn" title="Ebics certificate batch" onClick="save,action-bank-payment-batch-method-action-ebics-certificate" colSpan="12" showIf="actionSelect == 1"/>
		    <button name="bankStatementBatchBtn" title="Bank Statement Batch" onClick="save,action-bank-payment-batch-method-action-bank-statement" colSpan="12"  showIf="actionSelect == 2"/>
		</panel>
	</form>
	
	<action-method name="action-bank-payment-batch-method-action-ebics-certificate">
		<call class="com.axelor.apps.bankpayment.web.BankPaymentBatchController" method="actionEbicsCertificate"/>
	</action-method>

	<action-method name="action-bank-payment-batch-method-action-bank-statement">
		<call class="com.axelor.apps.bankpayment.web.BankPaymentBatchController" method="actionBankStatement" />
	</action-method>

</object-views>
