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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid2.Column8.Text1" UniqueID="" Timestamp="" />
	*< 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="_grid1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grid1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_buton1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_buton2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_nract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_nract2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_pereche" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: col4
		*p: npereche
		*p: sql_act
		*p: sql_ireg
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 416
		Name = "afisdebsicred"
		sql_act = ''
		sql_ireg = ''
		Width = 749
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 750
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 715
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 34
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Pereche inregistrari"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Left = 719
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_grid1' AS _grid WITH ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		Height = 319, ;
		HighlightStyle = 1, ;
		Left = 12, ;
		Name = "_grid1", ;
		Panel = 1, ;
		RecordSource = "v_actcd", ;
		Top = 57, ;
		Width = 363, ;
		ZOrderSet = 5, ;
		Column1.ControlSource = "dataact", ;
		Column1.Name = "Column1", ;
		Column1.Width = 64, ;
		Column2.ControlSource = "nract", ;
		Column2.Name = "Column2", ;
		Column2.Width = 71, ;
		Column3.ControlSource = "suma", ;
		Column3.InputMask = "999 999 999 999.99", ;
		Column3.Name = "Column3", ;
		Column3.Width = 81, ;
		Column4.BackColor = 252,253,200, ;
		Column4.ControlSource = "", ;
		Column4.Name = "Column4", ;
		Column4.Width = 112, ;
		Column5.ControlSource = "explicatia", ;
		Column5.Name = "Column5", ;
		Column5.Width = 96, ;
		Column6.ControlSource = "scc", ;
		Column6.Name = "Column6", ;
		Column7.ControlSource = "scd", ;
		Column7.Name = "Column7", ;
		Column8.ControlSource = "", ;
		Column8.Name = "Column8", ;
		Column9.ControlSource = "dataireg", ;
		Column9.Name = "Column9", ;
		Column10.ControlSource = "fdoc", ;
		Column10.Name = "Column10"
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="grid" />

	ADD OBJECT '_grid1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data act", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grid1.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel doc", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column10.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. act", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grid1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Document pereche", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column4.Text1' AS textbox WITH ;
		BackColor = 252,253,200, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT '_grid1.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont cred", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid1.Column7.Header1' AS header WITH ;
		Caption = "Cont deb", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid1.Column8.Header1' AS header WITH ;
		Caption = "Explicatia 2", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data ireg", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid1.Column9.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid2' AS _grid WITH ;
		ColumnCount = 8, ;
		DeleteMark = .F., ;
		Height = 319, ;
		HighlightStyle = 1, ;
		Left = 378, ;
		Name = "_grid2", ;
		Panel = 1, ;
		RecordSource = "v_iregcd", ;
		Top = 57, ;
		Width = 356, ;
		ZOrderSet = 5, ;
		Column1.ControlSource = "dataact", ;
		Column1.Name = "Column1", ;
		Column1.Width = 66, ;
		Column2.ControlSource = "nract", ;
		Column2.Name = "Column2", ;
		Column2.Width = 69, ;
		Column3.ControlSource = "suma", ;
		Column3.InputMask = "999 999 999 999.99", ;
		Column3.Name = "Column3", ;
		Column3.Width = 92, ;
		Column4.ControlSource = "achitat", ;
		Column4.InputMask = "999 999 999 999.99", ;
		Column4.Name = "Column4", ;
		Column4.Width = 91, ;
		Column5.ControlSource = "fdoc", ;
		Column5.Name = "Column5", ;
		Column6.ControlSource = "dataireg", ;
		Column6.Name = "Column6", ;
		Column7.ControlSource = "explicatia", ;
		Column7.Name = "Column7", ;
		Column8.ControlSource = "acont", ;
		Column8.Name = "Column8"
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="grid" />

	ADD OBJECT '_grid2.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data act", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grid2.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. doc", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grid2.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid2.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid2.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Achitat", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid2.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid2.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel doc", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid2.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid2.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data ireg", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid2.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid2.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatia", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid2.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grid2.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Acont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grid2.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_shape3' AS _shape WITH ;
		Height = 372, ;
		Left = 4, ;
		Name = "_shape3", ;
		Style = 3, ;
		Top = 36, ;
		Width = 741, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'ck_nract' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = nract, ;
		Caption = "Nr. document", ;
		Left = 99, ;
		Name = "ck_nract", ;
		Top = 40
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_nract2' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = nract, ;
		Caption = "Nr. document", ;
		Left = 456, ;
		Name = "ck_nract2", ;
		Top = 40
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_pereche' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = pereche, ;
		Caption = "Pereche", ;
		Left = 240, ;
		Name = "Ck_pereche", ;
		Top = 40
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_buton1' AS cmd_buton WITH ;
		caction = do_listare, ;
		Caption = "\<Listare 1", ;
		FontBold = .T., ;
		Left = 72, ;
		Name = "Cmd_buton1", ;
		Top = 379
		*< END OBJECT: ClassLib="..\comun\clase\_cmd_base.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_buton2' AS cmd_buton WITH ;
		caction = do_excel, ;
		Caption = "\<Listare 2", ;
		FontBold = .T., ;
		Left = 528, ;
		Name = "Cmd_buton2", ;
		Top = 379
		*< END OBJECT: ClassLib="..\comun\clase\_cmd_base.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Caption = "\<Pereche", ;
		Left = 273, ;
		Name = "Cmd_executa1", ;
		Top = 379
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Lb_1' AS lb_titlu_alb_b12 WITH ;
		Left = 23, ;
		Name = "Lb_1", ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'Lb_2' AS lb_titlu_alb_b12 WITH ;
		Left = 390, ;
		Name = "Lb_2", ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
	
	PROCEDURE Destroy
		RELEASE pnPereche1,pnPereche2,pctitlu
		
	ENDPROC

	PROCEDURE do_cauta
		STORE "" TO t1,t2,T3
		lcAct = this._grid1.RecordSource 
		lcIreg = this._grid2.RecordSource 
		
		
		IF thisform.ck_nract.Value=1
			T1 = T1 + thisform.ck_nract.filtru_vfp
		ENDIF
		if this.ck_pereche.Value=1
			lcControl = this._grid1.column4.ControlSource
			val1 = thisform.ck_pereche.cvaloare1 
			val2 = thisform.ck_pereche.cvaloare2 
			T1=t1+" and (" + lcControl + ">=" + val1 + ") and (" + lcCOntrol +"<=" + val2 + ")"
		endif
		IF thisform.ck_nract2.Value=1
			T2 = T2 + thisform.ck_nract2.filtru_vfp
		ENDIF
		
		SELECT (lcAct)
		IF !EMPTY(t1)
			t1=SUBSTR(t1,5)
		ELSE 
			t1=".t."
		ENDIF 
		
			SELECT (lcAct)
			SET FILTER TO &t1 
		*!*	SUM suma TO totsumdeb
		*!*	GO BOTTOM 
		
		
		SELECT (lcIreg)
		IF !EMPTY(t2)
			t2=SUBSTR(t2,5)
		ELSE 
			t2=".t."
		ENDIF 
		SELECT (lcIreg)
		SET FILTER TO &t2
		*!*	SUM suma TO totsumcred
		
		*!*	GO BOTTOM 
		thisform.Refresh 
	ENDPROC

	PROCEDURE do_excel
		lcIreg = This._grid2.RecordSource
		If Reccount(lcIreg)>0
			Thisform.AlwaysOnTop=.F.
			Private pctitlu,pcDataOra
			pctitlu = Thisform.lb_2.Caption
			pcDataOra = get_ora(2)
			Select (lcIreg)
			Report Form ist_deb_cred To Printer Prompt Preview
			Thisform.AlwaysOnTop=.T.
		Else
			amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_executa
		PRIVATE pcPereche
		SELECT v_actcd
		SCATTER NAME pcPereche 
		
		lcPereche = thisform._GRID1.coluMN4.ControlSource 
		
		opereche = CREATEOBJECT('cautper')
		
		
		SELECT v_iregcd
		LOCATE FOR nract = pcPereche.&lcPereche
		opereche.pereche = lcPereche
		
		*!*	opereche.lb._cbbase1.controlsource = 'pcPereche.&lcPereche'
		
		opereche.show(1)
		
		IF buton = 1
			thisform.LockScreen = .T. 
			save_grid(this._grid1)
			SAVE_grid(this._grid2)
				USE IN v_actcd
				lcSql = this.sql_act 
				lcCursor = [v_actcd]   &&Act
				lnSucces = goExecutor.oExecute(lcSql,lcCursor)
				goExecutor.oReset()
				
				USE IN v_iregcd
				lcSql = this.sql_ireg 
				lcCursor = [v_iregcd]   &&Ireg
				lnSucces = goExecutor.oExecute(lcSql,lcCursor)
				goExecutor.oReset()
			restore_grid(this._grid1)
			restore_grid(this._grid2)
			thisform.LockScreen = .F. 
		ENDIF 
		RELEASE opereche
	ENDPROC

	PROCEDURE do_listare
		thisform.AlwaysOnTop=.f.
		PRIVATE pctitlu,pcdataora
		pcdataora=get_ora(2)
		pctitlu = thisform.lb_1.Caption 
		lcAct = this._grid1.RecordSource
		SELECT (lcAct)
		REPORT FORM ist_deb_cred TO PRINTER PROMPT PREVIEW
		thisform.AlwaysOnTop=.t.
		
	ENDPROC

	PROCEDURE ck_nract.Click
		thisform.do_cauta 
	ENDPROC

	PROCEDURE ck_nract2.Click
		thisform.do_cauta 
	ENDPROC

	PROCEDURE Ck_pereche.Click
		thisform.do_cauta 
	ENDPROC

	PROCEDURE _grid1.AfterRowColChange
		LPARAMETERS nColIndex
		thisform._grid1.SetAll('DynamicBackColor','IIF(.t.,RGB(255,255,255),RGB(255,255,255))','column')
		thisform._grid1.column4.BackColor =RGB(252,253,200)
		
		lcAct = this.RecordSource 
		lcIreg = thisform._grid2.RecordSource 
		thisform.npereche = EVALUATE(this.column4.ControlSource)
		SELECT (lcIreg)
		thisform._grid2.SetAll('DynamicBackColor','iif(nract=thisform.npereche,RGB(191,223,255),RGB(255,255,255))','column')
		SELECT (lcAct)
		thisform.Refresh 
	ENDPROC

	PROCEDURE _grid2.AfterRowColChange
		LPARAMETERS nColIndex
		thisform._grid2.SetAll('DynamicBackColor','IIF(.t.,RGB(255,255,255),RGB(255,255,255))','column')
		
		lcIreg = this.RecordSource 
		 lcAct = thisform._grid1.RecordSource 
		*!*	this.SetAll("DynamicBackColor","IIF(thisform.rec=RECNO(), RGB(191,223,255) , RGB(255,255,255))", "Column")
		thisform.npereche = EVALUATE(this.column2.ControlSource)
		thisform.col4=thisform._grid1.column4.ControlSource 
		SELECT (lcAct)
		thisform._grid1.SetAll('DynamicBackColor','iif(EVALUATE(thisform.col4) =thisform.npereche,RGB(191,223,255),RGB(255,255,255))','column')
		SELECT (lcIreg)
		thisform.Refresh 
	ENDPROC

