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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="cboLuna" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboAnul" UniqueID="" Timestamp="" />

	*<PropValue>
		BackColor = 255,255,255
		Height = 32
		Name = "container_data"
		Width = 147
	*</PropValue>

	ADD OBJECT 'cboAnul' AS combobox WITH ;
		BoundTo = .T., ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 92, ;
		Name = "cboAnul", ;
		RowSource = "1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010", ;
		RowSourceType = 1, ;
		Style = 2, ;
		Top = 4, ;
		Width = 52
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'cboLuna' AS combobox WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "60,0", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 4, ;
		Name = "cboLuna", ;
		RowSource = "Ianuarie,01,Februarie,02,Martie,03,Aprilie,04,Mai,05,Iunie,06,Iulie,07,August,08,Septembrie,09,Octombrie,10,Noiembrie,11,Decembrie,12 ", ;
		RowSourceType = 1, ;
		Style = 2, ;
		Top = 4, ;
		Width = 87
		*< END OBJECT: BaseClass="combobox" />

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="edt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmd" UniqueID="" Timestamp="" />

	*<PropValue>
		BackStyle = 0
		BorderColor = 192,192,192
		Height = 21
		Name = "container_text_cmd"
		Width = 303
	*</PropValue>

	ADD OBJECT 'cmd' AS commandbutton WITH ;
		Caption = "", ;
		Height = 21, ;
		Left = 277, ;
		Name = "cmd", ;
		Picture = ..\grafice\wzedit.bmp, ;
		Top = 0, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'edt' AS editbox WITH ;
		ControlSource = "", ;
		FontName = "Arial", ;
		Height = 21, ;
		Left = -1, ;
		Name = "edt", ;
		ReadOnly = .T., ;
		Top = -1, ;
		Width = 274
		*< END OBJECT: BaseClass="editbox" />
	
	PROCEDURE cmd.Click
		LOCAL lcLista, lcLabel 
		 
		* lcLista = thisform.container_bal.edtSD.Value 
		lcLista = this.Parent.edt.Value 
		
		lcFis = gcTempPath+"tLista.dbf"
		CREATE TABLE (lcFis) (valoare C(11))
		
		DO completeaza_lista_bal WITH lcLista, lcFis IN oproceduri_seturi_indicatori.prg
		
		SELECT tLista
		GO TOP 
		
		lcControlSource = ALLTRIM(this.Parent.edt.ControlSource) 
		locb = CREATEOBJECT("frm_ind_bal",lcControlSource)
		DO CASE 
		CASE RIGHT(ALLTRIM(lcControlSource),3) = "PD1"
			locb.lb_titlu_alb_b121.caption = "PRECEDENT DEBITOR LA 1 IAN."
		CASE RIGHT(ALLTRIM(lcControlSource),3) = "PC1"
			locb.lb_titlu_alb_b121.caption = "PRECEDENT CREDITOR LA 1 IAN."
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "PD"
			locb.lb_titlu_alb_b121.caption = "PRECEDENT DEBITOR"
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "PC"
			locb.lb_titlu_alb_b121.caption = "PRECEDENT CREDITOR"	
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "RD"
			locb.lb_titlu_alb_b121.caption = "RULAJ DEBITOR"
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "RC"
			locb.lb_titlu_alb_b121.caption = "RULAJ CREDITOR"
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "TD"
			locb.lb_titlu_alb_b121.caption = "TOTAL DEBITOR"
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "TC"
			locb.lb_titlu_alb_b121.caption = "TOTAL CREDITOR"	
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "SD"
			locb.lb_titlu_alb_b121.caption = "SOLD DEBITOR"
		CASE RIGHT(ALLTRIM(lcControlSource),2) = "SC"
			locb.lb_titlu_alb_b121.caption = "SOLD CREDITOR"			
		ENDCASE 
		locb.show(1)
		
		USE IN (SELECT("tLista"))	&&	modificare	v 2.3.8 : era dupa if si imi ramanea deschisa tabela
		IF buton = 2
			RETURN
		ENDIF 
		
		thisform.send_formula
		
		THIS.Parent.edt.Refresh 
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_comentariu 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="Edit1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Image1" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 244
		Name = "frm_comentariu"
		Width = 424
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 423
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 392
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 32
		Lb_titlu_alb_b121.Left = 36
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 6
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 394
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'Edit1' AS editbox WITH ;
		Anchor = 15, ;
		ControlSource = "poIndComent.comentariu", ;
		Height = 198, ;
		Left = 10, ;
		Name = "Edit1", ;
		Top = 36, ;
		Width = 403
		*< END OBJECT: BaseClass="editbox" />

	ADD OBJECT 'Image1' AS image WITH ;
		BackStyle = 0, ;
		Height = 26, ;
		Left = 4, ;
		Name = "Image1", ;
		Picture = ..\..\grafice\help_w_mare.bmp, ;
		Top = 3, ;
		Width = 24
		*< END OBJECT: BaseClass="image" />

ENDDEFINE

