<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winEditarVoucher"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>

<zk xmlns="http://www.zkoss.org/2005/zul">
	<window id="winEditarVoucher" border="normal"
		apply="${editarVoucherController}" 
		height="317px" width="600px" contentStyle="overflow:auto" sizable="true"
		title="${c:l('editarVoucherController.window.title')}">
		
		<toolbar>
			<hbox spacing="5px" style="padding:1px" align="right">
				<button id="btnSalvar" height="20"
					image="/gui/img/save.png" width="35px" 
					tooltiptext="${c:l('tooltiptext.btnSalvar')}" />
				<button id="btnCerrar"
					onClick="winEditarVoucher.detach()" image="/gui/img/exit.png"
					width="35px"
					tooltiptext="${c:l('tooltiptext.btnFechar')}" />
			</hbox>
		</toolbar>
		
		<tabbox vflex="1" hflex="1">
			<tabs>					
				<tab label="${c:l('editarVoucherController.tab.voucher')}" />
				<tab label="${c:l('editarVoucherController.tab.legalizar')}" />
			</tabs>
			
			<tabpanels style="overflow: auto">
			
				<!-- Voucher -->
				<tabpanel id="tbVoucher" >
					<grid fixedLayout="true">
						<columns>
							<column width="25%" />
							<column width="75%" />
						</columns>
						<rows>							
							<row>
								<label id="lbNumVoucher" value="${c:l('label.numVoucher')}" />
								<label id="txtNumVoucher"								 
									value="@{winEditarVoucher$composer.voucher.voucherId}" />
							</row>
							
							<row>
								<label value="${c:l('label.numContrato')}" />
								<label id="txtNumContrato" 
									value="@{winEditarVoucher$composer.voucher.contrato.numContrato}" />
							</row>
							
							<row>
								<label value="${c:l('label.clienteCorporativo')}" />
								<label id="txtCliente" />
							</row>
							
							<row>
								<label value="${c:l('label.origem')}" />
								<label id="txtOrigem"
									value="@{winEditarVoucher$composer.voucher.descOrigem}" />
							</row>
							
							<row>
								<label value="${c:l('label.destino')}" />
								<label id="txtDestino" 
									value="@{winEditarVoucher$composer.voucher.descDestino}" />
							</row>
								
							<row>
								<label id="lbDataValidade" value="${c:l('label.dataValidade')}" />
								<datebox id="datValidade" width="100px"
									constraint="no past, no today" format="dd/MM/yyyy" maxlength="10" 
									value="@{winEditarVoucher$composer.voucher.dataValidade}" />
							</row>
							
							<row>
								<label id="lbValorLicitado" value="${c:l('label.valorLicitado')}" />
								<label id="txtValorLicitado"
									value="@{winEditarVoucher$composer.voucher.valorLicitado}" />
							</row>

							<row>
								<label id="lbLegalizado" value="${c:l('label.valorTransportadora')}" />
								<label id="txtLegalizado" 
									value="@{winEditarVoucher$composer.voucher.valorLegalizado}" />
							</row>
														
							<row>
								<label value="${c:l('label.passageiro')}" />
								<label id="txtPassageiro" 
									value="@{winEditarVoucher$composer.voucher.nomePassageiro}" />
							</row>
							
							<row>
								<label value="${c:l('label.numFatura')}" />
								<label id="txtFatura" 
									value="@{winEditarVoucher$composer.voucher.numFatura}" />
							</row>
							
							<row >
								<label value="${c:l('label.situacao')}" />
								<label id="txtStatus" 
									value="@{winEditarVoucher$composer.voucher.situacaoVoucher}" />
							</row>
							
						</rows>
					</grid>
				</tabpanel>
				
				<!-- Legalizar -->
				<tabpanel id="tbLegalizar" >
					<grid fixedLayout="true">
						<columns>
							<column width="25%" />
							<column width="75%" />
						</columns>
						<rows>
							<row>
			                    <label value="${c:l('label.transportadora')}"/>
			                    <combobox id="cmbTransportadora" width="95%" 
			                    	use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" 
			                    	model="@{winEditarVoucher$composer.lsTransportadora}"
			                    	value="@{winEditarVoucher$composer.voucher.transportadora}"
			                    	mold="rounded" buttonVisible="true" />
			                </row>
			                
							<row>
								<label id="lbValorTransp" value="${c:l('label.valorTransportadora')}" />
								<decimalbox id="txtValorTransp" 
									maxlength="12" format="0.00"
									constraint="no negative" width="100px"
									value="@{winEditarVoucher$composer.voucher.valorLegalizado}" />
							</row>
			                
			                <row spans="4" align="center">
			                    <button id="btnLegalizar" height="20"
									image="/gui/img/ok.png" width="120px"
									label="Legalizar " />
			                </row>

						</rows>
					</grid>
				</tabpanel>	
				
			</tabpanels>
		</tabbox>
	</window>
</zk>