ENDDEFINE

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

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

	*<DefinedPropArrayMethod>
		*p: pereche
		*p: valoare
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 89
		Name = "cautper"
		pereche = 
		valoare = 0
		Width = 352
		_shape1.BorderStyle = 2
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 351
		_shape2.Height = 29
		_shape2.Left = 291
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Pereche"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Left = 321
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'lb' AS cb_tx_simplu WITH ;
		Left = 32, ;
		Name = "lb", ;
		TabIndex = 1, ;
		Top = 48, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_iregcd.nract", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Pereche", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE inainte_de_do_termin
		
		lcCod = pcPereche.cod
		update_actper(lcCod)
		
		lnSucces = sqlsetprop(gnhandle,"Transactions",2)
		
		SELECT actactan
		IF lnSucces > 0
			lnSucces = oscrie_in_fisiere(2,.t.)
		ENDIF 
		
		IF lnSucces >0
			lcSql = [delete from act_temp] 
			lnSucces = SQLEXEC(gnHandle,lcSql)
		ENDIF 
			
		IF lnSucces>0
			SELECT actactan 
			LOCATE FOR id_act = pcPereche.id_act
				IF FOUND()
					GATHER NAME pcPereche
					REPLACE id_util WITH gnidutil
				ENDIF 
			lnSucces = oscrie_in_fisiere(0,.t.)
		ENDIF 
		
		IF lnSucces < 0
			SQLROLLBACK(gnhandle)
			llReturn = .f.
		ELSE
			SQLCOMMIT(gnhandle)
			llReturn = .t.
		ENDIF
		
		lnSucces = sqlsetprop(gnhandle,"Transactions",1)	
		IF lnSucces < 0
			aMESSAGEBOX('Programul a trecut pe tranzactie manuala. Iesiti si intrati din nou!',48,'Atentie!')
		ENDIF 
		
		RETURN llReturn
		
	ENDPROC

	PROCEDURE lb._cbbase1.LostFocus
		lcPereche = thisform.pereche 
		pcPereche.&lcPereche = v_iregcd.nract
	ENDPROC

