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

	<!-- Taxe Barlad -->
	<screen id="account" type="numeric" title="CNP / CIF">
		<fields>
			<text-field id="id1" keyboard="Digital" max-len="13" title="Introduceti CNP / CIF">
				<validator type="regex">
					<rules>
						<rule regex="^[0-9]{4,13}"/>
					</rules>
				</validator>
				<help>
					<![CDATA[<html>]]>
				</help>
			</text-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<set key="service_name" value="Taxe_Barlad"/>
				<set key="action_type" value="check_person"/>
				<online-request type="default" function="check_person" params="id1,service_name,action_type">
					<actions>
						<action type="success">
							<if condition="code == 0">
								<then>
									<if condition="pType == 0">
										<then>
											<goto target="select_taxa_PF"/>
										</then>
										<else>
											<goto target="select_taxa_PJ"/>
										</else>
									</if>
								</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="Lista taxelor este inaccesibila momentan" 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>

	<screen id="select_taxa_PF" type="selector/bigbutton" title="Taxa PF">
		<fields>
			<selector-field id="categoria" message="Selectati categoria" title="Selectati categoria">
				<items type="static">
					<item value="0" title="Taxe judecatorie (timbru)"/>
					<item value="1" title="Taxe stare civila"/>
					<item value="2" title="Impozite si taxe PF"/>
					<item value="3" title="Taxe evidenta populatiei"/>
					<item value="4" title="Impozite si taxe PJ"/>
				</items>
			</selector-field>
		</fields>
		<actions>
			<action type="Next" title="Next">
				<switch value="categoria">
					<case value="0"><goto target="taxe_judecatorie"/></case>
					<case value="1"><goto target="taxe_civila"/></case>
					<case value="2"><goto target="taxe_impozite"/></case>
					<case value="3"><goto target="taxe_buletin"/></case>
					<case value="4"><goto target="select_taxa_PJ"/></case>
					<default/>
				</switch>
			</action>
			<action type="Prev" title="Prev">
				<goto target="account"/>
			</action>
			<action type="Exit" title="Exit">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>

	<screen id="taxe_civila" type="selector/bigbutton" title="Taxa PF">
		<fields>
			<selector-field id="categoria_civil" message="Selectati categoria" title="Selectati categoria">
				<items type="static">
					<item value="0" title="Nastere"/>
					<item value="1" title="Casatorie"/>
					<item value="2" title="Livret de familie"/>
					<item value="3" title="Divort"/>
					<item value="4" title="Deces"/>
					<item value="5" title="Altele"/>
				</items>
			</selector-field>
		</fields>
		<actions>
			<action type="Next" title="Next">
				<switch value="categoria_civil">
					<case value="0"><goto target="taxe_nastere"/></case>
					<case value="1"><goto target="taxe_casatorie"/></case>
					<case value="2"><goto target="taxe_livret"/></case>
					<case value="3"><goto target="taxe_divort"/></case>
					<case value="4"><goto target="taxe_deces"/></case>
					<case value="5"><goto target="taxe_altele"/></case>
					<default/>
				</switch>
			</action>
			<action type="Prev" title="Prev">
				<goto target="select_taxa_PF"/>
			</action>
			<action type="Exit" title="Exit">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_judecatorie" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="197" value-title="Taxa informare PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="243" value-title="Taxa judiciara de timbru PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="select_taxa_PF"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_impozite" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>

				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="927" value-title="Taxa Eliberare Duplicat PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="109" value-title="Taxa de urgenta pentru eliberare certificate de atestare fiscala pentru care se solicita eliberarea in acceiasi zi PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="968" value-title="Taxa viza fise de inmatriculare/ contracte de instrainare-dobandire a mijloacelor de transport (facturi sau documente similare), in termen de 48 de ore PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="969" value-title="Taxa eliberare orice tip de adeverinta PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="970" value-title="Taxa eliberare istoric fiscal PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="259" value-title="Taxa impunere imobile (facturi sau documente similare, in termen de 48 de ore) PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="select_taxa_PF"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_buletin" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="78" value-title="Contravaloare carte identitate PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_nastere" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="100" value-title="Eliberare duplicat certificate nastere PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="1931" value-title="Eliberare duplicat certificate nastere in regim de urgenta PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_casatorie" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="143" value-title="Eliberare duplicat certificat casatorie PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="1930" value-title="Eliberare duplicat certificat casatorie in regim de urgenta PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="316" value-title="Taxa casatorie PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="317" value-title="Taxa casatorie in afara sediului SPCLEP (Primaria Mun. Barlad , Bisericile de pe raza Mun. Barlad) PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_livret" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="144" value-title="Eliberare livret de familie PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="1926"
							  value-title="Eliberare livret familie in regim de urgenta PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_divort" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="201" value-title="Eliberare duplicat certificat de divort PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="321" value-title="Taxa divort PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_deces" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="101" value-title="Eliberare duplicate certificate deces PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="315" value-title="Eliberare duplicat certificat de deces in regim de urgenta PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="taxe_altele" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="323" value-title="Taxa schimbare de nume pe cale administrativa PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="324" value-title="Transcrierea, la cerere, a actelor de stare civila intocmite in strainatate peste termenul de 6 luni PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="325" value-title="Taxa eliberare, din arhiva, de fotocopii ale inscrisurilor care au stat la baza intocmirii actelor de stare civila-constatator de nastere PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="69" value-title="Anexa 24 privind succesiunea PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="306" value-title="Eliberare extras multilingv PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="307" value-title="Eliberare extras multilingv in regim de urgenta PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="308" value-title="Formular standard multilingv PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="309" value-title="Transcrierea, la cerere, a actelor de stare civila intocmite in strainatate PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="310" value-title="Rectificarea pe cale administrativa, la cerere, a actelor de stare civila PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="311" value-title="Intocmirea ulterior a actelor de stare civila/reconstituire acte de stare civila PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="312" value-title="Anexa 9, E401, componenta familiei PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="313" value-title="Inscrierea , la cerere, a mentiunilor, pe marginea actelor de stare civila, cu privire la schimbarea numelui in strainatate, a desfacerii casatoriei in strainatate, etc. PF" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="314" value-title="Taxa pentru acces cu aparatura foto-video la oficiere casatorii PF" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="taxe_civila"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="select_taxa_PJ" type="table" title="Alege taxa">
		<fields>
			<table-field id="tf" title="Tabel" read-only="false">
				<columns>
					<column key="taxaId" title="Tip taxa" width="0.8"/>
				</columns>
				<items>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="197" value-title="Taxa informare PJ" />
						<cell key="valoareImplicita" key-title="Pret taxa" value="100" key-value="100" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="243" value-title="Taxa judiciara de timbru PJ" />
						<cell key="valoareImplicita" key-title="Pret taxa" value="0" key-value="0" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="109"
							  value-title="Taxa de urgenta pentru eliberare certificate de atestare fiscala pentru care se solicita eliberarea in acceiasi zi PJ" />
						<cell key="valoareImplicita" key-title="Pret taxa" value="30" key-value="30" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="927" value-title="Taxa Eliberare Duplicat PJ" />
						<cell key="valoareImplicita" key-title="Pret taxa" value="0" key-value="0" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="968"
							  value-title="Taxa viza fise de inmatriculare/ contracte de instrainare-dobandire a mijloacelor de transport (facturi sau documente similare), in termen de 48 de ore PJ" />
						<cell key="valoareImplicita" key-title="Pret taxa" value="50" key-value="50" />
					</item>
					<item>
						<cell key="taxaId" key-title="Tip taxa" value="259"
							  value-title="Taxa impunere imobile (facturi sau documente similare, in termen de 48 de ore) PJ" />
						<cell key="valoareImplicita" key-title="Pret taxa" value="50" key-value="50" />
					</item>
				</items>
			</table-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="get_price"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="select_taxa_PF"/>
			</action>
			<action type="Exit" title="Pagina principala">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>

	<screen type="void" decor="button" title="" id="get_price">
		<fields/>
		<actions>
			<action type="Next" title="Verifica pretul">
				<set key="service_name" value="Taxe_Barlad"/>
				<set key="action_type" value="get_price"/>
				<set key="service_name" value="Taxe_Barlad"/>
				<set key="action_type" value="get_price"/>
				<online-request type="default" function="get_price" params="id1,taxaId,service_name,action_type">
					<actions>
						<action type="success">
							<if condition="code == 0">
								<then>
									<if condition="price == 0">
										<then>
											<goto target="set_price"/>
										</then>
										<else>
											<if condition="pId == 0">
												<then>
													<goto target="set_name"/>
												</then>
												<else>
													<goto target="confirm"/>
												</else>
											</if>
										</else>
									</if>
								</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="Serverul nu raspunde momentan. Incercati mai tarziu" 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="account"/>
			</action>
			<action type="Exit" title="Acasa">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="set_name" type="group" title="Nume">
		<fields>
			<text-field id="nume" keyboard="any:[ro,en,symb]:lower:true" max-len="64" message="Nume si prenume" title="Nume si prenume" default="">
				<validator type="regex">
					<rules>
						<rule regex="[a-zA-Z .]{5,64}"/>
					</rules>
				</validator>
				<help>
					<![CDATA[<html><center>Introduceti numele si prenumele persoanei pentru care faceti plata]]>
				</help>
			</text-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<goto target="confirm"/>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="account"/>
			</action>
			<action type="Exit" title="Acasa">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>
	<screen id="set_price" type="group" title="Nume">
		<fields>
			<text-field id="price" keyboard="any:[ro,en,symb]:lower:true" max-len="10" message="Suma" title="Suma" default="">
				<validator type="regex">
					<rules>
						<rule regex="[1-9]\d*"/>
					</rules>
				</validator>
				<help>
					<![CDATA[<html><center>Introduceti suma pe care doriti sa o platiti]]>
				</help>
			</text-field>
		</fields>
		<actions>
			<action type="Next" title="Inainte">
				<if condition="pId == 0">
					<then>
						<goto target="set_name"/>
					</then>
					<else>
						<goto target="confirm"/>
					</else>
				</if>
			</action>
			<action type="Prev" title="Inapoi">
				<goto target="account"/>
			</action>
			<action type="Exit" title="Acasa">
				<goto target="exit"/>
			</action>
		</actions>
	</screen>

	<screen id="confirm" type="confirm" title="Confirmare">
		<fields list="id1,taxaId,nume,price"/>
		<actions>
			<action type="Next" title="Achita">
				<set-sum from="price" type="units"/>
				<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>
