<scenario begin="generic_info">

	<screen type="Sum" sum="sum-important"/>
	
	<screen type="Void" id="generic_info">
	    <actions>
           <action type="Next" title="INAINTE">
				<set key="#engie" key-title="engie" value="file://generic_info.html" value-title=""/>
				<goto target="engie_start"/>                 	
			</action>
		</actions>
	</screen>
	
	<screen type="Info" title="PRIN CONTINUAREA TRANZACTIEI:" id="engie_start">
		<field key="#engie" />
        <actions>
            <action type="Next" title="CONFIRMARE">
                <goto target="input_code"/> 
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="previos"/>	                
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>
	
    <screen type="numeric/comunal" title="INTRODUCETI CODUL DE CLIENT" id="input_code" sound="input_payment_indent.mp3">
        <fields>
            <text-field id="id1" title="COD CLIENT" max-len="12" keyboard="Digital">
                <validator type="regex">
                    <rules>
                        <rule regex="^\d{12}$"/>
                    </rules>
				</validator>
                <formatter type="regex">
                    <rules default="**** **** ****"/>
                </formatter>                
                <help>file://helps/engie_client.png</help>
            </text-field>
        </fields>
        <actions>
            <action type="Next" title="INAINTE">
                <goto target="input_bill"/>                
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="previos"/>
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>
	
    <screen type="numeric/comunal" title="INTRODUCETI NUMARUL DE FACTURA" id="input_bill" sound="input_payment_indent.mp3">
        <fields>
            <text-field id="id2" title="NUMAR FACTURA" max-len="11" keyboard="Digital">
                <validator type="regex">
                    <rules>
                        <rule regex="^\d{6,11}$"/>
                    </rules>
				</validator>                
                <help>file://helps/engie_factura.png</help>
            </text-field>
        </fields>
        <actions>
            <action type="Next" title="INAINTE">
                <goto target="input_phone"/>                
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="input_code"/>
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>
	
    <screen type="numeric/info" title="INTRODUCETI NUMARUL DE TELEFON" id="input_phone" sound="input_phone.mp3">
        <fields>
            <text-field id="id3" title="TELEFON" max-len="10" prefix="07" keyboard="Digital">
                <validator type="regex">
                    <rules>
                        <rule regex="^\d{10}$"/>
                    </rules>
				</validator>                
                <help>file://helps/smith_phone.png</help>
            </text-field>
        </fields>
        <actions>
            <action type="Next" title="INAINTE">
                <goto target="confirm"/>                
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="input_bill"/>
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>
    
    <screen type="confirm/comunal" title="VERIFICATI CORECTITUDINEA DATELOR INTRODUSE" id="confirm" sound="validate_phone.mp3" message="&lt;html&gt;&lt;b&gt;&lt;center&gt;Apasati CONFIRMARE pentru a avansa.&lt;br&gt;Apasati INAPOI pentru a corecta datele.">
	<fields list="id1,id2"/>
        <actions>
            <action type="Next" title="CONFIRMARE">
				<set key="sum" value="4"/>
                <online-request type="default" function="checkPaymentRequisites" params="id1,id2,id3">
                    <actions>
                        <action type="success">
							<clear keys="sum"/>
                            <goto target="pay"/>
                        </action>
                        <action type="error">
                            <dialog type="Info" title="Error" message="Datele introduse sunt gresite" timeout="10" default="okay">
                                <actions>
                                    <action type="okay" title="OK">
										<clear keys="sum"/>
                                        <goto target="input_code"/>
                                    </action>                                            
                                </actions>
                            </dialog>                            
                        </action>
                        <action type="exception">
                            <dialog type="Info" title="Error" message="Nu exista conexiune cu serverul" timeout="10" default="okay">
                                <actions>
                                    <action type="okay" title="OK">
										<clear keys="sum"/>
                                        <cancel/>
                                    </action>                                            
                                </actions>
                            </dialog>
                        </action>
                    </actions>
                </online-request>          
            </action>
            <action type="Prev" title="INAPOI">
                <goto target="input_phone"/>	                
            </action>
            <action type="Exit" title="MENIU">
                <goto target="exit"/>
            </action>
        </actions>
    </screen>      
    
</scenario>