*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="configurare.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS buton_optiuni AS commandbutton 
 	*< CLASSDATA: Baseclass="commandbutton" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<DefinedPropArrayMethod>
		*p: culoare_activ
		*p: culoare_inactiv
	*</DefinedPropArrayMethod>

	*<PropValue>
		BackColor = 255,255,255
		Caption = "Command1"
		culoare_activ = RGB(217,241,255)
		culoare_inactiv = rgb(192,192,192)
		ForeColor = 0,64,128
		Height = 27
		Name = "buton_optiuni"
		Width = 84
	*</PropValue>
	
	PROCEDURE MouseEnter
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		
		this.BackColor=RGB(217,241,255)
		
			
			
	ENDPROC

	PROCEDURE MouseLeave
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		
		IF TYPE('this.Parent.activecontrol') <> 'O' OR  this.Parent.activecontrol.Name != this.name
			this.BackColor = RGB(255,255,255)
		ENDIF
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_gestiuni_config_old AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_gestiuni_config"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		
		If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
			Return .F.
		Endif
		
		IF INLIST(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
			lcnom = [nom_gestiuni]	
			lc_camp_id = [id_gestiune]
			lc_copil_lookup = [vrul]
			lc_camp_id_lookup = [id_gestiune]
			lc_copil_del = [gest_coresp_grupe_gestiuni]
			lc_camp_id_del = [id_gestiune]	
		*!*		lcnom = gcS + ".nom_gestiuni"
		*!*		lcamp = "nom_gestiuni.id_gestiune"
		*!*		lclook = gcS + ".rul"
		*!*		lclookid = "rul.id_gestiune"
		ENDIF 
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcnume_gestiune = Nvl(STRTRAN(Alltrim(Upper(toRec.nume_gestiune)),['],['']),"")	
			lccgest = Nvl(UPPER(ALLTRIM(toRec.cgest)),"")
			lccont = Nvl(ALLTRIM(toRec.cont),"")	
			lcacont = Nvl(ALLTRIM(toRec.acont),"")
			lcnr_pag = Nvl(ALLTRIM(STR(toRec.nr_pag)),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")
			*!* 22.02.2010
			lcid_sucursala = IIF(ISNULL(toRec.id_sucursala), "", ALLTRIM(STR(toRec.id_sucursala)))
			lcid_responsabil = IIF(ISNULL(toRec.id_responsabil), "", ALLTRIM(STR(toRec.id_responsabil))) 
			*!* 22.02.2010 ^	
			*!* 24.02.2010
			lcacont_cheltuiala = Nvl(ALLTRIM(toRec.acont_cheltuiala),"")	
			lcacont_adaos = Nvl(ALLTRIM(toRec.acont_adaos),"")		
			*!* 24.02.2010 ^
		Endif
		
		Do Case
		*!*	modificare	19.08.2008
			Case lcActiune = "INSERT"
			lcSql = [begin pack_def.adauga_gestiune('] + lcnume_gestiune + [','] + lccgest + [','] + lccont + [',] + lcnr_pag + [,] + ;
				['] + lcacont +  [',] + lcinactiv +[,]+lcid_sucursala+ [,] + lcid_responsabil + [); end;]
		*!*			lcSql = [begin nomgestinsproc('] + gcS+ [','] + lcnume_gestiune + [','] + lccgest +;
		*!*					[','] + lcont + [','] + lacont + [',] + lcnr_pag + [,] + lcinactiv + [); end;]
		*!*	*!*			lcSql = [INSERT INTO ] + gcS + [.nom_gestiuni (nume_gestiune,ngest,cgest,cont,acont,nr_pag,inactiv) VALUES ('] +;
		*!*	*!*					lcnume_gestiune + [',] + lcngest + [,'] + lccgest + [','] + lcont + [','] +;
		*!*	*!*					lacont + [',] + lcnr_pag + [,] + lcinactiv + [)]
		
			Case lcActiune = "UPDATE"
			lcSql = [begin pack_def.modifica_gestiune(] + lcId + [,'] + lcnume_gestiune + [','] + lccgest + [','] + lccont + ['] + ;
				[,] + lcnr_pag + [,'] + lcacont + [',] + lcinactiv +[,]+lcid_sucursala + [,] + lcId_responsabil + [); ] +;
				[end;]
		
		*!*			lcSql = [UPDATE ] + gcS + [.nom_gestiuni SET nume_gestiune = '] + lcnume_gestiune + ;
		*!*					[', cgest = '] + lccgest + [', cont = '] + lcont + ;
		*!*					[', acont = '] + lacont + [', nr_pag = ] + lcnr_pag + [,inactiv =] + lcinactiv +;
		*!*					[ where id_gestiune = ] + lcId 
		*!*	modificare	19.08.2008	^
			Case lcActiune = "DELETE"	
				lcSql = [begin NOM_COPIL_DELPROC('] + gcS + [','] + lcnom + [','] + lc_camp_id +;
						[',] + lcId + [,'] + lc_copil_lookup + [','] + lc_camp_id_lookup + [','] +;
						lc_copil_del + [','] + lc_camp_id_del + ['); end;]
		*!*			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
			
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_grupe AS _cusodatabase OF "..\..\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_grupe"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		
		If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
			Return .F.
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
			Return .F.
		Endif
		
		IF INLIST(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		*!*		lcnom = gcS + ".gest_nom_grupe"
		*!*		lcamp = "gest_nom_grupe.id_grupe"
		*!*		lclook = gcS + ".gest_coresp_util_grupe"
		*!*		lclookid = "gest_coresp_util_grupe.id_grupe"	
			lcnom = [gest_nom_grupe]	
			lc_camp_id = [id_grupe]
			lc_copil_lookup = [vgest_coresp_util_grupe]
			lc_camp_id_lookup = [id_grupe]
			lc_copil_del = [gest_coresp_grupe_gestiuni]
			lc_camp_id_del = [id_grupe]
		ENDIF 
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcnume_grupa = Nvl(STRTRAN(Alltrim(Upper(toRec.nume_grupa)),['],['']),"")	
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
			pnInactiv = NVL(toRec.inactiv,0)
			IF EMPTY(toRec.parent_id) OR ISNULL(toRec.parent_id)
				lcParentId = "NULL"
			ELSE 	
				lcParentId = NVL(TRANSFORM(toRec.parent_id),"")
			ENDIF 	
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = [INSERT INTO ] + gcS + [.gest_nom_grupe (nume_grupa, parent_id, inactiv) VALUES ('] +;
						lcnume_grupa + [',] + lcParentId + [,] + lcinactiv + [)]
		
			Case lcActiune = "UPDATE"
				lcSql = [UPDATE ] + gcS + [.gest_nom_grupe SET nume_grupa = '] + lcnume_grupa + ;
						[', inactiv = ] + lcInactiv + [, parent_id = ] + lcParentId + [ where id_grupe = ]  + lcId 
		*		WAIT WINDOW lcSql 
			Case lcActiune = "DELETE"
				lcSql = [begin NOM_COPIL_DELPROC('] + gcS + [','] + lcnom + [','] + lc_camp_id +;
						[',] + lcId + [,'] + lc_copil_lookup + [','] + lc_camp_id_lookup + [','] +;
						lc_copil_del + [','] + lc_camp_id_del + ['); end;]
		*!*				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] +;
		*!*				  lclook + [','] + lclookid + ['); end;]
					
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

	PROCEDURE salvare
		Lparameters toRec,tnId
		
		Private llSucces, lnSucces
		
		llSucces = .T.
		lnSucces = -1
		lcActiune = Upper(Alltrim(This.cactiune))
		lcMesaj = ''
		lcTitlu = ''
		Do Case
			Case lcActiune = "INSERT"
				lcMesaj = "Doriti sa adaugati inregistrarea?"
				lcTitlu = "Adaugare"
				
			Case lcActiune = "UPDATE"
				lcMesaj = "Doriti sa salvati modificarile?"
				lcTitlu = "Modificare"
				
			Case lcActiune = "DELETE"
				lcMesaj = "Doriti sa stergeti inregistrarea?"
				lcTitlu = "Stergere"
				
		ENDCASE
		
		lcimagine = [intreb.ico]
		lctip = [Intrebare]
		ofrm_intreb = CREATEOBJECT('frm_mesaj',lctitlu,lcimagine,lctip,lcmesaj)
		ofrm_intreb.show(1)
		RELEASE ofrm_intreb
		
		IF buton = 1
			PNIESIRE=1
			If This.validare()
		
				This.make_sql(toRec,tnId)
		
				lcSql = Upper(Alltrim(This.csql))
		
				llConditie = 'INSERT'$lcSql Or 'UPDATE'$lcSql Or 'DELETE'$lcSql Or 'BEGIN'$lcSql
		
				If llConditie
					lnSucces = goExecutor.oExecute(lcSql)
					If lnSucces < 0
		
						lcTextEroare = goExecutor.cEroare								
						
						Do Case
						CASE LIKE('*ORA-20???:*',lcTextEroare)
							lnPozi=At("ORA-20",lcTextEroare)+11
							lnPozf=At("ORA",lcTextEroare,2)
							lcMesaj=Substr(lcTextEroare,lnPozi,lnPozf-lnPozi)
							lcTitlu="Eroare"
																	
		*!*					Case "ORA-20000"$lcTextEroare
		*!*						lnPozi=At("ORA-20000",lcTextEroare)+11
		*!*						lnPozf=At("ORA",lcTextEroare,2)
		*!*						lcMesaj=Substr(lcTextEroare,lnPozi,lnPozf-lnPozi)
		*!*						lcTitlu="Eroare"
		*!*					Case "ORA-20001"$lcTextEroare
		*!*						lnPozi=At("ORA-20001",lcTextEroare)+11
		*!*						lnPozf=At("ORA",lcTextEroare,2)
		*!*						lcMesaj=Substr(lcTextEroare,lnPozi,lnPozf-lnPozi)
		*!*						lcTitlu="Eroare"
						Case lcActiune = "INSERT"
							lcMesaj = "Inregistrarea nu a fost adaugata." + Chr(13) + Chr(10) + lcTextEroare
							lcTitlu = "Adaugare"
						Case lcActiune = "UPDATE"
							lcMesaj = "Inregistrarea nu a fost modificata." + Chr(13) + Chr(10) + lcTextEroare
							lcTitlu = "Modificare"
						Case lcActiune = "DELETE"
							lcMesaj = "Inregistrarea nu a fost stearsa." + Chr(13) + Chr(10) + lcTextEroare
							lcTitlu = "Stergere"
						Endcase
						
						lcimagine = [info_c.ico]
						lctip = [Informare]
						ofrm_info = CREATEOBJECT([frm_mesaj],lcTitlu,lcimagine,lctip,lcMesaj)
						ofrm_info.show(1)
						RELEASE ofrm_info				
						llSucces = .F.
					ENDIF						
		
					If lnSucces >=1 And lcActiune = "DELETE"																																							
						lcTitlu = "Stergere"				
						lctip = [Informare]
						lcimagine = [info_c.ico]
						lcMesaj = "Inregistrarea a fost stearsa."
						ofrm_mesaj = CREATEOBJECT([frm_mesaj],lcTitlu,lcimagine,lctip,lcMesaj)
						ofrm_mesaj.show(1)
						RELEASE ofrm_mesaj				
					Endif
				Endif
		
			Endif
		
		Else
			PNIESIRE=2
		Endif
		
		
		Return llSucces
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_config_tipuri_gestiuni AS _frmbase OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="List1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="List2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="List3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_LBBASE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_add" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_addall" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_rem" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_remall" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase4" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_liste
		*m: adauga_cont
		*m: scoate_cont
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 384
		Name = "frm_config_tipuri_gestiuni"
		Width = 339
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 344
		_shape2.Height = 29
		_shape2.Left = 277
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Configurare tipuri de gestiuni"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 10
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 307
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 9
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 31
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_LBBASE1' AS _lbbase WITH ;
		Caption = "Tipuri de gestiuni", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Left = 12, ;
		Name = "_LBBASE1", ;
		TabIndex = 11, ;
		Top = 38
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase2' AS _lbbase WITH ;
		Caption = "Conturi disponibile*", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Left = 12, ;
		Name = "_lbbase2", ;
		TabIndex = 12, ;
		Top = 188
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase3' AS _lbbase WITH ;
		Caption = "Conturi selectate", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Left = 216, ;
		Name = "_lbbase3", ;
		TabIndex = 13, ;
		Top = 188
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase4' AS _lbbase WITH ;
		AutoSize = .F., ;
		Caption = "* Tastati cea de-a doua cifra din contul dorit pentru pozitionare rapida", ;
		FontItalic = .T., ;
		FontSize = 8, ;
		Height = 32, ;
		Left = 14, ;
		Name = "_lbbase4", ;
		TabIndex = 14, ;
		Top = 352, ;
		Width = 307, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'but_add' AS cmd_buton WITH ;
		cpicturedown = add.bmp, ;
		cpictureup = add.bmp, ;
		Height = 25, ;
		Left = 156, ;
		Name = "but_add", ;
		Picture = ..\grafice\add.bmp, ;
		TabIndex = 4, ;
		Top = 216, ;
		Width = 25
		*< END OBJECT: ClassLib="_cmd_base.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'but_addall' AS cmd_buton WITH ;
		cpicturedown = addall.bmp, ;
		cpictureup = addall.bmp, ;
		Height = 25, ;
		Left = 156, ;
		Name = "but_addall", ;
		Picture = ..\grafice\addall.bmp, ;
		TabIndex = 5, ;
		Top = 246, ;
		Width = 25
		*< END OBJECT: ClassLib="_cmd_base.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Left = 278, ;
		Name = "But_reface1", ;
		TabIndex = 8, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'but_rem' AS cmd_buton WITH ;
		cpicturedown = remove.bmp, ;
		cpictureup = remove.bmp, ;
		Height = 25, ;
		Left = 156, ;
		Name = "but_rem", ;
		Picture = ..\grafice\remove.bmp, ;
		TabIndex = 6, ;
		Top = 276, ;
		Width = 25
		*< END OBJECT: ClassLib="_cmd_base.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'but_remall' AS cmd_buton WITH ;
		cpicturedown = remall.bmp, ;
		cpictureup = remall.bmp, ;
		Height = 25, ;
		Left = 156, ;
		Name = "but_remall", ;
		Picture = ..\grafice\remall.bmp, ;
		TabIndex = 7, ;
		Top = 308, ;
		Width = 25
		*< END OBJECT: ClassLib="_cmd_base.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'List1' AS listbox WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		Height = 120, ;
		Left = 12, ;
		Name = "List1", ;
		RowSource = "crsTipuri_gest", ;
		RowSourceType = 2, ;
		TabIndex = 1, ;
		Top = 56, ;
		Width = 313
		*< END OBJECT: BaseClass="listbox" />

	ADD OBJECT 'List2' AS listbox WITH ;
		Height = 134, ;
		Left = 12, ;
		Name = "List2", ;
		RowSource = "crsPlcont", ;
		RowSourceType = 2, ;
		Sorted = .F., ;
		TabIndex = 2, ;
		Top = 208, ;
		Width = 109
		*< END OBJECT: BaseClass="listbox" />

	ADD OBJECT 'List3' AS listbox WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		Height = 134, ;
		Left = 216, ;
		Name = "List3", ;
		RowSource = "crsCoresp", ;
		RowSourceType = 2, ;
		TabIndex = 3, ;
		Top = 206, ;
		Width = 109
		*< END OBJECT: BaseClass="listbox" />
	
	PROCEDURE actualizeaza_liste
					
		lcRowSource2 = this.list2.RowSource
		lcRowSource3 = this.list3.RowSource
		this.list2.RowSource = []
		this.list3.RowSource = []
		
		poCoresp.ca_baza1.afisare()	
		poPlcont.ca_baza1.afisare()	
		
		this.list2.RowSource = lcRowSource2
		this.list3.RowSource = lcRowSource3
		
		thisform.refresh
		*this.list2.refresh
		*this.list3.refresh
		
		
		
		
		  
		  
		
	ENDPROC

	PROCEDURE adauga_cont
		
		PARAMETERS tlToate
		
		select crsTipuri_gest
		lcId_tipgest = ALLTRIM(STR(id_tipgest))
		
		SELECT crsPlcont
		IF tlToate	
			SCAN
				lccont = ALLTRIM(cont)
				lcSql = [insert into ] + gcs + [.coresp_cont_tipgest (id_tipgest,cont) values ] +;
						[(] + lcId_tipgest + [,'] + lccont + [')]
				lnsucces = goExecutor.oExecute(lcSql)
				IF lnsucces < 0
					lcmesaj = goExecutor.cEroare 
					ofrm_er = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcmesaj)
					ofrm_er.show(1)
					RELEASE ofrm_er
					RETURN 
				ENDIF				
			ENDSCAN	
		ELSE
			lccont = ALLTRIM(this.list2.Value)
		*!*		lcSql = [insert into ] + gcs + [.coresp_cont_tipgest (id_tipgest,cont) values ] +;
		*!*				[(] + lcId_tipgest + [,'] + lccont + [')]
			lcSql = [insert into ] + gcs + [.coresp_cont_tipgest (id_tipgest,cont) values ] +;
					[(?lcId_tipgest,?lccont)]
			lnsucces = goExecutor.oExecute(lcSql)
			IF lnsucces < 0
				lcmesaj = goExecutor.cEroare 
				ofrm_er = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcmesaj)
				ofrm_er.show(1)
				RELEASE ofrm_er
				RETURN 
			ENDIF		
		ENDIF
		
		
	ENDPROC

	PROCEDURE do_reface
		lctitlu = [Refacere]
		lcimagine = [intreb.ico]
		lctip = [Intrebare]
		lcmesaj = [Aceasta operatie va sterge corespondenta actuala ] +;
				[dintre tipuri de gestiuni si conturi!Doriti sa continuati?]
		
		ofrm_mesaj = CREATEOBJECT([frm_mesaj],lctitlu,lcimagine,lctip,lcmesaj)
		ofrm_mesaj.show(1)
		RELEASE ofrm_mesaj
		
		IF buton=2
			RETURN 
		ENDIF 
		
		lcComanda1 = [delete from ] + gcS + [.coresp_cont_tipgest]
		lnSucces1 = goExecutor.oExecute(lcComanda1)
		IF lnSucces1 < 0
			lcMesaj = goExecutor.cEroare 
			ofrm_er = CREATEOBJECT([frm_mesaj],[Eroare],[exclam.ico],[Avertizare],lcmesaj)
			ofrm_er.show(1)
		    RELEASE ofrm_er
			RETURN	
		ENDIF
		
		lcComanda2 = [insert into ] + gcS + [.coresp_cont_tipgest  (select * from coresp_cont_tipgest)]
		lnSucces2 = goExecutor.oExecute(lcComanda2)
		IF lnSucces2 < 0
			lcMesaj = goExecutor.cEroare 
			ofrm_er = CREATEOBJECT([frm_mesaj],[Eroare],[exclam.ico],[Avertizare],lcmesaj)
			ofrm_er.show(1)
		    RELEASE ofrm_er
			RETURN	
		ENDIF
		
		lctitlu = [Refacere]
		lcimagine = [info_c.ico]
		lctip = [Informare]
		lcmesaj1 = [Refacerea s-a terminat!]
		
		ofrm_mesaj = CREATEOBJECT([frm_mesaj],lctitlu,lcimagine,lctip,lcmesaj1)
		ofrm_mesaj.show(1)
		RELEASE ofrm_mesaj
		
		this.actualizeaza_liste 
		this.refresh
	ENDPROC

	PROCEDURE Refresh
		
		ln2 = this.list2.ListCount
		ln3 = this.list3.ListCount
		this.but_add.Enabled = IIF(ln2 = 0,.f.,IIF(this.list2.ListIndex =0,.f.,.t.))
		this.but_addall.Enabled = IIF(ln2 = 0,.f.,.t.)
		this.but_rem.Enabled = IIF(ln3 = 0,.f.,IIF(this.list3.ListIndex =0,.f.,.t.))
		this.but_remall.Enabled = IIF(ln3 = 0,.f.,.t.)
	ENDPROC

	PROCEDURE scoate_cont
		
		
		PARAMETERS tlToate
		
		SELECT crsCoresp
		IF tlToate			
			lcSql = [update ] + gcs + [.coresp_cont_tipgest set sters = 1 where id_tipgest =?pnId_tipgest]
		ELSE	
			lcId_cct = ALLTRIM(STR(id_cct))
			lcSql = [update ] + gcs + [.coresp_cont_tipgest set sters = 1 where id_cct =] + lcId_cct							
		ENDIF
					
		lnsucces = goExecutor.oExecute(lcSql)
		IF lnsucces < 0
			lcmesaj = goExecutor.cEroare 
			ofrm_er = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcmesaj)
			ofrm_er.show(1)
			RELEASE ofrm_er
			RETURN 
		ENDIF		
		
		
		
	ENDPROC

	PROCEDURE but_add.Click
		thisform.adauga_cont(.f.)
		thisform.actualizeaza_liste 
		thisform.refresh
		
	ENDPROC

	PROCEDURE but_addall.Click
		thisform.adauga_cont(.t.)
		
		thisform.actualizeaza_liste 
		thisform.refresh
	ENDPROC

	PROCEDURE but_rem.Click
		thisform.scoate_cont(.f.) 
		thisform.actualizeaza_liste 
		thisform.refresh
	ENDPROC

	PROCEDURE but_remall.Click
		thisform.scoate_cont(.t.) 
		
		thisform.actualizeaza_liste 
		thisform.refresh
	ENDPROC

	PROCEDURE List1.InteractiveChange
		
		SELECT crsTipuri_gest
		pnId_tipgest = id_tipgest
		
		this.Parent.actualizeaza_liste
		
	ENDPROC

	PROCEDURE List2.InteractiveChange
		
		thisform.refresh
	ENDPROC

	PROCEDURE List2.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		
		IF INLIST(CHR(nKeyCode),'0','1','2','3','4','5','6','7','8','9')	
			SELECT crsPlcont
			LOCATE FOR SUBSTR(cont,2,1)  = CHR(nKeyCode)
			IF FOUND()
				this.Value = cont
			ENDIF	
			this.refresh
			
		ENDIF
		
	ENDPROC

	PROCEDURE List3.InteractiveChange
		
		thisform.refresh
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_gestiuni_grupe_utilizatori AS _frmbase OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Pagefr_config" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column3.Check2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1._lbbase2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.grd_grupe_coresp.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag1.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni_coresp" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni_coresp.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni_coresp.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni_coresp.Cnume_grupa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni_coresp.Cnume_grupa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cnume_gestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cnume_gestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.ccgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.ccgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cacont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cacont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Cnr_pag.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Cnr_pag.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cinactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cinactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cResponsabil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cResponsabil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cacont_cheltuiala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cacont_cheltuiala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cAcont_adaos.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cAcont_adaos.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cLucrare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.cLucrare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column16.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column16.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_gestiuni.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2._lbbase2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_grupe" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_grupe.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_grupe.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_grupe.Cnume_grupa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.grd_grupe.Cnume_grupa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2._lbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.cmd_add" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.cmd_add_all" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.cmd_rem" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.cmd_rem_all" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag2.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori.Cutilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori.Cutilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3._lbbase2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3._lbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.cmd_add" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.cmd_add_all" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.cmd_rem" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.cmd_rem_all" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_grupe" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_grupe.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_grupe.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_grupe.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_grupe.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori_coresp" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori_coresp.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori_coresp.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori_coresp.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.grd_utilizatori_coresp.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pagefr_config.pag3.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl_nom_caut" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shp_butoane" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copiaza1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_pagina
		*m: adauga_drept_acces
		*m: adauga_grupa
		*m: sterge_drept_acces
		*m: sterge_grupa
		*p: cordine
		*p: lasc
		*p: nidgestiune		&& id_gestiune curent - pentru revenirea dupa modificare/adaugare
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 2
		DoCreate = .T.
		Height = 431
		lasc = .T.
		Name = "frm_gestiuni_grupe_utilizatori"
		nidgestiune = 0
		Width = 775
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="nidgestiune" type="property" display="nIdGestiune"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "RESIZABLE,NOVERTICAL_RESIZE"
		_shape1.Top = 0
		_shape1.Width = 780
		_shape1.ZOrderSet = 0
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 743
		_shape2.Name = "_shape2"
		_shape2.Tag = "MOVABLE,NOVERTICAL_MOVE"
		_shape2.Top = 0
		_shape2.Width = 32
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		Lb_titlu_alb_b121.ZOrderSet = 2
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 744
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 9
		BUT_TERMIN1.Tag = "NOVERTICAL_MOVE,MOVABLE"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 3
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_copiaza1' AS but_copiaza WITH ;
		Left = 47, ;
		Name = "But_copiaza1", ;
		Top = 107
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Left = 136, ;
		Name = "But_excel1", ;
		TabIndex = 6, ;
		Top = 107, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Left = 77, ;
		Name = "But_modifica1", ;
		TabIndex = 4, ;
		Top = 107, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 17, ;
		Name = "But_nou1", ;
		TabIndex = 3, ;
		Top = 107, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Left = 106, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 107, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta' AS cmd_cauta WITH ;
		Left = 188, ;
		Name = "Cmd_cauta", ;
		TabIndex = 2, ;
		Top = 106, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lbl_nom_caut' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 15, ;
		Name = "lbl_nom_caut", ;
		TabIndex = 1, ;
		Top = 71, ;
		Width = 257, ;
		ZOrderSet = 7, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 81, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 173, ;
		Lb_simplu1.Caption = "Eticheta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Pagefr_config' AS pagefr_config WITH ;
		Anchor = 15, ;
		ErasePage = .T., ;
		Height = 402, ;
		Left = 0, ;
		Name = "Pagefr_config", ;
		TabIndex = 7, ;
		TabStretch = 0, ;
		Tag = "RESIZABLE", ;
		Top = 31, ;
		Width = 779, ;
		ZOrderSet = 4, ;
		pag1.BackColor = 255,255,255, ;
		pag1.Name = "pag1", ;
		pag2.Name = "pag2", ;
		pag3.Name = "pag3"
		*< END OBJECT: ClassLib="configurare.vcx" BaseClass="pageframe" />

	ADD OBJECT 'Pagefr_config.pag1._lbbase2' AS _lbbase WITH ;
		Caption = "Gestiuni corespunzatoare", ;
		Height = 18, ;
		Left = 397, ;
		Name = "_lbbase2", ;
		TabIndex = 2, ;
		Top = 69, ;
		Width = 150
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe' AS _grdrow WITH ;
		Anchor = 7, ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grd_grupe", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordSource = "crsGrupe", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Tag = "RESIZABLE,NOHORIZONTAL_RESIZE", ;
		Top = 87, ;
		Width = 378, ;
		Column1.ControlSource = "recno('crsGrupe')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 36, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "nume_grupa", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 157, ;
		Column3.Alignment = 2, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "inactiv", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.Sparse = .F., ;
		Column3.Width = 34, ;
		Column4.ColumnOrder = 3, ;
		Column4.ControlSource = "nume_parinte", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.Width = 113
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Grupa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column3.Check2' AS checkbox WITH ;
		Alignment = 1, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 38, ;
		Name = "Check2", ;
		Top = 32, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Grupa parinte", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 393, ;
		Name = "grd_grupe_coresp", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordSource = "crsGrupe_Gestiuni", ;
		RowHeight = 19, ;
		TabIndex = 3, ;
		Tag = "RESIZABLE", ;
		Top = 87, ;
		Width = 375, ;
		Column1.ControlSource = "recno('crsGrupe_Gestiuni')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 36, ;
		Column2.ControlSource = "cgest", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 114, ;
		Column3.ControlSource = "nume_gestiune", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.Width = 205, ;
		Column4.ControlSource = "nume_tip_gest", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.Width = 148
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Indicativ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire gestiune", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tipul gestiunii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag1.grd_grupe_coresp.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag1.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.pagefr_config.pag1.grd_grupe, ;
		Left = 299, ;
		Name = "Gridextra1", ;
		Top = 37
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Pagefr_config.pag2._lbbase1' AS _lbbase WITH ;
		Anchor = 8, ;
		Caption = "Grupele din care  nu face parte", ;
		Left = 599, ;
		Name = "_lbbase1", ;
		TabIndex = 3, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 71
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Pagefr_config.pag2._lbbase2' AS _lbbase WITH ;
		Anchor = 8, ;
		Caption = "Grupele din care face parte", ;
		Left = 391, ;
		Name = "_lbbase2", ;
		TabIndex = 3, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 71
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Pagefr_config.pag2.cmd_add' AS commandbutton WITH ;
		Anchor = 8, ;
		Caption = "<", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 564, ;
		Name = "cmd_add", ;
		TabIndex = 4, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 100, ;
		Width = 28
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag2.cmd_add_all' AS commandbutton WITH ;
		Anchor = 8, ;
		Caption = "<<", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 564, ;
		Name = "cmd_add_all", ;
		TabIndex = 5, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 133, ;
		Width = 28
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag2.cmd_rem' AS commandbutton WITH ;
		Anchor = 8, ;
		Caption = ">", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 564, ;
		Name = "cmd_rem", ;
		TabIndex = 6, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 166, ;
		Width = 28
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag2.cmd_rem_all' AS commandbutton WITH ;
		Anchor = 8, ;
		Caption = ">>", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 564, ;
		Name = "cmd_rem_all", ;
		TabIndex = 7, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 199, ;
		Width = 28
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 17, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grd_gestiuni", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsGestiuni", ;
		RowHeight = 19, ;
		TabIndex = 2, ;
		Tag = "RESIZABLE", ;
		Top = 87, ;
		Width = 378, ;
		Column1.ControlSource = "recno('crsGestiuni')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cnr_crt", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 34, ;
		Column2.ControlSource = "nume_gestiune", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cnume_gestiune", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 146, ;
		Column3.ControlSource = "cgest", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "ccgest", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 79, ;
		Column4.ControlSource = "cont", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "ccont", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 32, ;
		Column5.ColumnOrder = 5, ;
		Column5.ControlSource = "acont", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cacont", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 34, ;
		Column6.ColumnOrder = 8, ;
		Column6.ControlSource = "nume_tip", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Cnr_pag", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 144, ;
		Column7.ColumnOrder = 17, ;
		Column7.ControlSource = "inactiv", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cinactiv", ;
		Column7.ReadOnly = .T., ;
		Column7.Sparse = .F., ;
		Column7.Width = 38, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "sucursala", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cSucursala", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 181, ;
		Column9.ColumnOrder = 10, ;
		Column9.ControlSource = "denumire", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cResponsabil", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 169, ;
		Column10.ColumnOrder = 12, ;
		Column10.ControlSource = "sectie", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 137, ;
		Column11.ColumnOrder = 6, ;
		Column11.ControlSource = "acont_cheltuiala", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cacont_cheltuiala", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 59, ;
		Column12.ColumnOrder = 7, ;
		Column12.ControlSource = "acont_adaos", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cAcont_adaos", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 58, ;
		Column13.ColumnOrder = 11, ;
		Column13.ControlSource = "nrord", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cLucrare", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 142, ;
		Column14.ColumnOrder = 13, ;
		Column14.ControlSource = "gestionar", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 125, ;
		Column15.ColumnOrder = 14, ;
		Column15.ControlSource = "comisie_receptie1", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "Column15", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 113, ;
		Column16.ColumnOrder = 15, ;
		Column16.ControlSource = "comisie_receptie2", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "Column16", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 108, ;
		Column17.ColumnOrder = 16, ;
		Column17.ControlSource = "comisie_receptie3", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "Column17", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 136
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cacont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cacont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cAcont_adaos.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic 37x", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cAcont_adaos.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cacont_cheltuiala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic 60x", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cacont_cheltuiala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.ccgest.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Indicativ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.ccgest.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.ccont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.ccont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cinactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 10, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 28, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cinactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cLucrare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lucrare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cLucrare.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cnr_crt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cnr_crt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Cnr_pag.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tipul gestiunii", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Cnr_pag.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cnume_gestiune.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire gestiune", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cnume_gestiune.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sectie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column10.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Gestionar", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column14.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column15.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Receptie 1", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column15.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column16.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Receptie 2", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column16.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Receptie 3", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.Column17.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cResponsabil.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Responsabil", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cResponsabil.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cSucursala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni.cSucursala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni_coresp' AS _grdrow WITH ;
		Anchor = 13, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 390, ;
		Name = "grd_gestiuni_coresp", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordSource = "crsGrupe_Gestiuni", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Tag = "RESIZABLE,NOHORIZONTAL_RESIZE,MOVABLE,NOVERTICAL_MOVE", ;
		Top = 87, ;
		Width = 169, ;
		Column1.ControlSource = "recno('crsGrupe_Gestiuni')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.Width = 34, ;
		Column2.ControlSource = "nume_grupa", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Cnume_grupa", ;
		Column2.Width = 129
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni_coresp.Cnr_crt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni_coresp.Cnr_crt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni_coresp.Cnume_grupa.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire grupa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_gestiuni_coresp.Cnume_grupa.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_grupe' AS _grdrow WITH ;
		Anchor = 13, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		Left = 598, ;
		Name = "grd_grupe", ;
		Panel = 1, ;
		RecordSource = "crsGrupe", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE,RESIZABLE,NOHORIZONTAL_RESIZE", ;
		Top = 87, ;
		Width = 169, ;
		Column1.ControlSource = "recno('crsGrupe')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.Width = 34, ;
		Column2.ControlSource = "nume_grupa", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Cnume_grupa", ;
		Column2.Width = 129
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag2.grd_grupe.Cnr_crt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_grupe.Cnr_crt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.grd_grupe.Cnume_grupa.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire grupa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag2.grd_grupe.Cnume_grupa.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag2.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.pagefr_config.pag2.grd_gestiuni, ;
		Left = 299, ;
		Name = "Gridextra1", ;
		Top = 25
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Pagefr_config.pag3._lbbase1' AS _lbbase WITH ;
		Anchor = 2, ;
		Caption = "Grupe la care nu are acces", ;
		Left = 553, ;
		Name = "_lbbase1", ;
		TabIndex = 9, ;
		Top = 72, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Pagefr_config.pag3._lbbase2' AS _lbbase WITH ;
		Anchor = 2, ;
		Caption = "Grupe la care are acces", ;
		Left = 294, ;
		Name = "_lbbase2", ;
		TabIndex = 8, ;
		Top = 72, ;
		ZOrderSet = 1
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Pagefr_config.pag3.cmd_add' AS commandbutton WITH ;
		Anchor = 2, ;
		Caption = "<", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 515, ;
		Name = "cmd_add", ;
		TabIndex = 4, ;
		Tag = "", ;
		Top = 100, ;
		Width = 28, ;
		ZOrderSet = 3
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag3.cmd_add_all' AS commandbutton WITH ;
		Anchor = 2, ;
		Caption = "<<", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 515, ;
		Name = "cmd_add_all", ;
		TabIndex = 5, ;
		Tag = "", ;
		Top = 133, ;
		Width = 28, ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag3.cmd_rem' AS commandbutton WITH ;
		Anchor = 2, ;
		Caption = ">", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 515, ;
		Name = "cmd_rem", ;
		TabIndex = 6, ;
		Tag = "", ;
		Top = 166, ;
		Width = 28, ;
		ZOrderSet = 5
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag3.cmd_rem_all' AS commandbutton WITH ;
		Anchor = 2, ;
		Caption = ">>", ;
		FontBold = .T., ;
		Height = 21, ;
		Left = 515, ;
		Name = "cmd_rem_all", ;
		TabIndex = 7, ;
		Tag = "", ;
		Top = 199, ;
		Width = 28, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Pagefr_config.pag3.grd_grupe' AS _grdrow WITH ;
		Anchor = 7, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 552, ;
		Name = "grd_grupe", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordSource = "crsGrupe", ;
		RowHeight = 19, ;
		TabIndex = 3, ;
		Tag = "RESIZABLE,NOHORIZONTAL_RESIZE", ;
		Top = 87, ;
		Width = 214, ;
		ZOrderSet = 7, ;
		Column1.ControlSource = "recno('crsGrupe')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 39, ;
		Column2.ControlSource = "nume_grupa", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 144
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag3.grd_grupe.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag3.grd_grupe.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag3.grd_grupe.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire grupa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag3.grd_grupe.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori' AS _grdrow WITH ;
		Anchor = 5, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grd_utilizatori", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordSource = "crsUtilizatori", ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Tag = "RESIZABLE,NOHORIZONTAL_RESIZE", ;
		Top = 87, ;
		Width = 278, ;
		ZOrderSet = 0, ;
		Column1.ControlSource = "recno('crsUtilizatori')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.Width = 46, ;
		Column2.ControlSource = "utilizator", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Cutilizator", ;
		Column2.Width = 199
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori.Cnr_crt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori.Cnr_crt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori.Cutilizator.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Utilizator", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori.Cutilizator.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori_coresp' AS _grdrow WITH ;
		Anchor = 7, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 280, ;
		HighlightStyle = 1, ;
		Left = 293, ;
		Name = "grd_utilizatori_coresp", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordSource = "crsGrupe_Utilizatori", ;
		RowHeight = 19, ;
		TabIndex = 2, ;
		Tag = "RESIZABLE,NOHORIZONTAL_RESIZE", ;
		Top = 87, ;
		Width = 214, ;
		ZOrderSet = 8, ;
		Column1.ControlSource = "recno('crsGrupe_Utilizatori')", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.Width = 40, ;
		Column2.ControlSource = "nume_grupa", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 143
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori_coresp.Cnr_crt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Crt.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori_coresp.Cnr_crt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori_coresp.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire grupa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pagefr_config.pag3.grd_utilizatori_coresp.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pagefr_config.pag3.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform.pagefr_config.pag3.grd_utilizatori, ;
		Left = 311, ;
		Name = "Gridextra1", ;
		Top = 37
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BackColor = 217,241,255, ;
		BackStyle = 1, ;
		Height = 77, ;
		Left = 6, ;
		Name = "Shape1", ;
		Top = 64, ;
		Width = 279, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'shp_butoane' AS shape WITH ;
		BackStyle = 0, ;
		Height = 29, ;
		Left = 15, ;
		Name = "shp_butoane", ;
		Top = 106, ;
		Width = 121, ;
		ZOrderSet = 8
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE actualizeaza_grid1
		
		LPARAMETERS tnCol,tlAsc
		
		lnCol = tnCol
		
		WITH thisform.pagefr_config.pag2.grd_gestiuni
		
			FOR i=1 TO .ColumnCount     
				IF i=lnCol
					.Columns(i).Header1.ForeColor = RGB(0,0,255)
					.Columns(i).header1.Fontunderline = .t.
				ELSE
					.Columns(i).Header1.ForeColor = RGB(0,0,0)
					.Columns(i).header1.Fontunderline = .f.
				ENDIF	
			ENDFOR 	
		
			IF lnCol = 6
				thisform.cordine = [nr_pag]
			ELSE	
				lcControlS = .Columns(lnCol).ControlSource
				lnpos = RAT('.',lcControlS)+1	
				thisform.cordine = SUBSTR(lcControlS,lnpos)
			ENDIF	
			.readonly = .t.
		ENDWITH 
		
		lcOrdine_nou = thisform.cordine
		lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		IF !EMPTY(tlAsc)
			thisform.lasc = .t.
		ELSE
			IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
				thisform.lasc = !thisform.lasc
			ELSE
				thisform.lasc = .t.	
			ENDIF
		ENDIF	
		
		thisform.actualizeaza_pagina(2,poGestiuni.ca_baza1.cfiltru,.f.)
		
		
		
		
		
		
	ENDPROC

	PROCEDURE actualizeaza_pagina
		PARAMETERS tnpag,tcFiltru,tlDoarButoane
		LOCAL lnpag,lcFiltru 
		
		lnpag = tnpag
		llDoarButoane = tlDoarButoane
		lcFiltru = tcFiltru
		
		DO case
			CASE lnpag =1
				IF !EMPTY(lcFiltru)
					*poGrupe.ca_baza1.cfiltru =[1=1]
					poGrupe.ca_baza1.cfiltru = lcFiltru			
					save_grid_tag(This.pagefr_config.pag1.grd_grupe)
					save_grid_tag(This.pagefr_config.pag2.grd_grupe)
					save_grid_tag(This.pagefr_config.pag3.grd_grupe)
					poGrupe.ca_baza1.afisare()			
					restore_grid_tag(This.pagefr_config.pag1.grd_grupe)		
					restore_grid_tag(This.pagefr_config.pag2.grd_grupe)
					restore_grid_tag(This.pagefr_config.pag3.grd_grupe)
					This.pagefr_config.pag1.grd_grupe.nrecno = 1
					This.pagefr_config.pag1.grd_grupe.refresh
					This.pagefr_config.pag1.grd_grupe.ReadOnly = .t.	
					
					thisform.pagefr_config.pag1.gridextra1.applyfilter()
					
					SELECT crsGrupe
					GO top	
				ENDIF				
				
				lnId_grupe = crsGrupe.id_grupe
				lcId_grupe = ALLTRIM(STR(lnId_grupe))
				poGrupe_Gestiuni.ca_baza1.cfiltru=IIF(!EMPTY(lnId_grupe),[a.id_grupe=]+lcId_grupe,[1=2])
				poGrupe_Gestiuni.ca_baza1.corder=[b.nume_gestiune]
				
				save_grid_tag(This.pagefr_config.pag1.grd_grupe_coresp)
				save_grid_tag(This.pagefr_config.pag2.grd_gestiuni_coresp)
				poGrupe_Gestiuni.ca_baza1.afisare()
				restore_grid_tag(This.pagefr_config.pag1.grd_grupe_coresp)
				restore_grid_tag(This.pagefr_config.pag2.grd_gestiuni_coresp)
				This.pagefr_config.pag1.grd_grupe_coresp.refresh	
				This.pagefr_config.pag1.grd_grupe_coresp.ReadOnly = .t.									
			CASE lnpag =2
				IF !llDoarButoane		
					IF !EMPTY(lcFiltru)
						poGestiuni.ca_baza1.cfiltru=lcFiltru
						poGestiuni.ca_baza1.corder = thisform.cordine + [ ] + IIF(thisform.lasc,[ASC],[DESC])
						save_grid_tag(This.pagefr_config.pag2.grd_gestiuni)
						poGestiuni.ca_baza1.afisare()
						restore_grid_tag(This.pagefr_config.pag2.grd_gestiuni)
						This.pagefr_config.pag2.grd_gestiuni.nrecno = 1
						This.pagefr_config.pag2.grd_gestiuni.refresh
						This.pagefr_config.pag2.grd_gestiuni.ReadOnly = .t.
		
						thisform.pagefr_config.pag2.gridextra1.applyfilter()
		
						SELECT crsGestiuni
						GO top			
					ENDIF	
					lnId_gestiune = crsGestiuni.id_gestiune	
					lcId_gestiune = ALLTRIM(STR(lnId_gestiune))
					poGrupe_Gestiuni.ca_baza1.cfiltru=IIF(!EMPTY(lnId_gestiune),[a.id_gestiune=]+lcId_gestiune,[1=2])
					poGrupe_Gestiuni.ca_baza1.corder=[c.nume_grupa]
					
					save_grid_tag(This.pagefr_config.pag2.grd_gestiuni_coresp)
					save_grid_tag(This.pagefr_config.pag1.grd_grupe_coresp)
					poGrupe_Gestiuni.ca_baza1.afisare()
					restore_grid_tag(This.pagefr_config.pag2.grd_gestiuni_coresp)
					restore_grid_tag(This.pagefr_config.pag1.grd_grupe_coresp)	
					This.pagefr_config.pag2.grd_gestiuni_coresp.ReadOnly = .t.	
					This.pagefr_config.pag2.grd_gestiuni_coresp.refresh	
					
					* Actualizare grupe neselectate	
					IF !EMPTY(lnId_gestiune)																	
						SELECT id_grupe FROM crsGrupe_Gestiuni INTO ARRAY aListaGrupe
						IF _tally = 0
							lcListaGrupe = []
						ELSE
							lcListaGrupe = [(]
							FOR i=1 TO ALEN('aListaGrupe')
								lcListaGrupe = lcListaGrupe + ALLTRIM(STR(aListaGrupe(i)))+[,]
							ENDFOR	
							lcListaGrupe = SUBSTR(lcListaGrupe,1,LEN(lcListaGrupe)-1)		
							lcListaGrupe = lcListaGrupe + [)]
						ENDIF			
						poGrupe.ca_baza1.cfiltru =IIF(EMPTY(lcListaGrupe),[1=1],[id_grupe not in ]+lcListaGrupe)
					ELSE
						poGrupe.ca_baza1.cfiltru = [1=2]
					ENDIF				
					
					save_grid_tag(This.pagefr_config.pag2.grd_grupe)
					save_grid_tag(This.pagefr_config.pag1.grd_grupe)
					save_grid_tag(This.pagefr_config.pag3.grd_grupe)
					poGrupe.ca_baza1.afisare()
					restore_grid_tag(This.pagefr_config.pag2.grd_grupe)
					restore_grid_tag(This.pagefr_config.pag1.grd_grupe)		
					restore_grid_tag(This.pagefr_config.pag3.grd_grupe)	
					This.pagefr_config.pag2.grd_grupe.ReadOnly = .t.	
					This.pagefr_config.pag2.grd_grupe.refresh	
					
				ENDIF
				&& actualizez starea butoanelor de adaugare/stergere drepturi de acces	
							
				WITH this.pagefr_config.pag2	
					IF reccount('crsGrupe_Gestiuni')=0
						.cmd_rem.enabled = .f.
						.cmd_rem_all.enabled = .f.
					ELSE
						IF TYPE('.activecontrol')!='O' OR  .activecontrol.name!='grd_gestiuni_coresp'
							.cmd_rem.enabled = .f.
							.cmd_rem_all.enabled=.t.
						ELSE								
							.cmd_rem.enabled = .t.	
							.cmd_rem_all.enabled = .t.
						ENDIF				
					ENDIF
					IF reccount('crsGrupe')=0
						.cmd_add.enabled = .f.
						.cmd_add_all.enabled = .f.
					ELSE
						IF TYPE('.activecontrol')!='O' OR .activecontrol.name!='grd_grupe'
							.cmd_add.enabled = .f.
							.cmd_add_all.enabled = .t.
						ELSE								
							.cmd_add.enabled = .t.	
							.cmd_add_all.enabled = .t.
						ENDIF				
					ENDIF																															
				ENDWITH	
													
			CASE lnpag =3
				IF !llDoarButoane
					IF !EMPTY(lcFiltru)
						poUtilizatori.ca_baza1.cfiltru=lcFiltru
						save_grid_tag(This.pagefr_config.pag3.grd_utilizatori)
						poUtilizatori.ca_baza1.afisare()
						restore_grid_tag(This.pagefr_config.pag3.grd_utilizatori)
						This.pagefr_config.pag3.grd_utilizatori.nrecno = 1
						This.pagefr_config.pag3.grd_utilizatori.ReadOnly = .t.
						This.pagefr_config.pag3.grd_utilizatori.refresh
						
						thisform.pagefr_config.pag3.gridextra1.applyfilter()
						
						SELECT crsUtilizatori
						GO top									
					ENDIF						
					lnid_util = crsUtilizatori.id_util				
					lcId_util = ALLTRIM(STR(lnId_util))	
													
					poGrupe_Utilizatori.ca_baza1.cfiltru=IIF(!EMPTY(lnId_util),[id_util=]+lcId_util,[1=2])
					
					save_grid_tag(This.pagefr_config.pag3.grd_utilizatori_coresp)
					poGrupe_Utilizatori.ca_baza1.afisare()
					restore_grid_tag(This.pagefr_config.pag3.grd_utilizatori_coresp)
					This.pagefr_config.pag3.grd_utilizatori_coresp.ReadOnly = .t.
					This.pagefr_config.pag3.grd_utilizatori_coresp.refresh
				
					* Actualizare grupe neselectate	
					IF !EMPTY(lnId_util)																	
						SELECT id_grupe FROM crsGrupe_Utilizatori INTO ARRAY aListaGrupe
						IF _tally = 0
							lcListaGrupe = []
						ELSE
							lcListaGrupe = [(]
							FOR i=1 TO ALEN('aListaGrupe')
								lcListaGrupe = lcListaGrupe + ALLTRIM(STR(aListaGrupe(i)))+[,]
							ENDFOR	
							lcListaGrupe = SUBSTR(lcListaGrupe,1,LEN(lcListaGrupe)-1)		
							lcListaGrupe = lcListaGrupe + [)]
						ENDIF			
						poGrupe.ca_baza1.cfiltru =IIF(EMPTY(lcListaGrupe),[1=1],[id_grupe not in ]+lcListaGrupe)
					ELSE
						poGrupe.ca_baza1.cfiltru = [1=2]
					ENDIF				
					
					save_grid_tag(This.pagefr_config.pag3.grd_grupe)
					save_grid_tag(This.pagefr_config.pag1.grd_grupe)
					save_grid_tag(This.pagefr_config.pag2.grd_grupe)
					poGrupe.ca_baza1.afisare()
					restore_grid_tag(This.pagefr_config.pag3.grd_grupe)
					restore_grid_tag(This.pagefr_config.pag1.grd_grupe)		
					restore_grid_tag(This.pagefr_config.pag2.grd_grupe)		
					This.pagefr_config.pag3.grd_grupe.ReadOnly = .t.
					This.pagefr_config.pag3.grd_grupe.refresh	
				ENDIF				
				
				&& actualizez starea butoanelor de adaugare/stergere drepturi de acces				
				WITH this.pagefr_config.pag3	
					IF reccount('crsGrupe_Utilizatori')=0
						.cmd_rem.enabled = .f.
						.cmd_rem_all.enabled = .f.
					ELSE
						IF TYPE('.activecontrol')!='O' OR  .activecontrol.name!='grd_utilizatori_coresp'
							.cmd_rem.enabled = .f.
							.cmd_rem_all.enabled=.t.
						ELSE								
							.cmd_rem.enabled = .t.	
							.cmd_rem_all.enabled = .t.
						ENDIF				
					ENDIF
					IF reccount('crsGrupe')=0
						.cmd_add.enabled = .f.
						.cmd_add_all.enabled = .f.
					ELSE
						IF TYPE('.activecontrol')!='O' OR .activecontrol.name!='grd_grupe'
							.cmd_add.enabled = .f.
							.cmd_add_all.enabled = .t.
						ELSE								
							.cmd_add.enabled = .t.	
							.cmd_add_all.enabled = .t.
						ENDIF				
					ENDIF																															
				ENDWITH		
		ENDCASE
		
	ENDPROC

	PROCEDURE adauga_drept_acces
		PARAMETERS  tlToate
		
		LOCAL lcId_grupa,lcId_util,llToate
		llToate = tlToate
		
		SELECT crsUtilizatori
		lcId_util = ALLTRIM(STR(crsUtilizatori.id_util))
		
		lcSql_sterse = [select id_cug,id_grupe from ] + gcS + [.gest_coresp_util_grupe] + ;
			[ where sters = 1 and id_util = ] + lcId_util
		lcCursor = [crsSterse]	
		lnsucces_sterse = goExecutor.oExecute(lcSql_sterse,lcCursor)		
		IF lnSucces_sterse < 0
			lcMesaj = goExecutor.cEroare
			ofrm_eroare = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcMesaj)
			ofrm_eroare.show(1)
			RELEASE ofrm_eroare
			RETURN
		ENDIF		
		
		IF RECCOUNT(lcCursor) > 0	
			SELECT * from (lcCursor) INTO ARRAY laCoresp_sterse
			lnDim = RECCOUNT(lcCursor)
		ELSE
			lnDim = 0	
		endif
		
		IF llToate
			SELECT crsGrupe
			SCAN
				lnId_grupe = crsGrupe.id_grupe
				lcId_grupe= ALLTRIM(STR(lnId_grupe))
				IF lnDim > 0		
					lnPoz = ASCAN(laCoresp_sterse,lnId_grupe,1,lnDim,2,8)
				ELSE 
					lnPoz = 0	
				ENDIF			
				IF lnPoz != 0
					lnId_cug = laCoresp_sterse(lnPoz,1)
					lcSql = [update ] + gcs + [.gest_coresp_util_grupe set sters = 0 where ] +;			
							[ id_cug = ] + ALLTRIM(STR(lnId_cug))					
				else				
					lcSql = [insert into ]+gcS+[.gest_coresp_util_grupe(id_grupe,id_util) ]+;
						[ values (]+lcId_grupe+[,]+lcId_util+[)] 
				endif		
				lnsucces = goExecutor.oExecute(lcSql)		
				IF lnSucces < 0
					lcMesaj = goExecutor.cEroare
					ofrm_eroare = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcMesaj)
					ofrm_eroare.show(1)
					RELEASE ofrm_eroare
					RETURN
				ENDIF			
			ENDSCAN		
		ELSE
		
			SELECT crsGrupe
			lnId_grupe = crsGrupe.id_grupe
			lcId_grupe= ALLTRIM(STR(lnId_grupe))
			IF lnDim > 0		
				lnPoz = ASCAN(laCoresp_sterse,lnId_grupe,1,lnDim,2,8)
			ELSE 
				lnPoz = 0	
			ENDIF			
			IF lnPoz != 0
				lnId_cug = laCoresp_sterse(lnPoz,1)
				lcSql = [update ] + gcs + [.gest_coresp_util_grupe set sters = 0 where ] +;			
						[ id_cug = ] + ALLTRIM(STR(lnId_cug))					
			else				
				lcSql = [insert into ]+gcS+[.gest_coresp_util_grupe(id_grupe,id_util) ]+;
					[ values (]+lcId_grupe+[,]+lcId_util+[)] 
			endif		
			lnsucces = goExecutor.oExecute(lcSql)		
			IF lnSucces < 0
				lcMesaj = goExecutor.cEroare
				ofrm_eroare = CREATEOBJECT('frm_mesaj','Eroare','exclam.ico','Avertizare',lcMesaj)
				ofrm_eroare.show(1)
				RELEASE ofrm_eroare
				RETURN
			ENDIF
		ENDIF
		
		this.actualizeaza_pagina(3,[])
		DO ovariabile_globale.prg
		this.pagefr_config.pag3.grd_grupe.SetFocus
		
		
		
		
	ENDPROC

	PROCEDURE adauga_grupa
		PARAMETERS  tlToate
		
		LOCAL lcId_grupa,lcId_gestiune,llToate
		llToate = tlToate
		
		SELECT crsGestiuni
		lcId_gestiune = ALLTRIM(STR(crsGestiuni.id_gestiune))
		
		IF llToate
			SELECT crsGrupe
			SCAN
				lcId_grupe= ALLTRIM(STR(crsGrupe.id_grupe))
				lcSql = [insert into ]+gcS+[.gest_coresp_grupe_gestiuni(id_grupe,id_gestiune) ]+;
						[ values (]+lcId_grupe+[,]+lcId_gestiune+[)] 
				lnsucces = goExecutor.oExecute(lcSql)		
				IF lnSucces < 0
					aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
					RETURN
				ENDIF			
			ENDSCAN		
		ELSE
			SELECT crsGrupe
			lcId_grupe = ALLTRIM(STR(crsGrupe.id_grupe))
		
			lcSql = [insert into ]+gcS+[.gest_coresp_grupe_gestiuni(id_grupe,id_gestiune) ]+;
					[ values (]+lcId_grupe+[,]+lcId_gestiune+[)] 
			lnsucces = goExecutor.oExecute(lcSql)		
			IF lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
				RETURN
			ENDIF
		ENDIF
		
		this.actualizeaza_pagina(2,[],.f.)
		this.pagefr_config.pag2.grd_grupe.SetFocus
		
		
		
		
	ENDPROC

	PROCEDURE do_adauga
		LPARAMETERS tlCopiaza
		* tlCopiaza (default .F.) : daca creeaza o inregistrare noua prin copierea datelor existente
		*!* 22.02.2010
		*!* marius.mutu
		*!* adaugarea de gestiune apeleaza nom_gestiuni_nou din onomenclatoare.prg
		*!* la fel ca si frm_gestiuni.do_adauga din onomenclatoare.vcx
		
		Local lnpag, lnIdGestiune
		lnpag = This.pagefr_config.ActivePage
		
		Do Case
			Case lnpag=1
				Select crsGrupe
				IF m.tlCopiaza
					Scatter Name loGrupa
					loGrupa.id_grupe = NULL 
				ELSE
					Scatter Name loGrupa Blank
				ENDIF 
		
				Do Adauga_Modifica_Inregistrare With [grupe],loGrupa,,[INSERT]
				This.actualizeaza_pagina(1,poGrupe.ca_baza1.cfiltru)
			Case lnpag=2
				*!* 22.02.2010
		
				*!*			SELECT crsGestiuni
				*!*			SCATTER NAME loGestiune blank
				*!*			DO Adauga_Modifica_Inregistrare WITH [gestiuni_config],loGestiune,,[INSERT]
				*!*			this.actualizeaza_pagina(2,poGestiuni.ca_baza1.cfiltru)
		
				IF m.tlCopiaza
					lnIdGestiune = NVL(crsGestiuni.id_gestiune,0)
				ELSE
					lnIdGestiune = 0	
				ENDIF 
				Do nom_gestiuni_nou WITH m.lnIdGestiune In onomenclatoare.prg
				
				If gnButon = 1
					*!*	modificare	v 2.0.150
					*!*				this.actualizeaza_pagina(2,poGestiuni.ca_baza1.cfiltru)
					This.do_cauta()
					*!*	modificare	v 2.0.150	^
				Endif
				*!* 22.02.2010 ^
		Endcase
		
	ENDPROC

	PROCEDURE do_cauta
		
		LOCAL lnpag,lcFiltru
		lnpag= this.pagefr_config.ActivePage
		lcFiltru=[]
		
		lcNume = UPPER(ALLTRIM(this.lbl_nom_caut.text_simplu1.Value))
		
		DO case
			CASE lnpag = 1
				lcFiltru = IIF(!EMPTY(lcNume),[ nume_grupa like '%]+lcNume+[%'],[1=1])
				lcCrs = [crsGrupe]
			CASE lnpag = 2
				lcFiltru = IIF(!EMPTY(lcNume),[ nume_gestiune like '%]+lcNume+[%'],[1=1])
				lcCrs = [crsGestiuni]
			CASE lnpag = 3
				lcFiltru =IIF(!EMPTY(lcNume),[ utilizator like '%]+lcNume+[%'],[1=1])
				lcCrs = [crsUtilizatori]
		ENDCASE
		
		
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_pagina(lnpag,lcFiltru)
		SELECT (lcCrs)
		
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ELSE 
			*!* 22.02.2010
			IF lnpag = 2
				IF NVL(thisform.nIdGestiune,0) > 0 
					SELECT crsGestiuni
					LOCATE FOR id_gestiune = thisform.nIdGestiune
					IF !FOUND()
						GO top
					ENDIF 	
					Thisform.nIdGestiune = 0
				ENDIF 	
			ENDIF 	
			*!* 22.02.2010 ^		
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
		
		
	ENDPROC

	PROCEDURE do_copiaza
		thisform.do_adauga(.T.)
	ENDPROC

	PROCEDURE do_excel
		DO export_excel_grid WITH this.pagefr_config.pag2.grd_gestiuni
		
		* export_excel(this.pagefr_config.pag2.grd_gestiuni,[GESTIUNI],,.t.)
	ENDPROC

	PROCEDURE do_modifica
		*!* 22.02.2010
		*!* marius.mutu
		*!* modificarea de gestiune apeleaza procedura nom_gestiuni_modifica din onomenclatoare.prg
		*!* la fel ca si frm_gestiuni.do_modifica din onomenclatoare.vcx
		
		Local lnId_Grupa, lnIdGestiune, loGrupa, loGestiune, loRec
		Local lnpag
		lnpag = This.pagefr_config.ActivePage
		
		Private pcnume
		Store '' To pcnume
		
		Do Case
			Case lnpag=1
				Select crsGrupe
				Scatter Name loGrupa
				lnId_Grupa = loGrupa.id_grupe
				pcnume = loGrupa.nume_grupa
				Do Adauga_Modifica_Inregistrare With [grupe],loGrupa,lnId_Grupa,[UPDATE]
				This.actualizeaza_pagina(1,poGrupe.ca_baza1.cfiltru)
				Select crsGrupe
				Locate For 	id_grupe = loGrupa.id_grupe
				If !Found()
					Go Top
				Endif
				This.pagefr_config.paG1.grd_grupe.SetFocus()
			Case lnpag=2
				If Reccount('crsGestiuni')>0
					Select crsGestiuni
					lnIdGestiune = id_gestiune
		
					loRec = nom_gestiuni_modifica(lnIdGestiune)
		
					If !Isnull(loRec)
						This.nIdGestiune = loRec.id_gestiune
		
						this.do_cauta()
						*This.actualizeaza_pagina(2,poGestiuni.ca_baza1.cfiltru)
		
						Select crsGestiuni
						Locate For id_gestiune = loRec.id_gestiune
						If !Found()
							Go Top
						Endif
					Endif
				Else
					amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
				Endif
		Endcase
		
		
	ENDPROC

	PROCEDURE do_sterge
		
		LOCAL lnpag
		lnpag = this.pagefr_config.ActivePage
		
		DO case
			CASE lnpag=1
				SELECT crsGrupe
				SCATTER NAME loGrupa
				lnId_grupa = loGrupa.id_grupe
				DO STERGE_INREGISTRARE WITH [grupe],lnId_grupa
				this.actualizeaza_pagina(1,poGrupe.ca_baza1.cfiltru)		
			CASE lnpag=2	
				SELECT crsGestiuni
				SCATTER NAME loGestiune
				lnId_gestiune = loGestiune.id_gestiune
		*!*	modificare	v 2.2.21
		*!*			DO STERGE_INREGISTRARE WITH [gestiuni_config],lnId_gestiune
				DO STERGE_INREGISTRARE WITH [gestiuni],lnId_gestiune
		*!*	modificare	v 2.2.21	^
				this.actualizeaza_pagina(2,poGestiuni.ca_baza1.cfiltru)			
		ENDCASE
		
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		this.WindowState = 2 
		this.pagefr_config.pag1.gridextra1.setup()
		this.pagefr_config.pag2.gridextra1.setup()
		this.pagefr_config.pag3.gridextra1.setup()
	ENDPROC

	PROCEDURE sterge_drept_acces
		PARAMETERS tlToate
		
		LOCAL llToate
		llToate = tlToate
		
		SELECT crsUtilizatori
		lcId_util = ALLTRIM(STR(crsUtilizatori.id_util))
		
		IF llToate
			*lcSql = [delete from ]+gcS+[.gest_coresp_util_grupe where id_util=]+lcId_util			
			lcSql = [update ] + gcS + [.gest_coresp_util_grupe set sters = 1 where id_util = ] + lcid_util 
		ELSE
			SELECT crsGrupe_Utilizatori
			lcId_cug = ALLTRIM(STR(crsGrupe_Utilizatori.id_cug))
			*lcSql =[delete from ]+gcS+[.gest_coresp_util_grupe where id_cug=]+lcId_cug			
			lcSql = [update ] + gcS + [.gest_coresp_util_grupe set sters = 1 where id_cug = ] + lcid_cug 
		ENDIF
		
		lnsucces = goExecutor.oExecute(lcSql)		
		IF lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
			RETURN
		ENDIF	
		
		this.actualizeaza_pagina(3,[])
		DO ovariabile_globale.prg
		this.pagefr_config.pag3.grd_utilizatori_coresp.SetFocus
		
	ENDPROC

	PROCEDURE sterge_grupa
		PARAMETERS tlToate
		
		LOCAL llToate
		llToate = tlToate
		
		lcSql=[]
		
		SELECT crsGestiuni
		lcId_gestiune = ALLTRIM(STR(crsGestiuni.id_gestiune))
		
		IF llToate
			*lcSql = [delete from ]+gcS+[.gest_coresp_grupe_gestiuni where id_gestiune=]+lcId_gestiune+;
					[ and id_grupe <> -1]			
			lcSql = [update ] + gcS + [.gest_coresp_grupe_gestiuni set sters = 1 where ]+;
					[id_gestiune = ] + lcId_gestiune + [ and id_grupe <> -1]		
		ELSE
			SELECT crsGrupe_Gestiuni
			lcId_cgg = ALLTRIM(STR(crsGrupe_Gestiuni.id_cgg))
			lnId_grupa = crsGrupe_Gestiuni.id_grupe
			IF lnId_grupa <> -1	
				*lcSql =[delete from ]+gcS+[.gest_coresp_grupe_gestiuni where id_cgg=]+lcId_cgg			
				lcSql = [update ] + gcS + [.gest_coresp_grupe_gestiuni set sters = 1 ] +;
				[ where id_cgg = ] + lcId_cgg
			ELSE
			 	lcMesaj=[Aceasta grupa este asociata implicit si nu poate fi stearsa!]
				lcTitlu = [Atentie!]
				lctip = [AVERTIZARE]
				lcImagine = [exclam.ico]
				ofrm_av = CREATEOBJECT('frm_mesaj',lctitlu,lcimagine,lctip,lcmesaj)
				ofrm_av.show(1)
				RELEASE ofrm_av		
			ENDIF		
		ENDIF
		
		IF !EMPTY(lcSql)
			lnsucces = goExecutor.oExecute(lcSql)		
			IF lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,[Eroare])
				RETURN
			ENDIF	
		ENDIF
		
		this.actualizeaza_pagina(2,[],.f.)
		this.pagefr_config.pag2.grd_gestiuni_coresp.SetFocus
		
	ENDPROC

	PROCEDURE Pagefr_config.activare_pagina
		PARAMETERS npag
		
		DODEFAULT(npag)
		
		this.setare_pagina(npag)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag1.grd_grupe.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()
		
		thisform.actualizeaza_pagina(1,.f.)
	ENDPROC

	PROCEDURE Pagefr_config.pag2.cmd_add.Click
		thisform.adauga_grupa(.f.)
	ENDPROC

	PROCEDURE Pagefr_config.pag2.cmd_add_all.Click
		thisform.adauga_grupa(.t.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.cmd_rem.Click
		thisform.sterge_grupa(.f.)
	ENDPROC

	PROCEDURE Pagefr_config.pag2.cmd_rem_all.Click
		thisform.sterge_grupa(.t.)
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.AfterRowColChange
		LPARAMETERS nColIndex
		
		DODEFAULT()
		
		THISFORM.actualizeaza_pagina(2,[],.f.)
		*!*	SELECT crsGestiuni
		*!*	lcId_gestiune = ALLTRIM(STR(crsGestiuni.id_gestiune))
		*!*	poGrupe_Gestiuni.ca_baza1.cfiltru=[a.id_gestiune=]+lcId_gestiune
		*!*	*poGrupe_Gestiuni.ca_baza1.corder=[c.nume_grupa]
		
		*!*	save_grid_tag(This.Parent.grd_gestiuni_coresp)
		*!*	save_grid_tag(This.Parent.PARENT.pag1.grd_grupe_coresp)
		*!*	poGrupe_Gestiuni.ca_baza1.afisare()
		*!*	restore_grid_tag(This.parent.grd_gestiuni_coresp)
		*!*	restore_grid_tag(This.parent.parent.pag1.grd_grupe_coresp)
		*!*	This.parent.grd_gestiuni_coresp.refresh		
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.cacont.Header1.DblClick
		
		
		thisform.actualizeaza_grid1(5)
		*!*	thisform.cordine = [acont]
		*!*	lcOrdine_nou = thisform.cordine
		*!*	lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		*!*	IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
		*!*		thisform.lasc = !thisform.lasc
		*!*	ELSE
		*!*		thisform.lasc = .t.	
		*!*	ENDIF
		
		*!*	thisform.actualizeaza_pagina(2,[1=1],.f.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.ccgest.Header1.DblClick
		
		
		thisform.actualizeaza_grid1(3)
		*!*	thisform.cordine = [cgest]
		*!*	lcOrdine_nou = thisform.cordine
		*!*	lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		*!*	IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
		*!*		thisform.lasc = !thisform.lasc
		*!*	ELSE
		*!*		thisform.lasc = .t.	
		*!*	ENDIF
		
		*!*	thisform.actualizeaza_pagina(2,[1=1],.f.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.ccont.Header1.DblClick
		
		
		thisform.actualizeaza_grid1(4)
		*!*	thisform.cordine = [cont]
		*!*	lcOrdine_nou = thisform.cordine
		*!*	lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		*!*	IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
		*!*		thisform.lasc = !thisform.lasc
		*!*	ELSE
		*!*		thisform.lasc = .t.	
		*!*	ENDIF
		
		*!*	thisform.actualizeaza_pagina(2,[1=1],.f.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.cinactiv.Header1.Click
		
		
		thisform.actualizeaza_grid1(7)
		*!*	thisform.cordine = [inactiv]
		*!*	lcOrdine_nou = thisform.cordine
		*!*	lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		*!*	IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
		*!*		thisform.lasc = !thisform.lasc
		*!*	ELSE
		*!*		thisform.lasc = .t.	
		*!*	ENDIF
		
		*!*	thisform.actualizeaza_pagina(2,[1=1],.f.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.Cnr_pag.Header1.Click
		
		
		thisform.actualizeaza_grid1(6)
		*!*	thisform.cordine = [nr_pag]
		*!*	lcOrdine_nou = thisform.cordine
		*!*	lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		*!*	IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
		*!*		thisform.lasc = !thisform.lasc
		*!*	ELSE
		*!*		thisform.lasc = .t.	
		*!*	ENDIF
		
		*!*	thisform.actualizeaza_pagina(2,[1=1],.f.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni.cnume_gestiune.Header1.DblClick
		
		
		thisform.actualizeaza_grid1(2)
		*!*	thisform.cordine = [nume_gestiune]
		*!*	lcOrdine_nou = thisform.cordine
		*!*	lcOrdine_vechi = poGestiuni.ca_baza1.corder
		
		*!*	IF UPPER(ALLTRIM(lcOrdine_nou))$UPPER(ALLTRIM(lcOrdine_vechi))
		*!*		thisform.lasc = !thisform.lasc
		*!*	ELSE
		*!*		thisform.lasc = .t.	
		*!*	ENDIF
		
		*!*	thisform.actualizeaza_pagina(2,[1=1],.f.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_gestiuni_coresp.AfterRowColChange
		LPARAMETERS nColIndex
		
		DODEFAULT()
		
		thisform.actualizeaza_pagina(2,[],.t.)
	ENDPROC

	PROCEDURE Pagefr_config.pag2.grd_grupe.AfterRowColChange
		LPARAMETERS nColIndex
		
		
		DODEFAULT()
		thisform.actualizeaza_pagina(2,[],.t.)
	ENDPROC

	PROCEDURE Pagefr_config.pag3.cmd_add.Click
		thisform.adauga_drept_acces(.f.)
	ENDPROC

	PROCEDURE Pagefr_config.pag3.cmd_add_all.Click
		thisform.adauga_drept_acces(.t.)
		
	ENDPROC

	PROCEDURE Pagefr_config.pag3.cmd_rem.Click
		thisform.sterge_drept_acces(.f.)
	ENDPROC

	PROCEDURE Pagefr_config.pag3.cmd_rem_all.Click
		thisform.sterge_drept_acces(.t.)
	ENDPROC

	PROCEDURE Pagefr_config.pag3.grd_grupe.AfterRowColChange
		LPARAMETERS nColIndex
		
		DODEFAULT()
		thisform.actualizeaza_pagina(3,[],.t.)
	ENDPROC

	PROCEDURE Pagefr_config.pag3.grd_utilizatori.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()
		
		thisform.actualizeaza_pagina(3,[],.f.)
		*!*	SELECT crsUtilizatori
		*!*	lnid_util = crsUtilizatori.id_util	
		*!*	lcId_util = ALLTRIM(STR(lnId_util))
		*!*	poGrupe_Utilizatori.ca_baza1.cfiltru=[id_util=]+lcId_util
		*!*	*poGrupe_Gestiuni.ca_baza1.corder=[c.nume_grupa]
		
		*!*	save_grid_tag(This.Parent.grd_utilizatori_coresp)
		*!*	poGrupe_Utilizatori.ca_baza1.afisare()
		*!*	restore_grid_tag(This.parent.grd_utilizatori_coresp)
		*!*	This.parent.grd_utilizatori_coresp.refresh	
		
		*!*	* Actualizare grupe neselectate							
		*!*	SELECT id_grupe FROM crsGrupe_Utilizatori INTO ARRAY aListaGrupe
		*!*	IF _tally = 0
		*!*		lcListaGrupe = []
		*!*	ELSE
		*!*		lcListaGrupe = [(]
		*!*		FOR i=1 TO ALEN('aListaGrupe')
		*!*			lcListaGrupe = lcListaGrupe + ALLTRIM(STR(aListaGrupe(i)))+[,]
		*!*		ENDFOR	
		*!*		lcListaGrupe = SUBSTR(lcListaGrupe,1,LEN(lcListaGrupe)-1)		
		*!*		lcListaGrupe = lcListaGrupe + [)]
		*!*	ENDIF			
		*!*	poGrupe.ca_baza1.cfiltru =IIF(EMPTY(lcListaGrupe),[1=1],[id_grupe not in ]+lcListaGrupe)
		
		*!*	save_grid_tag(This.parent.grd_grupe)
		*!*	save_grid_tag(This.parent.parent.pag1.grd_grupe)
		*!*	poGrupe.ca_baza1.afisare()
		*!*	restore_grid_tag(This.parent.grd_grupe)
		*!*	restore_grid_tag(This.parent.parent.pag1.grd_grupe)		
		*!*	This.parent.grd_grupe.refresh								
			
			
	ENDPROC

	PROCEDURE Pagefr_config.pag3.grd_utilizatori_coresp.AfterRowColChange
		LPARAMETERS nColIndex
		
		DODEFAULT()
		thisform.actualizeaza_pagina(3,[],.t.)
	ENDPROC

	PROCEDURE Pagefr_config.setare_pagina
		PARAMETERS tnpag
		LOCAL lnpag 
		lnpag = tnpag
		
		*thisform.lbl_nom_caut.text_simplu1.Value=[]
		thisform.shp_butoane.Visible = IIF(lnpag=3,.f.,.t.)
		thisform.shp_butoane.width = IIF(lnpag=2,121,91)
		thisform.but_nou1.Visible = IIF(lnpag=3,.f.,.t.)
		thisform.but_copiaza1.Visible = IIF(lnpag=3,.f.,.t.)
		thisform.but_modifica1.Visible = IIF(lnpag=3,.f.,.t.)
		thisform.but_sterge1.Visible = IIF(lnpag=3,.f.,.t.)
		thisform.but_excel1.Visible = IIF(lnpag=2,.t.,.f.)
		thisform.cmd_cauta.Left = IIF(lnpag=3,15,179)
		
		
		DO case
			CASE lnpag = 1
				thisform.lb_titlu_alb_b121.Caption = [Configurare grupe de gestiuni]
				thisform.lbl_nom_caut.Lb_simplu1.Caption = [Grupa]				
				
			CASE lnpag = 2
				thisform.lb_titlu_alb_b121.Caption = [Configurare gestiuni]
				thisform.lbl_nom_caut.Lb_simplu1.Caption = [Gestiune]
				thisform.actualizeaza_grid1(2,.t.)		
		*!*			thisform.cordine = [nume_gestiune]
		*!*			thisform.lasc = .t.				
			
			CASE lnpag = 3
				thisform.lb_titlu_alb_b121.Caption = [Configurare drepturi de acces pe grupe de gestiuni]		
				thisform.lbl_nom_caut.Lb_simplu1.Caption = [Utilizator]	
				
		ENDCASE
		
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		
		thisform.actualizeaza_pagina(lnpag,)
		
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
		
		
	ENDPROC

	PROCEDURE _shape1.DblClick
		IF thisform.WindowState= 2
			thisform.WindowState = 0
		ELSE 
			thisform.WindowState= 2
		ENDIF 
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_grupe_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="clb_grupa" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_grupe" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="img_parinte" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_parinte" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_parinte
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 149
		Name = "frm_grupe_nou"
		Width = 387
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 387
		_shape2.Height = 29
		_shape2.Left = 326
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 61
		Lb_titlu_alb_b121.Caption = "Grupa de gestiune"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Left = 357
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 327, ;
		Name = "But_renunt1", ;
		TabIndex = 3, ;
		Top = 1
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_inactiv' AS ck_simplu WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 12, ;
		Name = "Ck_inactiv", ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 124
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'clb_grupa' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 13, ;
		Name = "clb_grupa", ;
		TabIndex = 1, ;
		Top = 83, ;
		Width = 313, ;
		Text_simplu1.ControlSource = "porec.nume_grupa", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.MaxLength = 50, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 208, ;
		Lb_simplu1.Caption = "Nume grupa", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_parinte' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 13, ;
		Name = "clb_parinte", ;
		TabIndex = 6, ;
		TabStop = .F., ;
		ToolTipText = "Pentru modificare, faceti dublu-click!", ;
		Top = 55, ;
		Width = 313, ;
		Text_simplu1.ControlSource = "porec.nume_parinte", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = , ;
		Text_simplu1.Width = 206, ;
		Lb_simplu1.Caption = "Grupa parinte", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_grupe' AS cus_odata_grupe WITH ;
		Left = 324, ;
		Name = "Cus_odata_grupe", ;
		Top = 123
		*< END OBJECT: ClassLib="configurare.vcx" BaseClass="custom" />

	ADD OBJECT 'img_parinte' AS _image WITH ;
		Height = 24, ;
		Left = 331, ;
		Name = "img_parinte", ;
		Picture = ..\comun\grafice\alege.bmp, ;
		Stretch = 2, ;
		ToolTipText = "Alegeti valuta", ;
		Top = 57, ;
		Width = 24
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="image" />
	
	PROCEDURE do_alege_parinte
		Local loCauta
		loCauta = caut_grupa_gestiune(poRec.id_grupe)
		
		IF !EMPTY(loCauta.id_grupe)
			poRec.parent_id = loCauta.id_grupe
			poRec.nume_parinte = loCauta.nume_grupa
		ELSE
			poRec.parent_id = NULL
			poRec.nume_parinte = ""	
		ENDIF
		
		this.clb_parinte.text_simplu1.Refresh()
		
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		 
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF   INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		IF EMPTY(porec.nume_grupa)
		*!*		Messagebox('Nu ati completat numele grupei!',0+48,"Atentie")
		*!*		This.clb_tx_nume_grupa.SetFocus()
			lcTitlu=[Atentie]
			lcMesaj=[Nu ati completat numele grupei!]	
			lcimagine = [exclam.ico]
			lctip = [Avertizare]
			ofrm_av = CREATEOBJECT([frm_mesaj],lcTitlu,lcimagine,lctip,lcMesaj)
			ofrm_av.show(1)
			RELEASE ofrm_av
			
			This.clb_tx_nume_grupa.SetFocus()			
			plreturn=.F.
		ELSE 
			
			If Alltrim(Upper(This.cus_odata_grupe.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_grupe.cactiune))="UPDATE" And porec.nume_grupa!=pcnume) 
				pcexec=[select * from ]+gcS+[.vgest_nom_grupe where TRIM(nume_grupa)=']+Alltrim(porec.nume_grupa)+[']
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_nume_grupa')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_nume_grupa')>0
					*Messagebox('Mai exista acesta grupa inregistrata!',0+48,"Atentie")
					lcTitlu=[Atentie]
					lcMesaj=[Mai exista acesta grupa inregistrata!]	
					lcimagine = [exclam.ico]
					lctip = [Avertizare]
					ofrm_av = CREATEOBJECT([frm_mesaj],lcTitlu,lcimagine,lctip,lcMesaj)
					ofrm_av.show(1)
					RELEASE ofrm_av
								
					Thisform.clb_tx_nume_grupa.SetFocus()
					Use In exista_nume_grupa
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_grupe.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
				PLRETURN=This.cus_odata_grupe.salvare(This.OREC,This.NID)
			ENDIF  
		ENDIF 
		
		Return PLRETURN
		
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_grupe.cactiune = tcActiune
	ENDPROC

	PROCEDURE clb_parinte.Text_simplu1.DblClick
		Thisform.do_alege_parinte()
	ENDPROC

	PROCEDURE img_parinte.Click
		Thisform.do_alege_parinte()
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_raport_gestiuni AS frm_termin_renunt OF "_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Ct_clb_gestiunec" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_data" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_subgrupart" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_articole" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta_articole
		*m: do_cauta_gestiune
		*m: do_cauta_gestiunec
		*m: do_cauta_subgrupeart
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 230
		Name = "frm_raport_gestiuni"
		Width = 374
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 308
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 67
		Lb_titlu_alb_b121.Caption = "Raport de gestiune"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		BUT_TERMIN1.Left = 343
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Left = 312
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 8
		But_renunt1.Top = 1
	*</PropValue>

	ADD OBJECT '_CHECKBOX1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Se grupeazã dupã gestiunea corespondentã", ;
		ControlSource = "pnGrupezGestc", ;
		Left = 22, ;
		Name = "_CHECKBOX1", ;
		TabIndex = 5, ;
		Top = 157
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_data' AS clb_nr_intre WITH ;
		Height = 29, ;
		Left = 15, ;
		Name = "Clb_data", ;
		TabIndex = 1, ;
		Top = 39, ;
		Width = 314, ;
		tx_n1.Alignment = 3, ;
		tx_n1.ControlSource = "pdData1", ;
		tx_n1.Height = 23, ;
		tx_n1.InputMask = "", ;
		tx_n1.Left = 127, ;
		tx_n1.Name = "tx_n1", ;
		tx_n1.Top = 3, ;
		tx_n1.Value = ({}), ;
		tx_n1.Width = 87, ;
		Lb_simplu1.Caption = "Perioada", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		tx_n2.Alignment = 3, ;
		tx_n2.ControlSource = "pdData2", ;
		tx_n2.Height = 23, ;
		tx_n2.InputMask = "", ;
		tx_n2.Left = 216, ;
		tx_n2.Name = "tx_n2", ;
		tx_n2.Top = 3, ;
		tx_n2.Value = ({}), ;
		tx_n2.Width = 94
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_articole' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(pcSirIdArticole,'')), ;
		cprocedura = thisform.do_cauta_articole, ;
		cvar_afisata = pcSirNumeArticole, ;
		Left = 14, ;
		Name = "Ct_clb_articole", ;
		TabIndex = 4, ;
		Top = 122, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Articole", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_gestiune' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(pnId_gestiune,0)), ;
		cprocedura = thisform.do_cauta_gestiune, ;
		cvar_afisata = pcNumeGest, ;
		Left = 14, ;
		Name = "Ct_clb_gestiune", ;
		TabIndex = 2, ;
		Top = 66, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Gestiune", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_gestiunec' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(pnId_gestiunec,0)), ;
		cprocedura = thisform.do_cauta_gestiunec, ;
		cvar_afisata = pcNumeGestc, ;
		Left = 14, ;
		Name = "Ct_clb_gestiunec", ;
		TabIndex = 6, ;
		Top = 178, ;
		Visible = .F., ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Gestiune coresp.", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_subgrupart' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(pcSirIdSubgrupArt,'')), ;
		cprocedura = thisform.do_cauta_subgrupeart, ;
		cvar_afisata = pcSirNumeSubgrupArt, ;
		Left = 14, ;
		Name = "Ct_clb_subgrupart", ;
		TabIndex = 3, ;
		Top = 94, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Subgrupe articole", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />
	
	PROCEDURE do_cauta_articole
		Local lcXMLArticole
		lcXMLArticole = cauta_articole([2=2], 1, , @pcSirIdArticole, @pcSirNumeArticole)
		This._chECKBOX1.SetFocus()
	ENDPROC

	PROCEDURE do_cauta_gestiune
		Local loCauta
		*!* 09.06.2008
		*!* se pot alege si gestiuni sursa la pret de vanzare (transfer de la pret de vz la pret de vz)
		*!*	modificare	v 2.0.81
		*!*	loCauta = caut_gestiune(pnNr_pag,gnIdUtil,.t.) &&_sursa([4,5,6])
		loCauta = caut_gestiune(pnNr_pag,gnIdUtil)
		*!*	modificare	v 2.0.81	^
		*!* 09.06.2008 ^
		If !Isnull(loCauta) And !Empty(loCauta.id_gestiune)
			pnId_gestiune = loCauta.id_gestiune
			pcNumeGest = loCauta.nume_gestiune
			This.ct_clb_gestiune.Refresh()	
		EndIf
		*!*	This.ct_clb_lucrare.setfocus()
		
	ENDPROC

	PROCEDURE do_cauta_gestiunec
		Local loCauta
		*!*	If Empty(NVL(pnId_gestiune,0))
		*!*		amessagebox("Nu ati ales gestiunea sursa!",0+48,"Atentie")
		*!*		This.ct_clb_gestiune.SetFocus()
		*!*	Else
		*!*		loCauta = caut_gestiune_dest(pnId_gestiune)
		loCauta = caut_gestiune_dest()
			If !Isnull(loCauta) And !Empty(NVL(loCauta.id_gestiune,0))
				pnId_gestiunec = loCauta.id_gestiune
				pcNumeGestc = loCauta.nume_gestiune
		
				This.ct_clb_gestiunec.Refresh()
		*!*			This.ct_clb_furnizor.SetFocus()
			Endif
		*!*	Endif
		
	ENDPROC

	PROCEDURE do_cauta_subgrupeart
		Local lcXMLSubgrupe
		lcXMLSubgrupe = caut_subgrupa_articole([2=2], , .T., 1, , @pcSirIdSubgrupArt, @pcSirNumeSubgrupArt)
		Thisform.ct_clb_articole.SetFocus()
		
	ENDPROC

	PROCEDURE _CHECKBOX1.InteractiveChange
		IF this.Value = 1
			thisform.ct_clb_gestiunec.Visible = .t.
		ELSE 
			thisform.ct_clb_gestiunec.Visible = .f.
		ENDIF 
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_raport_marfa AS _frmbase OF "_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_txDataf" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_txDatai" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_txtpolitica" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_txtutilizator" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_cautare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_cautare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_utilizator" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbPerioada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_politica" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_utilizatori" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_politici" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_LISTARE1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta2
		*p: cnumepol
		*p: cnumeutilizator
		*p: ctitlu
		*p: ntip_raport
		*p: orezult
		*p: pddataf
		*p: pddatai
	*</DefinedPropArrayMethod>

	*<PropValue>
		cnumepol = 
		cnumeutilizator = 
		ctitlu = 
		DoCreate = .T.
		Height = 335
		Name = "frm_raport_marfa"
		ntip_raport = 1
		orezult = 
		pddataf = {}
		pddatai = {}
		Width = 377
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 2
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 65
		_shape2.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "Alegeti felul raportului"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		Lb_titlu_alb_b121.ZOrderSet = 5
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 6
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 6
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_txDataf' AS _textbox WITH ;
		ControlSource = "thisform.pddataf", ;
		DisabledForeColor = 0,0,0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Height = 22, ;
		Left = 140, ;
		Name = "_txDataf", ;
		TabIndex = 3, ;
		Top = 108, ;
		Width = 111, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT '_txDatai' AS _textbox WITH ;
		ControlSource = "thisform.pddatai", ;
		DisabledForeColor = 0,0,0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Height = 22, ;
		Left = 24, ;
		Name = "_txDatai", ;
		TabIndex = 2, ;
		Top = 108, ;
		Width = 106, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT '_txtpolitica' AS _textbox WITH ;
		ControlSource = "thisform.cnumepol", ;
		DisabledForeColor = 0,0,0, ;
		Enabled = .F., ;
		FontItalic = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Height = 22, ;
		Left = 111, ;
		Name = "_txtpolitica", ;
		TabIndex = 10, ;
		Top = 280, ;
		Width = 215, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT '_txtutilizator' AS _textbox WITH ;
		ControlSource = "thisform.cnumeutilizator", ;
		DisabledForeColor = 0,0,0, ;
		Enabled = .F., ;
		FontItalic = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Height = 22, ;
		Left = 111, ;
		Name = "_txtutilizator", ;
		TabIndex = 9, ;
		Top = 195, ;
		Width = 215, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'But_cautare1' AS but_cautare WITH ;
		Left = 327, ;
		Name = "But_cautare1", ;
		TabIndex = 14, ;
		Top = 191, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_cautare2' AS but_cautare WITH ;
		caction = do_cauta2, ;
		Left = 327, ;
		Name = "But_cautare2", ;
		TabIndex = 15, ;
		Top = 276, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'BUT_LISTARE1' AS but_listare WITH ;
		Left = 315, ;
		Name = "BUT_LISTARE1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 33, ;
		Left = 7, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 34, ;
		Width = 360, ;
		_edbase1.ControlSource = "thisform.ctitlu", ;
		_edbase1.FontName = "Arial Narrow", ;
		_edbase1.FontSize = 10, ;
		_edbase1.Format = "k", ;
		_edbase1.Height = 27, ;
		_edbase1.Left = 68, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.TabIndex = 1, ;
		_edbase1.Top = 3, ;
		_edbase1.Width = 287, ;
		_LBBASE1.Caption = "Titlu raport", ;
		_LBBASE1.FontName = "Arial Narrow", ;
		_LBBASE1.FontSize = 10, ;
		_LBBASE1.Left = 11, ;
		_LBBASE1.Name = "_LBBASE1", ;
		_LBBASE1.TabIndex = 2, ;
		_LBBASE1.Top = 7
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'lb_politica' AS label WITH ;
		Alignment = 2, ;
		BackColor = 255,255,255, ;
		Caption = "Politica de preturi", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 20, ;
		Name = "lb_politica", ;
		TabIndex = 11, ;
		Top = 237, ;
		Width = 88, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lb_utilizator' AS label WITH ;
		Alignment = 2, ;
		BackColor = 255,255,255, ;
		Caption = "Utilizatori", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 15, ;
		Name = "lb_utilizator", ;
		TabIndex = 12, ;
		Top = 152, ;
		Width = 63, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lbPerioada' AS label WITH ;
		Alignment = 2, ;
		BackColor = 255,255,255, ;
		Caption = "Perioada", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 17, ;
		Name = "lbPerioada", ;
		TabIndex = 13, ;
		Top = 74, ;
		Width = 63, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'opt_politici' AS _optiongrup WITH ;
		BorderStyle = 0, ;
		Left = 20, ;
		Name = "opt_politici", ;
		TabIndex = 5, ;
		Top = 256, ;
		Option1.Caption = "Toate", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.Caption = "Politica", ;
		Option2.FontName = "Arial Narrow", ;
		Option2.FontSize = 10, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'opt_utilizatori' AS _optiongrup WITH ;
		BorderStyle = 0, ;
		Left = 20, ;
		Name = "opt_utilizatori", ;
		TabIndex = 4, ;
		Top = 173, ;
		Option1.Caption = "Toti", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.Caption = "Utilizator", ;
		Option2.FontName = "Arial Narrow", ;
		Option2.FontSize = 10, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BackStyle = 0, ;
		Height = 66, ;
		Left = 7, ;
		Name = "Shape1", ;
		Top = 162, ;
		Width = 360, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackStyle = 0, ;
		Height = 66, ;
		Left = 7, ;
		Name = "Shape2", ;
		Top = 247, ;
		Width = 360, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape3' AS shape WITH ;
		BackStyle = 0, ;
		Height = 66, ;
		Left = 9, ;
		Name = "Shape3", ;
		Top = 84, ;
		Width = 360, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE do_cauta
		If Thisform.opt_utilizatori.Value=2
			pcselect = [select distinct utilizator from vvanzari_detalii]
			pcfiltru = [1=2]
			pcschema = []
			pcorder = [1]
			pccoloane = [Utilizator]
			pcTitlu = [Utilizator]
			pcTitluColoane = [Utilizator]
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")		&& 11.07.2007
			If !Empty(locauta.utilizator)
				Thisform.cnumeutilizator=locauta.utilizator
				Thisform._txtutilizator.Refresh
			Endif
		Endif
	ENDPROC

	PROCEDURE do_cauta2
		If Thisform.opt_politici.Value=2
			pcselect = [select distinct nume_lista_preturi from vvanzari_detalii]
			pcfiltru = [1=2]
			pcschema = []
			pcorder = [1]
			pccoloane = [nume_lista_preturi]
			pcTitlu = [Politica de preturi]
			pcTitluColoane = [Politica de preturi]
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")		&& 11.07.2007
			If !Empty(locauta.nume_lista_preturi)
				Thisform.cnumepol=locauta.nume_lista_preturi
				Thisform._txtpolitica.Refresh
			Endif
		Endif
	ENDPROC

	PROCEDURE do_listare
		Do Case
		Case Empty(Thisform.pddatai)
			aMessagebox("Nu ati completat data initiala!",0+48,"Atentie")
			Thisform._txDatai.SetFocus()
		Case Empty(Thisform.pddataf)
			aMessagebox("Nu ati completat data finala!",0+48,"Atentie")
			Thisform._txDataf.SetFocus()
		Case Thisform.pddatai>Thisform.pddataf
			aMessagebox("Data initiala trebuie sa fie mai mica decat data finala a raportului!",0+48,"Atentie")
			Thisform._txDatai.SetFocus()
		Otherwise
			Private pcschema,pcselect,pcfiltru,pcorder,pcgroup,poLista
			Store '' To poLista
			lnUtil=Thisform.opt_utilizatori.Value
			lnPol=Thisform.opt_politici.Value
			pcschema=[]
			Do Case
			Case Thisform.ntip_raport=1		&&	centralizator pe articole
				pcselect=[select utilizator,nume_lista_preturi,denumire,um,pret,diferenta,]+;
					[SUM(cantitate) as cantitate from ]+gcS+[.vvanzari_detalii where 1=2]
				pcorder=[nume_lista_preturi,utilizator,denumire,um,pret,diferenta]
				pcgroup=[nume_lista_preturi,utilizator,denumire,um,pret,diferenta]
				lcRaport = [rap_marfuri_lista_centr]
			Case Thisform.ntip_raport=2		&& rulaje articole
				pcselect=[select * from ] + gcS + [.vvanzari_detalii where 1=2]
				pcorder=[dataora,numar_act,utilizator,denumire,um,pret]
				pcgroup=[]
				lcRaport = [rap_marfuri_lista_desf]
			Case Thisform.ntip_raport=3		&& centralizator valoric
				pcselect=[select nume_lista_preturi, sum(cantitate*pret-diferenta) as valoare from vvanzari_detalii where 1=2]
				pcorder=[nume_lista_preturi]
				pcgroup=[nume_lista_preturi]
				lcRaport = [rap_marfuri_lista_valoric]
			Endcase
		*!*		pcfiltru=[trunc(dataora) between to_date(']+Dtos(Thisform.pddatai)+[','YYYYMMDD') and ]+;
		*!*			[to_date(']+Dtos(Thisform.pddataf)+[','YYYYMMDD') ]+;
		*!*			IIF(lnUtil=2,[ and utilizator=']+Upper(Alltrim(Thisform.cnumeutilizator))+['],[])+;
		*!*			IIF(lnPol=2,[ and nume_lista_preturi=']+Upper(Alltrim(Thisform.cnumepol))+['],[])
			pcfiltru=[dataora between to_date(']+Ttoc(Thisform.pddatai,1)+[','YYYYMMDD HH24:MI:SS') and ]+;
				[to_date(']+Ttoc(Thisform.pddataf,1)+[','YYYYMMDD HH24:MI:SS') ]+;
				IIF(lnUtil=2,[ and utilizator=']+Upper(Alltrim(Thisform.cnumeutilizator))+['],[])+;
				IIF(lnPol=2,[ and nume_lista_preturi=']+Upper(Alltrim(Thisform.cnumepol))+['],[])+gcCondSucursala
		
			llAfiseaza=.F.
			gencursor('polista','crsmarfuri',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza,pcgroup)
			poLista.ca_baza1.afisare()
			pcTitlu = Thisform.ctitlu
			pcPerioada = Alltrim(Transform(Thisform.pddatai)) + [ - ] + Alltrim(Transform(Thisform.pddataf))
		
		*!*	modificare 28.02.2008
			Thisform.AlwaysOnTop=.F.
			goExport.export2frx([crsmarfuri],lcRaport)
			Thisform.AlwaysOnTop=.T.
		*!*		If Reccount('crsmarfuri')>0
		*!*			Thisform.AlwaysOnTop=.F.
		*!*			pcDataora = get_Ora(2)
		*!*			Select crsmarfuri
		*!*			Report Format (lcRaport) To Printer Prompt Noconsole Preview
		*!*			Thisform.AlwaysOnTop=.T.
		*!*		Else
		*!*			aMessagebox("Nu exista inregistrari pentru listare!",48,"Atentie")
		*!*		Endif
		*!*	modificare 28.02.2008	^
		
			If Used('crsmarfuri')
				Use In crsmarfuri
			Endif
		
		Endcase
		
	ENDPROC

	PROCEDURE Init
		Lparameters tnTip
		*!*	1 - centralizator
		*!*	2 - desfasurat
		Thisform.ntip_raport=Iif(Empty(tnTip),1,tnTip)
		
		this.ctitlu = [VANZARE MARFA LA PRET DE LISTA - ]+IIF(thisform.ntip_raport=1,[CENTRALIZATOR PE ARTICOLE],IIF(thisform.ntip_raport=2,[RULAJE ARTICOLE],[CENTRALIZATOR VALORIC PE LISTE DE PRETURI]))
		
		ltDataora = get_ora()
		ldDataora = TTOD(ltDataora) 
		this.pddatai=  DTOT(ldDataora)
		this.pddataf = DTOT(ldDataora)
		
		DODEFAULT()
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
	ENDPROC

	PROCEDURE opt_politici.Click
		If This.Value=1
			Thisform._txtpolitica.Value=[]
			Thisform.but_cautare2.Visible=.F.
		Else
			Thisform.but_cautare2.Visible=.T.
		Endif
	ENDPROC

	PROCEDURE opt_utilizatori.Click
		If This.Value=1
			Thisform._txtutilizator.Value=[]
			Thisform.but_cautare1.Visible=.F.
		Else
			Thisform.but_cautare1.Visible=.T.
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_raport_stoc AS frm_termin_renunt OF "_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optOrder" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="OptPerioada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_txtgestiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtData1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtData2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ckTotalUM" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_stoc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optgestiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="OptArticol" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="OptGrupe" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_cautare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ckpretachi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optCont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optAcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optSubgrupa" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: make_cursor_listare
		*m: select_stoc
		*p: csubtitlu
		*p: ctitlu
		*p: ddatafinal
		*p: ddatainit
		*p: orezult
		*p: pcnumegest
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		csubtitlu = .F.
		ctitlu = 
		DoCreate = .T.
		Height = 337
		Name = "frm_raport_stoc"
		orezult = 
		pcnumegest = 
		Width = 375
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 6
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 65
		_shape2.ZOrderSet = 8
		Lb_titlu_alb_b121.Caption = "Alegeti felul raportului"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 20
		Lb_titlu_alb_b121.ZOrderSet = 9
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 15
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 14
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Left = 228
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 19
		But_renunt1.Top = 0
		But_renunt1.Visible = .F.
		But_renunt1.ZOrderSet = 15
	*</PropValue>

	ADD OBJECT '_txtgestiuni' AS _textbox WITH ;
		ControlSource = "thisform.pcnumegest", ;
		DisabledForeColor = 0,0,0, ;
		Enabled = .F., ;
		FontItalic = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Height = 22, ;
		Left = 111, ;
		Name = "_txtgestiuni", ;
		TabIndex = 21, ;
		Top = 108, ;
		Width = 215, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'But_cautare1' AS but_cautare WITH ;
		Left = 327, ;
		Name = "But_cautare1", ;
		TabIndex = 8, ;
		Top = 104, ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Left = 282, ;
		Name = "But_excel1", ;
		TabIndex = 14, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		caction = do_listare, ;
		Left = 313, ;
		Name = "But_listare1", ;
		TabIndex = 13, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_stoc' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cu stoc final # 0", ;
		Height = 17, ;
		Left = 11, ;
		Name = "Ck_stoc", ;
		TabIndex = 9, ;
		Top = 253, ;
		Width = 106, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'ckpretachi' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Pret achizitie vizibil", ;
		Height = 17, ;
		Left = 240, ;
		Name = "ckpretachi", ;
		TabIndex = 10, ;
		Top = 253, ;
		Visible = .F., ;
		Width = 119, ;
		ZOrderSet = 27
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'ckTotalUM' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cu total pe UM", ;
		Height = 17, ;
		Left = 132, ;
		Name = "ckTotalUM", ;
		TabIndex = 11, ;
		Top = 253, ;
		Width = 98, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 33, ;
		Left = 7, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 34, ;
		Width = 360, ;
		ZOrderSet = 24, ;
		_edbase1.ControlSource = "thisform.ctitlu", ;
		_edbase1.FontName = "Arial Narrow", ;
		_edbase1.FontSize = 10, ;
		_edbase1.Format = "k", ;
		_edbase1.Height = 27, ;
		_edbase1.Left = 68, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.TabIndex = 1, ;
		_edbase1.Top = 3, ;
		_edbase1.Width = 287, ;
		_LBBASE1.Caption = "Titlu raport", ;
		_LBBASE1.FontName = "Arial Narrow", ;
		_LBBASE1.FontSize = 10, ;
		_LBBASE1.Left = 11, ;
		_LBBASE1.Name = "_LBBASE1", ;
		_LBBASE1.TabIndex = 2, ;
		_LBBASE1.Top = 7
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Label1' AS label WITH ;
		Alignment = 2, ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		Caption = "Selectie", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 15, ;
		Name = "Label1", ;
		TabIndex = 24, ;
		Top = 68, ;
		Width = 38, ;
		ZOrderSet = 20
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		Alignment = 2, ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		Caption = "Grupat dupa", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 15, ;
		Name = "Label2", ;
		TabIndex = 22, ;
		Top = 161, ;
		Width = 61, ;
		ZOrderSet = 21
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		Alignment = 2, ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Ordonat dupa", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 15, ;
		Name = "Label3", ;
		TabIndex = 23, ;
		Top = 209, ;
		Width = 67, ;
		ZOrderSet = 31
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'optAcont' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Analitic", ;
		Height = 17, ;
		Left = 71, ;
		Name = "optAcont", ;
		TabIndex = 9, ;
		Top = 185, ;
		Width = 57, ;
		ZOrderSet = 29
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'OptArticol' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 1, ;
		Height = 28, ;
		Left = 11, ;
		Name = "OptArticol", ;
		SpecialEffect = 1, ;
		TabIndex = 4, ;
		Top = 128, ;
		Value = 0, ;
		Width = 56, ;
		ZOrderSet = 19, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Articol", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 0, ;
		Option1.Width = 46
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'optCont' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cont", ;
		Height = 17, ;
		Left = 17, ;
		Name = "optCont", ;
		TabIndex = 9, ;
		Top = 185, ;
		Width = 44, ;
		ZOrderSet = 28
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'optgestiuni' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 1, ;
		Height = 28, ;
		Left = 11, ;
		Name = "optgestiuni", ;
		SpecialEffect = 1, ;
		TabIndex = 2, ;
		Top = 84, ;
		Value = 0, ;
		Width = 65, ;
		ZOrderSet = 18, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Gestiuni", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 0, ;
		Option1.Width = 55
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'OptGrupe' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 1, ;
		Height = 28, ;
		Left = 11, ;
		Name = "OptGrupe", ;
		SpecialEffect = 1, ;
		TabIndex = 3, ;
		Top = 105, ;
		Value = 0, ;
		Width = 96, ;
		ZOrderSet = 22, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Grupe gestiuni", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 0, ;
		Option1.Width = 86
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'optOrder' AS optiongroup WITH ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		BorderColor = 0,0,0, ;
		BorderStyle = 1, ;
		ButtonCount = 2, ;
		Height = 27, ;
		Left = 7, ;
		Name = "optOrder", ;
		SpecialEffect = 1, ;
		TabIndex = 16, ;
		Top = 221, ;
		Value = 1, ;
		Width = 360, ;
		ZOrderSet = 2, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Cod material, denumire", ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 148, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Denumire, cod material", ;
		Option2.Height = 17, ;
		Option2.Left = 178, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option2.Width = 147
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'OptPerioada' AS _optiongrup WITH ;
		AutoSize = .T., ;
		BorderStyle = 0, ;
		Height = 46, ;
		Left = 12, ;
		Name = "OptPerioada", ;
		TabIndex = 12, ;
		Top = 279, ;
		Width = 100, ;
		ZOrderSet = 10, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Luna curenta", ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "O perioada", ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'optSubgrupa' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Subgrupa articole", ;
		Height = 17, ;
		Left = 138, ;
		Name = "optSubgrupa", ;
		TabIndex = 9, ;
		Top = 185, ;
		Width = 115, ;
		ZOrderSet = 30
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BackStyle = 0, ;
		Height = 83, ;
		Left = 7, ;
		Name = "Shape1", ;
		Top = 78, ;
		Width = 360, ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackStyle = 0, ;
		Height = 38, ;
		Left = 7, ;
		Name = "Shape2", ;
		Top = 170, ;
		Width = 360, ;
		ZOrderSet = 3
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape3' AS shape WITH ;
		BackStyle = 0, ;
		Height = 53, ;
		Left = 7, ;
		Name = "Shape3", ;
		Top = 275, ;
		Width = 360, ;
		ZOrderSet = 5
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape5' AS shape WITH ;
		BackStyle = 0, ;
		Height = 21, ;
		Left = 7, ;
		Name = "Shape5", ;
		Top = 251, ;
		Width = 360, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'txtData1' AS _textbox WITH ;
		Alignment = 3, ;
		Format = "RKD", ;
		Height = 23, ;
		InputMask = "99/99/9999", ;
		Left = 120, ;
		Name = "txtData1", ;
		TabIndex = 17, ;
		Top = 302, ;
		Visible = .F., ;
		Width = 78, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtData2' AS _textbox WITH ;
		Alignment = 3, ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "99/99/9999", ;
		Left = 203, ;
		Name = "txtData2", ;
		TabIndex = 18, ;
		Top = 302, ;
		Visible = .F., ;
		Width = 78, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE do_cauta
		Do Case
			Case This.optgestiuni.Value = 1
		*!*		DO CASE
		*!*			CASE "-1" $ gcGestPermis
		*!*				pcselect = [select * from ] + gcs + [.vnom_GESTIUNI where inactiv = 0 and nr_pag = ?gnTipGest ]
		*!*				pcfiltru = [2=2]
		*!*				pcschema = ['']
		*!*				pcorder = [nume_gestiune]
		*!*				pccoloane = [nume_gestiune,cgest]
		*!*				pcTitlu = [Alegeti gestiunea]
		*!*				pcTitluColoane = [Gestiune,Indicativ]
		*!*				locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.t.)
		*!*			OTHERWISE
		*!*				pcselect = [select * from ] + gcs + [.vnom_GESTIUNI where inactiv = 0 and nr_pag = ?gnTipGest and id_gestiune in ] + ;
		*!*				[(select g.id_gestiune from ] + gcs + [.vgest_coresp_grupe_gestiuni g join ] + ;
		*!*				gcs + [.vgest_coresp_util_grupe u on g.id_grupe = u.id_grupe and u.id_util = ?gnIdUtil)]
		*!*				pcfiltru = []
		*!*				pcschema = ['']
		*!*				pcorder = [nume_gestiune]
		*!*				pccoloane = [nume_gestiune,cgest]
		*!*				pcTitlu = [Alegeti gestiunea]
		*!*				pcTitluColoane = [Gestiune,Indicativ]
		*!*				locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.t.)
		*!*		ENDCASE
		*!*	modificare	ROAGEST	v 2.0.6
		*!*		Do Case
		*!*		Case "-1" $ gcGestPermis
		*!*			pcselect = [select * from vnom_GESTIUNI]
		*!*			pcFiltruOrig = [inactiv = 0 and nr_pag = ?gnTipGest]
		*!*			pcfiltru = [1=2]
		*!*			pcschema = []
		*!*			pcorder = [nume_gestiune]
		*!*			pccoloane = [nume_gestiune,cgest]
		*!*			pcTitlu = [Alegeti gestiunea]
		*!*			pcTitluColoane = [Gestiune,Indicativ]
		*!*			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.T.,pcFiltruOrig)		&& 11.07.2007
		*!*		Otherwise
				pcselect = [select * from vnom_GESTIUNI]
				pcFiltruOrig = 	[inactiv = 0 and nr_pag = ?gnTipGest and id_gestiune in ] + ;
					[(select g.id_gestiune from vgest_coresp_grupe_gestiuni g join ] + ;
					[vgest_coresp_util_grupe u on g.id_grupe = u.id_grupe and u.id_util = ?gnIdUtil)]
				pcfiltru = [1=2]
				pcschema = []
				pcorder = [nume_gestiune]
				pccoloane = [nume_gestiune,cgest]
				pcTitlu = [Alegeti gestiunea]
				pcTitluColoane = [Gestiune,Indicativ]
				locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.T.,pcFiltruOrig )		&& 11.07.2007
		*!*		EndCase
		*!*	modificare	ROAGEST	v 2.0.6	^
				This.pcnumegest = locauta.nume_gestiune
			Case This.optGrupe.Value = 1
				pcselect = [select * from vGEST_nom_grupe]
				pcFiltruOrig = [inactiv = 0]
				pcfiltru = [1=2]
				pcschema = []
				pcorder = [nume_grupa]
				pccoloane = [nume_grupa]
				pcTitlu = [Alegeti grupa de gestiuni]
				pcTitluColoane = [Grupa]
				locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.F.,pcFiltruOrig )		&& 11.07.2007
				This.pcnumegest = locauta.nume_grupa
			Case This.optArticol.Value = 1
				pcselect = [select * from vNom_articole]
				pcFiltruOrig = [inactiv = 0]
				pcfiltru = [1=2]
				pcschema = []
				pcorder = [denumire,codmat,cont]
				pccoloane = [denumire,codmat,cont]
				pcTitlu = [Alegeti articolul]
				pcTitluColoane = [Articol,Cod material,Cont]
				locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.T.,pcFiltruOrig )		&& 11.07.2007
				This.pcnumegest = locauta.denumire
			Otherwise
				amessagebox("Nu ati ales criteriul de grupare!",0+48,"Atentie")
				Thisform.ed_tx_simplu1.SetFocus()
				Return
		Endcase
		
		This._txtgestiuni.Refresh
		This.orezult = locauta
		
	ENDPROC

	PROCEDURE do_excel
		Private postocuri,pcschema,pcselect,pcfiltru,pcorder,osel,pcFiltruOriginal,pcGrupCont,pcGrupAcont,pcSelectStoc,pcgrupgest
		Store [] To postocuri,pcFiltruOriginal,pcHeaderGrup,pcSelectStoc,pcGrupCont,pcGrupAcont,pcgrupgest
		
		thisform.make_cursor_listare()
		
		LOCAL lcFileName
		lcFileName = ""
		*!*	THIS.creeaza_raport()
		
		If Used('crsStocuri')
			If Reccount('crsStocuri') > 0
				Thisform.AlwaysOnTop=.F.
					lcFileName = strtranx(this.lb_titlu_alb_b121.Caption, "([^a-zA-Z0-9])", [_] )			
					export_xls('crsStocuri', lcFileName)
				Thisform.AlwaysOnTop=.T.
			Else
				aMESSAGEBOX("Nu exista inregistrari pentru optiunile selectate!",0+48,"Atentie")
			Endif
			Use In crsStocuri
		Endif
		
		Return .F.
		
		
		
	ENDPROC

	PROCEDURE do_listare
		Local lcRaport, lcOrderGrup
		Private postocuri,pcschema,pcselect,pcfiltru,pcorder,osel,pcFiltruOriginal,pcGrupCont,pcGrupAcont,pcGrupSubgrupa,pcSelectStoc,pcgrupgest,pcSubtitlu
		Private pcConditieGrup, pcTotalGrup
		Store [] To postocuri,pcFiltruOriginal,pcHeaderGrup,pcSelectStoc,pcGrupCont,pcGrupAcont,pcGrupSubgrupa,pcgrupgest,pcSubtitlu
		Local llTotalUm, lcOrder2
		llTotalUm = (Thisform.ckTotalUM.Value = 1)
		llSubgrupa = (Thisform.optsubgrupa.Value = 1)
		llAcont = (Thisform.optAcont.Value = 1)
		llCont = (Thisform.optCont.Value = 1)
		pcConditieGrup = Iif(m.llCont, [+Padr(ALLTRIM(nvl(cont,'')), 4, ' ')], []) + Iif(m.llAcont, [+Padr(ALLTRIM(nvl(acont,'')), 4, ' ')], []) + Iif(m.llSubgrupa, [+Padr(ALLTRIM(nvl(subgrupa,'')), 50, ' ')], [])
		If !Empty(m.pcConditieGrup)
			pcConditieGrup = Substr(m.pcConditieGrup, 2)
		ELSE 
			pcConditieGrup = ["1=1"]
		Endif
		
		pcTotalGrup = Iif(m.llCont, "+' Cont: '+ALLTRIM(nvl(cont,''))", "") + Iif(m.llAcont, "+' Analitic: '+IIF(EMPTY(nvl(acont,'')), 'Fara', ALLTRIM(nvl(acont,'')))", "") + Iif(m.llSubgrupa, "+' Subgrupa: '+IIF(EMPTY(nvl(subgrupa,'')), 'Fara', ALLTRIM(nvl(subgrupa,'')))", "")
		lcOrderGrup = Iif(m.llCont, ",cont", "") + Iif(m.llAcont, ",acont", "") + Iif(m.llSubgrupa, ",subgrupa", "")
		If !Empty(m.lcOrderGrup)
			lcOrderGrup = Substr(m.lcOrderGrup, 2)
		ENDIF
		
		lcOrder2 = IIF(!Empty(m.lcOrderGrup), m.lcOrderGrup + ",", "") + Iif(This.optOrder.Value = 1, [codmat,denumire,serie,], [denumire,codmat,serie,])
		 
		Thisform.make_cursor_listare()
		
		If Used('crsStocuri')
			pcGrupCont = Strtran(m.pcGrupCont,'a.','',1,1,1)
			pcGrupAcont = Strtran(m.pcGrupAcont,'a.','',1,1,1)
		
		
			If Inlist(gnTipGest,6,7)
				If This.ckPretAchi.Value = 0
					lcRaport = [rap_stocvanz_grup.FRX]
				Else
					x = xmenu('Stoc grupat dupa pret achizitie, pret vanzare;Stoc grupat dupa pret achizitie, pret vanzare - simplu')
					If x = 1
						lcRaport = [rap_stocvanzachi_grup.FRX]
					Else
						lcRaport = [rap_stocvanzachi_simplu_grup.FRX]
						If Used('crsStocuri')
							Delete From crsStocuri Where g4 <> 0 And g1 <> 0 And g5 = 0
						Endif
					Endif
				Endif
			Else
				If !m.llTotalUm
					* Creez totaluri pe cont + acont + subgrupa
					Select * From crsStocuri Where g4 = 0 Into Cursor crsStocuriTemp && doar articolele, fara subtotaluri pe unitati de masura
					USE IN (SELECT('crsStocuri'))
					
					lcOrder2 = IIF(RIGHT(m.lcOrder2, 1) = ",", LEFT(m.lcOrder2, LEN(m.lcOrder2) - 1),m.lcOrder2)
					Select * From crsStocuriTemp  Into Cursor crsStocuri Order By &lcOrder2
					USE IN (SELECT('crsStocuriTemp'))
					lcRaport = [rap_stocachi_grup3.FRX] && raport stoc fara total pe unitati de masura
				ELSE 	
					lcRaport = [rap_stocachi_grup.FRX] && raport stoc cu total pe unitati de masura
				Endif
			ENDIF && Inlist(gnTipGest,6,7)
		
			pcTitlu = Thisform.ctitlu
			pcDataora = get_Ora(2)
			pcSubtitlu = Thisform.csubtitlu
		
			If Reccount('crsStocuri') > 0
				Thisform.AlwaysOnTop=.F.
				Select crsStocuri
				Keyboard '{CTRL+F10}'
				goExport.export2frx([crsStocuri], m.lcRaport, , , , , , .T.)
				*Report Format &lcRaport To Printer Prompt Noconsole Preview
		
				Thisform.AlwaysOnTop=.T.
			Else
				aMESSAGEBOX("Nu exista inregistrari pentru optiunile selectate!",0+48,"Atentie")
			Endif
			Use In crsStocuri
		Endif
		
		Return .F.
		
	ENDPROC

	PROCEDURE make_cursor_listare
		Local lnOrderType
		lnOrderType = This.optOrder.Value && 1 = CODMAT, DENUMIRE; 2 = DENUMIRE, CODMAT
		
		Local lcPretAchizitie,lcColoanaPretAchizitie && le folosesc la gestiunea la pret de vanzare
		Store '' To lcPretAchizitie,lcColoanaPretAchizitie
		
		
		If Inlist(gnTipGest, 6,7)
			If Thisform.ckPretAchi.Value= 1
				lcPretAchizitie = [a.pret]
				lcColoanaPretAchizitie = [pret]
			Endif
			lcPret = [a.pretv+a.tvav]
			lcColoanaPret = [pretv]
		Else
			lcPret = [a.pret]
			lcColoanaPret = [pret]
		Endif
		
		If Thisform.optPerioada.Value = 1
			Thisform.ddatainit={}
			Thisform.ddatafinal = {}
		Else
			Thisform.ddatainit = Thisform.txtData1.Value
			Thisform.ddatafinal = Thisform.txtData2.Value
		Endif
		
		lcSelectieCont = [NVL(a.cont,'')]
		lcSelectieAcont = [NVL(a.acont,'')]
		lcSelectieSubgrupa = [subgrupa]
		lcSelectieArticol = [b.codmat,b.id_articol,b.denumire,a.serie]
		lcSelectieUM = [b.um,b.cant_bax,b.um2]
		lcSelectieGestiune = [c.id_gestiune, c.nume_gestiune, c.cgest]
		lcSelectieAltele = []
		
		osel = This.orezult
		pcHeaderGrup = []
		pcGrupGest = [EOF()]
		pcGrupCont = [EOF()]
		pcGrupAcont = [EOF()]
		pcGrupSubgrupa = [EOF()]
		pcFiltruOriginal = [2=2]
		
		lcOrder = []
		lcGroup = []
		
		lcSelectG1 = [-1 as g1,]
		lcSelect1 = []
		lcSelectG2 = [-1 as g2,]
		lcSelect2 = []
		lcSelectG3 = [-1 as g3,]
		lcSelect3 = []
		lcSelectG31 = [-1 as g31,]
		lcSelect31 = []
		
		lcGroupG1 = []
		lcGroupCont = []
		lcGroupAcont = []
		lcGroupSubgrupa = []
		lcOrder2 = Iif(lnOrderType = 1, [b.codmat,b.denumire,a.serie,], [b.denumire,b.codmat,a.serie,])
		
		If This.optCont.Value = 1
			pcGrupCont = lcSelectieCont
			lcSelectG2 = [grouping_id(] + lcSelectieCont +[) as g2,]
			lcSelect2 = lcSelectieCont + [ as cont,]
			lcGroupCont = lcSelectieCont + [,]
		*!*		lcOrder = lcOrder + [g2,]
		*!*		lcOrder2 = lcSelectieCont + [,]
			lcOrder = lcOrder + lcSelectieCont + [,g2,]
		Endif
		
		If This.optAcont.Value = 1
			pcGrupAcont = lcSelectieAcont
			lcSelectG3 = [grouping_id(] + lcSelectieAcont + [) as g3,]
			lcSelect3 = lcSelectieAcont + [ as acont,]
			lcGroupAcont = lcSelectieAcont + [,]
			lcOrder = lcOrder + lcSelectieAcont + [,g3,]
		*!*		lcOrder = lcOrder + [g3,]
		*!*		lcOrder2 = lcSelectieAcont + [,]
		Endif
		If This.optSubgrupa.Value = 1
			pcGrupSubgrupa = lcSelectieSubgrupa
			lcSelectG31 = [grouping_id(] + lcSelectieSubgrupa + [) as g31,]
			lcSelect31 = lcSelectieSubgrupa + [ as subgrupa,]
			lcGroupSubgrupa = lcSelectieSubgrupa + [,]
			lcOrder = lcOrder + lcSelectieSubgrupa + [,g31,]
		
		Endif
		
		
		Do Case
			Case This.optgestiuni.Value = 1
				If Type('osel')#'O'
					aMESSAGEBOX("Alegeti gestiunea!",0+48,"Atentie")
					Return .F.
				Endif
		
				If Alltrim(osel.nume_gestiune) # [<TOATE INREGISTRARILE>]
					nGest = osel.id_gestiune
					pcFiltruOriginal = pcFiltruOriginal + [ and a.id_gestiune = ?nGest]
				Else
					pcFiltruOriginal = pcFiltruOriginal + [ and a.id_gestiune in ] + ;
						[(select g.id_gestiune from vgest_coresp_grupe_gestiuni g join ] + ;
						gcs + [.vgest_coresp_util_grupe u on g.id_grupe = u.id_grupe and u.id_util = ?gnIdUtil)]
				Endif
		*!*
				pcHeaderGrup = [Gestiune : ]
				pcGrupGest = [nume_gestiune]
				lcSelectG1 = [grouping_id(] + lcSelectieGestiune + [) as g1,]
				lcSelect1 = lcSelectieGestiune + [,]
				lcGroupG1 = [(] + lcSelectieGestiune + [),]
				lcSelectieAltele = lcSelectieArticol + [,] + lcSelectieUM + [,]
				lcOrder = [g1,c.nume_gestiune,] + lcOrder
		*!*		lcOrder = [g1,] + lcOrder
		*!*		lcOrder2 = [c.nume_gestiune,] + lcOrder2
		*!*	^
			Case This.optGrupe.Value = 1
				If Type('osel')#'O'
					aMESSAGEBOX('Alegeti grupa!',0+48,"Atentie")
					Return .F.
				Endif
				If Alltrim(osel.nume_grupa) # [<TOATE INREGISTRARILE>]
					nGrupa = osel.id_grupe
					pcFiltruOriginal = pcFiltruOriginal + [ and a.id_gestiune in (select id_gestiune from ] + gcs + [.vgest_coresp_grupe_gestiuni where id_grupe =?nGrupa)]
				Endif
		*!*
				lcSelectieAltele = lcSelectieArticol + [,] + lcSelectieGestiune + [,] + lcSelectieUM + [,]
		*!*	^
			Case This.optArticol.Value = 1
				If Type('osel')#'O'
					aMESSAGEBOX('Alegeti articolul!',0+48,"Atentie")
					Return .F.
				Endif
		
				If Alltrim(osel.denumire) # [<TOATE INREGISTRARILE>]
					nArticol = osel.id_articol
					pcFiltruOriginal = pcFiltruOriginal + [ and a.id_articol = ?nArticol]
				Endif
		*!*
				pcGrupGest = [denumire]
				pcHeaderGrup = [Articol : ]
				lcGroupG1 = [(] + lcSelectieArticol + [),]
				lcSelectG1 = [grouping_id(] + lcSelectieArticol + [) as g1,]
				lcSelect1 = lcSelectieArticol + [,]
				lcSelectieAltele = lcSelectieGestiune + [,] + lcSelectieUM + [,]
				lcOrder = Iif(lnOrderType = 1, [g1,b.codmat,b.denumire,], [g1,b.denumire,b.codmat,]) + lcOrder
				lcOrder2 = []
		*!*		lcOrder = [g1,] + lcOrder
		*!*		lcOrder2 = [b.denumire,b.codmat,] + lcOrder2
		*!*	^
			Otherwise
				lcSelectieAltele = lcSelectieGestiune + [,] + lcSelectieArticol + [,] + lcSelectieUM + [,]
		Endcase
		
		If This.ck_stoc.Value = 1
			pcFiltruOriginal = pcFiltruOriginal + [ and a.cants + a.cant - a.cante<>0]
		Endif
		
		pcselect = [select ] + lcSelectG1 + lcSelectG2 + lcSelectG3 + lcSelectG31 + ;
			[grouping_id(] + lcPret + [,]
		If !Empty(lcPretAchizitie) And !Empty(lcColoanaPretAchizitie)
			pcselect = pcselect + lcPretAchizitie +[ , ]
		Endif
		pcselect = pcselect +lcSelectieAltele + [a.datain) as g4,] + ;
			[grouping_id(b.um2, b.um) as g5,] + ;
			lcSelect1 + lcSelect2 + lcSelect3 + lcSelect31 + ;
			lcSelectieAltele + lcPret + [ as ] + lcColoanaPret + [,]
		If !Empty(lcPretAchizitie) And !Empty(lcColoanaPretAchizitie)
			pcselect = pcselect + lcPretAchizitie +[ as ]+ lcColoanaPretAchizitie +[,]
		Endif
		*!*	modificare	07.11.2012	:	la valoare_stoc am pus gnPc in loc de gnPa
		pcselect = pcselect +[a.datain,NVL(b.um2, b.um) as um_final,] + ;
			[sum(a.cants) as cants,sum(a.cant) as cant,sum(a.cante) as cante,] + ;
			[sum(a.cants * b.cant_bax) as cants2,sum(a.cant * b.cant_bax) as cant2,sum(a.cante * b.cant_bax) as cante2,] + ;
			[sum(a.cants * NVL2(b.um2, b.cant_bax, 1)) as cants3,sum(a.cant * NVL2(b.um2, b.cant_bax, 1)) as cant3,] + ;
			[sum(a.cante * NVL2(b.um2, b.cant_bax, 1)) as cante3,] + ;
			[sum(round((a.cants+a.cant-a.cante)*(] + lcPret + [),?gnPc)) as valoare_stoc ]
		If !Empty(lcPretAchizitie) And !Empty(lcColoanaPretAchizitie)
		*!*	modificare	07.11.2012	:	am pus gnPc in loc de gnPa
			pcselect = pcselect +[,sum(round((a.cants+a.cant-a.cante)*(] + lcPretAchizitie + [),?gnPc)) as valstocachizitie ]
		Endif
		pcselect = pcselect +[from ]
		
		lcCondSucursala = Strtran(gcCondSucursala,[id_sucursala],[a.id_sucursala])
		
		If Thisform.optPerioada.Value  = 1
			Thisform.csubtitlu = 'Luna: ' + Alltrim(Str(gnLuna))+ ' / ' + Alltrim(Str(gnAn))
			pcselect = pcselect + [stoc a ]
		Else
			Thisform.select_stoc()
			pcselect = pcselect + [(] + pcSelectStoc + [) a ]
			lcCondSucursala = "" && am pus deja sucursala in select
			Thisform.csubtitlu = 'Perioada: '+Allt(Dtoc(This.ddatainit))+' - '+Allt(Dtoc(This.ddatafinal))
		Endif
		pcselect = pcselect +[join nom_articole b on a.id_articol = b.id_articol ] + ;
			[ LEFT JOIN VGEST_ART_SBGR SG ON B.ID_SUBGRUPA = SG.ID_SUBGRUPA ] + ;
			[ join nom_gestiuni c on a.id_gestiune = c.id_gestiune and c.nr_pag = ?gnTipGest ]
		pcschema=['']
		
		pcfiltru = Iif(Thisform.optPerioada.Value  = 1, [a.an = ?gnAn and a.luna = ?gnLuna], []) + lcCondSucursala
		
		pcorder = lcOrder + [g4,g5,] + lcOrder2 + [b.um,b.um2,] + lcPret
		llAfiseaza = .F.
		pcGroup = [NVL(b.um2, b.um),rollup((b.um,b.cant_bax,b.um2),] + lcGroupG1 + lcGroupCont + lcGroupAcont + lcGroupSubgrupa + ;
			[(] + lcPret + [, ]
		If !Empty(lcPretAchizitie) And !Empty(lcColoanaPretAchizitie)
			pcGroup = pcGroup + lcPretAchizitie +[,]
		Endif
		pcGroup = pcGroup + lcSelectieAltele + [NVL(b.um2, b.um),a.datain))]
		
		gencursor('postocuri','crsStocuri',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza,pcGroup, .T., pcFiltruOriginal)
		postocuri.ca_baza1.afisare()
		*!*	Select crsStocuri
		*!*	Copy To c:\stocuri
	ENDPROC

	PROCEDURE select_stoc
		Local ldDataInit, ldDataFinal, lcCondSucursala
		ldDataInit = thisform.ddatainit
		ldDataFinal = thisform.ddatafinal
		lcCondSucursala = Lower(gcCondSucursala)
		
		ldDataInit0 = Gomonth(Date(Year(ldDataInit), Month(ldDataInit), 1),-1)	
		Text to pcSelectStoc textmerge noshow  
		select id_articol,
			   serie,
		       id_gestiune,
		       cont,
		       acont,
		       pret,
		       <<Iif(INLIST(gnTipGest, 6,7), 'pretv,tvav,proc_tvav,','')>>       
		       Max(datain) as datain,
		       Max(dataout) as dataout,
		       sum(cants) as cants,
		       sum(cant) as cant,
		       sum(cante) as cante
		  from (select s.id_articol,
		  			   s.serie,
		               s.id_gestiune,
		               s.cont,
		               s.acont,
		               s.pret,
		               s.datain,
		               s.dataout,
		               <<Iif(INLIST(gnTipGest,6,7), 's.pretv,s.tvav,s.proc_tvav,','')>>
		               s.cants+s.cant-s.cante as cants,
		               0 as cant,
		               0 as cante
		          from stoc s
		          join nom_gestiuni g on s.id_gestiune = g.id_gestiune
		          join nom_articole a on s.id_articol = a.id_articol
		         where s.an = <<Year(ldDataInit0)>>
		           and s.luna = <<Month(ldDataInit0)>>
		           <<Strtran(lcCondSucursala,[id_sucursala],[s.id_sucursala])>>
		           <<Iif(INLIST(gnTipGest,6,7), ' and (g.nr_pag = 6 or g.nr_pag = 7)', ' and g.nr_pag <> 6 and g.nr_pag <> 7 ')>>
		        union all
		        select r1.id_articol,
		  			   r1.serie,        
		               r1.id_gestiune,
		               r1.cont,
		               r1.acont,
		               r1.pret,
		               max(case
		                     when r1.cant <> 0 then
		                      r1.dataact
		                     else
		                      cast(null as date)
		                   end) as datain,
		               max(case
		                     when r1.cante <> 0 then
		                      r1.dataact
		                     else
		                      cast(null as date)
		                   end) as dataout,
		               <<Iif(INLIST(gnTipGest,6,7), 'r1.pretv,r1.tvav,r1.proc_tvav,','')>>
		               sum(r1.cant - r1.cante) as cants,
		               0 as cant,
		               0 as cante
		          from rul r1
		          join nom_gestiuni g1 on r1.id_gestiune = g1.id_gestiune
		         where r1.an = <<Year(ldDataInit)>>
		           and r1.luna = <<Month(ldDataInit)>>
		           and trunc(r1.dataact) < to_date('<<Dtos(ldDataInit)>>', 'yyyymmdd')
		           and r1.sters = 0
		           <<Strtran(lcCondSucursala,[id_sucursala],[r1.id_sucursala])>>
		           <<Iif(INLIST(gnTipGest,6,7), ' and (g1.nr_pag = 6 or g1.nr_pag = 7)', ' and g1.nr_pag <> 6 and g1.nr_pag <> 7')>>  
		         group by r1.id_articol,
				          r1.serie,
		                  r1.id_gestiune,
		                  r1.cont,
		                  r1.acont,
		                  r1.pret
		                  <<Iif(INLIST(gnTipGest, 6,7), ',r1.pretv,r1.tvav,r1.proc_tvav','')>>
		        union all
		        select r2.id_articol,
		   			   r2.serie,        
		               r2.id_gestiune,
		               r2.cont,
		               r2.acont,
		               r2.pret,
		               max(case
		                     when r2.cant <> 0 then
		                      r2.dataact
		                     else
		                      cast(null as date)
		                   end) as datain,
		               max(case
		                     when r2.cante <> 0 then
		                      r2.dataact
		                     else
		                      cast(null as date)
		                   end) as dataout,
		               <<Iif(INLIST(gnTipGest,6,7), 'r2.pretv,r2.tvav,r2.proc_tvav,','')>>               
		               0 as cants,
		               sum(r2.cant) as cant,
		               sum(r2.cante) as cante
		          from rul r2
		          left join nom_gestiuni g2 on r2.id_gestiune = g2.id_gestiune
		         where trunc(r2.dataact) between to_date('<<dtos(ldDataInit)>>', 'yyyymmdd') and
		               to_date('<<Dtos(ldDataFinal)>>', 'yyyymmdd')
		           and r2.sters = 0
		           <<Strtran(lcCondSucursala,[id_sucursala],[r2.id_sucursala])>>           
		           <<Iif(INLIST(gnTipGest,6,7), ' and (g2.nr_pag = 6 or g2.nr_pag = 7 ) ', ' and g2.nr_pag <> 6 AND g2.nr_pag <> 7')>>  
		         group by r2.id_articol,
				          r2.serie,         
		                  r2.id_gestiune,
		                  r2.cont,
		                  r2.acont,
		                  r2.pret
		                  <<Iif(INLIST(gnTipGest, 6,7), ',r2.pretv,r2.tvav,r2.proc_tvav','')>>)
		group by id_articol,
		       serie,
		       id_gestiune,
		       cont,
		       acont,
		       pret
		       <<Iif(INLIST(gnTipGest,6,7), ',pretv,tvav,proc_tvav','')>>      
		EndText 
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		this.ctitlu = [LISTA STOCURILOR IN LUNA ] + PADL(ALLTRIM(STR(gnLuna)),2,'0') + [.] + ALLTRIM(STR(gnAn))
		If INLIST(gnTipGest, 6,7)
			thisform.ckPretAchi.Visible = .t.
		ENDIF 
	ENDPROC

	PROCEDURE OptArticol.InteractiveChange
		thisform.pcnumegest = []
		thisform._txtgestiuni.refresh
		thisform.optGestiuni.Value = 0
		thisform.optgrupe.Value = 0
		thisform.ResetToDefault('orezult')
	ENDPROC

	PROCEDURE optgestiuni.InteractiveChange
		thisform.pcnumegest = []
		thisform.optGrupe.Value = 0
		thisform.optArticol.Value = 0
		thisform._txtgestiuni.refresh
		thisform.ResetToDefault('orezult')
	ENDPROC

	PROCEDURE OptGrupe.InteractiveChange
		thisform.pcnumegest = []
		thisform._txtgestiuni.refresh
		thisform.optGestiuni.Value = 0
		thisform.optArticol.Value = 0
		thisform.ResetToDefault('orezult')
	ENDPROC

	PROCEDURE OptPerioada.Valid
		*!*	Thisform.caut_anluna1.Visible = Iif(This.Value=1,.T.,.F.)
		
		Thisform.txtData1.Visible = Iif(This.Value=2,.T.,.F.)
		Thisform.txtData2.Visible = Iif(This.Value=2,.T.,.F.)
		If This.Value=2
			Thisform.txtData1.SetFocus
			IF EMPTY(Thisform.txtData1.Value)
				Thisform.txtData1.Value = Date(gnAn,gnLuna,1) 
			ENDIF 
			IF EMPTY(Thisform.txtData2.Value)
				
				Thisform.txtData2.Value = Gomonth(Thisform.txtData1.Value,1)-1
			ENDIF 	
		Endif
	ENDPROC

	PROCEDURE txtData1.LostFocus
		If Empty(Thisform.txtData2.Value)
			Thisform.txtData2.Value=This.Value
		Endif
	ENDPROC

	PROCEDURE txtData1.Valid
		*!*	IF !empty(this.value)
		*!*		lcLuna=SUBSTR(ALLTRIM(this.Value),1,2)
		*!*		lcAn=SUBSTR(ALLTRIM(this.Value),3)
		*!*		IF EMPTY(lcAn) OR LEN(lcAn)<4
		*!*			lcAn=ALLTRIM(STR(YEAR(DATE())))
		*!*			this.value=PADL(lcLuna,2,'0')+lcAn
		*!*		ENDIF
		*!*		IF TYPE("DATE(VAL(lcAn),VAL(lcLuna),1)")!="D"
		*!*			aMESSAGEBOX("Data invalida!",0+16,"Eroare")
		*!*			RETURN 0
		*!*		ENDIF
		*!*	ENDIF
	ENDPROC

	PROCEDURE txtData2.LostFocus
		If Empty(Thisform.txtData1.Value)
			Thisform.txtData1.Value=This.Value
		Endif
	ENDPROC

	PROCEDURE txtData2.Valid
		*!*	IF !empty(this.value)
		*!*		lcLuna=SUBSTR(ALLTRIM(this.Value),1,2)
		*!*		lcAn=SUBSTR(ALLTRIM(this.Value),3)
		*!*		IF EMPTY(lcAn) OR LEN(lcAn)<4
		*!*			lcAn=ALLTRIM(STR(YEAR(DATE())))
		*!*			this.value=PADL(lcLuna,2,'0')+lcAn
		*!*		ENDIF
		*!*		IF TYPE("DATE(VAL(lcAn),VAL(lcLuna),1)")!="D"
		*!*			aMESSAGEBOX("Data invalida!",0+16,"Eroare")
		*!*			RETURN 0
		*!*		ENDIF
		*!*	ENDIF
	ENDPROC

ENDDEFINE

DEFINE CLASS pagefr_config AS pageframe 
 	*< CLASSDATA: Baseclass="pageframe" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<DefinedPropArrayMethod>
		*m: activare_pagina
		*m: setare_pagina
		*p: cul_activa
		*p: cul_fundal
		*p: cul_inactiva
	*</DefinedPropArrayMethod>

	*<PropValue>
		cul_activa = 
		cul_fundal = 
		cul_inactiva = 
		ErasePage = .T.
		Height = 256
		Name = "pagefr_config"
		PageCount = 3
		TabStyle = 1
		Themes = .F.
		Width = 712
		Page1.BackColor = 255,255,255
		Page1.Caption = "Grupe de gestiuni"
		Page1.ForeColor = 0,0,0
		Page1.Name = "pag1"
		Page2.BackColor = 255,255,255
		Page2.Caption = "Gestiuni"
		Page2.ForeColor = 0,0,0
		Page2.Name = "pag2"
		Page3.BackColor = 255,255,255
		Page3.Caption = "Drepturi de acces pe grupe de gestiuni"
		Page3.Name = "pag3"
	*</PropValue>
	
	PROCEDURE activare_pagina
		PARAMETERS npag
		
		FOR i=1 TO this.PageCount
			cpag='this.pag'+ALLTRIM(STR(i))+'.'
			IF i<>npag
				&cpag.BackColor=this.cul_inactiva
				&cpag.ForeColor=this.cul_activa
				&cpag.FontBold=.f.
			else
				&cpag.BackColor=this.cul_activa
				&cpag.ForeColor=this.cul_inactiva
				&cpag.FontBold=.t.
			ENDIF
		NEXT
	ENDPROC

	PROCEDURE Init
		this.cul_fundal = RGB(255,255,255)
		this.cul_activa = RGB(255,255,255)
		this.cul_inactiva = RGB(0,64,128)
		
		this.SetAll('backcolor',this.cul_fundal,'page')
		
		
	ENDPROC

	PROCEDURE setare_pagina
	ENDPROC

	PROCEDURE pag1.Activate
		this.Parent.activare_pagina(1)
		
	ENDPROC

	PROCEDURE pag2.Activate
		this.Parent.activare_pagina(2)
	ENDPROC

	PROCEDURE pag3.Activate
		this.Parent.activare_pagina(3)
	ENDPROC

ENDDEFINE