DEFINE CLASS frm_ind_bal 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="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_plcont.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtCont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optTip" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_conturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_conturi.cValoare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_conturi.cValoare.Text1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: adauga_cont
		*m: insert
		*m: recompune
		*m: remove_cont
		*p: ccontrolsource
		*p: ccuvant
		*p: cgrup
		*p: csemn
		*p: nelemente
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		ccontrolsource = 
		ccuvant = <fb2p_value>&#13;</fb2p_value>
		cgrup = C
		csemn = +
		DoCreate = .T.
		Height = 415
		Name = "frm_ind_bal"
		nelemente = 0
		Width = 611
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 612
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 552
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 62
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 3
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 581
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 132
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 36
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 551, ;
		Name = "But_renunt1", ;
		TabIndex = 6, ;
		Top = 0, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Command1' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "+", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 25, ;
		Left = 114, ;
		Name = "Command1", ;
		TabIndex = 5, ;
		ToolTipText = "Adauga rand", ;
		Top = 69, ;
		Width = 25, ;
		ZOrderSet = 8
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command2' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "-", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 25, ;
		Left = 114, ;
		Name = "Command2", ;
		TabIndex = 7, ;
		ToolTipText = "Sterge rand", ;
		Top = 99, ;
		Width = 25, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'grid_conturi' AS _grdrow WITH ;
		Anchor = 7, ;
		ColumnCount = 1, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		HeaderHeight = 0, ;
		Height = 333, ;
		HighlightStyle = 2, ;
		Left = 10, ;
		Name = "grid_conturi", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "tLista", ;
		RowHeight = 19, ;
		TabIndex = 12, ;
		Top = 71, ;
		Width = 100, ;
		Column1.ControlSource = "valoare", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cValoare", ;
		Column1.Width = 78
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid_conturi.cValoare.Header1' AS header WITH ;
		Caption = "Header1", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_conturi.cValoare.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 'grid_plcont' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 254, ;
		HighlightStyle = 2, ;
		Left = 169, ;
		Name = "grid_plcont", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "crsPlcont", ;
		RowHeight = 19, ;
		TabIndex = 2, ;
		Top = 149, ;
		Width = 435, ;
		ZOrderSet = 6, ;
		Column1.ControlSource = "cont", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cCont", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 60, ;
		Column2.ControlSource = "acont", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cAcont", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 56, ;
		Column3.ControlSource = "explicatie", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDenumire", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 290
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'grid_plcont.cAcont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .F.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_plcont.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.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_plcont.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.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid_plcont.cDenumire.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		Caption = "Conturile din formula de calcul", ;
		FontSize = 10, ;
		Height = 34, ;
		Left = 10, ;
		Name = "Label1", ;
		TabIndex = 9, ;
		Top = 33, ;
		Width = 100, ;
		WordWrap = .T., ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Alegeti contul dorit si dati click in tabel pt adaugare in campul ales", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 169, ;
		Name = "Label2", ;
		TabIndex = 10, ;
		Top = 107, ;
		Width = 386, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Optiongroup1' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		ButtonCount = 2, ;
		Height = 47, ;
		Left = 169, ;
		Name = "Optiongroup1", ;
		TabIndex = 8, ;
		Top = 38, ;
		Value = 1, ;
		Width = 37, ;
		ZOrderSet = 11, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "+", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 27, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "-", ;
		Option2.FontSize = 10, ;
		Option2.Height = 18, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24, ;
		Option2.Width = 23
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'optTip' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		ButtonCount = 4, ;
		Height = 70, ;
		Left = 210, ;
		Name = "optTip", ;
		TabIndex = 11, ;
		Top = 38, ;
		Value = 1, ;
		Width = 124, ;
		ZOrderSet = 12, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Contul (C)", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 77, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Grupa 3 cifra (T)", ;
		Option2.FontSize = 10, ;
		Option2.Height = 18, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 19, ;
		Option2.Width = 112, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Grupa 2 cifre (D)", ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 33, ;
		Option3.Width = 114, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "Grupa 1 cifre (I)", ;
		Option4.FontSize = 10, ;
		Option4.Height = 18, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Top = 47, ;
		Option4.Width = 108
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		Anchor = 15, ;
		Height = 377, ;
		Left = 162, ;
		Name = "Shape1", ;
		Top = 33, ;
		Width = 445, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'txtCont' AS _textbox WITH ;
		Comment = "*:onResize=lt", ;
		FontSize = 10, ;
		Format = "K", ;
		Height = 23, ;
		Left = 169, ;
		Name = "txtCont", ;
		TabIndex = 1, ;
		ToolTipText = "Cautare cont", ;
		Top = 123, ;
		Width = 68, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE adauga_cont
		Parameters tcCont, tcAcont, tcSemn, tcGrup
		
		Local lcTabel, lcCont, lcAcont, lcSemn, lcGrup
		lcTabel = Thisform.grid_conturi.RecordSource
		lcCont = Alltrim(tcCont)
		lcAcont = Alltrim(tcAcont)
		lcSemn = Alltrim(tcSemn)
		lcGrup = Alltrim(Upper(tcGrup))
		Select (lcTabel)
		If Empty(valoare)
			Do Case
			Case lcGrup = 'C'
				lcValoare = lcSemn + lcGrup + lcCont + Iif(!Empty(lcAcont) And !Isnull(lcAcont),'.'+lcAcont,'')
			Case lcGrup = 'T'
				lcValoare = lcSemn + lcGrup + Left(lcCont,3) + Iif(!Empty(lcAcont) And !Isnull(lcAcont),'.'+lcAcont,'')
			Case lcGrup = 'D'
				lcValoare = lcSemn + lcGrup + Left(lcCont,2) + Iif(!Empty(lcAcont) And !Isnull(lcAcont),'.'+lcAcont,'')
			Case lcGrup = 'I'
				lcValoare = lcSemn + lcGrup + Left(lcCont,1) + Iif(!Empty(lcAcont) And !Isnull(lcAcont),'.'+lcAcont,'')
			Endcase
		
			Replace valoare With lcValoare
		
			Select (lcTabel)
			LOCATE FOR EMPTY(valoare)
			IF !FOUND()
				Append Blank
				Thisform.nElemente = Thisform.nElemente + 1
			ENDIF 
		Endif
		
		Thisform.grid_conturi.SetFocus
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		pcListaModificata = thisform.recompune() 
	ENDPROC

	PROCEDURE Init
		PARAMETERS tcControlSource
		
		DODEFAULT()
		
		lcTabel = thisform.grid_conturi.RecordSource 
		SELECT (lcTabel)
		GO BOTTOM 
		lnElemente = RECCOUNT()
		
		thisform.nElemente = lnElemente 
		thisform.cControlsource = ALLTRIM(tcControlSource)		
		
		this.Width = INT(_screen.Width*0.7)
		this.Height = INT(_screen.Height*0.7)
		this.AutoCenter = .T. 
		
		
		
		 
	ENDPROC

	PROCEDURE insert
		PARAMETERS tnNumar
		
		lcTabel = thisform.grid_conturi.RecordSource 
		SELECT (lcTabel)
		APPEND BLANK
		
		* mut inregistrarile mai jos
		FOR i = RECCOUNT()-1 TO tnNumar STEP -1 
			SELECT (lcTabel) 
			GOTO RECORD i  
			lcVal = valoare
			GOTO RECORD i+1
			REPLACE valoare WITH lcVal  
		ENDFOR 
		
		* celula in care inserez o las goala
		REPLACE valoare WITH "" FOR RECNO() = tnNumar 
		
		SELECT (lcTabel)
		GOTO tnNumar
		thisform.grid_conturi.SetFocus()
		
		
		
		
		
	ENDPROC

	PROCEDURE recompune
		LOCAL lcTabel, lcLista  
		lcTabel = thisform.grid_conturi.RecordSource 
		lcLista = ''
		
		lcControlSource = thisform.cControlsource 
		
		SELECT (lcTabel)
		SCAN 
			lcLista = lcLista + ALLTRIM(valoare)
		SELECT (lcTabel)
		ENDSCAN 
		
		&lcControlSource = ALLTRIM(lcLista) 
	ENDPROC

	PROCEDURE remove_cont
		PARAMETERS tnNumar
		
		LOCAL lnElemente 
		lnElemente = thisform.nElemente 
		lcTabel = thisform.grid_conturi.RecordSource  
		SELECT (lcTabel)
		 
		* mut inregistrarile mai sus
		FOR i = tnNumar TO lnElemente
			SELECT (lcTabel) 
			GOTO RECORD i+1  
			lcVal = valoare
			GOTO RECORD i
			REPLACE valoare WITH lcVal 
		ENDFOR 
		
		SELECT (lcTabel)
		DELETE FOR RECNO() = lnElemente+1
		PACK 
		
		SELECT (lcTabel)
		IF RECCOUNT()>tnNumar
			GOTO tnNumar
		ELSE
			GO BOTTOM 	
		ENDIF 
		
		thisform.grid_conturi.RecordSource = (lcTabel)
		thisform.grid_conturi.SetFocus()
		
		
	ENDPROC

	PROCEDURE Command1.Click
		lcTabel = thisform.grid_conturi.RecordSource 
		SELECT (lcTabel)
		
		lnNumar = RECNO()
		
		thisform.nElemente = thisform.nElemente + 1
		
		thisform.insert(lnNumar) 
		
	ENDPROC

	PROCEDURE Command2.Click
		lcTabel = thisform.grid_conturi.RecordSource 
		SELECT (lcTabel)
		
		lnNumar = RECNO()
		
		thisform.nElemente = thisform.nElemente - 1
		thisform.remove_cont(lnNumar)
		
	ENDPROC

	PROCEDURE grid_conturi.Init
		* Nu sterge
	ENDPROC

	PROCEDURE grid_plcont.cAcont.Text1.Click
		LOCAL lcCont, lcAcont 
		lcTabel = thisform.grid_plcont.RecordSource 
		lcCont = &lcTabel..cont 
		lcAcont = this.Value 
		
		IF !EMPTY(lcAcont) AND !ISNULL(lcAcont) 
			thisform.adauga_cont(lcCont, lcAcont, thisform.cSemn, thisform.cGrup)
		ENDIF 
		
		
	ENDPROC

	PROCEDURE grid_plcont.cCont.Text1.Click
		LOCAL lcCont, lcAcont  
		lcCont = this.Value 
		lcAcont = ''
		
		thisform.adauga_cont(lcCont, lcAcont, thisform.cSemn, thisform.cGrup)
	ENDPROC

	PROCEDURE grid_plcont.Init
		* Nu sterge
	ENDPROC

	PROCEDURE Optiongroup1.Valid
		Do Case
		Case This.Value = 1
			Thisform.Csemn = "+"
		Case This.Value = 2
			Thisform.Csemn = "-"
		Endcase
		
	ENDPROC

	PROCEDURE optTip.Valid
		Do Case
		Case This.Value = 1
			Thisform.cGrup = "C"
		Case This.Value = 2
			Thisform.cGrup = "T"
		Case This.Value = 3
			Thisform.cGrup = "D"
		Case This.Value = 4
			Thisform.cGrup = "I"
		Endcase
		
	ENDPROC

	PROCEDURE txtCont.KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		
		LOCAL lcTabel, lcCautat   
		lcTabel = Thisform.grid_plcont.RecordSource
		
		If Inlist(nKeyCode,13,9)
			lcCautat = Alltrim(Upper(This.Value))
			
			lcCautat = Alltrim(Upper(This.Value))
			Select (lcTabel)
			Locate For Left(Cont,Len(lcCautat)) = lcCautat
			
			thisform.grid_plcont.SetFocus
		
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_ind_rand 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="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command13" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command14" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command15" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command16" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command17" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command18" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command19" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command20" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command21" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command22" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command23" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command24" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command25" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command27" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command28" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command29" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtFormula" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: adauga_constanta
		*m: adauga_rand
		*p: csemn
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		csemn = +
		DoCreate = .T.
		Height = 430
		Name = "frm_ind_rand"
		ScrollBars = 2
		Width = 555
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 553
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 492
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 62
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Formula - randuri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 523
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 493, ;
		Name = "But_renunt1", ;
		Top = 0, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Command1' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "<", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 59, ;
		Name = "Command1", ;
		Top = 304, ;
		Width = 15
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command10' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "'='", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 75, ;
		Name = "Command10", ;
		Top = 304, ;
		Width = 15
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command11' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "0", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 121, ;
		Name = "Command11", ;
		Top = 318, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command12' AS commandbutton WITH ;
		Anchor = 9, ;
		Caption = "", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 524, ;
		Name = "Command12", ;
		Picture = ..\grafice\wzdelete.bmp, ;
		Top = 31, ;
		Width = 23
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command13' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "7", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 74, ;
		Name = "Command13", ;
		Top = 340, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command14' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "8", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 98, ;
		Name = "Command14", ;
		Top = 340, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command15' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "9", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 121, ;
		Name = "Command15", ;
		Top = 340, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command16' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "4", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 74, ;
		Name = "Command16", ;
		Top = 368, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command17' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "5", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 98, ;
		Name = "Command17", ;
		Top = 368, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command18' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "6", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 121, ;
		Name = "Command18", ;
		Top = 368, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command19' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "1", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 74, ;
		Name = "Command19", ;
		Top = 396, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command2' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = ">", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 91, ;
		Name = "Command2", ;
		Top = 304, ;
		Width = 15
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command20' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "2", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 98, ;
		Name = "Command20", ;
		Top = 396, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command21' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "3", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 121, ;
		Name = "Command21", ;
		Top = 396, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command22' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "-", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 145, ;
		Name = "Command22", ;
		Top = 368, ;
		Width = 21
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command23' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "+", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 145, ;
		Name = "Command23", ;
		Top = 396, ;
		Width = 21
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command24' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "/", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 145, ;
		Name = "Command24", ;
		Top = 318, ;
		Width = 21
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command25' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "*", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 145, ;
		Name = "Command25", ;
		Top = 340, ;
		Width = 21
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command27' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "IIF", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 12, ;
		Name = "Command27", ;
		Top = 354, ;
		Width = 33
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command28' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = ",", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 12, ;
		Name = "Command28", ;
		Top = 378, ;
		Width = 33
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command29' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "AND", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 12, ;
		Name = "Command29", ;
		Top = 402, ;
		Width = 33
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command3' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "CASE", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 13, ;
		Name = "Command3", ;
		Top = 263, ;
		Width = 39
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command4' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "WHEN", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 58, ;
		Name = "Command4", ;
		Top = 263, ;
		Width = 39
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command5' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "THEN", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 14, ;
		Name = "Command5", ;
		Top = 283, ;
		Width = 39
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command6' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "ELSE", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 58, ;
		Name = "Command6", ;
		Top = 283, ;
		Width = 39
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command7' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "END", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 20, ;
		Left = 103, ;
		Name = "Command7", ;
		Top = 283, ;
		Width = 39
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command8' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "(", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 14, ;
		Name = "Command8", ;
		Top = 304, ;
		Width = 15
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command9' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = ")", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 23, ;
		Left = 28, ;
		Name = "Command9", ;
		Top = 304, ;
		Width = 15
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 235, ;
		HighlightStyle = 2, ;
		Left = 182, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "cRanduri", ;
		RowHeight = 19, ;
		Top = 183, ;
		Width = 365, ;
		Column1.ControlSource = "rand", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 56, ;
		Column2.ControlSource = "nume_ind", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 276
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Operatii cu randuri", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 12, ;
		Name = "Label1", ;
		TabIndex = 18, ;
		Top = 175, ;
		Width = 108, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Indicatori definiti anterior", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 183, ;
		Name = "Label2", ;
		TabIndex = 18, ;
		Top = 167, ;
		Width = 142, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Operatii cu constante", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 12, ;
		Name = "Label3", ;
		TabIndex = 18, ;
		Top = 244, ;
		Width = 126, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Formula de calcul (apasati pe indicatorii din tabel pentru a-i adauga in formula)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 12, ;
		Name = "Label4", ;
		TabIndex = 18, ;
		Top = 32, ;
		Width = 453, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Optiongroup1' AS optiongroup WITH ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		ButtonCount = 4, ;
		Height = 30, ;
		Left = 12, ;
		Name = "Optiongroup1", ;
		Top = 192, ;
		Value = 1, ;
		Width = 127, ;
		ZOrderSet = 11, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "+", ;
		Option1.FontBold = .T., ;
		Option1.FontSize = 12, ;
		Option1.Height = 22, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 28, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "-", ;
		Option2.FontBold = .T., ;
		Option2.FontSize = 12, ;
		Option2.Height = 22, ;
		Option2.Left = 37, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option2.Width = 24, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "*", ;
		Option3.FontBold = .T., ;
		Option3.FontSize = 12, ;
		Option3.Height = 22, ;
		Option3.Left = 67, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5, ;
		Option3.Width = 25, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "/", ;
		Option4.FontBold = .T., ;
		Option4.FontSize = 12, ;
		Option4.Height = 22, ;
		Option4.Left = 94, ;
		Option4.Name = "Option4", ;
		Option4.Top = 5, ;
		Option4.Width = 23
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'txtFormula' AS editbox WITH ;
		Anchor = 11, ;
		ControlSource = "pcFormulaModi", ;
		FontSize = 10, ;
		Height = 113, ;
		Left = 12, ;
		Name = "txtFormula", ;
		ReadOnly = .T., ;
		Top = 53, ;
		Width = 534
		*< END OBJECT: BaseClass="editbox" />
	
	PROCEDURE adauga_constanta
		Parameters tcConstanta
		
		Local lcConstanta, lcFormula
		
		lcConstanta = tcConstanta
		
		If Isnull(pcFormulaModi)
			pcFormulaModi = lcConstanta
		Else
			pcFormulaModi = pcFormulaModi + lcConstanta
		Endif
		
		Thisform.txtFormula.SetFocus()
		
	ENDPROC

	PROCEDURE adauga_rand
		Parameters tcRand, tcSemn
		
		Local lcCont, lcSemn, lcValoare, lcFormula
		lcFormula = ''
		
		lcRand = Alltrim(tcRand)
		lcSemn = Alltrim(tcSemn)
		
		lcValoare = lcSemn +"[R" + lcRand + "]"
		
		lcFormula = Thisform.txtFormula.Value
		
		If Isnull(pcFormulaModi)
			pcFormulaModi = lcValoare
		Else
			pcFormulaModi = pcFormulaModi + lcValoare
		Endif
		
		
		Thisform.txtFormula.SetFocus()
		
		
		
		
		
	ENDPROC

	PROCEDURE do_sterge
		pcFormulaModi = SUBSTR(pcFormulaModi,1,LEN(pcFormulaModi)-1)
		
		Thisform.txtFormula.SetFocus()
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		this.Width = INT(_screen.Width*0.7)
		this.Height = INT(_screen.Height*0.7)
		this.AutoCenter = .T. 
	ENDPROC

	PROCEDURE Command1.Click
		LOCAL lcConstanta 
		lcConstanta = '<'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command10.Click
		LOCAL lcConstanta 
		lcConstanta = '='
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command11.Click
		LOCAL lcConstanta 
		lcConstanta = '0'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command12.Click
		thisform.do_sterge()
	ENDPROC

	PROCEDURE Command13.Click
		LOCAL lcConstanta 
		lcConstanta = '7'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command14.Click
		LOCAL lcConstanta 
		lcConstanta = '8'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command15.Click
		LOCAL lcConstanta 
		lcConstanta = '9'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command16.Click
		LOCAL lcConstanta 
		lcConstanta = '4'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command17.Click
		LOCAL lcConstanta 
		lcConstanta = '5'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command18.Click
		LOCAL lcConstanta 
		lcConstanta = '6'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command19.Click
		LOCAL lcConstanta 
		lcConstanta = '1'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command2.Click
		LOCAL lcConstanta 
		lcConstanta = '>'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command20.Click
		LOCAL lcConstanta 
		lcConstanta = '2'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command21.Click
		LOCAL lcConstanta 
		lcConstanta = '3'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command22.Click
		LOCAL lcConstanta 
		lcConstanta = '-'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command23.Click
		LOCAL lcConstanta 
		lcConstanta = '+'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command24.Click
		LOCAL lcConstanta 
		lcConstanta = '/'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command25.Click
		LOCAL lcConstanta 
		lcConstanta = '*'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command27.Click
		LOCAL lcConstanta 
		lcConstanta = 'IIF'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command28.Click
		LOCAL lcConstanta 
		lcConstanta = ','
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command29.Click
		LOCAL lcConstanta 
		lcConstanta = ' AND '
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command3.Click
		LOCAL lcConstanta 
		lcConstanta = 'CASE '
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command4.Click
		LOCAL lcConstanta 
		lcConstanta = 'WHEN '
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command5.Click
		LOCAL lcConstanta 
		lcConstanta = ' THEN '
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command6.Click
		LOCAL lcConstanta 
		lcConstanta = ' ELSE '
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command7.Click
		LOCAL lcConstanta 
		lcConstanta = ' END '
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command8.Click
		LOCAL lcConstanta 
		lcConstanta = '('
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Command9.Click
		LOCAL lcConstanta 
		lcConstanta = ')'
		thisform.adauga_constanta(lcConstanta) 
	ENDPROC

	PROCEDURE Grid1.Column1.Text1.Click
		lcVal = this.Value 
		thisform.adauga_rand(lcVal,thisform.cSemn)
	ENDPROC

	PROCEDURE Grid1.Init
		* Nu sterge
	ENDPROC

	PROCEDURE Optiongroup1.Valid
		Do Case
		Case This.Value = 1
			Thisform.Csemn = "+"
		Case This.Value = 2
			Thisform.Csemn = "-"
		Case This.Value = 3
			Thisform.Csemn = "*"
		Case This.Value = 4
			Thisform.Csemn = "/"
		ENDCASE 
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_ind_rj 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="Ck_fdoc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_explicatii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_explicatia" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_scd" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_scc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_ascd" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_ascc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nrord" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nume_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nresp" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_dst_chlt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_sectie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_sucursala" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_util" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_sters" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_pereched" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_perecheC" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_suma" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_suma_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_dataact" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_dataireg" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_dataora" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nnir" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_cod" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_id_set" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_partD" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_partC" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_perioada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_explicatia5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_explicatia4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_gestin" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_gestout" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_formula" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_formula.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_formula.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_formula.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_formula.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Line1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 434
		Name = "frm_ind_rj"
		Width = 690
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 688
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 629
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 59
		Lb_titlu_alb_b121.Caption = "Indicator bazat pe Registru Jurnal"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 659
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 630, ;
		Name = "But_renunt1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_ascc' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = ascc, ;
		Caption = "Analitic C", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 244, ;
		Name = "Ck_ascc", ;
		TabIndex = 16, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_ascd' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = ascd, ;
		Caption = "Analitic D", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 244, ;
		Name = "Ck_ascd", ;
		TabIndex = 15, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_cod' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = cod, ;
		Caption = "Cod", ;
		FontName = "Arial Narrow", ;
		Left = 491, ;
		mask = (replicate('9',12)), ;
		Name = "Ck_cod", ;
		TabIndex = 27, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_dataact' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = dataact, ;
		Caption = "Data Act", ;
		Enabled = .T., ;
		FontName = "Arial Narrow", ;
		Left = 4, ;
		Name = "Ck_dataact", ;
		TabIndex = 1, ;
		tip = D, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_dataireg' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = dataIREG, ;
		Caption = "Data inreg.", ;
		FontName = "Arial Narrow", ;
		Left = 4, ;
		Name = "Ck_dataireg", ;
		TabIndex = 2, ;
		tip = D, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_dataora' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = dataora, ;
		Caption = "Data introducerii", ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,255, ;
		Left = 572, ;
		Name = "Ck_dataora", ;
		TabIndex = 31, ;
		tip = D, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_dst_chlt' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = dst_chlt, ;
		Caption = "Chelt./Venituri", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 491, ;
		Name = "Ck_dst_chlt", ;
		TabIndex = 25, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_explicatia' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = explicatia, ;
		Caption = "Explicatia 3", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 86, ;
		Name = "Ck_explicatia", ;
		TabIndex = 7, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_explicatia4' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = explicatia4, ;
		Caption = "Explicatia 4", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 86, ;
		Name = "Ck_explicatia4", ;
		TabIndex = 8, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_explicatia5' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = explicatia5, ;
		Caption = "Explicatia 5", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 162, ;
		Name = "Ck_explicatia5", ;
		TabIndex = 9, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_explicatii' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = partD,partC,explicatia,explicatia4,explicatia5, ;
		Caption = "Explicatii", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 162, ;
		Name = "Ck_explicatii", ;
		TabIndex = 10, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_fdoc' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = fdoc, ;
		Caption = "Tip document", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 4, ;
		Name = "Ck_fdoc", ;
		TabIndex = 3, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_gestin' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = gestin, ;
		Caption = "Gestiune dest.", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 162, ;
		Name = "Ck_gestin", ;
		TabIndex = 11, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_gestout' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = gestout, ;
		Caption = "Gestiune sursa", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 162, ;
		Name = "Ck_gestout", ;
		TabIndex = 12, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_id_set' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = id_set, ;
		Caption = "Tip Operatie", ;
		FontName = "Arial Narrow", ;
		Left = 491, ;
		Name = "Ck_id_set", ;
		TabIndex = 28, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nnir' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = nnir, ;
		Caption = "Nr. NIR/Bon", ;
		FontName = "Arial Narrow", ;
		Left = 408, ;
		mask = (replicate('9',12)), ;
		Name = "Ck_nnir", ;
		TabIndex = 23, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nract' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = NRACT, ;
		Caption = "Nr. document", ;
		FontName = "Arial Narrow", ;
		Left = 4, ;
		mask = (replicate('9',12)), ;
		Name = "Ck_nract", ;
		TabIndex = 4, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nresp' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = nresp, ;
		Caption = "Responsabil", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 408, ;
		Name = "Ck_nresp", ;
		TabIndex = 24, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nrord' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = nrord, ;
		Caption = "Lucrare/Contract", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 319, ;
		Name = "Ck_nrord", ;
		TabIndex = 17, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nume_val' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = nume_val, ;
		Caption = "Valuta", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 319, ;
		Name = "Ck_nume_val", ;
		TabIndex = 19, ;
		Top = 62
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_partC' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = partC, ;
		Caption = "Explicatia 2", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 86, ;
		Name = "Ck_partC", ;
		TabIndex = 6, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_partD' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = partD, ;
		Caption = "Explicatia 1", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 86, ;
		Name = "Ck_partD", ;
		TabIndex = 5, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_perecheC' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = perecheC, ;
		Caption = "Nr.doc.incasat", ;
		FontName = "Arial Narrow", ;
		Left = 408, ;
		mask = (replicate('9',12)), ;
		Name = "Ck_perecheC", ;
		TabIndex = 21, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_pereched' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = perecheD, ;
		Caption = "Nr.doc.platit", ;
		FontName = "Arial Narrow", ;
		Left = 408, ;
		mask = (replicate('9',12)), ;
		Name = "ck_pereched", ;
		TabIndex = 22, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_perioada' AS ck_filtru_luna WITH ;
		Alignment = 0, ;
		camp_nume = luna+an*12, ;
		Caption = "Perioada", ;
		Enabled = .F., ;
		FontName = "Arial Narrow", ;
		Left = 572, ;
		luna = , ;
		Name = "Ck_perioada", ;
		TabIndex = 30, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_scc' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = scc, ;
		Caption = "Cont creditor", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 244, ;
		Name = "Ck_scc", ;
		TabIndex = 14, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_scd' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = scd, ;
		Caption = "Cont debitor", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 244, ;
		Name = "Ck_scd", ;
		TabIndex = 13, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_sectie' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = sectie, ;
		Caption = "Sectie", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 491, ;
		Name = "Ck_sectie", ;
		TabIndex = 26, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_sters' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		Caption = "Sterse", ;
		Comment = "*:OnResize=LT", ;
		Enabled = .F., ;
		FontName = "Arial Narrow", ;
		ForeColor = 255,0,0, ;
		Height = 18, ;
		Left = 639, ;
		Name = "Ck_sters", ;
		TabIndex = 33, ;
		Top = 31, ;
		Width = 45
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_sucursala' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = sucursala, ;
		Caption = "Sucursala", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		Left = 572, ;
		Name = "Ck_sucursala", ;
		TabIndex = 29, ;
		Top = 31
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_suma' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = suma, ;
		Caption = "Suma", ;
		FontName = "Arial Narrow", ;
		Left = 319, ;
		mask = (get_mask(12,gnPa)), ;
		Name = "Ck_suma", ;
		nrzec = (gnPa), ;
		TabIndex = 18, ;
		Top = 46
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_suma_val' AS ck_filtru_numar_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = suma_val, ;
		Caption = "Suma valuta", ;
		FontName = "Arial Narrow", ;
		Left = 319, ;
		mask = (get_mask(12,gnPVal)), ;
		Name = "Ck_suma_val", ;
		nrzec = (gnPval), ;
		TabIndex = 20, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_util' AS ck_filtru_text_manager WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		camp_nume = util, ;
		Caption = "Operator introducere", ;
		Comment = "*:OnResize=LT", ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,255, ;
		Left = 572, ;
		Name = "Ck_util", ;
		TabIndex = 32, ;
		Top = 78
		*< END OBJECT: ClassLib="caut_manager.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid_formula' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 326, ;
		HighlightStyle = 2, ;
		Left = 5, ;
		Name = "grid_formula", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "tLista_rjModificata", ;
		RowHeight = 19, ;
		Top = 102, ;
		Width = 679, ;
		Column1.ControlSource = "camp_numeT", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 117, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "traducere", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column3", ;
		Column2.Width = 536
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grid_formula.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 'grid_formula.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Traducere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_formula.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 'Line1' AS line WITH ;
		Anchor = 10, ;
		Height = 0, ;
		Left = 4, ;
		Name = "Line1", ;
		Top = 96, ;
		Width = 679
		*< END OBJECT: BaseClass="line" />
	
	PROCEDURE Init
		DODEFAULT()
		LOCAL lcTabel
		lcTabel = thisform.gRID_FORMULA.RecordSource 
		SELECT (lcTabel)
		SCAN 
			lcCamp_numeT = STRTRAN(ALLTRIM(camp_numeT),' ','')
			lcCamp_nume = STRTRAN(ALLTRIM(camp_nume),' ','')	
			
			lcCk = 'thisform.ck_'+lcCamp_numeT 
			IF TYPE("&lcCk") = 'U' 
				lcCk = 'thisform.ck_'+lcCamp_nume
			ENDIF 	
			
			lcCk_value = lcCk + '.value =1'
			&lcCk_value 
		SELECT (lcTabel)
		ENDSCAN 
		
		SELECT (lcTabel)
		GO TOP 
		
		this.Width = INT(_screen.Width*0.7)
		this.Height = INT(_screen.Height*0.7)
		this.AutoCenter = .T. 
	ENDPROC

	PROCEDURE Ck_perioada.Init
		DODEFAULT()
		this.Value = 1
	ENDPROC

	PROCEDURE Ck_sters.InteractiveChange
		*
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_parametri_calcul 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="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkColoaneVenchelt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cbo_venchelt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboCumul" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_data1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_data2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cbo_centre" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cfisexport
		*p: cnume_set
		*p: nind_act
		*p: nind_bal
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cfisexport = ''
		cnume_set = ''
		DoCreate = .T.
		Height = 162
		Name = "frm_parametri_calcul"
		nind_act = 0
		nind_bal = 0
		Width = 448
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 452
		_shape1.ZOrderSet = 0
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 411
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 32
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		Lb_titlu_alb_b121.ZOrderSet = 2
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 418
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 3
		Gridsort1.Left = 216
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 7
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 388, ;
		lvizibil = .F., ;
		Name = "But_renunt1", ;
		TabIndex = 8, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cbo_centre' AS combobox WITH ;
		ColumnWidths = "100", ;
		Height = 24, ;
		Left = 104, ;
		Name = "cbo_centre", ;
		RowSource = "cFCentre.sectie", ;
		RowSourceType = 2, ;
		Style = 2, ;
		TabIndex = 1, ;
		Top = 36, ;
		Width = 149
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'cbo_venchelt' AS combobox WITH ;
		Anchor = 11, ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "150,0", ;
		Height = 24, ;
		Left = 104, ;
		Name = "cbo_venchelt", ;
		RowSource = "cVenChelt.explicatie,id_venchelt", ;
		RowSourceType = 2, ;
		Style = 2, ;
		TabIndex = 2, ;
		Top = 62, ;
		Width = 149, ;
		ZOrderSet = 7
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'cboCumul' AS combobox WITH ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "50,0", ;
		ControlSource = "poset.cumul", ;
		FontBold = .F., ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 322, ;
		Name = "cboCumul", ;
		RowSource = "Luni,1,Trimestre,3,Semestre,6,Ani,12", ;
		RowSourceType = 1, ;
		Style = 2, ;
		TabIndex = 6, ;
		Top = 127, ;
		Width = 82, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Check1' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Impartire la 1000", ;
		FontBold = .F., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 264, ;
		Name = "Check1", ;
		TabIndex = 14, ;
		Top = 95, ;
		Visible = .F., ;
		Width = 115, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'chkColoaneVenchelt' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Coloane Cheltuieli/Venituri", ;
		ControlSource = "pnColoaneCheltuieliVenituri", ;
		FontBold = .F., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 264, ;
		Name = "chkColoaneVenchelt", ;
		TabIndex = 5, ;
		ToolTipText = 'Coloanele sunt generate de "tip cheltuiala/venit" sau de "timp"', ;
		Top = 65, ;
		Width = 171, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Container_data1' AS container_data WITH ;
		Left = 104, ;
		Name = "Container_data1", ;
		TabIndex = 3, ;
		Top = 88, ;
		CBOLUNA.ControlSource = "poset.lunai", ;
		CBOLUNA.Name = "CBOLUNA", ;
		CBOANUL.ControlSource = "poset.anulI", ;
		CBOANUL.Name = "CBOANUL", ;
		CBOANUL.RowSource = "1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030"
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_data2' AS container_data WITH ;
		Left = 104, ;
		Name = "Container_data2", ;
		TabIndex = 4, ;
		Top = 123, ;
		CBOLUNA.ControlSource = "poset.lunaF", ;
		CBOLUNA.Name = "CBOLUNA", ;
		CBOANUL.ControlSource = "poset.anulF", ;
		CBOANUL.Name = "CBOANUL", ;
		CBOANUL.RowSource = "1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030"
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Data initiala", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 7, ;
		Name = "Label1", ;
		TabIndex = 10, ;
		Top = 95, ;
		Width = 79, ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Data finala", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 7, ;
		Name = "Label2", ;
		TabIndex = 13, ;
		Top = 130, ;
		Width = 71, ;
		ZOrderSet = 5
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cumulare", ;
		FontBold = .F., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 264, ;
		Name = "Label3", ;
		TabIndex = 15, ;
		Top = 130, ;
		Width = 57, ;
		ZOrderSet = 7
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Sectia", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 7, ;
		Name = "Label4", ;
		TabIndex = 11, ;
		Top = 38, ;
		Width = 42, ;
		ZOrderSet = 5
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label5' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Chelt./Venit.", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 7, ;
		Name = "Label5", ;
		TabIndex = 12, ;
		Top = 65, ;
		Width = 80, ;
		ZOrderSet = 5
		*< END OBJECT: BaseClass="label" />
	
	PROCEDURE inainte_de_do_termin
		LOCAL lnLunaI, lnAnulI, lnLunaI, lnAnulF   
		LOCAL lcDataI, lcDataF, ldDataI, ldDataF    
		 
		lnLunaI = Thisform.Container_data1.cboLuna.Value
		lnAnulI = Thisform.Container_data1.cboAnul.Value
		lnLunaF = Thisform.Container_data2.cboLuna.Value
		lnAnulF = Thisform.Container_data2.cboAnul.Value
		
		lcDataI = "1/" + Padl(Str(lnLunaI,2,0),2,"0") + "/"+Str(lnAnulI,4,0)
		lcDataF = "1/" + Padl(Str(lnLunaF,2,0),2,"0") + "/"+ Str(lnAnulF,4,0)
		ldDataI = Ctod(lcDataI)
		ldDataF = Ctod(lcDataF)
		If ldDataI > ldDataF
		* Do mesaj With "Data initiala este mai mare decat data finala! Introduceti date valide!"
			amessagebox('Data initiala este mai mare decat data finala! Introduceti date valide!',0+48,"Atentie")
			Return .F.
		ENDIF
		
		Return .T.
		
	ENDPROC

	PROCEDURE Init
		Parameters tnIndAct, tnIndBal
		
		Thisform.nInd_act = tnIndAct
		Thisform.nInd_bal = tnIndBal
		
		If Thisform.nInd_act = 0
			This.cbo_venchelt.Enabled= .F.
		Else
			This.cbo_venchelt.Enabled= .T.
		Endif
		
		DoDefault()
		If !initializeaza_sucursala() &&	oinit_optiuni.prg
			Return
		Endif
	ENDPROC

	PROCEDURE cbo_centre.Init
		THIS.VALUE = "<FIRMA>"
	ENDPROC

	PROCEDURE cbo_centre.Valid
		pnid_sectie = cfcentre.id_sectie
		this.Value = cFCentre.sectie
	ENDPROC

	PROCEDURE cbo_venchelt.Init
		THIS.VALUE = "<TOATE>"
		
	ENDPROC

	PROCEDURE cbo_venchelt.Valid
		pnId_venChelt = cVenChelt.id_venchelt
		this.Value = cVenChelt.explicatie
		
		IF THIS.VALUE = "<TOATE>"
			thisform.chkColoaneVenchelt.Visible = .T.
			pnColoaneCheltuieliVenituri = 0
			thisform.chkColoaneVenchelt.Refresh()
		ELSE 
			thisform.chkColoaneVenchelt.Visible = .F.
		ENDIF 
			
		IF thisform.nInd_act <> 0 AND thisform.nInd_bal <> 0
			AMESSAGEBOX('Selectia pentru tipul de cheltuiala este valabila doar pentru indicatorii din jurnal!',48,"Atentie")
		ENDIF 
		
		
		
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_set 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="Container_rj" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_rj.cmd" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_rj.grid_formule_rj" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_rj.grid_formule_rj.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_rj.grid_formule_rj.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_rj.grid_formule_rj.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_rj.grid_formule_rj.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_functii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_functii.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_functii.edtFormFct" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cRand.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cRand.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cNume_ind.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cNume_ind.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cAles.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cComentariu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.cComentariu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_set.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNume_set" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Label12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_bal.Container_text_cmd10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_randuri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_randuri.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_randuri.cmd" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_randuri.edtFormRd" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_grafic1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_grafic
		*m: do_modiparam
		*m: send_formula
		*p: cnume_set
		*p: lnou
		*p: nid_modipara
		*p: nid_set
	*</DefinedPropArrayMethod>

	*<PropValue>
		BackColor = 240,240,240
		cnume_set = 
		DoCreate = .T.
		Height = 500
		lnou = .F.
		Name = "frm_set"
		nid_modipara = 0
		nid_set = 0
		Width = 800
		_memberdata = <VFPData>
			<memberdata name="cnume_set" display="cNume_set"/>
		</VFPData>
		_SHAPE1.Anchor = 10
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 801
		_SHAPE1.ZOrderSet = 2
		_SHAPE2.Anchor = 9
		_SHAPE2.Height = 29
		_SHAPE2.Left = 625
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 180
		_SHAPE2.ZOrderSet = 3
		LB_TITLU_ALB_B121.Caption = "SET"
		LB_TITLU_ALB_B121.Left = 6
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 13
		LB_TITLU_ALB_B121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 771
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 11
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Left = 432
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 7
	*</PropValue>

	ADD OBJECT 'But_grafic1' AS but_grafic WITH ;
		Anchor = 9, ;
		Left = 713, ;
		Name = "But_grafic1", ;
		TabIndex = 10, ;
		Top = 1, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		Left = 653, ;
		Name = "But_modifica1", ;
		TabIndex = 8, ;
		Top = 1, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 9, ;
		Left = 623, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 9, ;
		Left = 742, ;
		Name = "But_renunt1", ;
		TabIndex = 12, ;
		Top = 1, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 9, ;
		Left = 683, ;
		Name = "But_sterge1", ;
		TabIndex = 9, ;
		Top = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Command2' AS commandbutton WITH ;
		Anchor = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Comment = "*:onResize=lb", ;
		Height = 17, ;
		Left = 456, ;
		Name = "Command2", ;
		Picture = ..\..\grafice\ok.bmp, ;
		TabIndex = 15, ;
		ToolTipText = 'Bifeaza/debifeaza "ales"', ;
		Top = 58, ;
		Width = 20, ;
		ZOrderSet = 16
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Container_bal' AS container WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		Height = 414, ;
		Left = 484, ;
		Name = "Container_bal", ;
		TabIndex = 3, ;
		Top = 79, ;
		Visible = .F., ;
		Width = 308, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd1' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd1", ;
		Top = 6, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcPD1", ;
		edt.FontSize = 10, ;
		edt.Height = 38, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd10' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd10", ;
		Top = 357, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcSC", ;
		edt.Height = 39, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd2' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd2", ;
		Top = 45, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcPC1", ;
		edt.Height = 38, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd3' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd3", ;
		Top = 84, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcPD", ;
		edt.Height = 38, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd4' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd4", ;
		Top = 123, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcPC", ;
		edt.Height = 38, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd5' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd5", ;
		Top = 162, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcRD", ;
		edt.Height = 39, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd6' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd6", ;
		Top = 201, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcRC", ;
		edt.Height = 39, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd7' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd7", ;
		Top = 240, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcTD", ;
		edt.Height = 39, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd8' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd8", ;
		Top = 279, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcTC", ;
		edt.Height = 39, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Container_text_cmd9' AS container_text_cmd WITH ;
		Anchor = 10, ;
		Height = 38, ;
		Left = 84, ;
		Name = "Container_text_cmd9", ;
		Top = 318, ;
		Width = 221, ;
		edt.Anchor = 10, ;
		edt.ControlSource = "pcSD", ;
		edt.Height = 39, ;
		edt.Left = 0, ;
		edt.Name = "edt", ;
		edt.Top = -1, ;
		edt.Width = 190, ;
		CMD.Anchor = 8, ;
		CMD.Left = 194, ;
		CMD.Name = "CMD", ;
		CMD.Top = 8
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'Container_bal.Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Sold Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label1", ;
		Top = 318, ;
		Width = 62
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label10' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Prec. Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label10", ;
		Top = 40, ;
		Width = 71
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label11' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "1 ian.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 47, ;
		Name = "Label11", ;
		Top = 14, ;
		Width = 34
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label12' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "1 ian.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 47, ;
		Name = "Label12", ;
		Top = 51, ;
		Width = 34
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Sold Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label2", ;
		Top = 357, ;
		Width = 66
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label3", ;
		Top = 240, ;
		Width = 64
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label4' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label4", ;
		Top = 279, ;
		Width = 68
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label5' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Rulaj Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label5", ;
		Top = 162, ;
		Width = 65
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label6' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Rulaj Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label6", ;
		Top = 202, ;
		Width = 69
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label7' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Prec. Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label7", ;
		Top = 85, ;
		Width = 67
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label8' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Prec. Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label8", ;
		Top = 123, ;
		Width = 71
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_bal.Label9' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Prec. Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label9", ;
		Top = 3, ;
		Width = 67
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'container_functii' AS container WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		Height = 414, ;
		Left = 484, ;
		Name = "container_functii", ;
		TabIndex = 4, ;
		Top = 166, ;
		Visible = .F., ;
		Width = 308, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'container_functii.edtFormFct' AS textbox WITH ;
		Anchor = 15, ;
		ControlSource = "pcFormula", ;
		Height = 24, ;
		Left = 7, ;
		Name = "edtFormFct", ;
		ReadOnly = .T., ;
		Top = 31, ;
		Width = 295
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'container_functii.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Formula", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label2", ;
		Top = 12, ;
		Width = 48
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_randuri' AS container WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		Height = 414, ;
		Left = 484, ;
		Name = "Container_randuri", ;
		TabIndex = 5, ;
		Top = 79, ;
		Visible = .F., ;
		Width = 308, ;
		ZOrderSet = 14
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'Container_randuri.cmd' AS commandbutton WITH ;
		Anchor = 8, ;
		Caption = "", ;
		Height = 21, ;
		Left = 279, ;
		Name = "cmd", ;
		Picture = ..\grafice\wzedit.bmp, ;
		Top = 7, ;
		Width = 24
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Container_randuri.edtFormRd' AS editbox WITH ;
		Anchor = 15, ;
		ControlSource = "pcFormula", ;
		FontSize = 10, ;
		Height = 373, ;
		Left = 7, ;
		Name = "edtFormRd", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 296
		*< END OBJECT: BaseClass="editbox" />

	ADD OBJECT 'Container_randuri.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Formula", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 8, ;
		Name = "Label2", ;
		Top = 10, ;
		Width = 49
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_rj' AS container WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		Height = 412, ;
		Left = 484, ;
		Name = "Container_rj", ;
		TabIndex = 6, ;
		Top = 79, ;
		Visible = .F., ;
		Width = 308, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'Container_rj.cmd' AS commandbutton WITH ;
		Alignment = 4, ;
		Anchor = 8, ;
		Caption = "", ;
		Height = 21, ;
		Left = 280, ;
		Name = "cmd", ;
		Picture = ..\grafice\wzedit.bmp, ;
		Top = 7, ;
		Width = 22
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Container_rj.grid_formule_rj' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 2, ;
		DeleteMark = .T., ;
		Height = 371, ;
		HighlightStyle = 2, ;
		Left = 7, ;
		Name = "grid_formule_rj", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "tLista_rj", ;
		RowHeight = 19, ;
		Top = 35, ;
		Width = 295, ;
		Column1.ControlSource = "camp_numeT", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 129, ;
		Column2.ControlSource = "traducere", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 178
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Container_rj.grid_formule_rj.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Camp", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Container_rj.grid_formule_rj.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 'Container_rj.grid_formule_rj.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Conditie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Container_rj.grid_formule_rj.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 'grid_set' AS _grdrow WITH ;
		Anchor = 5, ;
		ColumnCount = 5, ;
		DeleteMark = .T., ;
		FontName = "Arial", ;
		Height = 414, ;
		HighlightStyle = 2, ;
		Left = 6, ;
		Name = "grid_set", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "m_indicatori", ;
		TabIndex = 2, ;
		Top = 79, ;
		Width = 471, ;
		ZOrderSet = 6, ;
		Column1.ControlSource = "rand", ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cRand", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 42, ;
		Column2.ControlSource = "nume_ind", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cNume_ind", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 277, ;
		Column3.ControlSource = "ales", ;
		Column3.FontName = "Arial", ;
		Column3.Name = "cAles", ;
		Column3.ReadOnly = .F., ;
		Column3.Sparse = .F., ;
		Column3.Width = 29, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = 'iif(!EMPTY(comentariu) and !isnull(comentariu) ,"*","")', ;
		Column4.FontName = "Arial", ;
		Column4.Name = "cComentariu", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 16, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = 'iif(tip=1,"Balanta",iif(tip=2,"Registru jurnal",iif(tip=3,"Facturi",iif(tip=4,"Altfel",iif(tip=5,"Rd.",iif(tip=6,"Functie","Necunoscut"))))))', ;
		Column5.FontName = "Arial", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 85
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid_set.cAles.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 19, ;
		Name = "Check1", ;
		ReadOnly = .F., ;
		Top = 47, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grid_set.cAles.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Ales", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_set.cComentariu.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "?", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_set.cComentariu.Text1' AS textbox WITH ;
		FontName = "Arial", ;
		Height = 23, ;
		Left = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255, ;
		Top = 23, ;
		Width = 100
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid_set.cNume_ind.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume indicator", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_set.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_set.cRand.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rand", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Nume set", ;
		Height = 17, ;
		Left = 6, ;
		Name = "Label1", ;
		TabIndex = 14, ;
		Top = 37, ;
		Width = 56, ;
		ZOrderSet = 7
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'txtNume_set' AS textbox WITH ;
		ControlSource = "Thisform.cNume_set", ;
		Format = "k", ;
		Height = 23, ;
		Left = 64, ;
		Name = "txtNume_set", ;
		TabIndex = 1, ;
		Top = 34, ;
		Width = 365, ;
		ZOrderSet = 8
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE do_adauga
		LOCAL lcTabel, llSucces 
		lcTabel = thisform.grid_set.RecordSource 
		llSucces = adauga_indicator(thisform.nId_set, m.lcTabel) && IN oproceduri_seturi_indicatori.prg
		
		IF EMPTY(thisform.nId_set)
			thisform.nId_set = &lcTabel..id_set
		ENDIF 
		
		thisform.grid_set.SetFocus()
	ENDPROC

	PROCEDURE do_grafic
		#DEFINE CRLF CHR(13) + CHR(10)
		
		THISFORM.ALWAYSONTOP = .F.
		DO make_venChelt IN oproceduri_manager.prg
		
		PRIVATE pnId_set, pnLunaI, pnAnulI, pnLunaF, pnAnulF, pnCumul, pnCount, pcNume_set, pnId_sectie, pnId_venchelt
		PRIVATE pnColoaneCheltuieliVenituri
		pnColoaneCheltuieliVenituri = 0
		STORE 0 TO pnId_set, pnId_sectie, pnId_venchelt, pnCount && cate inregistrari are setul
		pnId_set = THISFORM.nId_set
		STORE '' TO pcNume_set
		
		
		LOCAL lcAlias, llFaraGrafic, lcNumeSet
		
		lcSel = THISFORM.grid_set.RECORDSOURCE
		lcNumeSet = THISFORM.txtnume_set.VALUE
		
		IF THISFORM.lNou
			PRIVATE pnIndAct, pnIndBal
			STORE 0 TO pnIndAct, pnIndBal
		
			lcfisier_export = gcTempPath + lcSel+".dbf"
			*Do calculeaza_set With lcfisier_export, lcNumeSet In oproceduri_seturi_indicatori.prg
		
			SELECT DISTINCT id_set, ;
				gnLuna AS lunaI, gnAn AS anulI,  ;
				gnLuna AS lunaF, gnAn AS anulF, ;
				00 AS cumul ;
				FROM (lcSel) ;
				INTO CURSOR cParametri
		
			SELECT COUNT(*) AS nrIndAct ;
				FROM (lcSel) ;
				WHERE tip = 2 ;
				INTO CURSOR crsIndAct
		
			SELECT COUNT(*) AS nrIndBal ;
				FROM (lcSel) ;
				WHERE tip = 1 OR tip = 6 ;
				INTO CURSOR crsIndBal
		
			SELECT crsIndAct
			pnIndAct = nrIndAct
			SELECT crsIndBal
			pnIndBal = nrIndBal
		
			IF USED('nrIndAct')
				USE IN nrIndAct
			ENDIF
		
			IF USED('crsIndBal')
				USE IN crsIndBal
			ENDIF
		
			SELECT cParametri
			SCATTER NAME poset
		
			poset.lunaI = gnLuna
			poset.anulI = gnAn
			poset.lunaF = gnLuna
			poset.anulF = gnAn
			poset.cumul = 1 && luni
		
			loexport = CREATEOBJECT("frm_parametri_calcul",pnIndAct,pnIndBal)
			loexport.lb_titlu_alb_b121.CAPTION = ALLTRIM(lcNumeSet)
			loexport.SHOW(1)
		
			IF buton = 2
				RETURN
			ENDIF
		
			pnAnulI = poset.anulI
			pnLunaI = poset.lunaI
			pnAnulF = poset.anulF
			pnLunaF = poset.lunaF
			pnCumul = poset.cumul
		
			IF USED("cParametri")
				USE IN cParametri
			ENDIF
		
		ELSE
			THISFORM.do_modiparam()
		
			IF buton = 2
				RETURN
			ENDIF
		
			DO CASE
				CASE THISFORM.nId_modipara = 1 && toate seturile
					IF USED("crsSeturi") && situatii financiare
						SELECT crsSeturi
					ENDIF
					IF USED("t_seturi")
						SELECT t_seturi
					ENDIF
				CASE THISFORM.nId_modipara = 2 && seturi uzuale
					PRIVATE poSetUz, pcschema1, pcselect1
					STORE '' TO poSetUz
					pcschema1 = []
					pcselect1 = ['select * from mg_seturi_uzuale where 1=2']
					pcorder1 = []
					pcfiltru1 = [id_util =] + ALLTRIM(STR(gnIdUtil))
					llAfiseaza = .F.
					gencursor('poSetUz','cIntermediar',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
					poSetUz.ca_baza1.afisare()
		
					IF USED('crsSeturiUzuale')
						USE IN crsSeturiUzuale
					ENDIF
		
					USE DBF("cIntermediar") IN 0 AGAIN ALIAS crsSeturiUzuale
					IF USED("cIntermediar")
						USE IN cIntermediar
					ENDIF
		
					SELECT crsSeturiUzuale
			ENDCASE
		
			LOCATE FOR id_set = THISFORM.nId_set
			IF FOUND()
				pnAnulI = anulI
				pnLunaI = lunaI
				pnAnulF = anulF
				pnLunaF = lunaF
				pnCumul = cumul
			ELSE
				RETURN
			ENDIF
		
			IF faraGrafic = 0
				llFaraGrafic = .F.
			ELSE
				llFaraGrafic = .T.
			ENDIF
		
			IF USED("crsSeturiUzuale")
				USE IN crsSeturiUzuale
			ENDIF
		
		ENDIF
		
		&& daca creez coloane pentru fiecare tip chelt/venit apelez calculul setului pentru fiecare tip chelt/venit
		&& selectez numai tipurile de chelt/venituri pentru sectia si perioada aleasa
		lcListaXtab = ""
		IF pnColoaneCheltuieliVenituri = 1
			lcSel = [SELECT DISTINCT A.ID_VENCHELT, V.EXPLICATIE FROM ACT A ] + ;
				[LEFT JOIN VNOM_VENCHEL V ON A.ID_VENCHELT = V.ID_VENCHELT ] + ;
				[WHERE A.STERS = 0 AND A.an*12+A.luna between ?pnAnulI*12 + ?pnLunaI AND ?pnAnulF*12+?pnLunaF] + ;
				IIF(!EMPTY(pnId_Sectie), [ AND A.ID_SECTIE = ?pnId_Sectie], []) + ;
				STRTRAN(gcCondSucursala,[id_sucursala],[a.id_sucursala])
			lcSel = lcSel + [ ORDER BY NVL(V.EXPLICATIE,'_')]
			lnSucces = goExecutor.oExecute(lcSel, "cVenCheltTemp")
			IF lnSucces < 0
				AMESSAGEBOX(goExecutor.oPrelucrareEroare(),0+16,'Eroare')
				RETURN 
			ENDIF 
				
			SELECT cVenCheltTemp
			SCAN && FOR NVL(id_venchelt,0) <> 0
				lcCheltuiala = strtranx(ALLTRIM(cVenCheltTemp.explicatie), "[^a-z0-9]",[_],1,,1)
				pnId_venchelt = id_venchelt		
				IF NVL(id_venchelt,0) = 0
					pnId_venchelt = 99999
					lcCheltuiala = "Fara_tip_cheltuiala"
				ENDIF 
		
				WAIT WINDOW 'Se calculeaza ' + lcCheltuiala + " " + ALLTRIM(STR(RECNO())) + '/' + ALLTRIM(STR(RECCOUNT())) + ' ...' NOWAIT
		
				&& DACA APAS ESC IES DIN SCAN CU CE AM CALCULAT PANA ACUM
				lnKeyCode = INKEY(0.5)
				IF lnKeyCode = 27 && ESC
					EXIT
				ENDIF 
				lcSel = [{call PACK_MG_EVOLUTIE.GEN_MG_INDICATORI(?pnLunaI,?pnAnulI,?pnLunaF,?pnAnulF,?pnCumul,?pnId_sectie,?pnId_venchelt)}]
				lcCursor = 'xtab_o' + ALLTRIM(STR(pnId_venchelt))
				lnSucces = goExecutor.oExecute(lcSel,lcCursor)
				IF lnSucces < 0
					AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
					RETURN
				ENDIF
		
				lcListaXtab = lcListaXtab + lcCursor + ";" + lcCheltuiala + ","
			ENDSCAN
			USE IN (SELECT('cVenCheltTemp'))
			pnId_venchelt = 0
			lcSelect = ""
		
			&& creez un cursor cu toate coloanele din xtab_o<id_venchelt> prin join
			lcSelect = MAKE_XTABO_VENCHELT(lcListaXtab) && oproceduri_evolutie.prg
			
			IF !USED('xtab_o')
				RETURN
			ENDIF
		
		ELSE
			lcSel = [{call PACK_MG_EVOLUTIE.GEN_MG_INDICATORI(?pnLunaI,?pnAnulI,?pnLunaF,?pnAnulF,?pnCumul,?pnId_sectie,?pnId_venchelt)}]
			lcCursor = 'xtab_o'
			lnSucces = goExecutor.oExecute(lcSel,lcCursor)
			IF lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF
		
		SELECT xtab_o
		IF RECCOUNT()=0
			amessagebox('Raportul nu contine nici o informatie!',0+48,"Atentie")
			IF USED('xtab_o')
				USE IN xtab_o
			ENDIF
			RETURN
		ENDIF
		***---------
		PRIVATE poset
		STORE '' TO poset
		
		LOCAL lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
		lcSchema1 = []
		lcSelect1 = [select id_ind, ales from mg_tmp_indicatori]
		lcOrder1 = []
		lcgroup = []
		lcFiltru1 = [ales=1 and id_set=]+ALLTRIM(STR(THISFORM.nId_set))
		lcFiltruOriginal = []
		llModParam = .T.
		llAfiseaza = .F.
		
		gencursor('poSet','crsSet', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza,  lcgroup, llModParam, lcFiltruOriginal)
		poset.ca_baza1.afisare()
		
		***---------
		lcFisXtab = gcTempPath + "xtab.dbf"
		SELECT crsSet
		LOCATE FOR ales = 1
		IF FOUND()
			SELECT x.* ;
				FROM xtab_o x JOIN crsSet i ON i.id_ind = x.id_ind ;
				ORDER BY ord_rand, RAND INTO CURSOR XTAB READWRITE
			*!*			ORDER BY ord_rand, RAND INTO TABLE (lcFisXtab)
		ELSE
			SELECT x.* ;
				FROM xtab_o x ;
				ORDER BY ord_rand, RAND INTO CURSOR XTAB READWRITE
			*!*			ORDER BY ord_rand, RAND INTO TABLE (lcFisXtab)
		ENDIF
		lcFisXtab = DBF('XTAB')
		
		IF USED("crsSet")
			USE IN crsSet
		ENDIF
		RELEASE poset
		
		DO viz_set_calc WITH 'xtab', THISFORM.nId_set, llFaraGrafic, lcNumeSet, pnId_sectie, pnId_venchelt
		
		RELEASE loSet
		IF USED('xtab')
			USE IN XTAB
		ENDIF
		
		THISFORM.ALWAYSONTOP = .T.
		
	ENDPROC

	PROCEDURE do_modifica
		LOCAL lcTabel, lnId_ind, llSucces
		lcTabel = thisform.grid_set.RecordSource 
		SELECT (lcTabel)
		lnId_ind = id_ind
		
		llSucces = modifica_indicator(thisform.nId_set, lnId_ind, m.lcTabel) && IN oproceduri_seturi_indicatori.prg
		thisform.grid_set.SetFocus()
	ENDPROC

	PROCEDURE do_modiparam
		Local lcTabel, lcAlias
		
		lcTabel = Thisform.grid_set.RecordSource
		Select (lcTabel)
		
		Private pnId_set, pnId_modipara
		pnId_set = Thisform.nId_set
		pnId_modipara = Thisform.nid_modipara
		
		lcSel = [{call pack_mg_evolutie.get_set_linie(?pnId_set, ?pnId_modipara, ?gnIdutil)}]
		lcCursor = 'crsSet'
		lnSucces = goExecutor.oExecute(lcSel,lcCursor)
		
		If lnSucces < 0
			amessagebox('Call pack_mg_evolutie.get_set_linie' + Chr(13) + goExecutor.cEroare,0+16,"Eroare")
			Return
		Endif
		
		***----------
		Do Case
		Case Thisform.nid_modipara = 1 && toate seturile
			If Used("crsSeturi") && situatii financiare
				Select crsSeturi
				LOCATE FOR id_set = pnId_set
				lcAlias = 'crsSeturi'
			Endif
			If Used("t_seturi")
				Select t_seturi
				LOCATE FOR id_set = pnId_set
				lcAlias = 't_seturi'
			Endif
		Case Thisform.nid_modipara = 2 && seturi uzuale
			Private poSetUz, pcschema1, pcselect1
			Store '' To poSetUz
			pcschema1 = []
			pcselect1 = ['select * from mg_seturi_uzuale where 1=2']
			pcorder1 = []
			pcfiltru1 = [id_util =] + Alltrim(Str(gnIdUtil))
			llAfiseaza = .F.
			gencursor('poSetUz','cIntermediar',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
			poSetUz.ca_baza1.afisare()
		
			If Used('crsSeturiUzuale')
				SELECT crsSeturiUzuale
				Use In crsSeturiUzuale
			Endif
			Use Dbf("cIntermediar") In 0 Again Alias crsSeturiUzuale
			If Used("cIntermediar")
				Use In cIntermediar
			ENDIF
			
			SELECT crsSeturiUzuale
			LOCATE FOR id_set = pnId_set
		
			Select crsSeturiUzuale
			lcAlias = 'crsSeturiUzuale'
		Endcase
		***--------------
		
		*DO modifica_parametri WITH pnId_modipara, 'crsSet' IN oproceduri_seturi_indicatori.prg
		Local llDinFormModi
		llDinFormModi = .T.
		Do modifica_parametri With pnId_modipara, lcAlias, llDinFormModi In oproceduri_seturi_indicatori.prg
		
		If Used("crsSet")
			Use In crsSet
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		THISFORM.LOCKSCREEN = .T.
		
		*!*	DEBUG
		*!*	SUSPEND
		
		PRIVATE pnid_ind 
		STORE 0 TO pnid_ind 
		
		LOCAL lcTabel, lnInreg, lnRec, lnRaspuns
		lcTabel = ALLTRIM(THISFORM.grid_set.RECORDSOURCE)
		STORE 0 TO lnInreg
		
		SELECT (lcTabel)
		IF RECCOUNT()>0
		lnRec = RECNO() && imi intoarece o valoare negativa = nr. inregistarilor adaugate
		
		
		*!*		lcMesaj = "Doriti sa stergeti inregistrarea?"
		*!*		lcTitlu = "Stergere"
		
		*!*		lcimagine = [intreb.ico]
		*!*		lctip = [Intrebare]
		*!*		ofrm_intreb = Createobject('frm_mesaj',lcTitlu,lcimagine,lctip,lcMesaj)
		*!*		ofrm_intreb.Show(1)
		*!*		Release ofrm_intreb
		
		*!*		If buton = 2
		*!*			Return
		*!*		Endif
		
			lnRaspuns = amessagebox('Doriti sa stergeti indicatorul?',4+32,"Confirmare")
			IF lnRaspuns = 7 && 7 = No ; 6 = Yes
				THISFORM.LOCKSCREEN = .F.
				RETURN
			ENDIF
		
			save_grid_tag(THIS.grid_set)
		
		&& sterg de pe server si le iau din nou
		
		*!*	pnid_ind = &lcTabel..id_ind
		*!*	lcSql = [begin PACK_MG_EVOLUTIE.sterge_indicator(?pnId_set); end;]
		*!*			lnSucces = goExecutor.oExecute(lcSql)
		
		*!*			If lnSucces < 0
		*!*				Messagebox('sterge_indicator'+goExecutor.cEroare,0+16,"Eroare")
		*!*				Return
		*!*			ENDIF
				***
		
		*!*		IF USED(lcTabel)
		*!*			USE IN &lcTabel
		*!*		ENDIF
			***
			pcExec = [update mg_tmp_indicatori set sters = 1 where id_ind =  ]+ ALLTRIM(STR(&lcTabel..id_ind))
		
			lnSucces = goExecutor.oExecute(pcExec)
			IF lnSucces < 0
				lcTextEroare = goExecutor.cEroare
				AMESSAGEBOX(lcTextEroare,48,"Eroare")
				RETURN
			ENDIF
		
			IF USED(lcTabel)
				USE IN &lcTabel
			ENDIF
			***
			PRIVATE poSetS,pcschema1,pcselect1
			STORE '' TO poSetS
			pcschema1=['']
			pcselect1=['select id_ind, id_set, rand, ord_rand, nume_ind, formula, ales, tip, comentariu, sters from mg_tmp_indicatori where 1=2']
			pcorder1 = []
			pcfiltru1 = [sters=0 and id_set = ] +ALLTRIM(STR(THISFORM.nId_set))
			llAfiseaza = .F.
			gencursor('poSetS','crsIntermediar',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfiseaza)
			poSetS.ca_baza1.afisare()
		
			SELECT * FROM crsIntermediar INTO CURSOR m_indicatori READWRITE ORDER BY RAND
			RELEASE poSetS
		
			restore_grid_tag(THIS.grid_set)
		
		*!*		CALCULATE CNT() FOR !DELETED() TO lnInreg
		*!*		WAIT WINDOW "lnInreg="+ALLTRIM(STR(lnInreg))
		*!*		WAIT WINDOW "lnRec="+ALLTRIM(STR(lnrec))
		*!*		
		*!*		IF lnRec >= lnInreg 
		*!*			GOTO lnRec
		*!*		ELSE 
		*!*			GO BOTTOM 	
		*!*		ENDIF
		
			THISFORM.grid_set.SETFOCUS
		ENDIF
		
		THISFORM.LOCKSCREEN = .F.
		
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Private pnId_set, pcNume_set, pnCumul, pnFaraGrafic
		Local lcSql, llSucces, lcTabel
		
		pnId_set = Thisform.nId_set
		pcNume_set = Alltrim(Nvl(Thisform.cNume_set, ''))
		llSucces = .F.
		lcTabel = Thisform.grid_set.RecordSource
		pnCumul = 1
		pnFaraGrafic = 1
		
		Select (lcTabel)
		If Reccount() > 0
			If Empty(pcNume_set)
				amessagebox('Completati numele setului!', 0 + 48, "Atentie")
				Return m.llSucces
			Endif
		Endif
		
		* Adauga set nou
		If This.lNou
			lcSql = [begin PACK_MG_EVOLUTIE.adauga_set(?pnId_set, ?pcNume_set, ?gnLuna, ?gnAn, ?gnLuna, ?gnAn, ?pnCumul); end;]
			llSucces = goExecutor.oExecuta(lcSql)
		Else
			llSucces = .T.
		Endif
		
		* Copiaza indicatori din mg_tmp_indicatori in mg_indicatori
		If m.llSucces
			lcSql = [begin PACK_MG_EVOLUTIE.SET_SET(?pnId_set); end;]
			llSucces = goExecutor.oExecuta(lcSql)
		Endif
		
		* Modifica nume set
		If m.llSucces
			lcSql = [begin PACK_MG_EVOLUTIE.modifica_set(?pnId_set,?pcNume_set);end;]
			llSucces = goExecutor.oExecuta(lcSql)
		Endif
		
		
		* Adaug set uzual
		If This.lNou AND this.nid_modipara = 2 && uzual
			lcSql = [begin PACK_MG_EVOLUTIE.adauga_uzual(?pnId_set,?gnIdUtil, ?gnLuna, ?gnAn, ?gnLuna, ?gnAn, ?pnCumul, ?pnFaraGrafic); end;]
			llSucces = goExecutor.oExecuta(lcSql)
		
			If m.llSucces
				oprinc.set_uzual_requery
			Endif
		Endif
		
		Return m.llSucces
	ENDPROC

	PROCEDURE Init
		PARAMETERS tnId_set, tcNume_set, tlNou, tnId_modiPara
		
		DODEFAULT()
		
		thisform.nId_set = m.tnId_set
		thisform.cNume_set = m.tcNume_set
		thisform.nId_modipara = m.tnId_modiPara
		thisform.lNou = m.tlNou
		
		thisform.grid_set.AfterRowColChange 
		
		this.Width = INT(_screen.Width*0.7)
		this.Height = INT(_screen.Height*0.7)
		this.AutoCenter = .T.
	ENDPROC

	PROCEDURE Release
		IF USED('cVenChelt')
			USE IN cVenChelt
		ENDIF 
	ENDPROC

	PROCEDURE send_formula
		Private pnId_ind, pnId_set &&, pcFormula
		Store 0 To pnId_ind
		pnId_set = Thisform.nId_set
		
		Local lcTabel, lnTip
		lcTabel = Thisform.grid_set.RecordSource
		pnId_ind = &lcTabel..id_ind
		If Empty(pnId_ind)
			lcSql = [begin PACK_MG_EVOLUTIE.next_id_ind(?@pnId_ind); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			If lnSucces < 0
				AMessagebox(goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
		Endif
		
		lnTip = &lcTabel..tip
		
		Do Case
		Case lnTip = 1 && balanta
			pcFormula = ''
			If !Empty(pcPD1)
				pcFormula = pcFormula + '<PD1>'+Alltrim(pcPD1)+";"
			Endif
			If !Empty(pcPC1)
				pcFormula = pcFormula + '<PC1>'+Alltrim(pcPC1)+";"
			Endif
			If !Empty(pcPD)
				pcFormula = pcFormula + '<PD>'+Alltrim(pcPD)+";"
			Endif
			If !Empty(pcPC)
				pcFormula = pcFormula + '<PC>'+Alltrim(pcPC)+";"
			Endif
			If !Empty(pcRD)
				pcFormula = pcFormula + '<RD>'+Alltrim(pcRD)+";"
			Endif
			If !Empty(pcRC)
				pcFormula = pcFormula + '<RC>'+Alltrim(pcRC)+";"
			Endif
			If !Empty(pcTD)
				pcFormula = pcFormula + '<TD>'+Alltrim(pcTD)+";"
			Endif
			If !Empty(pcTC)
				pcFormula = pcFormula + '<TC>'+Alltrim(pcTC)+";"
			Endif
			If !Empty(pcSD)
				pcFormula = pcFormula + '<SD>'+Alltrim(pcSD)+";"
			Endif
			If !Empty(pcSC)
				pcFormula = pcFormula + '<SC>'+Alltrim(pcSC)+";"
			Endif
		Case lnTip = 2 && rj
			pcFormula = ''
			lcTabelRJ = Thisform.container_rj.grid_formule_rj.RecordSource
			Select (lcTabelRJ)
			SCAN
				lcCampT = Alltrim(camp_numeT) &&
				lcCamp = Alltrim(camp_nume)
				lcTraducere = Strtran(Alltrim(traducere),[''],['])
				pcFormulaI = Strtran(Alltrim(formula),[''],[']) && form. intermediara (doar pt. un camp)
				pcFormula = pcFormula + '<' + lcCampT + '>|' + ;
					'<' + lcCamp + '>|' + ;
					'<' + lcTraducere + '>|' + ;
					'<' + pcFormulaI + '>;'
		
				Select (lcTabelRJ)
			Endscan
		*!*	Case lnTip = 5 && randuri
		*!*		pcFormula = pcFormula
		Endcase
		
		Select (lcTabel)
		Replace formula With pcFormula
		
		
		lcSql = [begin PACK_MG_EVOLUTIE.update_mg_tmp_indicatori(?pnId_set, ?pnId_ind, ?pcFormula); end;]
		lnSucces = goExecutor.oExecute(lcSql)
		
		If lnSucces < 0
			AMessagebox(goExecutor.cEroare,0+16,"Eroare")
			Return
		Endif
		
		
		
		
		
	ENDPROC

	PROCEDURE Command2.Click
		LOCAL lcTabel
		lcTabel = thisform.grid_set.RecordSource 
		SELECT (lcTabel)
		LOCATE FOR ales = 1
		IF FOUND()
			REPLACE ALL ales WITH 0
		ELSE
			REPLACE ALL ales WITH 1
		ENDIF
		
		thisform.grid_set.cAles.check1.Valid 
	ENDPROC

	PROCEDURE Container_randuri.cmd.Click
		LOCAL lcLista 
		lcLista = this.Parent.edtFormRd.Value 
		
		SELECT rand, nume_ind FROM m_indicatori INTO CURSOR cRanduri
		
		pcFormulaModi = lcLista && pcFormula 
		SELECT cRanduri
		lofr=CREATEOBJECT("frm_ind_rand")
		lofr.show(1)
		
		IF buton = 2
			RETURN
		ENDIF
		
		pcFormula = pcFormulaModi 
		 		
		IF USED("cRanduri")
			USE IN cRanduri
		ENDIF 	
		
		thisform.send_formula
		this.Parent.edtFormRd.Refresh 
		
	ENDPROC

	PROCEDURE Container_rj.cmd.Click
		LOCAL lofr, lcTabel 
		
		lcTabel = thisform.container_rj.grid_formule_rj.RecordSource && tLista_rj
		SELECT * FROM (lcTabel) INTO CURSOR tLista_rjModificata READWRITE  
		SELECT tLista_rjModificata 
		
		lofr=CREATEOBJECT("frm_ind_rj")
		lofr.show(1)
		
		IF buton = 2
			RETURN
		ENDIF
		
		SELECT (lcTabel)
		DELETE ALL 
		APPEND FROM DBF("tLista_rjModificata") 
		SELECT (lcTabel)
		GO TOP 
		
		thisform.container_rj.Refresh 
		thisform.send_formula
		
		
	ENDPROC

	PROCEDURE Container_rj.grid_formule_rj.Init
		* Nu sterge
	ENDPROC

	PROCEDURE grid_set.AfterRowColChange
		Lparameters nColIndex
		
		Local lcTabel, lnTip, lcTabelRJ && pcFormula, 
		STORE '' TO pcFormula
		lcTabel = This.RecordSource
		
		Thisform.container_bal.Visible = .F.
		Thisform.container_randuri.Visible = .F.
		thisform.container_rj.Visible = .F.
		thisform.container_functii.Visible = .F.
		
		lnTip = &lcTabel..tip
		
		Do Case
		Case lnTip = 1 && balanta
			pcFormula = &lcTabel..formula
			Do desparte_formula_bal With pcFormula In oproceduri_seturi_indicatori.prg
			Thisform.container_bal.Visible = .T.
			Thisform.container_bal.Refresh
		CASE lnTip = 2 && registru jurnal	
			pcFormula = &lcTabel..formula
			lcTabelRj = thisform.container_rj.grid_formule_rj.RecordSource 
		
		*!*		lcTabelRJ = gcTempPath+"tLista_rj.dbf"
		*!*		CREATE TABLE (lcTabelRJ) (caption C(30), Formula C(200), traducere c(200))
		
			Do desparte_formula_rj With pcFormula, lcTabelRJ In oproceduri_seturi_indicatori.prg
		
			thisform.container_rj.Visible = .T.
			thisform.container_rj.Refresh 
			
		Case lnTip = 5 && randuri
			SELECT (lcTabel) 
			pcFormula = ALLTRIM(formula)
			Thisform.container_randuri.Visible = .T.
			thisform.container_randuri.Refresh 
		Case lnTip = 6 && functii
			pcFormula = ALLTRIM(formula)
			Thisform.container_functii.Visible = .T.
			thisform.container_functii.Refresh 	
		
		Endcase
		
		
		
		
	ENDPROC

	PROCEDURE grid_set.cAles.Check1.Valid
		PRIVATE pnId_ind, pnValue 
		LOCAL lcTabel, lcSql, lnSucces   
		
		lcTabel = thisform.grid_set.RecordSource 
		
		pnId_ind = &lcTabel..id_ind
		pnValue = this.Value 
		 
		lcSql = [begin PACK_MG_EVOLUTIE.update_alesIndicator(?pnId_ind,?pnValue); end;]
		lnSucces = goExecutor.oExecute(lcSql)
		
		If lnSucces < 0
			AMessagebox(goExecutor.cEroare,0+16,"Eroare")
			Return
		Endif
	ENDPROC

	PROCEDURE grid_set.cComentariu.Text1.Click
		lcAlias = thisform.grid_set.RecordSource 
		Select (lcalias)
		Scatter Name poIndComent Memo
		
		Select (lcalias)
		poco = Createobject("frm_comentariu")
		poco.lb_titlu_alb_b121.Caption = poIndComent.nume_ind
		
		*!*	IF buton = 2
		*!*		RETURN
		*!*	ENDIF 
		
		*!*	If tlpredef
		*!*		poco.ebcomentariu.ReadOnly=.T.
		*!*	Endif
		
		poco.Show(1)
		Gather Name poIndComent Memo
	ENDPROC

	PROCEDURE grid_set.Init
		this.SetAll("DynamicBackColor","IIF(ales=1, RGB(255,255,225), RGB(244,250,255))", "Column")
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_sitfin_2011 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="Pagefr_calc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Panou_calc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboSesiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="edtInfo" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_data1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_calc_altesit_50" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_calc_altesit_60" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdXMLtoPDF" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdEroriXML" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdXML" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: afiseaza_mesaj
		*m: cbilantpdf_assign
		*m: cbilantrezultat_assign
		*m: do_genereaza_xdp
		*m: do_genereaza_xml
		*m: updateinfo
		*m: updatepdf
		*p: cbilantpdf
		*p: cbilantrezultat
		*p: cbilantrezultatfile
		*p: cbilantvalidatorfile
		*p: cfisierxml
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cbilantpdf = ''
		cbilantrezultat = ''
		cbilantrezultatfile = ''
		cbilantvalidatorfile = ''
		cfisierxml = ''
		DoCreate = .T.
		Height = 368
		Name = "frm_sitfin"
		Width = 779
		_memberdata = <VFPData>
			<memberdata name="cfisierxml" display="cFisierXML"/>
			<memberdata name="updatepdf" display="UpdatePDF"/>
			<memberdata name="cbilantpdf" display="cBilantPDF"/>
			<memberdata name="cbilantrezultat" display="cBilantRezultat"/>
			<memberdata name="cbilantrezultatfile" display="cBilantRezultatFile"/>
			<memberdata name="cbilantvalidatorfile" display="cBilantValidatorFile"/>
			<memberdata name="cbilantpdf_assign" display="cBilantPDF_assign"/>
			<memberdata name="cbilantrezultat_assign" display="cBilantRezultat_assign"/>
		</VFPData>
		_SHAPE1.Anchor = 11
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 792
		_SHAPE1.ZOrderSet = 10
		_SHAPE2.Anchor = 9
		_SHAPE2.Height = 29
		_SHAPE2.Left = 750
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 31
		_SHAPE2.ZOrderSet = 26
		LB_TITLU_ALB_B121.Caption = "SITUATII FINANCIARE"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.ZOrderSet = 27
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 750
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 28
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_label5' AS _label WITH ;
		Caption = "Creati PDF-ul inteligent optional, pentru vizualizarea datelor. Functia de validare din PDF-ul inteligent nu face toate verificarile.", ;
		FontSize = 7, ;
		Left = 4, ;
		Name = "_label5", ;
		Top = 344, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="..\..\..\roadecl\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label6' AS _label WITH ;
		Caption = "Folositi intotdeauna functia Export XML pentru verificarea D112.", ;
		FontBold = .T., ;
		FontSize = 7, ;
		ForeColor = 255,0,0, ;
		Left = 150, ;
		Name = "_label6", ;
		Top = 331, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="..\..\..\roadecl\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'But_calc_altesit_50' AS but_calc_altesit WITH ;
		Caption = "Situatia \<modificarilor capitalului propriu", ;
		FontName = "Arial Narrow", ;
		Height = 34, ;
		Left = 480, ;
		Name = "But_calc_altesit_50", ;
		Top = 348, ;
		Visible = .F., ;
		Width = 146, ;
		WordWrap = .T., ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_calc_altesit_60' AS but_calc_altesit WITH ;
		Caption = "Situatia \<stocurilor si a productiei in curs de executie", ;
		FontName = "Arial Narrow", ;
		Height = 34, ;
		Left = 636, ;
		Name = "But_calc_altesit_60", ;
		Top = 348, ;
		Visible = .F., ;
		Width = 146, ;
		WordWrap = .T., ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cboSesiuni' AS combobox WITH ;
		ControlSource = "cSesiuni.traducere", ;
		FontName = "Arial Narrow", ;
		Height = 24, ;
		Left = 64, ;
		Name = "cboSesiuni", ;
		RowSource = "cSesiuni.traducere,sesiune", ;
		RowSourceType = 2, ;
		Style = 2, ;
		Top = 36, ;
		Width = 80, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'cmdEroriXML' AS cmd_executa WITH ;
		Anchor = 0, ;
		AutoSize = .F., ;
		Caption = "Avertizari \<Erori XML", ;
		Enabled = .F., ;
		FontBold = .F., ;
		FontSize = 8, ;
		ForeColor = 0,0,255, ;
		Height = 31, ;
		Left = 236, ;
		Name = "cmdEroriXML", ;
		Top = 294, ;
		Width = 63, ;
		WordWrap = .T., ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="..\..\..\roadecl\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdXML' AS cmd_executa WITH ;
		Anchor = 0, ;
		AutoSize = .T., ;
		Caption = "Export \<XML", ;
		FontBold = .T., ;
		FontSize = 8, ;
		Height = 25, ;
		Left = 152, ;
		Name = "cmdXML", ;
		Top = 297, ;
		Width = 82, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="..\..\..\roadecl\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdXMLtoPDF' AS cmd_executa WITH ;
		Anchor = 0, ;
		AutoSize = .F., ;
		Caption = "XML >> PDF +Semnare", ;
		Enabled = .F., ;
		FontBold = .F., ;
		FontSize = 7, ;
		ForeColor = 0,0,255, ;
		Height = 31, ;
		Left = 301, ;
		Name = "cmdXMLtoPDF", ;
		Top = 294, ;
		Width = 63, ;
		WordWrap = .T., ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="..\..\..\roadecl\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Command1' AS commandbutton WITH ;
		Caption = "Datele de identificare ale firmei", ;
		FontName = "Arial Narrow", ;
		Height = 29, ;
		Left = 6, ;
		Name = "Command1", ;
		Top = 135, ;
		Width = 138, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command2' AS commandbutton WITH ;
		Caption = "Setare cale export", ;
		FontName = "Arial Narrow", ;
		Height = 24, ;
		Left = 8, ;
		Name = "Command2", ;
		Top = 253, ;
		Width = 133, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command3' AS commandbutton WITH ;
		AutoSize = .F., ;
		Caption = "Export in fisiere text", ;
		FontSize = 7, ;
		ForeColor = 0,0,255, ;
		Height = 31, ;
		Left = 377, ;
		Name = "Command3", ;
		Top = 294, ;
		Width = 51, ;
		WordWrap = .T., ;
		ZOrderSet = 21
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command4' AS commandbutton WITH ;
		Caption = "Raportul administratorului", ;
		FontName = "Arial Narrow", ;
		Height = 24, ;
		Left = 570, ;
		Name = "Command4", ;
		Top = 330, ;
		Width = 113, ;
		ZOrderSet = 18
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command5' AS commandbutton WITH ;
		Caption = "Proces verbal", ;
		FontName = "Arial Narrow", ;
		Height = 24, ;
		Left = 686, ;
		Name = "Command5", ;
		Top = 330, ;
		Width = 84, ;
		ZOrderSet = 19
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command6' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "Export PDF inteligent", ;
		ForeColor = 0,0,255, ;
		Height = 27, ;
		Left = 12, ;
		Name = "Command6", ;
		Top = 180, ;
		Visible = .F., ;
		Width = 132, ;
		ZOrderSet = 20
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Container_data1' AS container_data WITH ;
		Height = 32, ;
		Left = 6, ;
		Name = "Container_data1", ;
		Top = 99, ;
		Width = 138, ;
		ZOrderSet = 8, ;
		CBOLUNA.Height = 24, ;
		CBOLUNA.Left = 4, ;
		CBOLUNA.Name = "CBOLUNA", ;
		CBOLUNA.Top = 4, ;
		CBOLUNA.Width = 80, ;
		cboAnul.Height = 24, ;
		cboAnul.Left = 86, ;
		cboAnul.Name = "cboAnul", ;
		cboAnul.Top = 4, ;
		cboAnul.Width = 48
		*< END OBJECT: ClassLib="ferestre_seturi_indicatori.vcx" BaseClass="container" />

	ADD OBJECT 'edtInfo' AS _editbox WITH ;
		Anchor = 15, ;
		Height = 290, ;
		Left = 438, ;
		Name = "edtInfo", ;
		Top = 36, ;
		Width = 336, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="..\..\..\roadecl\comun\clase\_baza.vcx" BaseClass="editbox" />

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Formula la:", ;
		FontName = "Arial", ;
		FontSize = 8, ;
		Height = 16, ;
		Left = 6, ;
		Name = "Label1", ;
		Top = 40, ;
		Width = 54, ;
		ZOrderSet = 22
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Luna contabila", ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 6, ;
		Name = "Label2", ;
		Top = 80, ;
		Width = 83, ;
		ZOrderSet = 11
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Bilant agenti economici", ;
		FontSize = 14, ;
		Height = 25, ;
		Left = 203, ;
		Name = "Label4", ;
		Top = 37, ;
		Width = 196, ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Pagefr_calc1' AS pagefr_calc WITH ;
		ErasePage = .T., ;
		Height = 261, ;
		Left = 152, ;
		Name = "Pagefr_calc1", ;
		Top = 28, ;
		ZOrderSet = 1, ;
		PAGE1.Name = "PAGE1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.But_edit1.Name = "But_edit1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.Label1.Name = "Label1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.Label2.Name = "Label2", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.Label3.Name = "Label3", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.lb_bil_data.Name = "lb_bil_data", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.Name = "CONTAINER_FORMULAR_10", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Name = "optBilPrescurtat", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Left = 5, ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Name = "Option1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Top = -1, ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Left = 93, ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Name = "Option2", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Top = -1, ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.But_edit1.Name = "But_edit1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.Label1.Name = "Label1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.Label2.Name = "Label2", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.Label3.Name = "Label3", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.lb_bil_data.Name = "lb_bil_data", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_20.Name = "CONTAINER_FORMULAR_20", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_30.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_30.But_edit1.Name = "But_edit1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_30.Label1.Name = "Label1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_30.Label2.Name = "Label2", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_30.Name = "CONTAINER_FORMULAR_30", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_40.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_40.But_edit1.Name = "But_edit1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_40.Label1.Name = "Label1", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_40.Label2.Name = "Label2", ;
		PAGE1.Panou_calc1.CONTAINER_FORMULAR_40.Name = "CONTAINER_FORMULAR_40", ;
		PAGE1.Panou_calc1.Name = "Panou_calc1", ;
		PAGE2.Name = "PAGE2", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.But_edit1.Name = "But_edit1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.Label1.Name = "Label1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.Label2.Name = "Label2", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.Label3.Name = "Label3", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.lb_bil_data.Name = "lb_bil_data", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.Name = "CONTAINER_FORMULAR_10", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Name = "optBilPrescurtat", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Left = 5, ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Name = "Option1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Top = -1, ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Left = 93, ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Name = "Option2", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Top = -1, ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.But_edit1.Name = "But_edit1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.Label1.Name = "Label1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.Label2.Name = "Label2", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.Label3.Name = "Label3", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.lb_bil_data.Name = "lb_bil_data", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_20.Name = "CONTAINER_FORMULAR_20", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_30.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_30.But_edit1.Name = "But_edit1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_30.Label1.Name = "Label1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_30.Label2.Name = "Label2", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_30.Name = "CONTAINER_FORMULAR_30", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_40.BUT_CALC1.Name = "BUT_CALC1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_40.But_edit1.Name = "But_edit1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_40.Label1.Name = "Label1", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_40.Label2.Name = "Label2", ;
		PAGE2.Panou_calc1.CONTAINER_FORMULAR_40.Name = "CONTAINER_FORMULAR_40", ;
		PAGE2.Panou_calc1.Name = "Panou_calc1", ;
		Page3.Name = "Page3", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.BUT_CALC1.Name = "BUT_CALC1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.But_edit1.Name = "But_edit1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.Label1.Name = "Label1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.Label2.Name = "Label2", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.Label3.Name = "Label3", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.lb_bil_data.Name = "lb_bil_data", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.Name = "CONTAINER_FORMULAR_10", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Name = "optBilPrescurtat", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Left = 5, ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Name = "Option1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option1.Top = -1, ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Left = 93, ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Name = "Option2", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_10.optBilPrescurtat.Option2.Top = -1, ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.BUT_CALC1.Name = "BUT_CALC1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.But_edit1.Name = "But_edit1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.Label1.Name = "Label1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.Label2.Name = "Label2", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.Label3.Name = "Label3", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.lb_bil_data.Name = "lb_bil_data", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_20.Name = "CONTAINER_FORMULAR_20", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_30.BUT_CALC1.Name = "BUT_CALC1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_30.But_edit1.Name = "But_edit1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_30.Label1.Name = "Label1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_30.Label2.Name = "Label2", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_30.Name = "CONTAINER_FORMULAR_30", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_40.BUT_CALC1.Name = "BUT_CALC1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_40.But_edit1.Name = "But_edit1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_40.Label1.Name = "Label1", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_40.Label2.Name = "Label2", ;
		Page3.Panou_calc1.CONTAINER_FORMULAR_40.Name = "CONTAINER_FORMULAR_40", ;
		Page3.Panou_calc1.Name = "Panou_calc1"
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="pageframe" />

	ADD OBJECT 'Panou_calc1' AS panou_calc WITH ;
		Left = 157, ;
		Name = "Panou_calc1", ;
		Top = 67, ;
		ZOrderSet = 5, ;
		Container_formular_10.But_calc1.Name = "But_calc1", ;
		Container_formular_10.But_edit1.Name = "But_edit1", ;
		Container_formular_10.Label1.Name = "Label1", ;
		Container_formular_10.Label2.Name = "Label2", ;
		Container_formular_10.Label3.Name = "Label3", ;
		Container_formular_10.lb_bil_data.Name = "lb_bil_data", ;
		Container_formular_10.Name = "Container_formular_10", ;
		Container_formular_10.optBilPrescurtat.Name = "optBilPrescurtat", ;
		Container_formular_10.optBilPrescurtat.Option1.Left = 5, ;
		Container_formular_10.optBilPrescurtat.Option1.Name = "Option1", ;
		Container_formular_10.optBilPrescurtat.Option1.Top = -1, ;
		Container_formular_10.optBilPrescurtat.Option2.Left = 93, ;
		Container_formular_10.optBilPrescurtat.Option2.Name = "Option2", ;
		Container_formular_10.optBilPrescurtat.Option2.Top = -1, ;
		Container_formular_20.But_calc1.Name = "But_calc1", ;
		Container_formular_20.But_edit1.Name = "But_edit1", ;
		Container_formular_20.Label1.Name = "Label1", ;
		Container_formular_20.Label2.Name = "Label2", ;
		Container_formular_20.Label3.Name = "Label3", ;
		Container_formular_20.lb_bil_data.Name = "lb_bil_data", ;
		Container_formular_20.Name = "Container_formular_20", ;
		Container_formular_30.But_calc1.Name = "But_calc1", ;
		Container_formular_30.But_edit1.Name = "But_edit1", ;
		Container_formular_30.Label1.Name = "Label1", ;
		Container_formular_30.Label2.Name = "Label2", ;
		Container_formular_30.Name = "Container_formular_30", ;
		Container_formular_40.But_calc1.Name = "But_calc1", ;
		Container_formular_40.But_edit1.Name = "But_edit1", ;
		Container_formular_40.Label1.Name = "Label1", ;
		Container_formular_40.Label2.Name = "Label2", ;
		Container_formular_40.Name = "Container_formular_40"
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="container" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BorderStyle = 0, ;
		Height = 260, ;
		Left = 150, ;
		Name = "Shape1", ;
		Top = 29, ;
		Width = 282, ;
		ZOrderSet = 3
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackStyle = 0, ;
		Curvature = 10, ;
		Height = 35, ;
		Left = 150, ;
		Name = "Shape2", ;
		Top = 292, ;
		Width = 218, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape3' AS shape WITH ;
		BackStyle = 0, ;
		Curvature = 10, ;
		Height = 35, ;
		Left = 373, ;
		Name = "Shape3", ;
		Top = 292, ;
		Width = 59, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE afiseaza_mesaj
		Lparameters tcMesaj,tnButoane
		Local lnReturn,lcTitlu
		lcTitlu = [Bilant]
		If gcAppName = "CONSAL"
			lnReturn = Messagebox(tcMesaj,tnButoane,lcTitlu)
		Else
			lnReturn = amessagebox(tcMesaj,tnButoane,lcTitlu)
		Endif
		Return lnReturn
	ENDPROC

	PROCEDURE cbilantpdf_assign
		lparameters tcBilantPDF
		
		this.cBilantPDF = m.tcBilantPDF
		
		*thisform.cmdEroriXML.Enabled=
		
		thisform.Refresh
		
		
		
	ENDPROC

	PROCEDURE cbilantrezultat_assign
		lparameters tcBilantRezultat
		This.cBilantRezultat = m.tcBilantRezultat
		thisform.cmdEroriXML.Enabled = FILE(m.tcBilantRezultat)
		thisform.cmdxmLtoPDF.Enabled = FILE(m.tcBilantRezultat)
		
		thisform.Refresh
		
		
		
		
	ENDPROC

	PROCEDURE do_executa
		Lparameters tnMenu
		*!* tnMenu: 1 = XML, 2 = PDF, 3 = XML + PDF
		*!* tnDecl: 100, 102
		#Define CRLF Chr(13) + Chr(10)
		
		
		Local loEx As Exception
		Local lnMenu, lcCaleFisier, lcCaleFisierPDF, lcNumeFisier
		Local lcAppPath, lcCaleBilant, lcComunPath, lcSelect, lcTempPath, lnPos
		Local lcFileName, lcFisierPDFNou, lcFisierPDFOriginal, lcFisierXDP, lcFisierXML, lcRun
		Local loProcess As "api_apprun" Of "process.vcx"
		Local lcBilantRezultatFile, lcBilantValidatorFile, lcMesaj, lcRezultat, lcVersiuneDUK
		Local lcVersiuneFisiereBilant, lcVersiunePDF, llSucces
		lcCaleFisier = ""
		
		lcSelect = Select()
		If !Empty(tnMenu)
			lnMenu = tnMenu
		Else
			lnMenu = xmenu("Genereaza \<XML pentru validare;Completeaza \<PDF;Genereaza XML \<si completeaza PDF")
		Endif
		If !Between(lnMenu,1,3)
			Return
		Endif
		This.UpdateInfo("RESET")
		
		lcAppPath = Addbs(gcAppPath)
		lcComunPath = lcAppPath
		lnPos = Rat("\", Addbs(m.lcAppPath), 2)
		If lnPos > 0
			lcComunPath = Left(m.lcAppPath, lnPos)
		Endif
		lcComunPath = lcComunPath + Iif(gcAppName = "CONCONT", "COMUNCONTAFIN\", "COMUNROA\") && d:\contafin\comuncontafin\
		
		This.UpdateInfo("Creez structura director export...")
		
		*** Creez structura director export (caletemp\D112\aaaa_ll\firma\
		llSucces = .F.
		Try
			lcTempPath = Iif(gcAppName = "CONCONT", Addbs(m.dirgen),Addbs(gcDirMare))
			lcCaleFisier = m.lcTempPath + "Bilant\" && c:\temp\D112\
		
			If !Directory(m.lcCaleFisier)
				Md (m.lcCaleFisier)
			Endif
		
			lcCaleFisier = m.lcCaleFisier + Alltrim(Str(gnAn)) + "_" + Padl(Alltrim(Str(gnLuna)),2, "0") + "\"&& c:\temp\D112\2011_01\
			If !Directory(m.lcCaleFisier)
				Md (m.lcCaleFisier)
			Endif
		
			lcCaleFisier = m.lcCaleFisier + Strtran(gcFirma,[ ],[_]) + "\" && c:\temp\D112\2011_01\firma\
			If !Directory(m.lcCaleFisier)
				Md (m.lcCaleFisier)
			Endif
			This.UpdateInfo("S-a creat directorul " + m.lcCaleFisier)
		
			lcCaleFisierPDF = m.lcCaleFisier  && c:\temp\D112\2011_01\firma\
			If !Directory(m.lcCaleFisierPDF)
				Md (m.lcCaleFisierPDF)
			Endif
			This.UpdateInfo("S-a creat directorul " + m.lcCaleFisierPDF)
		
			llSucces = .T.
		Catch To loEx
			lcMesaj = "Creare director " + lcCaleFisier + " " + loEx.Message
			This.UpdateInfo(lcMesaj)
		
			Thisform.afiseaza_mesaj(lcMesaj,0+48)
		Endtry
		If !llSucces
			Return
		Endif
		
		lcFisierPDFOriginal = lcComunPath + "Bilant.pdf" && d:\contafin\comuncontafin\d112.pdf
				
		*!* 18.01.2012
		*This.UpdatePDF(m.lcFisierPDFOriginal) && actualizez pdf de la romfast
		*!* 18.01.2012 ^
		
		If Upper(Substr(Alltrim(gofirma.cod_fiscal),1,2))='RO'
			lcCod_fiscal = Substr(Alltrim(gofirma.cod_fiscal),3,Len(Alltrim(gofirma.cod_fiscal))-2)
		Else
			lcCod_fiscal = Alltrim(gofirma.cod_fiscal)
		Endif
		
		
		lcNumeFisier = "bilant_"+ lcCod_fiscal + "_" + Alltrim(Str(gnAn)) + "_" + Padl(gnLuna, 2, "0")
		lcFileName = m.lcCaleFisier + lcNumeFisier
		lcFileNamePDF = m.lcCaleFisierPDF + lcNumeFisier
		lcFisierPDFNou = m.lcFileNamePDF + [.pdf]
		lcFisierXDP = m.lcFileNamePDF + [.xdp]
		
		lcFisierXML = m.lcFileName + [.xml]
		lcBilantValidatorFile = m.lcComunPath + [dist\DUKIntegrator.jar]
		lcBilantRezultatFile = m.lcFisierXML + [.err.txt]
		
		lcVersiuneFisiereBilant = lcComunPath + "versiuni_fisiere.txt"
		this.cBilantValidatorFile = lcBilantValidatorFile
		This.cFisierXML = lcFisierXML
		This.cBilantRezultatFile = lcBilantRezultatFile
		
		If Inlist(lnMenu, 2,3)
			If File(lcFisierPDFNou)
				Delete File (lcFisierPDFNou)
			Endif
			If File(lcFisierXDP)
				Delete File (lcFisierXDP)
			Endif
		Endif
		If Inlist(lnMenu, 1,3)
			If File(lcFisierXML)
				Delete File (lcFisierXML)
			Endif
			If File(m.lcBilantRezultatFile)
				Delete File (m.lcBilantRezultatFile)
			Endif
		Endif
		This.cBilantRezultat = ""
		This.cBilantPDF = ""
		
		
		Do Case
			Case lnMenu = 1
				This.UpdateInfo("Se exporta datele in format XML")
				Thisform.do_genereaza_xml(lcFisierXML)
				This.UpdateInfo(Replicate('-', 100))
			Case lnMenu = 2
				This.UpdateInfo("Se exporta datele in format PDF")
				Thisform.do_genereaza_xdp(lcFisierPDFOriginal, lcFisierXDP, lcFisierPDFNou)
				This.UpdateInfo(Replicate('-', 100))
			Case lnMenu = 3
				This.UpdateInfo("Se exporta datele in format XML")	
				Thisform.do_genereaza_xml(lcFisierXML)
				This.UpdateInfo(REPLICATE('-', 100))			
		*!*			Thisform.do_genereaza_xdp(lcFisierPDFOriginal, lcFisierXDP, lcFisierPDFNou)
		*!*			This.UpdateInfo(REPLICATE('-', 100))	
		ENDCASE
		
		
		
		*** deschid fisierul XDP (pdf inteligent)
		If Inlist(lnMenu,2,3) And File(lcFisierXDP)
			*** copiez fisierul pdf inteligent original in directorul de export
			Copy File (lcFisierPDFOriginal) To (lcFisierPDFNou)
			This.cBilantPDF = m.lcFisierXDP
		
			If File(m.lcFisierXDP)
				This.UpdateInfo([In PDF apasati butonul "Options > Trust this document always" de pe banda galbena pentru a incarca datele.])
				open_default_app(lcFisierXDP)
			Endif
		
		Endif
		
		*** lansez programul de verificare D112 (dukvalidator.jar)
		If Inlist(lnMenu,1,3)
			This.UpdateInfo("Validare XML...")
		
		*!*		- pt. validare declaratie:
		*!*		java -version:1.6 -jar "<cale>\dist\DUKIntegrator.jar" [-c caleConfig] -v tipDeclaratie fisierXML [fisierRezultat] [optiuneValidare]
		
		*!*		- pt. validare declaratie + creare fisier PDF:
		*!*		java -version:1.6 -jar "<cale>\dist\DUKIntegrator.jar" [-c caleConfig] -p tipDeclaratie fisierXML [fisierRezultat] [optiuneValidare] [fisierPDF]
		
		*!*		- pt. validare declaratie + creare fisier PDF semnat electronic:
		*!*		java -version:1.6 -jar "<cale>\dist\DUKIntegrator.jar" [-c caleConfig] -s tipDeclaratie fisierXML [fisierRezultat] [optiuneValidare] [fisierPDF] pinSmartCard smartCard [selectorCertificat]
			
			*		CD (JUSTPATH(lcD112ValidatorFile))
			loProcess = Newobject("api_apprun","process.vcx")
			loProcess.icLaunchDir = Justpath(lcBilantValidatorFile)
			*!* 18.07.2011
		*!*		lcMesaj = [java -jar "DUKIntegrator.jar" -v1 s1003 ] + m.lcFisierXML + [ ] + m.lcD112RezultatFile + [ ] + lcFisierPDFNou
		*!*		aMESSAGEBOX(lcMesaj) 
			
			* loProcess.iccommandline = [java -jar "DUKIntegrator.jar" -v1 s1003 ] + m.lcFisierXML + [ ] + m.lcBilantRezultatFile 
			loProcess.iccommandline = [java -jar "DUKIntegrator.jar" -v s1003 ] + m.lcFisierXML  
			
			*!* 18.07.2011 ^
			loProcess.launchappandwait()
			
			If !File(m.lcBilantRezultatFile)
				This.UpdateInfo("Nu s-a obtinut fisierul rezultat " + m.lcBilantRezultatFile + ". Verificati manual.")
			Else
				lcRezultat = Filetostr(m.lcBilantRezultatFile)
				llRezultatErori = AT('E:', lcRezultat) > 0
				If Upper(lcRezultat) = "OK"
					This.UpdateInfo("Validare fara erori sau avertizari.")
				Else
					This.UpdateInfo("Validare cu " + IIF(llRezultatErori, "erori", "avertizari") + ". Verificati fisierul rezultat " + m.lcBilantRezultatFile)
				ENDIF
				This.cBilantRezultat = m.lcBilantRezultatFile
				*!*				open_default_app(m.lcD112RezultatFile)
				This.UpdateInfo(lcRezultat)		
			ENDIF
			This.UpdateInfo(REPLICATE('-', 100))	
		Endif
		
		*** deschid fisierul XDP (pdf inteligent)
		If Inlist(lnMenu,2,3) And File(lcFisierXDP)
			This.UpdateInfo([Apasati butonul "Deschide PDF"])
			*** copiez fisierul pdf inteligent original in directorul de export
			Copy File (lcFisierPDFOriginal) To (lcFisierPDFNou)
			This.cBilantPDF = m.lcFisierXDP
			*!*		open_default_app(lcFisierXDP)
			This.UpdateInfo(REPLICATE('-', 100))		
		Endif
		
		*!*	*** deschid explorer in directorul de export
		lcRun = [RUN /N7 explorer.exe "] + m.lcCaleFisier + ["]
		&lcRun
		
		
		Select (lcSelect)
		 
		
		
	ENDPROC

	PROCEDURE do_genereaza_xdp
		Lparameters tcFisierPDFOriginal, tcFisierXDP, tcFisierPDFNou
		Local lcSelect, lcDateStyle, lcMark, lcXDP, lcFirma
		
		lcSelect = Select()
		lcDateStyle = Set("Date")
		lcMark = Set("Mark")
		
		Set Date To Ymd
		Set Mark To '-'
		
		
		Set Textmerge On To Memvar lcXDP Noshow
		\<?xml version="1.0" encoding="UTF-8"?>
		
		\<?xfa generator="XFA2_4" APIVersion="3.3.10270.0"?>
		\<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
		\<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
		\<xfa:data>
		
		\<form1>
		\<codF1>
		\<universalCode>S1003_A1.0.0</universalCode>
		\<d_rec>0</d_rec>
		\<totalPlata_A>0</totalPlata_A>
		\</codF1>
		
		\<date_identificare>
		lcFirma = XmlSpecialCharacters(ALLTRIM(UPPER(NVL(goFirma.antet,'')))) && oproceduri_comune.prg
		\<DENI><<lcFirma>></DENI>
		\<TipBIL>BS</TipBIL>
		
		\<AP_LOCALITATE>Constanta</AP_LOCALITATE>
		\<AP_BLOC/>
		\<AP_APART/>
		\<TELEFON><<Nvl(Alltrim(gofirma.telefon),'')>></TELEFON>
		\<AP_SCARA/>
		\<AP_NR>17</AP_NR>
		\<AP_STRADA>mamaia</AP_STRADA>
		\<AP_SECTOR/>
		\<AP_JUDET>13</AP_JUDET>
		\<REG_COM/>
		
		If Upper(Substr(Alltrim(gofirma.cod_fiscal),1,2))='RO'
			lcCod_fiscal = Substr(Alltrim(gofirma.cod_fiscal),3,Len(Alltrim(gofirma.cod_fiscal))-2)
		Else
			lcCod_fiscal = Alltrim(gofirma.cod_fiscal)
		Endif
		
		\<cif><<lcCod_fiscal>></cif>
		\<FPROP>35</FPROP>
		\<CAEN><<Nvl(Alltrim(gofirma.caen),'')>></CAEN>
		
		\<checkJJ>0</checkJJ>
		\<checkDD>0</checkDD>
		\<per1>01.01.2011</per1>
		\<per2>31.12.2011</per2>
		\<per3>31.12.2010</per3>
		
		
		\<an_r><<gnAn>></an_r>
		\<anc><<gnAn>></anc>
		\<anp><<gnAn-1>></anp>
		
		\<sit_titlu>Situaţiile financiare anuale încheiate la 31.12.2011 de către entităţile al căror exerciţiu financiar coincide cu anul calendaristic, cu exceptia entitatilor care au optat pentru un sistem simplificat de contabilitate.F10 - BILANT  prescurtat F20 - CONTUL DE PROFIT ŞI PIERDERE F30 - DATE INFORMATIVE F40 - SITUATIA ACTIVELOR IMOBILIZATE</sit_titlu>
		
		
		\<id1/>
		\<id2>0.</id2>
		\<NUME3><<Nvl(Alltrim(gofirma.declarant),'')>></NUME3>
		\<NUME2/>
		\<NUME1/>
		\<CALITATEA><<Nvl(Alltrim(gofirma.functie),'')>></CALITATEA>
		\<tipAS>1</tipAS>
		\<rbl>2</rbl>
		\<checkFF>0</checkFF>
		\<luna_r><<gnLuna>></luna_r>
		\<butoane xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:dataNode="dataGroup"/>
		\<RAP1>0</RAP1>
		\<RAP2>0</RAP2>
		\<RAP3>0</RAP3>
		\</date_identificare>
		
		*!*	lcDirTabele = Addbs(Alltrim(gcDirExpBil_tabele)) + Alltrim(gofirma.firma) + "\"
		*!*	WAIT WINDOW gcDirExpBil_tabele
		
		*!*	lcFisCpp = lcDirTabele + "Cpp.dbf"
		*!*	If !File(lcFisCpp)
		*!*		AMESSAGEBOX("Nu ati salvat Contul de profit si pierdere!", 0+48,"Atentie")
		*!*		Return
		*!*	ENDIF
		
		*!*	Use (lcFisCpp) In 0 Alias cpp
		*!*	Select cpp
		*!*	Locate For ales=1
		*!*	If Found()
		*!*		Scan For ales=1
		*!*			* lcSir=lcSir+Alltrim(Str(valprec,20,0))+","+Alltrim(Str(valcur,20,0))+","
		*!*			*\<R01><C1>378558</C1></R01>
		*!*			\<R<<ALLTRIM(rand)>>><C1><<Alltrim(Str(valcur,20,0))>></C1></R<<ALLTRIM(rand)>>>
		*!*		Endscan
		*!*	Else
		*!*		Scan
		*!*			*lcSir=lcSir+Alltrim(Str(valprec,20,0))+","+Alltrim(Str(valcur,20,0))+","
		*!*			\<R<<ALLTRIM(rand)>>><C1><<Alltrim(Str(valcur,20,0))>></C1></R<<ALLTRIM(rand)>>>
		*!*		Endscan
		*!*	Endif
		*!*	Use In cpp
		
		*!*	\<R98><C1>0</C1></R98>
		*!*	\<BUTOANE xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:dataNode="dataGroup"/>
		
		\</form1>
		
		\</xfa:data>
		\</xfa:datasets>
		\<pdf href="<<JUSTFNAME(tcFisierPDFNou)>>" xmlns="http://ns.adobe.com/xdp/pdf/"/>
		\</xdp:xdp>
		
		
		Set Textmerge To
		
		Strtofile(lcXDP, tcFisierXDP)
		
		
		Set Date To &lcDateStyle
		Set Mark To &lcMark
		
		Select (lcSelect)
		
	ENDPROC

	PROCEDURE do_genereaza_xml
		*!* 07.04.2011
		*!* marius.mutu
		*!* str(d_8,13) in loc de str(d_8) CNP_COPIL aparea 5.0E
		
		*!* 02.05.2011
		*!* marius.mutu
		*!* cAngajatorC5 - adaug liniile doar daca nu au sume 0
		
		Lparameters tcFisierXML
		Local lcXML, lcXmlFile, loAsigurat
		Local lcDateStyle, lcMark
		Local lcCod_fiscal
		
		lcDateStyle = Set("Date")
		lcMark = Set("Mark")
		
		Set Date To Dmy
		Set Mark To '.'
		
		Set Textmerge On To Memvar lcXML Noshow
		\<?xml version="1.0"?>
		*\<Bilant1003  luna="12" an="2011" cui="1879855" den="ROMFAST" adresa="CONSTANTA " regCom="J13" caen="6010" bifaMC="0" bifaDD="0" bifa_art27="0" tipBIL="BS" codTT="13" codJJ="13" codPP="35" nume_admin="VOICU IOAN" nume_intocmit="CARAPETRU SILVIA" calit_intocmit="11" totalPlata_A="200" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="mfp:anaf:dgti:s1003:declaratie:v1 s1003.xsd" xmlns="mfp:anaf:dgti:s1003:declaratie:v1">
		
		lcLuna = Thisform.container_data1.cboluna.Value
		lcAnul = Thisform.container_data1.cboAnul.Value
		
		lcCod_fiscal = ""
		lcCod_fiscal = Nvl(Alltrim(gofirma.cod_fiscal),'')
		
		If Substr(lcCod_fiscal,1,2) = "RO"
			lcCod_fiscal = Substr(lcCod_fiscal,3,Len(lcCod_fiscal)-2)
		Else
			If Substr(lcCod_fiscal,1,1) = "R"
				lcCod_fiscal = Substr(lcCod_fiscal,2,Len(lcCod_fiscal)-1)
			Endif
		Endif
		
		lcAntet = [<Bilant1003  luna="]+lcLuna+[" an="]+lcAnul+[" cui="]+lcCod_fiscal+[" den="]+;
			ALLTRIM(gofirma.firma) + [" adresa="]+Nvl(Alltrim(gofirma.adresa),'')+[" regCom="]+Nvl(Alltrim(gofirma.reg_comert),'')+[" caen="]+Alltrim(gofirma.caen)+;
			[" bifaMC="0" bifaDD="0" bifa_art27="0" tipBIL="BS" codTT="13" codJJ="13" codPP="35" ]+;
			[nume_admin="VOICU IOAN" nume_intocmit="]+;
			Nvl(Alltrim(gofirma.declarant),'')+[" calit_intocmit="11" ]+;
			[totalPlata_A="200" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="mfp:anaf:dgti:s1003:declaratie:v s1003.xsd" xmlns="mfp:anaf:dgti:s1003:declaratie:v1">]
		\<<lcAntet>>
		
		
		lcDirTabele = Addbs(Alltrim(gcDirExpBil_tabele)) + Alltrim(gofirma.firma) + "\"
		
		lcFisBilant = lcDirTabele + "Bilant.dbf"
		If !File(lcFisBilant)
			AMESSAGEBOX("Nu ati salvat Bilantul!", 0+48,"Atentie")
			Return
		Endif
		
		Use (lcFisBilant) In 0 Alias bilant
		lcSir_bilant = "<F10  "
		Select bilant
		Locate For ales=1
		If Found()
			Scan For ales=1
				lcSir_bilant = lcSir_bilant + [F10_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(valprec,20,0))+[" ]
				lcSir_bilant = lcSir_bilant + [F10_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(valcur,20,0))+[" ]
			Endscan
		Else
			Scan
				lcSir_bilant = lcSir_bilant + [F10_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(valprec,20,0))+[" ]
				lcSir_bilant = lcSir_bilant + [F10_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(valcur,20,0))+[" ]
			Endscan
		Endif
		Use In bilant
		
		lcSir_bilant = lcSir_bilant +[ />]
		
		\<<lcSir_bilant>>
		
		*** end Export datele din bilant
		
		*** Export datele din CPP
		lcFisCPP = lcDirTabele + "cpp.dbf"
		If !File(lcFisCPP)
			AMESSAGEBOX("Nu ati salvat Contul de profit si pierdere!", 0+48,"Atentie")
			Return
		Endif
		
		Use (lcFisCPP) In 0 Alias cpp
		lcSir_cpp = "<F20  "
		Select cpp
		Locate For ales=1
		If Found()
			Scan For ales=1
				lcSir_cpp = lcSir_cpp + [F20_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(valprec,20,0))+[" ]
				lcSir_cpp = lcSir_cpp + [F20_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(valcur,20,0))+[" ]
			Endscan
		Else
			Scan
				lcSir_cpp = lcSir_cpp + [F20_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(valprec,20,0))+[" ]
				lcSir_cpp = lcSir_cpp + [F20_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(valcur,20,0))+[" ]
			Endscan
		Endif
		Use In cpp
		
		lcSir_cpp = lcSir_cpp + [ />]
		
		\<<lcSir_cpp>>
		*** --- end Export datele din CPP
		
		*** export datele din DateInf
		
		lcFisDateInf = lcDirTabele + "DateInf.dbf"
		If !File(lcFisDateInf)
			AMESSAGEBOX("Nu ati salvat Date Informative!", 0+48,"Atentie")
			Return
		Endif
		
		Use (lcFisDateInf) In 0 Alias dateInf
		lcSir_DI = "<F30  "
		Select dateInf
		Locate For ales=1
		If Found()
			Scan For ales=1
				Do Case
					Case col22 = 1 And col33 = 1
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [1="] + Alltrim(Str(col1,20,0))+[" ]
					Case col33 = 1
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [1="] + Alltrim(Str(col1,20,0))+[" ]
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [2="] + Alltrim(Str(col2,20,0))+[" ]
					Otherwise
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [1="] + Alltrim(Str(col1,20,0))+[" ]
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [2="] + Alltrim(Str(col2,20,0))+[" ]
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [3="] + Alltrim(Str(col3,20,0))+[" ]
				Endcase
			Endscan
		Else
			Scan
				Do Case
					Case col22 = 1 And col33 = 1
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [1="] + Alltrim(Str(col1,20,0))+[" ]
					Case col33 = 1
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [1="] + Alltrim(Str(col1,20,0))+[" ]
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [2="] + Alltrim(Str(col2,20,0))+[" ]
					Otherwise
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [1="] + Alltrim(Str(col1,20,0))+[" ]
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [2="] + Alltrim(Str(col2,20,0))+[" ]
						lcSir_DI = lcSir_DI + [F30_] + Padl(Alltrim(Rand),3,[0]) + [3="] + Alltrim(Str(col3,20,0))+[" ]
				Endcase
			Endscan
		Endif
		Use In dateInf
		
		lcSir_DI = lcSir_DI + [ />]
		\<<lcSir_di>>
		*** --- end export datele din DateInf
		
		*** export datele din Active
		lcFisActive = lcDirTabele + "Active.dbf"
		If !File(lcFisActive)
			AMESSAGEBOX("Nu ati salvat Situatia activelor!", 0+48,"Atentie")
			Return
		Endif
		
		Use (lcFisActive) In 0 Alias Active
		lcSir_Active = "<F40  "
		Scan
			Do Case
				Case !lcol4
					lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(soldi,20,0))+[" ]
					lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(cresteri,20,0))+[" ]
					lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [3="]+ Alltrim(Str(reduceri,20,0))+[" ]
					lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [4="]+ Alltrim(Str(dezmembr,20,0))+[" ]
					lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [5="]+ Alltrim(Str(soldi+cresteri-reduceri,20,0))+[" ]
				Otherwise
					Do Case
						Case Val(Rand)<13
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(soldi,20,0))+[" ]
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(cresteri,20,0))+[" ]
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [3="]+ Alltrim(Str(reduceri,20,0))+[" ]
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [5="]+ Alltrim(Str(soldi+cresteri-reduceri,20,0))+[" ]
						Case Val(Rand)>=13
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [1="]+ Alltrim(Str(soldi,20,0))+[" ]
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [2="]+ Alltrim(Str(cresteri,20,0))+[" ]
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [3="]+ Alltrim(Str(reduceri,20,0))+[" ]
							lcSir_Active = lcSir_Active + [F40_0] + Alltrim(Rand) + [4="]+ Alltrim(Str(soldi+cresteri-reduceri,20,0))+[" ]
		
					Endcase
			Endcase
		
		Endscan
		
		Use In Active
		
		lcSir_Active = lcSir_Active + [ />]
		\<<lcSir_Active>>
		*** --- end export datele din DateInf
		***-----------------
		
		\</Bilant1003>
		
		Set Textmerge To
		
		Strtofile(lcXML, m.tcFisierXML)
		
		Set Date To &lcDateStyle
		Set Mark To &lcMark
		
		
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		gcAcces=[1;2;3;4;]
		lcSel = [begin pack_contafin.set_id_sucursala(?gnIdSucursala); end;]
		lnSucces = goExecutor.oExecute(lcSel)
		If lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
			Return
		Endif
	ENDPROC

	PROCEDURE updateinfo
		#DEFINE CRLF CHR(13) + CHR(10)
		Lparameters tcInfo
		
		
		Local loInfo
		loInfo = this.edtInfo
		If Upper(tcInfo) = 'RESET'
			loInfo.Value = ""
		Else
			loInfo.Value = loInfo.Value + m.tcInfo + CRLF + CRLF
		Endif
		loInfo.Refresh()
		
		
	ENDPROC

	PROCEDURE updatepdf
		Lparameters tcPDFFile
		*** tcPDFFile: calea completa a fisierului pdf D:\CONTAFIN\COMUNCONTAFIN\d390.pdf
		
		Local lcFile, lcPath, llOpen
		lcFile = Justfname(m.tcPDFFile)
		lcPath = Addbs(Justpath(m.tcPDFFile))
		llOpen = .F.
		
		Return DownloadSupportFile(m.lcFile, m.lcPath, m.llOpen) && proceduri_comune.prg
		
		
	ENDPROC

	PROCEDURE cboSesiuni.Init
		LOCAL lnPage, lcAct
		
		lnPunct = AT(".", THIS.ROWSOURCE)
		lcTabelSesiuni = SUBSTR(THIS.ROWSOURCE, 1, lnPunct-1)
		
		SELECT (lcTabelSesiuni)
		lcSesiune = sesiune && 2006_1
		lcAn = SUBSTR(lcSesiune,1,4)
		lcSem = SUBSTR(lcSesiune,6,1)
		
		* IF ALLTRIM(lcSesiune) = '2006_1'
		IF VAL(lcAn) >= 2006
			*IF ALLTRIM(lcSesiune) = '2006_1'
			THISFORM.pagefr_calc1.VISIBLE = .F.
			THISFORM.pANOU_CALC1.VISIBLE = .T.
			IF lcSem = '1'
				THISFORM.pANOU_CALC1.CONtainer_formular_40.VISIBLE = .F.
				THISFORM.pANOU_CALC1.CONtainer_formular_10.optBilPrescurtat.VISIBLE = .F.
			ENDIF
			IF lcSem = '2'
				THISFORM.pANOU_CALC1.CONtainer_formular_40.VISIBLE = .T.
				THISFORM.pANOU_CALC1.CONtainer_formular_10.optBilPrescurtat.VISIBLE = .T.
			ENDIF
		ELSE
			IF TYPE("thisform.pANOU_CALC1.Visible")<>'U'
				THISFORM.pANOU_CALC1.VISIBLE = .F.
			ENDIF
			THISFORM.pagefr_calc1.VISIBLE = .T.
			lnPage = THISFORM.pagefr_calc1.ACTIVEPAGE
			lcAct = "thisform.pagefr_calc1.page" + ALLTRIM(STR(lnPage)) + ".activate"
			&lcAct
		ENDIF
		
	ENDPROC

	PROCEDURE cboSesiuni.InteractiveChange
		LOCAL lnPage, lcAct
		
		lnPunct = AT(".", THIS.ROWSOURCE)
		lcTabelSesiuni = SUBSTR(THIS.ROWSOURCE, 1, lnPunct-1)
		
		SELECT (lcTabelSesiuni)
		lcSesiune = sesiune && 2006_1
		lcAn = SUBSTR(lcSesiune,1,4)
		lcSem = SUBSTR(lcSesiune,6,1)
		
		IF VAL(lcAn) >= 2006
			* IF ALLTRIM(lcSesiune) = '2006_1'
			THISFORM.pagefr_calc1.VISIBLE = .F.
			THISFORM.pANOU_CALC1.VISIBLE = .T.
			IF lcSem = '1'
				THISFORM.pANOU_CALC1.CONtainer_formular_40.VISIBLE = .F.
				THISFORM.pANOU_CALC1.CONtainer_formular_10.optBilPrescurtat.VISIBLE = .F.
			ENDIF
			IF lcSem = '2'
				THISFORM.pANOU_CALC1.CONtainer_formular_10.optBilPrescurtat.VISIBLE = .T.
				THISFORM.pANOU_CALC1.CONtainer_formular_40.VISIBLE = .T.
			ENDIF
		ELSE
			THISFORM.pANOU_CALC1.VISIBLE = .F.
			THISFORM.pagefr_calc1.VISIBLE = .T.
			lnPage = THISFORM.pagefr_calc1.ACTIVEPAGE
			lcAct = "thisform.pagefr_calc1.page" + ALLTRIM(STR(lnPage)) + ".activate"
			&lcAct
		ENDIF
		
		
	ENDPROC

	PROCEDURE cmdEroriXML.Click
		Local lcBilantRezultatFile
		lcBilantRezultatFile = thisform.cBIlantRezultat 
		IF !EMPTY(m.lcBilantRezultatFile) AND FILE(m.lcBilantRezultatFile)
			open_default_app(m.lcBIlantRezultatFile)
		ENDIF 	 
	ENDPROC

	PROCEDURE cmdXML.Click
		Thisform.do_executa(1)
	ENDPROC

	PROCEDURE cmdXMLtoPDF.Click
		*** lansez programul de verificare D112 (dukvalidator.jar)
		loProcess = Newobject("api_apprun","process.vcx")
		loProcess.icLaunchDir = Justpath(thisform.cBilantValidatorFile)
		loProcess.iccommandline = [java -jar "DUKIntegrator.jar" ] + thisform.cFisierXML
		loProcess.launchapp()
	ENDPROC

	PROCEDURE Command1.Click
		Do date_identif In oproceduri_sitfin.prg
	ENDPROC

	PROCEDURE Command2.Click
		locs = CREATEOBJECT("frm_caiSalvare")
		locs.show(1)
	ENDPROC

	PROCEDURE Command3.Click
		Thisform.do_executa(3)
		
		PRIVATE pdDataI, pdDataF
		
		lcLuna = thisform.container_data1.cboluna.Value 
		lcanul = thisform.container_data1.cboAnul.Value
		
		
		
		DO case
		CASE INLIST(VAL(lcLuna),1,3,5,7,8,10,12)
		lcZiua = '31'
		CASE INLIST(VAL(lcLuna),4,6,9,11)
		lcZiua = '30'
		OTHERWISE 
		lcZiua = '28'
		ENDCASE 
		
		pdDataI = CTOD('01/01/'+ALLTRIM(lcanul))
		pdDataF = CTOD(lcZiua + "/"+ ALLTRIM(lcluna)+'/'+ALLTRIM(lcanul))
		
		LOCAL lnTip, llUnitate, llVerifActive, llBL
		llUnitate = .T.
		llVerifActive = .F.
		lnBilPrescurtat = 0
		
		lnTip = THISFORM.pagefr_calc1.ACTIVEPAGE && 1 - microintreprinderi
		**
		lnPunct = AT(".",THISFORM.cboSesiuni.ROWSOURCE)
		lcTabelSesiuni = SUBSTR(THISFORM.cboSesiuni.ROWSOURCE,1,lnPunct)
		
		SELECT (lcTabelSesiuni)
		lcSesiune = ALLTRIM(sesiune)
		lnSemestru = VAL(SUBSTR(lcSesiune,6,1))
		lcAn = SUBSTR(lcSesiune,1,4) 
		
		IF ((lnTip <> 1) OR (VAL(lcAn)*12+lnSemestru >= 2006*12+2)) AND lnSemestru = 2
			llVerifActive = .T.
		ENDIF
		
		IF TYPE('thisform.paNOU_CALC1.CONTAINER_FORMULAR_10.opTBILPRESCURTAT') <> 'U'
			lnBilPrescurtat = THISFORM.paNOU_CALC1.CONTAINER_FORMULAR_10.opTBILPRESCURTAT.VALUE && 0-inainte de dec 06; 1-BS; 2-BL
		ENDIF
		
		**
		IF EMPTY(NVL(gcSF_DirExpBil,'')) OR !DIRECTORY(NVL(gcSF_DirExpBil,''))
			MESSAGEBOX('Alegeti calea unde se exporta Bilantul!')
			thisform.command2.Click 
			
			IF EMPTY(NVL(gcSF_DirExpBil,'')) OR !DIRECTORY(NVL(gcSF_DirExpBil,''))
				RETURN 
			ENDIF 
		ENDIF 
		
		* 
		IF VAL(lcanul)*12+VAL(lcLuna) >= 2011*12+12
		DO Export_balanta WITH lnTip, llUnitate, llVerifActive, lnBilPrescurtat IN oproceduri_sitfin.prg
		ELSE 
		DO EXPORT WITH lnTip, llUnitate, llVerifActive, lnBilPrescurtat IN oproceduri_sitfin.prg
		ENDIF 
	ENDPROC

	PROCEDURE Command3.Init
		IF gnAn * 12 + gnLuna >= 2011*12 + 12
		 this.Caption= "Export Balanta.txt"
		 ELSE
		  this.Caption= "Export in fisiere text"
		 ENDIF 
		
	ENDPROC

	PROCEDURE Command4.Click
		Thisform.AlwaysOnTop = .F.
		
		Local lcLuna, lcAnul
		lcAnul = Thisform.container_data1.cboAnul.Value
		lcLuna = Thisform.container_data1.cboLuna.Value
		
		lcmenu = "Model \<1;Model \<2"
		lnx = xmenu(lcmenu)
		
		&& deschid bilantul care e deja salvat
		lcFisBilant = Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)) + "Bilant.dbf"
		
		If File(lcFisBilant)
			Use (lcFisBilant) In 0 Alias rg_bilant
			Select * From rg_bilant Into Cursor cBilant Readwrite
			Select cBilant
		Else
			amessagebox("Salvati Bilantul in directorul " + Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)),0+48,"Atentie")
			Create Cursor cBilant (Rand c(3), descriere c(30), valprec N(15), valcur N(15))
		Endif
		
		&& deschid cpp care e deja salvat
		lcFisCpp = Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)) +"cpp.dbf"
		If File(lcFisCpp)
			Use (lcFisCpp) In 0 Alias rg_cpp
			Select * From rg_cpp Into Cursor cCpp Readwrite
			Select cCpp
		Else
			amessagebox("Salvati Contul de profit si pierdere in directorul "+ Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)),0+48,"Atentie")
			Create Cursor cCpp (Rand c(3), descriere c(30), valprec N(15), valcur N(15))
		Endif
		
		Do Case
		Case lnx = 1
		&& deschid dateInf care e deja salvat
			lcFisDateInf = Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)) +"dateInf.dbf"
			If File(lcFisDateInf)
				Use (lcFisDateInf) In 0 Alias rg_dateInf
				Select * From rg_dateInf Into Cursor cDateInf Readwrite
				Select cDateInf
			Else
				amessagebox("Salvati Datele informative in directorul "+ Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)),0+48,"Atentie")
				Create Cursor cDateInf (Rand c(3), descriere c(30), col1 N(15))
			Endif
		
			Do rapgest_2005 With 'cBilant', 'cCpp', 'cDateInf', lcLuna, lcAnul In oproceduri_sitfin.prg
		
		
			If Used('rg_dateInf')
				Use In rg_dateInf
			Endif
			If Used("cDateInf")
				Use In cDateInf
			Endif
		
		Case lnx = 2
			Do rapgest1 With 'cBilant', 'cCpp', lcLuna, lcAnul In oproceduri_sitfin.prg
		Endcase
		
		
		If Used('rg_Bilant')
			Use In rg_bilant
		Endif
		If Used("cBilant")
			Use In cBilant
		Endif
		
		If Used('rg_cpp')
			Use In rg_cpp
		Endif
		If Used("cCpp")
			Use In cCpp
		Endif
		
		Thisform.AlwaysOnTop = .T.
		
	ENDPROC

	PROCEDURE Command5.Click
		Thisform.AlwaysOnTop = .F.
		
		Local lcLuna, lcAnul
		lcAnul = Thisform.container_data1.cboAnul.Value
		lcLuna = Thisform.container_data1.cboLuna.Value
		
		
		&& deschid cpp care e deja salvat
		lcFisCpp = Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)) +"cpp.dbf"
		If File(lcFisCpp)
			Use (lcFisCpp) In 0 Alias rg_cpp
			Select * From rg_cpp Into Cursor cCpp Readwrite
			Select cCpp
		Else
			amessagebox("Salvati Contul de profit si pierdere in directorul "+ Addbs(Alltrim(gcDirExpBil_tabele)) + Addbs(Alltrim(gofirma.firma)),0+48,"Atentie")
			Create Cursor cCpp (Rand c(3), descriere c(30), valprec N(15), valcur N(15))
		ENDIF
		
		Do procVerb WITH 'cCPP', lcLuna, lcAnul In oproceduri_sitfin.prg
		
		IF USED('rg_cpp')
			Use In rg_Cpp
		ENDIF
		If Used("cCpp")
			Use In cCpp
		ENDIF
		
		Thisform.AlwaysOnTop = .T.
		
	ENDPROC

	PROCEDURE Command6.Click
		Thisform.do_executa(3) && XML + PDF
	ENDPROC

	PROCEDURE Container_data1.cboAnul.Init
		this.Value = ALLTRIM(STR(gnAn))
	ENDPROC

	PROCEDURE Container_data1.cboAnul.InteractiveChange
		thisform.pagefr_calc1.Refresh 
		
		IF VAL(this.Value)*12 + VAL(this.Parent.cboLuna.Value) >= 2011*12 + 12
		thisform.command3.Caption = "Export Balanta.txt"
		ELSE
		thisform.command3.Caption = "Export in fisiere text"
		ENDIF 
		
		thisform.command3.Refresh 
	ENDPROC

	PROCEDURE Container_data1.CBOLUNA.Init
		this.Value = PADL(gnLuna,2,'0') && ALLTRIM(STR(gnLuna))
		
	ENDPROC

	PROCEDURE Container_data1.CBOLUNA.InteractiveChange
		thisform.pagefr_calc1.Refresh 
		
		IF VAL(this.Parent.cboAnul.value)*12 + VAL(this.Parent.cboLuna.Value) >= 2011*12 + 12
		thisform.command3.Caption = "Export Balanta.txt"
		ELSE
		thisform.command3.Caption = "Export in fisiere text"
		ENDIF 
		
		thisform.command3.Refresh 
	ENDPROC

	PROCEDURE Container_data1.CBOLUNA.Valid
		** setare variabile folosite pt. labeluri in rapoarte
		LOCAL lnLuna, lnAnul
		lnLuna = VAL(this.Value)
		lnAnul = VAL(this.Parent.cboAnul.Value) 
		
		If 12 * lnAnul + lnLuna >= 12*Val(Substr(gcDataRon,4,4))+Val(Left(gcDataRon,2)) && 07-2005
			pcMiiLei_ron = "- RON -"
			pcMiiLei = "lei"
		Else
			pcMiiLei_ron = "- mii lei -"
			pcMiiLei = "mii lei"
		ENDIF
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_tip_nume_rand_indicator 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="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 129
		Name = "frm_tip_nume_rand_indicator"
		Width = 757
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 756
		_shape2.Height = 29
		_shape2.Left = 696
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 61
		Lb_titlu_alb_b121.Caption = "Tip, rand, nume indicator"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Left = 726
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Rand", ;
		Height = 17, ;
		Left = 125, ;
		Name = "Label1", ;
		TabIndex = 9, ;
		Top = 32, ;
		Width = 32
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Nume indicator", ;
		Height = 17, ;
		Left = 187, ;
		Name = "Label2", ;
		TabIndex = 11, ;
		Top = 32, ;
		Width = 86
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Tip indicator", ;
		Height = 17, ;
		Left = 7, ;
		Name = "Label3", ;
		TabIndex = 8, ;
		Top = 32, ;
		Width = 69
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Ordine", ;
		ForeColor = 160,160,160, ;
		Height = 17, ;
		Left = 125, ;
		Name = "Label4", ;
		TabIndex = 10, ;
		Top = 72, ;
		Width = 39
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Optiongroup1' AS optiongroup WITH ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		ButtonCount = 6, ;
		ControlSource = "poindicator.tip", ;
		Height = 77, ;
		Left = 7, ;
		Name = "Optiongroup1", ;
		TabIndex = 1, ;
		Top = 48, ;
		Value = 1, ;
		Width = 109, ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Balanta", ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 61, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Registru jurnal", ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 22, ;
		Option2.Width = 99, ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Facturi", ;
		Option3.Enabled = .F., ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 76, ;
		Option3.Visible = .F., ;
		Option3.Width = 61, ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "Altfel", ;
		Option4.Enabled = .F., ;
		Option4.Height = 17, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Top = 95, ;
		Option4.Visible = .F., ;
		Option4.Width = 61, ;
		Option5.AutoSize = .T., ;
		Option5.BackStyle = 0, ;
		Option5.Caption = "Total", ;
		Option5.Height = 17, ;
		Option5.Left = 5, ;
		Option5.Name = "Option5", ;
		Option5.Top = 39, ;
		Option5.Width = 45, ;
		Option6.BackStyle = 0, ;
		Option6.Caption = "Functie", ;
		Option6.Enabled = .F., ;
		Option6.Height = 17, ;
		Option6.Left = 5, ;
		Option6.Name = "Option6", ;
		Option6.Top = 56, ;
		Option6.Width = 61
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'Text1' AS textbox WITH ;
		ControlSource = "poindicator.rand", ;
		Format = "k", ;
		Height = 23, ;
		InputMask = "XXXX", ;
		Left = 125, ;
		Name = "Text1", ;
		TabIndex = 2, ;
		Top = 48, ;
		Width = 55
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text2' AS textbox WITH ;
		ControlSource = "poindicator.nume_ind", ;
		Format = "k", ;
		Height = 45, ;
		Left = 187, ;
		Name = "Text2", ;
		TabIndex = 3, ;
		Top = 48, ;
		Width = 558
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text3' AS textbox WITH ;
		Alignment = 3, ;
		ControlSource = "poindicator.ord_rand", ;
		ForeColor = 160,160,160, ;
		Format = "kr", ;
		Height = 23, ;
		InputMask = "9999", ;
		Left = 125, ;
		Name = "Text3", ;
		TabIndex = 4, ;
		Top = 89, ;
		Value = 0, ;
		Width = 55
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE inainte_de_do_termin
		this.buT_TERMIN1.SetFocus()
	ENDPROC

	PROCEDURE Optiongroup1.Valid
		poIndicator.tip = this.Value 
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_toate_seturile 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="opt_sitfin" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Image1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_tipuri_speciale" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_tipuri_speciale.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_tipuri_speciale.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_tipuri_speciale.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_tipuri_speciale.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cNrCrt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cNrCrt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cUzual.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cUzual.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cNume_Set.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cNume_Set.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cDataI.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cDataI.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cDataF.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cDataF.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cCumul.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cCumul.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cFaraGrafic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid_seturi.cFaraGrafic.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_grafic1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copie_set" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nume_set" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_copie_set
		*m: do_grafic
		*m: do_modiparam
		*m: inainte_de_do_reset
		*m: valid_uzual
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = grid_seturi,grid_tipuri_speciale
		DoCreate = .T.
		Height = 464
		Name = "frm_toate_seturile"
		Width = 711
		WindowState = 2
		_SHAPE1.Anchor = 11
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 736
		_SHAPE1.ZOrderSet = 1
		_SHAPE2.Anchor = 9
		_SHAPE2.Height = 29
		_SHAPE2.Left = 470
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 238
		_SHAPE2.ZOrderSet = 2
		LB_TITLU_ALB_B121.Caption = "SETURI DE INDICATORI"
		LB_TITLU_ALB_B121.Left = 45
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 9
		LB_TITLU_ALB_B121.Top = 6
		LB_TITLU_ALB_B121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 681
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Picture = ..\grafice\terminat_sus.bmp
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 12
		Gridsort1.Left = 256
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 7
	*</PropValue>

	ADD OBJECT 'But_copie_set' AS but_grafic WITH ;
		Anchor = 9, ;
		caction = do_copie_set, ;
		cpicturedown = copy_jos.bmp, ;
		cpictureup = copy_sus.bmp, ;
		Left = 590, ;
		Name = "But_copie_set", ;
		Picture = ..\grafice\copy_sus.bmp, ;
		TabIndex = 7, ;
		ToolTipText = "Copiere set de indicatori (CTRL+C)", ;
		Top = 1, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_grafic1' AS but_grafic WITH ;
		Anchor = 9, ;
		Left = 650, ;
		Name = "But_grafic1", ;
		Picture = ..\grafice\grafic_sus.bmp, ;
		TabIndex = 7, ;
		Top = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Left = 560, ;
		Name = "But_listare1", ;
		Picture = ..\grafice\listare_sus.bmp, ;
		Top = 1, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		Left = 500, ;
		Name = "But_modifica1", ;
		Picture = ..\grafice\modific_sus.bmp, ;
		TabIndex = 3, ;
		ToolTipText = "Modificare set de indicatori (CTRL+M)", ;
		Top = 1, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 9, ;
		Left = 470, ;
		Name = "But_nou1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		caction = inainte_de_do_reset, ;
		Left = 620, ;
		Name = "But_reface1", ;
		Picture = ..\grafice\refac_sus.bmp, ;
		Top = 1, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 9, ;
		Left = 530, ;
		Name = "But_sterge1", ;
		Picture = ..\grafice\sterg_sus.bmp, ;
		TabIndex = 6, ;
		Top = 1, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_nume_set' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 9, ;
		AutoSize = .T., ;
		camp_nume = s1.nume_set, ;
		Caption = "Nume set", ;
		Comment = "*:OnResize=LT", ;
		Left = 511, ;
		Name = "Ck_nume_set", ;
		TabIndex = 1, ;
		Top = 39, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=LT", ;
		Height = 27, ;
		Left = 555, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 34, ;
		Top = 123, ;
		Width = 75, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=LT", ;
		Height = 27, ;
		Left = 633, ;
		Name = "Cmd_reset1", ;
		TabIndex = 45, ;
		Top = 123, ;
		Width = 75, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grid_seturi' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		Height = 416, ;
		HighlightStyle = 2, ;
		Left = 9, ;
		Name = "grid_seturi", ;
		Panel = 1, ;
		RecordSource = "crsSeturi", ;
		RecordSourceType = 1, ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 39, ;
		Width = 497, ;
		ZOrderSet = 8, ;
		Column1.ControlSource = "", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNrCrt", ;
		Column1.Width = 36, ;
		Column2.ControlSource = "uzual", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cUzual", ;
		Column2.Sparse = .F., ;
		Column2.Width = 33, ;
		Column3.ControlSource = "nume_set", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cNume_Set", ;
		Column3.Width = 225, ;
		Column4.ControlSource = 'cluna3(crsseturi.lunai) + " " + ALLTRIM(STR(crsseturi.anuli))', ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cDataI", ;
		Column4.Width = 72, ;
		Column5.ControlSource = 'cluna3(crsseturi.lunaf) + " " + ALLTRIM(STR(crsseturi.anulf))', ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cDataF", ;
		Column5.Width = 65, ;
		Column6.ControlSource = '	IIF(crsseturi.cumul = 1, "Luni",IIF(crsseturi.cumul=3,"Trimestre",IIF(crsseturi.cumul=6,"Semestre","Ani")))', ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cCumul", ;
		Column6.Width = 75, ;
		Column7.ControlSource = "faragrafic", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cFaraGrafic", ;
		Column7.Sparse = .F., ;
		Column7.Width = 61
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid_seturi.cCumul.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cumul", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_seturi.cCumul.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 'grid_seturi.cDataF.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data finala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_seturi.cDataF.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 'grid_seturi.cDataI.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data initiala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_seturi.cDataI.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 'grid_seturi.cFaraGrafic.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 27, ;
		Name = "Check1", ;
		Top = 47, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grid_seturi.cFaraGrafic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fara grafic", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid_seturi.cNrCrt.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 'grid_seturi.cNume_Set.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume set", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_seturi.cNume_Set.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 'grid_seturi.cUzual.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 16, ;
		Name = "Check1", ;
		Top = 35, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grid_seturi.cUzual.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Uzual", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_tipuri_speciale' AS _grdrow WITH ;
		Anchor = 12, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 92, ;
		Left = 512, ;
		Name = "grid_tipuri_speciale", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "cTipuri_seturi", ;
		RowHeight = 19, ;
		Top = 363, ;
		Width = 194, ;
		Column1.ControlSource = "nume_tip_set", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 135, ;
		Column2.ControlSource = "ales", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Sparse = .F., ;
		Column2.Width = 28
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid_tipuri_speciale.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip set special", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid_tipuri_speciale.Column1.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 'grid_tipuri_speciale.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 34, ;
		Name = "Check1", ;
		ReadOnly = .F., ;
		Top = 35, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'Image1' AS image WITH ;
		BackStyle = 0, ;
		Height = 28, ;
		Left = 9, ;
		Name = "Image1", ;
		Picture = ..\..\grafice\balb_reg.bmp, ;
		Top = 0, ;
		Width = 31, ;
		ZOrderSet = 5
		*< END OBJECT: BaseClass="image" />

	ADD OBJECT 'opt_sitfin' AS optiongroup WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		ButtonCount = 3, ;
		Height = 58, ;
		Left = 511, ;
		Name = "opt_sitfin", ;
		Top = 64, ;
		Value = 1, ;
		Width = 196, ;
		ZOrderSet = 0, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Exceptand seturile financiare", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 186, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Seturile financiare", ;
		Option2.FontSize = 10, ;
		Option2.Height = 18, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 20, ;
		Option2.Width = 122, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Toate seturile", ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 35, ;
		Option3.Width = 97
		*< END OBJECT: BaseClass="optiongroup" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poSeturi.ca_baza1.cfiltru
		ENDIF
		
		* lcOrder = This.corderby + " " + This.Casc
		
		save_grid_tag(thisform.grid_seturi)
		poSeturi.ca_baza1.cfiltru = lcFiltru
		*poSeturi.ca_baza1.corder = lcOrder
		poSeturi.ca_baza1.afisare()
		restore_grid_tag(thisform.grid_seturi)
		IF RECCOUNT('crsseturi')>0
			thisform.grid_seturi.SetFocus()
		ENDIF
		
		
	ENDPROC

	PROCEDURE do_adauga
		thisform.AlwaysOnTop = .F.
		
		* DO setNou IN oproceduri_seturi_indicatori.prg
		
		lnId_set = 0
		lnId_modiPara = 1 && toate seturile
		SET STEP ON 
		DO editare_set WITH lnId_set, lnId_modiPara IN oproceduri_seturi_indicatori.prg
			
		thisform.AlwaysOnTop = .T.
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru = ""
		
		If This.ck_nume_set.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_nume_set.filtru
		Endif
		
		Do Case
		Case This.opt_sitfin.Value = 1 && exceptand seturile financiare
			lcFiltru = lcFiltru + [ and s1.sters = 0 and s1.id_set not in (select ss.id_set from mg_seturi_speciale ss where ss.id_tip_set =1 and ss.sters =0)] && (id_tip_set <> 1 or ISNULL(id_tip_set) or EMPTY(id_tip_set)) ]
		Case This.opt_sitfin.Value = 2 && seturile financiare
			lcFiltru = lcFiltru + [ and s1.sters = 0 and s1.id_set in (select id_set from mg_seturi_speciale where id_tip_set =1 and sters =0)]  && id_tip_set = 1]
		Case This.opt_sitfin.Value = 3 && toate seturile 
			lcFiltru = lcFiltru + [ and s1.sters = 0]
		Endcase
		
		If !Empty(lcFiltru)
			lcFiltru = Substr(lcFiltru,6)
		Else
			lcFiltru = []
		ENDIF
		
		Thisform.actualizeaza_grid1(lcFiltru)
		Thisform.grid_seturi.SetFocus()
		
	ENDPROC

	PROCEDURE do_copie_set
		PRIVATE pnId_set
		LOCAL lcAlias, lnRaspuns
		lcAlias = THISFORM.grid_seturi.RECORDSOURCE
		SELECT (lcAlias)
		IF RECCOUNT()>0
			SCATTER NAME posetc
			pnId_set = id_set
		
			lnRaspuns = amessagebox("Doriti sa copiati setul " + ALLTRIM(posetc.nume_set) + "?",4+32,"Atentie")
			IF lnRaspuns = 7 && 7 = No ; 6 = Yes
				RETURN
			ELSE
		* Do copie_set With lnId_set In oproceduri_seturi_indicatori.prg
				lcSql = [begin pack_mg_evolutie.copie_set(?pnId_set); end;]
				lnSucces = goExecutor.oExecute(lcSql)
		
				IF lnSucces < 0
					AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
					RETURN
				ENDIF
		
				SELECT (lcAlias)
				THISFORM.actualizeaza_grid1()
		
				SELECT (lcAlias)
				LOCATE FOR id_set = pnId_set
		
				THISFORM.grid_seturi.SETFOCUS
			ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE do_grafic
		THISFORM.ALWAYSONTOP = .F.
		PRIVATE pnColoaneCheltuieliVenituri
		pnColoaneCheltuieliVenituri = 0
		
		LOCAL lcAlias, llFaraGrafic, lcNumeSet
		lcAlias = THISFORM.grid_seturi.RECORDSOURCE
		
		DO make_venChelt IN oproceduri_manager.prg
		
		SELECT (lcAlias)
		IF RECCOUNT()>0
			PRIVATE pnId_set, pnLunaI, pnAnulI, pnLunaF, pnAnulF, pnCumul, pnCount, pnId_sectie, pnId_venChelt
			STORE 0 TO pnId_set, pnId_sectie, pnId_venChelt, pnCount && cate inregistrari are setul
		
			THIS.do_modiparam()
		
			IF buton = 2
				RETURN
			ENDIF
		
			SELECT (lcAlias)
			SCATTER NAME loSet
		
			pnLunaI = loSet.lunaI
			pnAnulI = loSet.anulI
			pnLunaF = loSet.lunaF
			pnAnulF = loSet.anulF
			pnCumul = loSet.cumul
			pnId_set = loSet.id_set
		
			IF loSet.faraGrafic = 0
				llFaraGrafic = .F.
			ELSE
				llFaraGrafic = .T.
			ENDIF
			lcNumeSet = ALLTRIM(loSet.nume_set)
		
			&& copii din mg_indicatori in temporarul mg_tmp_indicatori
			lcSql = [begin PACK_MG_EVOLUTIE.GET_SET(?pnId_set,?@pnCount); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			IF lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		
			IF pnCount = 0
				amessagebox('Setul nu contine indicatori!',0+48,"Atentie")
				RETURN
			ENDIF
		
			t1 = DATETIME()
			golog.LOG(TRANSFORM(t1),PROGRAM())
		
		
			&& daca creez coloane pentru fiecare tip chelt/venit apelez calculul setului pentru fiecare tip chelt/venit
			&& selectez numai tipurile de chelt/venituri pentru sectia si perioada aleasa
			lcListaXtab = ""
			IF pnColoaneCheltuieliVenituri = 1
				lcSel = [SELECT DISTINCT A.ID_VENCHELT, V.EXPLICATIE FROM ACT A ] + ;
					[LEFT JOIN VNOM_VENCHEL V ON A.ID_VENCHELT = V.ID_VENCHELT ] + ;
					[WHERE A.STERS = 0 AND A.an*12+A.luna between ?pnAnulI*12 + ?pnLunaI AND ?pnAnulF*12+?pnLunaF] + ;
					IIF(!EMPTY(pnId_sectie), [ AND A.ID_SECTIE = ?pnId_Sectie], []) + ;
					STRTRAN(gcCondSucursala,[id_sucursala],[a.id_sucursala])
				lcSel = lcSel + [ ORDER BY NVL(V.EXPLICATIE,'_')]
				lnSucces = goExecutor.oExecute(lcSel, "cVenCheltTemp")
				IF lnSucces < 0
					AMESSAGEBOX(goExecutor.oPrelucrareEroare(),0+16,'Eroare')
					RETURN
				ENDIF
		
				SELECT cVenCheltTemp
				SCAN && FOR NVL(id_venchelt,0) <> 0
					lcCheltuiala = strtranx(ALLTRIM(cVenCheltTemp.explicatie), "[^a-z0-9]",[_],1,,1)
					pnId_venChelt = id_venchelt
					IF NVL(id_venchelt,0) = 0
						pnId_venChelt = 99999
						lcCheltuiala = "Fara_tip_cheltuiala"
					ENDIF
		
					WAIT WINDOW 'Se calculeaza ' + lcCheltuiala + " " + ALLTRIM(STR(RECNO())) + '/' + ALLTRIM(STR(RECCOUNT())) + ' ...' NOWAIT
		
					&& DACA APAS ESC IES DIN SCAN CU CE AM CALCULAT PANA ACUM
					lnKeyCode = INKEY(0.5)
					IF lnKeyCode = 27 && ESC
						EXIT
					ENDIF
					lcSel = [{call PACK_MG_EVOLUTIE.GEN_MG_INDICATORI(?pnLunaI,?pnAnulI,?pnLunaF,?pnAnulF,?pnCumul,?pnId_sectie,?pnId_venchelt)}]
					lcCursor = 'xtab_o' + ALLTRIM(STR(pnId_venChelt))
					lnSucces = goExecutor.oExecute(lcSel,lcCursor)
					IF lnSucces < 0
						AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
						RETURN
					ENDIF
		
					lcListaXtab = lcListaXtab + lcCursor + ";" + lcCheltuiala + ","
				ENDSCAN
				USE IN (SELECT('cVenCheltTemp'))
				pnId_venChelt = 0
				lcSelect = ""
		
				&& creez un cursor cu toate coloanele din xtab_o<id_venchelt> prin join
				lcSelect = MAKE_XTABO_VENCHELT(lcListaXtab) && oproceduri_evolutie.prg
		
				IF !USED('xtab_o')
					RETURN
				ENDIF
		
			ELSE
				lcSel = [{call PACK_MG_EVOLUTIE.GEN_MG_INDICATORI(?pnLunaI,?pnAnulI,?pnLunaF,?pnAnulF,?pnCumul,?pnId_sectie,?pnId_venChelt)}]
				lcCursor = 'xtab_o'
				lnSucces = goExecutor.oExecute(lcSel,lcCursor)
				IF lnSucces < 0
					AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
					RETURN
				ENDIF
			ENDIF
			t2 = DATETIME()
			golog.LOG(TRANSFORM(t2),PROGRAM())
		
			golog.LOG(TRANSFORM(t2-t1),PROGRAM())
			*AMESSAGEBOX(Transform(t2-t1))
		
		
			SELECT xtab_o
			IF RECCOUNT()=0
				amessagebox('Raportul nu contine nici o informatie!',0+48,"Atentie")
				IF USED('xtab_o')
					USE IN xtab_o
				ENDIF
				RETURN
			ENDIF
			***---------
			PRIVATE poSet
			STORE '' TO poSet
		
			LOCAL lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
			lcSchema1 = []
			lcSelect1 = [select id_ind, ales from mg_tmp_indicatori]
			lcOrder1 = []
			lcgroup = []
			lcFiltru1 = [ales=1 and id_set=]+ALLTRIM(STR(pnId_set))
			lcFiltruOriginal = []
			llModParam = .T.
			llAfiseaza = .F.
		
			gencursor('poSet','crsSet', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza,  lcgroup, llModParam, lcFiltruOriginal)
			poSet.ca_baza1.afisare()
			***---------
			lcFisXtab = gcTempPath + "xtab.dbf"
			SELECT crsSet
			LOCATE FOR ales = 1
			IF FOUND()
				SELECT x.* ;
					FROM xtab_o x JOIN crsSet i ON i.id_ind = x.id_ind ;
					ORDER BY ord_rand, RAND INTO CURSOR XTAB READWRITE
				*!*				ORDER BY ord_rand, RAND INTO TABLE (lcFisXtab)
			ELSE
				SELECT x.* ;
					FROM xtab_o x ;
					ORDER BY ord_rand, RAND INTO CURSOR XTAB READWRITE
				*!*				ORDER BY ord_rand, RAND INTO TABLE (lcFisXtab)
			ENDIF
		
			IF USED("crsSet")
				USE IN crsSet
			ENDIF
			RELEASE poSet
		
			DO viz_set_calc WITH 'xtab', pnId_set, llFaraGrafic, lcNumeSet, pnId_sectie, pnId_venChelt IN oproceduri_evolutie.prg
		
			RELEASE loSet
			IF USED('xtab')
				USE IN XTAB
			ENDIF
			IF USED('xtab_o')
				USE IN xtab_o
			ENDIF
		ENDIF
		
		
		THISFORM.ALWAYSONTOP = .T.
		
	ENDPROC

	PROCEDURE do_listare
		thisform.AlwaysOnTop = .F. 
		LOCAL lcTabel, lnId_set, lnId_modiPara  
		
		lcTabel = thisform.grid_seturi.RecordSource 
		SELECT (lcTabel) 
		IF RECCOUNT()>0
			lnId_set = id_set
			lnId_modiPara = 1 && toate seturile
		
			DO listare_set WITH lnId_set IN oproceduri_seturi_indicatori.prg
		ENDIF 
		
		thisform.AlwaysOnTop = .T. 
	ENDPROC

	PROCEDURE do_modifica
		thisform.AlwaysOnTop = .F. 
		LOCAL lcTabel, lnId_set, lnId_modiPara 
		
		lcTabel = thisform.grid_seturi.RecordSource 
		
		SELECT (lcTabel) 
		IF RECCOUNT()>0
			lnRec = RECNO()
		
			lnId_set = id_set
			lnId_modiPara = 1 && toate seturile
		
			DO editare_set WITH lnId_set, lnId_modiPara IN oproceduri_seturi_indicatori.prg
		
			Thisform.actualizeaza_grid1() 
			SELECT (lcTabel) 
			GOTO lnRec  
		ENDIF 
		thisform.AlwaysOnTop = .T. 
	ENDPROC

	PROCEDURE do_modiparam
		LOCAL lcTabel, lnTip 
		 
		lcTabel = thisform.grid_seturi.RecordSource 
		SELECT (lcTabel)
		IF RECCOUNT()>0
			lnTip = 1 && toate seturile
		
			DO modifica_parametri WITH lnTip, (lcTabel) IN oproceduri_seturi_indicatori.prg
		ENDIF 
		
		
		
	ENDPROC

	PROCEDURE do_sterge
		PRIVATE pnId_set
		LOCAL lcTabel, lnRaspuns
		
		lcTabel = THISFORM.grid_seturi.RECORDSOURCE
		SELECT (lcTabel)
		IF RECCOUNT() > 0
			pnId_set = id_set
			lnRec = RECNO()
		
			lnRaspuns = amessagebox('Doriti sa stergeti setul?',4+32,"Confirmare")
			IF lnRaspuns = 7 && 7 = No ; 6 = Yes
				RETURN
			ENDIF
		
			lcSql = [begin PACK_MG_EVOLUTIE.sterge_set(?pnId_set); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			IF lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		
			THISFORM.actualizeaza_grid1()
		
			SELECT (lcTabel)
			IF RECCOUNT() >= lnRec
				GOTO lnRec
			ELSE
				GO BOTTOM
			ENDIF
		ENDIF
		
		
	ENDPROC

	PROCEDURE inainte_de_do_reset
		lnReturn = AMESSAGEBOX("Doriti sa resetati setul la cel predefinit?",4+32,"Resetare set")
		IF lnReturn = 7 && 6 - DA, 7 - NU
			RETURN
		ENDIF 
		
		lcTabel = thisform.grid_seturi.RecordSource 
		SELECT (lcTabel)
		lcId_set = ALLTRIM(STR(id_set))
		lcId_util = ALLTRIM(STR(gnIdUtil))
		lcSql = [begin PACK_MG_EVOLUTIE.reset_set(] + lcId_set + [,] + lcId_util + [); end;]
		lnSucces = goExecutor.oExecute(lcSql)
		
		IF lnSucces < 0
			AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ELSE
			WAIT WINDOW "Setul a fost resetat!"
		ENDIF
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		Local lbviz
		lbviz=This.bvizualizare
		
		Do Case
			Case nKeyCode=3 And nShiftAltCtrl=2 && ctrl + C
				If Pemstatus(This,"do_copie_set",5)
					Nodefault
					This.do_copie_set()
				Endif
			Case nKeyCode=7 And nShiftAltCtrl=2 && ctrl + G
				If Pemstatus(This,"do_grafic",5)
					Nodefault
					This.do_grafic()
				Endif
			Otherwise
				DoDefault(nKeyCode, nShiftAltCtrl)
		Endcase
		
	ENDPROC

	PROCEDURE Release
		IF USED('cVenChelt')
			USE IN cVenChelt
		ENDIF 
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		
		this.WindowState = 2 
		thisform.do_cauta()
		
		DODEFAULT(nStyle)
	ENDPROC

	PROCEDURE valid_uzual
		Lparameters tnId_set, tnUzual, tnLunaI, tnAnulI, tnLunaF, tnAnulF, tnCumul, tnFaraGrafic
		
		Private pnId_set, pnCount, pnLunaI, pnAnulI, pnLunaF, pnAnulF, pnCumul, pnFaraGrafic
		pnId_set = tnId_set
		Store 0 To pnCount
		pnLunaI = tnLunaI
		pnAnulI = tnAnulI
		pnLunaF = tnLunaF
		pnAnulF = tnAnulF
		pnCumul = tnCumul
		pnFaraGrafic = tnFaraGrafic
		
		LOCAL lnuzual 
		lnuzual = tnUzual
		
		If lnUzual = 1
			lcSql = [begin PACK_MG_EVOLUTIE.verifica_uzual(?pnId_set,?gnIdUtil,?@pnCount); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			If lnSucces < 0
				AMessagebox(goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
		
			If pnCount = 0
				lcSql = [begin PACK_MG_EVOLUTIE.adauga_uzual(?pnId_set,?gnIdUtil, ?pnLunaI, ?pnAnulI, ?pnLunaF, ?pnAnulF, ?pnCumul, ?pnFaraGrafic); end;]
				lnSucces = goExecutor.oExecute(lcSql)
		
				If lnSucces < 0
					AMessagebox(goExecutor.cEroare,0+16,"Eroare")
					Return
				Endif
			Endif
		
		Else && sterg din mg_seturi_uzuale
			lcSql = [begin PACK_MG_EVOLUTIE.verifica_uzual(?pnId_set,?gnIdUtil,?@pnCount); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			If lnSucces < 0
				AMessagebox(goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
		
			If pnCount > 0
				lcSql = [begin PACK_MG_EVOLUTIE.sterge_uzual(?pnId_set,?gnIdUtil); end;]
				lnSucces = goExecutor.oExecute(lcSql)
		
				If lnSucces < 0
					AMessagebox(goExecutor.cEroare,0+16,"Eroare")
					Return
				Endif
			Endif
		ENDIF
		
		oprinc.set_uzual_requery
		
		
	ENDPROC

	PROCEDURE grid_seturi.AfterRowColChange
		LPARAMETERS nColIndex
		
		lcTabel = thisform.grid_seturi.RecordSource 
		save_grid_tag(thisform.grid_tipuri_speciale)
		
		SELECT (lcTabel) 
		pnId_set = id_set
		
		lcSel = [{call pack_mg_evolutie.get_set_tip_special(?pnId_set)}]
		lcCursor = 'crsTipuri_seturi'
		lnSucces = goExecutor.oExecute(lcSel,lcCursor)
		
		If lnSucces < 0
			amessagebox('Call pack_mg_evolutie.get_set_tip_special' + Chr(13) + goExecutor.cEroare,0+16,"Eroare")
			Return
		ENDIF
		
		SELECT * FROM crsTipuri_seturi INTO CURSOR cTipuri_seturi READWRITE 
		
		IF USED("crsTipuri_seturi")
			USE IN crsTipuri_seturi
		ENDIF 
		***
		SELECT (lcTabel) 
		IF id_set < 0
			thisform.but_reface1.Enabled = .T.
		ELSE 	
			thisform.but_reface1.Enabled = .F.
		ENDIF 
		
		restore_grid_tag(thisform.grid_tipuri_speciale)
		
		
	ENDPROC

	PROCEDURE grid_seturi.cFaraGrafic.Check1.Valid
		Private pnId_set, pnValue
		Local lcTabel
		
		lcTabel = Thisform.grid_seturi.RecordSource 
		
		Select (lcTabel)
		pnId_set = id_set
		
		pnValue = This.Value
		lcSql = [begin PACK_MG_EVOLUTIE.update_faraGrafic(?pnId_set,?pnValue); end;]
		lnSucces = goExecutor.oExecute(lcSql)
		
		If lnSucces < 0
			AMessagebox(goExecutor.cEroare,0+16,"Eroare")
			Return
		ENDIF
		
		
		
		
	ENDPROC

	PROCEDURE grid_seturi.cUzual.Check1.Valid
		LOCAL lnId_set, llUzual, lnLunaI, lnAnulI, lnLunaF, lnAnulF, lnCumul, lnFaraGrafic, lcTabel
		lcTabel = thisform.grid_seturi.RecordSource 
		
		lnId_set = &lcTabel..id_set
		llUzual = &lcTabel..uzual
		lnLunaI = &lcTabel..lunaI
		lnAnulI = &lcTabel..anulI
		lnLunaF = &lcTabel..lunaF
		lnAnulF = &lcTabel..anulF
		lnCumul = &lcTabel..cumul
		lnFaraGrafic = &lcTabel..faraGrafic
		
		thisform.valid_uzual(lnId_set, llUzual, lnLunaI, lnAnulI, lnLunaF, lnAnulF, lnCumul, lnFaraGrafic) 
		
	ENDPROC

	PROCEDURE grid_seturi.Init
		* this.SetAll("DynamicBackColor","IIF(this.nRecno = RECNO(),RGB(191,223,255),IIF(uzual,RGB(244,250,255),RGB(255,255,255)))", "Column")
		
		this.SetAll("DynamicBackColor","IIF(id_set < 0, RGB(223,255,223),IIF(uzual=1,RGB(230,244,255),RGB(255,255,255)))", "Column")
		
		
	ENDPROC

	PROCEDURE grid_tipuri_speciale.Column2.Check1.Valid
		LOCAL lnId_set, lnId_tip_set
		STORE 0 TO lnId_set, lnId_tip_set
		
		lcTabel_seturi = thisform.grid_seturi.RecordSource 
		SELECT (lcTabel_seturi)
		lnId_set = id_set
		
		lcTabel_tipuri = THISFORM.grid_tipuri_speciale.RECORDSOURCE
		SELECT (lcTabel_tipuri)
		lnId_tip_set = id_tip_set
		
		IF THIS.VALUE = 1 && ales
			lcSql = [begin PACK_MG_EVOLUTIE.adauga_set_special(]+ALLTRIM(STR(lnId_set))+ [,]+ ALLTRIM(STR(lnId_tip_set)) + [); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			IF lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ELSE
			lcSql = [begin PACK_MG_EVOLUTIE.sterge_set_special(]+ALLTRIM(STR(lnId_set))+ [,]+ ALLTRIM(STR(lnId_tip_set)) + [); end;]
			lnSucces = goExecutor.oExecute(lcSql)
		
			IF lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_viz_set_calc 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="edtComentariu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Resizer1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_grafic" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_grafic.Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_grafic._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_grafic._checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="container_grafic.olbl" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_explorer" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cb_faraGrafic" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cb_help" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: aspect
		*m: do_editare_set
		*m: grid_bind_formula
		*m: inainte_de_do_explorer
		*m: sou
		*p: cclass
		*p: ctitlugrafic
		*p: lfaragrafic
		*p: llgrafic
		*p: nheightgrid
		*p: nid_sectie
		*p: nid_set
		*p: nid_venchelt
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cclass = 
		ctitlugrafic = 
		DoCreate = .T.
		Height = 499
		lfaragrafic = .F.
		llgrafic = .F.
		Name = "frm_viz_set_calc"
		nheightgrid = 0
		nid_sectie = 0
		nid_set = 0
		nid_venchelt = 0
		Width = 795
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 794
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 673
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 120
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 764
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 9, ;
		Left = 706, ;
		Name = "But_excel1", ;
		TabIndex = 4, ;
		Top = 1, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_explorer' AS but_excel WITH ;
		Anchor = 9, ;
		caction = inainte_de_do_explorer, ;
		cpicturedown = explorer_jos.bmp, ;
		cpictureup = explorer_sus.bmp, ;
		Left = 676, ;
		Name = "But_explorer", ;
		Picture = ..\grafice\excel_sus.bmp, ;
		TabIndex = 4, ;
		ToolTipText = "Export Explorer", ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 735, ;
		Name = "But_listare1", ;
		TabIndex = 3, ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		Left = 646, ;
		Name = "But_reface1", ;
		Picture = ..\grafice\refac_sus.bmp, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cb_faraGrafic' AS commandbutton WITH ;
		Anchor = 9, ;
		Caption = "", ;
		Height = 19, ;
		Left = 775, ;
		Name = "cb_faraGrafic", ;
		TabIndex = 5, ;
		Top = 174, ;
		Width = 19, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cb_help' AS commandbutton WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		Caption = "", ;
		Height = 18, ;
		Left = 774, ;
		Name = "cb_help", ;
		Picture = ..\grafice\help_mic.bmp, ;
		TabIndex = 6, ;
		Top = 33, ;
		Width = 18, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'container_grafic' AS _container WITH ;
		Anchor = 15, ;
		BackStyle = 1, ;
		Comment = "*:onResize=ss", ;
		Height = 294, ;
		Left = 0, ;
		Name = "container_grafic", ;
		TabIndex = 2, ;
		Top = 195, ;
		Visible = .F., ;
		Width = 793, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="container" />

	ADD OBJECT 'container_grafic._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Legenda", ;
		Comment = "*:onResize=rb", ;
		Enabled = .T., ;
		FontBold = .F., ;
		FontName = "MS Sans Serif", ;
		FontSize = 8, ;
		Left = 724, ;
		Name = "_checkbox1", ;
		TabIndex = 13, ;
		Top = 80, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'container_grafic._checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Titlu", ;
		Comment = "*:onResize=rb", ;
		FontBold = .F., ;
		FontName = "MS Sans Serif", ;
		FontSize = 8, ;
		Left = 724, ;
		Name = "_checkbox2", ;
		TabIndex = 14, ;
		Top = 96, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'container_grafic.olbl' AS oleboundcontrol WITH ;
		Comment = "*:onResize=ss", ;
		Height = 286, ;
		Left = 4, ;
		Name = "olbl", ;
		Top = 4, ;
		Width = 701, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="oleboundcontrol" />

	ADD OBJECT 'container_grafic.Optiongroup1' AS optiongroup WITH ;
		BackStyle = 0, ;
		ButtonCount = 3, ;
		Comment = "*:onResize=rb", ;
		Height = 60, ;
		Left = 721, ;
		Name = "Optiongroup1", ;
		TabIndex = 10, ;
		Top = 129, ;
		Value = 2, ;
		Width = 68, ;
		ZOrderSet = 14, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "\<Bare", ;
		Option1.FontName = "MS Sans Serif", ;
		Option1.FontSize = 8, ;
		Option1.Height = 15, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 22, ;
		Option1.Value = 0, ;
		Option1.Width = 40, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "\<Coloane", ;
		Option2.FontName = "MS Sans Serif", ;
		Option2.FontSize = 8, ;
		Option2.Height = 15, ;
		Option2.Left = 4, ;
		Option2.Name = "Option2", ;
		Option2.Top = 6, ;
		Option2.Value = 1, ;
		Option2.Width = 57, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "\<Disc", ;
		Option3.FontName = "MS Sans Serif", ;
		Option3.FontSize = 8, ;
		Option3.Height = 15, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 39, ;
		Option3.Value = 0, ;
		Option3.Width = 39
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'edtComentariu' AS editbox WITH ;
		Anchor = 9, ;
		Height = 163, ;
		Left = 611, ;
		Name = "edtComentariu", ;
		TabIndex = 8, ;
		Top = 28, ;
		Width = 162, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="editbox" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 11, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 163, ;
		HighlightStyle = 2, ;
		Left = 0, ;
		Name = "Grid1", ;
		RecordMark = .F., ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 28, ;
		Width = 773, ;
		ZOrderSet = 11
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		Left = 350, ;
		Name = "Gridextra1", ;
		Top = 45
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Resizer1' AS resizer WITH ;
		Left = 180, ;
		Name = "Resizer1", ;
		TabIndex = 10, ;
		Top = 7, ;
		ZOrderSet = 5, ;
		Label1.Name = "Label1"
		*< END OBJECT: ClassLib="resizer.vcx" BaseClass="control" />
	
	PROCEDURE Activate
		this.WindowState= 2
		If This.WindowState= 2 And Type('this.resizer1')='O'
			This.resizer1.OnResize()
		ENDIF
		
		If Thisform.lFaraGrafic && fara Grafic
			this.container_grafic.Visible = .F. 
			this.grid1.Height = Thisform.grid1.Height + this.container_grafic.Height + 4
			this.cb_faraGrafic.Picture = 'chart_mic.bmp'
		ELSE && cu grafic
			this.container_grafic.Visible = .T.
		ENDIF 
		
		Thisform.nHeightGrid = Thisform.grid1.Height
	ENDPROC

	PROCEDURE aspect
		with THISFORM.container_grafic.olbl
			.chArtAREA.font.bold=.f.
			.chArtAREA.font.size=10
			.LEGEND.font.bold=.f.
			.LEGEND.font.size=8
			.walls.interior.color=rgb(192,192,192)
			.floor.interior.color=rgb(192,192,192)	
			.HasTitle = .T.
			*.ChartTitle.Caption =ALLTRIM(pcTitlu)
			.ChartTitle.Caption = ALLTRIM(thisform.cTitluGrafic) 
		endwith
	ENDPROC

	PROCEDURE do_editare_set
		LOCAL lnId_modiPara, lnId_ind  
		lnId_modiPara = 2 && seturi uzuale
		lcTabel = thisform.grid1.RecordSource
		SELECT (lcTabel)
		lnId_ind = id_ind
		
		DO editare_set WITH thisform.nId_set, lnId_modiPara, lnId_ind IN oproceduri_seturi_indicatori.prg
	ENDPROC

	PROCEDURE grid_bind_formula
		lcGrid = 'thisform.grid1'
		loGrid = &lcGrid
		If !Pemstatus(loGrid,'name',5)
			Loop
		Endif
		
		For j = 1 To loGrid.ColumnCount
			loText = loGrid.Columns(j).Text1
			Bindevent(loText, "DblClick", This, "do_editare_set")
		Endfor
		
	ENDPROC

	PROCEDURE inainte_de_do_excel
		LOCAL lcSelect, i
		PRIVATE plFaraGrafic
		LOCAL lcTabel, lcTitlu  
		lcTabel = THISFORM.grid1.RECORDSOURCE
		lcTitlu = ""
		IF !EMPTY(thisform.cTitluGrafic)
			lcTitlu = thisform.cTitluGrafic
		ENDIF 	
		
		plFaraGrafic = .F.
		
		IF thisform.container_grafic.Visible = .f.
			plFaraGrafic = .T.
		ENDIF 	
		
		*!*	SELECT (lctabel)
		*!*	lcXtabV = gcTempPath + "xtabv.DBF"
		*!*	SELECT * FROM (lctabel) INTO TABLE (lcXtabV)
		*!*	ALTER TABLE XTABV drop COLUMN comentariu
		
		lcSelect = ""
		FOR I = 1 TO FCOUNT(lcTabel)
			IF LOWER(FIELD(i, lcTabel)) <> 'comentariu'
				lcSelect = lcSelect + "," + FIELD(i, lcTabel)
			ENDIF 	
		ENDFOR 
		lcSelect = "select " + SUBSTR(lcSelect,2) + " from " + lcTabel + " into cursor xtabv"
		&lcSelect
		
		
		DO lanseaza_excel WITH "XtabV", lcTitlu, plFaraGrafic IN oproceduri_evolutie.prg
		
		USE IN (SELECT('xtabv'))
		
	ENDPROC

	PROCEDURE inainte_de_do_explorer
		LOCAL lcTabel, lcXtabV, llfaragrafic  
		llfaragrafic = .F.
		
		lcTabel = thisform.grid1.RecordSource 
		SELECT (lctabel)
		lcXtabV = ADDBS(gcTempPath) + "xtabv.DBF"
		
		SELECT * FROM (lcTabel) INTO TABLE (lcXtabV)
		ALTER TABLE (lcXtabV) drop COLUMN comentariu
		ALTER TABLE (lcXtabV) drop COLUMN id_ind
		
		IF thisform.container_grafic.Visible= .f.
			llfaragrafic = .T.
		ENDIF 
		
		thisform.AlwaysOnTop = .F.
		
		DO lanseaza_html WITH "XtabV", thisform.cTitluGrafic, llfaragrafic 
		USE IN xtabv
		
		* thisform.AlwaysOnTop = .T.
		
	ENDPROC

	PROCEDURE inainte_de_do_listare
		THISFORM.ALWAYSONTOP = .F.
		
		*!*	lcmenu="Listare \<sume, formule;Listare \<grafic"
		*!*	lnx=xmenu(lcmenu)
		*!*	DO CASE
		*!*		CASE lnx = 1
		*!*		
		*!*		SELECT xtab
		*!*		lcTabelForm = pre_listare_formule_set(thisform.nId_set)
		*!*		SELECT f.* FROM (lcTabelForm) f LEFT JOIN 
		*!*		BROWSE 
		*!*		
		*!*		CASE lnx = 2
				IF THISFORM.container_grafic.VISIBLE = .F.
					lnRaspuns = amessagebox('Graficul este ascuns!',0+48,"Atentie")
				ELSE
		*!*				IF USED("gtemp")
		*!*					SELE gtemp
		*!*					REPORT FORM grafic TO PRINTER PROMPT PREVIEW
		*!*				ENDIF
					goExport.export2frx([gtemp],[grafic])
				ENDIF
		*!*	ENDCASE
		
		THISFORM.ALWAYSONTOP = .T.
		
		
	ENDPROC

	PROCEDURE inainte_de_do_reface
		save_grid(thisform.grid1)
		*!* TODO: TREBUIE SA EXECUT ACELASI COD - BIFA COLOANE DUPA TIP VENITURI/CHELTUIELI DIN FRM_PARAMETRI_CALCUL
		pcFCentru = ""
		lcSel = [{call PACK_MG_EVOLUTIE.GEN_MG_INDICATORI(?pnLunaI,?pnAnulI,?pnLunaF,?pnAnulF,?pnCumul,] + ;
			ALLTRIM(STR(thisform.nid_sectie)) + [,] + ALLTRIM(STR(thisform.nid_venchelt)) + [)}]
		lcCursor = 'xtab_O'
		lnSucces = goExecutor.oExecute(lcSel,lcCursor)
		IF lnSucces < 0
			AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		SELECT xtab_O
		IF RECCOUNT()=0
			amessagebox('Raportul nu contine nici o informatie!',0+48,"Atentie")
			IF USED('xtab_O')
				USE IN xtab_O
			ENDIF
			RETURN
		ENDIF
		
		***---------
		PRIVATE poSet
		STORE '' TO poSet
		
		LOCAL lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
		lcSchema1 = []
		lcSelect1 = [select id_ind, ales from mg_tmp_indicatori]
		lcOrder1 = []
		lcgroup = []
		lcFiltru1 = [ales=1 and id_set=]+ALLTRIM(STR(thisform.nId_set))
		lcFiltruOriginal = []
		llModParam = .T.
		llAfiseaza = .F.
		
		gencursor('poSet','crsSet', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza,  lcgroup, llModParam, lcFiltruOriginal)
		poSet.ca_baza1.afisare()
		***---------
		lcFisXtab = gcTempPath + "xtab.dbf"
		SELECT crsSet
		LOCATE FOR ales = 1
		IF FOUND()
			SELECT x.* ;
				FROM xtab_O x JOIN crsSet i ON i.id_ind = x.id_ind ;
				ORDER BY ord_rand, RAND INTO CURSOR XTAB READWRITE		
		*!*			ORDER BY ord_rand, RAND INTO TABLE (lcFisXtab)
		ELSE
			SELECT x.* ;
				FROM xtab_O x ;
				ORDER BY ord_rand, RAND INTO CURSOR XTAB READWRITE		
		*!*			ORDER BY ord_rand, RAND INTO TABLE (lcFisXtab)
		ENDIF
		
		IF USED("crsSet")
			USE IN crsSet
		ENDIF
		RELEASE poSet
		
		thisform.grid1.RecordSource = "xtab"
		
		thisform.grid1.column3.header1.caption = "Rand"
		thisform.grid1.column3.controlsource = 'xtab.rand'
		thisform.grid1.column3.alignment = 4
		
		thisform.grid1.column4.header1.caption = "Nume_ind"
		thisform.grid1.column4.controlsource = 'xtab.nume_ind'
		thisform.grid1.column4.alignment = 4
		
		
		lnColumn = thisform.grid1.ColumnCount
		
		SELECT xtab
		lnColumn = FCOUNT()
		
		*!*	DEBUG
		*!*	SUSPEND
		
		FOR i = 6 TO lnColumn 
			SELECT xtab
			lcCol = FIELD(i)
			
			cCaption = "thisform.grid1.column"+Alltrim(Str(i))+".header1.caption='"+lcCol+"'"
			&cCaption 
			
			cControlSource = "thisform.grid1.Column"+Alltrim(Str(i))+".controlsource='"+lcCol+"'"
			&cControlSource 
		
			cformat = "thisform.grid1.Column"+Alltrim(Str(i))+".format='rk'"
			&cformat
			cinputmask = "thisform.grid1.Column"+Alltrim(Str(i))+".inputmask"
			&cinputmask = "999 999 999 999.99"
			
			cAlignement = "thisform.grid1.Column"+Alltrim(Str(i))+".alignment =5"
			&cAlignement 
		
		ENDFOR 
		
		IF thisform.llgrafic 
			Thisform.sou
		ENDIF 
	ENDPROC

	PROCEDURE Init
		Parameters tnId_set, tlfaragrafic, tcTitluGrafic, tnId_sectie, tnId_venchelt
		
		DODEFAULT()
		thisform.nId_set = tnId_set
		thisform.lFaraGrafic = tlfaragrafic 
		thisform.cTitluGrafic = ALLTRIM(tcTitluGrafic)
		
		lcclass = ""
		Do Case
		Case isComobject("msgraph.chart")
			lcclass="msgraph.chart"
		Case isComobject("msgraph.chart.5")
			lcclass="msgraph.chart.5"
		Case isComobject("msgraph.chart.8")
			lcclass="msgraph.chart.8"
		Case isComobject("msgraph.chart.9")
			lcclass="msgraph.chart.9"
		Case isComobject("msgraph.chart.10")
			lcclass="msgraph.chart.10"
		ENDCASE
		
		thisform.cclass = lcclass
		
		If Empty(lcclass)
			this.container_grafic._checkbox1.Visible = .F. 
			this.container_grafic._checkbox2.Visible = .F. 
			this.llgrafic=.f.
		ELSE
			this.llgrafic=.t.
		ENDIF
		
		IF !this.llgrafic 
			Thisform.lFaraGrafic = .T.
		ENDIF 
		
		IF this.llgrafic 
			Thisform.sou
		ENDIF 
		
		IF !EMPTY(tnId_sectie)
			thisform.nid_sectie = tnId_sectie
		ENDIF
		
		IF !EMPTY(tnId_venchelt)
			thisform.nid_venchelt = tnId_venchelt
		endif
		this.grid_bind_formula()
		this.gridextra1.setup()
		
		
	ENDPROC

	PROCEDURE Resize
		THIS.Resizer1.OnResize()
	ENDPROC

	PROCEDURE sou
		Lparameters nStyle,ii,T
		*!* 29.05.2019
		*!* marius.mutu
		*!* campurile de sume de la coloana 4 (primele 3: nrcrt, nume, atributxml)
		
		#Define CRLF	Chr(13)+Chr(10)
		#Define Tab 	Chr(9)
		#Define coltype	-4100
		
		LOCAL lcCent, lcCurr, lcDate, lcDeci, lcHour, lcMark, lcPoin, lcSepa       
		
		lctabel = Thisform.grid1.RecordSource
		Select (lctabel)
		lcXtabV = gcTempPath + "xtabv.dbf"
		Copy To (lcXtabV)
		Alter Table (lcXtabV) Drop Column id_ind
		Alter Table (lcXtabV) Drop Column ord_rand
		Alter Table (lcXtabV) Drop Column comentariu
		
		
		***
		lcfis = gcTempPath + "gtemp"
		Create Table &lcfis (gen1 g)
		Append Blank
		*_______________________________________
		cgdata=""
		Select xtabv
		
		For i=3 To Fcount()
			lcgrup = Right(Field(i),2)
			lcTipCumul = Left(Field(i),1)
			lcan = Substr(Field(i),2,4)
			cgdata = cgdata+Tab+cluna(lcgrup,lcTipCumul,lcan)
		Next
		
		lcCent = SET("Century")
		lcCurr = SET("Currency")
		lcDate = SET("Date")
		lcDeci = SET("Decimals")
		lcHour = SET("Hours")
		lcMark = SET("Mark")
		lcPoin = SET("Point")
		lcSepa = SET("Separator")
		
		SET SYSFORMATS ON 
		
		Select xtabv
		Scan
			cgdata = cgdata+CRLF+Alltrim(Evaluate(Field(2)))
			For i = 4 To Fcount()
				cgdata = cgdata+Tab+Alltrim(Str(Eval(Field(i)),16,2))
			Endfor
			Select xtabv
		Endscan
		
		cgdata = cgdata+CRLF
		
		SET SYSFORMATS OFF
		
		SET CENTURY &lcCent
		SET CURRENCY &lcCurr
		SET date &lcDate
		SET DECIMALS TO &lcDeci 
		SET HOURS TO &lcHour
		SET MARK TO &lcMark
		SET POINT TO &lcPoin
		SET SEPARATOR TO &lcSepa 
		
		*________________________________________
		* This.LockScreen = .T.
		
			Select gtemp
			Append General gen1 Class (thisform.cclass) Data m.cgdata
			This.container_grafic.olbl.ControlSource = "gtemp.gen1"
			This.container_grafic.olbl.autoformat(coltype,1)
			This.container_grafic.olbl.Visible=.T.
			This.Visible=.T.
			Use In xtabv
			Select (lctabel)
			Go Top
			Select gtemp
		
		* This.LockScreen = .F.
		
		Thisform.aspect
		
		
	ENDPROC

	PROCEDURE cb_faraGrafic.Click
		Thisform.container_grafic.Visible = !Thisform.container_grafic.Visible
		
		If Thisform.container_grafic.Visible 
			Thisform.container_grafic.Visible = .T.
			Thisform.lfaragrafic = .F.
			
			** micsorez graficul
			*Thisform.grid1.Height = Thisform.nheightgrid 
			Thisform.grid1.Height = Thisform.Height - Thisform.container_grafic.Height - 42
			Thisform.cb_faraGrafic.Picture = 'chart_mic_taiat.bmp'
		Else
			Thisform.container_grafic.Visible = .F.
			Thisform.lfaragrafic = .T.
		
			* Thisform.grid1.Height = Thisform.nheightgrid + Thisform.container_grafic.Height + 4
			Thisform.grid1.Height = Thisform.Height - 37
			Thisform.cb_faraGrafic.Picture = 'chart_mic.bmp'
		Endif
		
	ENDPROC

	PROCEDURE cb_faraGrafic.Init
		 If Thisform.lFaragrafic
			this.Picture = 'CHART_MIC.BMP'
		Else
			This.Picture = 'CHART_mic_TAIAT.BMP'
		Endif
		
	ENDPROC

	PROCEDURE cb_help.Click
		LOCAL lnMare, lnMic
		STORE 0 TO lnMare, lnMic
		
		lnMare = thisform.edtComentariu.Left + thisform.edtComentariu.Width 
		lnMic = thisform.edtcomentariu.Left - thisform.grid1.Left - 2
		
		IF thisform.grid1.Width = lnMare
			thisform.grid1.Width = lnMIc
			thisform.cb_help.Picture = 'help_mic_taiat.BMP'
		ELSE
			thisform.grid1.Width = lnMare
			thisform.cb_help.Picture = 'help_mic.BMP'
		ENDIF 	
		
		
	ENDPROC

	PROCEDURE container_grafic.Optiongroup1.Click
		#DEFINE bartype	-4099
		#DEFINE coltype	-4100
		#DEFINE pietype	-4102
		
		DO CASE
		CASE THIS.Value = 1
			THISFORM.container_grafic.Olbl.autoformat(bartype,1)
		CASE THIS.Value = 2
			THISFORM.container_grafic.Olbl.autoformat(coltype,1)
		OTHERWISE
			THISFORM.container_grafic.Olbl.autoformat(pietype,7)
		ENDCASE
	ENDPROC

	PROCEDURE container_grafic._checkbox1.Click
		THISFORM.container_grafic.olbl.HasLegend ;
		= !THISFORM.container_grafic.olbl.HasLegend
		
	ENDPROC

	PROCEDURE container_grafic._checkbox1.Init
		this.Value=1
	ENDPROC

	PROCEDURE container_grafic._checkbox2.Click
		THISFORM.container_grafic.olbl.HasTitle = !THISFORM.container_grafic.olbl.HasTitle
		IF THISFORM.container_grafic.olbl.HasTitle = .T.
			THISFORM.container_grafic.olbl.ChartTitle.Caption = thisform.cTitluGrafic
		ENDIF
	ENDPROC

	PROCEDURE container_grafic._checkbox2.Init
		this.Value=1
	ENDPROC

	PROCEDURE Grid1.AfterRowColChange
		LPARAMETERS nColIndex
		thisform.edtcomentariu.Refresh
	ENDPROC

ENDDEFINE

DEFINE CLASS panou_calc_2011 AS panou OF "..\..\clase\ferestre_sitfin_comune.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Container_formular_10.But_calc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_10.lb_bil_data" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_10.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_10.But_edit1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_10.optBilPrescurtat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_20.But_calc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_20.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_20.lb_bil_data" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_20.But_edit1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_30.But_calc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_30.But_edit1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_40.But_calc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container_formular_40.But_edit1" UniqueID="" Timestamp="" />

	*<PropValue>
		Name = "panou_calc"
		Container_formular_10.Label1.Left = 6
		Container_formular_10.Label1.Name = "Label1"
		Container_formular_10.Label2.Name = "Label2"
		Container_formular_10.Name = "Container_formular_10"
		Container_formular_20.Label1.Left = 7
		Container_formular_20.Label1.Name = "Label1"
		Container_formular_20.Label2.Name = "Label2"
		Container_formular_20.Name = "Container_formular_20"
		Container_formular_30.Label1.Name = "Label1"
		Container_formular_30.Label2.Name = "Label2"
		Container_formular_30.Name = "Container_formular_30"
		Container_formular_40.LABEL1.Name = "LABEL1"
		Container_formular_40.LABEL2.Name = "LABEL2"
		Container_formular_40.Name = "Container_formular_40"
	*</PropValue>

	ADD OBJECT 'Container_formular_10.But_calc1' AS but_calc WITH ;
		Left = 186, ;
		Name = "But_calc1", ;
		Top = 11
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_10.But_edit1' AS but_edit WITH ;
		Left = 229, ;
		Name = "But_edit1", ;
		Top = 11
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_10.Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Precedent  -  Curent", ;
		FontName = "Arial Narrow", ;
		Height = 18, ;
		Left = 6, ;
		Name = "Label3", ;
		TabIndex = 4, ;
		Top = 30, ;
		Width = 87
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_formular_10.lb_bil_data' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		FontName = "Arial Narrow", ;
		Height = 18, ;
		Left = 6, ;
		Name = "lb_bil_data", ;
		TabIndex = 4, ;
		Top = 42, ;
		Width = 29
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_formular_10.optBilPrescurtat' AS optiongroup WITH ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 2, ;
		Height = 16, ;
		Left = 119, ;
		Name = "optBilPrescurtat", ;
		Top = 41, ;
		Value = 1, ;
		Visible = .F., ;
		Width = 136, ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Bilant prescurtat", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = -1, ;
		Option1.Value = 1, ;
		Option1.Width = 84, ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Bilant", ;
		Option2.FontName = "Arial Narrow", ;
		Option2.Height = 18, ;
		Option2.Left = 93, ;
		Option2.Name = "Option2", ;
		Option2.Top = -1, ;
		Option2.Width = 41
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'Container_formular_20.But_calc1' AS but_calc WITH ;
		Left = 186, ;
		Name = "But_calc1", ;
		Top = 13
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_20.But_edit1' AS but_edit WITH ;
		Left = 229, ;
		Name = "But_edit1", ;
		Top = 13
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_20.Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Precedent  -  Curent", ;
		FontName = "Arial Narrow", ;
		Height = 18, ;
		Left = 7, ;
		Name = "Label3", ;
		TabIndex = 4, ;
		Top = 29, ;
		Width = 87
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_formular_20.lb_bil_data' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		FontName = "Arial Narrow", ;
		Height = 18, ;
		Left = 7, ;
		Name = "lb_bil_data", ;
		TabIndex = 4, ;
		Top = 42, ;
		Width = 29
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Container_formular_30.But_calc1' AS but_calc WITH ;
		Left = 186, ;
		Name = "But_calc1", ;
		Top = 4
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_30.But_edit1' AS but_edit WITH ;
		Left = 229, ;
		Name = "But_edit1", ;
		Top = 4
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_40.But_calc1' AS but_calc WITH ;
		Left = 186, ;
		Name = "But_calc1", ;
		Top = 4
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container_formular_40.But_edit1' AS but_edit WITH ;
		Left = 229, ;
		Name = "But_edit1", ;
		Top = 4
		*< END OBJECT: ClassLib="..\..\clase\ferestre_sitfin.vcx" BaseClass="commandbutton" />
	
	PROCEDURE Container_formular_10.lb_bil_data.Refresh
		LOCAL lcLuna, lcAnulC, lnAnul, lnAnulP    
		
		lcLuna = thisform.container_data1.cboluna.Value 
		lcAnulC = thisform.container_data1.cboAnul.Value
		lnAnul = VAL(thisform.container_data1.cboAnul.Value)
		lnAnulP = lnanul - 1
		this.Caption = "12 " + ALLTRIM(str(lnanulP)) + "    -   " + lcLuna +" "+ lcanulC
	ENDPROC

	PROCEDURE Container_formular_20.lb_bil_data.Refresh
		LOCAL lcLuna, lcAnulC, lnAnulP  
		
		lcLuna = thisform.container_data1.cboluna.Value 
		lcAnulC = thisform.container_data1.cboAnul.Value
		lnAnulP = val(thisform.container_data1.cboAnul.Value)-1
		this.Caption = lcLuna + ' ' + ALLTRIM(str(lnanulP)) + '    -   ' + lcLuna + ' ' + lcAnulC
	ENDPROC

ENDDEFINE
