<hbox vflex="1">
	<listbox
		vflex="1"
		hflex="7"
		itemRenderer="@load(vm.requirementsItemRenderer)"
		selectedItem="@bind(vm.dataBean)"
		model="@load(vm.dataList)"
		onAfterRender="@command('afterRender')"
		selectedIndex="@bind(vm.selIndex)">
		<listhead menupopup="auto">
			<listheader
				label="${labels.StudentProjectAbr}"
				sort="auto(project)"
				hflex="5" />
			<listheader
				label="${labels.RequirementsGridNumberSerie}"
				sort="czech(numser)"
				hflex="7" />
			<listheader
				label="${labels.RequirementsGridReqDate}"
				sort="auto(reqDate)"
				hflex="13" />
			<listheader
				label="${labels.RequirementsGridCenter}"
				sort="auto(centre.fullName)"
				hflex="15" />
			<listheader
				label="${labels.RequirementsGridDeliveryDate}"
				sort="auto(reqDate)"
				hflex="13" />
			<listheader
				label="${labels.Amount}"
				sort="auto(sumTotal)"
				align="right"
				hflex="10" />
			<listheader
				label="${labels.RequirementsGridDescription}"
				sort="czech(description)"
				hflex="20" />
			<listheader
				sort="auto(ownedBy.fullName)"
				label="${labelsownedBy}"
				hflex="15" />
		</listhead>
		<auxhead
			sclass="category-center"
			visible="@load(vm.filter)">
			<auxheader>
				<div sclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<checkbox
							label="${labels.StudentProjectAbr}"
							checked="@bind(vm.filterTemplate.project)"
							onClick="@command('doFilter')" />
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div sclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<textbox
							value="@bind(vm.filterTemplate.numser)"
							instant="true"
							onChange="@command('doFilter')"
							maxlength="@load(vm.lengthText)"
							sclass="find-grid-textbox" />
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div sclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<datebox
							value="@bind(vm.filterTemplate.reqDate)"
							format="${labels.DateFormat}"
							instant="true"
							onChange="@command('doFilter')"
							sclass="find-grid-textbox" />
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div sclass="find-grid-cell">
					<combobox
						ctrlKeys="${labels.HandleComboKeyFilter}"
						onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
						onChange="@command('doFilter')"
						model="@load(vm.centres)"
						readonly="true"
						width="100%"
						selectedItem="@bind(vm.filterTemplate.centre)">
						<template name="model">
							<comboitem label="@load(each.fullName)" />
						</template>
					</combobox>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div sclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<datebox
							value="@bind(vm.filterTemplate.deliveryDate)"
							format="${labels.DateFormat}"
							instant="true"
							onChange="@command('doFilter')"
							sclass="find-grid-textbox" />
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div sclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<textbox
							value="@bind(vm.filterTemplate.sumTotal) @converter(vm.bigDecimalConverter)"
							instant="true"
							onChange="@command('doFilter')"
							maxlength="@load(vm.lengthText)"
							sclass="find-grid-textbox" />
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div sclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<textbox
							value="@bind(vm.filterTemplate.description)"
							instant="true"
							onChange="@command('doFilter')"
							maxlength="@load(vm.lengthDescription)"
							sclass="find-grid-textbox" />
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
			<auxheader>
				<div zclass="find-grid-cell">
					<div sclass="find-grid-divtextbox">
						<combobox
							ctrlKeys="${labels.HandleComboKeyFilter}"
							onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
							onChange="@command('doFilter')"
							width="100%"
							selectedItem="@bind(vm.filterTemplate.ownedBy)"
							model="@load(vm.allUsers)"
							readonly="true">
							<template name="model">
								<comboitem label="@load(each.fullName)" />
							</template>
						</combobox>
					</div>
					<div sclass="find-grid-img">
						<image src="/img/funnel.png" />
					</div>
				</div>
			</auxheader>
		</auxhead>
		<template name="model">
			<listitem>
				<listcell label="@load(each.project) @converter(vm.standardBoolConverter)" />
				<listcell label="@load(each.numser)" />
				<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
				<listcell label="@load(each.centre.fullName)" />
				<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
				<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
				<listcell label="@load(each.description)" />
				<listcell label="@load(each.ownedBy.fullName)" />
			</listitem>
		</template>
	</listbox>
	<div hflex="3">
		<vbox>
       <include src="/main/approveStatus.zul" />
       
       <hbox visible="@load(not empty vm.invoicedAmount)">
         <label value="${labels.RequirementInvoicedAmount}"/>
         <label value="@load(vm.invoicedAmount) @converter(vm.bigDecimalConverter)"/>
       </hbox>
       
     </vbox>
	</div>
</hbox>