ENDDEFINE

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

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

	*<DefinedPropArrayMethod>
		*m: init_mesaj
		*m: init_test
		*m: init_test_inregistrari
		*m: istoric
		*p: activ
		*p: lcont
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 395
		Name = "teste_ireg"
		Width = 553
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 565
		_shape2.Height = 29
		_shape2.Left = 486
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 68
		Lb_titlu_alb_b121.Caption = "Test inregistrari"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 522
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_listbox1' AS _listbox WITH ;
		AutoHideScrollbar = 1, ;
		Height = 315, ;
		Left = 12, ;
		Name = "_listbox1", ;
		ToolTipText = (this.value), ;
		Top = 48, ;
		Width = 528
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="listbox" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Left = 490, ;
		Name = "But_listare1", ;
		Top = 1
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Caption = "\<Istoric", ;
		Left = 456, ;
		Name = "Cmd_executa1", ;
		Top = 365
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
	
	PROCEDURE Destroy
		IF USED('crslistare')
			USE IN crslistare
		ENDIF 
	ENDPROC

	PROCEDURE do_executa
		
		IF thisform._listbox1.listcount = 0
			thisform.Cmd_executa1.Enabled = .f.	
		ELSE
			thisform.Cmd_executa1.Enabled = .t.	
			IF thisform._listbox1.listindex = 0
				ofrm_mes = CREATEOBJECT('frm_mesaj','Atentie','exclam.ico','Avertizare','Selectati un item din lista!')
				ofrm_mes.show(1)
				RELEASE ofrm_mes
			ELSE	
				lcId_part = thisform.lam[ceiling(thisform._listbox1.listindex/2),3]
				* lcCont = thisform.lcont 
				lcCont = thisform.lam[ceiling(thisform._listbox1.listindex/2),4]
				lcAcont = thisform.lam[ceiling(thisform._listbox1.listindex/2),5]
				lcActiv = thisform.activ 
				* WAIT WINDOW "Id : " + lcId_part + " Cont : " + lcCont + " Activ : " + lcActiv
				thisform.istoric(lcCont,lcAcont,lcId_part,lcActiv)
			ENDIF		
		ENDIF
		
	ENDPROC

	PROCEDURE do_listare
		Thisform.AlwaysOnTop=.F.
		*!*	gofundal.AlwaysOnTop=.F.
		pcTitlu = thisform.lb_titlu_alb_b121.Caption 
		pcDataOra=get_ora(2)
		Select crslistare
		Report Format rap_teste To Printer Prompt Preview
		*!*	gofundal.AlwaysOnTop=.T.
		Thisform.AlwaysOnTop=.T.
	ENDPROC

	PROCEDURE Init
		LPARAMETERS taMesaje,tcCont,tnActiv
		DODEFAULT()
		
		IF !EMPTY(tcCont) AND PCOUNT() > 2
			this.init_test_inregistrari(@taMesaje,tcCont,tnActiv)
		ELSE 
			this.init_mesaj(@taMesaje)
		ENDIF
	ENDPROC

	PROCEDURE init_mesaj
		PARAMETERS taMesaje
		LOCAL ICtr
		
		this.cmd_executa1.Visible = .f.
		
		EXTERNAL ARRAY taMesaje
		
		lnLen = aLEN(taMesaje)  												&&Lungime array parametru
		DIMENSION laM(lnLen,1)
		ADDPROPERTY(thisform,'lam(lnLen,1)')
		
		CREATE CURSOR crslistare (explicatie1 c(50),explicatie2 c(20),mesaj c(100))
		
		FOR ICtr = 1 TO lnLen
			lcSeparator = AT(';',taMesaje[Ictr])  							    &&Primu separator
			lcMesaj = LEFT(taMesaje[Ictr],lcSeparator-1)   					   
		
			lam[Ictr,1] = lcMesaj
		
			thisform._listbox1.AddItem(laM[Ictr,1])
			thisform.lam[Ictr,1] = laM[Ictr,1]
			
			IF '--' $ laM[Ictr,1]
				lcmesaj = []
				lcExp1 = laM[Ictr,1]
			ELSE 
				lcmesaj = laM[Ictr,1]
				lcExp1 = []
			ENDIF 
			INSERT INTO crslistare(explicatie1,explicatie2,mesaj) values(lcExp1,'',lcmesaj)
		ENDFOR 	
	ENDPROC

	PROCEDURE init_test
	ENDPROC

	PROCEDURE init_test_inregistrari
		PARAMETERS taMesaje, tcCont, tnActiv 
		
		LOCAL ICtr, lcId_part, lcCont, lcAcont  
		
		EXTERNAL ARRAY taMesaje
		
		thisform.lcont=TcCont
		thisform.activ = ALLTRIM(STR(tnActiv))
		
		lnLen = aLEN(taMesaje)  												&&Lungime array parametru
		DIMENSION laM(lnLen,7)
		
		ADDPROPERTY(thisform,'lam(lnLen,7)')
		IF USED('crslistare')
			USE IN crslistare
		ENDIF
		*CREATE CURSOR crslistare (nume c(50),acont c(4),mesaj c(100))
		CREATE CURSOR crslistare (explicatie1 c(50),explicatie2 c(30),mesaj c(100))
		
		FOR ICtr = 1 TO lnLen
		* ID_SUCURSALA, SUCURSALA, ID_PARTENER, PARTENER, CONT, ACONT, SOLD_BALANTA, SOLD_INREGISTRARI
			lcLinie = taMesaje[Ictr]
			lnItems = ALINES(laItems, lcLinie, 1, ';')
			lcIdSucursala = laItems[1]
			lcSucursala =  laItems[2]
			lcId_part = laItems[3]
			lcPart = laItems[4]
			lcCont = laItems[5]
			lcAcont = UPPER(ALLTRIM(laItems[6]))
			lcAcont = IIF(lcAcont = 'XXXX', '', lcAcont)
			lcSoldBal = laItems[7]
			lcSoldIreg = laItems[8]
		
			lcSold = "Sold balanta : " + lcSoldBal + "  Sold inregistrari : " + lcSoldIreg + "  Diferenta : " +;
			ALLTRIM(STR(VAL(lcSoldBal) - VAL(lcSoldIreg),14,gnPa))
			
		*	to_char(item.id_sucursala) || ';' || item.sucursala || ';' || to_char(item.id_part) || ';' || item.nume || ';' || item.cont || ';' ||
		*                    item.acont || ';' || lnDiferentaB || ';' || lnDiferentaI || '*'
		
			laM[Ictr,1] = lcPart
			laM[Ictr,2] = lcSold
			laM[Ictr,3] = lcId_part
			laM[Ictr,4] = lcCont
			laM[Ictr,5] = lcAcont
			laM[Ictr,6] = lcIdSucursala
			laM[Ictr,7] = lcSucursala
		
			&& SUCURSALA - NUME - CONT - ACONT
			lcNumesiAna = lcPart + IIF(!EMPTY(lcSucursala), ' (' + lcSucursala + ')', '') + [ - ] + lcCont + IIF(!EMPTY(lcAcont), [.] + lcAcont, '')
			thisform._listbox1.AddItem(lcNumesiAna)
			&& SOLD_BALANTA | SOLD_INREGISTRARI | DIFERENTA
			thisform._listbox1.AddItem(laM[Ictr,2])
			thisform.lam[Ictr,1] = laM[Ictr,1]
			thisform.lam[Ictr,2] = laM[Ictr,2]
			thisform.lam[Ictr,3] = laM[Ictr,3]		
			thisform.lam[Ictr,4] = laM[Ictr,4]	
			thisform.lam[Ictr,5] = laM[Ictr,5]	
			thisform.lam[Ictr,6] = laM[Ictr,6]	
			thisform.lam[Ictr,7] = laM[Ictr,7]
						
			INSERT INTO crslistare(explicatie1,explicatie2,mesaj) values(lcPart + IIF(!EMPTY(lcSucursala), ' (' + lcSucursala + ')', '') ,lcCont + IIF(!EMPTY(lcAcont), [.] + lcAcont, ''), lcSold)
		ENDFOR 
		
		
		*!*	LOCAL ICtr
		
		*!*	EXTERNAL ARRAY taMesaje
		
		*!*	thisform.lcont=TcCont
		*!*	thisform.activ = ALLTRIM(STR(tnActiv))
		
		*!*	lnLen = aLEN(taMesaje)  												&&Lungime array parametru
		*!*	DIMENSION laM(lnLen,4)
		
		*!*	ADDPROPERTY(thisform,'lam(lnLen,4)')
		*!*	IF USED('crslistare')
		*!*		USE IN crslistare
		*!*	ENDIF
		*!*	*CREATE CURSOR crslistare (nume c(50),acont c(4),mesaj c(100))
		*!*	CREATE CURSOR crslistare (explicatie1 c(50),explicatie2 c(20),mesaj c(100))
		
		
		*!*	FOR ICtr = 1 TO lnLen
		*!*		lcSeparator = AT(';',taMesaje[Ictr])  							    &&Primu separator
		*!*		lcId_part = LEFT(taMesaje[Ictr],lcSeparator-1)   					&&Id partener
		*!*		lcAcont = STREXTRACT(taMesaje[Ictr],';',';',1)  					&&Analitic
		
		*!*		lcSql = [select id_part,nume from ] + gcS + [.vnom_parteneri where id_part = ] + lcId_Part
		*!*		lcCursor = [crsParteneri]
		*!*		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		*!*		IF lnSucces > 0
		*!*			SELECT crsParteneri
		*!*			GO top
		*!*			laM[Ictr,1] = UPPER(ALLTRIM(nume)) 				&& Nume Partener
		*!*			laM[Ictr,3] = lcId_part
		*!*			laM[Ictr,4] = lcAcont
		*!*		ELSE
		*!*			aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
		*!*			laM[Ictr,1] = ""          						&& Nume Partener
		*!*			laM[Ictr,3] = lcId_part	
		*!*			laM[Ictr,4] = lcAcont	
		*!*		ENDIF 
		*!*		IF USED('crsParteneri')
		*!*			USE IN crsParteneri
		*!*		ENDIF 
		*!*		lcSoldBal = STREXTRACT(taMesaje[Ictr],';',';',2)					&&Sold balanta parteneri
		*!*		lcSeparator3 = AT(';',taMesaje[Ictr],3)  							 && Al 3-lea separator
		*!*		lcSoldIreg = STRTRAN(SUBSTR(taMesaje[Ictr],lcSeparator3+1),'*','')    &&Sold inregistrari parteneri
		*!*		lam[Ictr,2] = "Sold balanta : " + lcSoldBal + "  Sold inregistrari : " + lcSoldIreg + "  Diferenta : " +;
		*!*		ALLTRIM(STR(VAL(lcSoldBal) - VAL(lcSoldIreg),14,gnPa))
		
		*!*		IF !EMPTY(lcAcont) AND ALLTRIM(UPPER(lcAcont)) # 'XXXX'
		*!*			lcNumesiAna = laM[Ictr,1] + [ - Analitic ] + lcAcont
		*!*		ELSE 
		*!*			lcNumesiAna = laM[Ictr,1]
		*!*		ENDIF 
		*!*	*	thisform._listbox1.AddItem(laM[Ictr,1])
		*!*		thisform._listbox1.AddItem(lcNumesiAna)
		*!*		thisform._listbox1.AddItem(laM[Ictr,2])
		*!*		thisform.lam[Ictr,1] = laM[Ictr,1]
		*!*		thisform.lam[Ictr,2] = laM[Ictr,2]
		*!*		thisform.lam[Ictr,3] = laM[Ictr,3]		
		*!*		thisform.lam[Ictr,4] = laM[Ictr,4]	
		*!*		
		*!*		INSERT INTO crslistare(explicatie1,explicatie2,mesaj) values(laM[Ictr,1],[Analitic - ] + laM[Ictr,4],laM[Ictr,2])
		*!*	ENDFOR 
	ENDPROC

	PROCEDURE istoric
		LPARAMETERS tcCont,tcAnalitic,tnId,tcActiv
		
		lcCont = ALLTRIM(tcCont)
		lcAcont = ALLTRIM(tcAnalitic)
		IF EMPTY(lcAcont) OR ISNULL(lcAcont)
			lcAcont = 'xxxx'
		ENDIF
		lcId = ALLTRIM(tnId)
		lnActiv = VAL(tcActiv)
		
		PRIVATE pnPereche1,pnPereche2
		STORE 0 TO pnPereche1,pnPereche2
		
		THIS.ALWAYSONTOP=.F.
		
		DO CASE
			CASE lnActiv = 0  &&
				PRIVATE pccond
		
				lcSql_i = [select id_part,nume as partc,'' as partd,dataact,nract,dataireg,preccred+credit as suma,precdeb+debit as achitat,cont as scc, '' as scd, acont,fdoc,explicatia ]+;
					[ from vireg_parteneri where id_part=] + lcId + [ and cont = '] + lcCont + [' and NVL(acont,'xxxx') = '] + lcAcont + [' and an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnLuna)) + ;
					[ order by dataireg]
		
				lcCursor = [v_iregcd]   &&Ireg_parteneri
				lnSucces = goExecutor.oExecute(lcSql_i,lcCursor)
				goExecutor.oReset()
		
				lcSql_a = [select a.dataact,a.nract,a.suma,a.explicatia,a.id_act,a.cod,a.scd,a.scc,a.dataireg,a.fdoc,a.partd,a.pereched from ] + ;
					gcS + [.vact a where a.id_partd = ] + lcId + [ and a.scd = '] + lcCont + [' and NVL(a.ascd,'xxxx') = '] + lcAcont + [' and a.an = ] + ALLTRIM(STR(gnAn)) + [ and a.luna = ] + ALLTRIM(STR(gnLuna)) +;
					[ order by a.dataact]
		
				lcCursor = [v_actcd]   &&Act
				lnSucces = goExecutor.oExecute(lcSql_a,lcCursor)
				goExecutor.oReset()
		
				pcPereche='pereched'
				ORC=CREATEOBJ("AFisDEBsiCRED")
				ORC._grid1.column4.CONTROLSOURCE = 'pereched'
				ORC.lb_2.CAPTION='CREDIT'
				ORC.lb_1.CAPTION='DEBIT'
				ORC.Sql_act = lcSql_a
				ORC.Sql_ireg = lcSql_i
		
			CASE lnActiv = 1 &&
				PRIVATE pccond
		
				lcSql_i = [select id_part,nume as partd, '' as partc, dataact,nract,dataireg,precdeb+debit as suma,preccred+credit as achitat,cont as scd, '' as scc, acont,fdoc,explicatia ] +;
					[ from vireg_parteneri where id_part=] + lcId + [ and cont = '] + lcCont + [' and NVL(acont,'xxxx') = '] + lcAcont + [' and an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnLuna)) + ;
					[ order by dataireg]
		
				lcCursor = [v_iregcd]   &&Ireg_parteneri
				lnSucces = goExecutor.oExecute(lcSql_i,lcCursor)
				goExecutor.oReset()
		
				lcSql_a = [select a.partd,a.dataact,a.nract,a.suma,a.explicatia,a.id_act,a.cod,a.scd,a.scc,a.dataireg,a.fdoc,a.partc,a.perechec from ] + ;
					gcS + [.vact a where a.id_partc = ] + lcId + [ and a.scc = '] + lcCont + [' and NVL(a.ascc,'xxxx') = '] + lcAcont + [' and a.an = ] + ALLTRIM(STR(gnAn)) + [ and a.luna = ] + ALLTRIM(STR(gnLuna)) +;
					[ order by a.dataact]
		
				lcCursor = [v_actcd]   &&Act
				lnSucces = goExecutor.oExecute(lcSql_a,lcCursor)
				goExecutor.oReset()
		
				pcPereche='perechec'
				ORC=CREATEOBJ("AFisDEBsiCRED")
				ORC._grid1.column4.CONTROLSOURCE = 'perechec'
				ORC.lb_1.CAPTION='CREDIT'
				ORC.lb_2.CAPTION='DEBIT'
				ORC.Sql_act = lcSql_a
				ORC.Sql_ireg = lcSql_i
		ENDCASE
		
		ORC.SHOW(1)
		
		
		
		
	ENDPROC

ENDDEFINE
