<?xml version="1.0" encoding="UTF-8"?>
<scenario begin="account">

	<!-- Client code or barcode -->
	<screen id="account" type="numeric" title="Reprezentant">
		<fields>
			<text-field id="id1" keyboard="Digital" max-len="8" message="Introduceti codul de client" title="Cod reprezentant">
				<validator type="regex">
					<rules>
						<rule regex="^[0-9]{7,8}$"/>
					</rules>
				</validator>
			</text-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<online-request type="default" function="adv-check" params="id1">
					<actions>
						<action type="success">
							<goto target="confirm"/>
						</action>
						<action type="error">
							<dialog type="Info" title="Eroare" message="A intervenit o eroare, va rugam sa incercati din nou" timeout="10" default="okay">
								<actions>
									<action type="okay" title="OK">
										<cancel/>
									</action>
								</actions>
							</dialog>
						</action>
					</actions>
				</online-request>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="previous"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>

	<!-- Confirm -->
	<screen id="confirm" type="confirm" title="Confirmare">
		<fields list="reprezentant"/>
		<actions>
			<action type="Next" title="Achita">
				<goto target="pay"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="account"/>
			</action>
			<action type="Exit" title="Acasa">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
</scenario>
