*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="oparteneri.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS afincpl 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="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="Grid1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtTotal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ali
	*</DefinedPropArrayMethod>

	*<PropValue>
		ali = ''
		DoCreate = .T.
		Height = 437
		Name = "afincpl"
		Width = 727
		WindowState = 2
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 732
		_shape2.Height = 29
		_shape2.Left = 664
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "RULAJ"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 697
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 0
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 8, ;
		Left = 667, ;
		Name = "But_listare1", ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 12, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 368, ;
		Left = 14, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RowHeight = 19, ;
		Top = 36, ;
		Width = 702, ;
		Column1.ControlSource = "dataireg", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 71, ;
		Column2.ControlSource = "dataact", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 77, ;
		Column3.ControlSource = "nract", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.Width = 104, ;
		Column4.ControlSource = "partD", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.Width = 199, ;
		Column5.ControlSource = "partC", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.Width = 67, ;
		Column6.ControlSource = "explicatia", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.Width = 69, ;
		Column7.ControlSource = "suma", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = "999 999 999 999 999.99", ;
		Column7.Name = "Column7", ;
		Column7.Width = 117, ;
		Column8.ControlSource = "scd", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.Width = 58, ;
		Column9.ControlSource = "scc", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.Width = 62, ;
		Column10.ControlSource = "fdoc", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.Width = 112, ;
		Column11.ControlSource = "util", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.Width = 83, ;
		Column12.ControlSource = "dataora", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column12"
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'Grid1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data inreg.", ;
		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.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel Doc.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.Column9.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 'txtTotal' AS textbox WITH ;
		Anchor = 12, ;
		FontSize = 10, ;
		Height = 23, ;
		InputMask = "999 999 999 999 999.99", ;
		Left = 552, ;
		Name = "txtTotal", ;
		ReadOnly = .T., ;
		Top = 408, ;
		Visible = .F., ;
		Width = 164
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE do_listare
		LOCAL lcAlias
		lcAlias = Thisform.grid1.RecordSource
		If Reccount(m.lcAlias)>0
			pcDataOra = get_ora(2)
			Thisform.AlwaysOnTop= .F.
			SELECT(m.lcAlias)
			Report Form ist_deb_cred To Printer Prompt Preview
			Thisform.AlwaysOnTop= .T.
		Else
			amessagebox("Nu exista inregistrari pentru listare!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		
		LOCAL lcAlias
		lcAlias = Thisform.grid1.RecordSource
		SELECT(m.lcAlias)
		CALCULATE SUM(suma) TO thisform.txtTotal.Value
		GO TOP 
		
		DODEFAULT(nStyle)
	ENDPROC

	PROCEDURE txtTotal.Init
		sum suma to totsum
	ENDPROC

ENDDEFINE

DEFINE CLASS cb_nom_valute AS _cbbase OF "..\..\comun\clase\_cb_base.vcx" 
 	*< CLASSDATA: Baseclass="combobox" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<DefinedPropArrayMethod>
		*m: initializare
	*</DefinedPropArrayMethod>

	*<PropValue>
		FontName = "Arial Narrow"
		Name = "cb_nom_valute"
		Width = 72
	*</PropValue>
	
	PROCEDURE Destroy
		If Used('crsnumeval')
			Use In crsnumeval
		Endif
	ENDPROC

	PROCEDURE Init
		this.initializare()
	ENDPROC

	PROCEDURE initializare
		=ccvalute()
		Select nume_val From v_nom_valute Into Array lanumeval Order By nume_val
		Use In v_nom_valute
		
		If Used('crsnumeval')
			Use In crsnumeval
		Endif
		
		Create Cursor crsnumeval (nume_val c(5))
		Select crsnumeval
		Append Blank
		Replace nume_val With '---'
		If Type('lanumeval')#'U'
			Append From Array lanumeval
			Release lanumeval
		Endif
		This.RowSourceType= 2
		This.RowSource="crsnumeval"
		This.Value='---'
		This.BoundTo=.T.
	ENDPROC

ENDDEFINE

DEFINE CLASS config_balanta_nou AS frm_termin OF "..\..\comun\clase\_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" 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.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Name = "config_balanta_nou"
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 299
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 76
		Lb_titlu_alb_b121.Caption = "-"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		BUT_TERMIN1.Top = 1
	*</PropValue>

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

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 41, ;
		Width = 360, ;
		TEXT_SIMPLU1.ControlSource = "oadd.explicatie", ;
		TEXT_SIMPLU1.Format = "K", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.Left = 64, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 3, ;
		TEXT_SIMPLU1.Width = 292, ;
		LB_SIMPLU1.Caption = "Titlu", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 72, ;
		Width = 360, ;
		TEXT_SIMPLU1.ControlSource = "oadd.explicatie2", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.Left = 64, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		TEXT_SIMPLU1.Top = 3, ;
		TEXT_SIMPLU1.Width = 292, ;
		LB_SIMPLU1.Caption = "Explicatie", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 132, ;
		Left = 13, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RecordSource = "crsCont", ;
		TabIndex = 3, ;
		Top = 108, ;
		Width = 163, ;
		Column1.ControlSource = "cont", ;
		Column1.Name = "Column1", ;
		Column1.Width = 91, ;
		Column2.ControlSource = "ales", ;
		Column2.CurrentControl = "Check1", ;
		Column2.Name = "Column2", ;
		Column2.Sparse = .F., ;
		Column2.Width = 40
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'Grid1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		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.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Height = 17, ;
		Left = 30, ;
		Name = "Check1", ;
		Top = 47, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Grid1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Alege", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />
	
	PROCEDURE Grid1.Column2.Check1.Valid
		pcExplicatie2 = ''
		SELECT crsCont
		lnRecno = RECNO()
		SCAN FOR ales = 1
			pcExplicatie2 = pcExplicatie2 + '+' + ALLTRIM(cont) 
		ENDSCAN 
		pcExplicatie2 = SUBSTR(pcExplicatie2,2)
		oadd.explicatie2 = pcExplicatie2
		SELECT crsCont
		GO lnRecno
		thisform.clb_tx_simplu2.Refresh 
		
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="LbExplicatie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search1.But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search1.But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search1.But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search2.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search2.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search2.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search3.But_nou3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search3.But_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_search3.But_sterge3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Edit1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: calcul_formula
		*m: do_adauga_balanta
		*m: do_adauga_coloane
		*m: do_adauga_formula
		*m: do_modifica_balanta
		*m: do_modifica_coloane
		*m: do_modifica_formula
		*m: do_sterge_balanta
		*m: do_sterge_coloane
		*m: do_sterge_formula
		*p: cformula
		*p: clistaconturi
		*p: cnumecoloana
		*p: ctiltlubalanta
		*p: nidbalanta
		*p: nidcoloana
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cbuton3 = Ct_grid_search1.but_modifica1;Ct_grid_search2.but_modifica2;Ct_grid_search3.but_modifica3
		cbuton4 = Ct_grid_search1.but_sterge1;Ct_grid_search2.but_sterge2;Ct_grid_search3.but_sterge3;but_reface1
		cformula = 
		clistaconturi = 
		cnumecoloana = 
		ctiltlubalanta = 
		DoCreate = .T.
		Height = 541
		Name = "config_balante_parteneri"
		nidbalanta = 0
		nidcoloana = 0
		Width = 727
		WindowState = 2
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 751
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 9
		_shape2.Left = 675
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Configurare Balante Parteneri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 695
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'Ct_grid_search1' AS ct_grid_search WITH ;
		Anchor = 11, ;
		Height = 172, ;
		Left = 12, ;
		Name = "Ct_grid_search1", ;
		Top = 26, ;
		Width = 349, ;
		ZOrderSet = 5, ;
		_GRID1.Anchor = 15, ;
		_GRID1.FontName = "Arial", ;
		_GRID1.Height = 105, ;
		_GRID1.Left = 6, ;
		_GRID1.Name = "_GRID1", ;
		_GRID1.Top = 62, ;
		_GRID1.Width = 336, ;
		Titlu.Anchor = 3, ;
		Titlu.Caption = "Lista Balante Configurate", ;
		Titlu.Name = "Titlu", ;
		Cb_tx_cautare1.Anchor = 10, ;
		Cb_tx_cautare1.Criteriu.Anchor = 2, ;
		Cb_tx_cautare1.Criteriu.Height = 24, ;
		Cb_tx_cautare1.Criteriu.Left = 3, ;
		Cb_tx_cautare1.Criteriu.Name = "Criteriu", ;
		Cb_tx_cautare1.Criteriu.Top = 1, ;
		Cb_tx_cautare1.Criteriu.Width = 99, ;
		Cb_tx_cautare1.Height = 27, ;
		Cb_tx_cautare1.Left = 7, ;
		Cb_tx_cautare1.Name = "Cb_tx_cautare1", ;
		Cb_tx_cautare1.Text.Anchor = 130, ;
		Cb_tx_cautare1.Text.Height = 25, ;
		Cb_tx_cautare1.Text.Left = 102, ;
		Cb_tx_cautare1.Text.Name = "Text", ;
		Cb_tx_cautare1.Text.Top = 1, ;
		Cb_tx_cautare1.Text.Width = 145, ;
		Cb_tx_cautare1.Top = 31, ;
		Cb_tx_cautare1.Width = 248
		*< END OBJECT: ClassLib="ferestre_cere_date.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_grid_search1.But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = do_modifica_balanta, ;
		Left = 285, ;
		Name = "But_modifica1", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Ct_grid_search1.But_sterge1' AS but_sterge WITH ;
		Anchor = 9, ;
		caction = do_sterge_balanta, ;
		Left = 313, ;
		Name = "But_sterge1", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct_grid_search2' AS ct_grid_search WITH ;
		Anchor = 225, ;
		Height = 260, ;
		Left = 12, ;
		Name = "Ct_grid_search2", ;
		Top = 202, ;
		Width = 349, ;
		ZOrderSet = 6, ;
		_GRID1.FontName = "Arial", ;
		_GRID1.Height = 195, ;
		_GRID1.Left = 6, ;
		_GRID1.Name = "_GRID1", ;
		_GRID1.Top = 62, ;
		_GRID1.Width = 336, ;
		Titlu.Caption = "Coloane Balanta", ;
		Titlu.Name = "Titlu", ;
		Cb_tx_cautare1.Criteriu.Height = 24, ;
		Cb_tx_cautare1.Criteriu.Left = 3, ;
		Cb_tx_cautare1.Criteriu.Name = "Criteriu", ;
		Cb_tx_cautare1.Criteriu.Top = 1, ;
		Cb_tx_cautare1.Criteriu.Width = 105, ;
		Cb_tx_cautare1.Height = 27, ;
		Cb_tx_cautare1.Left = 7, ;
		Cb_tx_cautare1.Name = "Cb_tx_cautare1", ;
		Cb_tx_cautare1.Text.Height = 25, ;
		Cb_tx_cautare1.Text.Left = 108, ;
		Cb_tx_cautare1.Text.Name = "Text", ;
		Cb_tx_cautare1.Text.ReadOnly = .T., ;
		Cb_tx_cautare1.Text.Top = 1, ;
		Cb_tx_cautare1.Text.Width = 138, ;
		Cb_tx_cautare1.Top = 31, ;
		Cb_tx_cautare1.Width = 248
		*< END OBJECT: ClassLib="ferestre_cere_date.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_grid_search2.But_modifica2' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = do_modifica_coloane, ;
		Left = 284, ;
		Name = "But_modifica2", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct_grid_search2.But_nou2' AS but_nou WITH ;
		Anchor = 9, ;
		caction = do_adauga_coloane, ;
		Left = 255, ;
		Name = "But_nou2", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct_grid_search2.But_sterge2' AS but_sterge WITH ;
		Anchor = 9, ;
		caction = do_sterge_coloane, ;
		Left = 312, ;
		Name = "But_sterge2", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct_grid_search3' AS ct_grid_search WITH ;
		Anchor = 225, ;
		Height = 260, ;
		Left = 372, ;
		Name = "Ct_grid_search3", ;
		Top = 202, ;
		Width = 349, ;
		ZOrderSet = 7, ;
		_GRID1.FontName = "Arial", ;
		_GRID1.Height = 195, ;
		_GRID1.Left = 6, ;
		_GRID1.Name = "_GRID1", ;
		_GRID1.Top = 62, ;
		_GRID1.Width = 336, ;
		Titlu.Caption = "Formula Coloane", ;
		Titlu.Name = "Titlu", ;
		Cb_tx_cautare1.Criteriu.Height = 24, ;
		Cb_tx_cautare1.Criteriu.Left = 3, ;
		Cb_tx_cautare1.Criteriu.Name = "Criteriu", ;
		Cb_tx_cautare1.Criteriu.Top = 1, ;
		Cb_tx_cautare1.Criteriu.Width = 106, ;
		Cb_tx_cautare1.Height = 27, ;
		Cb_tx_cautare1.Left = 7, ;
		Cb_tx_cautare1.Name = "Cb_tx_cautare1", ;
		Cb_tx_cautare1.Text.Height = 25, ;
		Cb_tx_cautare1.Text.Left = 110, ;
		Cb_tx_cautare1.Text.Name = "Text", ;
		Cb_tx_cautare1.Text.Top = 1, ;
		Cb_tx_cautare1.Text.Width = 136, ;
		Cb_tx_cautare1.Top = 31, ;
		Cb_tx_cautare1.Visible = .F., ;
		Cb_tx_cautare1.Width = 248
		*< END OBJECT: ClassLib="ferestre_cere_date.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_grid_search3.But_modifica3' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = do_modifica_formula, ;
		Left = 284, ;
		Name = "But_modifica3", ;
		Top = 32
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct_grid_search3.But_nou3' AS but_nou WITH ;
		Anchor = 9, ;
		caction = do_adauga_formula, ;
		Left = 255, ;
		Name = "But_nou3", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ct_grid_search3.But_sterge3' AS but_sterge WITH ;
		Anchor = 9, ;
		caction = do_sterge_formula, ;
		Left = 312, ;
		Name = "But_sterge3", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Edit1' AS editbox WITH ;
		Anchor = 30, ;
		ControlSource = "thisform.cFormula", ;
		DisabledBackColor = 255,255,255, ;
		Height = 46, ;
		Left = 18, ;
		Name = "Edit1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		Top = 488, ;
		Width = 696, ;
		ZOrderSet = 8
		*< END OBJECT: BaseClass="editbox" />

	ADD OBJECT 'LbExplicatie' AS label WITH ;
		Anchor = 82, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Explicatie", ;
		FontItalic = .T., ;
		FontUnderline = .T., ;
		Height = 17, ;
		Left = 18, ;
		Name = "LbExplicatie", ;
		Top = 470, ;
		Width = 55, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="label" />
	
	PROCEDURE calcul_formula
		LOCAL lcFormula
		lcFormula = []
		lcCrs = thisform.ct_grid_search3.cnumecursor 
		SELECT (lcCrs)
		SCAN
			lcFormula = lcFormula +" " +ALLTRIM(camp)
		ENDSCAN 
		thisform.cformula = lcFormula
		thisform.edit1.Refresh 
		
		lcFormula = ALLTRIM(this.ctiltlubalanta) + [ - Formula de calcul pentru coloana "] + ALLTRIM(this.cnumecoloana) + [" este :]
		this.lbExplicatie.Caption = lcFormula
		this.lbExplicatie.Refresh 
	ENDPROC

	PROCEDURE do_adauga_balanta
		lcSel = this.ct_grid_search1.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd BLANK 
		 
		lcSql = [select distinct cont, 0 as ales from ] + gcs + [.vcoresp_tip_cont order by cont]
		lcCursor = [crsCont]
		lnSucces = goExecutor.oExecute(lcSql, lcCursor)
		
		IF lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		gnButon = 2
		poAdd = CREATEOBJECT('config_balanta_nou')
		poAdd.show()
		
		IF gnButon = 1
			pcListaConturi = ALLTRIM(oadd.explicatie2)
			pcExplicatie = ALLTRIM(oadd.explicatie)
			pnIdBal = oadd.id_coloana
			lcCallProc = [{call pack_balante_cumulate.add_new_balanta(?gcs,?pcListaConturi,'+',?pcExplicatie,1,?pnIdBal)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		IF USED(lcCursor) 
			USE IN (lcCursor)
		ENDIF 
		
		this.ct_grid_search1.actualizeaza_grid()
		this.ct_grid_search1._GRID1.AutoFit 
		this.ct_grid_search1.SetFocus 
	ENDPROC

	PROCEDURE do_adauga_coloane
		lcSel = this.ct_grid_search2.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd BLANK 
		 
		
		gnButon = 2
		poAdd = CREATEOBJECT('config_coloana_nou')
		poAdd.show()
		
		IF gnButon = 1
			pcNumeColoana = ALLTRIM(oadd.explicatie)
			pnOrdine = oadd.ordine
			pnIdBal = thisform.nidbalanta
			pnIdCol = oadd.id_op_col
			pnIdCalcul = oadd.id_calcul
		
			lcCallProc = [{call pack_balante_cumulate.add_new_coloana(?gcs,?pcNumeColoana,?pnOrdine,1,?pnIdBal,?pnIdCol,?pnIdCalcul)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		this.ct_grid_search2.actualizeaza_grid()
		this.ct_grid_search2._GRID1.AutoFit 
		this.ct_grid_search2.SetFocus 
	ENDPROC

	PROCEDURE do_adauga_formula
		lcSel = this.ct_grid_search3.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd BLANK 
		
		pcListaConturi = ['] + ALLTRIM(STRTRAN(this.clistaconturi, [+], [','])) + [']
		
		lcSql = [select id_coloana, explicatie, camp from ] + gcs + [.coloane where explicatie2 in (] + pcListaConturi + [) order by explicatie2, id_coloana]
		lcCursor1 = [crsColoane]
		lnSucces = goExecutor.oExecute(lcSql, lcCursor1)
		
		IF lnSucces < 0
			amessagebox(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		lcSql = [select id_operator, operator, traducere from ] + gcs + [.sal_operatori where functie = 0 order by id_operator]
		lcCursor2 = [CrsOperatori]
		lnSucces = goExecutor.oExecute(lcSql, lcCursor2)
		
		IF lnSucces < 0
			amessagebox(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		pcTata = this.cnumecoloana
		
		gnButon = 2
		poAdd = CREATEOBJECT('config_formula_nou')
		poAdd.show()
		
		IF gnButon = 1
			pnOrdine = oadd.ordine
			pnTip = 1 && Insert
			pnIdTata = this.nidcoloana 
			pnIdColOp = oadd.Id_Op_col
			pnFel = oadd.coloana
			pnIdCalcul = oadd.id_calcul
			
			lcCallProc = [{call pack_balante_cumulate.add_new_formula(?gcs,?pnOrdine, ?pnTip, ?pnIdTata, ?pnIdColOp, ?pnFel, ?pnIdCalcul)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		IF USED(lcCursor1) 
			USE IN (lcCursor1)
		ENDIF 
		IF USED(lcCursor2) 
			USE IN (lcCursor2)
		ENDIF 
		
		this.ct_grid_search3.actualizeaza_grid()
		this.ct_grid_search3._GRID1.AutoFit 
		this.ct_grid_search3.SetFocus 
		this.calcul_formula
	ENDPROC

	PROCEDURE do_modifica_balanta
		lcSel = this.ct_grid_search1.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd
		pcListaConturi = ALLTRIM(STRTRAN(oadd.explicatie2,[+],[,]))
		 
		lcSql = [select distinct cont, (CASE WHEN cont in (] + pcListaConturi + [) THEN 1 ELSE 0 END) as ales from ] + gcs + [.vcoresp_tip_cont order by cont]
		lcCursor = [crsCont]
		lnSucces = goExecutor.oExecute(lcSql, lcCursor)
		
		IF lnSucces < 0
			amessagebox(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		SELECT (lcCursor)
		gnButon = 2
		poAdd = CREATEOBJECT('config_balanta_nou')
		poAdd.show()
		
		IF gnButon = 1
			pcListaConturi = ALLTRIM(oadd.explicatie2)
			pcExplicatie = ALLTRIM(oadd.explicatie)
			pnIdBal = oadd.id_coloana
			lcCallProc = [{call pack_balante_cumulate.add_new_balanta(?gcs,?pcListaConturi,'+',?pcExplicatie,2,?pnIdBal)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		IF USED(lcCursor) 
			USE IN (lcCursor)
		ENDIF 
		
		this.ct_grid_search1.actualizeaza_grid()
		this.ct_grid_search1._GRID1.AutoFit 
	ENDPROC

	PROCEDURE do_modifica_coloane
		lcSel = this.ct_grid_search2.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd
		 
		
		gnButon = 2
		poAdd = CREATEOBJECT('config_coloana_nou')
		poAdd.show()
		
		IF gnButon = 1
			pcNumeColoana = ALLTRIM(oadd.explicatie)
			pnOrdine = oadd.ordine
			pnIdBal = oadd.id_coloana
			pnIdCol = oadd.id_op_col
			pnIdCalcul = oadd.id_calcul
		
			lcCallProc = [{call pack_balante_cumulate.add_new_coloana(?gcs,?pcNumeColoana,?pnOrdine,2,?pnIdBal,?pnIdCol,?pnIdCalcul)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		this.ct_grid_search2.actualizeaza_grid()
		this.ct_grid_search2._GRID1.AutoFit 
	ENDPROC

	PROCEDURE do_modifica_formula
		lcSel = this.ct_grid_search3.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd
		
		pcListaConturi = ['] + ALLTRIM(STRTRAN(this.clistaconturi, [+], [','])) + [']
		
		lcSql = [select id_coloana, explicatie, camp from ] + gcs + [.coloane where explicatie2 in (] + pcListaConturi + [) order by explicatie2, id_coloana]
		lcCursor1 = [crsColoane]
		lnSucces = goExecutor.oExecute(lcSql, lcCursor1)
		
		IF lnSucces < 0
			amessagebox(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		lcSql = [select id_operator, operator, traducere from ] + gcs + [.sal_operatori where functie = 0 order by id_operator]
		lcCursor2 = [CrsOperatori]
		lnSucces = goExecutor.oExecute(lcSql, lcCursor2)
		
		IF lnSucces < 0
			amessagebox(goExecutor.cEroare,0+16,"Eroare")
			RETURN
		ENDIF
		
		pcTata = this.cnumecoloana
		
		gnButon = 2
		poAdd = CREATEOBJECT('config_formula_nou')
		poAdd.show()
		
		IF gnButon = 1
			pnOrdine = oadd.ordine
			pnTip = 2 && UPDATE
			pnIdTata = this.nidcoloana 
			pnIdColOp = oadd.Id_Op_col
			pnFel = oadd.coloana
			pnIdCalcul = oadd.id_calcul
			
			lcCallProc = [{call pack_balante_cumulate.add_new_formula(?gcs,?pnOrdine, ?pnTip, ?pnIdTata, ?pnIdColOp, ?pnFel, ?pnIdCalcul)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		IF USED(lcCursor1) 
			USE IN (lcCursor1)
		ENDIF 
		IF USED(lcCursor2) 
			USE IN (lcCursor2)
		ENDIF 
		
		this.ct_grid_search3.actualizeaza_grid()
		this.ct_grid_search3._GRID1.AutoFit 
		this.calcul_formula
	ENDPROC

	PROCEDURE do_sterge_balanta
		lcSel = this.ct_grid_search1.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd
		 
		lnBut = amessagebox('Stergeti ' + ALLTRIM(oadd.explicatie) + ' ?',4+32,'Atentie')
		
		IF lnBut = 6
			pcListaConturi = ALLTRIM(oadd.explicatie2)
			pcExplicatie = ALLTRIM(oadd.explicatie)
			pnIdBal = oadd.id_coloana
			lcCallProc = [{call pack_balante_cumulate.add_new_balanta(?gcs,?pcListaConturi,'+',?pcExplicatie,3,?pnIdBal)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		this.ct_grid_search1.actualizeaza_grid()
		this.ct_grid_search1._GRID1.AutoFit 
		this.ct_grid_search1.SetFocus 
	ENDPROC

	PROCEDURE do_sterge_coloane
		lcSel = this.ct_grid_search2.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd
		 
		
		lnBut = amessagebox('Stergeti coloana ' + ALLTRIM(oadd.explicatie) + ' ?',4+32,'Atentie')
		
		IF lnBut = 6
			pcNumeColoana = ALLTRIM(oadd.explicatie)
			pnOrdine = oadd.ordine
			pnIdBal = oadd.id_coloana
			pnIdCol = oadd.id_op_col
			pnIdCalcul = oadd.id_calcul
		
			lcCallProc = [{call pack_balante_cumulate.add_new_coloana(?gcs,?pcNumeColoana,?pnOrdine,3,?pnIdBal,?pnIdCol,?pnIdCalcul)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		this.ct_grid_search2.actualizeaza_grid()
		this.ct_grid_search2._GRID1.AutoFit 
		this.ct_grid_search2.SetFocus 
	ENDPROC

	PROCEDURE do_sterge_formula
		lcSel = this.ct_grid_search3.cnumecursor 
		SELECT (lcSel)
		SCATTER NAME oadd
		
		lnBut = amessagebox('Stergeti formula ' + ALLTRIM(oadd.explicatie) + ' ?',4+32,'Atentie')
		
		IF lnBut = 6
			pnOrdine = oadd.ordine
			pnTip = 3 && DELETE
			pnIdTata = this.nidcoloana 
			pnIdColOp = oadd.Id_Op_col
			pnFel = oadd.coloana
			pnIdCalcul = oadd.id_calcul
			
			lcCallProc = [{call pack_balante_cumulate.add_new_formula(?gcs,?pnOrdine, ?pnTip, ?pnIdTata, ?pnIdColOp, ?pnFel, ?pnIdCalcul)}]
			lnSucces = goExecutor.oExecute(lcCallProc)
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
		ENDIF 
		
		this.ct_grid_search3.actualizeaza_grid()
		this.ct_grid_search3._GRID1.AutoFit 
		this.ct_grid_search3.SetFocus 
		this.calcul_formula
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		
		
		this.ct_grid_search1.initializare(.t.)
		
		lcSel = this.ct_grid_search1.cnumecursor 
		SELECT (lcSel)
		LOCATE
		pnIdBalanta = id_coloana
		this.nidbalanta = id_coloana
		this.cListaConturi = explicatie2
		this.cTiltluBalanta = explicatie
		this.ct_grid_search2.initializare(.t.)
		
		lcSel = this.ct_grid_search2.cnumecursor 
		SELECT (lcSel)
		LOCATE
		pnIdColoana = id_op_col
		this.nidcoloana = id_op_col
		this.cNumeColoana = explicatie
		this.ct_grid_search3.initializare(.t.)
		
		this.ct_grid_search1._GRID1.SetFocus 
		
		THIS.WindowState = 2
	ENDPROC

	PROCEDURE Ct_grid_search1.Resize
		*
	ENDPROC

	PROCEDURE Ct_grid_search1._GRID1.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT(nColIndex)
		pnIdBalanta = id_coloana
		thisform.nIdbalanta = id_coloana
		thisform.cListaConturi = explicatie2
		thisform.cTiltluBalanta = explicatie
		
		thisform.ct_grid_search2.actualizeaza_grid()
		thisform.ct_grid_search2._GRID1.AutoFit 
		lcSel = thisform.ct_grid_search2.cnumecursor 
		pnIdColoana = &lcSel..id_op_col
		thisform.nIdColoana = &lcSel..id_op_col
		thisform.cNumeColoana = &lcSel..explicatie
		
		thisform.ct_grid_search3.actualizeaza_grid()
		thisform.ct_grid_search3._GRID1.AutoFit 
		
		thisform.calcul_formula 
	ENDPROC

	PROCEDURE Ct_grid_search2._GRID1.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT(nColIndex)
		pnIdColoana = id_op_col
		thisform.nIdColoana = id_op_col
		thisform.cNumeColoana = explicatie
		
		thisform.ct_grid_search3.actualizeaza_grid()
		thisform.ct_grid_search3._GRID1.AutoFit 
		
		thisform.calcul_formula
	ENDPROC

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

ENDDEFINE

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

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

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

	*<PropValue>
		DoCreate = .T.
		Height = 125
		Name = "config_coloana_nou"
		nid = .F.
		orec = .F.
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Name = "_shape2"
		Lb_titlu_alb_b121.Caption = "-"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_RENUNT1.Name = "BUT_RENUNT1"
		BUT_RENUNT1.TabIndex = 4
	*</PropValue>

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 41, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 41, ;
		TEXT_SIMPLU1.ControlSource = "oadd.explicatie", ;
		TEXT_SIMPLU1.Format = "K", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		Lb_simplu1.Caption = "Denumire", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 41, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 71, ;
		TEXT_SIMPLU1.ControlSource = "oadd.ordine", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		Lb_simplu1.Caption = "Ordine", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />

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

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 189
		Name = "config_formula_nou"
		nid = .F.
		orec = .F.
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Name = "_shape2"
		Lb_titlu_alb_b121.Caption = "-"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		BUT_RENUNT1.Name = "BUT_RENUNT1"
		BUT_RENUNT1.TabIndex = 6
	*</PropValue>

	ADD OBJECT 'Cb_tx' AS cb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Cb_tx", ;
		TabIndex = 3, ;
		Top = 110, ;
		_cbbase1.ControlSource = "oadd.camp", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Check1' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Coloana", ;
		ControlSource = "oadd.coloana", ;
		Height = 17, ;
		Left = 42, ;
		Name = "Check1", ;
		TabIndex = 2, ;
		Top = 86, ;
		Width = 65
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 50, ;
		TEXT_SIMPLU1.ControlSource = "pcTata", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		Lb_simplu1.Caption = "Camp calculat:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 4, ;
		Top = 138, ;
		TEXT_SIMPLU1.ControlSource = "oadd.ordine", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		Lb_simplu1.Caption = "Ordine", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE Show
		LPARAMETERS nStyle
		IF oadd.coloana = 1
			thisform.cb_tx._cbbase1.RowSource = 'crsColoane.camp,explicatie'
			thisform.cb_tx._lbbase1.Caption = "COLOANA"
		ELSE 
			thisform.cb_tx._cbbase1.RowSource = 'CrsOperatori.traducere'
			thisform.cb_tx._lbbase1.Caption = "OPERATOR"
		ENDIF 
	ENDPROC

	PROCEDURE Cb_tx._cbbase1.LostFocus
		*!*	IF oadd.coloana = 1
		*!*	*!*		thisform.cb_tx._cbbase1.RowSource = 'v_colcalc.explicatie'
		*!*	*!*		thisform.cb_tx._lbbase1.Caption = "COLOANA"
		*!*		oadd.id_op_col = v_colcalc.id_coloana
		
		*!*	ELSE 
		*!*	*!*		thisform.cb_tx._cbbase1.RowSource = 'v_operatori.traducere'
		*!*	*!*		thisform.cb_tx._lbbase1.Caption = "OPERATOR"
		*!*		porec.id_op_Col = v_operatori.id_operator
		
		*!*	ENDIF 
		
		
	ENDPROC

	PROCEDURE Cb_tx._cbbase1.Valid
		IF oadd.coloana = 1
			oadd.id_op_col = crsColoane.id_coloana
		ELSE 
			oadd.id_op_col = crsOperatori.id_operator
		ENDIF 
	ENDPROC

	PROCEDURE Check1.InteractiveChange
		IF this.Value = 1
			thisform.cb_tx._cbbase1.RowSource = 'crsColoane.camp'
			thisform.cb_tx._lbbase1.Caption = "COLOANA"
		ELSE 
			thisform.cb_tx._cbbase1.RowSource = 'CrsOperatori.traducere'
			thisform.cb_tx._lbbase1.Caption = "OPERATOR"
		ENDIF 
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldPrec.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldPrec.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAvans.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAvans.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSold.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSold.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldFinal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldFinal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAvansPrec.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAvansPrec.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecdeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPreccred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPreccred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotAvans.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotAvans.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotdeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotcred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotcred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCod_fiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCod_fiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldPrecVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldPrecVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValDebit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValDebit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValCredit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValCredit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldFinalVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldFinalVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAcont2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAcont2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_part.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_part.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column24.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column24.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.csoldprec1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.csoldprec1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecdeb1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecdeb1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPreccred1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPreccred1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulanDeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulanDeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulAnCred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulAnCred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAdresa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAdresa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRegComert.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRegComert.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTelefon.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTelefon.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cEmail.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cEmail.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulanpdeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulanpdeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulanpCred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRulanpCred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cContBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cContBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSwiftBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSwiftBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAdresaBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAdresaBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCategorieEntitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCategorieEntitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdDebitor" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdLunaInitializare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="oContextMenu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="oMenuShortcut" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdfooter1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_totaluri
		*m: butapend
		*m: butdrept
		*m: corderby_assign
		*m: initializare
		*m: istavans
		*m: istcred
		*m: istdeb
		*m: istdebcred
		*m: lblocatrefacere_assign
		*m: listare_notificari
		*m: llunainitializare_assign
		*p: casc
		*p: centitate
		*p: cnewvalue
		*p: coldvalue
		*p: corder
		*p: cseparator
		*p: cvaluta
		*p: lafisaretot
		*p: lblocatrefacere
		*p: llunainitializare
		*p: lmodificare_totaluri		&& Dezactiveaza BeforeRowColChange cand se reactualizeaza totalurile.
		*p: lmodificata		&& Indica daca linia a fost modificata sau nu.
		*p: ncurs
		*p: nprec1avans
		*p: nprec1cred
		*p: nprec1deb
		*p: nprecavans
		*p: npreccred
		*p: nprecdeb
		*p: nsold1prec
		*p: nsoldprec
		*p: nsoldtot
		*p: ntavans
		*p: ntcred
		*p: ntdeb
		*p: ntipselectie		&& Variabila pentru tipul selectiei : toti (1), interni(2), externi(3).
		*p: ntotavans
		*p: ntotcred
		*p: ntotdeb
		*p: ntsold
		*p: pcacont
		*p: pccont
		*p: pcfel
		*p: pnidpart
		*p: reglat
		*p: tabel
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		casc = ASC
		cbuton2 = but_listare1;but_listare2
		centitate = BP
		cgridsortlist = grid1
		cnewvalue = 
		coldvalue = 
		corder = 
		cseparator = .
		cvaluta = 
		DoCreate = .T.
		Height = 508
		lafisaretot = .F.
		lblocatrefacere = .F.
		llunainitializare = .F.
		lmodificare_totaluri = .F.
		lmodificata = .F.
		Name = "frm_bal_parteneri"
		ncurs = 0
		nprec1avans = 0
		nprec1cred = 0
		nprec1deb = 0
		nprecavans = 0
		npreccred = 0
		nprecdeb = 0
		nsold1prec = 0
		nsoldprec = 0
		nsoldtot = 0
		ntavans = 0
		ntcred = 0
		ntdeb = 0
		ntipselectie = 1
		ntotavans = 0
		ntotcred = 0
		ntotdeb = 0
		ntsold = 0
		pcacont = .F.
		pccont = ''
		pcfel = ''
		pnidpart = .F.
		reglat = .F.
		tabel = ''
		Width = 910
		_memberdata = <VFPData>
			<memberdata name="lblocatrefacere" display="lBlocatRefacere"/>
			<memberdata name="lblocatrefacere_assign" display="lBlocatRefacere_Assign"/>
			<memberdata name="llunainitializare" display="lLunaInitializare"/>
			<memberdata name="llunainitializare_assign" display="lLunaInitializare_Assign"/>
			<memberdata name="centitate" display="cEntitate"/>
			<memberdata name="lafisaretot" display="lAfisareTot"/>
		</VFPData>
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 910
		_shape1.ZOrderSet = 3
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 612
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 178
		_shape2.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "SITUATII ANALITICE"
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = -1
		Lb_titlu_alb_b121.Width = 146
		Lb_titlu_alb_b121.ZOrderSet = 6
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 879
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 17
		Gridsort1.Left = 336
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 0
	*</PropValue>

	ADD OBJECT '_grdfooter1' AS _grdfooter WITH ;
		ccolwithlabel = cNume, ;
		csourcegrdalias = xtemp, ;
		csourcegrid = grid1, ;
		csumcolumns = csoldprec1,csoldprec,cdeb,ccred,csold,csoldfinal,cprecdeb1,cpreccred1,crulandeb,crulancred,crulanpdeb,crulanpcred,cprecdeb,cpreccred,ctotdeb,ctotcred,csoldfinalval,cvaldebit,cvalcredit, ;
		ctotallabelexpression = 'TOTAL', ;
		Left = 6, ;
		Name = "_grdfooter1", ;
		Top = 465, ;
		Width = 896
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'But_listare2' AS but_listare WITH ;
		Anchor = 9, ;
		Left = 849, ;
		Name = "But_listare2", ;
		ToolTipText = "Listare detaliata", ;
		Top = 1, ;
		ZOrderSet = 37
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = butapend, ;
		Left = 790, ;
		Name = "But_modifica1", ;
		Top = 1, ;
		ZOrderSet = 34
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		Left = 760, ;
		Name = "But_reface1", ;
		Top = 1, ;
		ZOrderSet = 38
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Left = 675, ;
		Name = "But_reset_criterii1", ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 704, ;
		Name = "But_start_criterii1", ;
		RightToLeft = .F., ;
		SpecialEffect = 1, ;
		Top = 1, ;
		Width = 31, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 8, ;
		Left = 732, ;
		Name = "But_verifica1", ;
		TabIndex = 14, ;
		ToolTipText = "Verificare coduri fiscale", ;
		Top = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdDebitor' AS commandbutton WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		Caption = "Istoric Debit/Credit", ;
		FontBold = .F., ;
		FontCharSet = 0, ;
		FontSize = 10, ;
		Height = 29, ;
		Left = 767, ;
		Name = "cmdDebitor", ;
		Top = 38, ;
		Width = 129, ;
		ZOrderSet = 40
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cmdLunaInitializare' AS cmd_executa WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		Caption = "Luna initializare!", ;
		ForeColor = 255,0,0, ;
		Left = 537, ;
		Name = "cmdLunaInitializare", ;
		ToolTipText = "Atentie, situatia contabila a fost initializata manual si nu se modifica in cazul refacerii/redeschiderii de luna! Click pentru schimbare optiune!", ;
		Top = 0, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grid1' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 41, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 393, ;
		Left = 6, ;
		Name = "grid1", ;
		Panel = 1, ;
		RowHeight = 20, ;
		Top = 72, ;
		Width = 896, ;
		ZOrderSet = 7, ;
		Column1.ColumnOrder = 3, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNume", ;
		Column1.Width = 171, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "acont", ;
		Column2.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.InputMask = "9999", ;
		Column2.Name = "cAcont", ;
		Column2.Width = 46, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "soldprec", ;
		Column3.DynamicBackColor = "RGB(236,249,255)", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.InputMask = (get_mask(12,gnPA)), ;
		Column3.Name = "cSoldPrec", ;
		Column3.Width = 100, ;
		Column4.ColumnOrder = 6, ;
		Column4.ControlSource = "", ;
		Column4.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.InputMask = (get_mask(12,gnPA)), ;
		Column4.Name = "cAvans", ;
		Column4.Width = 78, ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "deb", ;
		Column5.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.InputMask = (get_mask(12,gnPA)), ;
		Column5.Name = "cDeb", ;
		Column5.Width = 101, ;
		Column6.ColumnOrder = 8, ;
		Column6.ControlSource = "cred", ;
		Column6.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.InputMask = (get_mask(12,gnPA)), ;
		Column6.Name = "cCred", ;
		Column6.Width = 96, ;
		Column7.ColumnOrder = 9, ;
		Column7.ControlSource = "sold", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = (get_mask(12,gnPA)), ;
		Column7.Name = "cSold", ;
		Column7.Width = 130, ;
		Column8.ColumnOrder = 10, ;
		Column8.ControlSource = "totdeb-totcred", ;
		Column8.DynamicBackColor = "RGB(187,235,255)", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(12,gnPA)), ;
		Column8.Name = "cSoldFinal", ;
		Column8.Width = 79, ;
		Column9.ColumnOrder = 11, ;
		Column9.ControlSource = "", ;
		Column9.DynamicBackColor = "IIF(THIS.READONLY,RGB(236,249,255),RGB(252,255,183))", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.InputMask = (get_mask(12,gnPA)), ;
		Column9.Name = "cAvansPrec", ;
		Column10.ColumnOrder = 19, ;
		Column10.ControlSource = "precdeb", ;
		Column10.DynamicBackColor = "IIF(THIS.READONLY,RGB(236,249,255),RGB(252,255,183))", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Format = "r", ;
		Column10.InputMask = (get_mask(12,gnPA)), ;
		Column10.Name = "cPrecdeb", ;
		Column11.ColumnOrder = 20, ;
		Column11.ControlSource = "preccred", ;
		Column11.DynamicBackColor = "IIF(THIS.READONLY,RGB(236,249,255),RGB(252,255,183))", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Format = "r", ;
		Column11.InputMask = (get_mask(12,gnPA)), ;
		Column11.Name = "cPreccred", ;
		Column12.ColumnOrder = 21, ;
		Column12.ControlSource = "", ;
		Column12.DynamicBackColor = "RGB(187,235,255)", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Format = "r", ;
		Column12.InputMask = (get_mask(12,gnPA)), ;
		Column12.Name = "cTotAvans", ;
		Column13.ColumnOrder = 22, ;
		Column13.ControlSource = "totdeb", ;
		Column13.DynamicBackColor = "RGB(187,235,255)", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "r", ;
		Column13.InputMask = (get_mask(12,gnPA)), ;
		Column13.Name = "cTotdeb", ;
		Column14.ColumnOrder = 23, ;
		Column14.ControlSource = "totcred", ;
		Column14.DynamicBackColor = "RGB(187,235,255)", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "r", ;
		Column14.InputMask = (get_mask(12,gnPA)), ;
		Column14.Name = "cTotcred", ;
		Column15.ColumnOrder = 31, ;
		Column15.ControlSource = "cod_fiscal", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Format = "!", ;
		Column15.Name = "cCod_fiscal", ;
		Column15.Width = 59, ;
		Column16.ControlSource = "nume_val", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cNume_val", ;
		Column16.Visible = .F., ;
		Column17.ColumnOrder = 24, ;
		Column17.ControlSource = "soldprecval", ;
		Column17.DynamicBackColor = "RGB(236,249,255)", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.InputMask = (get_mask(12,gnPval)), ;
		Column17.Name = "cSoldPrecVal", ;
		Column17.Width = 84, ;
		Column18.ColumnOrder = 25, ;
		Column18.ControlSource = "valdebit", ;
		Column18.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.InputMask = (get_mask(12,gnPval)), ;
		Column18.Name = "cValDebit", ;
		Column19.ColumnOrder = 26, ;
		Column19.ControlSource = "valcredit", ;
		Column19.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.InputMask = (get_mask(12,gnPval)), ;
		Column19.Name = "cValCredit", ;
		Column20.ColumnOrder = 27, ;
		Column20.ControlSource = "soldfinalval", ;
		Column20.DynamicBackColor = "RGB(187,235,255)", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.InputMask = (get_mask(12,gnPval)), ;
		Column20.Name = "cSoldFinalVal", ;
		Column20.Width = 89, ;
		Column21.ColumnOrder = 29, ;
		Column21.ControlSource = "acont", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.InputMask = "9999", ;
		Column21.Name = "cAcont2", ;
		Column21.Width = 34, ;
		Column22.ColumnOrder = 30, ;
		Column22.ControlSource = "nume", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cNume2", ;
		Column22.Width = 176, ;
		Column23.ColumnOrder = 32, ;
		Column23.ControlSource = "id_part", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cId_part", ;
		Column23.Width = 68, ;
		Column24.ColumnOrder = 1, ;
		Column24.ControlSource = "cont", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "Column24", ;
		Column24.Width = 39, ;
		Column25.ColumnOrder = 28, ;
		Column25.ControlSource = "sucursala", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cSucursala", ;
		Column25.Width = 155, ;
		Column26.ColumnOrder = 4, ;
		Column26.ControlSource = "soldprec1", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.InputMask = (get_mask(12,gnPA)), ;
		Column26.Name = "csoldprec1", ;
		Column26.Width = 103, ;
		Column27.ColumnOrder = 12, ;
		Column27.ControlSource = "precdeb1", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.InputMask = (get_mask(12,gnPA)), ;
		Column27.Name = "cPrecdeb1", ;
		Column27.Width = 98, ;
		Column28.ColumnOrder = 13, ;
		Column28.ControlSource = "preccred1", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.InputMask = (get_mask(12,gnPA)), ;
		Column28.Name = "cPreccred1", ;
		Column28.Width = 102, ;
		Column29.ColumnOrder = 17, ;
		Column29.ControlSource = "rulandeb", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.InputMask = (get_mask(12,gnPA)), ;
		Column29.Name = "cRulanDeb", ;
		Column29.Width = 108, ;
		Column30.ColumnOrder = 18, ;
		Column30.ControlSource = "rulancred", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.InputMask = (get_mask(12,gnPA)), ;
		Column30.Name = "cRulAnCred", ;
		Column30.Width = 115, ;
		Column31.ColumnOrder = 34, ;
		Column31.ControlSource = "adresa", ;
		Column31.FontName = "Arial", ;
		Column31.FontSize = 10, ;
		Column31.Name = "cAdresa", ;
		Column31.Width = 160, ;
		Column32.ColumnOrder = 33, ;
		Column32.ControlSource = "reg_comert", ;
		Column32.FontName = "Arial", ;
		Column32.FontSize = 10, ;
		Column32.Name = "cRegComert", ;
		Column32.ReadOnly = .T., ;
		Column33.ColumnOrder = 35, ;
		Column33.ControlSource = "telefon", ;
		Column33.FontName = "Arial", ;
		Column33.FontSize = 10, ;
		Column33.Name = "cTelefon", ;
		Column33.ReadOnly = .T., ;
		Column33.Width = 81, ;
		Column34.ColumnOrder = 36, ;
		Column34.ControlSource = "email", ;
		Column34.FontName = "Arial", ;
		Column34.FontSize = 10, ;
		Column34.Name = "cEmail", ;
		Column34.ReadOnly = .T., ;
		Column34.Width = 135, ;
		Column35.ColumnOrder = 14, ;
		Column35.ControlSource = "rulanpdeb", ;
		Column35.FontName = "Arial", ;
		Column35.FontSize = 10, ;
		Column35.Format = "RK", ;
		Column35.InputMask = (get_mask(12,gnPA)), ;
		Column35.Name = "cRulanpdeb", ;
		Column35.Width = 127, ;
		Column36.ColumnOrder = 15, ;
		Column36.ControlSource = "rulanpcred", ;
		Column36.FontName = "Arial", ;
		Column36.FontSize = 10, ;
		Column36.Format = "RK", ;
		Column36.InputMask = (get_mask(12,gnPA)), ;
		Column36.Name = "cRulanpCred", ;
		Column36.Width = 130, ;
		Column37.ControlSource = "cont_banca", ;
		Column37.FontName = "Arial", ;
		Column37.FontSize = 10, ;
		Column37.Name = "cContBanca", ;
		Column37.ReadOnly = .T., ;
		Column37.Width = 234, ;
		Column38.ControlSource = "swift_banca", ;
		Column38.FontName = "Arial", ;
		Column38.FontSize = 10, ;
		Column38.Name = "cSwiftBanca", ;
		Column38.ReadOnly = .T., ;
		Column38.Width = 105, ;
		Column39.ControlSource = "banca", ;
		Column39.FontName = "Arial", ;
		Column39.FontSize = 10, ;
		Column39.Name = "cBanca", ;
		Column39.ReadOnly = .T., ;
		Column39.Width = 191, ;
		Column40.ControlSource = "adresa_banca", ;
		Column40.FontName = "Arial", ;
		Column40.FontSize = 10, ;
		Column40.Name = "cAdresaBanca", ;
		Column40.ReadOnly = .T., ;
		Column40.Width = 160, ;
		Column41.ControlSource = "categorie_entitate", ;
		Column41.Name = "cCategorieEntitate", ;
		Column41.ReadOnly = .T., ;
		Column41.Width = 114
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

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

	ADD OBJECT 'grid1.cAdresa.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 'grid1.cAdresaBanca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Adresa banca", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grid1.cAvansPrec.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 'grid1.cBanca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Banca", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cCategorieEntitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Categorie ent.", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grid1.cCod_fiscal.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 'grid1.cContBanca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "IBAN", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cCred.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Credit(Incasat)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cCred.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 'grid1.cDeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Debit(Facturat)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

	ADD OBJECT 'grid1.cNume_val.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, ;
		Visible = .F.
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grid1.cPreccred.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 'grid1.cPreccred1.Header1' AS header WITH ;
		Caption = "Prec. Cred. 1 ian", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cPrecdeb.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 'grid1.cPrecdeb1.Header1' AS header WITH ;
		Caption = "Prec. Deb. 1 ian", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cRegComert.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 'grid1.cRulAnCred.Header1' AS header WITH ;
		Caption = "Rulaj anual creditor", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cRulAnCred.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 'grid1.cRulanDeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rulaj anual debitor", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cRulanDeb.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 'grid1.cRulanpCred.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rulaj anual prec. credit", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cRulanpCred.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cRulanpdeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rulaj anual prec. debit", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cRulanpdeb.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cSold.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold(deb-cred-avans)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cSoldFinal.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 'grid1.cSoldFinalVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Final Val.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cSoldPrec.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 'grid1.csoldprec1.Header1' AS header WITH ;
		Caption = "Sold la 1 ianuarie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.csoldprec1.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 'grid1.cSoldPrecVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Prec Val", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cSucursala.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 'grid1.cSwiftBanca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "SWIFT", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

	ADD OBJECT 'grid1.cValDebit.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 'Gridextra1' AS gridextra WITH ;
		Left = 240, ;
		Name = "Gridextra1", ;
		Top = 0
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Lb_shortcuts1' AS lb_shortcuts WITH ;
		Caption = "CTRL+F = Terminare; ESC = Renuntare; CTRL+Q = Cautare; CTRL+T = Resetare", ;
		Left = 6, ;
		Name = "Lb_shortcuts1", ;
		Top = 15
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'oContextMenu' AS ctl32_contextmenu WITH ;
		Height = 21, ;
		Left = 444, ;
		Name = "oContextMenu", ;
		TabIndex = 3, ;
		Top = 12, ;
		Width = 64, ;
		lblname.Name = "lblname"
		*< END OBJECT: ClassLib="..\utile\ctl32\ctl32_contextmenu.vcx" BaseClass="container" />

	ADD OBJECT 'oMenuShortcut' AS menulib WITH ;
		Left = 378, ;
		Name = "oMenuShortcut", ;
		Top = 5, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="utility.vcx" BaseClass="container" />

	ADD OBJECT 'Optiongroup1' AS optiongroup WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 3, ;
		Height = 27, ;
		Left = 588, ;
		Name = "Optiongroup1", ;
		Top = 39, ;
		Value = 1, ;
		Width = 172, ;
		ZOrderSet = 16, ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Toti", ;
		Option1.FontCharSet = 0, ;
		Option1.FontName = "Segoe UI", ;
		Option1.FontSize = 10, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 61, ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Interni", ;
		Option2.FontCharSet = 0, ;
		Option2.FontName = "Segoe UI", ;
		Option2.FontSize = 10, ;
		Option2.Height = 17, ;
		Option2.Left = 48, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option2.Value = 0, ;
		Option2.Width = 61, ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Externi", ;
		Option3.FontCharSet = 0, ;
		Option3.FontName = "Segoe UI", ;
		Option3.FontSize = 10, ;
		Option3.Height = 17, ;
		Option3.Left = 106, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5, ;
		Option3.Value = 0, ;
		Option3.Width = 61
		*< END OBJECT: BaseClass="optiongroup" />
	
	PROCEDURE Activate
		*!*	thisform.WindowState=2
		
		*!*	tw1=thisform.Width
		*!*	tl1=thisform.Height
		
		*!*	tw2=thisform.Width
		*!*	tl2=thisform.Height
		
		*!*	gw1=thisform.grid1.width
		*!*	gl1=thisform.grid1.height
		
		*!*	thisform.grid1.width=ROUND(gw1*tw2/tw1,0)
		*!*	thisform.grid1.height=ROUND(gl1*tl2/tl1,0)
		
		*!*	lnlung1=thisform._shape1.width
		*!*	thisform._shape1.Width=ROUND(lnlung1*tw2/tw1,0)
		*!*	lndif=thisform._shape1.Width-lnlung1
		*!*	thisform._shape2.Left=thisform._shape2.Left+lndif
		*!*	**
		
		*!*	thisform.paint
		*!*	thisform.refresh
		
		*!*	set safety off
		*!*	SELE xtemp
		
		
		
	ENDPROC

	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		c = Thisform.pcfel
		save_grid_tag(Thisform.gRID1)
		Do Case
			Case Thisform.ntipselectie = 1
				If Empty(lcFiltru)
					lcFiltru = pobalparttot.ca_baza1.cfiltru
				Endif
				Use In xtemp
				pobalparttot.ca_baza1.cfiltru = lcFiltru
				pobalparttot.ca_baza1.afisare()
				With Thisform.gRID1
					.cSoldPrecVal.Visible = .F.
					.cValDebit.Visible = .F.
					.cValCredit.Visible = .F.
					.cSoldFinalVal.Visible = .F.
					.cNume_Val.Visible = .F.
					If Thisform.pcfel = 'A'
						.cSold.ControlSource = '- cred + deb'
						.cSoldFinal.ControlSource = '- totcred + totdeb'
						.cSoldPrec.ControlSource = '- preccred + precdeb'
						.cSoldPrec1.ControlSource = '- preccred1 + precdeb1'
						.cSold.header1.Caption = 'Sold (deb-cred)'
						.cDeb.header1.Caption = 'Debit'
						.cCred.header1.Caption = 'Credit'
					Else
						.cSold.ControlSource = 'cred - deb'
						.cSoldFinal.ControlSource = 'totcred - totdeb'
						.cSoldPrec.ControlSource = 'preccred -precdeb'
						.cSoldPrec1.ControlSource = 'preccred1 -precdeb1'
						.cSold.header1.Caption = 'Sold (cred-deb)'
						.cDeb.header1.Caption = 'Debit'
						.cCred.header1.Caption = 'Credit'
					Endif
				Endwith
			Case Thisform.ntipselectie = 2
				If Empty(lcFiltru)
					lcFiltru = pobalpartext.ca_baza1.cfiltru
				Endif
				Use In xtemp
				pobalpartext.ca_baza1.cfiltru = lcFiltru
				pobalpartext.ca_baza1.afisare()
				With Thisform.gRID1
					.cSoldPrecVal.Visible = .F.
					.cValDebit.Visible = .F.
					.cValCredit.Visible = .F.
					.cSoldFinalVal.Visible = .F.
					.cNume_Val.Visible = .F.
					If Thisform.pcfel = 'A'
						.cSold.ControlSource = '- cred + deb'
						.cSoldFinal.ControlSource = '- totcred + totdeb'
						.cSoldPrec.ControlSource = '- preccred + precdeb'
						.cSoldPrec1.ControlSource = '- preccred1 + precdeb1'
						.cSold.header1.Caption = 'Sold (deb-cred)'
						.cDeb.header1.Caption = 'Debit'
						.cCred.header1.Caption = 'Credit'
					Else
						.cSold.ControlSource = 'cred - deb'
						.cSoldFinal.ControlSource = 'totcred - totdeb'
						.cSoldPrec.ControlSource = 'preccred -precdeb'
						.cSoldPrec1.ControlSource = 'preccred1 -precdeb1'
						.cSold.header1.Caption = 'Sold (cred-deb)'
						.cDeb.header1.Caption = 'Debit'
						.cCred.header1.Caption = 'Credit'
					Endif
				Endwith
			Case Thisform.ntipselectie = 3
				Local llCautareNoua
				llCautareNoua = .T.
				If Empty(lcFiltru)
					lcFiltru = pobalpartext.ca_baza1.cfiltru
					llCautareNoua = .F.
				Endif
				Use In xtemp
				pobalpartext.ca_baza1.cfiltru = lcFiltru
				pobalpartext.ca_baza1.afisare()
				With Thisform.gRID1
					.cSoldPrecVal.Visible = .T.
					.cValDebit.Visible = .T.
					.cValCredit.Visible = .T.
					.cSoldFinalVal.Visible = .T.
					.cNume_Val.Visible = .T.
					If Thisform.pcfel = 'A'
						.cSold.ControlSource = '- valcredit + valdebit'
						.cSoldFinal.ControlSource = '- totvalcred + totvaldeb'
						.cSoldPrec.ControlSource = '- precvalcred + precvaldeb'
						.cSoldPrec1.ControlSource = '- precvalcred1 + precvaldeb1'
						.cSold.header1.Caption = 'Sold (deb-cred)'
						.cDeb.header1.Caption = 'Debit'
						.cCred.header1.Caption = 'Credit'
					Else
						.cSold.ControlSource = 'valcredit - valdebit'
						.cSoldFinal.ControlSource = 'totvalcred - totvaldeb'
						.cSoldPrec.ControlSource = 'precvalcred -precvaldeb'
						.cSoldPrec1.ControlSource = 'precvalcred1 -precvaldeb1'
						.cSold.header1.Caption = 'Sold (cred-deb)'
						.cDeb.header1.Caption = 'Debit'
						.cCred.header1.Caption = 'Credit'
					Endif
				Endwith
		Endcase
		If !Empty(Thisform.ncurs)
			Select xtemp
			Repl All precdeb1 With Round(precdeb1/Thisform.ncurs,gnPval) && pt. evaluarea in valuta
			Repl All preccred1 With Round(preccred1/Thisform.ncurs,gnPval)
			Repl All precdeb With Round(precdeb/Thisform.ncurs,gnPval) && pt. evaluarea in valuta
			Repl All preccred With Round(preccred/Thisform.ncurs,gnPval)
			Repl All cred With Round(cred/Thisform.ncurs,gnPval)
			Repl All deb With Round(deb/Thisform.ncurs,gnPval)
			Repl All totdeb With Round(totdeb/Thisform.ncurs,gnPval)
			Repl All totcred With Round(totcred/Thisform.ncurs,gnPval)
		Endif
		restore_grid_tag(Thisform.gRID1)
		
		*!*	Do Case
		*!*		Case Thisform.ntipselectie=3
		*!*			Thisform.label3.Caption='Total valuta'
		*!*			*	Thisform.label7.Caption='Avans valuta'
		*!*			Thisform.label4.Caption='Debit valuta'
		*!*			Thisform.label5.Caption='Credit valuta'
		*!*			Thisform.label6.Caption='Sold valuta'
		*!*			Thisform.cb_nom_valute1.Visible=.T.
		*!*			Thisform.cb_nom_valute1.initializare(llCautareNoua)
		*!*		Otherwise
		*!*			Thisform.cb_nom_valute1.Visible=.F.
		*!*			Thisform.label3.Caption='Total'
		*!*			*	Thisform.label7.Caption='Avans'
		*!*			Thisform.label4.Caption='Debit'
		*!*			Thisform.label5.Caption='Credit'
		*!*			Thisform.label6.Caption='Sold'
		*!*	Endcase
		
		Thisform.actualizeaza_totaluri()
		Sele xtemp
		Go Top
		Thisform.gRID1.SetFocus
		
	ENDPROC

	PROCEDURE actualizeaza_totaluri
		Local lcValuta,lnPoz
		*!*	lcValuta=Alltrim(Thisform.cb_nom_valute1.Value)
		Select xtemp
		lnPoz=Iif(Reccount('xtemp')>0,Recno(),0)
		c=thisform.pcfel
		
		If Type('XTEMP.AVANS') # 'U'
			Sum avans,precavans,totavans To Thisform.ntavans,Thisform.nprecavans,Thisform.ntotavans
		Endif
		
		*!*	If Thisform.ntipselectie=3
		*!*		Sum valdebit,valcredit,precvaldeb,precvalcred,totvaldeb,totvalcred,precdeb1,preccred1 To ;
		*!*			Thisform.ntdeb,Thisform.ntcred,Thisform.nprecdeb,Thisform.npreccred,Thisform.ntotdeb,Thisform.ntotcred,;
		*!*			thisform.nprec1deb, thisform.nprec1cred For nume_val=lcValuta
		*!*	Else
		*!*		Sum deb,cred,precdeb,preccred,totdeb,totcred,precdeb1,preccred1 To ;
		*!*			Thisform.ntdeb,Thisform.ntcred,Thisform.nprecdeb,Thisform.npreccred,Thisform.ntotdeb,Thisform.ntotcred,;
		*!*			thisform.nprec1deb, thisform.nprec1cred
		*!*	Endif
		
		*!*	If c='A'	&&clienti
		*!*		Thisform.nSOLD1PREC=Thisform.nprec1deb-Thisform.nprec1cred
		*!*		Thisform.nSOLDPREC=Thisform.nprecdeb-Thisform.npreccred-Thisform.nprecavans
		*!*		Thisform.nSOLDTOT=Thisform.ntotdeb-Thisform.ntotcred-Thisform.ntotavans
		*!*		Thisform.ntsold=Thisform.ntdeb-Thisform.ntcred-Thisform.ntavans
		*!*	Else		&&furnizori
		*!*		Thisform.nSOLD1PREC=-Thisform.nprec1deb+Thisform.nprec1cred
		*!*		Thisform.nSOLDPREC=-Thisform.nprecdeb+Thisform.npreccred-Thisform.nprecavans
		*!*		Thisform.nSOLDTOT=-Thisform.ntotdeb+Thisform.ntotcred-Thisform.ntotavans
		*!*		Thisform.ntsold=-Thisform.ntdeb+Thisform.ntcred-Thisform.ntavans
		*!*	Endif
		
		* Am sters totalurile textbox
		*!*	Thisform.text1.Refresh
		*!*	Thisform.text2.Refresh
		*!*	Thisform.text3.Refresh
		*!*	Thisform.text4.Refresh
		*!*	Thisform.text5.Refresh
		*!*	Thisform.text6.Refresh
		*!*	Thisform.text7.Refresh
		*!*	Thisform.text8.Refresh
		*!*	Thisform.text9.Refresh
		*!*	Thisform.text10.Refresh
		*!*	Thisform.text11.Refresh
		*!*	Thisform.text12.Refresh
		*!*	Thisform.text13.Refresh
		*!*	Thisform.text14.Refresh
		*!*	Thisform.text15.Refresh
		Thisform._grdfooter1.calcTotal()
		If Reccount('xtemp')>0
			Select xtemp
			Go lnPoz
		Endif
	ENDPROC

	PROCEDURE butapend
		IF glLunaInchisa
			RETURN
		ENDIF
		
		
		IF THISFORM.lactiv3
			PRIVATE lcText,lcFis,lnOpt
			lcFis = UPPER(ALLTRIM(THISFORM.tabel))
			IF THISFORM.ntipselectie = 1
				aMessagebox("Nu puteti face initializari decat in selectiile pe interni sau externi!",0+48,"Atentie")
				RETURN
			ENDIF
		
			IF THISFORM.grid1.READONLY
				lcText=[\<Deblocare;]
				lcText=lcText+[\-;]
				lcText=lcText+[\Adauga Blanc;]
				lcText=lcText+[\Sterge]
			ELSE
				IF THISFORM.lmodificata
					THISFORM.do_modifica()
				ENDIF
				lcText=[\<Revenire;]
				lcText=lcText+[\-;]
				lcText=lcText+[\<Adauga Blanc;]
				lcText=lcText+[\<Sterge]
			ENDIF
		
			lnOptiune = xmenu(lcText)
			
			if m.lnOptiune = 1 and !this.lLunainitializare and amessagebox('Doriti sa marcati luna ' + padl(m.gnLuna, 2, '0') + '/' + alltrim(str(gnAn)) + ' pentru initializare?' + chr(13) + chr(10) + ;
					'Atentie! Situatia contabila curenta NU va mai fi suprascrisa (refacuta) la Redeschidere de luna sau Refaceri!', 4+32, _screen.Caption) = 6
					This.lLunaInitializare = IsCalendarInit('SET', thisform.cEntitate, Thisform.pccont) && oparteneri.prg
			endif 		
		
			
			DO CASE
				CASE lnOptiune=1
					THISFORM.initializare()
				CASE lnOptiune=3
					THISFORM.do_adauga()
				CASE lnOptiune=4
					THISFORM.do_sterge()
			ENDCASE
		ENDIF
		
	ENDPROC

	PROCEDURE butdrept
		If Thisform.grid1.ReadOnly=.T.
			Local laMenu[3]
			***************** decomentate 13.12
		*!*		Local c,N,N1,d
		*!*		c=Thisform.lb_titlu_alb_b121.Caption
		*!*		N='SITUATIA ANALITICA - CLIENTI'
		*!*		N1='SITUATIA ANALITICA - FURNIZORI'
			***********************************
			Scatter Memvar
			laMenu=""
			laMenu[1]="Istoric \<Debit"
			laMenu[2]="Istoric \<Credit"
			laMenu[3]="\<Istoric Deb&Cred"
		
			Thisform.oMenuShortcut.ShowMenu(@laMenu)
		
			Do Case
		*CASE BAR()=1
		*	thisform.fisacont
			Case Bar()=1
				Thisform.istdeb
			Case Bar()=2
				Thisform.istcred
			Case Bar()=3
				Thisform.istDEBcred
		*!*		Case Bar()=4
		*!*			Thisform.istavans
		
			Endcase
		Endif
	ENDPROC

	PROCEDURE corderby_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		
		IF THIS.corder = m.vNewVal
			lcASC = IIF(this.casc = 'ASC','DESC','ASC')
		ELSE
			lcASC = 'ASC'
		ENDIF 
		
		THIS.cOrder = m.vNewVal
		this.cAsc = lcAsc
		INDEX ON &vNewVal TAG nume OF &gcTempPath\xindex.idx COMPACT &lcAsc
	ENDPROC

	PROCEDURE do_adauga
		LOCAL lnid_part,lcnume,lccod_fiscal,lcacont,lnid_valuta,lcnume_val, lcCont, loCont, loCauta, lnIdSucursala, lcSucursala
		LOCAL lcTitlu,lcSql,lnSucces,locauta
		LOCAL llToateIreg, llNou, llBlank
		STORE .F. TO llToateIreg, llNou, llBlank
		
		STORE "" TO locauta
		
		lcCont = ALLTRIM(THISFORM.pcCont)
		
		IF [,]$THISFORM.pcCont
			loCont = Caut_cont()
			lcCont = ALLTRIM(loCont.CONT)
		ENDIF
		
		STORE "" TO locauta
		lnIdSucursala = NULL
		lcSucursala = ''
		IF glEMama
			llToateIreg = .F.
			llNou = .F.
			llBlank = .T.
			loCauta = caut_sucursala(llToateIreg, llNou, llBlank)
			lnIdSucursala = loCauta.id_sucursala
			lcSucursala = loCauta.sucursala
		ELSE 
			lnIdSucursala = gnIdSucursala && pentru o sucursala este id-ul firmei, iar pe firma independenta este null	
		ENDIF 
		
		STORE "" TO locauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti partenerul ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont))
		IF !EMPTY(locauta.nume)
			lnid_part=locauta.id_part
			lcnume=ALLTRIM(locauta.nume)
			lccod_fiscal=ALLTRIM(locauta.cod_fiscal)
		ELSE
			RETURN
		ENDIF
		
		STORE "" TO locauta
		locauta = caut_acont(lcCont)
		IF gnButon=2
			RETURN
		ENDIF
		IF !EMPTY(locauta.acont)
			lcacont=ALLTRIM(locauta.acont)
		ELSE
			lcacont=""
		ENDIF
		
		IF THISFORM.ntipselectie=3
			STORE "" TO locauta
			STORE "" TO locauta
			locauta = caut_valuta()
			IF EMPTY(locauta.nume_val)
				RETURN
			ENDIF
			lnid_valuta=locauta.id_valuta
			lcnume_val=ALLTRIM(locauta.nume_val)
		ELSE
		*!* 17.10.2006
		*!* marius.mutu
			loCauta = GetMonedaNationala()
			lnid_valuta = loCauta.id_valuta
			lcnume_val = ALLTRIM(locauta.nume_val)
		ENDIF
		
		SELECT xtemp
		LOCATE FOR id_part=lnid_part AND ALLTRIM(cont) = lcCont AND ALLTRIM(acont) = lcacont AND id_valuta=lnid_valuta AND NVL(id_sucursala,0) = NVL(lnIdSucursala,0)
		IF !FOUND()
			APPEND BLANK
			REPLACE CONT WITH ALLTRIM(lcCont)
			REPLACE acont WITH lcacont
			REPLACE an WITH gnAn
			&&	luna este 0 pentru a deosebi liniile noi de cele modificate
			REPLACE luna WITH 0
			REPLACE id_part WITH lnid_part
			REPLACE cod_fiscal WITH lccod_fiscal
			REPLACE nume WITH lcnume
			REPLACE id_valuta WITH lnid_valuta
			REPLACE nume_val WITH lcnume_val
			REPLACE id_sucursala WITH lnIdSucursala, sucursala WITH lcSucursala
			THISFORM.lmodificata=.T.
		ENDIF
		THISFORM.grid1.SETFOCUS()
		
		
		
	ENDPROC

	PROCEDURE do_cauta
		Local tnume,tfdoc,TBER,lcFiltru,lcAvans,lcTotAvans,lnPoz
		Store '.t.' To tnume,tfdoc,TBER
		lcFiltru=""
		C=Thisform.pcfel
		lcTitlu=Thisform.lb_titlu_alb_b121.Caption
		lnPoz=Rat('*',lcTitlu,1)-2
		
		Do Case
			Case Thisform.optiongroup1.Value=1
				Thisform.lb_titlu_alb_b121.Caption=Substr(lcTitlu,1,Iif(lnPoz<0,Len(lcTitlu),lnPoz))+" * TOTI"
			Case Thisform.optiongroup1.Value=2
				Thisform.lb_titlu_alb_b121.Caption=Substr(lcTitlu,1,Iif(lnPoz<0,Len(lcTitlu),lnPoz))+" * INTERNI"
				*!* 17.10.2006
				*!* marius.mutu
				lcFiltru = lcFiltru + [ AND (ID_VALUTA=0 OR MONEDA_NATIONALA = 1)]
			Case Thisform.optiongroup1.Value=3
				Thisform.lb_titlu_alb_b121.Caption=Substr(lcTitlu,1,Iif(lnPoz<0,Len(lcTitlu),lnPoz))+" * EXTERNI"
				lcFiltru = lcFiltru + [ AND MONEDA_NATIONALA = 0]
				*!*	lcFiltru = lcFiltru + [ AND ID_VALUTA!=0]
				*!*		If Thisform.ck_numeval.Value=1
				*!*			lcFiltru = lcFiltru + Thisform.ck_numeval.filtru
				*!*		Endif
		Endcase
		
		*!*	If this.check4.Value = 1
		*!*		lcFiltru=lcFiltru + [ AND UPPER(SUBSTR(nume,1,]+Alltrim(Str(Len(m.nume)))+[))=']+Alltrim(m.nume)+[']
		*!*		tnume="UPPER(LEFT(nume,LEN(M.nume)))==M.nume"
		*!*	Endif
		
		*!*	If This.ck_nume.Value = 1
		*!*		lcFiltru = lcFiltru + Thisform.ck_nume.filtru
		*!*	Endif
		
		*!*	If This.ck_acont.Value = 1
		*!*		lcFiltru = lcFiltru + Thisform.ck_acont.filtru
		*!*	ENDIF
		
		*!*	If This.ck_cont.Value = 1
		*!*		lcFiltru = lcFiltru + Thisform.ck_cont.filtru
		*!*	Endif
		
		If Type('XTEMP.AVANS') # 'U'
			lcAvans=[+avans]
			lcTotAvans=[+Totavans]
		Else
			lcAvans=[]
			lcTotAvans=[]
		Endif
		
		*!*	If This.check1.Value = 1
		*!*		Do Case
		*!*		Case C='A'
		*!*			lcFiltru=lcFiltru + [ AND (ABS(debit-credit]+lcAvans+[)>0 or ABS(PRECDEB+DEBIT-PRECCRED-CREDIT]+lcTotAvans+[)>0)]
		*!*	*!*			tfdoc='(abs(deb-cred+avans)>0 OR abs(TOTdeb-TOTcred+TOTavans)>0)'
		*!*		Case C='P'
		*!*			lcFiltru=lcFiltru + [ AND (ABS(-debit+credit]+lcAvans+[)>0 or ABS(-PRECDEB-DEBIT+PRECCRED+CREDIT]+lcTotAvans+[)>0)]
		*!*	*!*			tfdoc='(abs(-deb+cred+avans)>0 OR abs(-TOTdeb+TOTcred+TOTavans)>0)'
		*!*		Endcase
		*!*	Endif
		
		*!*	Sele xtemp
		If Len(Thisform.filtru_pretty)>0
			filtrutext=Thisform.filtru_pretty
			If At("AND",filtrutext)=1
				filtrutext=Right(filtrutext,Len(filtrutext)-4)
			Endif
		
			lcFiltru=lcFiltru+" and ("+Alltrim(filtrutext)+")"
		Endif
		Do Case
			Case C='P'
				lcFiltru=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnan))+[ and CONT in (']+Alltrim(Strtran(Thisform.pccont, [,], [','])) + [') ] + lcFiltru
			Case C='A'
				lcFiltru=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnan))+[ and CONT in (']+Alltrim(Strtran(Thisform.pccont, [,], [','])) + [') ] + lcFiltru
			Otherwise
				lcFiltru=[luna=]+Alltrim(Str(gnLuna))+[ and an=]+Alltrim(Str(gnan))+[ and SUBSTR(cont,1,4)=']+Left(cn,4)+[']+lcFiltru
		Endcase
		
		Thisform.nTipSelectie = Thisform.optiongroup1.Value
		
		If (This.filtru_pretty#"none")
			Thisform.actualizeaza_grid1(lcFiltru)
			If Reccount('xtemp')=0
				amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Endif
		ENDIF
		Thisform.but_start_criterii1.SetFocus()
		
		
	ENDPROC

	PROCEDURE do_excel
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		lcAlias = this.grid1.RecordSource 
		lcFiltru = FILTER(lcAlias)
		IF EMPTY(lcFiltru)
			lcFiltru = '.T.'
		ENDIF 
		
		exista_excel=.T.
		lcColumnList = ''
		lcHeaderList = ''
		lcSelect = ''
		llSelect = .T.
		lcType = 'CURSOR'
		lcFrom = lcAlias
		lcWhere = lcFiltru
		lcOrder = 'nume'
		lcOutput = 'crsBalPart'
		
		get_schema_grid(this.grid1,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
		&lcSelect
		IF USED(lcOutput)
			DO export_xls WITH lcOutput IN oproceduri_comune.prg
			USE IN (lcOutput)
		ENDIF 
		
		
		RETURN 
		
		*!*	Local i,xlsheet,XLApp,tmpsheet
		*!*	exista_excel=.T.
		*!*	p1=''
		*!*	p2=''
		*!*	With Thisform.grid1
		*!*		For nCol=1 To .ColumnCount
		*!*			nColumn=.Columns(nCol).ColumnOrder
		*!*			p1=p1+.Columns(nCol).ControlSource+','
		*!*			p2=p2+Strtran(.Columns(nCol).header1.Caption,Chr(32),'_')+','
		*!*		Endfor
		*!*		p1=Substr(p1,1,Len(p1)-1)
		*!*		p2=Substr(p2,1,Len(p2)-1)
		*!*	Endwith
		*!*	On Error Do exportare With thisform.grID1.recordsource,p1,p2
		*!*	tmpsheet = Getobject('','excel.sheet')
		*!*	On Error
		
		*!*	If exista_excel
		*!*		Wait Window "Se transmit datele catre Excel..." Nowait
		
		*!*		XLApp = tmpsheet.Application
		
		*!*		XLApp.workbooks.Close()
		*!*		XLApp.workbooks.Add()
		*!*		poExcel = XLApp.ActiveSheet
		
		
		*!*		Go Top
		*!*		poExcel.Cells(1,1).Font.Size=16
		*!*		poExcel.Cells(1,1).Font.Bold=.T.
		*!*		poExcel.Cells(1,1)=Thisform.lb_titlu_alb_b121.Caption+" Luna "+Alltrim(Str(gnLuna))+"/"+Alltrim(Str(gnAn))
		*!*		nRows = 3
		*!*		With Thisform.grid1
		*!*			For nCol = 1 To .ColumnCount
		*!*				nColumn = .Columns(nCol).ColumnOrder
		*!*				poExcel.Columns(nColumn).ColumnWidth = .Columns(nCol).Width/7.5
		*!*				poExcel.Cells(nRows,nColumn) = .Columns(nCol).header1.Caption
		*!*				poExcel.Cells(nRows,nColumn).Font.Bold = .T.
		*!*				poExcel.Cells(nRows,nColumn).Interior.ColorIndex = 16
		*!*			Endfor
		*!*			Scan
		*!*				nRows = nRows + 1
		*!*				For nCol = 1 To .ColumnCount
		*!*					nColumn = .Columns(nCol).ColumnOrder
		*!*					If At('CHECK',Upper(.Columns(nCol).CurrentControl))>0
		*!*						poExcel.Cells(nRows,nColumn)=Iif(Eval(.Columns(nCol).ControlSource)==0,'NU','DA')
		*!*					Else
		*!*						poExcel.Cells(nRows,nColumn) = Eval(.Columns(nCol).ControlSource)
		*!*					Endif
		*!*				Endfor
		*!*			Endscan
		*!*		Endwith
		
		*!*		XLApp.Visible = .T.
		*!*	Endif
		
		
		
		
	ENDPROC

	PROCEDURE do_listare
		**thisform.cmdlist1.Click
		PRIVATE pcTitlu, D, denC, denD, denCC, denDD, denCCC, denDDD
		LOCAL lcOrder
		LOCAL lcSortColumn, lcSortType
		LOCAL lcCrs, lcCursor, lcFilter, lcMenuRetVal, lcRaport, lcType, lcorderby, lctext, llColumnExist
		LOCAL lnOptiune, luNullValue
		*:Global pcGroupAcont, pcSubtitlu
		pcTitlu = THISFORM.lb_TITLU_ALB_B121.CAPTION
		D = THISFORM.grid1.RECORDSOURCE
		
		PRIVATE tlextern
		tlextern = IIF(THISFORM.optiongroup1.VALUE = 3, .T., .F.)
		
		denD = THISFORM.grid1.cPrecDeb.header1.CAPTION
		denC = THISFORM.grid1.cPrecCred.header1.CAPTION
		denDD = THISFORM.grid1.cTotDeb.header1.CAPTION
		denCC = THISFORM.grid1.cTotCred.header1.CAPTION
		denDDD = [Total ] + THISFORM.grid1.cValDebit.header1.CAPTION
		denCCC = [Total ] + THISFORM.grid1.cValCredit.header1.CAPTION
		
		IF THISFORM.filtru_traducere() # ""
			lctext = " si " + THIS.PARENT.filtru_traducere()
		ELSE
			lctext = ""
		ENDIF
		
		pcSubtitlu = THISFORM.filtru_pretty_ro + lctext
		
		WITH THISFORM.oContextMenu
			.CLEAR
		
			* creare meniu
			.ADD("000000")
		
			* categorie
			.ADD("000000", "1", "Listare \<selectie" + IIF(m.tlextern, " extern", ""))
			.ADD("000000", "2", "Listare grupata pe \<analitice")
			.ADD("000000", "3", "Listare \<balanta anuala")
			.ADD("000000", "4", "Listare \<balanta rulaje anuale")	
			.ADD("000000", "5", "Listare s\<impla")
			.ADD("000000", "6", "\<Notificari")
		
		ENDWITH
		
		*Thisform.oContextMenu.ShowFlags = TPM_VERPOSANIMATION
		THISFORM.oContextMenu.ShowFlags = 0x1000
		lcMenuRetVal = THISFORM.oContextMenu.SHOW()
		lnOptiune = VAL(m.lcMenuRetVal) && optiune
		
		
		lcSortColumn = ''
		lcSortType = ''
		IF PEMSTATUS(THISFORM.grid1, "oSortColumn", 5)
			lcSortColumn = THISFORM.grid1.oSortColumn.CONTROLSOURCE
			lcSortType = ALLTRIM(UPPER(THISFORM.grid1.oSortColumn.TAG))
			lcSortType = IIF(lcSortType = 'UP', 'ASC', 'DESC')
		ENDIF
		DO CASE
			CASE lnOptiune = 1
				pcGroupAcont = [EOF()]
			CASE lnOptiune = 2
				pcGroupAcont = [acont]
			CASE lnOptiune = 3
				pcGroupAcont = [EOF()]
			CASE lnOptiune = 4
				pcGroupAcont = [EOF()]
			CASE lnOptiune = 5
				denD = THISFORM.grid1.cDeb.header1.CAPTION
				denC = THISFORM.grid1.cCred.header1.CAPTION
				*!*			lcorderby = [acont,]+Iif(!Empty(lcSortColumn),lcSortColumn + ' ' + lcSortType,'')
				IF !EMPTY(lcSortColumn)
					lcorderby = [acont,] + lcSortColumn + ' ' + lcSortType
				ELSE
					lcorderby = [acont]
				ENDIF
				SELECT * FROM xtemp INTO CURSOR xtemp1 ORDER BY &lcorderby
				THISFORM.ALWAYSONTOP = .F.
				goExport.export2frx([xtemp1], [balanta_parteneri_rpt1], , , , , , .T.)
				THISFORM.ALWAYSONTOP = .T.
				USE IN (SELECT("xtemp1"))
				RETURN
			CASE m.lnOptiune = 6
				this.listare_notificari()	
				RETURN 
			OTHERWISE
				RETURN
		ENDCASE
		
		lcCrs = THISFORM.grid1.RECORDSOURCE
		lcFilter = FILTER(lcCrs)
		IF EMPTY(lcFilter)
			lcFilter = [1=1]
		ENDIF
		
		IF m.tlextern
			lcRaport = [balanta_parteneri_rpt2_ext.frx]
			SELE xtemp
			lcType = TYPE('xtemp.' + lcSortColumn)
			luNullValue = SPACE(100)
			DO CASE
				CASE lcType $ 'CVM'
					luNullValue = SPACE(100)
				CASE lcType $ 'NFI'
					luNullValue = CAST(0 AS I)
				CASE lcType = 'D'
					luNullValue = {}
				CASE lcType = 'T'
					luNullValue = {//::}
			ENDCASE
			llColumnExist = lcSortColumn $ 'nume,nume_val,preccred,precdeb,totdeb,totcred,valcredit,valdebit,totvaldeb,totvalcred'
			SELECT 0 AS tip, nume, nume_val, preccred, precdeb, totdeb, totcred, ;
				valcredit, valdebit, totvaldeb, totvalcred ;
				FROM xtemp ;
				UNION ALL ;
				SELECT 1 AS tip, [TOTAL ] + nume_val AS nume, nume_val, SUM(preccred) AS preccred, SUM(precdeb) AS precdeb, ;
				SUM(totdeb) AS totdeb, SUM(totcred) AS totcred, SUM(valcredit) AS valcredit, ;
				SUM(valdebit) AS valdebit, SUM(totvaldeb) AS totvaldeb, SUM(totvalcred) AS totvalcred ;
				FROM xtemp GROUP BY nume_val;
				INTO CURSOR crs
		
			lcOrder = [tip, ] + IIF(llColumnExist, lcSortColumn + ' ' + lcSortType, [nume]) + [,nume_val]
		
			*!*		Select * From crs  Into Cursor crs_ordonat Order By tip,nume,nume_val
			SELECT * FROM crs  INTO CURSOR crs_ordonat ORDER BY &lcOrder
			lcCursor = [crs_ordonat]
			USE IN (SELECT('crs'))
		ELSE
			IF LOWER(pcGroupAcont) = [acont]
				lcCursor = [crs_ordonat]
				lcOrder = IIF(!EMPTY(lcSortColumn), lcSortColumn + ' ' + lcSortType, [acont,nume])
				SELECT * FROM (lcCrs) WHERE &lcFilter INTO CURSOR (lcCursor) ORDER BY &lcOrder
			ELSE
				lcCursor = lcCrs
			ENDIF
			DO CASE 
				CASE lnOptiune = 3
					* balanta anuala portret
					lcRaport = [balanta_parteneri_rpt4.frx]
				CASE lnOptiune = 4
					* balanta rulaje anuale landscape
					lcRaport = [balanta_parteneri_rpt5.frx]			
				OTHERWISE 		
					* listare selectie
					lcRaport = [balanta_parteneri_rpt2.frx]
			ENDCASE 
		ENDIF
		
		
		THISFORM.ALWAYSONTOP = .F.
		goExport.export2frx(lcCursor, lcRaport, , , , , , .T.)
		
		THISFORM.ALWAYSONTOP = .T.
		
		USE IN (SELECT('crs_ordonat'))
		
		RELEASE pcTitlu, D, denC, denD, denCC, denDD, denCCC, denDDD
		
	ENDPROC

	PROCEDURE do_modifica
		Lparameters tlIesire
		
		If glLunaInchisa
			RETURN
		Endif
		
		Local loRec,lcFunctie,lcSql,lcMesaj,lcActiune,lcTitlu,llIesire
		llIesire=tlIesire
		If Empty(llIesire)
			llIesire=.F.
		Endif
		Select xtemp
		Scatter Name loRec
		nrlin=Recno()
		Thisform.grid1.SetAll('DynamicFontBold','IIF(RECNO()=nrlin,.T.,.F.)','Column')
		Thisform.grid1.Refresh()
		lnluna=luna
		lnid_valuta=id_valuta
		lnid_part=id_part
		lcIdSucursala = IIF(NVL(loRec.id_sucursala,0) = 0, 'NULL', ALLTRIM(STR(loRec.id_sucursala)))
		
		If lnluna=0
			lcMesaj=[Doriti sa adaugati aceasta inregistrare?]
			lcActiune=[adaugata]
			lcTitlu=[Adaugare]
		Else
			lcMesaj=[Doriti sa modificati aceasta inregistrare?]
			lcActiune=[modificata]
			lcTitlu=[Modificare]
		ENDIF
		
		If amessagebox(lcMesaj,4+32+256,lcTitlu)==6
			lcCont = loRec.cont
			lcSql=[begin PACK_INREGISTRARI.balpartinsproc(] + lcIdSucursala + [,] +Alltrim(Str(gnLuna))+[,]+Alltrim(Str(gnAn))+;
				[,]+Alltrim(Str(loRec.PRECDEB,25,4))+[,]+Alltrim(Str(loRec.PRECCRED,25,4))+[,]+Alltrim(Str(loRec.DEB,25,4))+;
				[,]+Alltrim(Str(loRec.CRED,25,4))+[,]+Alltrim(Str(loRec.PRECVALDEB,25,4))+[,]+Alltrim(Str(loRec.PRECVALCRED,25,4))+;
				[,]+Alltrim(Str(loRec.VALDEBIT,25,4))+[,]+Alltrim(Str(loRec.VALCREDIT,25,4))+[,]+Alltrim(Str(loRec.id_part))+;
				[,']+Alltrim(loRec.cont)+[',]+Iif(Isnull(loRec.ACONT),[''],[']+Alltrim(loRec.ACONT)+['])+[,]+Alltrim(Str(loRec.id_valuta))+[,]+Alltrim(STR(loRec.id_bal_part))+[); end;]
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				lcTextEroare = goExecutor.cEroare
				amessagebox(lcTextEroare,0+48,"Eroare")
				Return
			Endif
			Thisform.MousePointer= 11
			Thisform.LockScreen=.T.
			Thisform.actualizeaza_grid1()
			Thisform.LockScreen=.F.
			Thisform.MousePointer= 0
			amessagebox("Inregistrarea a fost "+lcActiune+"!",0+64,lcTitlu)
			Select xtemp
			Locate For id_part=loRec.id_part And NVL(ACONT,'')=NVL(loRec.ACONT,'') And id_valuta=loRec.id_valuta AND cont = loRec.Cont
			pnRec=Recno()
		Else
			If !llIesire
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid1()
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		Endif
		Thisform.lmodificata=.F.
		Thisform.grid1.SetAll('DynamicFontBold','.F.','Column')
		Thisform.grid1.SetFocus()
		
	ENDPROC

	PROCEDURE do_reface
		IF THIS.lBlocatRefacere
			AMESSAGEBOX('Nu se pot da refaceri! (Luna initiala, inchisa sau blocata)',0+48,'Refacere')
			RETURN
		ENDIF 
		
		LOCAL lcCont,lcConturi, x, i, lnIx
		lcConturi = Alltrim(Thisform.pccont)
		lcSursa = [balanta_parteneri]
		lnLuna = gnLuna
		lnAn = gnAn
		
		x= xmenu('Refacere \<completa;Refacere \<sume lunare;Refacere s\<ume precedente')
		DO case
			CASE x = 1
				lcLunar = [3]
			CASE x = 2
				lcLunar = [0]
			CASE x = 3
				lcLunar = [2]				
			OTHERWISE
				RETURN 
		ENDCASE 
		
		lnSucces = 1
		lnIx = GETWORDCOUNT(lcConturi, [,])
		FOR i = 1 TO lnIx
			IF lnSucces > 0
				lcCont = GETWORDNUM(lcConturi, i, [,])
				lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
			ENDIF 
		ENDFOR 
		
		IF lnSucces > 0
			do inainte WITH "BALANTA_parteneri",lcCont in oinainte_de.prg
		
			Thisform.actualizeaza_grid1()
			amessagebox('Refacerea s-a terminat!',64,"Info refacere")
		ENDIF 
	ENDPROC

	PROCEDURE do_renunt
		pnbuton=2
		If Thisform.lmodificata
			Thisform.do_modifica(.T.)
		Endif
		If Type('thisformset')='O'
			Thisformset.Release
		Endif
		Thisform.Release
	ENDPROC

	PROCEDURE do_reset
			*STORE .F. TO ber,bfdoc,bnume
		*!*	this.check1.Value = 0
		*!*	*this.check4.Value = 0
		*!*	this.ck_nume.Value = 0
		*!*	this.ck_acont.Value = 0
		*!*	this.ck_cont.Value = 0
		*!*	*this.ck_numeval.Value=0
		
		* Banca/Casa in valuta - intru cu externi automat
		IF '5124'$this.lb_titlu_alb_b121.Caption OR '5314'$this.lb_titlu_alb_b121.Caption
			this.optionGroup1.Value = 3 && externi 
		ELSE 
			this.optionGroup1.Value = 1	&& toti
		ENDIF 
		
		If This.lmodificata
			This.do_modifica()
		Endif
		
		
		IF NOT PEMSTATUS(thisform,"filtru_pretty",5)
		thisform.AddProperty("filtru_pretty")
		ENDIF
		
		IF NOT PEMSTATUS(thisform,"filtru_pretty_ro",5)
		thisform.AddProperty("filtru_pretty_ro")
		ENDIF
		
		thisform.filtru_pretty=""
		thisform.filtru_pretty_ro=""
		thisform.but_start_criterii1.ToolTipText=thisform.filtru_pretty_ro
		Thisform.but_start_criterii1.SetFocus
		Thisform.Refresh
		thisform.but_start_criterii1.pornit="nu"
		thisform.do_cauta()
		Thisform.but_start_criterii1.SetFocus
	ENDPROC

	PROCEDURE do_sterge
		If Thisform.ntipselectie = 1
			aMESSAGEBOX('Nu puteti sterge inregistrari decat pe inregistrarile interne/externe',0+48,'Stergere')
			Return
		Endif
		
		Local lcSql,lnRec
		Select xtemp
		lnRec=Recno()
		Scatter Name loRec
		Thisform.grid1.SetAll('DynamicFontBold','IIF(RECNO()='+ALLTRIM(STR(lnRec))+',.T.,.F.)','Column')
		Thisform.grid1.Refresh()
		
		If loRec.id_bal_part = 0 Or Isnull(loRec.id_bal_part)
			aMESSAGEBOX("Aceasta inregistrare nu este salvata pe server. Repetati cautarea",0+48,'Stergere')
			Return
		Endif
		
		If aMESSAGEBOX("Doriti sa stergeti aceasta inregistrare?",4+32+256,"Stergere")==6
			lcSql = [BEGIN PACK_INREGISTRARI.BALPARTDELPROC(] + Alltrim(Str(loRec.id_bal_part)) + [); END;]
		
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				lcTextEroare = goExecutor.cEroare
				aMESSAGEBOX(lcTextEroare,0+48,"Eroare")
				Return
			Endif
			aMESSAGEBOX("Inregistrarea a fost stearsa!",0,"Stergere")
			Thisform.MousePointer= 11
			Thisform.LockScreen=.T.
			Thisform.actualizeaza_grid1()
			Thisform.LockScreen=.F.
			Thisform.MousePointer=0
			Release loRec
			Select xtemp
			lnRec=Min(Reccount(),lnRec)
		
			If lnRec <= 1
				Go Top
			Else
				Go lnRec
			Endif
		Endif
		Thisform.grid1.SetAll('DynamicFontBold','.F.','Column')
		Thisform.grid1.SetFocus()
	ENDPROC

	PROCEDURE do_termin
		pnbuton=1
		IF THISFORM.lmodificata
			THISFORM.do_modifica(.T.)
		ENDIF
		IF TYPE('thisformset')='O'
			THISFORMSET.RELEASE
		ENDIF
		THISFORM.RELEASE
		THIS.BUT_STArt_criterii1.RESETstatus()
		DODEFAULT()
		
		
	ENDPROC

	PROCEDURE do_verifica
		Local loDate As "empty"
		Local lcCodFiscal, lcDenumire, lcFilter, lcSelect, lcWhere, llAutoVerificare, llDontCloseCursor
		Local llExperimental, llMFIN, llServiciuWebANAF, llValidare, llVerificarePlatitorTVA, lnOptiune
		Local lnRaspuns, loPartener
		lcSelect = Select()
		
		Select xtemp
		lcCodFiscal = Alltrim(xtemp.cod_fiscal)
		lcDenumire = Alltrim(xtemp.nume)
		lcIBAN = ALLTRIM(NVL(cont_banca,''))
		
		lnOptiune = XMENU('Verifica... ' + m.lcDenumire + ' - ANAF; Verifica toti partenerii - ANAF; Verifica codul IBAN; Verifica toate codurile IBAN')
		
		If Empty(m.lnOptiune)
			Return
		Endif
		
		* Pot sa fac verificarea pentru un singur nume si cu formularul pentru mai multi parteneri, dar arata mai dragut informatia intr-un messagebox pentru unul singur
		Do Case
			Case m.lnOptiune = 1 && un singur nume
				loPartener = Null
				loDate = Createobject("empty")
		
				AddProperty(loDate, "denumire",  m.lcDenumire)
				AddProperty(loDate, "cod_fiscal", m.lcCodFiscal)
				AddProperty(loDate, "tip_verificare", "ANAF_SERVICIU_WEB")
		
				lnRaspuns = VerificaCodFiscal(loDate, @lnOptiune, @loPartener)
		
			Case m.lnOptiune = 2 && TOATE NUMELE
				llDontCloseCursor = .F.
				llExperimental = .F.
				llVerificarePlatitorTVA = .F. && verific VIES pentru toti partenerii
				llMFIN = .T. && verific MFIN pentru toata lumea
				llValidare = .T. && verific algoritmul codurilor fiscale
				llAutoVerificare = .T. && lanseaza verificarea automata la activate-ul formularului de verificare
				llServiciuWebANAF = .T.
		
				lcFilter = Filter("xtemp")
				lcWhere = Iif(m.lnOptiune = 1, "recno() = " + Alltrim(Str(Recno())), Iif(!Empty(m.lcFilter), m.lcFilter, ".T."))
				Select Distinct cod_fiscal, nume As denumire, Iif(Left(Upper(cod_fiscal), 2) = "RO", "RO", "  ") As ATRIBUT_FISCAL, .T. As IsCIF, .F. As codvalid ;
					From xtemp;
					Where &lcWhere ;
					Into Cursor crsCoduriFiscale ;
					Order By nume, cod_fiscal  ;
					Readwrite
		
		
				Local lcXMLParteneri
				lcXMLParteneri = ""
				Cursortoxml('crsCoduriFiscale', "lcXMLParteneri", 1, 0, 0, "1")
		
				Do verificare_parteneri With m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA, m.llAutoVerificare, m.llDontCloseCursor, m.llExperimental, m.llServiciuWebANAF
		
			CASE m.lnOptiune = 3 && IBAN un cod
				lcIBAN = ALLTRIM(NVL(cont_banca,''))
				llValid = verifiban(m.lcIBAN)
				IF m.llValid
					AMESSAGEBOX('Contul IBAN ' + m.lcIBAN + ' este VALID.',0+64,_screen.Caption)
				ELSE
					AMESSAGEBOX('Contul IBAN ' + m.lcIBAN + ' este INVALID!',0+48,_screen.Caption)
				ENDIF 
			Case m.lnOptiune = 4 && IBAN
				lcFilter = Filter("xtemp")
				lcWhere = Iif(m.lnOptiune = 1, "recno() = " + Alltrim(Str(Recno())), Iif(!Empty(m.lcFilter), m.lcFilter, ".T."))
		
				SELECT DISTINCT nume as denumire, cod_fiscal, cont_banca ;
					FROM xtemp ;
					Where &lcWhere ;
					Into Cursor crsCoduriIBAN
		
				Local lcXMLIBAN
				lcXMLIBAN = ""
				Cursortoxml('crsCoduriIBAN', "lcXMLIBAN", 1, 0, 0, "1")			
				USE IN (SELECT('crsCoduriIBAN'))
				
				DO verificare_iban WITH m.lcXMLIBAN
				
		Endcase && x = 1
		
		Select (m.lcSelect)
		
	ENDPROC

	PROCEDURE Init
		*!*	*------------------ \\imi trebuie pt ordonarea pe dblclick header 
		*!*	thisform.RemoveObject('check3')
		LPARAMETERS tnCurs,tcValuta, tlAfisareTot
		* tlAfisareTot .T. = daca se afiseaza toate inregistrarile la intrarea in formular
		
		If !Empty(tnCurs)
			Thisform.ncurs = tnCurs
		Endif
		
		If !Empty(tcValuta)
			Thisform.cvaluta = tcValuta
		ENDIF
		
		This.lAfisareTot = m.tlAfisareTot
		
		DODEFAULT()
		SELECT xtemp
		GO top
		SCATTER MEMVAR blank
		
		IF THIS.but_modifica1.VISIBLE
			THIS.but_modifica1.VISIBLE=!glLunaInchisa
		ENDIF 
		IF THIS.but_reface1.VISIBLE
			THIS.but_reface1.VISIBLE=!glLunaInchisa
		ENDIF
		
		This.gridextra1.setup()
		
	ENDPROC

	PROCEDURE initializare
		Thisform.grid1.ReadOnly = !Thisform.grid1.ReadOnly
		THIS.but_start_criterii1.Enabled = !THIS.but_start_criterii1.Enabled
		this.but_reset_criterii1.Enabled = !this.but_reset_criterii1.Enabled
		
		thisform.cmdDebitor.Enabled = !Thisform.cmdDebitor.Enabled 
		*Thisform.cmdCreditor.Enabled = !Thisform.cmdCreditor.Enabled
		With Thisform.grid1
			.cNume.ReadOnly=.T.
			.cCod_fiscal.ReadOnly=.T.
		*!*		.cAcont.readonly=.T.
			.cSold.ReadOnly=.T.
			.cAcont2.ReadOnly=.T.
			.cSoldPrec.ReadOnly=.T.
			.cSoldFinal.ReadOnly=.T.
			.cTotAvans.ReadOnly=.T.
			.cTotdeb.ReadOnly=.T.
			.cTotCred.ReadOnly=.T.
			.cNume2.ReadOnly=.T.
			.cNume_val.ReadOnly=.T.
			.cSucursala.ReadOnly=.T.	
		Endwith
		thisform.grid1.Refresh
		
		
	ENDPROC

	PROCEDURE istavans
		PRIVATE pcschema1,pcselect1,pcfiltru1,pcorder1,poactan,pcdatacrt,pnavans
		STORE "" TO poactan
		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		pcschema1=['']
		pcselect1=['select * from ]+gcS+[.vact where 2=2']
		pcorder1=[]
		llAfisare=.F.
		
		pcdatacrt=ALLTRIM(STR(gnAn))+PADL(ALLTRIM(STR(gnLuna)),2,'0')+[01]
		thisform.AlwaysOnTop= .F.
		
		SELECT xtemp
		SCATTER NAME loRec
		IF loRec.pnavans==0
				OST=CREATEOBJ("stop")
				OST.LABEL2.CAPTION=" "
				OST.LABEL3.CAPTION="Avans = 0"
				oSt.show(1)
		ELSE 
			IF TYPE('loRec.id_part') # 'U'
				lcCond=[(partD=']+ALLTRIM(loRec.nume)+[' or id_partC=]+ALLTRIM(STR(loRec.id_part))+[)]
			ELSE 
				IF this.pccont = '542 '
				lcCond=[partC=']+ALLTRIM(loRec.nume)+[']
				ELSE 
				lcCond=[partD=']+ALLTRIM(loRec.nume)+[']
				ENDIF 
			ENDIF 
		
			IF 'CLIENTI' $ thisform.lb_titlu_alb_b121.Caption
				pcfiltru1=[SUBSTR(scc,1,3)='419' and dataact<add_months(to_date(]+pcdatacrt+[,'YYYY-MM-DD'),1) and ]+lcCond
			ELSE
				pcfiltru1=[SUBSTR(scd,1,3)='409' and dataact<add_months(to_date(]+pcdatacrt+[,'YYYY-MM-DD'),1) and ]+lcCond
			ENDIF 
			gencursor('poactan','tactan',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poactan.ca_baza1.afisare()
			
			titlu="SITUATIE ANALITICA - ISTORIC AVANS"
			ORC =CREATEOBJECT("AFDEBCRED")
			WITH orc
				.ali='tactan'
				.LABELTITLU.CAPTION="SITUATIE ANALITICA - ISTORIC AVANS"
			ENDWITH 
			ORC.SHOW()
			
			USE IN TACTAN
		ENDIF 
		RELEASE poactan,orc,loRec
		thisform.AlwaysOnTop= .t.
		SELECT xtemp
		
		
		
		
	ENDPROC

	PROCEDURE istcred
		PRIVATE pcschema1,pcselect1,pcfiltru1,pcorder1,poactan,pcdatacrt,pnavans
		STORE "" TO poactan
		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		pcschema1=['']
		pcselect1=['select * from ]+gcS+[.vact where 2=2']
		pcorder1=[dataact,serie_act,nract]
		llAfisare=.F.
		
		pcdatacrt=ALLTRIM(STR(gnAn))+PADL(ALLTRIM(STR(gnLuna)),2,'0')+[01]
		thisform.AlwaysOnTop= .F.
		
		thisform.AlwaysOnTop= .F.
		SELECT xtemp
		SCATTER NAME loRec
		IF loRec.cred==0
				OST=CREATEOBJ("stop")
				OST.LABEL2.CAPTION="Contul "+loRec.cont+":"
				OST.LABEL3.CAPTION="Credit = 0"
				oSt.show(1)
		ELSE 
			pcfiltru1=[scc=']+ALLTRIM(loRec.cont)+[' and dataact<add_months(to_date(]+pcdatacrt+[,'YYYY-MM-DD'),1) and id_partC=]+ALLTRIM(STR(loRec.id_part))
			gencursor('poactan','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poactan.ca_baza1.afisare()
			
			titlu="SITUATIE ANALITICA - ISTORIC CREDIT"
			ORC =CREATEOBJECT("frm_debcred")
			WITH orc
		*!*			.ali='tactan'
		*!*			.LABELTITLU.CAPTION="SITUATIE ANALITICA - ISTORIC CREDIT"
					.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - ISTORIC CREDIT * " + lorec.Nume
					.lb_titlu1.caption="SITUATIE ANALITICA - ISTORIC CREDIT"
			ENDWITH 
			ORC.SHOW(1)
			USE IN acn1
		endif
		RELEASE loRec,orc,poactan
		
		thisform.AlwaysOnTop= .t.
		SELECT xtemp
		
		
	ENDPROC

	PROCEDURE istdeb
		PRIVATE pcschema1,pcselect1,pcfiltru1,pcorder1,poactan,pcdatacrt,pnavans
		STORE "" TO poactan
		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		pcschema1=['']
		pcselect1=['select * from ]+gcS+[.vact where 2=2']
		pcorder1=[dataact,serie_act,nract]
		llAfisare=.F.
		
		pcdatacrt=ALLTRIM(STR(gnAn))+PADL(ALLTRIM(STR(gnLuna)),2,'0')+[01]
		thisform.AlwaysOnTop= .F.
		
		SELECT xtemp
		SCATTER NAME loRec
		IF loRec.DEB==0
				OST=CREATEOBJ("stop")
				OST.LABEL2.CAPTION="Contul "+loRec.cont+":"
				OST.LABEL3.CAPTION="Debit = 0"
				oSt.show(1)
		ELSE 
			pcfiltru1=[scd=']+ALLTRIM(loRec.cont)+[' and dataact<add_months(to_date(]+pcdatacrt+[,'YYYY-MM-DD'),1) and id_partD=]+ALLTRIM(STR(loRec.id_part))
			gencursor('poactan','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
			poactan.ca_baza1.afisare()
		
			titlu="SITUATIE ANALITICA - ISTORIC CREDIT"
			ORC =CREATEOBJECT("frm_debcred")
			WITH orc
		*!*			.ali='tactan'
		*!*			.LABELTITLU.CAPTION="SITUATIE ANALITICA - ISTORIC DEBIT"
					.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - ISTORIC DEBIT * " + loRec.nume
					.lb_titlu1.caption="SITUATIE ANALITICA - ISTORIC DEBIT"
			ENDWITH 
			ORC.SHOW(1)
			
			USE IN acn1
		endif
		RELEASE loRec,orc,poactan
		thisform.AlwaysOnTop= .t.
		SELECT xtemp
		
	ENDPROC

	PROCEDURE istdebcred
		Private pcschema1,pcselect1,pcfiltru1,pcorder1,poacn1,poacn2,pcdatacrt,pnavans
		Store "" To poacn1,poacn2
		pcschema1=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,nract N(20),DATAACT D,'+]+;
			['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
			['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
			['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
			['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
			['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
			['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
			['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		pcschema1=['']
		pcselect1=['select * from ]+gcS+[.vact where 2=2']
		pcorder1=[dataact,serie_act,nract]
		llAfisare=.F.
		
		pcdatacrt=Alltrim(Str(gnAn))+Padl(Alltrim(Str(gnLuna)),2,'0')+[01]
		Thisform.AlwaysOnTop= .F.
		
		Select xtemp
		Scatter Name loRec
		
		pcfiltru1=[scd=']+ALLTRIM(loRec.Cont)+[' and dataact<add_months(to_date(]+pcdatacrt+[,'YYYY-MM-DD'),1) and id_partD=]+Alltrim(Str(loRec.id_part))
		gencursor('poacn1','acn1',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
		poacn1.ca_baza1.afisare()
		
		pcfiltru1=[scc=']+ALLTRIM(loRec.Cont)+[' and dataact<add_months(to_date(]+pcdatacrt+[,'YYYY-MM-DD'),1) and id_partC=]+Alltrim(Str(loRec.id_part))
		gencursor('poacn2','acn2',pcselect1,pcfiltru1,pcschema1,pcorder1,llAfisare)
		poacn2.ca_baza1.afisare()
		
		ORC=Createobj("frm_debsicred")
		ORC.lb_titlu_alb_b121.caption="SITUATIE ANALITICA * " + loRec.nume
		ORC.Show(1)
		
		Select acn1
		Use
		Select acn2
		Use
		
		Release loRec,poacn1,poacn2,ORC
		Thisform.AlwaysOnTop= .T.
		Select xtemp
		
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		Do Case
			Case nKeyCode=27 And nShiftAltCtrl=0
				Nodefault
				If amessagebox("Sunteti sigur ca doriti sa inchideti fereastra?",4+32+256,"Confirmare")==6
					This.do_renunt()
				Endif
			Case nKeyCode=5 And nShiftAltCtrl=2
				Nodefault
				If Pemstatus(This,"do_excel",5)
					This.do_excel()
				Endif
			Case nKeyCode=13 And nShiftAltCtrl=2
				Nodefault
				If Pemstatus(This,"butapend",5)
					This.butapend()
				Endif
			Case nKeyCode=14 And nShiftAltCtrl=2 And !Thisform.grid1.ReadOnly And Thisform.lmodificata=.F.
				Nodefault
				If Pemstatus(This,"do_adauga",5)
					This.do_adauga()
				Endif
			Case nKeyCode=19 And nShiftAltCtrl=2 And !Thisform.grid1.ReadOnly And Thisform.lmodificata
				Nodefault
				If Pemstatus(This,"do_modifica",5)
					This.do_modifica()
				Endif
			Case nKeyCode=4 And nShiftAltCtrl=2 And !Thisform.grid1.ReadOnly And Thisform.lmodificata=.F.
				Nodefault
				If Pemstatus(This,"do_sterge",5)
					This.do_sterge()
				Endif
			Case nKeyCode=6 And nShiftAltCtrl=2
				Nodefault
				This.do_termin()
			Case nKeyCode=16 And nShiftAltCtrl=2
				Nodefault
				If Pemstatus(This,"do_listare",5)
					This.do_listare()
				ENDIF
				
			Case nKeyCode = 17 And nShiftAltCtrl=2 && CTRL + Q
				Nodefault
				If Type('THIS.but_start_criterii1') = 'O'
					This.but_start_criterii1.Click()
				Endif
		
			Case nKeyCode = 20 And nShiftAltCtrl=2 && CTRL + T
				Nodefault
				If Type('THIS.but_reset_criterii1') = 'O'
					This.but_reset_criterii1.Click()
				Endif
		
		Endcase
		
	ENDPROC

	PROCEDURE lblocatrefacere_assign
		lparameters tlBlocatRefacere
		This.lBlocatRefacere = tlBlocatRefacere
		
		this.but_reface1.Visible = !THIS.lBlocatRefacere
		thisform.but_modifica1.Visible = !THIS.lBlocatRefacere
		
	ENDPROC

	PROCEDURE listare_notificari
		LOCAL loFrm AS "frm_notificari_extra"
		LOCAL lcAliasParteneri, lcCursor, lcSql, lcSelect
		lcSelect = SELECT()
		TEXT TO lcSql NOSHOW
			select n.id_notificare, n.titlu, n.lista_conturi, n.text, n.ordine, n.sters, n.id_util, n.dataora, n.id_utils, n.dataoras,u.utilizator 
			from notificari n left join syn_utilizatori u on n.id_util = u.id_util
			where n.sters = 0 
			order by n.ordine
		ENDTEXT
		
		
		lcCursor = [cNotificari]
		lcTable = THISFORM.grid1.RECORDSOURCE
		SELECT distinct id_part, nume, cod_fiscal, adresa, reg_comert, telefon, email FROM (m.lcTable) INTO CURSOR cParteneriNotificare
		lcAliasParteneri = 'cParteneriNotificare'
		
		llSucces = goExecutor.oExecuta(m.lcSql, m.lcCursor)
		IF m.llSucces
			this.AlwaysOnTop = .F.
			SELECT (m.lcCursor)
			loFrm = CREATEOBJECT("frm_notificari_extra", 0, m.lcAliasParteneri)
			loFrm.SHOW(1)
			this.AlwaysOnTop = .T.
		ENDIF 
		
		USE IN (SELECT(m.lcCursor))
		USE IN (SELECT(m.lcAliasParteneri))
		SELECT (m.lcSelect)
	ENDPROC

	PROCEDURE llunainitializare_assign
		lparameters tlLunaInitializare
		This.lLunaInitializare = tlLunaInitializare
		
		this.cmdLunaInitializare.Visible = THIS.llunainitializare
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		
		IF luna_inchisa
			thisform.but_modifica1.Visible = .F.
		ENDIF 
		
		This.lLunaInitializare = IsCalendarInit('GET', thisform.cEntitate, Thisform.pccont) && oparteneri.prg
		This.lBlocatRefacere = IsBlocatRefacere(thisform.cEntitate, Thisform.pccont) && oparteneri.prg
		
		THIS._grdfooter1.attachtogrid(This.GRID1)
		
		* Banca/Casa in valuta - intru cu externi automat
		IF '5124'$this.lb_titlu_alb_b121.Caption OR '5314'$this.lb_titlu_alb_b121.Caption
			this.optiongroup1.value = 3 && externi 
		ENDIF 
		
		* Afisez toate inregistrarile cand intru pentru banca/casa. Sunt putine
		IF this.lAfisareTot OR '5124'$this.lb_titlu_alb_b121.Caption OR '5314'$this.lb_titlu_alb_b121.Caption OR '5121'$this.lb_titlu_alb_b121.Caption OR '5311'$this.lb_titlu_alb_b121.Caption
			This.do_reset() && afisarea tuturor inregistrarilo
		ENDIF 
		this.WindowState = 2
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		IF TYPE('XTEMP.AVANS') # 'U'
			lcAvans=[+avans]
			lcTotAvans=[+Totavans]
		ELSE
			lcAvans=[]
			lcTotAvans=[]
		ENDIF
		
		lcStringCriterii="Nume\nume\T\p.ID_PART\nom_parteneri" 		+ crlf + ;
			"Cod fiscal\cod_fiscal\T\none\"   		+ crlf + ;
			"Reg. comert\reg_comert\T\none\"   		+ crlf + ;	
			"Categorie ent.\categorie_entitate\T\none\"   		+ crlf + ;		
			"Analitic\acont\T\none\"   				+ crlf + ;
			"Cont\cont\T\none\"						+ crlf + ;
			"Cu rulaje lunare\nofiled\E\(debit <> 0 or credit <> 0)\" + crlf + ;
			"Cu rulaje anuale\nofiled\E\((TOTDEB-PRECDEB1) <> 0 or (TOTCRED-PRECCRED1) <> 0)\"	+ crlf + ;		
			"Cu sold\nofiled\E\" 
		
		IF THISFORM.pcfel="A"
			lcStringCriterii=lcStringCriterii+ [ (ABS(debit-credit] + lcAvans + [)>0 or ABS(PRECDEB+DEBIT-PRECCRED-CREDIT] + lcTotAvans + [)>0)\] + crlf
		ELSE
			lcStringCriterii = lcStringCriterii + [ (ABS(-debit+credit] + lcAvans + [)>0 or ABS(-PRECDEB-DEBIT+PRECCRED+CREDIT] + lcTotAvans+[)>0)\] + crlf
		ENDIF
		
		lcStringCriterii = lcStringCriterii + "Rulaj debit\debit\N|get_mask(12,gnPA)\none\"+ crlf 
		lcStringCriterii = lcStringCriterii + "Rulaj credit\credit\N|get_mask(12,gnPA)\none\"+ crlf 
		
		lcStringCriterii = lcStringCriterii + "Rul. debit anual\(TOTDEB-PRECDEB1)\N|get_mask(12,gnPA)\none\"+ crlf 
		lcStringCriterii = lcStringCriterii + "Rul. credit anual\(TOTCRED-PRECCRED1)\N|get_mask(12,gnPA)\none\"+ crlf 
		
		If  THISFORM.pcfel="A"
			lcStringCriterii = lcStringCriterii + "Sold\precdeb+debit-credit-preccred\N|get_mask(12,gnPA)\none\"+ crlf 
		Else
			lcStringCriterii = lcStringCriterii + "Sold\credit+preccred-precdeb-debit\N|get_mask(12,gnPA)\none\"+ crlf 
		ENDIF
		
		lcStringCriterii = lcStringCriterii + "Cu rulaje sau sold\nofiled\E\((precdeb1-preccred1)<>0 or (totdeb-precdeb1) <> 0 or (totcred-preccred1) <> 0 or debit<> 0 or credit<>0)\"	+ crlf
		
		********
		lcStringCriterii= lcStringCriterii + "Nume valuta\nume_val\T\none\"+ crlf
		**********
		lcStringCriterii = lcStringCriterii + IIF(glEMama, "Sucursala\sucursala\T\ID_SUCURSALA\nom_sucursala"+ crlf, "")
		
		DODEFAULT()
		
	ENDPROC

	PROCEDURE cmdDebitor.Click
		lnOptiune = xmenu('Istoric debitor;Istoric creditor')
		IF EMPTY(m.lnOptiune)
			RETURN
		ENDIF 
		IF m.lnOptiune = 1
			thisform.istdeb()
		ELSE
			thisform.istcred()
		ENDIF 	
	ENDPROC

	PROCEDURE cmdLunaInitializare.Click
		IF amessagebox('Doriti sa demarcati luna ' + PADL(m.gnLuna, 2, '0') + '/' + ALLTRIM(STR(gnAn)) + ' pentru initializare?' + CHR(13) + CHR(10) + ;
				'Atentie! Situatia contabila curenta va fi suprascrisa (refacuta) la Redeschidere de luna sau Refaceri!', 4+32, _SCREEN.CAPTION) = 6
			Thisform.lLunainitializare = IsCalendarInit('DEL', thisform.cEntitate, Thisform.pccont) && oparteneri.prg
			Thisform.lBlocatRefacere = IsBlocatRefacere(thisform.cEntitate, Thisform.pccont) && oparteneri.prg
		endif
		
	ENDPROC

	PROCEDURE grid1.AfterRowColChange
		Lparameters nColIndex
		Local lnluna
		With Thisform.grid1
			Select xtemp
			lnluna = luna
			If Thisform.lmodificata
				Replace TOTCRED With PRECCRED + CRED
				Replace totdeb With PRECDEB + DEB
				Replace totvalcred With precvalcred + valcredit
				Replace totvaldeb With precvaldeb + valdebit
				Thisform.lmodificare_totaluri = .T.
				Thisform.actualizeaza_totaluri()
				If lnluna = 0
					Thisform.lmodificare_totaluri = .F.
				Endif
				Thisform.grid1.Refresh
			Endif
			If .RowColChange = 1 Or .RowColChange = 3
				If Type('xtemp.acont') # 'U'
					Thisform.pcAcont = Alltrim(acont)
				Endif
				If Type('xtemp.idpart') # 'U'
					Thisform.pnidpart = idpart
				Endif
			Endif
		Endwith
		
	ENDPROC

	PROCEDURE grid1.BeforeRowColChange
		Lparameters nColIndex
		If !Thisform.lmodificare_totaluri
			Local lnCol
			Private pnRec
		 
		*	WAIT WINDOW TRANSFORM(THISFORM.coldvalue) + ' ' + TRANSFORM(THISFORM.cnewvalue) 
			If Thisform.grid1.ReadOnly=.F. And Thisform.coldvalue!=Thisform.cnewvalue
				Thisform.lmodificata=.T.
			Endif
			If (This.RowColChange= 1 Or This.RowColChange= 3) And Thisform.lmodificata
				If Thisform.coldvalue!=Thisform.cnewvalue
					For i=1 To This.ColumnCount
						If This.Columns(i).ColumnOrder=nColIndex
							lcColoana="thisform.grid1."+This.Columns(i).Name
							Exit
						Endif
					Endfor
					oColoana=&lcColoana
					lValue=oColoana.text1.Value
					lcNumeColoana=Substr(oColoana.ControlSource,At('.',oColoana.ControlSource)+1)
					Select xtemp
					Replace (lcNumeColoana) With lValue
				Endif
				pnRec=Recno()
				Thisform.do_modifica()
				Thisform.lmodificare_totaluri=.F.
		*!*			Thisform.grid1.ActivateCell(pnRec,nColIndex)
				DoDefault()
			Endif
		Else
			Thisform.lmodificare_totaluri=.F.
			Nodefault
		Endif
		
	ENDPROC

	PROCEDURE grid1.cAcont.Text1.GotFocus
		Thisform.coldvalue=Alltrim(NVL(This.Value,[]))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cAcont.Text1.InteractiveChange
		Thisform.cnewvalue=Alltrim(This.Value)
	ENDPROC

	PROCEDURE grid1.cAcont.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cAcont2.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cAcont2.Text1.GotFocus
		thisform.cnewvalue=""
		thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cAcont2.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cAvans.Header1.DblClick
		ThisForm.gridsort1.gridsort(This.Parent)
	ENDPROC

	PROCEDURE grid1.cAvans.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cAvans.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cAvans.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cAvans.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cAvansPrec.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cAvansPrec.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cCod_fiscal.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cCod_fiscal.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cCod_fiscal.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cCred.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cCred.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cCred.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cCred.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cDeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cDeb.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cDeb.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cDeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cNume.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cNume.Text1.GotFocus
		thisform.coldvalue = ""
		thisform.cnewvalue = ""
		RETURN 
		
		LOCAL lcAlias
		lcAlias = thisform.grid1.RecordSource 
		thisform.coldvalue = &lcAlias..id_part
		thisform.cnewvalue = thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cNume.Text1.InteractiveChange
		&& DACA MODIFIC PARTENERUL/SUCURSALA SE DUBLEAZA LINIA - ESTE LA FEL CA ADAUGARE LINIE NOUA SI COPIERE SUME
		RETURN 
		
		LOCAL lcCont, lcAlias
		lcAlias = thisform.grid1.RecordSource 
		
		IF !THISFORM.grid1.READONLY
			NODEFAULT
			LOCAL locauta,lcOldValue,lcNewValue
		
			STORE "" TO locauta	
			SELECT (lcAlias)
			lcOldValue = id_part
			lnRec = RECNO()
			lcCont = ALLTRIM(CONT)	
		
			locauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti partenerul ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont))
			
			IF !EMPTY(locauta.nume)
				SELECT (lcAlias)
				GO lnRec
				REPLACE id_part WITH locauta.id_part
				REPLACE nume WITH ALLTRIM(locauta.nume)
				lcNewValue = loCauta.id_part
			ELSE
				lcNewValue = lcOldValue
			ENDIF
			THIS.SETFOCUS()
			THISFORM.coldvalue = lcOldValue
			THISFORM.cnewvalue = lcNewValue
			Thisform.lmodificata=.T.
			RELEASE locauta
		ELSE
			DODEFAULT()
		ENDIF
	ENDPROC

	PROCEDURE grid1.cNume.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cNume2.Text1.GotFocus
		thisform.cnewvalue=""
		thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cNume_val.Text1.GotFocus
		Thisform.coldvalue=""
		Thisform.cnewvalue=""
	ENDPROC

	PROCEDURE grid1.cPreccred.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cPreccred.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cPrecdeb.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cPrecdeb.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cSold.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cSold.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cSold.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		
	ENDPROC

	PROCEDURE grid1.cSold.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cSoldFinal.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cSoldFinalVal.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cSoldPrec.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cSoldPrecVal.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cSucursala.Text1.InteractiveChange
		&& DACA MODIFIC PARTENERUL/SUCURSALA SE DUBLEAZA LINIA - ESTE LA FEL CA ADAUGARE LINIE NOUA SI COPIERE SUME
		RETURN 
		
		IF !glEMama
			RETURN
		ENDIF 
		 
		LOCAL lcAlias
		lcAlias = thisform.grid1.RecordSource 
		
		IF !THISFORM.grid1.READONLY
			NODEFAULT
			LOCAL locauta,lcOldValue,lcNewValue, lnIdSucursala, lcOldSucursala
			
			STORE "" TO locauta	
			SELECT (lcAlias)
			lcOldValue = id_sucursala
			lcOldSucursala = sucursala		
			lnRec = RECNO()
		
		
			loCauta = caut_sucursala()
			IF gnButon = 1	
				loCauta.id_sucursala = IIF(NVL(locauta.id_sucursala,0) = 0, NULL, locauta.id_sucursala)
				SELECT (lcAlias)
				GO lnRec
				REPLACE id_sucursala WITH loCauta.id_sucursala
				REPLACE sucursala WITH ALLTRIM(NVL(locauta.sucursala,''))
		
				lcNewValue = loCauta.id_sucursala
				this.Value = sucursala				
			ELSE
				lcNewValue = lcOldValue
				this.value = lcOldSucursala		
			ENDIF
			RELEASE locauta
			THIS.SETFOCUS()
			THISFORM.coldvalue = lcOldValue	
			THISFORM.cnewvalue = lcNewValue
		
			Thisform.lmodificata=.T.
		*	MESSAGEBOX(TRANSFORM(THISFORM.coldvalue) + ' ' + TRANSFORM(THISFORM.cnewvalue))
		
		*!*		FOR i=1 TO THISFORM.grid1.COLUMNCOUNT
		*!*			IF THISFORM.grid1.COLUMNS(i).COLUMNORDER=THIS.PARENT.COLUMNORDER+1
		*!*				EXIT
		*!*			ENDIF
		*!*		ENDFOR
		*!*		THISFORM.grid1.COLUMNS(i).SETFOCUS()
		ELSE
			DODEFAULT()
		ENDIF
	ENDPROC

	PROCEDURE grid1.cSucursala.Text1.When
		&& NU AM REUSIT SA FAC COLDVALUE <> CNEWVALUE :(
		thisform.coldvalue = ""
		thisform.cnewvalue = ""
		RETURN .T.
		
		LOCAL lcAlias
		lcAlias = thisform.grid1.RecordSource 
		thisform.coldvalue = &lcAlias..id_sucursala
		thisform.cnewvalue = thisform.coldvalue
		RETURN .T.
	ENDPROC

	PROCEDURE grid1.cTotAvans.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cTotcred.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cTotdeb.Text1.GotFocus
		Thisform.cnewvalue=""
		Thisform.coldvalue=""
	ENDPROC

	PROCEDURE grid1.cValCredit.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cValCredit.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.cValDebit.Text1.GotFocus
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grid1.cValDebit.Text1.InteractiveChange
		lcMask=Strtran(This.Parent.InputMask,' ','')
		lnNrZec=At(Thisform.cseparator,lcMask,1)
		Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
	ENDPROC

	PROCEDURE grid1.Init
		*!*	*
		*!*	* Replace default headers with custom one
		*!*	lcOrder = thisform.corder 
		*!*	i=0
		*!*	For Each loColumn In This.Columns
		*!*		i = i + 1
		*!*		With loColumn
		*!*			If !Empty(loColumn.ControlSource)
		
		*!*				* Save default caption, color and font
		
		*!*				lcOldCaption   = loColumn.Header1.Caption
		*!*				lcOldFontName = loColumn.Header1.FontName
		*!*				lnOldForeColor = loColumn.Header1.ForeColor
		*!*				llOldFontUnderline = loColumn.Header1.FontUnderline
		
		*!*				* Name Header Obj after ControlSource
		
		*!*				lcControlSrc = loColumn.ControlSource
		*!*				lnControlSrc = Rat(".", lcControlSrc) + 1
		*!*				lcControlSrc = Substr(lcControlSrc, lnControlSrc)
		
		*!*				*	Metoda dupa care se face ordonarea relativa la grid
		*!*				lcMethodName = 'parent.corderby_assign'
		*!*				lcPropColOrder = 'parent.cOrder'
		*!*				lcPropSensOrder = 'parent.cAsc'
		*!*				* Remove old and create new header
		
		*!*				.RemoveObject("Header1")
		*!*				.AddObject("Header1", ;
		*!*					"PSHeader", ;
		*!*					lcOldCaption, lcOldFontName,lnOldForeColor,llOldFontUnderline,lcMethodName,lcControlSrc)
		
		*!*	*!*				If Upper(Alltrim(lcControlSrc)) = Upper(Alltrim(lcOrder))
		*!*	*!*					lcCuloare = [locolumn.grh] + ALLTRIM(STR(i)) + [.forecolor = RGB(0,0,255)]
		*!*	*!*					&lcCuloare
		*!*	*!*					lcUnderline = [locolumn.grh] + ALLTRIM(STR(i)) + [.FontUnderline = .t.]
		*!*	*!*					&lcUnderline
		*!*	*!*				Endif
		*!*			Endif
		*!*		Endwith
		*!*	ENDFOR
		
	ENDPROC

	PROCEDURE Gridextra1.applyfilter
		DODEFAULT()
		Thisform._grdfooter1.calcTotal()
	ENDPROC

	PROCEDURE Gridextra1.clearfilter
		DODEFAULT()
		Thisform._grdfooter1.calcTotal()
	ENDPROC

	PROCEDURE Optiongroup1.Valid
		*!*	IF !PEMSTATUS(THIS,"cTraducere",5)
		*!*		THIS.ADDPROPERTY("cTraducere", "")
		*!*	ENDIF
		*!*	DO CASE
		*!*		CASE THIS.VALUE = 1
		*!*			THIS.cTraducere = ""
		*!*		CASE THIS.VALUE = 2
		*!*			THIS.cTraducere = "Parteneri interni"
		*!*		CASE THIS.VALUE = 3
		*!*			THIS.cTraducere = "Parteneri externi"
		*!*	ENDCASE
		THISFORM.do_cauta()
		thisform._grdfooter1.attachtogrid(thisform.grid1) && se ascund/afiseaza coloane valuta
		Thisform.actualizeaza_totaluri() && nu se mai afisau totalurile dupa attachtogrid
		
		THISFORM.but_start_criterii1.refreshstatus
		
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_grid_order1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grd_total" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Resizable1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: calcul_totaluri
		*m: resize_grd_total
		*p: ctitlu
		*p: ototal
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 2
		cgridsortlist = ct_grid_order1._GRID1
		ctitlu = 
		DoCreate = .T.
		Height = 503
		Name = "frm_bal_parteneri_cumulata"
		ototal = .F.
		Width = 793
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = -2
		_shape1.Width = 792
		_shape1.ZOrderSet = 2
		_shape2.Height = 29
		_shape2.Left = 732
		_shape2.Name = "_shape2"
		_shape2.Top = -2
		_shape2.Width = 60
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "Balata parteneri cumulata"
		Lb_titlu_alb_b121.Left = 4
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 0
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Left = 760
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = -1
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'Ct_grid_order1' AS ct_grid_order WITH ;
		Height = 430, ;
		Left = 0, ;
		Name = "Ct_grid_order1", ;
		Top = 31, ;
		Width = 792, ;
		ZOrderSet = 6, ;
		_GRID1.Height = 393, ;
		_GRID1.Left = 6, ;
		_GRID1.Name = "_GRID1", ;
		_GRID1.RecordMark = .T., ;
		_GRID1.Top = 33, ;
		_GRID1.Width = 783, ;
		Titlu.Left = 372, ;
		Titlu.Name = "Titlu", ;
		Titlu.Top = 19, ;
		Cb_tx_cautare1.Criteriu.Name = "Criteriu", ;
		Cb_tx_cautare1.Left = 7, ;
		Cb_tx_cautare1.Name = "Cb_tx_cautare1", ;
		Cb_tx_cautare1.Text.Name = "Text", ;
		Cb_tx_cautare1.Top = 2
		*< END OBJECT: ClassLib="ferestre_cere_date.vcx" BaseClass="container" />

	ADD OBJECT 'Grd_total' AS grid WITH ;
		AllowHeaderSizing = .F., ;
		AllowRowSizing = .F., ;
		BackColor = 236,249,255, ;
		DeleteMark = .F., ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		GridLineColor = 0,98,145, ;
		GridLines = 2, ;
		GridLineWidth = 1, ;
		HeaderHeight = 0, ;
		Height = 21, ;
		HighlightBackColor = 236,249,255, ;
		HighlightForeColor = 0,0,0, ;
		Left = 13, ;
		Name = "Grd_total", ;
		RecordMark = .F., ;
		RowHeight = 21, ;
		ScrollBars = 0, ;
		Top = 474, ;
		Width = 769, ;
		ZOrderSet = 7
		*< END OBJECT: BaseClass="grid" />

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Totaluri", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 13, ;
		Name = "Label1", ;
		Top = 457, ;
		Width = 45, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Lb_shortcuts1' AS lb_shortcuts WITH ;
		Caption = "CTRL+F = Terminare; ESC = Renuntare", ;
		Left = 4, ;
		Name = "Lb_shortcuts1", ;
		Top = 14
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'Resizable1' AS resizable_class WITH ;
		Left = 312, ;
		Name = "Resizable1", ;
		repositionlist = _shape But_termin But_renunt Titlufrumos _txbase Ct_grid_order Grid Shape Label, ;
		resizelist = _shape But_termin But_renunt Titlufrumos _txbase Ct_grid_order Grid Shape Label, ;
		Top = 10
		*< END OBJECT: ClassLib="solution.vcx" BaseClass="custom" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BackStyle = 0, ;
		Height = 34, ;
		Left = 7, ;
		Name = "Shape1", ;
		Top = 465, ;
		Width = 781, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE Activate
		this.WindowState = 2
	ENDPROC

	PROCEDURE calcul_totaluri
		LOCAL lcCursor, lcColoane, lnNrCol, lcColoana
		
		lcCursor = this.ct_grid_order1.cnumecursor 
		lcColoane = this.ct_grid_order1.cnume_coloane
		lnNrCol = GETWORDCOUNT(lcColoane,';')
		
		SELECT (lcCursor)
		SCATTER NAME otot BLANK 
		lnRecno = RECNO()
		
		FOR i = 1 TO lnNrCol
			lcColoana = GETWORDNUM(lcColoane,i,';')
			IF TYPE(lcColoana) = 'N'
				SELECT (lcCursor)
				SUM &lcColoana TO otot.&lcColoana 
			ENDIF 
		ENDFOR 
		
		SELECT (lcCursor)
		IF !EOF()
			GOTO lnRecno
		ELSE 
			LOCATE
		ENDIF 
		this.ototal = oTot
		this.resize_grd_total
				
	ENDPROC

	PROCEDURE do_excel
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		lcAlias = this.ct_grid_order1._GRID1.RecordSource 
		lcFiltru = FILTER(lcAlias)
		IF EMPTY(lcFiltru)
			lcFiltru = '.T.'
		ENDIF 
		
		exista_excel=.T.
		lcColumnList = ''
		lcHeaderList = ''
		lcSelect = ''
		llSelect = .T.
		lcType = 'CURSOR'
		lcFrom = lcAlias
		lcWhere = lcFiltru
		lcOrder = 'nume'
		lcOutput = 'crsBalPart'
		
		get_schema_grid(this.grid1,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
		&lcSelect
		IF USED(lcOutput)
			DO export_xls WITH lcOutput IN oproceduri_comune.prg
			USE IN (lcOutput)
		ENDIF 
	ENDPROC

	PROCEDURE Resize
		this.resizable1.adjustcontrols 
	ENDPROC

	PROCEDURE resize_grd_total
		this.LockScreen = .T.
		
		this.grd_total.RecordSource = this.ct_grid_order1._gRID1.RecordSource 
		WITH this.ct_grid_order1._gRID1
			this.grd_total.ColumnCount = .ColumnCount
			For i=1 To .ColumnCount 
				lcControlCol = ALLTRIM(.columns(i).ControlSource)
				lnWidth = .columns(i).width
				lcMaskCol = .columns(i).InputMask
				lnOrder = .columns(i).columnOrder
				
				this.grd_total.columns(i).width = lnWidth 
				this.grd_total.columns(i).columnOrder = lnOrder
				this.grd_total.columns(i).InputMask = lcMaskCol
				lcControlSource = [this.grd_total.coLUMN] + Alltrim(Str(i))+ [.ControlSource = 'thisform.ototal.] + lcControlCol + [']
				&lcControlSource
			ENDFOR 
		ENDWITH 
		
		this.LockScreen = .F.
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		this.lb_titlu_alb_b121.Caption = this.ctitlu 
		this.ct_grid_order1.initializare()
		this.resize_grd_total
		this.calcul_totaluri()
		
		this.grid_sort_bind()
	ENDPROC

	PROCEDURE Ct_grid_order1.actualizeaza_grid
		LPARAMETERS pcFiltru
		DODEFAULT(pcFiltru)
		thisform.calcul_totaluri
	ENDPROC

	PROCEDURE Ct_grid_order1.initializare
		PARAMETERS tlNumerotare
		
		llNrOrd = tlNumerotare
		
		*** CREEZ CURSORUL INITIAL
		
		lcTitlu = This.cTitlu
		lcTitluColoane = This.cTitlu_coloane
		lcNumeColoane = This.cNume_coloane
		lcMask = ALLTRIM(This.cMask)
		*!*	lcSql = This.cSelect
		*!*	lcFiltru = Iif(!Empty(This.cFiltru),This.cFiltru + [ AND ] + This.cFiltruOriginal,This.cFiltruOriginal)
		*!*	lcFiltruOriginal = This.cFiltruOriginal
		*!*	lcSchema = This.cSchema
		lcOrder = This.cOrder
		*!*	llAfisare = .F.
		lcNumeCursor = This.cNumecursor
		lcNrColoane_check = ALLTRIM(this.cnrcoloane_check)
		
		&& testez daca am de-a face cu coloane de tip checkbox
		llCuCheck =IIF(EMPTY(lcNrColoane_check),.f.,.t.)
		
		This.titlu.Caption = lcTitlu
		
		*!*	IF USED(lcNumeCursor)
		*!*		USE IN &lcNumeCursor
		*!*	ENDIF 
		
		*!*	lnSucces = goExecutor.oExecute(lcSql,lcNumeCursor)
		
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
		*!*		RETURN 
		*!*	ENDIF 
		
		
		If Right(lcTitluColoane,1) # ','
			lcTitluColoane = lcTitluColoane + ','
		Endif
		If Left(lcTitluColoane,1) # ','
			lcTitluColoane = ',' + lcTitluColoane
		Endif
		
		If Right(lcNumeColoane ,1) # ';'
			lcNumeColoane = lcNumeColoane + ';'
		Endif
		If Left(lcNumeColoane ,1) # ';'
			lcNumeColoane = ';' + lcNumeColoane
		Endif
		
		If Right(lcSchema ,1) # ','
			lcSchema = lcSchema + ','
		Endif
		If Left(lcSchema,1) # ','
			lcSchema = ',' + lcSchema
		ENDIF
		
		If Right(lcMask,1) # ';' && am virgula in get_mask
			lcMask = lcMask + ';'
		Endif
		If Left(lcMask,1) # ';'
			lcMask = ';' + lcMask
		ENDIF
		
		IF llNrOrd && mai adaug o coloana la inceput
			lcTitluColoane = ',' + lcTitluColoane
			lcNumeColoane = ';' + lcNumeColoane
			lcSchema = ',' + lcSchema
			lcMask = ';[0]=' + lcMask
		ENDIF 
		
		lnNrCols = Occurs(",",lcTitluColoane) - 1
		
		This._GRID1.RecordSource = lcNumeCursor
		This._GRID1.ColumnCount = lnNrCols
		
		SELECT (lcNumeCursor)
		For i=1 To lnNrCols
			*	this._grid1.AddColumn(i)
			IF llNrOrd AND i = 1
				lcHeader = [this._grid1.column1.hEADER1.Caption = 'Nr.']
				&lcHeader
				this._GRID1.coLUMN1.ControlSource = ''
				LOOP
			ENDIF 
			lcTitluCol = Strextract(lcTitluColoane,[,],[,],i)
			lcControlCol = Strextract(lcNumeColoane,[;],[;],i)
			lcHeader = [this._grid1.column] + Alltrim(Str(i))+ [.hEADER1.Caption = '] + lcTitluCol + [']
			&lcHeader
			lcControlSource = [this._GRID1.coLUMN] + Alltrim(Str(i))+ [.ControlSource = '] + lcControlCol + [']
			&lcControlSource
			lcMaskCol = Strextract(lcMask,[;],[;],i)
			lcMaskCol = ALLTRIM(STREXTRACT(lcMaskCol,']='))
			lcBindEvent = [BINDEVENT(this._GRID1.Column] + ALLTRIM(STR(i)) + [,"Resize",thisform,"resize_grd_total")]
			&lcBindEvent
			lcBindEvent = [BINDEVENT(this._GRID1.Column] + ALLTRIM(STR(i)) + [,"Moved",thisform,"resize_grd_total")]
			&lcBindEvent
			IF !EMPTY(lcMaskCol)
				lcInputmask = [this._GRID1.coLUMN] + Alltrim(Str(i))+ [.InputMask = '] + EVALUATE(lcMaskCol) + [']
				&lcInputmask
			ENDIF 
			lcSchemaCol = Strextract(lcSchema,[,],[,],i)
			
			IF TYPE(lcControlCol) = 'N'
				IF EMPTY(lcMaskCol) && nu e configurat 
					IF !EMPTY(lcSchemaCol)
						lcSch = STREXTRACT(lcSchemaCol,'(',')',1)
						lnInt = IIF([,] $ lcSch,VAL(STREXTRACT(lcSch,[],[,])),VAL(lcSch))
						lnZec = IIF([,] $ lcSch,VAL(STREXTRACT(lcSch,[,])),0)
					ELSE 
						lnInt = 12
						lnZec = gnPA
					ENDIF 
					lcInputmask = [this._GRID1.coLUMN] + Alltrim(Str(i))+ [.InputMask = '] + get_mask(lnInt,lnZec) + [']
					&lcInputmask
				ENDIF 
				lcAlignment = [this._GRID1.coLUMN] + Alltrim(Str(i))+ [.Alignment = 1]
				&lcAlignment
				IF llCuCheck  
					&& daca nr coloanei curente este in lista cNrColoane_check, atunci 		
					&& controlul curent al coloanei va fi un checkbox
					lcVerific = 'INLIST(' + IIF(llNrOrd,ALLTRIM(STR(i-1)),ALLTRIM(STR(i))) + ',' +lcNrColoane_check + ')'
					lcEste = &lcVerific
					IF lcEste
						lcAdaugCheck = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.AddObject('Check1',]+;
							['Checkbox')]	
						&lcAdaugCheck	
						lcControlCurent = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.CurrentControl = 'Check1']
						&lcControlCurent	
						lcRemText = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.RemoveObject('Text1')]
						&lcRemText
						lcSparse = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.Sparse = .f.]
						&lcSparse
						lcWidth = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.width = 30]
						&lcWidth 
						lcCaption = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.Check1.caption = ''] 
						&lcCaption
						lcReadOnly = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.ReadOnly = .f.] 
						&lcReadOnly
						lcAli = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.Alignment = 2] 
						&lcAli
						lcReadOnly_ch = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.Check1.ReadOnly = .f.]				
						&lcReadOnly_ch
						lcControlSource = [this._GRID1.coLUMN] + Alltrim(Str(i))+ [.ControlSource = '] + lcControlCol + [']
						&lcControlSource				
						lcVisible = [this._GRID1.coLUMN] + Alltrim(Str(i)) + [.Check1.visible = .t.] 
						&lcVisible								
						
					ENDIF
				ENDIF	
			ELSE 
				lcAlignment = [this._GRID1.coLUMN] + Alltrim(Str(i))+ [.Alignment = 0]
				&lcAlignment
			ENDIF 
		Endfor
		
		* Replace default headers with custom one
		i = 0
		For Each loColumn In This._GRID1.Columns
			i = i + 1
			With loColumn
				If !Empty(loColumn.ControlSource)
		
					* Save default caption, color and font
		
					lcOldCaption   = loColumn.Header1.Caption
					lcOldFontName = loColumn.Header1.FontName
					lnOldForeColor = loColumn.Header1.ForeColor
					llOldFontUnderline = loColumn.Header1.FontUnderline
		
					* Name Header Obj after ControlSource
		
					lcControlSrc = loColumn.ControlSource
					lnControlSrc = Rat(".", lcControlSrc) + 1
					lcControlSrc = Substr(lcControlSrc, lnControlSrc)
					
					* Metoda dupa care se face ordonarea relativa la grid
					lcMethodName = 'parent.corderby_assign'
					lcPropColOrder = 'parent.cOrder'
					lcPropSensOrder = 'parent.cAsc'
					* Remove old and create new header
		
					.RemoveObject("Header1")
					.AddObject("grh"+ALLTRIM(STR(i)), ;
						"PSHeader", ;
						lcOldCaption, lcOldFontName,lnOldForeColor,llOldFontUnderline,lcMethodName,lcControlSrc)
		
					If Upper(Alltrim(lcControlSrc)) = Upper(Alltrim(lcOrder))
						lcCuloare = [locolumn.grh] + ALLTRIM(STR(i)) + [.forecolor = RGB(0,0,255)]
						&lcCuloare
						lcUnderline = [locolumn.grh] + ALLTRIM(STR(i)) + [.FontUnderline = .t.]
						&lcUnderline
					Endif
				Endif
			Endwith
		ENDFOR
		
		IF llNrOrd
			DO nrord WITH lcNumeCursor
			this._GRID1.coLUMN1.ControlSource = [nrcrt()]
			THIS._GRID1.COLUMN1.inputmask = '999'
			this._griD1.LockColumns = 1
		ENDIF 	
		
		This._GRID1.AutoFit
		
		
	ENDPROC

	PROCEDURE Ct_grid_order1.ordoneaza_grid
		DODEFAULT()
		thisform.resize_grd_total
		 
	ENDPROC

	PROCEDURE Ct_grid_order1._GRID1.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT(nColIndex)
		THISFORM.LOCKSCREEN = .T.
		LOCAL nDirection, nRecno, nLeftColumn, nRelativeRow
		
		nLeftColumn = THIS.LEFTCOLUMN
		IF nLeftColumn != THISFORM.grd_total.LEFTCOLUMN
			IF nLeftColumn < THISFORM.grd_total.LEFTCOLUMN
				nDirection = 4
			ELSE
				nDirection = 5
			ENDIF
			FOR i = 1 TO 1000
				THISFORM.grd_total.DOSCROLL(nDirection)
				IF nLeftColumn = THISFORM.grd_total.LEFTCOLUMN
					EXIT
				ENDIF
			ENDFOR
		ENDIF
		THISFORM.LOCKSCREEN = .F.
		
	ENDPROC

	PROCEDURE Ct_grid_order1._GRID1.Scrolled
		LPARAMETERS nDirection
		DODEFAULT(nDirection)
		thisform.grd_total.doscroll(nDirection)
	ENDPROC

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

ENDDEFINE

DEFINE CLASS frm_balpart_fc 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="Label11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" 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="GRID1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cSoldPrecVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cSoldPrecVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cValDebit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cValDebit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cValCredit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cValCredit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cSoldFinalVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cSoldFinalVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cAcont2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cAcont2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cCodFiscal2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cCodFiscal2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cNume2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cNume2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cIdPart.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cIdPart.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="GRID1.cValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text7" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nprecavans
		*p: npreccred
		*p: nprecdeb
		*p: nsoldprec
		*p: nsoldtot
		*p: ntavans
		*p: ntcred
		*p: ntdeb
		*p: ntotavans
		*p: ntotcred
		*p: ntotdeb
		*p: ntsold
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cgridsortlist = grid1
		DoCreate = .T.
		Height = 491
		Name = "frm_balpart_fc"
		nprecavans = 0
		npreccred = 0
		nprecdeb = 0
		nsoldprec = 0
		nsoldtot = 0
		ntavans = 0
		ntcred = 0
		ntdeb = 0
		ntotavans = 0
		ntotcred = 0
		ntotdeb = 0
		ntsold = 0
		Width = 793
		_shape1.Anchor = 11
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 792
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 759
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 32
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 761
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 28
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Left = 671, ;
		Name = "But_reset_criterii1", ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 700, ;
		Name = "But_start_criterii1", ;
		RightToLeft = .F., ;
		SpecialEffect = 1, ;
		Top = 1, ;
		Width = 31, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'GRID1' AS _grid WITH ;
		AllowAutoColumnFit = 0, ;
		Anchor = 15, ;
		ColumnCount = 24, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 341, ;
		Left = 5, ;
		Name = "GRID1", ;
		Panel = 1, ;
		RecordSource = "balpartfc", ;
		Top = 145, ;
		Width = 786, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "acont", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "soldprec", ;
		Column3.DynamicBackColor = "RGB(236,249,255)", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.InputMask = (get_mask(14,gnPA)), ;
		Column3.Name = "Column3", ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "avanscur", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.InputMask = (get_mask(14,gnPA)), ;
		Column4.Name = "Column4", ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "debit", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.InputMask = (get_mask(14,gnPA)), ;
		Column5.Name = "Column5", ;
		Column6.ColumnOrder = 7, ;
		Column6.ControlSource = "credit", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.InputMask = (get_mask(14,gnPA)), ;
		Column6.Name = "Column6", ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "soldcur", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.InputMask = (get_mask(14,gnPA)), ;
		Column7.Name = "Column7", ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "soldfinal", ;
		Column8.DynamicBackColor = "rgb(187,235,255)", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.InputMask = (get_mask(14,gnPA)), ;
		Column8.Name = "Column8", ;
		Column9.ColumnOrder = 10, ;
		Column9.ControlSource = "avansprec", ;
		Column9.DynamicBackColor = "RGB(236,249,255)", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.InputMask = (get_mask(14,gnPA)), ;
		Column9.Name = "Column9", ;
		Column10.ColumnOrder = 11, ;
		Column10.ControlSource = "precdeb", ;
		Column10.DynamicBackColor = "RGB(236,249,255)", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.InputMask = (get_mask(14,gnPA)), ;
		Column10.Name = "Column10", ;
		Column11.ColumnOrder = 12, ;
		Column11.ControlSource = "preccred", ;
		Column11.DynamicBackColor = "RGB(236,249,255)", ;
		Column11.FontName = "Arial Narrow", ;
		Column11.InputMask = (get_mask(14,gnPA)), ;
		Column11.Name = "Column11", ;
		Column12.ColumnOrder = 13, ;
		Column12.ControlSource = "avanstot", ;
		Column12.DynamicBackColor = "RGB(187,235,255)", ;
		Column12.FontName = "Arial Narrow", ;
		Column12.InputMask = (get_mask(14,gnPA)), ;
		Column12.Name = "Column12", ;
		Column13.ColumnOrder = 14, ;
		Column13.ControlSource = "totdeb", ;
		Column13.DynamicBackColor = "RGB(187,235,255)", ;
		Column13.FontName = "Arial Narrow", ;
		Column13.InputMask = (get_mask(14,gnPA)), ;
		Column13.Name = "Column13", ;
		Column14.ColumnOrder = 15, ;
		Column14.ControlSource = "totcred", ;
		Column14.DynamicBackColor = "RGB(187,235,255)", ;
		Column14.FontName = "Arial Narrow", ;
		Column14.InputMask = (get_mask(14,gnPA)), ;
		Column14.Name = "Column14", ;
		Column15.ColumnOrder = 16, ;
		Column15.ControlSource = "soldprecval", ;
		Column15.FontName = "Arial Narrow", ;
		Column15.InputMask = (get_mask(14,gnPVal)), ;
		Column15.Name = "cSoldPrecVal", ;
		Column16.ColumnOrder = 17, ;
		Column16.ControlSource = "valdebit", ;
		Column16.FontName = "Arial Narrow", ;
		Column16.InputMask = (get_mask(14,gnPVal)), ;
		Column16.Name = "cValDebit", ;
		Column17.ColumnOrder = 18, ;
		Column17.ControlSource = "valcredit", ;
		Column17.FontName = "Arial Narrow", ;
		Column17.InputMask = (get_mask(14,gnPVal)), ;
		Column17.Name = "cValCredit", ;
		Column18.ColumnOrder = 19, ;
		Column18.ControlSource = "soldfinalval", ;
		Column18.FontName = "Arial Narrow", ;
		Column18.InputMask = (get_mask(14,gnPVal)), ;
		Column18.Name = "cSoldFinalVal", ;
		Column19.ColumnOrder = 21, ;
		Column19.ControlSource = "acont", ;
		Column19.FontName = "Arial Narrow", ;
		Column19.Name = "cAcont2", ;
		Column20.ColumnOrder = 22, ;
		Column20.ControlSource = "cod_fiscal", ;
		Column20.FontName = "Arial Narrow", ;
		Column20.Name = "cCodFiscal2", ;
		Column21.ColumnOrder = 23, ;
		Column21.ControlSource = "nume", ;
		Column21.FontName = "Arial Narrow", ;
		Column21.Name = "cNume2", ;
		Column22.ColumnOrder = 24, ;
		Column22.ControlSource = "id_part", ;
		Column22.FontName = "Arial Narrow", ;
		Column22.Format = "RK", ;
		Column22.InputMask = "9999999999", ;
		Column22.Name = "cIdPart", ;
		Column23.ColumnOrder = 20, ;
		Column23.ControlSource = "sucursala", ;
		Column23.FontName = "Arial Narrow", ;
		Column23.Name = "cSucursala", ;
		Column23.Width = 158, ;
		Column24.ColumnOrder = 3, ;
		Column24.ControlSource = "nume_val", ;
		Column24.FontName = "Arial Narrow", ;
		Column24.Name = "cValuta", ;
		Column24.Width = 51
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="grid" />

	ADD OBJECT 'GRID1.cAcont2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cCodFiscal2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod fiscal", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cIdPart.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id partener", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

	ADD OBJECT 'GRID1.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec Deb.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column11.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec Cred.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column12.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Avans", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column13.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Deb.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Cred.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'GRID1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold precedent", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Avans", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Debit(Facturat)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Credit(Incasat)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold curent", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold final", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Avans prec.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cSoldFinalVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Final Val.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cSoldPrecVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold Prec Val", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cSucursala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cValCredit.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Credit Val", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cValDebit.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Debit Val", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'GRID1.cValuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Label11' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Total:", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 269, ;
		Name = "Label11", ;
		Top = 108, ;
		Width = 38, ;
		ZOrderSet = 8
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Total:", ;
		Height = 17, ;
		Left = 264, ;
		Name = "Label3", ;
		Top = 31, ;
		Width = 32, ;
		ZOrderSet = 36
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Debit", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 475, ;
		Name = "Label4", ;
		Top = 53, ;
		Width = 31, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label5' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Credit", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 575, ;
		Name = "Label5", ;
		Top = 53, ;
		Width = 36, ;
		ZOrderSet = 12
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label6' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Sold", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 675, ;
		Name = "Label6", ;
		Top = 53, ;
		Width = 27, ;
		ZOrderSet = 11
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label7' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Avans", ;
		FontBold = .T., ;
		Height = 17, ;
		Left = 378, ;
		Name = "Label7", ;
		Top = 53, ;
		Width = 37, ;
		ZOrderSet = 14
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label8' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Precedente", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 269, ;
		Name = "Label8", ;
		Top = 70, ;
		Width = 75, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label9' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "In luna curenta", ;
		FontBold = .T., ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 269, ;
		Name = "Label9", ;
		Top = 88, ;
		Width = 98, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		Anchor = 9, ;
		BackStyle = 0, ;
		Height = 104, ;
		Left = 250, ;
		Name = "Shape1", ;
		SpecialEffect = 0, ;
		Top = 38, ;
		Width = 540, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Text1' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 236,247,255, ;
		ControlSource = "thisform.nprecdeb", ;
		DisabledBackColor = 236,249,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 475, ;
		Name = "Text1", ;
		TabStop = .F., ;
		Top = 69, ;
		Width = 100, ;
		ZOrderSet = 24
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text10' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 187,235,255, ;
		ControlSource = "thisform.ntotdeb", ;
		DisabledBackColor = 187,235,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 475, ;
		Name = "Text10", ;
		TabStop = .F., ;
		Top = 109, ;
		Width = 100, ;
		ZOrderSet = 32
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text11' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 187,235,255, ;
		ControlSource = "thisform.ntotcred", ;
		DisabledBackColor = 187,235,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 575, ;
		Name = "Text11", ;
		TabStop = .F., ;
		Top = 109, ;
		Width = 100, ;
		ZOrderSet = 33
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text12' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 187,235,255, ;
		ControlSource = "thisform.nsoldtot", ;
		DisabledBackColor = 187,235,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 675, ;
		Name = "Text12", ;
		TabStop = .F., ;
		Top = 109, ;
		Width = 100, ;
		ZOrderSet = 34
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text2' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 236,247,255, ;
		ControlSource = "thisform.npreccred", ;
		DisabledBackColor = 236,249,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 575, ;
		Name = "Text2", ;
		TabStop = .F., ;
		Top = 69, ;
		Width = 100, ;
		ZOrderSet = 25
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text3' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 236,247,255, ;
		ControlSource = "thisform.nsoldprec", ;
		DisabledBackColor = 236,249,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 675, ;
		Name = "Text3", ;
		TabStop = .F., ;
		Top = 69, ;
		Width = 100, ;
		ZOrderSet = 26
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text4' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 236,249,255, ;
		ControlSource = "thisform.nprecavans", ;
		DisabledBackColor = 236,249,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 375, ;
		Name = "Text4", ;
		TabStop = .F., ;
		Top = 69, ;
		Width = 100, ;
		ZOrderSet = 15
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text5' AS textbox WITH ;
		Anchor = 9, ;
		ControlSource = "thisform.ntavans", ;
		DisabledBackColor = 255,255,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 375, ;
		Name = "Text5", ;
		TabStop = .F., ;
		Top = 89, ;
		Width = 100, ;
		ZOrderSet = 27
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text6' AS textbox WITH ;
		Anchor = 9, ;
		ControlSource = "thisform.ntdeb", ;
		DisabledBackColor = 255,255,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 475, ;
		Name = "Text6", ;
		TabStop = .F., ;
		Top = 89, ;
		Width = 100, ;
		ZOrderSet = 28
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text7' AS textbox WITH ;
		Anchor = 9, ;
		ControlSource = "thisform.ntcred", ;
		DisabledBackColor = 255,255,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 575, ;
		Name = "Text7", ;
		TabStop = .F., ;
		Top = 89, ;
		Width = 100, ;
		ZOrderSet = 29
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text8' AS textbox WITH ;
		Anchor = 9, ;
		ControlSource = "thisform.ntsold", ;
		DisabledBackColor = 255,255,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 675, ;
		Name = "Text8", ;
		TabStop = .F., ;
		Top = 89, ;
		Width = 100, ;
		ZOrderSet = 30
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text9' AS textbox WITH ;
		Anchor = 9, ;
		BackColor = 187,235,255, ;
		ControlSource = "thisform.ntotavans", ;
		DisabledBackColor = 187,235,255, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		Format = "r", ;
		Height = 20, ;
		InputMask = (get_mask(14,gnPA)), ;
		Left = 375, ;
		Name = "Text9", ;
		TabStop = .F., ;
		Top = 109, ;
		Width = 100, ;
		ZOrderSet = 31
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		*!*	lcfiltru = pcFiltru
		*!*	IF EMPTY(lcFiltru) 
		*!*		lcFiltru=pobalpartfc.ca_baza1.cfiltru
		*!*		MESSAGE("filtru gol")		
		*!*	ENDIF
		save_grid_comment(This.grid1)
		pobalpartfc.ca_baza1.cfiltru=lcfiltru
		pobalpartfc.ca_baza1.afisare()
		restore_grid_comment(This.grid1)
		Select balpartfc
		WITH thisform 
		
			SUM avansprec TO .nprecavans
			SUM avanscur TO .ntavans
			SUM avanstot TO .ntotavans
		
			SUM precdeb to .nprecdeb
			SUM debit TO .ntdeb
			SUM totdeb TO .ntotdeb
		
			SUM preccred TO .npreccred
			SUM credit TO .ntcred
			SUM totcred TO .ntotcred
		
			SUM soldprec TO .nsoldprec
			SUM soldcur TO .ntsold
			SUM soldfinal TO .nsoldtot
		ENDWITH 
			
		Go Top
		
		FOR i = 1 TO 12 
			lctext = 'thisform.text'+ALLTRIM(STR(i))+'.refresh'
			&lctext
		ENDFOR 	
		this.grid1.AutoFit()
		this.grid1.Refresh 
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		
		lcFiltru = Thisform.filtru_pretty
		
		
		If (This.filtru_pretty#"none")
			Thisform.actualizeaza_grid1(lcFiltru)
			If Reccount('balpartfc')=0
				amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Endif
		Endif
		Thisform.but_start_criterii1.SetFocus()
		
		
	ENDPROC

	PROCEDURE do_excel
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		lcAlias = this.grid1.RecordSource 
		lcFiltru = FILTER(lcAlias)
		IF EMPTY(lcFiltru)
			lcFiltru = '.T.'
		ENDIF 
		
		exista_excel=.T.
		lcColumnList = ''
		lcHeaderList = ''
		lcSelect = ''
		llSelect = .T.
		lcType = 'CURSOR'
		lcFrom = lcAlias
		lcWhere = lcFiltru
		lcOrder = 'nume'
		lcOutput = 'crsBalPart'
		
		get_schema_grid(this.grid1,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
		&lcSelect
		IF USED(lcOutput)
			DO export_xls WITH lcOutput IN oproceduri_comune.prg
			USE IN (lcOutput)
		ENDIF 
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		
		
		lcStringCriterii="Nume\nume\T\ID_PART\nom_parteneri" + crlf + ;
			"Cont\cont\T\none\"	+ crlf + ;
			"Analitic\acont\T\none\" + crlf + ;
			"Valuta\i.nume_val\T\id_valuta\nom_valuta" + crlf + ;
			"Cu sold\nofiled\E\(ABS((preccred+credit-(precdeb+debit)-(bprecdeb-bpreccred+bdebit-bcredit)))>0)\" + CRLF + ;
			"Cu avans\nofiled\E\(ABS(bprecdeb-bpreccred+bdebit-bcredit)>0)\" + crlf + ;
			IIF(glEMama, "Sucursala\sucursala\T\ID_SUCURSALA\nom_sucursala" + crlf, "")
		
		DODEFAULT()
		
	ENDPROC

	PROCEDURE Text1.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text10.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text11.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text12.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text2.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text3.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text4.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text5.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text6.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text7.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text8.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Text9.Refresh
		this.forecolor=IIF(thisform.nprecavans>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_ireg_parteneri 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="Label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cfdoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cfdoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDataAct.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDataAct.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDataScad.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDataScad.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDataireg.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDataireg.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNrAct.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNrAct.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotDeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotDeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotCred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotCred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldFinal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldFinal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotDebVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotDebVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotCredVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTotCredVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldVal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSoldVal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatia.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatia.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNrord.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNrord.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cnresp.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cnresp.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDebit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDebit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCredit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCredit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValDebit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValDebit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValCredit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cValCredit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cNume_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCurs.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCurs.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecDeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecDeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecCred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecCred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatia4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatia4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatia5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatia5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cVenChelt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cVenChelt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCod.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCod.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_fact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_fact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_set.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_set.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_part.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cId_part.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column32.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column32.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecValDeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecValDeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecValCred.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrecValCred.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column35.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column35.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSerie_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSerie_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cProcentTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cProcentTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatieTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cExplicatieTVA.combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCod_fiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCod_fiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDatarefpen.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cDatarefpen.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cnrzilepen.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cnrzilepen.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cprocpen.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cprocpen.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cvalpen.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cvalpen.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrimaRata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cPrimaRata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cUltimaRata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cUltimaRata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cRata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTVAI.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTVAI.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTVAI.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAles.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAles.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cContVc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cContVc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cContBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cContBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSwiftBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cSwiftBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAdresaBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cAdresaBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTipSAFT.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTipSAFT.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cTipSAFT._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cInstitutiePublica.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cInstitutiePublica.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cInstitutiePublica._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cEntitateAfiliata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cEntitateAfiliata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cEntitateAfiliata._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCategorieEntitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.cCategorieEntitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_nom_valute1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="oMenuShortcut" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdIncasPl" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_scadente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_neachitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdIncasare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdLunaInitializare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdfooter1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cb_scadente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_totaluri
		*m: butapend
		*m: butdrept
		*m: corderby_assign
		*m: do_venchelt_avans
		*m: do_venchelt_avans_sterge
		*m: filtre
		*m: incaspl
		*m: initializare
		*m: ist_deb_cred
		*m: lblocatrefacere_assign
		*m: llunainitializare_assign
		*m: notacontab
		*m: plati
		*m: salariati
		*p: casc
		*p: ccont
		*p: centitate
		*p: cnewvalue
		*p: coldvalue
		*p: cont
		*p: corderby
		*p: cseparator
		*p: ddataref
		*p: fisier
		*p: lactiv
		*p: lafisaretot
		*p: lblocatrefacere		&& Luna este blocata la refacere - luna initiala, luna inchisa, situatie blocata
		*p: leroare
		*p: llunainitializare
		*p: lmodificare_totaluri
		*p: lmodificata
		*p: lvaluta
		*p: ncreditval
		*p: ndebitval
		*p: nmodificata
		*p: npennegativ
		*p: nprocpen
		*p: ntipsaft
		*p: ntotcredit
		*p: ntotdebit
		*p: ntotsold
		*p: ntotsoldval
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		casc = ASC
		cbuton2 = but_listare1;but_listare2;but_listare3
		ccont = 
		centitate = IP
		cgridsortlist = grid1
		cnewvalue = 
		coldvalue = 
		cont = 0
		corderby = dataact
		cseparator = .
		ddataref = date()
		DoCreate = .T.
		filtru_pretty_ro = 
		fisier = ''
		Height = 431
		lactiv = .F.
		lafisaretot = .F.
		lblocatrefacere = .F.
		leroare = .F.
		llunainitializare = .F.
		lmodificare_totaluri = .F.
		lmodificata = .F.
		lvaluta = .F.
		Name = "frm_ireg_parteneri"
		ncreditval = 0
		ndebitval = 0
		nmodificata = 0
		npennegativ = 0
		nprocpen = 0.00
		ntipsaft = 0
		ntotcredit = 0
		ntotdebit = 0
		ntotsold = 0
		ntotsoldval = 0
		Width = 799
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="centitate" display="cEntitate"/>
			<memberdata name="lafisaretot" display="lAfisareTot"/>
			<memberdata name="ntipsaft" display="nTipSaft"/>
		</VFPData>
		_shape1.Anchor = 11
		_shape1.Comment = ""
		_shape1.Name = "_shape1"
		_shape1.Width = 792
		_shape1.ZOrderSet = 3
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 642
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 151
		_shape2.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "REGISTRUL"
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 11
		Lb_titlu_alb_b121.Top = -1
		Lb_titlu_alb_b121.ZOrderSet = 5
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 762
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 10
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 6
		Gridsort1.Left = 780
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 24
	*</PropValue>

	ADD OBJECT '_grdfooter1' AS _grdfooter WITH ;
		ccolwithlabel = cNume, ;
		csourcegrdalias = actcv, ;
		csourcegrid = grid1, ;
		csumcolumns = cTotDeb, cTotCred,cSoldFinal,cTotdebVal,cTotCredVal,cSoldVal,cDebit,cCredit,cValDebit,cValCredit,cPrecdeb,cPrecCred,cPrecValDeb,cPrecValCred, ;
		ctotallabelexpression = 'TOTAL', ;
		Height = 35, ;
		Left = 3, ;
		Name = "_grdfooter1", ;
		TabIndex = 36, ;
		Top = 389, ;
		Width = 786
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 9, ;
		Left = 703, ;
		Name = "But_listare1", ;
		TabIndex = 8, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Comment = "", ;
		Left = 554, ;
		Name = "But_reset_criterii1", ;
		TabIndex = 32, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		caction = , ;
		Height = 27, ;
		Left = 584, ;
		Name = "But_start_criterii1", ;
		Picture = ..\grafice\find_sus.bmp, ;
		Style = 0, ;
		TabIndex = 31, ;
		Top = 1, ;
		Width = 31
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 8, ;
		Left = 613, ;
		Name = "But_verifica1", ;
		TabIndex = 5, ;
		ToolTipText = "Verificare coduri fiscale", ;
		Top = 1, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_nom_valute1' AS cb_nom_valute WITH ;
		Anchor = 12, ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Left = 636, ;
		Name = "Cb_nom_valute1", ;
		TabIndex = 14, ;
		Top = 636, ;
		ZOrderSet = 43
		*< END OBJECT: ClassLib="oparteneri.vcx" BaseClass="combobox" />

	ADD OBJECT 'cb_scadente' AS cb_filtru_text WITH ;
		Height = 24, ;
		Left = 247, ;
		Name = "cb_scadente", ;
		RowSource = "Toate,Restante,Scadente astazi,Scadente saptamana curenta,Scadente saptamana urmatoare", ;
		RowSourceType = 1, ;
		TabIndex = 3, ;
		ToolTipText = "Filtreaza facturile Restante, Scadente ", ;
		Top = 36, ;
		Value = Toate, ;
		Width = 198
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="combobox" />

	ADD OBJECT 'ck_neachitate' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 3, ;
		AutoSize = .T., ;
		camp_nume = , ;
		Caption = "Neachitate", ;
		Left = 9, ;
		Name = "ck_neachitate", ;
		TabIndex = 1, ;
		ToolTipText = "Afiseaza doar facturile neachitate", ;
		Top = 39, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_scadente' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 3, ;
		AutoSize = .T., ;
		camp_nume = , ;
		Caption = "Scadente / Penalitati", ;
		Left = 97, ;
		Name = "Ck_scadente", ;
		TabIndex = 2, ;
		ToolTipText = "Scadente / Penalitati", ;
		Top = 39, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'cmdIncasare' AS cmd_executa WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		Caption = "\<Incasare", ;
		Height = 29, ;
		Left = 711, ;
		Name = "cmdIncasare", ;
		TabIndex = 34, ;
		ToolTipText = "Incasare facturi selectate", ;
		Top = 33, ;
		Width = 76
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdIncasPl' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "Plati / Incasari", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 30, ;
		Left = 540, ;
		Name = "cmdIncasPl", ;
		TabIndex = 28, ;
		Top = 516, ;
		Visible = .F., ;
		Width = 105, ;
		ZOrderSet = 46
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cmdLunaInitializare' AS cmd_executa WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		Caption = "Luna initializare!", ;
		Comment = "", ;
		ForeColor = 255,0,0, ;
		Left = 414, ;
		Name = "cmdLunaInitializare", ;
		TabIndex = 35, ;
		ToolTipText = "Atentie, situatia contabila a fost initializata manual si nu se modifica in cazul refacerii/redeschiderii de luna! Click pentru schimbare optiune!", ;
		Top = -1, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Command1' AS commandbutton WITH ;
		Caption = "Note contabile", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 27, ;
		Left = 384, ;
		Name = "Command1", ;
		TabIndex = 27, ;
		Top = 518, ;
		Visible = .F., ;
		Width = 94, ;
		ZOrderSet = 45
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command2' AS commandbutton WITH ;
		Caption = "\<Perechi", ;
		Height = 27, ;
		Left = 648, ;
		Name = "Command2", ;
		TabIndex = 29, ;
		Top = 516, ;
		Visible = .F., ;
		Width = 84, ;
		ZOrderSet = 47
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command3' AS commandbutton WITH ;
		AutoSize = .T., ;
		Caption = "Istoric", ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 30, ;
		Left = 480, ;
		Name = "Command3", ;
		TabIndex = 30, ;
		Top = 516, ;
		Visible = .F., ;
		Width = 59, ;
		ZOrderSet = 49
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'grid1' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 58, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 321, ;
		Left = 3, ;
		Name = "grid1", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RowHeight = 19, ;
		TabIndex = 4, ;
		Top = 66, ;
		Width = 786, ;
		ZOrderSet = 7, ;
		Column1.ColumnOrder = 8, ;
		Column1.ControlSource = "fdoc", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cfdoc", ;
		Column1.ReadOnly = .T., ;
		Column1.Visible = .T., ;
		Column1.Width = 114, ;
		Column2.ColumnOrder = 5, ;
		Column2.ControlSource = "dataAct", ;
		Column2.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cDataAct", ;
		Column2.ReadOnly = .T., ;
		Column2.Visible = .T., ;
		Column2.Width = 89, ;
		Column3.ColumnOrder = 7, ;
		Column3.ControlSource = "dataScad", ;
		Column3.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDataScad", ;
		Column3.ReadOnly = .T., ;
		Column3.Visible = .T., ;
		Column3.Width = 85, ;
		Column4.ColumnOrder = 6, ;
		Column4.ControlSource = "dataIreg", ;
		Column4.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cDataireg", ;
		Column4.ReadOnly = .T., ;
		Column4.Visible = .T., ;
		Column4.Width = 84, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "nrAct", ;
		Column5.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cNrAct", ;
		Column5.ReadOnly = .T., ;
		Column5.Visible = .T., ;
		Column5.Width = 116, ;
		Column6.ColumnOrder = 9, ;
		Column6.Comment = "", ;
		Column6.ControlSource = "nume", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cNume", ;
		Column6.ReadOnly = .T., ;
		Column6.Visible = .T., ;
		Column6.Width = 160, ;
		Column7.ColumnOrder = 11, ;
		Column7.ControlSource = "debit+precdeb", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = (get_mask(12,gnPA)), ;
		Column7.Name = "cTotDeb", ;
		Column7.ReadOnly = .T., ;
		Column7.Visible = .T., ;
		Column7.Width = 106, ;
		Column8.ColumnOrder = 12, ;
		Column8.ControlSource = "credit+preccred", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(12,gnPA)), ;
		Column8.Name = "cTotCred", ;
		Column8.ReadOnly = .T., ;
		Column8.Visible = .T., ;
		Column8.Width = 98, ;
		Column9.ColumnOrder = 13, ;
		Column9.ControlSource = "(precdeb+debit)-(preccred+credit)", ;
		Column9.DynamicBackColor = "RGB(187,235,255)", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.InputMask = (get_mask(12,gnPA)), ;
		Column9.Name = "cSoldFinal", ;
		Column9.ReadOnly = .T., ;
		Column9.Visible = .T., ;
		Column9.Width = 119, ;
		Column10.ColumnOrder = 14, ;
		Column10.ControlSource = "valdebit+precValDeb", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.InputMask = (get_mask(12,gnPval)), ;
		Column10.Name = "cTotDebVal", ;
		Column10.ReadOnly = .T., ;
		Column10.Visible = .T., ;
		Column10.Width = 107, ;
		Column11.ColumnOrder = 15, ;
		Column11.ControlSource = "valcredit+precValCred", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.InputMask = (get_mask(12,gnPval)), ;
		Column11.Name = "cTotCredVal", ;
		Column11.ReadOnly = .T., ;
		Column11.Visible = .T., ;
		Column11.Width = 114, ;
		Column12.ColumnOrder = 16, ;
		Column12.ControlSource = "(precValDeb+valDebit)-(precValCred+valCredit)", ;
		Column12.DynamicBackColor = "RGB(187,235,255)", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.InputMask = (get_mask(12,gnPval)), ;
		Column12.Name = "cSoldVal", ;
		Column12.ReadOnly = .T., ;
		Column12.Visible = .T., ;
		Column12.Width = 108, ;
		Column13.ColumnOrder = 2, ;
		Column13.ControlSource = "acont", ;
		Column13.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cAcont", ;
		Column13.ReadOnly = .T., ;
		Column13.Visible = .T., ;
		Column13.Width = 53, ;
		Column14.ColumnOrder = 17, ;
		Column14.ControlSource = "explicatia", ;
		Column14.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cExplicatia", ;
		Column14.ReadOnly = .T., ;
		Column14.Visible = .T., ;
		Column14.Width = 100, ;
		Column15.ColumnOrder = 18, ;
		Column15.ControlSource = "nrord", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cNrord", ;
		Column15.ReadOnly = .T., ;
		Column15.Visible = .T., ;
		Column15.Width = 107, ;
		Column16.ColumnOrder = 20, ;
		Column16.ControlSource = "nresp", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cnresp", ;
		Column16.ReadOnly = .T., ;
		Column16.Visible = .T., ;
		Column16.Width = 139, ;
		Column17.ColumnOrder = 21, ;
		Column17.ControlSource = "debit", ;
		Column17.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.InputMask = (get_mask(12,gnPA)), ;
		Column17.Name = "cDebit", ;
		Column17.ReadOnly = .T., ;
		Column17.Visible = .T., ;
		Column18.ColumnOrder = 22, ;
		Column18.ControlSource = "credit", ;
		Column18.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.InputMask = (get_mask(12,gnPA)), ;
		Column18.Name = "cCredit", ;
		Column18.ReadOnly = .T., ;
		Column18.Visible = .T., ;
		Column19.ColumnOrder = 23, ;
		Column19.ControlSource = "valDebit", ;
		Column19.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.InputMask = (get_mask(12,gnPval)), ;
		Column19.Name = "cValDebit", ;
		Column19.ReadOnly = .T., ;
		Column19.Visible = .T., ;
		Column19.Width = 102, ;
		Column20.ColumnOrder = 24, ;
		Column20.ControlSource = "valcredit", ;
		Column20.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.InputMask = (get_mask(12,gnPval)), ;
		Column20.Name = "cValCredit", ;
		Column20.ReadOnly = .T., ;
		Column20.Visible = .T., ;
		Column20.Width = 92, ;
		Column21.ColumnOrder = 25, ;
		Column21.ControlSource = "nume_val", ;
		Column21.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cNume_val", ;
		Column21.ReadOnly = .T., ;
		Column21.Visible = .T., ;
		Column21.Width = 80, ;
		Column22.ColumnOrder = 26, ;
		Column22.ControlSource = "curs", ;
		Column22.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.InputMask = (get_mask(12,gnPcurs2)), ;
		Column22.Name = "cCurs", ;
		Column22.ReadOnly = .T., ;
		Column22.Visible = .T., ;
		Column22.Width = 101, ;
		Column23.ColumnOrder = 27, ;
		Column23.ControlSource = "precDeb", ;
		Column23.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.InputMask = (get_mask(12,gnPA)), ;
		Column23.Name = "cPrecDeb", ;
		Column23.ReadOnly = .T., ;
		Column23.Visible = .T., ;
		Column23.Width = 106, ;
		Column24.ColumnOrder = 28, ;
		Column24.ControlSource = "precCred", ;
		Column24.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.InputMask = (get_mask(12,gnPA)), ;
		Column24.Name = "cPrecCred", ;
		Column24.ReadOnly = .T., ;
		Column24.Visible = .T., ;
		Column24.Width = 94, ;
		Column25.ColumnOrder = 31, ;
		Column25.ControlSource = "explicatia4", ;
		Column25.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cExplicatia4", ;
		Column25.ReadOnly = .T., ;
		Column25.Visible = .T., ;
		Column26.ColumnOrder = 32, ;
		Column26.ControlSource = "explicatia5", ;
		Column26.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cExplicatia5", ;
		Column26.ReadOnly = .T., ;
		Column26.Visible = .T., ;
		Column27.ColumnOrder = 33, ;
		Column27.ControlSource = "venChelt", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "cVenChelt", ;
		Column27.ReadOnly = .T., ;
		Column27.Visible = .T., ;
		Column27.Width = 103, ;
		Column28.ColumnOrder = 34, ;
		Column28.ControlSource = "cod", ;
		Column28.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Name = "cCod", ;
		Column28.ReadOnly = .T., ;
		Column28.Visible = .T., ;
		Column28.Width = 94, ;
		Column29.ColumnOrder = 35, ;
		Column29.ControlSource = "id_fact", ;
		Column29.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cId_fact", ;
		Column29.ReadOnly = .T., ;
		Column29.Visible = .T., ;
		Column29.Width = 95, ;
		Column30.ColumnOrder = 36, ;
		Column30.ControlSource = "id_set", ;
		Column30.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.Name = "cId_set", ;
		Column30.ReadOnly = .T., ;
		Column30.Visible = .T., ;
		Column30.Width = 91, ;
		Column31.ColumnOrder = 37, ;
		Column31.ControlSource = "id_part", ;
		Column31.FontName = "Arial", ;
		Column31.FontSize = 10, ;
		Column31.Name = "cId_part", ;
		Column31.ReadOnly = .T., ;
		Column31.Visible = .T., ;
		Column31.Width = 71, ;
		Column32.ColumnOrder = 1, ;
		Column32.ControlSource = "cont", ;
		Column32.FontName = "Arial", ;
		Column32.FontSize = 10, ;
		Column32.Name = "Column32", ;
		Column32.ReadOnly = .T., ;
		Column32.Width = 55, ;
		Column33.ColumnOrder = 29, ;
		Column33.ControlSource = "precvaldeb", ;
		Column33.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column33.FontName = "Arial", ;
		Column33.FontSize = 10, ;
		Column33.InputMask = (get_mask(12,gnPval)), ;
		Column33.Name = "cPrecValDeb", ;
		Column33.ReadOnly = .T., ;
		Column33.Width = 102, ;
		Column34.ColumnOrder = 30, ;
		Column34.ControlSource = "precvalcred", ;
		Column34.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column34.FontName = "Arial", ;
		Column34.FontSize = 10, ;
		Column34.InputMask = (get_mask(12,gnPval)), ;
		Column34.Name = "cPrecValCred", ;
		Column34.ReadOnly = .T., ;
		Column34.Width = 108, ;
		Column35.ColumnOrder = 19, ;
		Column35.ControlSource = "contract", ;
		Column35.FontName = "Arial", ;
		Column35.FontSize = 10, ;
		Column35.Name = "Column35", ;
		Column35.ReadOnly = .T., ;
		Column35.Width = 95, ;
		Column36.ColumnOrder = 3, ;
		Column36.ControlSource = "serie_act", ;
		Column36.FontName = "Arial", ;
		Column36.FontSize = 10, ;
		Column36.Name = "cSerie_act", ;
		Column36.ReadOnly = .T., ;
		Column36.Width = 67, ;
		Column37.ColumnOrder = 38, ;
		Column37.ControlSource = "proc_tva", ;
		Column37.FontName = "Arial", ;
		Column37.FontSize = 10, ;
		Column37.Name = "cProcentTVA", ;
		Column37.ReadOnly = .T., ;
		Column38.ColumnOrder = 39, ;
		Column38.ControlSource = "explicatie_TVA", ;
		Column38.DynamicBackColor = "IIF(THIS.READONLY,RGB(255,255,255),RGB(252,255,183))", ;
		Column38.FontName = "Arial", ;
		Column38.FontSize = 10, ;
		Column38.Name = "cExplicatieTVA", ;
		Column38.ReadOnly = .T., ;
		Column38.Sparse = .T., ;
		Column38.Width = 148, ;
		Column39.ColumnOrder = 40, ;
		Column39.ControlSource = "sucursala", ;
		Column39.FontName = "Arial", ;
		Column39.FontSize = 10, ;
		Column39.Name = "cSucursala", ;
		Column39.ReadOnly = .T., ;
		Column39.Width = 151, ;
		Column40.ColumnOrder = 10, ;
		Column40.ControlSource = "cod_fiscal", ;
		Column40.FontName = "Arial", ;
		Column40.FontSize = 10, ;
		Column40.Name = "cCod_fiscal", ;
		Column40.ReadOnly = .T., ;
		Column40.Width = 98, ;
		Column41.ControlSource = "datarefpen", ;
		Column41.FontName = "Arial", ;
		Column41.FontSize = 10, ;
		Column41.Name = "cDatarefpen", ;
		Column41.ReadOnly = .T., ;
		Column41.Width = 145, ;
		Column42.ControlSource = "nrzilepen", ;
		Column42.FontName = "Arial", ;
		Column42.FontSize = 10, ;
		Column42.Name = "cnrzilepen", ;
		Column42.ReadOnly = .T., ;
		Column42.Width = 96, ;
		Column43.ControlSource = "procpen", ;
		Column43.FontName = "Arial", ;
		Column43.FontSize = 10, ;
		Column43.Name = "cprocpen", ;
		Column43.ReadOnly = .T., ;
		Column43.Width = 109, ;
		Column44.ControlSource = "valpen", ;
		Column44.FontName = "Arial", ;
		Column44.FontSize = 10, ;
		Column44.Name = "cvalpen", ;
		Column44.ReadOnly = .T., ;
		Column44.Width = 112, ;
		Column45.ColumnOrder = 46, ;
		Column45.ControlSource = "dprima_rata", ;
		Column45.FontName = "Arial", ;
		Column45.FontSize = 10, ;
		Column45.Name = "cPrimaRata", ;
		Column45.ReadOnly = .T., ;
		Column45.Width = 96, ;
		Column46.ColumnOrder = 47, ;
		Column46.ControlSource = "dultima_rata", ;
		Column46.FontName = "Arial", ;
		Column46.FontSize = 10, ;
		Column46.Name = "cUltimaRata", ;
		Column46.ReadOnly = .T., ;
		Column46.Width = 97, ;
		Column47.ColumnOrder = 45, ;
		Column47.ControlSource = "rata", ;
		Column47.DynamicAlignment = "", ;
		Column47.FontName = "Arial", ;
		Column47.FontSize = 10, ;
		Column47.Format = "RK", ;
		Column47.InputMask = (get_mask(12,gnPA)), ;
		Column47.Name = "cRata", ;
		Column47.ReadOnly = .T., ;
		Column47.Width = 112, ;
		Column48.ColumnOrder = 49, ;
		Column48.ControlSource = "TVAI", ;
		Column48.CurrentControl = "Check1", ;
		Column48.FontName = "Arial", ;
		Column48.FontSize = 10, ;
		Column48.Name = "cTVAI", ;
		Column48.ReadOnly = .T., ;
		Column48.Sparse = .F., ;
		Column48.Width = 55, ;
		Column49.ColumnOrder = 50, ;
		Column49.ControlSource = "ales", ;
		Column49.CurrentControl = "Check1", ;
		Column49.FontName = "Arial", ;
		Column49.FontSize = 10, ;
		Column49.Name = "cAles", ;
		Column49.ReadOnly = .F., ;
		Column49.Sparse = .F., ;
		Column49.Width = 28, ;
		Column50.ColumnOrder = 48, ;
		Column50.ControlSource = "alltrim(nvl(contvc,'')) + iif(!empty(nvl(acontvc,'')), '.' + alltrim(acontvc), '')", ;
		Column50.FontName = "Arial", ;
		Column50.FontSize = 10, ;
		Column50.Name = "cContVc", ;
		Column50.ReadOnly = .T., ;
		Column50.Width = 86, ;
		Column51.ControlSource = "cont_banca", ;
		Column51.FontName = "Arial", ;
		Column51.FontSize = 10, ;
		Column51.Name = "cContBanca", ;
		Column51.ReadOnly = .T., ;
		Column51.Width = 196, ;
		Column52.ControlSource = "swift_banca", ;
		Column52.FontName = "Arial", ;
		Column52.FontSize = 10, ;
		Column52.Name = "cSwiftBanca", ;
		Column52.ReadOnly = .T., ;
		Column52.Width = 155, ;
		Column53.ControlSource = "banca", ;
		Column53.FontName = "Arial", ;
		Column53.FontSize = 10, ;
		Column53.Name = "cBanca", ;
		Column53.ReadOnly = .T., ;
		Column53.Width = 141, ;
		Column54.ControlSource = "adresa_banca", ;
		Column54.FontName = "Arial", ;
		Column54.FontSize = 10, ;
		Column54.Name = "cAdresaBanca", ;
		Column54.ReadOnly = .T., ;
		Column54.Width = 128, ;
		Column55.Bound = .F., ;
		Column55.ControlSource = "Iif(Seek(actcv.tip_saft,'saft_tip_facturi','cod'),saft_tip_facturi.tip_saftname,'')", ;
		Column55.CurrentControl = "_combobox1", ;
		Column55.FontName = "Arial", ;
		Column55.FontSize = 10, ;
		Column55.Name = "cTipSAFT", ;
		Column55.ReadOnly = .T., ;
		Column55.Sparse = .F., ;
		Column55.Width = 166, ;
		Column56.ControlSource = "institutie_publica", ;
		Column56.CurrentControl = "_checkbox1", ;
		Column56.FontSize = 10, ;
		Column56.Name = "cInstitutiePublica", ;
		Column56.ReadOnly = .T., ;
		Column56.Sparse = .F., ;
		Column56.Width = 61, ;
		Column57.ControlSource = "entitate_afiliata", ;
		Column57.CurrentControl = "_checkbox1", ;
		Column57.FontSize = 10, ;
		Column57.Name = "cEntitateAfiliata", ;
		Column57.ReadOnly = .T., ;
		Column57.Sparse = .F., ;
		Column57.Width = 64, ;
		Column58.ControlSource = "categorie_entitate", ;
		Column58.FontSize = 10, ;
		Column58.Name = "cCategorieEntitate", ;
		Column58.ReadOnly = .T., ;
		Column58.Width = 81
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

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

	ADD OBJECT 'grid1.cAdresaBanca.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 'grid1.cAles.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 41, ;
		Name = "Check1", ;
		ReadOnly = .F., ;
		Top = 35, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'grid1.cAles.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cBanca.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 'grid1.cCategorieEntitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Categorie ent.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grid1.cCod.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grid1.cContBanca.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 'grid1.cContVc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont Ven/Chelt", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cCredit.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cCurs.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Curs de schimb", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cCurs.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cDataAct.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 212,208,200, ;
		Caption = "Data Doc.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cDataAct.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cDataireg.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cDatarefpen.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data referinta penalitati", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cDataScad.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cDebit.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cEntitateAfiliata._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 50, ;
		Name = "_checkbox1", ;
		Top = 65
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid1.cEntitateAfiliata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Ent. afiliata", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grid1.cExplicatia.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cExplicatia4.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cExplicatia5.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cExplicatieTVA.combo1' AS combobox WITH ;
		BoundColumn = 1, ;
		BoundTo = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 24, ;
		Left = 30, ;
		Name = "combo1", ;
		ReadOnly = .T., ;
		RowSource = "jtva_temp.denumire", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Top = 23, ;
		Width = 100
		*< END OBJECT: BaseClass="combobox" />

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

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

	ADD OBJECT 'grid1.cfdoc.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cId_fact.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cId_part.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cId_set.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cInstitutiePublica._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 28, ;
		Name = "_checkbox1", ;
		Top = 53
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grid1.cInstitutiePublica.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Instit. Pub.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cNrAct.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 212,208,200, ;
		Caption = "Nr. Doc.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cNrAct.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cnresp.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cNrord.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cnrzilepen.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 'grid1.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 212,208,200, ;
		Caption = "Nume", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cNume.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cNume_val.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

	ADD OBJECT 'grid1.cPrecCred.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cPrecDeb.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cPrecValCred.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec. Valuta Credit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cPrecValCred.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 = 0,64,128
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cPrecValDeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prec. Valuta Debit", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cPrecValDeb.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 = 0,64,128
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cPrimaRata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data prima rata", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cProcentTVA.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ControlSource = "proc_tva", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 0,64,128
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cprocpen.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent penalitati / zi", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

	ADD OBJECT 'grid1.cSoldFinal.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cSoldVal.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grid1.cSwiftBanca.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 'grid1.cTipSAFT._combobox1' AS _combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "200,0", ;
		ControlSource = "actcv.tip_saft", ;
		Enabled = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 53, ;
		Name = "_combobox1", ;
		ReadOnly = .F., ;
		RowSource = "select tip_saftname,cod from saft_tip_facturi order by tip_saftname into cursor crsTipFacturiX", ;
		RowSourceType = 3, ;
		Top = 65
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

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

	ADD OBJECT 'grid1.cTipSAFT.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cTotCred.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cTotCredVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Credit Valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cTotCredVal.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cTotDeb.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cTotDebVal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Total Debit Valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.cTotDebVal.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid1.cTVAI.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 22, ;
		Name = "Check1", ;
		Top = 59, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

	ADD OBJECT 'grid1.cUltimaRata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data ultima rata", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grid1.cValCredit.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grid1.cValDebit.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grid1.cVenChelt.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 = 0,64,128, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		Height = 17, ;
		Left = 780, ;
		Name = "Gridextra1", ;
		Top = 48, ;
		Width = 19
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Label2' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = (thisform.grid1.cTotDeb.header1.caption), ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 299, ;
		Name = "Label2", ;
		TabIndex = 21, ;
		Top = 576, ;
		Width = 66, ;
		ZOrderSet = 38
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = (thisform.grid1.cTotCred.header1.caption), ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 428, ;
		Name = "Label4", ;
		TabIndex = 22, ;
		Top = 576, ;
		Width = 70, ;
		ZOrderSet = 39
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label5' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Sold", ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 603, ;
		Name = "Label5", ;
		TabIndex = 23, ;
		Top = 576, ;
		Width = 28, ;
		ZOrderSet = 40
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label6' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		Caption = (thisform.grid1.cTotDebVal.header1.caption), ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 259, ;
		Name = "Label6", ;
		TabIndex = 12, ;
		Top = 620, ;
		Width = 106, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label8' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = (thisform.grid1.cTotCredVal.header1.caption), ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 388, ;
		Name = "Label8", ;
		TabIndex = 25, ;
		Top = 619, ;
		Width = 110, ;
		ZOrderSet = 42
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label9' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Sold Valuta", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Height = 19, ;
		Left = 563, ;
		Name = "Label9", ;
		TabIndex = 24, ;
		Top = 620, ;
		Width = 68, ;
		ZOrderSet = 41
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Lb_shortcuts1' AS lb_shortcuts WITH ;
		Caption = "CTRL+F = Terminare; ESC = Renuntare; CTRL+Q = Cautare; CTRL+T = Resetare", ;
		Comment = "", ;
		Left = 6, ;
		Name = "Lb_shortcuts1", ;
		TabIndex = 33, ;
		Top = 15
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'Lb_simplu1' AS lb_simplu WITH ;
		Anchor = 12, ;
		Caption = "Valuta", ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Left = 648, ;
		Name = "Lb_simplu1", ;
		TabIndex = 13, ;
		Top = 612, ;
		ZOrderSet = 30
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'oMenuShortcut' AS menulib WITH ;
		Left = 191, ;
		Name = "oMenuShortcut", ;
		TabIndex = 26, ;
		Top = 10, ;
		ZOrderSet = 44
		*< END OBJECT: ClassLib="utility.vcx" BaseClass="container" />

	ADD OBJECT 'Text1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 12, ;
		ControlSource = "Thisform.ntotdebit", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 238, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		TabIndex = 15, ;
		Top = 594, ;
		Width = 127, ;
		ZOrderSet = 32
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text2' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 12, ;
		ControlSource = "Thisform.ntotcredit", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 371, ;
		Name = "Text2", ;
		ReadOnly = .T., ;
		TabIndex = 16, ;
		Top = 594, ;
		Width = 127, ;
		ZOrderSet = 33
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text3' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 12, ;
		Comment = "", ;
		ControlSource = "Thisform.ntotSold", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPA)), ;
		Left = 504, ;
		Name = "Text3", ;
		ReadOnly = .T., ;
		TabIndex = 17, ;
		Top = 594, ;
		Width = 127, ;
		ZOrderSet = 34
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text4' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 12, ;
		Comment = "", ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 238, ;
		Name = "Text4", ;
		ReadOnly = .T., ;
		TabIndex = 18, ;
		Top = 637, ;
		Width = 127, ;
		ZOrderSet = 35
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text5' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 12, ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 371, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		TabIndex = 19, ;
		Top = 637, ;
		Width = 127, ;
		ZOrderSet = 36
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text6' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 12, ;
		FontCharSet = 238, ;
		FontName = "Segoe UI", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 504, ;
		Name = "Text6", ;
		ReadOnly = .T., ;
		TabIndex = 20, ;
		Top = 637, ;
		Width = 127, ;
		ZOrderSet = 37
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Activate
		*!*	Thisform.WindowState=2
		
		*!*	tw1=Thisform.Width
		*!*	tl1=Thisform.Height
		
		*!*	tw2=Thisform.Width
		*!*	tl2=Thisform.Height
		
		*!*	gw1=Thisform.grid1.Width
		*!*	gl1=Thisform.grid1.Height
		
		*!*	Thisform.grid1.Width = Round(gw1*tw2/tw1,0)
		*!*	Thisform.grid1.Height = Round(gl1*tl2/tl1,0)
		
		*!*	lnlung1 = Thisform._shape1.Width
		*!*	Thisform._shape1.Width = Round(lnlung1*tw2/tw1,0)
		*!*	lndif = Thisform._shape1.Width-lnlung1
		*!*	Thisform._shape2.Left = Thisform._shape2.Left+lndif
		*!*	**
		
		*!*	Thisform.Paint
		*!*	Thisform.Refresh
		
		*!*	Set Safety Off
		*!*	Select actcv
	ENDPROC

	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru,llCautareNoua
		
		If Empty(tcFiltru)
			lcFiltru = poireg_parteneri.ca_baza1.cfiltru
			llCautareNoua=.F.
		Else
			lcFiltru = tcFiltru
			llCautareNoua=.T.
		Endif
		
		
		lcOrder = 'dataact,nract' && This.corderby + " " + This.Casc
		
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		save_grid_tag(Thisform.grid1)
		
		*!*	IF USED("actcv")
		*!*		USE IN actcv
		*!*	ENDIF
		
		poireg_parteneri.ca_baza1.cfiltru = lcFiltru
		poireg_parteneri.ca_baza1.corder = lcOrder
		poireg_parteneri.ca_baza1.afisare()
		
		
		*************************************
		*** FILTRU FACTURI CU TVA INCASARE - VERIFICAT IN RTVAI DUPA DATAACT
		If 'CU TVA INCASARE'$Upper(Thisform.filtru_pretty_ro_full) Or 'FARA TVA INCASARE'$Upper(Thisform.filtru_pretty_ro_full)
			WAIT WINDOW 'Verificare TVAI' NOWAIT 
			This.grid1.cTVAI.Visible = .T.
		
			Update actcv Set tvai = 0
		
		* Selectez inregistrarile din rtvai_istoric pentru toate codurile fiscale din ireg_parteneri luna si contul curent
			TEXT TO lcsql NOSHOW
		    Select i.cod_fiscal,i.data_inceput,
		       Min(NVL2(i.data_sfarsit,
		                i.data_sfarsit - 1,
		                TO_DATE('29991231', 'YYYYMMDD'))) As data_sfarsit
		      From contafin_oracle.rtvai_istoric i
		     Where i.cod_fiscal in (SELECT distinct to_number(regexp_replace(p.cod_fiscal, '[^[:digit:]]')) as cod_fiscal
		  FROM ireg_parteneri i
		  join nom_parteneri p
		    on i.id_part = p.id_part
		 where i.an = ?gnAn
		   and i.luna = ?gnLuna
		   and cont = ?pcCont)
		     Group By i.cod_fiscal, i.data_inceput;
			ENDTEXT
		
			llSucces = goExecutor.oExecuta(m.lcSql, 'crsTVAITemp')
			If m.llSucces
		
				Select crsTVAITemp
				SCAN
					lnCodFiscal = cod_fiscal
					ldData1 = data_inceput
					ldData2 = data_sfarsit
					WAIT WINDOW 'Verificare TVAI Cod fiscal: ' + TRANSFORM(lnCodFiscal) + ' ' + TRANSFORM(RECNO('crsTVAITemp')) + '/' + TRANSFORM(RECC('crsTVAITemp')) NOWAIT 
		*!*				Update actcv Set tvai = 1 Where Int(Val(strtranx(cod_fiscal,"[^0-9]",[],1,,1))) = m.lnCodFiscal And Between(dataact, m.ldData1, m.ldData2)
					Update actcv Set tvai = 1 Where VAL(COD_FISCALFRO) = m.lnCodFiscal And Between(dataact, m.ldData1, m.ldData2)
				Endscan
			Endif
			Use In (Select('crsTVAITemp'))
		
			If 'CU TVA INCASARE'$Upper(Thisform.filtru_pretty_ro_full)
				SELECT * FROM actcv WHERE tvai = 1 INTO CURSOR actcvx NOFILTER 
			Else
				SELECT * FROM actcv WHERE tvai = 0 INTO CURSOR actcvx NOFILTER 
			ENDIF
			USE IN (SELECT('actcv'))
			SELECT * FROM actcvx INTO CURSOR actcv READWRITE  
			USE IN (SELECT('actcvx'))
		Else
			This.grid1.cTVAI.Visible = .F.
		Endif && 'CU TVA INCASARE'
		
		
		restore_grid_tag(Thisform.grid1)
		Thisform.MousePointer= 0
		Thisform.LockScreen=.F.
		
		
		Thisform.cb_nom_valute1.initializare(llCautareNoua)
		Thisform.actualizeaza_totaluri()
		
		Select actcv
		GO TOP 
		*!*	If Thisform.clb_tx_simplu1.Visible=.T.
		*!*		Sum suma To Thisform.nsuma
		*!*	Endif
		*!*	If Thisform.ck_sters.Visible=.T.
		
		*!*	Endif
		Thisform.grid1.SetFocus
		*!*	Thisform.clb_tx_simplu1.text_simplu1.Refresh
		
	ENDPROC

	PROCEDURE actualizeaza_totaluri
		LOCAL lcValuta,lcPoz
		lcValuta=ALLTRIM(THISFORM.cb_nom_valute1.VALUE)
		
		SELECT actcv
		lnPoz=IIF(RECCOUNT('actcv')>0,RECNO(),0)
		
		*!*	SELECT * FROM actcv INTO TABLE c:\actcv_.DBF
		SUM (debit+precdeb),(credit+preccred) TO THISFORM.ntotdebit,THISFORM.ntotcredit
		IF TYPE('actcv.precvalcred')<>'U' AND TYPE('actcv.precvaldeb')<>'U'
			SUM (valdebit+precvaldeb),(valcredit+precvalcred) TO THISFORM.ndebitval,THISFORM.ncreditval FOR nume_val=lcValuta
		ENDIF
		
		IF THISFORM.lactiv
			SUM ((precdeb + debit) - ( preccred + credit)) TO THISFORM.ntotsold
			IF TYPE('actcv.precvalcred')<>'U' AND TYPE('actcv.precvaldeb')<>'U'
				SUM ((precvaldeb + valdebit) - ( precvalcred + valcredit)) TO THISFORM.ntotsoldval FOR nume_val=lcValuta
			ENDIF
		ELSE
			SUM ((preccred + credit) - (precdeb + debit)) TO THISFORM.ntotsold
			IF TYPE('actcv.precvalcred')<>'U' AND TYPE('actcv.precvaldeb')<>'U'
				SUM ((precvalcred + valcredit) - (precvaldeb + valdebit)) TO THISFORM.ntotsoldval FOR nume_val=lcValuta
			ENDIF
		ENDIF
		
		THISFORM.text1.REFRESH
		THISFORM.text2.REFRESH
		THISFORM.text3.REFRESH
		THISFORM.text4.REFRESH
		THISFORM.text5.REFRESH
		THISFORM.text6.REFRESH
		
		Thisform._grdfooter1.calcTotal()
		
		IF RECCOUNT('actcv')>0
			SELECT actcv
			GO lnPoz
		ENDIF
		
	ENDPROC

	PROCEDURE butapend
		Local lnOptiune, llMf
		If m.glLunaInchisa
			Return
		Endif
		llMF = !EMPTY(NVL(actcv.id_mf,0)) && are definite rate cheltuieli/venituri in avans
		
		If Thisform.grid1.ReadOnly
			lcMenu = '\<Deblocare;\-;\Adaug blanc;\Sterg inregistrarea'
		
		Else
			If Thisform.lmodificata
				Thisform.do_modifica()
			Endif
			lcMenu = '\<Revenire;\-;Adaug blanc (CTRL+N);Sterg inregistrarea (CTRL+D)'
		Endif
		
		IF INLIST(LEFT(ALLTRIM(this.cont),3), '471', '472', '475')
			lcMenu = lcMenu + ;
				';\-;Editare rata ' + IIF(LEFT(ALLTRIM(this.cont),3) = '471', 'cheltuieli', IIF(LEFT(ALLTRIM(this.cont),3) = '472', 'venituri', 'subventii')) + ' in avans' + ;
				 ';' + IIF(!m.llMF, '\', '') + 'Stergere rata ' + IIF(LEFT(ALLTRIM(this.cont),3) = '471', 'cheltuieli', IIF(LEFT(ALLTRIM(this.cont),3) = '472', 'venituri', 'subventii')) + ' in avans'
		ENDIF 
		
		lnOptiune = xmenu(m.lcMenu)
		
		if m.lnOptiune = 1 and !this.lLunainitializare and amessagebox('Doriti sa marcati luna ' + padl(m.gnLuna, 2, '0') + '/' + alltrim(str(gnAn)) + ' pentru initializare?' + chr(13) + chr(10) + ;
				'Atentie! Situatia contabila curenta NU va mai fi suprascrisa (refacuta) la Redeschidere de luna sau Refaceri!', 4+32, _screen.Caption) = 6
				This.lLunaInitializare = IsCalendarInit('SET', thisform.cEntitate, Thisform.cont) && oparteneri.prg
		endif 		
		
		
		Do Case
			Case lnOptiune = 1
				Thisform.initializare()
			Case lnOptiune = 3
				Thisform.do_adauga()
			Case lnOptiune = 4
				Thisform.do_sterge()
			CASE lnOptiune = 6
				thisform.do_venchelt_avans
			CASE lnOptiune = 7
				thisform.do_venchelt_avans_sterge
		Endcase
		
		
	ENDPROC

	PROCEDURE butdrept
		local laMenu[3]
		scatter MEMVAR FIELDS EXCEPT an,nl
		
		laMenu=""
		
		IF ISNULL(m.dataact)
			laMenu[1]="\Note contabile"
			lamenu[2]='\Plati/Incasari'
		ELSE
			laMenu[1]="Note contabile"
			lamenu[2]='Plati/Incasari'
		ENDIF
		IF ALLTRIM(pcCont) = '426'
			lamenu[3]='Salariati'
		ELSE 
			lamenu[3]='\-'
		ENDIF 
		*lamenu[3]='Perechi'
		*!*	laMenu[3]="Istoric Debit-Credit"
		thisform.oMenuShortcut.ShowMenu(@laMenu)
		
			
		*!*		MESSAGEBOX(pcCont,0)
		DO CASE
			CASE BAR()=1
			
				thisform.NOTACONTAB
			CASE BAR()=2
				thisform.incaspl 
			CASE BAR()=3
				thisform.salariati 		
		*	CASE BAR()=3		
		*		thisform.plati
		*		thisform.istoric 
		*!*		CASE BAR()=3
		*!*			this.ist_deb_cred
		OTHERWISE 
			
		ENDCASE
		
		
	ENDPROC

	PROCEDURE corderby_assign
		* Fac cautarea din oracle ca sa am randurile ordonate pentru listare?
		LPARAMETERS vNewVal
		this.cAsc = lcAsc
		RETURN 
		*To do: Modify this routine for the Assign method
		IF THIS.corderby = m.vNewVal
			lcASC = IIF(this.casc = 'ASC','DESC','ASC')
		ELSE
			lcASC = 'ASC'
		ENDIF 
		THIS.corderby = m.vNewVal
		this.cAsc = lcAsc
		thisform.actualizeaza_grid1()
		
	ENDPROC

	PROCEDURE do_adauga
		LOCAL lnid_part,lcnume,lcacont,lcfdoc,lnid_fdoc,lnIdFact, lnIdValuta, lcNumeValuta, lnIdFdoc, lcfdoc, lnIdResp, lcResp
		LOCAL llToateIreg, llNou, llBlank
		STORE .F. TO llToateIreg, llNou, llBlank
		
		lnIdValuta = 0
		lcNumeValuta = ""
		lnIdFdoc = 0
		lcfdoc = ""
		lnIdResp = 0
		lcResp = ""
		LOCAL lcTitlu,lcSql,lnSucces,locauta, lcCont, loCont
		STORE "" TO locauta
		lcCont = ALLTRIM(THISFORM.CONT)
		IF [,]$lcCont
			loCont = Caut_cont(,lcCont)
			lcCont = ALLTRIM(loCont.CONT)
		ENDIF
		STORE "" TO locauta
		lnIdSucursala = NULL
		lcSucursala = ''
		IF glEMama
			llToateIreg = .F.
			llNou = .F.
			llBlank = .T.
			loCauta = caut_sucursala(llToateIreg, llNou, llBlank)
			lnIdSucursala = loCauta.id_sucursala
			lcSucursala = loCauta.sucursala
		ELSE 
			lnIdSucursala = gnIdSucursala && pentru o sucursala este id-ul firmei, iar pe firma independenta este null	
		ENDIF 
		
		
		locauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti partenerul ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont))
		IF !EMPTY(locauta.nume)
			lnid_part=locauta.id_part
			lcnume=ALLTRIM(locauta.nume)
		ELSE
			RETURN
		ENDIF
		
		lcacont = []
		IF USED('crsacont')
			USE IN crsacont
		ENDIF
		*!*	lcSql=[select count(*) as aconturi from vplcont_analitic ]+;
		*!*		[where cont=']+ALLTRIM(THISFORM.CONT)+[' and an=]+ALLTRIM(STR(gnAn))
		lcSql=[select count(*) as aconturi from vplcont_analitic ]+;
			[where cont=']+lcCont+[' and an=]+ALLTRIM(STR(gnAn))
		lnSucces = goExecutor.oExecute(lcSql,"crsacont")
		IF lnSucces < 0
			lcTextEroare = goExecutor.cEroare
			aMESSAGEBOX(lcTextEroare,0+48,"Eroare")
		ENDIF
		IF lnSucces > 0 AND crsacont.aconturi>0
			STORE "" TO locauta
		*!*		pcselect = ['select acont,explicatie FROM vplcont_analitic '+]+;
		*!*			["where cont=']+ALLTRIM(THISFORM.CONT)+[' and an=]+ALLTRIM(STR(gnAn))+["]
			pcselect = ['select acont,explicatie FROM vplcont_analitic '+]+;
				["where cont=']+lcCont+[' and an=]+ALLTRIM(STR(gnAn))+["]
			pcfiltru = [1=2]
			pcschema = ['']
			pcorder = [acont]
			pccoloane = [acont]
			pcTitlu = [Alegeti contul analitic]
			pcTitluColoane = [Acont,Explicatie]
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane)
			IF !EMPTY(locauta.acont)
				lcacont=ALLTRIM(locauta.acont)
			ELSE
				IF gnButon=2
					RETURN
				ELSE
					lcacont=""
				ENDIF
			ENDIF
		ENDIF
		IF USED('crsacont')
			USE IN crsacont
		ENDIF
		IF lnSucces > 0
			loValuta = caut_valuta()
			lnIdValuta = IIF(!EMPTY(loValuta.id_valuta), loValuta.id_valuta, 0)
			lcNumeValuta = IIF(!EMPTY(loValuta.nume_val), loValuta.nume_val, "")
			*!* 17.10.2006
			*!* marius.mutu
			IF EMPTY(loValuta.nume_val) OR EMPTY(loValuta.id_valuta)
				loCauta = GetMonedaNationala()
				lnIdValuta = loCauta.id_valuta
				lcNumeValuta = ALLTRIM(locauta.nume_val)
			ENDIF 	
		ENDIF
		IF lnSucces > 0
			loFdoc = caut_fdoc()
			lnIdFdoc = IIF(!EMPTY(loFdoc.id_fdoc), loFdoc.id_fdoc, 0)
			lcfdoc = IIF(!EMPTY(loFdoc.fel_document), loFdoc.fel_document, "")
		ENDIF
		IF lnSucces > 0
			loResp = caut_responsabil()
			lnIdResp = IIF(!EMPTY(loResp.id_responsabil), loResp.id_responsabil, 0)
			lcResp = IIF(!EMPTY(loResp.nume), loResp.nume, "")
		ENDIF
		
		SELECT actcv
		
		APPEND BLANK
		REPLACE CONT WITH lcCont && ALLTRIM(THISFORM.CONT)
		REPLACE acont WITH lcacont
		REPLACE id_ireg_part WITH 0
		REPLACE id_part WITH lnid_part
		REPLACE nume WITH lcnume
		REPLACE id_fdoc WITH 0
		REPLACE fdoc WITH lcfdoc
		REPLACE id_fdoc WITH lnIdFdoc
		REPLACE id_valuta WITH lnIdValuta
		REPLACE id_responsabil WITH lnIdResp
		REPLACE nresp WITH lcResp
		REPLACE nume_val WITH lcNumeValuta
		REPLACE id_responsabil WITH 0
		REPLACE id_lucrare WITH 0
		REPLACE id_fact WITH 0
		REPLACE id_act WITH 0
		REPLACE id_set WITH 0
		REPLACE id_venchelt WITH 0
		REPLACE cod WITH 0
		REPLACE id_sucursala WITH lnIdSucursala, sucursala WITH lcSucursala
		
		THISFORM.lmodificata=.T.
		THISFORM.lvaluta=.F.
		THISFORM.grid1.cfdoc.SETFOCUS()
		*!*	Else
		*!*		Thisform.grid1.SetFocus()
		*!*	Endif
		
	ENDPROC

	PROCEDURE do_cauta
		*!* 16.08.2013
		*!* marius.mutu
		*!* Rate cheltuieli/venituri in avans 471, 472
		
		*!* 09.10.2013
		*!* marius.mutu
		*!* calcul penalitati si pentru sold < 0, in functie de optiunea aleasa
		*!* #3832
		
		Private pcCont
		Local lcFiltru, ldDataRefPen, lnProcPen, lnSemnSold
		Local lcFor, llPenNegativ, llPenalitati, llRateAvans, lnPenNegativ
		*:Global filtrutext
		
		lcFiltru = ""
		pcCont = This.Cont
		
		
		*!*	*scadente
		If This.Ck_scadente.Value = 1
			lcFiltru = lcFiltru + This.Ck_scadente.filtru
		Endif
		
		*!*	neachitate
		If This.Ck_neachitate.Value = 1
			lcFiltru = lcFiltru + This.Ck_neachitate.filtru
		Endif
		
		IF !EMPTY(this.cb_scadente.filtru)
			lcFiltru = lcFiltru + this.cb_scadente.filtru
		ENDIF 
		
		If Pemstatus(Thisform,"filtru_pretty",5)
		Else
			Thisform.AddProperty("filtru_pretty","")
		Endif
		If Len(Thisform.filtru_pretty)>0
			filtrutext=Thisform.filtru_pretty
			If At("AND",filtrutext)=1
				filtrutext=Right(filtrutext,Len(filtrutext)-4)
			Endif
		
			lcFiltru=lcFiltru+" and ("+Alltrim(filtrutext)+")"
		Endif
		
		If !Empty(lcFiltru)
			lcFiltru = [i.cont in ('] + Alltrim(Strtran(Thisform.Cont, [,], [','])) + [') and i.luna = ] + Alltrim(Str(gnLuna)) + [ and i.an = ] + Alltrim(Str(gnAn)) + lcFiltru
		Else
			lcFiltru = [i.cont in ('] + Alltrim(Strtran(Thisform.Cont, [,], [','])) + [') and i.luna = ] + Alltrim(Str(gnLuna)) + [ and i.an = ] + Alltrim(Str(gnAn))
		Endif
		
		If (This.filtru_pretty#"none")
			Thisform.MousePointer= 11
			Thisform.LockScreen=.T.
			Thisform.actualizeaza_grid1(lcFiltru)
			Thisform.LockScreen=.F.
			Thisform.MousePointer= 0
		
		*** calcul penalitati
			lnSemnSold = Iif(Thisform.lActiv,1,-1)
			lnProcPen = This.nProcPen
			ldDataRefPen = This.dDataRef
			lnPenNegativ = This.nPenNegativ
		
			llPenalitati = (This.Ck_scadente.Value = 1 And m.lnProcPen <> 0)
			llPenNegativ = (This.Ck_scadente.Value = 1 And m.lnPenNegativ = 1) && calcul penalitati pentru sold negativ
		
			With This.grid1
				.cdatarefpen.Visible = llPenalitati
				.cprocpen.Visible = llPenalitati
				.cnrzilepen.Visible = llPenalitati
				.cvalpen.Visible = llPenalitati
			Endwith
			If m.llPenalitati
				If m.llPenNegativ
					lcFor = [lnSemnSold *((precdeb+debit)-(preccred+credit)) <> 0]
				Else
					lcFor = [lnSemnSold *((precdeb+debit)-(preccred+credit)) > 0]
				Endif
				Select actcv
		
				Replace All datarefpen With m.ldDataRefPen, procpen With m.lnProcPen, nrzilepen With Iif(m.ldDataRefPen > datascad, m.ldDataRefPen - datascad, 0) ;
					FOR &lcFor
		
				Replace All valpen With Round(procpen / 100 * lnSemnSold *((precdeb+debit)-(preccred+credit)) * nrzilepen, m.gnPA) For &lcFor
				Go Top
			Endif
		*** calcul penalitati ^
		
			llRateAvans = Inlist(LEFT(This.Cont,3), '471', '472', '475')
			With This.grid1
				.cPrimaRata.Visible = m.llRateAvans
				.cUltimaRata.Visible = m.llRateAvans
				.cRata.Visible = m.llRateAvans
			Endwith
		
		*!*		IF m.llRateAvans
		*!*			REPLACE ALL rata WITH IIF(BETWEEN(m.gnAn*12 + m.gnLuna, YEAR(dprima_rata) * 12 + MONTH(dprima_rata), YEAR(dultima_rata) * 12 + MONTH(dultima_rata)-1),rata, ;
		*!*				IIF( m.gnAn*12 + m.gnLuna = YEAR(dultima_rata) * 12 + MONTH(dultima_rata), ultima_rata, 0)) IN actcv
		*!*		ENDIF
		
		
			If Reccount('actcv')=0
				aMessagebox("Cautarea nu a intors rezultate!",64,"Info cautare")
			Endif
		
		
		
		**************************************
		Endif && (This.filtru_pretty#"none")
		Thisform.but_start_criterii1.SetFocus
		
		
	ENDPROC

	PROCEDURE do_excel
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		lcAlias = this.grid1.RecordSource 
		lcFiltru = FILTER(lcAlias)
		IF EMPTY(lcFiltru)
			lcFiltru = '.T.'
		ENDIF 
		
		exista_excel=.T.
		lcColumnList = ''
		lcHeaderList = ''
		lcSelect = ''
		llSelect = .T.
		lcType = 'CURSOR'
		lcFrom = lcAlias
		lcWhere = lcFiltru
		lcOrder = 'dataact,nract'
		lcOutput = 'crsIregPart'
		
		get_schema_grid(this.grid1,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
		&lcSelect
		IF USED(lcOutput)
			DO export_xls WITH lcOutput IN oproceduri_comune.prg
			USE IN (lcOutput)
		ENDIF 
	ENDPROC

	PROCEDURE do_listare
		LOCAL llActiv, lcRaport, x, lcTitluXLS, lcNume, lcNrAct, lnIdFact
		LOCAL lcCont, lcFiltru, lcTitlu, lctext, lnIdPart, llActiv
		LOCAL lnValoare
		PRIVATE pcTitlu, t1, t2, t3, t4
		PRIVATE pcSemnaturi
		pcTitlu = ""
		pcSemnaturi = ""
		lcTitluXLS = ""
		
		lcRaport = ""
		lcTitlu = ""
		
		llActiv = THIS.lActiv
		
		t1 = THISFORM.grid1.cTotDeb.header1.CAPTION
		t2 = THISFORM.grid1.cTotCred.header1.CAPTION
		
		t3 = THISFORM.grid1.cTotDebVal.header1.CAPTION
		t4 = THISFORM.grid1.cTotCredVal.header1.CAPTION
		lcNume = IIF(!EMPTY(actcv.nume), ALLTRIM(actcv.nume), '')
		lcNrAct = IIF(!EMPTY(actcv.nract), ALLTRIM(STR(actcv.nract)), '')
		SET STEP ON 
		*!*	MESSAGEBOX('EACTIV = ' + TRANSFORM(EACTIV) + CHR(13) + t1 + " " + t2 + CHR(13) + t3 + " " + t4 + CHR(13) + iif(eActiv,t1,t2) + " " + iif(eActiv,t3,t4))
		x = xmenu("Lista facturi simpla;" + ;
			"Lista facturi pe parteneri sold cumulat - lei,valuta;" + ;
			"Lista facturi pe parteneri sold cumulat - lei;" + ;	
			"Lista facturi pe parteneri - lei;" + ;
			"Lista facturi pe parteneri - valuta;" + ;
			"Lista solduri facturi pe parteneri;" + ;
			"Lista facturi cu sold, defalcata pe luni (xlsx);" + ;
			"Centralizator facturi emise in luna;" + ;
			"\-;" + ;
			"Calcul penalitati;" + ;
			"\-;" + ;
			"Facturi \<TVA defalcat " + m.lcNume + ";" + ;
			"Factura "  + lcNrAct + " " + m.lcNume + " TVA defalcat;" + ;
			"\-;" + ;
			"Lista note contabile;" + ;
			"Lista plati/incasari;" + ;
			IIF(ALLTRIM(pcCont) <> '426', "\", "") + "Drepturi de personal neridicate")
		
		
		IF EMPTY(x)
			RETURN
		ENDIF 
		PRIVATE pcSubtitlu
		IF THIS.filtru_traducere() # ""
			lctext = " si " + THIS.filtru_traducere()
		ELSE
			lctext = ""
		ENDIF
		
		pcSubtitlu = THIS.filtru_pretty_ro + lctext
		
		lcFiltru = FILTER('actcv')
		IF EMPTY(m.lcFiltru)
			lcFiltru = '.T.'
		ENDIF
		
		DO CASE
			CASE x = 1
				lcTitlu = "" && Lista facturi simpla
				lcRaport = "ireg_parteneri_rpt1"
				SELECT * ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE &lcFiltru ;
					ORDER BY dataact, nract ;
					INTO CURSOR curent_cursor NOFILTER
		
				lcTitluXLS = 'Lista facturi simpla'
		
			CASE x = 2
				lcTitlu = "pe parteneri" && Lista facturi pe parteneri - lei,valuta
				lcRaport = "ireg_parteneri_rpt2"
				SELECT * ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE &lcFiltru ;
					ORDER BY nume, dataact, nract ;
					INTO CURSOR curent_cursor NOFILTER
		
				lcTitluXLS = 'Lista facturi pe parteneri - lei'
				
			CASE x = 3
				lcTitlu = "pe parteneri" && Lista facturi pe parteneri - lei sold cumulat
				lcRaport = "ireg_parteneri_rpt2lei_cum"
				SELECT * ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE &lcFiltru ;
					ORDER BY nume, dataact, nract ;
					INTO CURSOR curent_cursor NOFILTER
				lcTitluXLS = 'Lista facturi pe parteneri - lei'
		
			CASE x = 4
				lcTitlu = "pe parteneri" && Lista facturi pe parteneri - lei
				lcRaport = "ireg_parteneri_rpt2lei"
				SELECT * ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE &lcFiltru ;
					ORDER BY nume, dataact, nract ;
					INTO CURSOR curent_cursor NOFILTER
				lcTitluXLS = 'Lista facturi pe parteneri - lei'
		
			CASE x = 5
				lcTitlu = "pe parteneri - valuta" && Lista facturi pe parteneri - valuta
				lcRaport = "ireg_parteneri_rpt3"
				SELECT * ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE precvaldeb <> 0 OR precvalcred <> 0 OR valdebit <> 0 OR valcredit <> 0 AND &lcFiltru ;
					ORDER BY nume, dataact, nract ;
					INTO CURSOR curent_cursor NOFILTER
		
				lcTitluXLS = 'Lista facturi pe parteneri - valuta'
		
			CASE x = 6
				lcTitlu = "solduri pe parteneri" && Lista solduri facturi pe parteneri
				lcRaport = "ireg_parteneri_rpt5"
				SELECT nume, nume_val, SUM(precdeb) AS precdeb, SUM(preccred) AS preccred, SUM(precvaldeb) AS precvaldeb, SUM(precvalcred) AS precvalcred, ;
					SUM(debit) AS debit, SUM(credit) AS credit, SUM(valdebit) AS valdebit, SUM(valcredit) AS valcredit ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE &lcFiltru ;
					GROUP BY nume, nume_val ;
					ORDER BY nume, nume_val ;
					INTO CURSOR curent_cursor NOFILTER
		
				lcTitluXLS = 'Lista solduri facturi pe parteneri'
		
			CASE x = 7
				lcTitlu = "sold pe luni" && Lista facturi cu sold defalcat pe luni
				lcRaport = ''
				lcTitluXLS = 'Lista facturi cu sold defalcata pe luni'
				
				select cont, ;
				       acont, ;
				       nume as denumire, ;
				       nrord as lucrare, ;
				       contract, ;
				       nract, ;
				       dataact, ;
				       nvl(datascad, dataact + 30) as datascad, ;
				       nvl(datascad, dataact + 30) - DATE() as zile, ;
				       IIF(m.llActiv, 1, -1) * (precdeb + debit - preccred - credit) as sold, ;
				       explicatia, ;
				       explicatia4, ;
				       explicatia5, ;
				       YEAR(nvl(datascad, dataact + 30)) * 12 + MONTH(nvl(datascad, dataact + 30)) as nrluniscad, ;
				       YEAR(DATE()) * 12 + MONTH(DATE()) as nrluni ;
				 FROM actcv WITH (BUFFERING = .T.) ;
		  		 WHERE IIF(llActiv, 1, -1) * ((precdeb + debit) - (preccred + credit)) # 0 AND &lcFiltru ;
		  		 INTO CURSOR cIregTemp
		  		 		
				select cont, acont, denumire, nract, dataact, datascad, DATE() as dataref, zile, sold, ;
				CAST(IIF(nrluniscad < nrluni, sold, 0.00) as N(20,2)) as sold_restant, ;
				CAST(IIF(nrluniscad = nrluni, sold, 0.00) as N(20,2))  as sold_luna_curenta, ;
				CAST(IIF(nrluniscad = nrluni + 1, sold, 0.00) as N(20,2))  as sold_luna1, ;
				CAST(IIF(nrluniscad = nrluni + 2, sold, 0.00) as N(20,2))  as sold_luna2, ;
				CAST(IIF(nrluniscad = nrluni + 3, sold, 0.00) as N(20,2))  as sold_luna3, ;
				CAST(IIF(nrluniscad = nrluni + 4, sold, 0.00) as N(20,2))  as sold_luna4, ;
				CAST(IIF(nrluniscad >= nrluni + 5, sold, 0.00) as N(20,2))  as sold_luna5plus, ;
				lucrare, contract, explicatia, explicatia4, explicatia5 ;
				from cIregTemp ;
				order by cont, acont, denumire ;
				INTO CURSOR curent_cursor
				
				USE IN (SELECT('cIregTemp'))
				   		
			CASE x = 8
				lcTitlu = "centralizator" && Centralizator facturi emise in luna
				lcRaport = "ireg_parteneri_rpt6"
				SELECT nract, dataact, serie_act, nume, nume_val, SUM(precdeb) AS precdeb, SUM(preccred) AS preccred, SUM(precvaldeb) AS precvaldeb, SUM(precvalcred) AS precvalcred, ;
					SUM(debit) AS debit, SUM(credit) AS credit, SUM(valdebit) AS valdebit, SUM(valcredit) AS valcredit ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE YEAR(DATAIREG) * 12 + MONTH(DATAIREG) = gnAn * 12 + gnLuna AND &lcFiltru ;
					GROUP BY serie_act, nract, dataact, nume, nume_val ;
					ORDER BY dataact, nume, serie_act, nract, nume_val ;
					INTO CURSOR curent_cursor NOFILTER
		
				lcTitluXLS = 'Centralizator facturi emise in luna'
		
			CASE x = 10
				IF !THISFORM.grid1.cvalpen.VISIBLE
					aMESSAGEBOX('Completati data de referinta si procentul de penalitati!', 0 + 48, _SCREEN.CAPTION)
					RETURN
				ENDIF
		
				lcTitlu = "Calcul penalitati" && penalitati - facturile cu sold > 0
				lcRaport = "ireg_parteneri_penalitati_evaluare"
				SELECT nract, dataact, datascad, nume, precdeb, preccred, debit, credit, datarefpen, nrzilepen, procpen, valpen ;
					FROM actcv WITH (BUFFERING = .T.) ;
					WHERE IIF(llActiv, 1, -1) * ((precdeb + debit) - (preccred + credit)) # 0 AND &lcFiltru ;
					ORDER BY nume, dataact, nract ;
					INTO CURSOR curent_cursor NOFILTER
		
				lcTitluXLS = 'Calcul penalitati'
			CASE x = 12
				* Raport TVA defalcat pentru toate facturile furnizorului curent
				lcCont = ALLTRIM(NVL(actcv.CONT, ''))
				lnIdPart = actcv.id_part
				llActiv = Thisform.lActiv
				IF !EMPTY(m.lcCont) AND !EMPTY(m.lnIdPart)
					DO TVADefalcatFacturi IN orapoarte.prg WITH m.lcCont, m.llActiv, m.lnIdPart
				ELSE
					aMESSAGEBOX('Nu ati selectat nici o inregistrare!', 0 + 48, _SCREEN.CAPTION)
				ENDIF
				RETURN
		
			CASE x = 13
				* Raport TVA defalcat pentru factura curenta cu alegerea sumei de defalcat
				lcCont = ALLTRIM(NVL(actcv.CONT, ''))
				lnIdPart = actcv.id_part
				lnIdFact = actcv.id_fact
				llActiv = Thisform.lActiv
				lnValoare = ROUND(IIF(m.llActiv, (actcv.precdeb + actcv.debit) - (actcv.preccred + actcv.credit), ;
					(actcv.preccred + actcv.credit) - (actcv.precdeb + actcv.debit)), m.gnZ)
				IF !EMPTY(m.lcCont) AND !EMPTY(m.lnIdPart) AND !EMPTY(m.lnIdFact)
					lnValoare = aINPUTBOX('Suma', 'Valoare', m.lnValoare)
					IF EMPTY(m.lnValoare)
						RETURN
					ENDIF 
					DO TVADefalcatFacturi IN orapoarte.prg WITH m.lcCont, m.llActiv, m.lnIdPart, m.lnIdFact, m.lnValoare
				ELSE
					aMESSAGEBOX('Nu ati selectat nici o inregistrare!', 0 + 48, _SCREEN.CAPTION)
				ENDIF
				RETURN
		
			CASE x = 15
				* Vizualizare note contabile pentru factura curenta
				thisform.NOTACONTAB()
				RETURN
			CASE x = 16
				* Vizualizare incasari/plati pentru factura curenta
				thisform.incaspl()
				RETURN
			CASE x = 17
				* Vizualizare lista personal drepturi neridicate
				thisform.salariati()
				RETURN
			OTHERWISE
				RETURN
		ENDCASE
		
		*!*	If Empty(lcRaport) Or !Used('curent_cursor')
		*!*		Return
		*!*	Endif
		
		*!*	If Reccount('curent_cursor') = 0
		*!*		AMESSAGEBOX('Raportul nu contine rezultate',0+48,"Raport")
		*!*	Else
		param_listari(lcRaport, , @pcSemnaturi)
		
		pcTitlu = THISFORM.lb_titlu_alb_b121.CAPTION + " " + lcTitlu
		*!*		titlu = ceretitlu_rap('Titlul Raportului', lcTitlu)
		
		*!*		pcDataOra = get_ora(2)
		
		*!*		Thisform.AlwaysOnTop=.F.
		*!*		Select  curent_cursor
		*!*		Report Format &lcRaport To Printer Prompt Preview
		*!*		Thisform.AlwaysOnTop=.T.
		*!*	Endif
		THISFORM.ALWAYSONTOP = .F.
		IF !EMPTY(m.lcRaport)
			goExport.export2frx([curent_cursor], lcRaport, .T., , , , , .T.)
		ENDIF 	
		
		IF EMPTY(m.lcRaport) OR aMESSAGEBOX('Doriti sa exportati datele in format xls?', 4 + 32, _SCREEN.CAPTION) = 6
			goExport.export2xlsx([curent_cursor], m.lcTitluXLS)
		ENDIF
		
		THISFORM.ALWAYSONTOP = .T.
		USE IN (SELECT('curent_cursor'))
		RELEASE pcTitlu
		
	ENDPROC

	PROCEDURE do_modifica
		Parameters tlIesire
		
		LOCAL llInsert, lcIdSucursala
		lcIdSucursala = ''
		llInsert = .F.
		
		Local lcFunctie,lcSql,lcMesaj,lcActiune,lcTitlu,llIesire
		PRIVATE loRec
		llIesire=tlIesire
		If Empty(llIesire)
			llIesire=.F.
		Endif
		Select actcv
		Scatter Name loRec
		nrlin=Recno()
		lnid_part=loRec.id_part
		
		If loRec.id_ireg_part=0
			llInsert = .T.
			lcMesaj=[Doriti sa adaugati aceasta inregistrare?]
			lcActiune=[adaugata]
			lcTitlu=[Adaugare]
		ELSE
			lcMesaj=[Doriti sa modificati aceasta inregistrare?]
			lcActiune=[modificata]
			lcTitlu=[Modificare]
		Endif
		
		Thisform.grid1.SetAll("DynamicFontBold","IIF(RECNO()=nrlin,.T.,.F.)","Column")
		Thisform.grid1.Refresh()
		
		If aMessagebox(lcMesaj,4+32+256,lcTitlu)==6
			Thisform.grid1.SetAll("DynamicFontBold",".F.","Column")
			Thisform.grid1.Refresh()
		
			If Empty(loRec.dataact) And !Isnull(loRec.fdoc)
				aMessagebox("Nu ati introdus data documentului!",0+48,"Atentie")
				Thisform.leroare=.T.
				Thisform.grid1.cDataAct.SetFocus()
				Return
			Endif
		
		*!*		If Empty(loRec.datascad) And !Isnull(loRec.fdoc)
		*!*			Messagebox("Nu ati introdus data scadenta!",0+48,"Atentie")
		*!*			Thisform.leroare=.T.
		*!*			Thisform.grid1.column2.SetFocus()
		*!*			Return
		*!*		Endif
		
			If Empty(loRec.nract) And !Isnull(loRec.fdoc)
				aMessagebox("Nu ati introdus numarul documentului!",0+48,"Atentie")
				Thisform.leroare=.T.
				Thisform.grid1.cNrAct.SetFocus()
				Return
			Endif
		
			If !Thisform.grid1.cNresp.Visible
				AddProperty(loRec,'id_responsabil',Null)
			Endif
		
			If loRec.id_valuta=0 And (loRec.valcredit>0 Or loRec.valdebit>0)
				aMessagebox("Nu ati introdus numele valutei!",0+48,"Atentie")
				Thisform.lvaluta=.T.
				Thisform.leroare=.T.
				Thisform.grid1.cNume_val.SetFocus()
				Return
			Endif
		
			If loRec.id_valuta>0 And loRec.Curs=0
				aMessagebox("Nu ati introdus cursul de schimb!",0+48,"Atentie")
				Thisform.leroare=.T.
				Thisform.grid1.cCurs.SetFocus()
				Return
			ENDIF
			
			
			lnidjtva=VAL(TRANSFORM(loRec.id_jtva_coloana))
			lnproctva=lorec.proc_tva
			lcIdSucursala = IIF(NVL(loRec.id_sucursala,0) = 0, 'NULL', ALLTRIM(STR(lorec.id_sucursala)))
			
			lcSql1=[begin pack_inregistrari.iregpartinsproc(]+NVL(Alltrim(Str(loRec.id_ireg_part)),'0')+[,]+Alltrim(Str(gnAn))+[,]+Alltrim(Str(gnLuna))+[,]+;
				ALLTRIM(Str(loRec.id_part))+[,']+Alltrim(loRec.Cont)+[',']+Nvl(Alltrim(loRec.acont),'')+[',]+;
				ALLTRIM(Str(loRec.Debit,21,4))+[,]+Alltrim(Str(loRec.credit,21,4))+[,]+Alltrim(Str(loRec.valdebit,21,4))+[,]
			lcSql2=Alltrim(Str(loRec.valcredit,21,4))+[,]+Alltrim(Str(loRec.Curs,15,gnPCurs2))+[,]+Nvl(Alltrim(Str(loRec.id_fdoc)),'0')+[,]+;
				[to_date(']+Nvl(Alltrim(Dtos(loRec.dataact)),'')+[','YYYY-MM-DD'),to_date(']+Nvl(Alltrim(Dtos(loRec.dataireg)),'')+[',]+;
				['YYYY-MM-DD'),to_date(']+Nvl(Alltrim(Dtos(loRec.datascad)),'')+[','YYYY-MM-DD'),]+Nvl(Alltrim(Str(loRec.nract)),'')+[,]+;
				[']+NVL(ALLTRIM(loRec.serie_act),[])+[',]
			lcSql3=Nvl(Alltrim(Str(loRec.id_responsabil)),'0')+[,]+Alltrim(Str(loRec.precdeb,21,4))+[,]+Alltrim(Str(loRec.preccred,21,4))+[,]+;
				ALLTRIM(Str(loRec.precvaldeb,21,4))+[,]+ALLTRIM(Str(loRec.precvalcred,21,4))+[,]+NVL(Alltrim(Str(loRec.cod)),'0')+[,']+Nvl(Alltrim(loRec.explicatia),'')+[',]
			lcSql4=Nvl(Alltrim(Str(loRec.id_act)),'0')+[,]+NVL(Alltrim(Str(loRec.id_lucrare)),'0')+[,]+Alltrim(Str(loRec.id_valuta))+[,]+;
				NVL(ALLTRIM(Str(loRec.id_fact)),'0')+[,]+NVL(Alltrim(Str(loRec.id_set)),'0')+[,']+Nvl(Alltrim(loRec.explicatia4),'')+[',']+;
				NVL(Alltrim(loRec.explicatia5),'')+[',]+Nvl(Alltrim(Str(loRec.id_venchelt)),'0')+[,] + ALLTRIM(STR(lnidjtva))+[,]+ALLTRIM(STR(lorec.proc_tva,7,2))+[,] + lcIdSucursala + [); end;]
		
			lnSucces = goExecutor.oExecute(lcSql1+lcSql2+lcSql3+lcSql4)
			If lnSucces < 0
				lcTextEroare = goExecutor.cEroare
				aMessagebox(lcTextEroare,0+48,"Eroare")
			Else
				aMessagebox("Inregistrarea a fost "+lcActiune+"!",0+64,lcTitlu)
			ENDIF
		
			Select actcv
			IF !EMPTY(NVL(loRec.id_ireg_part,0))
				LOCATE FOR id_ireg_part = loRec.id_ireg_part
			ELSE 
				Locate For NVL(id_part,0) = NVL(loRec.id_part,0) And NVL(acont,'') = NVL(loRec.acont,'') And NVL(id_fdoc,0) = NVL(loRec.id_fdoc,0) And NVL(id_valuta,0) = NVL(loRec.id_valuta,0)
			ENDIF 
			If !Found()
				Go Top
			Endif
			pnRec=Recno()
			This.grID1.Refresh()
		*!*		IF llInsert
		*!*			REPLACE id_ireg_part WITH loRec.id_ireg_part, id_fact WITH loRec.id_fact
		*!*		ENDIF 
		Else
			Thisform.grid1.SetAll("DynamicFontBold",".F.","Column")
			Thisform.grid1.Refresh()
		Endif
		
		If !llIesire
			Thisform.MousePointer= 11
			Thisform.LockScreen=.T.
			*Thisform.actualizeaza_grid1()
			Thisform.LockScreen=.F.
			Thisform.MousePointer= 0
		Endif
		Thisform.lmodificata=.F.
		Thisform.lvaluta=.F.
		Thisform.leroare=.F.
	ENDPROC

	PROCEDURE do_reface
		LOCAL lcCont,x
		lcConturi = Alltrim(Thisform.ccont)
		lcSursa = [IREG_PARTENERI]
		lnLuna = gnLuna
		lnAn = gnAn
		
		IF THIS.lBlocatRefacere
			AMESSAGEBOX('Nu se pot da refaceri! (Luna initiala, inchisa sau blocata)',0+48,'Refacere')
			RETURN
		ENDIF 
		
		x= xmenu('Refacere \<completa;\-;\Refacere sume precedente si lunare;Refacere \<sume lunare;Refacere s\<ume precedente')
		DO case
			CASE x = 3
				lcLunar = [1]
			CASE x = 1
				lcLunar = [3]
			CASE x = 4
				lcLunar = [0]
			CASE x = 5
				lcLunar = [2]				
			OTHERWISE
				RETURN 
		ENDCASE 
		
		*!*	lnSucces = goExecutor.oExecute(lcExec)
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
		*!*		RETURN
		*!*	ENDIF 
		
		lnSucces = 1
		lnIx = GETWORDCOUNT(lcConturi, [,])
		FOR i = 1 TO lnIx
			IF lnSucces > 0
				lcCont = GETWORDNUM(lcConturi, i, [,])
				lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
			ENDIF 
		ENDFOR 
		IF lnSucces > 0
			Thisform.actualizeaza_grid1()
		
			do inainte WITH "IREG_PARTENERI",lcCont in oinainte_de.prg
		
			this.LockScreen = .f.
			this.griD1.SetFocus 
			aMESSAGEBOX('Refacerea s-a terminat!',0+64,"Info refacere")
		ENDIF 
		
	ENDPROC

	PROCEDURE do_renunt
		gnButon = 2
		pnButon = 2
		Buton = 2
		pnIesire = 2
		If This.lmodificata
			This.do_modifica(.T.)
		Endif
		If !This.leroare
			This.Release
		Endif
		
	ENDPROC

	PROCEDURE do_reset
		With Thisform
			For i=1 To .Objects.Count
				If Upper(.Objects(i).BaseClass)='CHECKBOX'
					.Objects(i).Value=0
				Endif
			Endfor
		ENDWITH
		
		
		IF NOT PEMSTATUS(thisform,"filtru_pretty",5)
		thisform.AddProperty("filtru_pretty")
		ENDIF
		
		IF NOT PEMSTATUS(thisform,"filtru_pretty_ro",5)
		thisform.AddProperty("filtru_pretty_ro")
		ENDIF
		
		thisform.filtru_pretty=""
		thisform.filtru_pretty_ro=""
		thisform.but_start_criterii1.ToolTipText=thisform.filtru_pretty_ro
		Thisform.but_start_criterii1.SetFocus
		Thisform.Refresh
		thisform.but_start_criterii1.pornit="nu"
		thisform.do_cauta()
		
		
		
	ENDPROC

	PROCEDURE do_sterge
		Select actcv
		Scatter Name loRec
		nrlin=Recno()
		
		Thisform.grid1.SetAll("DynamicFontBold","IIF(RECNO()=nrlin,.T.,.F.)","Column")
		Thisform.grid1.Refresh()
		
		IF loRec.id_ireg_part = 0 OR ISNULL(loRec.id_ireg_part)
			aMESSAGEBOX("Aceasta inregistrare nu este salvata pe server. Repetati cautarea!",0+48,'Stergere')
			RETURN 
		ENDIF 
		
		If aMessagebox("Doriti sa stergeti aceasta inregistrare?",4+32+256,"Confirmare stergere")==6
			Thisform.grid1.SetAll("DynamicFontBold",".F.","Column")
			Thisform.grid1.Refresh()
		
			lcSql=[begin PACK_INREGISTRARI.iregpartdelproc(] + Alltrim(Str(loRec.id_ireg_part))+[); end;]
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				lcTextEroare = goExecutor.cEroare
				aMessagebox(lcTextEroare,0+48,"Eroare")
			Else
				aMessagebox("Inregistrarea a fost stearsa!",0+64,"Info stergere")
			Endif
		
			Thisform.MousePointer= 11
			Thisform.LockScreen=.T.
			Thisform.actualizeaza_grid1()
			Thisform.LockScreen=.F.
			Thisform.MousePointer= 0
		
			Select actcv
			If Reccount()>0
				nrlin=Max(nrlin-1,1)
				Go nrlin
			Endif
			Thisform.grid1.SetFocus()
		Else
			Thisform.grid1.SetAll("DynamicFontBold",".F.","Column")
			Thisform.grid1.Refresh()
		Endif
		
	ENDPROC

	PROCEDURE do_termin
		gnButon = 1
		pnButon = 1
		Buton = 1
		pnIesire = 1
		IF THIS.lmodificata
			THIS.do_modifica(.T.)
		ENDIF
		IF !THIS.leroare
			THIS.RELEASE
		ENDIF
		THIS.BUT_STArt_criterii1.RESETstatus()
		DODEFAULT()
		
	ENDPROC

	PROCEDURE do_venchelt_avans
		*!* 14.04.2020
		*!* marius.mutu
		*!* s-a salvat cont, acont 6[7]xx in imob_nom_mf in loc de imob_lista_mf
		*!* s-a completat cont, acont 47x in loc de 6[7]xx in imob_lista_mf 
		
		Local lcBazatva, lcBunCapital, lcCursor, lcId_cotatva, lcProrataTVA, lcSel, lcSql, lcTva, llSucces, lnFiscala, ldDataOperatie
		Local lnSucces, loAct, lomodifica, lnTip
		Local lcSqlOperatii, lcSqlRate, loPrec
		Local lcExplicatia, lcExplicatia4, lcExplicatia5, lnIdMonedaNationala, loCauta
		
		
		PRIVATE pcLPerFin, pcLPerIn, pcPerFin, pcPerIn, pnIdOperatie
		Private pcCond, pcExplicMf, pcExplicOp, pcacont, pccod, pccont, pcContD, pcAcontD, pcdenumire, pdDataF, pdDataI
		Private pdDataOperatie, pddataact, pddatapif, pnAmortMaxDeductibil, pnButon, pnFiscala, pnIdFact
		Private pnIdMF, pnamort_prec, pncoeficient, pndns, pnid_gestiune, pnid_lucrare
		Private pnid_responsabil, pnid_sectie, pnid_sucursala, pnid_tip_amortizare, pnid_tip_imobilizare
		Private pnnr_inventar, pnnract, pnnrpif, pnprocent, pnuzura, pnvaloare, poMf, poMfOriginal
		Private pdDataRata, poOper, poRata, pnValoareReziduala
		pnValoareReziduala = 0
		
		Select actcv
		Scatter Name loAct
		
		pnButon = 1
		Store '' To lomodifica
		*********************************************
		*** Introducere in imobilizari
		*********************************************
		pnid_tip_imobilizare = Iif(Left(This.Cont, 3) = '471', 4, Iif(Left(This.Cont, 3) = '472', 5, 6)) && cheltuieli in avans (471), venituri in avans (472), subventii (475)
		pnIdFact = loAct.id_fact
		pnIdMF = Nvl(loAct.id_mf, 0)
		ldDataOperatie = loAct.data_operatie
		If !Empty(m.pnIdMF) And (m.gnAn * 12 + m.gnLuna < Year(m.ldDataOperatie) * 12 + Month(m.ldDataOperatie))
			AMESSAGEBOX('Puteti modifica rata doar incepand cu luna ' + Padl(Month(m.ldDataOperatie), 2, '0') + '/' + Alltrim(Str(Year(m.ldDataOperatie))), 0 + 64, _Screen.Caption)
			Return
		Endif
		
		loCauta = GetMonedaNationala()
		lnIdMonedaNationala = m.loCauta.id_valuta
		
		If Empty(Nvl(m.pnIdMF, 0))
			pnnract = loAct.nract
			pddataact = loAct.dataact
			lcExplicatia = Alltrim(Nvl(loAct.explicatia, ''))
			lcExplicatia4 = Alltrim(Nvl(loAct.explicatia4, ''))
			lcExplicatia5 = Alltrim(Nvl(loAct.explicatia5, ''))
			DO CASE 
				CASE !(EMPTY(m.lcExplicatia) AND EMPTY(m.lcExplicatia4))
					pcdenumire = m.lcExplicatia + IIF(!EMPTY(m.lcExplicatia4), ' ' + m.lcExplicatia4, '')
				CASE Left(This.Cont, 3) = '471'
					pcDenumire = 'CHELTUIALA IN AVANS ' + SYS(2015)
				CASE Left(This.Cont, 3) = '472'
					pcDenumire = 'VENIT IN AVANS ' + SYS(2015)
				CASE Left(This.Cont, 3) = '475'
					pcDenumire = 'SUBVENTII ' + SYS(2015)
				OTHERWISE 
					pcDenumire = SYS(2015)		
			ENDCASE 
		
		
			&& Valoarea imobilizarii in valuta facturii
			IF loAct.id_valuta = m.lnIdMonedaNationala
				pnvaloare = Iif(Left(This.Cont, 3) = '471', loAct.precdeb + loAct.debit, loAct.preccred + loAct.credit) && sold
			ELSE
				pnvaloare = Iif(Left(This.Cont, 3) = '471', loAct.precvaldeb + loAct.valdebit, loAct.precvalcred + loAct.valcredit) && sold
			ENDIF 	
			pddatapif = loAct.dataact
			pnnrpif = loAct.nract
			pnnr_inventar = loAct.nract
			pndns = 1 && o luna
			pnuzura = 0
			pnamort_prec = 0
			pccod = '0'
			pnid_tip_amortizare = 1 && Liniara
			pnprocent = 0
			pncoeficient = 0
			pnid_gestiune = 0
			pnid_responsabil = loAct.id_responsabil
			pnid_lucrare = loAct.id_lucrare
			pnid_sectie = 0
			pnid_sucursala = m.gnIdSucursala
		
			* Cont imobilizare 47x
			* se salveaza in imob_lista_mf
			pccont = Alltrim(loAct.Cont) && 471/472/475x
			pcacont = Alltrim(Nvl(loAct.acont, ''))
		
			* Cont venit/cheltuiala 6[7]xx = 47x
			* se salveaza in imob_nom_mf
			pcContD = Iif(This.Cont = '471', '6XX', '7XX')
			pcAcontD = ''
		
			pdDataOperatie = Date(gnAn, gnLuna, 1)
			pcExplicMf = m.lcExplicatia5 && Alltrim(Nvl(loAct.explicatia, ''))
			pcExplicOp = 'Introducere'
			lcBazatva = '0'
			lcTva = '0'
			lcId_cotatva	= '0'
			lcBunCapital = '0'
			lcProrataTVA = '0'
			pnAmortMaxDeductibil = 0
			pnValoareReziduala = 0
		
			lcSql = [begin ] + ;
				[pack_imob.adauga_mf(?@pnIdMf,'] + gcS + [',] + [?pdDataOperatie,] + Alltrim(Str(pnnract)) + [,to_date('] + Dtos(pddataact) + [','YYYYMMDD'),] + ;
				['] + Upper(Alltrim(pcdenumire)) + [',?pcExplicMf,] + Alltrim(Str(pnvaloare, 14, gnPa)) + [,] + Alltrim(Str(pnValoareReziduala, 14, gnPa)) + [,] + ;
				[to_date('] + Dtos(pddatapif) + [','YYYYMMDD'),] + Alltrim(Str(pnnrpif)) + [,] + ;
				ALLTRIM(Str(pnnr_inventar)) + [,'] + Alltrim(pccod) + [',] + ;
				ALLTRIM(Str(pndns)) + [,] + Alltrim(Str(pnuzura)) + [,] + Alltrim(Str(pnamort_prec, 14, gnPa)) + [,] + ;
				IIF(pnid_gestiune <> 0, Alltrim(Str(pnid_gestiune)), 'NULL') + [,] + ;
				IIF(pnid_responsabil <> 0, Alltrim(Str(pnid_responsabil)), 'NULL') + [,] + ;
				IIF(pnid_sectie <> 0, Alltrim(Str(pnid_sectie)), 'NULL') + [,] + ;
				IIF(pnid_lucrare <> 0, Alltrim(Str(pnid_lucrare)), 'NULL') + [,] + ;
				IIF(Nvl(pnid_sucursala, 0) = 0, 'NULL', Alltrim(Str(pnid_sucursala))) + [,] + ;
				ALLTRIM(Str(pnid_tip_amortizare)) + [,] + Alltrim(Str(pnprocent, 6, 2)) + [,] + Iif(Type('pncoeficient') = 'N', Alltrim(Str(pncoeficient, 6, 2)), 'NULL') + [,] + ;
				ALLTRIM(Str(pnid_tip_imobilizare)) + [,'] + Alltrim(pccont) + [',] + ;
				['] + Nvl(Alltrim(pcacont), []) + [',] + Alltrim(Str(gnIdUtil)) + [,] + Alltrim(Str(pnAmortMaxDeductibil, 14, gnPC)) + ;
				[,0,1,?pcExplicOp,] + lcBunCapital + [,] + lcBazatva + [,] + lcTva + [,] + lcId_cotatva + [,] + lcProrataTVA + [); end;]
			llSucces = goExecutor.oExecuta(m.lcSql)
		
			If m.llSucces And !Empty(Nvl(m.pnIdMF, 0))
				*!*			lcSql = [update imob_nom_mf set id_fact = ?pnIdFact where sters = 0 and id_tip_imobilizare = ?pnid_tip_imobilizare and denumire = ?pcDenumire]
				lcSql = [update imob_nom_mf set id_fact = ?pnIdFact, cont = ?pcContD, acont = ?pcAcontD where id_mf = ?pnIdMf]
				llSucces = goExecutor.oExecuta(m.lcSql)
			Endif && m.llSucces
		Endif &&  m.llSucces AND Empty(Nvl(m.pnIdMF,0))
		
		If Empty(Nvl(m.pnIdMF, 0))
			Return
		Endif
		*********************************************
		
		*********************************************
		*** Selectie din imobilizari
		*********************************************
		pdDataI = Date(m.gnAn, m.gnLuna, 1)
		pdDataF = m.pdDataI
		pnFiscala = 0
		pcCond = [a.id_mf = ] + Alltrim(Str(m.pnIdMF))
		*!*	lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?m.pdDataI, ?m.pdDataF, ?m.pcCond, ?m.pnFiscala, ?m.gnIdSucursala)}]
		
		*!*	lcCursor = 'crslista'
		
		*!*	llSucces = goExecutor.oExecuta(lcSel, lcCursor)
		*!*	If !m.llSucces
		*!*		Return
		*!*	Endif
		lnTip = 0 && toate tipurile. filtrez oricum dupa id_mf
		lcCursor = GET_CURSOR_AMORTIZARI(m.lnFiscala, m.gnAn, m.gnLuna, m.lnTip, m.pnIdMF)
		If Empty(m.lcCursor)
			RETURN 
		Endif
			
		SELECT (m.lcCursor)
		Go Top
		Scatter Name poMf
		Scatter Name poMfOriginal
		Use In (Select(m.lcCursor))
		
		* Cont venit/cheltuiala din imob_nom_mf
		lcSqlOperatii = [select cont, acont from imob_nom_mf where id_mf = ?pnIdMF]
		llSucces = goExecutor.oExecuta(lcSqlOperatii, 'crsImob')
		Select crsImob
		Go Top
		AddProperty(poMf, 'contd', Alltrim(Nvl(crsImob.Cont, '')))
		AddProperty(poMf, 'acontd', Alltrim(Nvl(crsImob.acont, '')))
		Use In (Select('crsImob'))
		
		lcSqlOperatii = [select * from imob_voperatii_mf where id_mf = ?pnIdMF order by data_operatie]
		llSucces = goExecutor.oExecuta(lcSqlOperatii, 'crsOperatii')
		Select crsOperatii
		Go Top
		Scatter Name poOper
		pnIdOperatie = id_operatie_mf
		
		Select * From crsOperatii With (Buffering = .T.) Where data_operatie In (Select Max(data_operatie) From crsOperatii) Into Cursor crsOpPrec
		Use In (Select('crsOperatii'))
		
		Select crsOpPrec
		Locate
		Scatter Name loPrec
		Use In (Select('crsOpPrec'))
		
		lcSqlRate = [select * from imob_vcalcul_rate where id_mf = ?pnIdMF and id_operatie_mf = ?pnIdOperatie]
		llSucces = goExecutor.oExecuta(lcSqlRate, 'crsRate')
		Select crsRate
		Go Top
		Scatter Name poRata
		Use In (Select('crsRate'))
		
		poMf.data_achizitie = Ttod(poMf.data_achizitie)
		poMf.data_PIF = Ttod(poMf.data_PIF)
		poMf.data_operatie = Ttod(poMf.data_operatie)
		poMf.data_expirare = Ttod(poMf.data_expirare)
		pdDataRata = Date(poRata.an, poRata.luna, 1)
		poOper.data_operatie = Ttod(poOper.data_operatie)
		poRata.data_ultima_rata = Ttod(poRata.data_ultima_rata)
		
		If Type("pRata.amortizare_prec_rol") = "U"
			AddProperty(poRata, "amortizare_prec_rol", 0)
		Endif
		
		= cctipuri_amort()
		= cctipuri_imob()
		= cctipuri_operatie()
		
		lomodifica = Createobject('frm_venchelt_avans')
		lomodifica.lblInformatii.Caption = "Informatii " + Iif(Left(This.Cont, 3) = '471', 'cheltuieli', Iif(Left(This.Cont, 3) = '471', 'venituri', 'subventii ')) + " in avans"
		lomodifica.Show(1)
		Release lomodifica
		
		*********************************************
		*** Salvare in imobilizari
		*********************************************
		If m.gnButon = 1
			With poMf
				.denumire = Alltrim(Nvl(.denumire, ''))
				.explicatia = Alltrim(Nvl(.explicatia, ''))
				.cod_mf = Alltrim(Nvl(.cod_mf, ''))
				.Cont = Alltrim(Nvl(.Cont, ''))
				.acont = Alltrim(Nvl(.acont, ''))
				.ContD = Alltrim(Nvl(.ContD, ''))
				.acontD = Alltrim(Nvl(.acontD, ''))
			Endwith
		
			*!*		&& daca s-a modificat una din atributele listei, atunci luna modificarii este luna curenta, altfel se pastreaza valabilitatea
			*!*		If poMf.nr_inventar <> poMfOriginal.nr_inventar Or ;
			*!*				poMf.id_lucrare     <> poMfOriginal.id_lucrare Or ;
			*!*				poMf.id_gestiune    <> poMfOriginal.id_gestiune Or ;
			*!*				Nvl(poMf.id_sucursala,0) <> Nvl(poMfOriginal.id_sucursala,0) Or ;
			*!*				poMf.id_sectie      <> poMfOriginal.id_sectie Or ;
			*!*				poMf.id_responsabil <> poMfOriginal.id_responsabil Or ;
			*!*				poMf.dns_luni       <> poMfOriginal.dns_luni Or ;
			*!*				poMf.cod_mf         <> poMfOriginal.cod_mf Or ;
			*!*				poMf.Cont           <> poMfOriginal.Cont Or ;
			*!*				poMf.acont          <> poMfOriginal.acont Or ;
			*!*				poMf.amort_max_deductibil <> poMfOriginal.amort_max_deductibil
		
			*!*			poMf.cPerIn = Padl(gnLuna, 2, '0') + Padl(gnAn, 4, '0')
			*!*		Endif
		
			If poMf.id_sucursala = 0
				poMf.id_sucursala = Null
			Endif
		
			pcPerIn = Padl(poRata.luna, 2, '0') + Alltrim(Str(poRata.an))
			pcPerFin = Padl(poRata.luna_exp, 2, '0') + Alltrim(Str(poRata.an_exp))
			llSucces = goConn.BeginManualTransaction()
			IF m.llSucces
				For lnFiscala = 0 To 1
					pnFiscala = m.lnFiscala
					lcSql = [begin pack_imob.schimba_mf(?poMf.id_mf,] + ;
						[?poMf.nract,] + ;
						[?poMf.data_achizitie,] + ;
						[?poMf.denumire,] + ;
						[?poMf.explicatia,] + ;
						[?poMf.data_pif ,] + ;
						[?poMf.nr_pif ,] + ;
						[?poMf.procent,] + ;
						[?poMf.coeficient,] + ;
						[?poMf.id_tip_amortizare,] + ;
						[?poMf.id_tip_imobilizare,] + ;
						[?poMf.id_lista_mf,] + ;
						[?poMf.dns_luni,] + ;
						[?poMf.Cod_mf ,] + ;
						[?poMf.cont,] + ;
						[?poMf.acont,] + ;
						[?poMf.nr_inventar,] + ;
						[?poMf.id_gestiune,] + ;
						[?poMf.id_responsabil,] + ;
						[?poMf.id_sectie,] + ;
						[?poMf.id_lucrare,] + ;
						[?poMf.id_sucursala,] + ;
						[?poMf.lper_in,] + ;
						[?poMf.lper_fin,] + ;
						[?poOper.id_operatie_mf,] + ;
						[?poOper.id_tip_operatie,] + ;
						[?poOper.valoare_rol,] + ;
						[?poOper.valoare_ramasa_rol,] + ;
						[?poOper.dns_ramas,] + ;
						[?poOper.valoare_reziduala,] + ;
						[?poOper.data_operatie,] + ;
						[?poOper.explicatia,] + ;
						[?poRata.uzura_prec,] + ;
						[?poRata.id_calcul_rate,] + ;
						[?pcPerIn ,] + ;
						[?pcPerFin,] + ;
						[?poRata.rata_rol,] + ;
						[?poRata.cota_an,] + ;
						[?poRata.cota_luna,] + ;
						[?poRata.ultima_rata_rol,] + ;
						[?poRata.data_ultima_rata,] + ;
						[?pnFiscala, ?gnIdUtil, ?poMF.amort_max_deductibil); end;]
		
					llSucces = goExecutor.oExecuta(lcSql)
					If !m.llSucces
						Exit
					Endif
				Endfor && lnFiscal
			ENDIF && llSucces	
		
			* Actualizez imob_nom_mf.cont, acont (cont venit/cheltuiala)
			If m.llSucces
				lcSql = [update imob_nom_mf set cont = ?poMF.contD, acont = ?poMf.acontD where id_mf = ?pnIdMf]
				llSucces = goExecutor.oExecuta(m.lcSql)
			Endif
			
			llSucces = goConn.EndManualTransaction(IIF(m.llSucces, 'COMMIT', 'ROLLBACK'))
			
		ENDIF && gnButon
		This.do_cauta()
		Select actcv
		*Locate For NVL(id_fact,0) = NVL(loAct.id_fact,0) AND NVL(id_part,0) = NVL(loAct.id_part,0) And NVL(acont,'') = NVL(loAct.acont,'') And NVL(id_fdoc,0) = NVL(loAct.id_fdoc,0) And NVL(id_valuta,0) = NVL(loAct.id_valuta,0)
		LOCATE FOR id_ireg_part = loAct.id_ireg_part
		If !Found()
			Go Top
		Endif
		This.grID1.Refresh()
		
		
		
		
		 
	ENDPROC

	PROCEDURE do_venchelt_avans_sterge
		*********************************************
		*** Stergere din imobilizari
		*********************************************
		Local lcsql, llSucces, loRec
		PRIVATE pnIdMF
		Select actcv
		Scatter Name loAct
		pnIdMF = Nvl(loAct.id_mf, 0)
		llSucces = .F.
		If !Empty(m.pnIdMF) And AMESSAGEBOX('Doriti sa stergeti rata?', 4 + 32, _Screen.Caption) = 6
			lcsql = [begin pack_imob.sterge_mf(?pnIdMf,?gnIdUtil); end;]
			llSucces = goExecutor.oExecuta(lcsql)
		ENDIF
		If m.llSucces
			This.do_cauta()
			Select actcv
			* Locate For NVL(id_fact,0) = NVL(loAct.id_fact,0) AND NVL(id_part,0) = NVL(loAct.id_part,0) And NVL(acont,'') = NVL(loAct.acont,'') And NVL(id_fdoc,0) = NVL(loAct.id_fdoc,0) And NVL(id_valuta,0) = NVL(loAct.id_valuta,0)
			LOCATE FOR id_ireg_part = loAct.id_ireg_part
			If !Found()
				Go Top
			Endif
		Endif
		This.grID1.Refresh()
		
		
		
		
		
		
		
		
		 
	ENDPROC

	PROCEDURE do_verifica
		Local loDate As "empty"
		Local lcCodFiscal, lcDenumire, lcFilter, lcSelect, lcWhere, llAutoVerificare, llDontCloseCursor
		Local llExperimental, llMFIN, llServiciuWebANAF, llValidare, llVerificarePlatitorTVA, lnOptiune
		Local lnRaspuns, loPartener, ldDataAct
		lcSelect = SELECT()
		
		SELECT actcv
		lcCodFiscal = Alltrim(actcv.cod_fiscal)
		lcDenumire = Alltrim(actcv.nume)
		ldDataAct = actcv.dataact
		lnOptiune = XMENU('VERIFICA... ' + m.lcDenumire + ' - ANAF; VERIFICA TOTI PARTENERII - ANAF')
		
		If EMPTY(m.lnOptiune)
			Return
		ENDIF
		
		* Pot sa fac verificarea pentru un singur nume si cu formularul pentru mai multi parteneri, dar arata mai dragut informatia intr-un messagebox pentru unul singur
		If m.lnOptiune = 1 && un singur nume
			loPartener = Null
			loDate = Createobject("empty")
		
			AddProperty(loDate, "denumire",  m.lcDenumire)
			AddProperty(loDate, "cod_fiscal", m.lcCodFiscal)
			AddProperty(loDate, "tip_verificare", "ANAF_SERVICIU_WEB")
			AddProperty(loDate, "data", m.ldDataAct)
		
			lnRaspuns = VerificaCodFiscal(loDate, @lnOptiune, @loPartener)
		Else
			llDontCloseCursor = .F.
			llExperimental = .F.
			llVerificarePlatitorTVA = .F. && verific VIES pentru toti partenerii
			llMFIN = .T. && verific MFIN pentru toata lumea
			llValidare = .T. && verific algoritmul codurilor fiscale
			llAutoVerificare = .T. && lanseaza verificarea automata la activate-ul formularului de verificare
			llServiciuWebANAF = .T.
		
			lcFilter = Filter("actcv")
			lcWhere = Iif(m.lnOptiune = 1, "recno() = " + Alltrim(Str(Recno())), Iif(!Empty(m.lcFilter), m.lcFilter, ".T."))
			Select Distinct cod_fiscal, nume as denumire, Iif(Left(Upper(cod_fiscal), 2) = "RO", "RO", "  ") As ATRIBUT_FISCAL, .T. As IsCIF, .F. As codvalid ;
				From actcv ;
				Where &lcWhere ;
				Into Cursor crsCoduriFiscale ;
				Order By nume, cod_fiscal  ;
				Readwrite
		
		
			Local lcXMLParteneri
			lcXMLParteneri = ""
			Cursortoxml('crsCoduriFiscale', "lcXMLParteneri", 1, 0, 0, "1")
		
			Do verificare_parteneri With m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA, m.llAutoVerificare, m.llDontCloseCursor, m.llExperimental, m.llServiciuWebANAF
		Endif && x = 1
		
		SELECT (m.lcSelect)
	ENDPROC

	PROCEDURE filtre
		STORE ".T." TO tfirma,TER,Tachitat,Tneachitat
		sele actcv
		
		if Bfirma==.t. then
			Tfirma="UPPER(LEFT(ACTCV.nume,LEN(M.nume)))==M.nume"
		endif
		
		if Bachitat==.t. then
			Tachitat='ACTCV.totctva=ACTCV.achitat and totctva#0'
		endif
		
		if Bneachitat==.t. then
			Tneachitat='ACTCV.totctva#ACTCV.achitat'
		endif
	ENDPROC

	PROCEDURE grid_sort_bind
		* nu sterge
	ENDPROC

	PROCEDURE incaspl
		Private pnlunanan,pcselect,pcfiltru,pcschema,pcorder,llAfisare,poact
		Local lnTotsum,pcTitlu
		Store "" To poact,pctitlu
		Store .F. To llAfisare
		Store 0 To pnlunanan,lnTotsum
		
		pnlunanan = gnAn*12+gnLuna
		*Thisform.blocbuton1.terminat1.Enabled = .F.
		Thisform.AlwaysOnTop = .F.
		
		*!*	pcschema=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
		*!*		['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
		*!*		['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
		*!*		['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
		*!*		['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
		*!*		['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
		*!*		['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
		*!*		['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		pcschema = ['']
		pcselect = ['select partD,dataact,serie_act,nract,dataireg,suma,perecheC,util,dataora,fdoc,scc,scd,partC,explicatia '+]+;
			['from vact where 2=2']
		
		Select actcv
		Do Case
		Case Thisform.lActiv	&& activ
			pcfiltru = [id_partC=]+Alltrim(STR(id_part))+[ and extract(year from dataireg)*12+extract(month from dataireg)<=]+Alltrim(Str(pnlunanan))+[ ]+;
				[ and id_factc = ] + ALLTRIM(STR(id_fact))+[ and scc=']+Alltrim(Thisform.Cont)+[']+[ and NVL(ascc,'xxx')=']+NVL(ALLTRIM(acont),'xxx')+[']
			pcTitlu = "INCASARI LA FACTURA NR.  "+Alltrim(Str(nract))
			pnachitat = credit+preccred
		Otherwise				&& pasiv
			pcfiltru = [id_partD=]+Alltrim(STR(id_part))+[ and extract(year from dataireg)*12+extract(month from dataireg)<=]+Alltrim(Str(pnlunanan))+[ ]+;
				[ and id_factd = ] + ALLTRIM(STR(id_fact))+[ and scd=']+Alltrim(Thisform.Cont)+[']+[ and NVL(ascd,'xxx')=']+NVL(ALLTRIM(acont),'xxx')+[']
			pcTitlu = "PLATI LA FACTURA NR. "+Alltrim(Str(nract))
			pnachitat = debit + precdeb
		Endcase
		
		pcorder = [dataact,nract]
		gencursor("poact","acn2",pcselect,pcfiltru,pcschema,pcorder,llAfisare)
		poact.ca_baza1.afisare()
		
		GO top
		ORC = Createobj("AFincpl")
		ORC.lb_titlu_alb_b121.Caption = pcTitlu
		ORC.ali = "acn2"
		ORC.grid1.column6.Visible = .T.
		ORC.Show(1)
		
		pcTitlu = ""
		Thisform.AlwaysOnTop = .T.
		*Thisform.blocbuton1.terminat1.Enabled = .T.
		If Used('acn2')
			Use In acn2
		Endif
		Release ORC,poact
		******************************************************
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS tlAfisareTot
		* tlAfisareTot = .T. daca se afiseaza toate inregistrarile la intrarea in formular
		
		This.lAfisareTot = m.tlAfisareTot
		
		DODEFAULT()
		IF THIS.but_modifica1.VISIBLE
			THIS.but_modifica1.VISIBLE=!glLunaInchisa
		ENDIF 
		IF THIS.but_reface1.VISIBLE
			THIS.but_reface1.VISIBLE=!glLunaInchisa
		ENDIF
		this.grID1.cTipSAFT.Visible = m.gl406
		this.gridextra1.setup()
	ENDPROC

	PROCEDURE initializare
		THISFORM.but_start_criterii1.ENABLED = !THISFORM.but_start_criterii1.ENABLED
		THISFORM.but_reset_criterii1.ENABLED = !THISFORM.but_reset_criterii1.ENABLED
		THISFORM.cmDINCASPL.ENABLED = !THISFORM.cmDINCASPL.ENABLED
		THISFORM.comMAND1.ENABLED = !THISFORM.comMAND1.ENABLED
		THISFORM.commAND2.ENABLED = !THISFORM.commAND2.ENABLED
		THISFORM.commAND3.ENABLED = !THISFORM.commAND3.ENABLED
		WITH THISFORM.grid1
			.READONLY = !.READONLY
			.cExplicatieTVA.Combo1.readonly=!.READONLY
			.cTotDeb.READONLY = .T.
			.cTotCred.READONLY = .T.
			.cSoldFinal.READONLY = .T.
			.cTotDebVal.READONLY = .T.
			.cTotCredVal.READONLY = .T.
			.cSoldVal.READONLY = .T.
			.cFDoc.READONLY = .T.
			.cNume.READONLY = .T.
			.cNume_val.READONLY = .T.
			.cNresp.READONLY = .T.
			.cNrord.READONLY = .T.
			.cProcentTVA.readonly= .T.
			.cTipSAFT._combobox1.enabled = !.cTipSAFT._combobox1.enabled
		ENDWITH
		SELECT actcv
		THISFORM.grid1.REFRESH
		THISFORM.grid1.SETFOCUS()
		
		
		
	ENDPROC

	PROCEDURE ist_deb_cred
		Private pnlunanan,lul,pcselect,pcschema,pcfiltru,pcorder,llAfisare,poacn1,poacn2,pcdatacrt,pcnume
		PRIVATE nl,an,pcluna,pcanul
		Store 0 To pnlunanan
		Store .F. To llAfisare
		Store "" To poacn1,poacn2
		pcdatacrt=Alltrim(Str(gnAn))+Padl(Alltrim(Str(gnLuna)),2,'0')+[01]	&& prima zi a lunii
		
		*Thisform.blocbuton1.terminat1.Enabled=.F.
		Thisform.AlwaysOnTop= .F.
		
		pcanul='00'
		pcluna='00'
		Select calendar
		OSE=Crea('SELELUNA')
		OSE.Show(1)
		pnlunanan=gnAn*12+gnLuna
		pnlunaanales=Val(pcanul)*12+Val(pcluna)
		Select actcv
		pcnume=nume
		pnid_part=id_part
		*!*	pcschema=['ID_ACT N(20),LUNA N(2),AN N(4),COD N(20),DATAIREG D,NRACT N(14),DATAACT D,'+]+;
		*!*		['EXPLICATIA C(100),SCD C(4),ASCD C(4),SCC C(4),ASCC C(4),SUMA N(19,2),PERECHED N(14),'+]+;
		*!*		['PERECHEC N(14),SUMA_VAL N(19,2),NUME_VAL C(5),CURS N(8,2),DATASCAD D,NEIMPOZAB N(19,2),'+]+;
		*!*		['NNIR N(10),ID_UTIL N(5),UTIL C(30),DATAORA T,ID_UTILS N(5),UTILS C(30),DATAORAS T,'+]+;
		*!*		['ID_RESPONSABIL N(5),NRESP C(30),ID_VENCHELT N(5),DST_CHLT C(100),ID_LUCRARE N(5),NRORD C(30),ID_SECTIE N(5),'+]+;
		*!*		['SECTIE C(30),PROC_TVA N(5,2),ID_SET N(20),ID_FACT N(20),ID_PARTD N(10),PARTD C(50),ID_PARTC N(10),'+]+;
		*!*		['PARTC C(50),ID_SUCURSALA N(5),SUCURSALA C(50),ID_FDOC N(5),FDOC C(30),'+]+;
		*!*		['EXPLICATIA4 C(100),EXPLICATIA5 C(100),ID_GESTD N(5),GESTD C(50),ID_GESTC N(5),GESTC C(50)']
		pcschema=['']
		pcselect=['select * from ]+gcS+[.vact where 2=2']
		pcorder=[dataact,serie_act,nract]
		pcfiltru=[scd=']+ALLTRIM(thisform.cont)+[' and id_partD=]+ALLTRIM(STR(pnid_part))+[ ]+;
				[and extract(year from dataact)*12+extract(month from dataact) ]+;
				[between ]+Alltrim(Str(pnlunaanales))+[ and ]+Alltrim(Str(pnlunanan))
		gencursor("poacn1","acn1",pcselect,pcfiltru,pcschema,pcorder,llAfisare)
		
		pcfiltru=[scc=']+ALLTRIM(thisform.cont)+[' and id_partC=]+ALLTRIM(STR(pnid_part))+[ ]+;
				[and extract(year from dataact)*12+extract(month from dataact) ]+;
				[between ]+Alltrim(Str(pnlunaanales))+[ and ]+Alltrim(Str(pnlunanan))
		gencursor("poacn2","acn2",pcselect,pcfiltru,pcschema,pcorder,llAfisare)
		
		poacn1.ca_baza1.afisare()
		poacn2.ca_baza1.afisare()
		
		ORC=Createobj("frm_debsicred")
			orc.lb_titlu_alb_b121.caption="SITUATIE ANALITICA - ISTORIC DEBIT CREDIT "
		ORC.Show(1)
		
		If Used('acn1')
			Use In acn1
		Endif
		If Used('acn2')
			Use In acn2
		Endif
		
		*Thisform.blocbuton1.terminat1.Enabled=.T.
		Thisform.AlwaysOnTop= .T.
		RELEASE orc,poacn1,poacn2
		
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		LOCAL lbviz
		lbviz=THIS.bvizualizare
		DO CASE
			CASE (nKeyCode=13 AND nShiftAltCtrl=2) OR (nKeyCode=4 AND nShiftAltCtrl=2)
				If glLunaInchisa OR this.grID1.ReadOnly 
					RETURN
				Endif
				NODEFAULT
			OTHERWISE
				DODEFAULT(nKeyCode, nShiftAltCtrl)
		ENDCASE
		
	ENDPROC

	PROCEDURE lblocatrefacere_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		THIS.lBlocatRefacere = m.vNewVal
		
		this.but_reface1.Visible = !THIS.lBlocatRefacere
		this.but_modifica1.Visible = !THIS.lBlocatRefacere
	ENDPROC

	PROCEDURE llunainitializare_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		THIS.lLunaInitializare = m.vNewVal
		
		this.cmdLunaInitializare.Visible = THIS.llunainitializare
		
		
	ENDPROC

	PROCEDURE notacontab
		If Reccount('actcv')>0
			Private pcselect,pcfiltru,pcschema,pcorder,poact
			Local lcTip,llTest
			Store .F. To llTest
			Store "" To poact
			*Thisform.blocbuton1.terminat1.Enabled=.F.
			Thisform.AlwaysOnTop=.F.
		*!*		lunanan=gnLuna+gnAn*12
			Select actcv
			
			SCATTER NAME oireg
			IF EMPTY(oireg.id_fact)
				pcfiltru = [dataact=to_date(']+Dtos(oireg.dataact)+[','YYYY-MM-DD') and nract=]+ALLTRIM(STR(oireg.nract))+;
				[ and ((id_partd=]+ALLTRIM(STR(oireg.id_part))+[ and ascd=']+NVL(ALLTRIM(oireg.acont),'')+;
				[') or (id_partc=]+ALLTRIM(STR(oireg.id_part))+[ and ascc=']+NVL(ALLTRIM(oireg.acont),'')+['))]
			ELSE 
				pcfiltru = [id_fact=]+ALLTRIM(STR(oireg.id_fact))	
			ENDIF 	
			pcschema=['DATAIREG D,DATAACT D,SERIE_ACT C(10),nract N(20),PARTD C(50),PARTC C(50),EXPLICATIA C(100),'+]+;
				['SUMA N(19,2),SCD C(4),ASCD C(4),SCC C(4), ASCC C(4),FDOC C(30),LUNA N(2),AN N(4),COD N(20),EXPLICATIE_TVA C(100)']
			pcselect=['select dataireg,dataact,serie_act,nract,partd,partc,explicatia,suma,scd,ascd,scc,ascc,fdoc,luna,an,cod,explicatie_tva '+]+;
				['from ]+gcS+[.vact where 2=2']
			pcorder=[dataact,serie_act,nract]
			llAfisare=.F.
			gencursor('poact','ACN1',pcselect,pcfiltru,pcschema,pcorder,llAfisare)
			poact.ca_baza1.afisare()
			Go Top
			ORC=CREATEOBJECT("frm_debcred")
				orc.lb_titlu_alb_b121.caption="NOTA CONTABILA"
				orc.lb_titlu1.caption=" "+UPPER(ALLTRIM(oireg.nume))+" "
			ORC.Show(1)
			Release poact,ORC
			*Thisform.blocbuton1.terminat1.Enabled=.T.
			Thisform.AlwaysOnTop=.T.
		Else
			aMessagebox("Nu aveti date in cautare!",48,"Atentie")
			Thisform.ck_nrdoc.SetFocus()
		Endif
		RELEASE oireg
		
		
	ENDPROC

	PROCEDURE plati
		THISFORM.CMDTERMIN1.ENABLED=.F.
		SCATTER FIELDS EXCEPT nl,an memv
				SELE ACT
		*		DO NRORD WITH "ACT"
				Set filter to nume=m.nume and pereche=m.nract
				DO NRORD WITH "ACT"
				go top
				ORC=CREATEOBJ("AFDEBCRED")
				ORC.LABELTITLU.CAPTION="Plati"
				ORC.SHOW(1)
		
		THISFORM.CMDTERMIN1.ENABLED=.T.
		
		
	ENDPROC

	PROCEDURE salariati
		
		
		If Reccount('actcv')>0
			Private pcselect,pcfiltru,pcschema,pcorder,postat
			Local lcTip,llTest
			Store .F. To llTest
			Store "" To postat
			*Thisform.blocbuton1.terminat1.Enabled=.F.
			Thisform.AlwaysOnTop=.F.
		*!*		lunanan=gnLuna+gnAn*12
			Select actcv
			PRIVATE oireg
			SCATTER NAME oireg
			
			IF oireg.id_part = gnID_PARTDRNERIDLIC &&lichidare
				pcschema= ['id_stat i,an n(4),luna n(2),NUME C(50),PRENUME C(50),SECTIE C(30),FORMATIE C(64),MARCA n(10),lichidare n(16), bifa n(1),SUMALICNERID n(16)']
		
				pcselect=[select a.id_stat,a.an,a.luna,a.nume,a.prenume,a.sectie,a.formatia,a.marca,a.lichidare,ROUND(a.ACHITLICNERID,0) as bifa,a.SUMALICNERID from sal_vstattot a where 1=2]
				pcfiltru =  [ id_fact_lic = ] +ALLTRIM(STR(oireg.id_fact))
			ELSE &&avans
				pcschema= ['id_stat i,an n(4),luna n(2),NUME C(50),PRENUME C(50),SECTIE C(30),FORMATIE C(64),MARCA n(10),lichidare n(16), bifa n(1),SUMALICNERID n(16)']
		
				pcselect=[select a.id_stat,a.an,a.luna,a.nume,a.prenume,a.sectie,a.formatia,a.marca,a.avans as lichidare,ROUND(a.ACHITAVNERID,0) as bifa,a.SUMAAVNERID as SUMALICNERID  from sal_vstattot a where 1=2]
				pcfiltru =  [ id_fact_av = ] +ALLTRIM(STR(oireg.id_fact))
			ENDIF 
		
		
			
			pcorder=[a.sectie,a.nume,A.PRENUME]
			llAfiseaza=.F.
			gencursor('postat','crsState',pcselect,pcfiltru,pcschema,pcorder,llAfiseaza)
			postat.ca_baza1.afisare()
		
			Select crsState
			ofrmSelect = CREATEOBJECT('frm_alege_neridicati')
			IF oireg.id_part = gnID_PARTDRNERIDLIC &&lichidare
				ofrmSelect.noptiune = 1&& pentru lichidare neridicata
			ELSE 
				ofrmSelect.noptiune = 4&& pentru avans neridicat
			ENDIF 
			ofrmSelect.show(1)
		
			RELEASE oireg
			USE IN crsState
			RELEASE ofrmSelect
			Thisform.AlwaysOnTop=.T.
			
		Else
			aMessagebox("Nu aveti date in cautare!",48,"Atentie")
			Thisform.ck_nrdoc.SetFocus()
		Endif
		RELEASE oireg
		
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		
		this.cmdIncasare.Visible = (this.cCont = '4111')
		
		This.lLunaInitializare = IsCalendarInit('GET', thisform.cEntitate, This.cont) && oparteneri.prg
		This.lBlocatRefacere = IsBlocatRefacere(thisform.cEntitate, This.cont) && oparteneri.prg
		
		THIS._grdfooter1.attachtogrid(This.GRID1)
		
		* Afisez toate inregistrarile cand intru pentru banca/casa. Sunt putine
		IF this.lAfisareTot
			This.do_reset() && afisarea tuturor inregistrarilo
		ENDIF 
		
		this.WindowState = 2
	ENDPROC

	PROCEDURE But_excel1.Click
		DODEFAULT()
		*!*	Local i,xlsheet,XLApp,tmpsheet
		*!*	exista_excel=.T.
		*!*	p1=''
		*!*	p2=''
		*!*	With Thisform.grid1
		*!*		For nCol=1 To .ColumnCount
		*!*			nColumn=.Columns(nCol).ColumnOrder
		*!*			p1=p1+.Columns(nCol).ControlSource+','
		*!*			For lnobjcol=1 To .Columns(nCol).Objects.Count
		*!*				If Upper(.Columns(nCol).Objects(lnobjcol).BaseClass)='HEADER'
		*!*					p2=p2+Strtran(.Columns(nCol).Objects(lnobjcol).Caption,Chr(32),'_')+','
		*!*					Exit
		*!*				Endif
		*!*			Endfor
		*!*		Endfor
		*!*		p1=Substr(p1,1,Len(p1)-1)
		*!*		p2=Substr(p2,1,Len(p2)-1)
		*!*	Endwith
		*!*	On Error Do exportare With Thisform.grid1.RecordSource,p1,p2
		*!*	tmpsheet = Getobject('','excel.sheet')
		*!*	On Error
		
		*!*	If exista_excel
		*!*		Wait Window "Se transmit datele catre Excel..." Nowait
		
		*!*		XLApp = tmpsheet.Application
		
		*!*		XLApp.workbooks.Close()
		*!*		XLApp.workbooks.Add()
		*!*		poExcel = XLApp.ActiveSheet
		
		*!*		Go Top
		*!*		poExcel.Cells(1,1).Font.Size=16
		*!*		poExcel.Cells(1,1).Font.Bold=.T.
		*!*		poExcel.Cells(1,1)=Thisform.lb_titlu_alb_b121.Caption+" Luna "+Alltrim(Str(gnLuna))+"/"+Alltrim(Str(gnAn))
		*!*		nRows = 3
		*!*		With Thisform.grid1
		*!*			For nCol = 1 To .ColumnCount
		*!*				nColumn = .Columns(nCol).ColumnOrder
		*!*				poExcel.Columns(nColumn).ColumnWidth = .Columns(nCol).Width/7.5
		*!*				For lnobjcol=1 To .Columns(nCol).Objects.Count
		*!*					If Upper(.Columns(nCol).Objects(lnobjcol).BaseClass)='HEADER'
		*!*						poExcel.Cells(nRows,nColumn) = .Columns(nCol).Objects(lnobjcol).Caption
		*!*						Exit
		*!*					Endif
		*!*				Endfor
		*!*				poExcel.Cells(nRows,nColumn).Font.Bold = .T.
		*!*				poExcel.Cells(nRows,nColumn).Interior.ColorIndex = 16
		*!*			Endfor
		*!*			Scan
		*!*				nRows = nRows + 1
		*!*				For nCol = 1 To .ColumnCount
		*!*					nColumn = .Columns(nCol).ColumnOrder
		*!*					If At('CHECK',Upper(.Columns(nCol).CurrentControl))>0
		*!*						poExcel.Cells(nRows,nColumn)=Iif(Eval(.Columns(nCol).ControlSource)==0,'NU','DA')
		*!*					Else
		*!*						poExcel.Cells(nRows,nColumn) = Iif(Empty(Eval(.Columns(nCol).ControlSource)),'',Eval(.Columns(nCol).ControlSource))
		*!*					Endif
		*!*				Endfor
		*!*			Endscan
		*!*		Endwith
		
		*!*		XLApp.Visible = .T.
		*!*	Endif
	ENDPROC

	PROCEDURE But_modifica1.Click
		thisform.butapend
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		Parameters tacriterii
		External Array tacriterii
		#Define crlf Chr(13)+Chr(10)
		#Define lf2 Chr(10)+Chr(10)
		
		lcStringCriterii = "Nr Document\i.nract\N\none\" + crlf + ;
			"Serie Document\i.serie_act\T\none\" + crlf + ;
			"Data document\i.dataact\D\none\" + crlf + ;
			"Data scadenta\i.datascad\D\none\"+ crlf + ;
			"Fel Document\i.fdoc\T\id_fdoc\nom_feldoc" + crlf + ;
			"Lucrare\i.nrord\T\id_lucrare\nom_lucrare"+ crlf + ;
			"Nume firma\i.nume\T\ID_PART\nom_parteneri"+ crlf + ;
			"Contract\i.contract\T\none\"+ crlf + ;
			"Debit\i.Debit\N|get_mask(12,gnPA)\none\"+ crlf + ;
			"Credit\i.credit\N|get_mask(12,gnPA)\none\"+ crlf
		If plactiv
			lcStringCriterii = lcStringCriterii + "Sold\precdeb+debit-credit-preccred\N|get_mask(12,gnPA)\none\"+ crlf
		Else
			lcStringCriterii = lcStringCriterii + "Sold\credit+preccred-precdeb-debit\N|get_mask(12,gnPA)\none\"+ crlf
		Endif
		lcStringCriterii = lcStringCriterii + ;
			"Cont\i.cont\T\none\"+ crlf + ;
			"Analitic\i.acont\T\none\"+ crlf + ;
			"Valuta\i.nume_val\T\id_valuta\nom_valuta"+ crlf + ;
			"Explicatia\i.explicatia\T\none\" + crlf + ;
			"Venit/Cheltuieli\i.venChelt\T\ID_VENCHELT\nom_venchel" + crlf + ;
			"Explicatia 4\i.explicatia4\T\none\" + crlf + ;
			"Explicatia 5\i.explicatia5\T\none\" + crlf + ;	
			"Categorie ent.\i.categorie_entitate\T\none\" + crlf + ;		
			"Responsabil\i.nresp\T\ID_RESPONSABIL\nom_parteneri" + crlf + ;
			"Achitate\nofield\E\"
		If Thisform.lActiv
			lcStringCriterii = lcStringCriterii + "(i.precdeb + i.debit) - (i.preccred + i.credit) = 0"
		Else
			lcStringCriterii = lcStringCriterii + "(i.preccred + i.credit) - (i.precdeb + i.debit) = 0"
		Endif
		lcStringCriterii = lcStringCriterii + "\" + crlf + ;
			"Neachitate\nofield\E\"
		If Thisform.lActiv
			lcStringCriterii = lcStringCriterii + "(i.precdeb + i.debit) - ( i.preccred + i.credit) <> 0"
		Else
			lcStringCriterii = lcStringCriterii + "(i.preccred + i.credit) - (i.precdeb + i.debit) <> 0"
		Endif
		lcStringCriterii = lcStringCriterii + "\" + crlf + "Procent TVA\i.proc_tva\N|get_mask(12,gnPA)\none\" + crlf + ;
			"Expl. TVA\i.explicatie_TVA\T\none"
		
		lcStringCriterii = lcStringCriterii + "\" + crlf + 	"Cu TVA Incasare\nofiled\E\(1=1)\-\" + ;
			"Se verifica facturile dupa data si cod fiscal in Registrul TVA Incasare" + lf2 + ;
			"Se afiseaza doar inregistrarile care apar in RTVAI."+ crlf + ;
			"Fara TVA Incasare\nofiled\E\(1=1)\-\" + ;
			"Se verifica facturile dupa data si cod fiscal in Registrul TVA Incasare" + lf2 + ;
			"Se afiseaza doar inregistrarile care NU apar in RTVAI."+ crlf
		
		&& aleg sucursale doar daca sunt pe mama
		If glEMama
			lcStringCriterii = lcStringCriterii + "Sucursala\sucursala\T\ID_SUCURSALA\nom_sucursala"
		Endif
		DoDefault()
		
	ENDPROC

	PROCEDURE Cb_nom_valute1.Init
		thisform.label6.Caption='Total Debit Valuta'
		thisform.label8.caption='Total Credit Valuta'
		thisform.label9.Caption='Sold Valuta'
		this.Enabled=.F.
	ENDPROC

	PROCEDURE Cb_nom_valute1.initializare
		Lparameters tlCautareNoua
		Local lcValuta,lnmaxinreg
		This.RowSource=""
		If Used('crsnumeval')
			Use In crsnumeval
		Endif
		Select Distinct nume_val,Count(*) As nrinreg From actcv Where id_valuta>0 Group By nume_val Order By nume_val Into Cursor crsnumeval
		lnValute = _tally 
		
		If tlCautareNoua
			Select crsnumeval
			Calculate Max(nrinreg) To lnmaxinreg
			Locate For nrinreg=lnmaxinreg
			lcValuta=IIF(lnValute = 0,'Valuta',NUME_VAL)
		Else
			lcValuta=IIF(lnValute = 0,'Valuta',THIS.Value)
		Endif
		
		IF EMPTY(lcValuta) OR ISNULL(lcValuta)
			lcValuta = 'Valuta'
		ENDIF 
		
		This.RowSourceType= 2
		This.RowSource="crsnumeval"
		This.Value=lcValuta
		This.BoundTo=.T.
		If Reccount('crsnumeval')>1
			This.Enabled=.T.
		Endif
		Thisform.label6.Caption='Total Debit '+lcValuta
		Thisform.label8.Caption='Total Credit '+lcValuta
		Thisform.label9.Caption='Sold '+lcValuta
	ENDPROC

	PROCEDURE Cb_nom_valute1.InteractiveChange
		lcValuta=Iif(Empty(This.Value),'Valuta',Alltrim(This.Value))
		Thisform.label6.Caption='Total Debit '+lcValuta
		Thisform.label8.Caption='Total Credit '+lcValuta
		Thisform.label9.Caption='Sold '+lcValuta
		Thisform.actualizeaza_totaluri()
	ENDPROC

	PROCEDURE cb_scadente.Valid
		lcValue = UPPER(This.Value)
		* Toate,Restante,Scadente astazi,Scadente saptamana curenta,Scadente saptamana urmatoare
		DO CASE 
			CASE m.lcValue = 'TOATE'
				This.filtru = ""
				This.cTraducere = ""
				This.Tag = ""
			CASE m.lcValue = 'RESTANTE'
				This.filtru = " and (precdeb+debit-preccred-credit <> 0 and datascad < trunc(sysdate))"
				This.cTraducere = " si Restante"
				This.Tag = " si Restante"
			CASE m.lcValue = 'SCADENTE ASTAZI'
				This.filtru = " and (precdeb+debit-preccred-credit <> 0 and datascad = trunc(sysdate))"
				This.cTraducere = " si Scadente astazi"
				This.Tag = " si Scadente astazi"
			CASE m.lcValue = 'SCADENTE SAPTAMANA CURENTA'
				This.filtru = " and (precdeb+debit-preccred-credit <> 0 and datascad between trunc(sysdate, 'IW') and trunc(sysdate, 'IW') + 6)"
				This.cTraducere = " si Scadente saptamana curenta"	
				This.Tag = " si Scadente saptamana curenta"	
			CASE m.lcValue = 'SCADENTE SAPTAMANA URMATOARE'
				This.filtru = " and (precdeb+debit-preccred-credit <> 0 and datascad between trunc(sysdate, 'IW')+7 and trunc(sysdate, 'IW') + 13)"
				This.cTraducere = " si Scadente sapatamana urmatoare"
				This.Tag = " si Scadente sapatamana urmatoare"				
		ENDCASE 
		
		Thisform.do_cauta()
		Thisform.but_start_criterii1.refreshstatus
		
		thisform._grdfooter1.attachtogrid(thisform.grid1) && se ascund/afiseaza coloane valuta
		Thisform.actualizeaza_totaluri() && nu se mai afisau totalurile dupa attachtogrid
	ENDPROC

	PROCEDURE ck_neachitate.InteractiveChange
		If This.Value = 1
			This.filtru = [ and (precdeb+debit-preccred-credit<>0)] 
			This.cTraducere = " si Neachitate"
			This.Tag = " si Neachitate"
		ELSE
			This.filtru = ""
			This.cTraducere = ""
			This.Tag = ""
		Endif
		Thisform.do_cauta()
		Thisform.but_start_criterii1.refreshstatus
		
		thisform._grdfooter1.attachtogrid(thisform.grid1) && se ascund/afiseaza coloane valuta
		Thisform.actualizeaza_totaluri() && nu se mai afisau totalurile dupa attachtogrid
	ENDPROC

	PROCEDURE Ck_scadente.InteractiveChange
		*!* 05.11.2012
		*!* marius.mutu
		*!* s-a introdus bifa chkPenalitatiTot 
		*!* se afiseaza toate facturile, indiferent daca sunt restante, pentru calculul penalitatilor cu valoare 0
		*!* se foloseste pentru raport juridic
		
		*!* 09.10.2013
		*!* marius.mutu
		*!* s-a introdus bifa chkPenalitatiNegativ
		*!* se calculeaza penalitati pentru sold negativ
		*!* #3832
		
		lccondScad = [1=1]
		If This.Value = 1
			Local llPenalitati
			Private pdDataRef,pdDatascad_max,pnNrluni, pnProcPen, pnPenTot, pnPenNegativ
			pnProcPen = 0.00
			pnNrluni = 0
			pdDataRef = Date()
			pdDatascad_max = pdDataRef
			pnPenTot = 0
			pnPenNegativ = 0
			llPenalitati = .T.
		
			ofrmscad = Createobject('frm_facturi_scadente', m.llPenalitati) && orapoarte_cont.vcx
			ofrmscad.txt_dataref.ControlSource = [pddataref]
			ofrmscad.txt_datamax.ControlSource = [pddatascad_max]
			ofrmscad.txtPenalitati.ControlSource = [pnProcPen]
			ofrmscad.chkPenalitatiTot.ControlSource = [pnPenTot]
			ofrmscad.chkPenalitatiNegativ.ControlSource = [pnPenNegativ]	
			ofrmscad.Show(1)
		
			If gnButon = 1
				If m.pnPenTot = 0 && se afiseaza doar facturile restante, cu penalitati
					lccondScad = [(i.datascad < to_date('] + Dtos(pdDatascad_max) + [','yyyymmdd'))]
					This.Tag=" si data scadenta mai mica decat "+Transform(pdDatascad_max)
				EndIf 	
			Endif
			Thisform.dDataref = m.pdDataRef
			Thisform.nProcPen = m.pnProcPen
			thisform.nPenNegativ = m.pnPenNegativ
		ELSE 
			Thisform.dDataref = {}
			Thisform.nProcPen = 0
			thisform.nPenNegativ = 0	
		Endif
		If This.Value=0
			This.filtru =""
			This.cTraducere=""
			This.Tag=""
		Else
			This.filtru = [ and ] + lccondScad
			This.cTraducere=This.Tag
		Endif
		Thisform.do_cauta()
		Thisform.but_start_criterii1.refreshstatus
		
		thisform._grdfooter1.attachtogrid(thisform.grid1) && se ascund/afiseaza coloane valuta
		Thisform.actualizeaza_totaluri() && nu se mai afisau totalurile dupa attachtogrid
	ENDPROC

	PROCEDURE cmdIncasare.Click
		*!* 24.05.2011
		*!* marius.mutu
		*!* nu se pot introduce documente de pe mama
		
		*!*	25.08.2014
		*!*	marius.mutu
		*!*	se transmit si soldurile pe cote de TVA 24,9,5 pentru cazul in care soldul total este 0
		IF thisform.cCont <> '4111'
			RETURN
		ENDIF 
		lcAlias = thisform.grid1.RecordSource
		
		Local lcXMLFacturi
		If !(luna_inchisa Or m.glEMama)
			Select * From &lcAlias With (Buffering = .T.) ;
				Where ales = 1 ;
				Into Cursor crsFacturiIncasareTemp
				
			If _Tally > 0
				Cursortoxml('crsFacturiIncasareTemp', "lcXMLFacturi", 1, 0, 0, "1")
				Use In (Select('crsFacturiIncasareTemp'))
		
				Do incasare_facturi_sold With m.lcXMLFacturi IN oproceduri_incasari.prg
			Endif
			Use In (Select('crsTVAIncasareTemp'))
		Endif
		
	ENDPROC

	PROCEDURE cmdIncasPl.Click
		thisform.incaspl 
	ENDPROC

	PROCEDURE cmdLunaInitializare.Click
		IF amessagebox('Doriti sa demarcati luna ' + PADL(m.gnLuna, 2, '0') + '/' + ALLTRIM(STR(gnAn)) + ' pentru initializare?' + CHR(13) + CHR(10) + ;
				'Atentie! Situatia contabila curenta va fi suprascrisa (refacuta) la Redeschidere de luna sau Refaceri!', 4+32, _SCREEN.CAPTION) = 6
			Thisform.lLunainitializare = IsCalendarInit('DEL',thisform.cEntitate, Thisform.cont) && oparteneri.prg
			thisform.lBlocatrefacere = IsBlocatRefacere(thisform.cEntitate, Thisform.cont) && oparteneri.prg
		endif
		
	ENDPROC

	PROCEDURE Command1.Click
		thisform.notacontab
	ENDPROC

	PROCEDURE Command2.Click
		SCAT fiel except nl,an MEMV
		thisform.istoric
	ENDPROC

	PROCEDURE Command3.Click
		thisform.ist_deb_cred
	ENDPROC

	PROCEDURE grid1.AfterRowColChange
		Lparameters nColIndex
		If Thisform.leroare
			Nodefault
			Return
		Endif
		Local lnluna
		Select actcv
		lnluna=luna
		If Thisform.lmodificata
		*!*		Thisform.lmodificare_totaluri=.T.
			Thisform.actualizeaza_totaluri()
		*!*		If lnluna=0
		*!*			Thisform.lmodificare_totaluri=.F.
		*!*		Endif
			Thisform.grid1.Refresh
		Endif
	ENDPROC

	PROCEDURE grid1.BeforeRowColChange
		Lparameters nColIndex
		*!*	If !Thisform.lmodificare_totaluri
		Local lnCol
		Private pnRec,pnCol
		If Thisform.grid1.ReadOnly=.F. And NVL(TRANSFORM(Thisform.coldvalue),'') != NVL(TRANSFORM(Thisform.cnewvalue),'')
			Thisform.lmodificata=.T.
		Endif
		If (This.RowColChange= 1 Or This.RowColChange= 3) And Thisform.lmodificata
			For i=1 To This.ColumnCount
				If This.Columns(i).ColumnOrder=nColIndex
					lcColoana="thisform.grid1."+This.Columns(i).Name
					Exit
				Endif
			Endfor
			oColoana=&lcColoana
			If Thisform.coldvalue!=Thisform.cnewvalue And !oColoana.ReadOnly
				If PEMSTATUS(oColoana,"text1",5)
					lValue=oColoana.text1.Value
					lcNumeColoana=Substr(oColoana.ControlSource,At('.',oColoana.ControlSource)+1)
					If Type('oColoana.text1.value')='D' And !oColoana.text1.Valid()
						Nodefault
						Return
					Endif
					Select actcv
					Replace (lcNumeColoana) With lValue
				Endif
			Endif
		
			Thisform.coldvalue=""
			Thisform.cnewvalue=""
			pnRec=Recno()
			Thisform.do_modifica()
			If Thisform.leroare
				Nodefault
				Return
			Endif
		*!*			Thisform.lmodificare_totaluri=.F.
			DoDefault()
		Endif
		*!*	Else
		*!*	*!*		Nodefault
		*!*		Thisform.lmodificare_totaluri=.F.
		*!*	Endif
		
	ENDPROC

	PROCEDURE grid1.cAcont.Text1.GotFocus
		If This.ReadOnly = .F.
			Thisform.coldvalue = Alltrim(This.Value)
			Thisform.cnewvalue = Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cAcont.Text1.InteractiveChange
		If This.ReadOnly = .F.
			Thisform.cnewvalue = Alltrim(This.Value)
		Endif
	ENDPROC

	PROCEDURE grid1.cCod.Text1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=Alltrim(Str(This.Value))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cCod.Text1.InteractiveChange
		If !This.ReadOnly
			Thisform.cnewvalue=Alltrim(Str(This.Value))
		Endif
		
	ENDPROC

	PROCEDURE grid1.cCredit.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cCredit.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cCurs.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cCurs.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cCurs.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cCurs.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cDataAct.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cDataAct.Text1.GotFocus
		If This.ReadOnly=.F.
			Thisform.coldvalue=Alltrim(Dtoc(This.Value))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cDataAct.Text1.InteractiveChange
		If This.ReadOnly=.F.
			Thisform.cnewvalue=Dtoc(This.Value)
		Endif
		
	ENDPROC

	PROCEDURE grid1.cDataAct.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cDataAct.Text1.Valid
		If This.ReadOnly=.F. And !Isnull(fdoc)
			If (Empty(This.Value) Or Isnull(This.Value))
				aMessagebox("Introduceti data documentului!",0+48,"Atentie")
				Return .F.
			Else
				If (Month(This.Value)+Year(This.Value)*12>gnLuna+gnAn*12)
					aMessagebox("Data documentului trebuie sa fie anterioara sau din luna "+Alltrim(Str(gnLuna))+"/"+Alltrim(Str(gnAn))+"!",0+48,"Atentie")
					Thisform.lmodificata=.F.
					Return .F.
				Endif
			Endif
		Endif
		Return .T.
		
	ENDPROC

	PROCEDURE grid1.cDataireg.Text1.GotFocus
		If This.ReadOnly=.F.
			Thisform.coldvalue=NVL(Alltrim(Dtoc(This.Value)),'*')
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cDataireg.Text1.InteractiveChange
		If This.ReadOnly=.F.
			Thisform.cnewvalue=NVL(Dtoc(This.Value),'*')
		Endif
	ENDPROC

	PROCEDURE grid1.cDataireg.Text1.Valid
		If This.ReadOnly=.F. And !Isnull(fdoc)
			If (Empty(This.Value) Or Isnull(This.Value))
				aMessagebox("Introduceti data inregistrarii!",0+48,"Atentie")
				Return .F.
			Else
				Do Case
				Case This.Value<dataact
					aMessagebox("Data inregistrarii trebuie sa fie mai mare sau egala cu data documentului!",0+48,"Atentie")
					Thisform.lmodificata=.F.
					Return .F.
				Case (Month(This.Value)+Year(This.Value)*12<>gnLuna+gnAn*12)
					aMessagebox("Data inregistrarii trebuie sa fie din luna "+Alltrim(Str(gnLuna))+"/"+Alltrim(Str(gnAn))+"!",0+48,"Atentie")
					Thisform.lmodificata=.F.
					Return .F.
				Endcase
			Endif
		Endif
		Return .T.
	ENDPROC

	PROCEDURE grid1.cDataScad.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cDataScad.Text1.GotFocus
		If This.ReadOnly=.F.
			Thisform.coldvalue=Alltrim(Dtoc(This.Value))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cDataScad.Text1.InteractiveChange
		If This.ReadOnly=.F.
			Thisform.cnewvalue=Dtoc(This.Value)
		Endif
	ENDPROC

	PROCEDURE grid1.cDataScad.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cDataScad.Text1.Valid
		*!*		(Empty(This.Value) And !Empty(dataact)) Or (Isnull(This.Value) And !Isnull(dataact))
		*!*			Messagebox("Introduceti data scadenta!",0+48,"Atentie")
		*!*			Return .F.
		*!*		Else
		If This.ReadOnly=.F. And !Isnull(fdoc)
			If !Empty(This.Value) And !Empty(dataact) And This.Value<dataact
				aMessagebox("Data scadenta trebuie sa fie mai mare sau egala cu data documentului!",0+48,"Atentie")
				Thisform.lmodificata=.F.
				Return .F.
			Endif
		Endif
		Return .T.
	ENDPROC

	PROCEDURE grid1.cDebit.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cDebit.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatia.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cExplicatia.Text1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=Nvl(Alltrim(This.Value),'*')
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatia.Text1.InteractiveChange
		If This.ReadOnly=.F.
			Thisform.cnewvalue=NVL(Alltrim(This.Value),'*')
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatia.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cExplicatia4.Text1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=NVL(Alltrim(This.Value),'*')
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatia4.Text1.InteractiveChange
		If !This.ReadOnly
			Thisform.cnewvalue=NVL(Alltrim(This.Value),'*')
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatia5.Text1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=NVL(Alltrim(This.Value),'*')
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatia5.Text1.InteractiveChange
		If !This.ReadOnly
			Thisform.cnewvalue=NVL(Alltrim(This.Value),'*')
		Endif
	ENDPROC

	PROCEDURE grid1.cExplicatieTVA.combo1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=ALLTRIM(STR(actcv.id_jtva_coloana))
			Thisform.cnewvalue=Thisform.coldvalue
		ENDIF
		
	ENDPROC

	PROCEDURE grid1.cExplicatieTVA.combo1.InteractiveChange
		If !This.ReadOnly
			Thisform.cnewvalue=ALLTRIM(STR(actcv.id_jtva_coloana))
		Endif
		
	ENDPROC

	PROCEDURE grid1.cExplicatieTVA.combo1.Valid
		replace actcv.id_jtva_coloana WITH jtva_temp.id_jtva_coloana
		replace actcv.proc_tva WITH ROUND((jtva_temp.cota_tva+100)/100,2)
		
	ENDPROC

	PROCEDURE grid1.cfdoc.Text1.DblClick
		If !Thisform.grid1.ReadOnly
			Nodefault
			Local locauta,lcOldValue,lcNewValue
			lcOldValue=Nvl(Alltrim(fdoc),'')
			Select actcv
			Store "" To locauta
			pcselect = ['select p.fel_document,p.id_fdoc FROM ] + Alltrim(gcS) + [.vnom_fdoc p where 2=2']
			pcfiltru = [1=2]
			pcschema = ['']
			pcorder = [fel_document]
			pccoloane = [fel_document]
			pcTitlu = [Alegeti felul documentului]
			pcTitluColoane = [Fel document]
			lnRec=Recno()
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane)
			If !Empty(locauta.fel_document)
				Select actcv
				Go lnRec
				Replace id_fdoc With locauta.id_fdoc
				Replace fdoc With Alltrim(locauta.fel_document)
				lcNewValue=Nvl(Alltrim(fdoc),'')
			Else
				lcNewValue=lcOldValue
			Endif
			This.SetFocus()
			Thisform.coldvalue=lcOldValue
			Thisform.cnewvalue=lcNewValue
			Release locauta
			For i=1 To Thisform.grid1.ColumnCount
				If Thisform.grid1.Columns(i).ColumnOrder=This.Parent.ColumnOrder+1
					Exit
				Endif
			Endfor
			Thisform.grid1.Columns(i).SetFocus()
		Else
			DoDefault()
		Endif
		
	ENDPROC

	PROCEDURE grid1.cfdoc.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cId_fact.Text1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=Alltrim(Str(This.Value))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cId_fact.Text1.InteractiveChange
		If !This.ReadOnly
			Thisform.cnewvalue=Alltrim(Str(This.Value))
		Endif
		
	ENDPROC

	PROCEDURE grid1.cId_set.Text1.GotFocus
		If !This.ReadOnly
			Thisform.coldvalue=Alltrim(Str(This.Value))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
		
	ENDPROC

	PROCEDURE grid1.cId_set.Text1.InteractiveChange
		If !This.ReadOnly
			Thisform.cnewvalue=Alltrim(Str(This.Value))
		Endif
	ENDPROC

	PROCEDURE grid1.cNrAct.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cNrAct.Text1.GotFocus
		If This.ReadOnly=.F.
			Thisform.coldvalue=Alltrim(Str(This.Value))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cNrAct.Text1.InteractiveChange
		If This.ReadOnly=.F.
			Thisform.cnewvalue=Alltrim(Str(This.Value))
		Endif
	ENDPROC

	PROCEDURE grid1.cNrAct.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cnresp.Text1.DblClick
		If !Thisform.grid1.ReadOnly
			Local locauta,lcCol,lcOldValue,lcNewValue
			Select actcv
			lcOldValue=Nvl(Alltrim(nresp),'')
			Store "" To locauta
			pcselect = ['select p.nume, p.functie, p.id_responsabil FROM ] + gcs + [.vnom_responsabili p '+]+;
				['where 2=2']
			pcfiltru = [1=2]
			pcschema = ['']
			pcorder = [p.nume]
			pccoloane = [nume,functie]
			pcTitlu = [Alegeti numele]
			pcTitluColoane = [Responsabil,Functie]
			lnRec=Recno()
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
			If !Empty(locauta.nume)
				Select actcv
				Go lnRec
				Replace id_responsabil With locauta.id_responsabil
				Replace nresp With Alltrim(locauta.nume)
				lcNewValue=Nvl(Alltrim(nresp),'')
			Else
				lcNewValue=lcOldValue
			Endif
			This.SetFocus()
			Thisform.coldvalue=lcOldValue
			Thisform.cnewvalue=lcNewValue
			Release locauta
			For i=1 To Thisform.grid1.ColumnCount
				If Thisform.grid1.Columns(i).ColumnOrder=This.Parent.ColumnOrder+1
					Exit
				Endif
			Endfor
			Thisform.grid1.Columns(i).SetFocus()
		Else
			DoDefault()
		Endif
		
	ENDPROC

	PROCEDURE grid1.cNrord.Text1.DblClick
		If !Thisform.grid1.ReadOnly
			Local locauta,lcOldValue,lcNewValue
			Select actcv
			lcOldValue=Nvl(Alltrim(nrord),'')
			Store "" To locauta
			pcselect = ['select p.nrord,p.id_lucrare FROM ] + gcs + [.vnom_lucrari p where 2=2']
			pcfiltru = [1=2]
			pcschema = ['']
			pcorder = [nrord]
			pccoloane = [nrord]
			pcTitlu = [Alegeti lucrarea/contractul]
			pcTitluColoane = [Lucrare/Contract]
			lnRec=Recno()
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
			If !Empty(locauta.nrord)
				Select actcv
				Go lnRec
				Replace id_lucrare With locauta.id_lucrare
				Replace nrord With locauta.nrord
				lcNewValue=Nvl(Alltrim(nrord),'')
			Else
				lcNewValue=lcOldValue
			Endif
			This.SetFocus()
			Thisform.coldvalue=lcOldValue
			Thisform.cnewvalue=lcNewValue
			For i=1 To Thisform.grid1.ColumnCount
				If Thisform.grid1.Columns(i).ColumnOrder=This.Parent.ColumnOrder+1
					Exit
				Endif
			Endfor
			Thisform.grid1.Columns(i).SetFocus()
		Else
			DoDefault()
		Endif
		
	ENDPROC

	PROCEDURE grid1.cNume.Text1.DblClick
		LOCAL lcCont
		
		IF !THISFORM.grid1.READONLY
			NODEFAULT
			LOCAL locauta,lcOldValue,lcNewValue
			lcOldValue=NVL(ALLTRIM(nume),'')
			SELECT actcv
			STORE "" TO locauta
			lnRec = RECNO()
			
			lcCont = ALLTRIM(actcv.CONT)
			locauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti partenerul ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont))
			
			IF !EMPTY(locauta.nume)
				SELECT actcv
				GO lnRec
				REPLACE id_part WITH locauta.id_part
				REPLACE nume WITH ALLTRIM(locauta.nume)
				lcNewValue=NVL(ALLTRIM(nume),'')
			ELSE
				lcNewValue=lcOldValue
			ENDIF
			THIS.SETFOCUS()
			THISFORM.coldvalue=lcOldValue
			THISFORM.cnewvalue=lcNewValue
			RELEASE locauta
			FOR i=1 TO THISFORM.grid1.COLUMNCOUNT
				IF THISFORM.grid1.COLUMNS(i).COLUMNORDER=THIS.PARENT.COLUMNORDER+1
					EXIT
				ENDIF
			ENDFOR
			THISFORM.grid1.COLUMNS(i).SETFOCUS()
		ELSE
			DODEFAULT()
		ENDIF
		
	ENDPROC

	PROCEDURE grid1.cNume.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cNume_val.Text1.DblClick
		If !Thisform.grid1.ReadOnly
			Local locauta,lcOldValue,lcNewValue
			Select actcv
			lcOldValue=Nvl(Alltrim(nume_val),'')
			Store "" To locauta
			pcselect = ['select p.nume_val,p.id_valuta FROM ] + gcs + [.vnom_valute p where 2=2']
			pcfiltru = [1=2]
			pcschema = ['']
			pcorder = [nume_val]
			pccoloane = [nume_val]
			pcTitlu = [Alegeti valuta]
			pcTitluColoane = [Valuta]
			lnRec=Recno()
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
			If !Empty(locauta.nume_val)
				Select actcv
				Go lnRec
				Replace id_valuta With locauta.id_valuta
				Replace nume_val With locauta.nume_val
				lcNewValue=Nvl(Alltrim(nume_val),'')
				Thisform.lvaluta=.F.
				thisform.actualizeaza_totaluri()
			Else
				lcNewValue=lcOldValue
			Endif
			This.SetFocus()
			Thisform.coldvalue=lcOldValue
			Thisform.cnewvalue=lcNewValue
			Release locauta
			For i=1 To Thisform.grid1.ColumnCount
				If Thisform.grid1.Columns(i).ColumnOrder=This.Parent.ColumnOrder+1
					Exit
				Endif
			Endfor
			Thisform.grid1.Columns(i).SetFocus()
		Else
			DoDefault()
		Endif
	ENDPROC

	PROCEDURE grid1.cNume_val.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cPrecCred.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecCred.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecDeb.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecDeb.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecValCred.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecValCred.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecValDeb.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cPrecValDeb.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cSoldFinal.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cSoldFinal.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cTipSAFT._combobox1.Valid
		Local llSucces
		PRIVATE pnIdDoc, pnTipFactura
		
		Select actcv
		pnIdDoc = Nvl(actcv.id_fact, 0)
		pnTipFactura = actcv.tip_saft
		IF NVL(pnTipFactura, 0) <> NVL(Thisform.nTipSaft, 0)
			llSucces = goExecutor.oExecuta('UPDATE documente SET tip_saft = ?pnTipFactura WHERE id_doc = ?pnIdDoc')
			IF !m.llSucces
				REPLACE tip_saft WITH thisform.cOldvalue
			ENDIF 
		ENDIF 
		
		RETURN .T.
		 
	ENDPROC

	PROCEDURE grid1.cTipSAFT._combobox1.When
		Thisform.nTipSaft = actcv.tip_saft
	ENDPROC

	PROCEDURE grid1.cTotDeb.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cTotDeb.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cTotDebVal.Text1.DblClick
		thisform.butdrept
	ENDPROC

	PROCEDURE grid1.cTotDebVal.Text1.RightClick
		do editscurt.mpr
	ENDPROC

	PROCEDURE grid1.cValCredit.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cValCredit.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cValCredit.Text1.Valid
		IF this.Value>0
			thisform.lvaluta=.T.
		ENDIF
	ENDPROC

	PROCEDURE grid1.cValDebit.Text1.GotFocus
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.coldvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
			Thisform.cnewvalue=Thisform.coldvalue
		Endif
	ENDPROC

	PROCEDURE grid1.cValDebit.Text1.InteractiveChange
		If This.ReadOnly=.F.
			lcMask=Strtran(This.Parent.InputMask,' ','')
			lnNrZec=At(Thisform.cseparator,lcMask,1)
			Thisform.cnewvalue=Alltrim(Str(This.Value,Len(lcMask),Iif(lnNrZec>0,Len(lcMask)-lnNrZec,0)))
		Endif
	ENDPROC

	PROCEDURE grid1.cValDebit.Text1.Valid
		IF this.Value>0
			thisform.lvaluta=.T.
		ENDIF
	ENDPROC

	PROCEDURE grid1.cVenChelt.Text1.DblClick
		If !Thisform.grid1.ReadOnly
			Local locauta,lcOldValue,lcNewValue
			Select actcv
			lcOldValue=Nvl(Alltrim(venchelt),'')
			Store "" To locauta
			pcselect = ["select v.explicatie,(case v.tip_venchelt when 1 then 'C' else 'V' end) as tip,v.id_venchelt FROM "+] +;
				["]+ Alltrim(gcs) + [.vnom_venchel v where 2=2"]
			pcfiltru = [1=2]
			pcschema = ['']
			pcorder = [explicatie]
			pccoloane = [explicatie,tip]
			pcTitlu = [Alegeti venitul\cheltuiala]
			pcTitluColoane = [Explicatie,Tip]
			lnRec=Recno()
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
			If !Empty(locauta.explicatie)
				Select actcv
				Go lnRec
				Replace id_venchelt With locauta.id_venchelt
				Replace venchelt With locauta.explicatie
				lcNewValue=Nvl(Alltrim(venchelt),'')
			Else
				lcNewValue=lcOldValue
			Endif
			This.SetFocus()
			Thisform.coldvalue=lcOldValue
			Thisform.cnewvalue=lcNewValue
			Release locauta
			For i=1 To Thisform.grid1.ColumnCount
				If Thisform.grid1.Columns(i).ColumnOrder=This.Parent.ColumnOrder+1
					Exit
				Endif
			Endfor
			Thisform.grid1.Columns(i).SetFocus()
		Else
			DoDefault()
		Endif
	ENDPROC

	PROCEDURE grid1.Init
		*!*	this.SetAll("DynamicForeColor", "IIF(abs(totctva-achitat)<1000,RGB(0,0,0),iif(totctva<achitat,rgb(255,0,0),RGB(0,0,255)))")
		*!*	If thisform.lActiv
		*!*		Thisform.grid1.SetAll("DynamicForeColor", "IIF(ABS((preccred+credit)-(precdeb+debit))=0,RGB(0,0,0), iif(((precdeb+debit) < (preccred+credit)),RGB(255,0,0),RGB(0,0,255)))", "Column")
		*!*	Else
		*!*		Thisform.grid1.SetAll("DynamicForeColor", "IIF(ABS((preccred+credit)-(precdeb+debit))=0,RGB(0,0,0), iif(((precdeb+debit) > (preccred+credit)),RGB(255,0,0),RGB(0,0,255)))", "Column")
		*!*	Endif
	ENDPROC

	PROCEDURE Gridextra1.applyfilter
		DODEFAULT()
		Thisform.actualizeaza_totaluri()
	ENDPROC

	PROCEDURE Gridextra1.clearfilter
		DODEFAULT()
		Thisform.actualizeaza_totaluri()
	ENDPROC

	PROCEDURE Text1.Refresh
		THIS.FORECOLOR=IIF(thisform.ntotdebit >=0,  RGB(0,0,0), RGB(255,0,0))
		this.Value = thisform.ntotdebit
	ENDPROC

	PROCEDURE Text2.Refresh
		THIS.FORECOLOR=IIF(thisform.ntotcredit >=0, RGB(0,0,0), RGB(255,0,0))
		this.Value = thisform.ntotcredit
	ENDPROC

	PROCEDURE Text3.Refresh
		THIS.FORECOLOR=IIF(thisform.ntotsold >=0,  RGB(0,0,0), RGB(255,0,0))
		this.Value = thisform.ntotsold
	ENDPROC

	PROCEDURE Text4.Refresh
		THIS.FORECOLOR=IIF(thisform.ndebitval >=0,  RGB(0,0,0), RGB(255,0,0))
		this.Value = thisform.ndebitval
	ENDPROC

	PROCEDURE Text5.Refresh
		THIS.FORECOLOR=IIF(thisform.ncreditval >=0,  RGB(0,0,0), RGB(255,0,0))
		this.Value = thisform.ncreditval
	ENDPROC

	PROCEDURE Text6.Refresh
		THIS.FORECOLOR=IIF(thisform.ntotsoldval >=0,  RGB(0,0,0), RGB(255,0,0))
		this.Value = thisform.ntotsoldval
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_venchelt_avans 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="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_nract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_dataact" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cont.txtAcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_valoare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_data_rata" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_dns_ramas" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblInformatii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_sectie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_sucursala" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_lucrare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1.txtAcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_responsabil" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ndns_max
		*p: ndns_min
		*p: ntip
		*p: ooperprec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 355
		Name = "frm_venchelt_avans"
		ndns_max = 0
		ndns_min = 0
		ntip = 1
		ooperprec = .NULL.
		TabStop = .T.
		Width = 699
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 788
		_shape1.ZOrderSet = 3
		_shape2.Anchor = 8
		_shape2.Left = 629
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "Modificare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 18
		Lb_titlu_alb_b121.ZOrderSet = 5
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 671
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 15
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 6
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'Clb_cont' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_cont", ;
		TabIndex = 9, ;
		Top = 75, ;
		Width = 312, ;
		Text_simplu1.ControlSource = "poMF.contD", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 172, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 65, ;
		Lb_simplu1.Caption = "Cont venit/cheltuiala", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_cont.txtAcont' AS _textbox WITH ;
		ControlSource = "poMF.acontD", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 242, ;
		MaxLength = 4, ;
		Name = "txtAcont", ;
		Top = 2, ;
		Width = 65
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Clb_data_rata' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 25, ;
		Name = "Clb_data_rata", ;
		TabIndex = 6, ;
		Top = 283, ;
		Width = 312, ;
		ZOrderSet = 28, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "pdDataRata", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = {}, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Data prima rata", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\..\roaimob\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_dataact' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Clb_dataact", ;
		TabIndex = 2, ;
		Top = 75, ;
		Width = 312, ;
		ZOrderSet = 8, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "poMf.data_achizitie", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = {}, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Data document", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_dns_ramas' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_dns_ramas", ;
		TabIndex = 7, ;
		Top = 311, ;
		Width = 312, ;
		ZOrderSet = 31, ;
		Text_simplu1.Alignment = 3, ;
		Text_simplu1.ControlSource = "poOper.dns_ramas", ;
		Text_simplu1.Format = "!KZ", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = "9 999", ;
		Text_simplu1.Left = 239, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = 0, ;
		Text_simplu1.Width = 69, ;
		Lb_simplu1.Caption = "Numar rate", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\..\roaimob\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_gestiune' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_gestiune", ;
		TabIndex = 10, ;
		ToolTipText = "Dublu click pentru modificare", ;
		Top = 103, ;
		Width = 312, ;
		ZOrderSet = 24, ;
		Text_simplu1.ControlSource = "poMf.gestiune", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.ToolTipText = "Dublu click pentru modificare", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Gestiune", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_lucrare' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_lucrare", ;
		TabIndex = 13, ;
		ToolTipText = "Dublu click pentru modificare", ;
		Top = 187, ;
		Width = 312, ;
		ZOrderSet = 23, ;
		Text_simplu1.ControlSource = "poMf.nrord", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.ToolTipText = "Dublu click pentru modificare", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Lucrare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_nract' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Clb_nract", ;
		TabIndex = 1, ;
		Top = 47, ;
		Width = 312, ;
		ZOrderSet = 7, ;
		Text_simplu1.Alignment = 3, ;
		Text_simplu1.ControlSource = "poMf.nract", ;
		Text_simplu1.Format = "!KZ", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = 0, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Nr. document", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_responsabil' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_responsabil", ;
		TabIndex = 11, ;
		ToolTipText = "Dublu click pentru modificare", ;
		Top = 131, ;
		Width = 312, ;
		ZOrderSet = 25, ;
		Text_simplu1.ControlSource = "poMf.responsabil", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.ToolTipText = "Dublu click pentru modificare", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Responsabil", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_sectie' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_sectie", ;
		TabIndex = 12, ;
		Top = 159, ;
		Width = 312, ;
		ZOrderSet = 22, ;
		Text_simplu1.ControlSource = "poMf.sectie", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.ToolTipText = "Dublu click pentru modificare", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Sectie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_sucursala' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_sucursala", ;
		TabIndex = 14, ;
		ToolTipText = "Dublu click pentru modificare", ;
		Top = 215, ;
		Width = 312, ;
		ZOrderSet = 23, ;
		Text_simplu1.ControlSource = "poMf.sucursala", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.ToolTipText = "Dublu click pentru modificare", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Sucursala", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Anchor = 9, ;
		Left = 368, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 8, ;
		TabStop = .F., ;
		Top = 47, ;
		Width = 312, ;
		Text_simplu1.ControlSource = "poMF.cont", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 172, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 65, ;
		Lb_simplu1.Caption = "Cont", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1.txtAcont' AS _textbox WITH ;
		ControlSource = "poMF.acont", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 242, ;
		MaxLength = 4, ;
		Name = "txtAcont", ;
		ReadOnly = .T., ;
		Top = 2, ;
		Width = 65
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Clb_valoare' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 25, ;
		Name = "Clb_valoare", ;
		TabIndex = 5, ;
		Top = 255, ;
		Width = 312, ;
		ZOrderSet = 28, ;
		Text_simplu1.Alignment = 3, ;
		Text_simplu1.ControlSource = "poOper.valoare_rol", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(14,gnPa)), ;
		Text_simplu1.Left = 132, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = 0, ;
		Text_simplu1.Width = 176, ;
		Lb_simplu1.Caption = "Valoare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\..\roaimob\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_denumire' AS ed_tx_simplu WITH ;
		Height = 44, ;
		Left = 22, ;
		Name = "Ed_denumire", ;
		TabIndex = 3, ;
		Top = 103, ;
		Width = 312, ;
		ZOrderSet = 14, ;
		_edbase1.ControlSource = "poMf.denumire", ;
		_edbase1.Height = 37, ;
		_edbase1.Left = 86, ;
		_edbase1.MaxLength = 100, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Top = 2, ;
		_edbase1.Width = 222, ;
		_lbbase1.AutoSize = .F., ;
		_lbbase1.Caption = "Denumire / Explicatia 4", ;
		_lbbase1.Height = 35, ;
		_lbbase1.Left = 8, ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.Top = 6, ;
		_lbbase1.Width = 78, ;
		_lbbase1.WordWrap = .T.
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 72, ;
		Left = 22, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 4, ;
		Top = 146, ;
		Width = 312, ;
		ZOrderSet = 15, ;
		_edbase1.ControlSource = "poMf.explicatia", ;
		_edbase1.Height = 67, ;
		_edbase1.Left = 86, ;
		_edbase1.MaxLength = 100, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.TabIndex = 1, ;
		_edbase1.Top = 2, ;
		_edbase1.Width = 222, ;
		_lbbase1.AutoSize = .T., ;
		_lbbase1.Caption = "Explicatie / Explicatia 5", ;
		_lbbase1.Height = 34, ;
		_lbbase1.Left = 8, ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 2, ;
		_lbbase1.Top = 6, ;
		_lbbase1.Width = 70, ;
		_lbbase1.WordWrap = .T.
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Label2' AS label WITH ;
		Anchor = 9, ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Atribute", ;
		Height = 17, ;
		Left = 371, ;
		Name = "Label2", ;
		TabIndex = 20, ;
		ToolTipText = "Modificarile din Lista MF sunt valabile de la luna curenta pana la luna urmatoarei modificari", ;
		Top = 30, ;
		Width = 43, ;
		ZOrderSet = 18
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Operatie", ;
		Height = 17, ;
		Left = 25, ;
		Name = "Label3", ;
		TabIndex = 17, ;
		Top = 232, ;
		Width = 49, ;
		ZOrderSet = 32
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lblInformatii' AS label WITH ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Informatii venituri/cheltuieli in avans", ;
		Height = 17, ;
		Left = 24, ;
		Name = "lblInformatii", ;
		TabIndex = 19, ;
		ToolTipText = "", ;
		Top = 29, ;
		Width = 196, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BackStyle = 0, ;
		Curvature = 10, ;
		Height = 185, ;
		Left = 9, ;
		Name = "Shape1", ;
		Top = 40, ;
		Width = 338, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		Anchor = 9, ;
		BackStyle = 0, ;
		Curvature = 10, ;
		Height = 212, ;
		Left = 356, ;
		Name = "Shape2", ;
		Top = 40, ;
		Width = 338, ;
		ZOrderSet = 2
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape3' AS shape WITH ;
		BackStyle = 0, ;
		Curvature = 10, ;
		Height = 108, ;
		Left = 10, ;
		Name = "Shape3", ;
		Top = 240, ;
		Width = 338, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE inainte_de_do_termin
		LOCAL lcContVenChelt
		PRIVATE plReturn
		plReturn = .T.
		lcContVenChelt = ALLTRIM(poMF.contD)
		
		IF aMESSAGEBOX("Doriti sa salvati modificarile?",4+32,"Confirmare")!=6
			RETURN .F.
		ENDIF
		
		DO CASE
			CASE EMPTY(poMf.denumire)
				aMESSAGEBOX("Nu ati completat denumirea!",0+48,"Atentie")
				THISFORM.ed_denumire._edbase1.SETFOCUS()
				plReturn=.F.
			CASE EMPTY(poMf.cont)
				aMESSAGEBOX("Nu ati introdus contul!",0+48,"Atentie")
				THISFORM.clb_tx_simplu1.texT_SIMPLU1.SETFOCUS()
				plReturn=.F.		
			CASE EMPTY(m.lcContVenChelt)
				MESSAGEBOX('Nu ati introdus contul venit/cheltuiala!',0+48, "Atentie")
				Thisform.clb_cont.text_simplu1.SetFocus()
				plReturn = .F.
			CASE !exista_cont_in_plan_conturi(m.lcContVenChelt)
		*!*			MESSAGEBOX('Nu exista contul venit/cheltuiala in planul de conturi!',0+48, "Atentie")
				Thisform.clb_cont.text_simplu1.SetFocus()
				plReturn = .F.	
		
			OTHERWISE
				plReturn = .t.
		ENDCASE
		RETURN m.plReturn
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		THIS.clb_Sucursala.Visible = glEMama
	ENDPROC

	PROCEDURE Clb_cont.Text_simplu1.LostFocus
		LOCAL llReturn, lcCont
		lcCont = ALLTRIM(poMF.contD)
		llReturn=exista_cont_in_plan_conturi(m.lcCont) && in oOperatii_comune.prg
		RETURN m.llReturn
	ENDPROC

	PROCEDURE Clb_cont.txtAcont.Click
		This.LostFocus(.T.)
	ENDPROC

	PROCEDURE Clb_cont.txtAcont.LostFocus
		Parameters tlClick
		Local lcAcont, lcCont, llReturn
		PRIVATE pcCont, pcAcont
		
		lcCont = ALLTRIM(NVL(poMF.contD,''))
		lcAcont = ALLTRIM(NVL(poMF.acontD,''))
		
		pcCont = m.lcCont
		pcAcont = m.lcAcont 
		
		llReturn = verific_analitic(m.tlClick, m.lcCont, m.lcAcont) && in oOperatii_comune.prg
		
		If m.llReturn
			poMF.acontD = ALLTRIM(NVL(m.pcAcont,''))
			this.Refresh()
		ENDIF
		RETURN .T.
	ENDPROC

	PROCEDURE Clb_dataact.Text_simplu1.Valid
		*!*	Thisform.clb_datapif.text_simplu1.Value=this.Value 
	ENDPROC

	PROCEDURE Clb_data_rata.Text_simplu1.Valid
		poOper.data_operatie = GOMONTH(m.pdDataRata, -1) && data operatiei trebuie sa fie mai mica decat data ratei, altfel nu pot sa vad imobilizarea in luna introducerii
		
		*!*	IF MONTH(pdDataRata) + 12*YEAR(pddataRata) < MONTH(poOper.data_operatie) + YEAR(poOper.data_operatie)*12
		*!*		aMESSAGEBOX("Data ratei trebuie sa fie mai mare sau egala cu decat data operatiei!",0,"Atentie")
		*!*		RETURN 0
		*!*	ENDIF 
		poRata.an = YEAR(pdDataRata)
		poRata.luna = MONTH(pdDataRata)
		poRata.data_ultima_rata = GOMONTH(pdDataRata, poOper.dns_ramas-1)
		poRata.an_exp = YEAR(poRata.data_ultima_rata) 
		poRata.luna_exp = MONTH(poRata.data_ultima_rata)
		poRata.data_ultima_rata = DATE(poRata.an_exp,poRata.luna_exp,1)
		
		
	ENDPROC

	PROCEDURE Clb_dns_ramas.Text_simplu1.Valid
		poMf.dns_luni = poOper.dns_ramas
		poRata.uzura_prec = poMf.dns_luni - poOper.dns_ramas
		poRata.cota_an = ROUND((1 / poOper.dns_ramas) * 100 * 12, 2)
		lnAnRon = VAL(SUBSTR(gcDataRon,4,4))
		lnLunaRon = VAL(SUBSTR(gcDataRon,1,2))
		lnPrecizie = IIF(poOper.data_operatie < DATE(lnAnRon,lnLunaRon,1), 0, gnPC)
		poRata.rata_rol = ROUND(poOper.valoare_ramasa_rol * poRata.cota_an / 12 / 100, lnPrecizie)
		poRata.data_ultima_rata = GOMONTH(pdDataRata, poOper.dns_ramas - 1)
		poRata.an_exp = YEAR(poRata.data_ultima_rata)
		poRata.luna_exp = MONTH(poRata.data_ultima_rata)
		poRata.data_ultima_rata = DATE(poRata.an_exp,poRata.luna_exp,1) && sa fie 1 ale lunii
		
		IF poOper.dns_ramas = 0 OR poOper.id_tip_operatie = 4 OR poOper.id_tip_operatie = 10
		  poRata.ultima_rata_rol = 0
		else
		  poRata.ultima_rata_rol = poRata.rata_rol + (poOper.valoare_ramasa_rol - poRata.rata_rol * (12 * poRata.an_exp + poRata.luna_exp -(12 * poRata.an + poRata.luna) + 1))
		ENDIF
		*!*	thisform.clb_uzura.Refresh 
		*!*	thisform.clb_cota_an.Refresh 
		*!*	thisform.clb_rata.Refresh 
		*!*	thisform.clb_ultima_rata.Refresh 
		*!*	thisform.clb_data_ultima_rata.Refresh 
	ENDPROC

	PROCEDURE Clb_gestiune.Text_simplu1.DblClick
		Store "" To locauta
		pcselect = ['select nume_gestiune, cgest,id_gestiune FROM ] + gcs + [.vnom_gestiuni where inactiv=0']
		pcfiltru = [1=2]
		pcschema = ['']
		pcorder = [nume_gestiune, cgest]
		pccoloane = [nume_gestiune,cgest,id_gestiune]
		pcTitlu = [Alegeti gestiunea]
		pcTitluColoane = [Gestiune,Cod,ID]
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
		If !Empty(locauta.nume_gestiune)
			poMf.id_gestiune=locauta.id_gestiune
			poMf.gestiune = ALLTRIM(locauta.nume_gestiune)
		Endif
		
	ENDPROC

	PROCEDURE Clb_gestiune.Text_simplu1.GotFocus
		If Empty(This.Value)
			this.DblClick 
		Endif
	ENDPROC

	PROCEDURE Clb_lucrare.Text_simplu1.DblClick
		Store "" To locauta
		pcselect = ['select nrord,id_lucrare FROM ] + gcs + [.vnom_lucrari where inactiv=0']
		pcfiltru = [1=2]
		pcschema = ['']
		pcorder = [nrord]
		pccoloane = [nrord]
		pcTitlu = [Alegeti lucrarea]
		pcTitluColoane = [Lucrare]
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
		If !Empty(locauta.nrord)
			poMf.id_lucrare=locauta.id_lucrare
			poMf.nrord=Alltrim(locauta.nrord)
		Endif
	ENDPROC

	PROCEDURE Clb_lucrare.Text_simplu1.GotFocus
		If Empty(This.Value)
			this.DblClick 
		Endif
	ENDPROC

	PROCEDURE Clb_responsabil.Text_simplu1.DblClick
		Store "" To locauta
		pcselect = ['select nume,id_responsabil FROM ] + gcs + [.vnom_responsabili where inactiv=0']
		pcfiltru = [1=2]
		pcschema = ['']
		pcorder = [nume]
		pccoloane = [nume]
		pcTitlu = [Alegeti responsabilul]
		pcTitluColoane = [Responsabil]
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
		If !Empty(locauta.nume)
			poMf.id_responsabil=locauta.id_responsabil
			poMf.responsabil=Alltrim(locauta.nume)
		Endif
	ENDPROC

	PROCEDURE Clb_responsabil.Text_simplu1.GotFocus
		If Empty(This.Value)
			this.DblClick 
		Endif
	ENDPROC

	PROCEDURE Clb_sectie.Text_simplu1.DblClick
		Store "" To locauta
		pcselect = ['select sectie,id_sectie FROM ] + gcs + [.vnom_sectii where inactiv=0']
		pcfiltru = [1=2]
		pcschema = ['']
		pcorder = [sectie]
		pccoloane = [sectie]
		pcTitlu = [Alegeti sectia]
		pcTitluColoane = [Sectie]
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"")
		If !Empty(locauta.sectie)
			poMf.id_sectie=locauta.id_sectie
			poMf.sectie=Alltrim(locauta.sectie)
		Endif
	ENDPROC

	PROCEDURE Clb_sectie.Text_simplu1.GotFocus
		If Empty(This.Value)
			this.DblClick 
		Endif
	ENDPROC

	PROCEDURE Clb_sucursala.Text_simplu1.DblClick
		llBlank = .T.
		llNou = .F.
		llToateIreg = .F.
		loSucursala = caut_sucursala(llToateIreg, llNou, llBlank)
		poMf.id_sucursala = loSucursala.id_sucursala
		poMf.sucursala = Alltrim(loSucursala.sucursala)
	ENDPROC

ENDDEFINE

DEFINE CLASS stop AS ffergen 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="Cmd_termin1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Image1" UniqueID="" Timestamp="" />

	*<PropValue>
		AutoCenter = .T.
		Closable = .F.
		ControlBox = .F.
		DoCreate = .T.
		Height = 100
		MaxButton = .F.
		MinButton = .F.
		Movable = .F.
		Name = "stop"
		TitleBar = 0
		Width = 377
		WindowState = 0
		WindowType = 0
	*</PropValue>

	ADD OBJECT 'Cmd_termin1' AS cmd_termin WITH ;
		Caption = "\<OK", ;
		FontBold = .T., ;
		FontSize = 10, ;
		ForeColor = 0,0,255, ;
		Height = 27, ;
		Left = 144, ;
		Name = "Cmd_termin1", ;
		Top = 65, ;
		Width = 84, ;
		ZOrderSet = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Image1' AS image WITH ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 18, ;
		Name = "Image1", ;
		Picture = ..\grafice\info_c.ico, ;
		Top = 9, ;
		Width = 32, ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="image" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		Caption = "Label2", ;
		Height = 17, ;
		Left = 73, ;
		Name = "Label2", ;
		Top = 17, ;
		Width = 40, ;
		ZOrderSet = 2
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		Alignment = 2, ;
		Caption = "Label3", ;
		Height = 17, ;
		Left = 14, ;
		Name = "Label3", ;
		Top = 43, ;
		Width = 348, ;
		ZOrderSet = 3
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Shape1' AS shape WITH ;
		BackStyle = 0, ;
		Height = 92, ;
		Left = 4, ;
		Name = "Shape1", ;
		SpecialEffect = 0, ;
		Style = 0, ;
		Top = 4, ;
		Width = 368, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE Cmd_termin1.Click
			buton=1
				IF TYPE("THISFORM.Parent") = "O"
					THISFORMSET.Release
				ELSE
					THISFORM.Release
				ENDIF
		
	ENDPROC

ENDDEFINE
