<?xml version="1.0" encoding="utf-8" ?>
<c:Screen xmlns:c="BitMobile.Controls" xmlns:s="BitMobile.ValueStack" xmlns:d="DefaultScope" StyleSheet="Visits.css">

	<s:Push Id="search" Value="$param1" />
	<s:Push Id="orders" Value="$GetOrderList()"></s:Push>

	<c:DockLayout>


		<c:DockLayout CssClass="top_navigator">
			<c:HorizontalLayout Id="btnMenu" CssClass="btn_menu" OnEvent="Back" OnClickAction="$Workflow.DoRollback()">
				<c:Image CssClass="menuIcon" />
			</c:HorizontalLayout>
			<c:Button Id="btnForward" Text="" CssClass="btn_forward" />
			<c:HorizontalLayout>
				<c:TextView Text="#orders#" />
			</c:HorizontalLayout>
		</c:DockLayout>
		<c:HorizontalLine />


		<c:HorizontalLayout Id="btnAdd" CssClass="bottom_btn" OnEvent="Back" OnClickAction="$DoAction(Create)">
			<c:TextView Text="#add#"></c:TextView>
		</c:HorizontalLayout>
		<c:HorizontalLine CssClass="b_line" />


		<c:ScrollView Id="grScrollView">
			<c:HorizontalLayout CssClass="margin_top"></c:HorizontalLayout>
			<c:HorizontalLine />

			<s:Iterator Id="order" Value="$orders">

				<s:Push Id="checkedNumber" Value="$AssignNumberIfNotExist($order.Number)"></s:Push>

				<c:HorizontalLayout CssClass="grid" OnClickAction="$DoAction(Select,$order.Outlet,null,$order.Id)">
					<s:If Test="$OrderCanceled($order.Status)">
						<c:Image CssClass="red_mark"></c:Image>
					</s:If>
					<s:Else>
						<c:VerticalLayout CssClass="no_mark"></c:VerticalLayout>
					</s:Else>
					<c:VerticalLayout>
						<c:TextView Text="$order.OutletDescription" CssClass="main_row"></c:TextView>
						<c:TextView Text="{$checkedNumber}, {$order.Date}" CssClass="description_row"></c:TextView>
					</c:VerticalLayout>
					<c:Image />
				</c:HorizontalLayout>
				<c:HorizontalLine />

			</s:Iterator>

		</c:ScrollView>

	</c:DockLayout>

</c:Screen>