<?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="winEditarTransportadora"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>

<zk xmlns="http://www.zkoss.org/2005/zul">
	<window id="winEditarTransportadora" border="normal"
		apply="${editarTransportadoraController}" height="400px" width="600px"
		contentStyle="overflow:auto"
		title="${c:l('editarTransportadoraController.window.title')}">
		
		<toolbar>
			<hbox spacing="5px" style="padding:1px" align="right">
				<button id="btnApagar" height="20"
					image="/gui/img/remove.png" width="35px"
					tooltiptext="${c:l('tooltiptext.btnApagar')}" />
				<button id="btnSalvar" height="20"
					image="/gui/img/save.png" width="35px" 
					tooltiptext="${c:l('tooltiptext.btnSalvar')}" />
				<button id="btnCerrar"
					onClick="winEditarTransportadora.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('editarTransportadoraController.tab.transportadora')}" />
				<tab label="${c:l('editarTransportadoraController.tab.convenio')}" />
				<!-- 
				<tab label="${c:l('editarTransportadoraController.tab.adicao')}" />-->
				<tab label="${c:l('editarTransportadoraController.tab.tarifa')}" />
			</tabs>
			
			<tabpanels style="overflow: auto">
			
				<!-- Transportadora -->
				<tabpanel id="tbTransportadora" >
					<grid fixedLayout="true">
						<columns>
							<column width="25%" />
							<column width="75%" />
						</columns>
						<rows>
							<row>
								<label id="lbNit" value="${c:l('label.nit')}" />
								<textbox id="txtNit" maxlength="20" width="150px"
									value="@{winEditarTransportadora$composer.transportadora.nit}" />
							</row>				
							<row>
								<label value="${c:l('label.razaoSocial')}" />
								<textbox id="txtNome" maxlength="255" width="95%" 
									value="@{winEditarTransportadora$composer.transportadora.nomeTransportadora}"
									use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
							</row>
							<row>
								<label value="${c:l('label.email')}" />
								<textbox id="txtEmail" maxlength="150" width="95%" 
									value="@{winEditarTransportadora$composer.transportadora.email}" />
							</row>
							<row >
								<label value="${c:l('label.classePagamento')}" />
								<radiogroup id="rdgClassePagamento" >
									<radio id="rdgContado" label="${c:l('label.classePagamento.contado')}" value="0"/>
									<radio id="rdgCredito" label="${c:l('label.classePagamento.credito')}" value="1" style="padding: 20px; "/>
								</radiogroup>
							</row>
						</rows>
					</grid>				
				</tabpanel>
				
				<!-- Convenio -->
				<tabpanel id="tbConvenio" >
					<grid fixedLayout="true">
						<columns>
							<column width="25%" />
							<column width="75%" />
						</columns>
						<rows>
						
							<row>
								<label id="lbNumConvenio" value="${c:l('label.numConvenio')}" />
								<textbox id="txtNumConvenio" maxlength="20" width="150px" 
									value="@{winEditarTransportadora$composer.convenio.numConvenio}" />
							</row>
											
							<row>
								<label value="${c:l('label.descricao')}" />
								<textbox id="txtNomeConvenio" maxlength="255" width="95%" 
									value="@{winEditarTransportadora$composer.convenio.nomeConvenio}"
									use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
							</row>
							
							<row>
								<label id="lbDataInicial" value="${c:l('label.dataInicial')}" />
								<datebox id="datInicial" width="100px"
									format="dd/MM/yyyy" maxlength="10"
									value="@{winEditarTransportadora$composer.convenio.dataInicial}" />
							</row>
							
							<row>
								<label id="lbDataFinal" value="${c:l('label.dataFinal')}" />
								<datebox id="datFinal" width="100px"
									format="dd/MM/yyyy" maxlength="10"
									value="@{winEditarTransportadora$composer.convenio.dataFinal}" />
							</row>
						 	
							<row>
								<label id="lbValor" value="${c:l('label.valor')}" />
								<decimalbox id="txtValor" maxlength="15" format="0.00"
									constraint="no negative" width="100px" 
									value="@{winEditarTransportadora$composer.convenio.valor}" />
							</row>	
							
							<row >
								<label value="${c:l('label.tipoConvenio')}" />
								<radiogroup id="rdgTipoConvenio" >
									<radio id="rdgConvenioPrePago" label="${c:l('label.tipoConvenio.prePago')}" value="0"/>
									<radio id="rdgConvenioCredito" label="${c:l('label.tipoConvenio.credito')}" value="1" style="padding: 20px; "/>
									<radio id="rdgVista" label="${c:l('label.tipoConvenio.vista')}" value="2" style="padding: 20px; "/>
								</radiogroup>
							</row>
						</rows>
					</grid>
				</tabpanel>

				<!-- Tarifa -->
				<tabpanel id="tbTarifa" >
					<grid fixedLayout="true">
						<columns>
							<column width="25%" />
							<column width="75%" />
						</columns>
						<rows>							
							<row>
								<label value="${c:l('label.origem')}" />
								<combobox id="cmbOrigem" width="95%" 
									constraint="no empty" autodrop="false" mold="rounded" buttonVisible="true"
									use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" />
							</row>
							<row>
								<label value="${c:l('label.destino')}" />
								<combobox id="cmbDestino" width="95%" 
									constraint="no empty" autodrop="false" mold="rounded" buttonVisible="true"
									use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" />
							</row>
							<row>
								<label value="${c:l('label.tarifa')}" />
								<decimalbox id="txtTarifa" width="120px"
									constraint="no negative, no zero, no empty" format="0.00"/>
							</row>
							<row id="rowIncluir" spans="2" align="middle">
								<hbox >
									<button id="btnAdicionarTarifa"
										height="20" image="/gui/img/add.png" width="35px"
										tooltiptext="${c:l('tooltiptext.btnIncluir')}" />

									<button id="btnRemoverTarifa"
										height="20" image="/gui/img/remove.png" width="35px"
										tooltiptext="${c:l('tooltiptext.btnRemover')}" />									
								</hbox>
							</row>
						</rows>
					</grid>
					<paging id="pagingTarifasConvenio" pageSize="20" />
					<listbox id="tarifaConvenioList"
						use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
						multiple="false">
						<listhead sizable="true">
							<listheader id="lbOrigem" image="/gui/img/create_doc.gif"
								label="${c:l('label.origem')}"
								sort="auto(origenId)" />
							<listheader id="lbDescOrigem" image="/gui/img/create_doc.gif"
								label="${c:l('label.descricao')}"
								sort="auto(descOrigen)" />
							<listheader id="lbDestino" image="/gui/img/create_doc.gif"
								label="${c:l('label.destino')}"
								sort="auto(destinoId)" />
							<listheader id="lbDescDestino" image="/gui/img/create_doc.gif"
								label="${c:l('label.descricao')}"
								sort="auto(descDestino)" />
							<listheader id="lbTarifa" image="/gui/img/create_doc.gif"
								label="${c:l('label.tarifa')}"
								sort="auto(tarifa)" />
						</listhead>
					</listbox>
				</tabpanel>
			</tabpanels>
		</tabbox>
	</window>
</zk>