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

	<!-- tradesilvania -->
	<screen id="account" type="group" title="Introduceti codul de client">
		<fields>
			<text-field id="id1" keyboard="any:[en,symb]:upper:true" max-len="15" message="Introduceti codul de client" title="Cod client">
				<validator type="regex">
					<rules>
						<rule regex="^[a-zA-Z0-9]{1,15}$"/>
					</rules>
				</validator>
				<help>
					<![CDATA[<html>Introduceti codul de client.]]>
				</help>
			</text-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<online-request type="default" function="get_bill" params="id1">
					<actions>
						<action type="success">
							<if condition="code == 0">
								<then>
									<goto target="confirm"/>
								</then>
								<else>
									<dialog type="Info" title="Eroare" message="Eroare: {0}" timeout="10" default="okay" mess-params="exception">
										<actions>
											<action type="okay" title="OK">
												<cancel/>
											</action>
										</actions>
									</dialog>
								</else>
							</if>
						</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="id1,client,min_plata,max_plata"/>
		<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>
