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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtdata1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtdata2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_data" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_afis" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_recap" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: pregateste_date		&& selecteaza datele necesare de pe serverul Oracle
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 235
		Name = "frm_jurnal_plati_incasari"
		Width = 300
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "Jurnal plati/incasari"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.ZOrderSet = 6
		BUT_TERMIN1.Left = 270
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 7
		Resizer1.Label1.Name = "Label1"
		Resizer1.Name = "Resizer1"
	*</PropValue>

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Left = 212, ;
		Name = "But_excel1", ;
		Top = 1, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="..\..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Ck_filtru_data' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = dataact, ;
		Caption = "Data", ;
		Left = 73, ;
		Name = "Ck_filtru_data", ;
		tip = D, ;
		Top = 96, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="..\..\comun\clase\caut_comun.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "_", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 119, ;
		Name = "Label1", ;
		TabIndex = 8, ;
		Top = 57, ;
		Width = 9, ;
		ZOrderSet = 11
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Filtrare:", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 26, ;
		Name = "Label2", ;
		TabIndex = 8, ;
		Top = 93, ;
		Width = 44, ;
		ZOrderSet = 12
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Perioada de referinta", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 20, ;
		Name = "Label3", ;
		TabIndex = 8, ;
		Top = 37, ;
		Width = 126, ;
		ZOrderSet = 19
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label4' AS label WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Afiseaza", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 19, ;
		Name = "Label4", ;
		TabIndex = 8, ;
		Top = 133, ;
		Width = 59, ;
		ZOrderSet = 17
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label5' AS label WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Cu recapitulatie", ;
		Comment = "*:OnResize=LT", ;
		FontBold = .F., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 152, ;
		Name = "Label5", ;
		TabIndex = 8, ;
		Top = 132, ;
		Width = 99, ;
		ZOrderSet = 15
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'opt_afis' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 3, ;
		Height = 72, ;
		Left = 18, ;
		Name = "opt_afis", ;
		SpecialEffect = 1, ;
		TabIndex = 11, ;
		Top = 154, ;
		Value = 1, ;
		Width = 96, ;
		ZOrderSet = 14, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Plati", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 37, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Incasari", ;
		Option2.FontName = "Arial Narrow", ;
		Option2.FontSize = 10, ;
		Option2.Height = 18, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 28, ;
		Option2.Width = 55, ;
		Option3.AutoSize = .T., ;
		Option3.Caption = "Plati si incasari", ;
		Option3.FontName = "Arial Narrow", ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 49, ;
		Option3.Width = 86
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'opt_recap' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 2, ;
		Height = 52, ;
		Left = 150, ;
		Name = "opt_recap", ;
		SpecialEffect = 1, ;
		TabIndex = 11, ;
		Top = 155, ;
		Value = 1, ;
		Width = 100, ;
		ZOrderSet = 16, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Pe parteneri", ;
		Option1.FontName = "Arial Narrow", ;
		Option1.FontSize = 10, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 76, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Pe responsabili", ;
		Option2.FontName = "Arial Narrow", ;
		Option2.FontSize = 10, ;
		Option2.Height = 18, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 29, ;
		Option2.Width = 90
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackStyle = 0, ;
		Height = 79, ;
		Left = 12, ;
		Name = "Shape2", ;
		Top = 143, ;
		Width = 109, ;
		ZOrderSet = 2
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape3' AS shape WITH ;
		BackStyle = 0, ;
		Height = 79, ;
		Left = 144, ;
		Name = "Shape3", ;
		Top = 143, ;
		Width = 145, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Shape4' AS shape WITH ;
		BackStyle = 0, ;
		Height = 78, ;
		Left = 12, ;
		Name = "Shape4", ;
		Top = 48, ;
		Width = 235, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'txtdata1' AS textbox WITH ;
		BorderColor = 128,128,128, ;
		ControlSource = "", ;
		Enabled = .F., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 25, ;
		Name = "txtdata1", ;
		SpecialEffect = 1, ;
		TabIndex = 10, ;
		Top = 61, ;
		Width = 88, ;
		ZOrderSet = 9
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtdata2' AS textbox WITH ;
		BorderColor = 128,128,128, ;
		ControlSource = "", ;
		Enabled = .F., ;
		FontName = "Arial Narrow", ;
		FontSize = 11, ;
		Height = 22, ;
		Left = 133, ;
		Name = "txtdata2", ;
		SpecialEffect = 1, ;
		TabIndex = 10, ;
		Top = 61, ;
		Width = 88, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE do_excel
		Local lcCursor,llplati,llresp
		lcCursor = Thisform.pregateste_date()
		
		llplati = Iif(Thisform.opt_afis.Value=1,.T.,.F.)
		llresp = Iif(Thisform.opt_recap.Value=1,.F.,.T.)
		If !Used(lcCursor)
			Messagebox('Nu s-a creat tabelul ' + lcCursor,0+48,_Screen.Caption)
			Return
		Endif
		Select (lcCursor)
		
		*!*	SET DEFAULT TO &gcSchemaPath
		*!*	CD &gcSchemaPath
		*!*	IF !DIRECTORY('&gcSchemaPath\jurnal_incasplati')
		*!*		MD jurnal_incasplati
		*!*	ENDIF
		*!*	lcFile=gcSchemaPath+'\jurnal_incasplati\jurnal_'+SYS(2)+'.XLS'
		lcFile = gcTempPath + [jurnal_incasplati]+Sys(2)+[.XLS]
		If tlresp
			Select tip, cnume As responsabil, cpartener As partener, ;
				suma5112 + suma5121 + suma5311 + compensari + diverse As Total, suma5112, suma5121, suma5311, compensari, diverse, ;
				contp As Cont, acont As analitic ;
				from (lcCursor) Order By 1,2  Into Cursor query_avans
		Else
			Select tip, cpartener As partener, ;
				suma5112 + suma5121 + suma5311 + compensari + diverse As Total, suma5112, suma5121, suma5311, compensari, diverse, ;
				contp As Cont, acont As analitic ;
				from (lcCursor) Order By 1,2 Into Cursor query_avans
		Endif
		
		Select query_avans
		
		Copy To (lcFile) Type Xls
		Use In (lcCursor)
		
		OPEN_DEFAULT_APP(lcFile)
		
		
	ENDPROC

	PROCEDURE pregateste_date		&& selecteaza datele necesare de pe serverul Oracle
		llplati = (Thisform.opt_afis.Value = 1)
		llIncasari = (Thisform.opt_afis.Value = 2)
		llPlatiIncasari = (Thisform.opt_afis.Value = 3)
		llresp = Iif(Thisform.opt_recap.Value=1,.F.,.T.)
		
		lcfiltrudata = Iif(!Empty(Thisform.ck_filtru_data.filtru),Thisform.ck_filtru_data.filtru,[ and 1=1])
		ldData1 = this.txtdata1.Value 
		ldData2 = this.txtdata2.Value 
		
		IF YEAR(m.ldData1) = YEAR(m.ldData2)
			lcFiltruData = lcFiltruData + [ and an = ] + ALLTRIM(STR(YEAR(m.ldData1)))
			IF MONTH(m.ldData1) = MONTH(m.ldData2)
				lcFiltruData = lcFiltruData + [ and luna = ] + ALLTRIM(STR(month(m.ldData1)))		
			ELSE 
				lcFiltruData = lcFiltruData + [ and luna between ] + ALLTRIM(STR(month(m.ldData1))) + [ and ] + ALLTRIM(STR(month(m.ldData2)))
			ENDIF 	
		ELSE 
			lcFiltruData = lcFiltruData + [ and an between ] + ALLTRIM(STR(YEAR(m.ldData1))) + [ and ] + + ALLTRIM(STR(YEAR(m.ldData2)))	
		ENDIF 		
		
	ENDPROC

	PROCEDURE Ck_filtru_data.InteractiveChange
		
		DODEFAULT()
		IF this.value = 1
			pdData1 = CTOD(this.cvaloare1)
			pdData2 = CTOD(this.cvaloare2)
		ELSE
			pdData1 = pdinit1
			pdData2 = pdinit2
		ENDIF	
		thisform.refresh
	ENDPROC

	PROCEDURE Ck_filtru_data.Valid
		*!* 21.06.2011
		*!* marius.mutu
		*!* se pot selecta inregistrari din orice perioada, nu numai din luna curenta
		*!* #3054
		
		Local lddata1,lddata2
		lddata1 = Ctod(This.cvaloare1)
		lddata2 = Ctod(This.cvaloare2)
		If This.Value = 0
			Return
		Endif
		
		*!* 21.06.2011
		If lddata1 <= lddata2 && AND BETWEEN(lddata1,pdinit1,pdinit2) AND BETWEEN(lddata2,pdinit1,pdinit2)
			Return .T.
		Else
			pdData1 = pdinit1
			pdData2 = pdinit2
			This.Value = 0
			Thisform.Refresh
			Wait Window "Date incorecte!"
			Return .F.
		Endif
		*!* 21.06.2011 ^
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_pondere_clienti_furnizori AS formtermin OF "..\..\..\..\contafin\comun\clase\baza.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="List1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_numar1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_numar2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_numar3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdfooter1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cknume" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: afisactual
		*m: grdfooterevent
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		Closable = .F.
		DoCreate = .T.
		Height = 526
		Name = "frm_pondere_clienti_furnizori"
		Width = 800
		WindowState = 0
		Shape1.Anchor = 10
		Shape1.Comment = "*:OnResize=st"
		Shape1.Height = 36
		Shape1.Left = 0
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 800
		Terminat1.Anchor = 8
		Terminat1.Command1.Name = "Command1"
		Terminat1.Comment = "*:OnResize=Rt"
		Terminat1.Imbuton1.Height = 29
		Terminat1.Imbuton1.Name = "Imbuton1"
		Terminat1.Imbuton1.Width = 27
		Terminat1.Left = 760
		Terminat1.Name = "Terminat1"
		Terminat1.Top = 3
		Titlufrumos1.AutoSize = .F.
		Titlufrumos1.Caption = "PONDERE CLIENTI / FURNIZORI"
		Titlufrumos1.Height = 18
		Titlufrumos1.Left = 9
		Titlufrumos1.Name = "Titlufrumos1"
		Titlufrumos1.Top = 5
		Titlufrumos1.Width = 627
		Lb_shortcuts1.Name = "Lb_shortcuts1"
	*</PropValue>

	ADD OBJECT '_grdfooter1' AS _grdfooter WITH ;
		Anchor = 14, ;
		ccolwithlabel = column1, ;
		csourcegrid = gridb1, ;
		csumcolumns = column5,column3,column4,column10,column6, ;
		ctotallabelexpression = 'TOTAL', ;
		Height = 25, ;
		Left = 9, ;
		Name = "_grdfooter1", ;
		TabIndex = 18, ;
		Top = 488, ;
		Width = 774
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Ck_filtru_numar1' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = debit, ;
		Caption = "Rulaj debit", ;
		Comment = "", ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 102, ;
		mask = (get_mask(14,GnZ)), ;
		Name = "Ck_filtru_numar1", ;
		nrzec = (gnZ), ;
		Top = 46, ;
		Width = 66
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\caut_comun.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_numar2' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = credit, ;
		Caption = "Rulaj credit", ;
		Comment = "", ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 205, ;
		mask = (get_mask(14,GnZ)), ;
		Name = "Ck_filtru_numar2", ;
		nrzec = (gnZ), ;
		Top = 46, ;
		Width = 71
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\caut_comun.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_numar3' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		camp_nume = sold_final, ;
		Caption = "Sold final", ;
		Comment = "", ;
		FontName = "Arial Narrow", ;
		Left = 307, ;
		mask = (get_mask(14,GnZ)), ;
		Name = "Ck_filtru_numar3", ;
		nrzec = (gnZ), ;
		Top = 46
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\caut_comun.vcx" BaseClass="checkbox" />

	ADD OBJECT 'cknume' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = nume, ;
		Caption = "Nume", ;
		Left = 12, ;
		Name = "cknume", ;
		Top = 46
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Excel1' AS excel WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=Rt", ;
		Left = 690, ;
		Name = "Excel1", ;
		Top = 3, ;
		Imbuton1.Height = 27, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 30, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Gridb1' AS gridb WITH ;
		Anchor = 15, ;
		ColumnCount = 10, ;
		Comment = "*:OnResize=ss", ;
		FontName = "Arial Narrow", ;
		HeaderHeight = 38, ;
		Height = 420, ;
		Left = 9, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "cPondereF", ;
		Top = 67, ;
		Width = 774, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Header1.Alignment = 2, ;
		Column1.Header1.Caption = "Nume", ;
		Column1.Header1.FontName = "Arial Narrow", ;
		Column1.Header1.Name = "Header1", ;
		Column1.Name = "Column1", ;
		Column1.Text1.FontName = "Arial Narrow", ;
		Column1.Text1.Name = "Text1", ;
		Column1.Width = 207, ;
		Column2.ControlSource = "analitic", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.Width = 31, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "debit", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Format = "rk", ;
		Column3.InputMask = (get_mask(16,GnZ)), ;
		Column3.Name = "Column3", ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "credit", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Format = "rk", ;
		Column4.InputMask = (get_mask(16,GnZ)), ;
		Column4.Name = "Column4", ;
		Column5.ColumnOrder = 3, ;
		Column5.ControlSource = "sold_initial", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Format = "rk", ;
		Column5.InputMask = (get_mask(16,GnZ)), ;
		Column5.Name = "Column5", ;
		Column6.ColumnOrder = 7, ;
		Column6.ControlSource = "sold_final", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Format = "rk", ;
		Column6.InputMask = (get_mask(16,GnZ)), ;
		Column6.Name = "Column6", ;
		Column7.ColumnOrder = 9, ;
		Column7.ControlSource = "pondere_debit", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Format = "rk", ;
		Column7.InputMask = "999 999 999.999", ;
		Column7.Name = "Column7", ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "pondere_credit", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Format = "rk", ;
		Column8.InputMask = "999 999 999.999", ;
		Column8.Name = "Column8", ;
		Column9.ColumnOrder = 10, ;
		Column9.ControlSource = "pondere_sold_final", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Format = "rk", ;
		Column9.InputMask = "999 999 999.999", ;
		Column9.Name = "Column9", ;
		Column9.Width = 68, ;
		Column10.ColumnOrder = 6, ;
		Column10.ControlSource = "avans", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.Format = "rk", ;
		Column10.InputMask = (get_mask(16,GnZ)), ;
		Column10.Name = "Column10"
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\baza.vcx" BaseClass="grid" />

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

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

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

	ADD OBJECT 'Gridb1.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 'Gridb1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Rulaj credit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.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 'Gridb1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sold initial", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridb1.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 'Gridb1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pondere debit (%)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.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 'Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pondere credit (%)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.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 'Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pondere sold final (%)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.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 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.Gridb1, ;
		Left = 630, ;
		Name = "Gridextra1", ;
		Top = 51
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'List1' AS list WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=Rt", ;
		Left = 725, ;
		Name = "List1", ;
		Top = 3, ;
		Imbuton1.Height = 27, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 30, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\baza.vcx" BaseClass="container" />
	
	PROCEDURE afisactual
		lccond=[]
		SET STEP ON 
		If This.cknume.Value=1
			lcfiltru = This.cknume.filtru_vfp 
			lccond = lccond + lcfiltru
		Endif
		
		If This.ck_filtru_numar1.Value=1
			lcfiltru = This.ck_filtru_numar1.filtru
			lccond = lccond + lcfiltru
		Endif
		
		If This.ck_filtru_numar2.Value=1
			lcfiltru = This.ck_filtru_numar2.filtru
			lccond = lccond  + lcfiltru
		Endif
		
		If This.ck_filtru_numar3.Value=1
			lcfiltru = This.ck_filtru_numar3.filtru
			lccond = lccond  + lcfiltru
		Endif
		
		lcsel = Thisform.gridb1.RecordSource
		Select (lcsel)
		If !Empty(lccond)
			lccond = Substr(lccond,6)
		Endif
		Set Filter To &lccond
		
		THIS._grdfooter1.calctotal()
		
		Select (lcsel)
		Do nrord With (lcsel)
		
		Select (lcsel)
		Go Top
		
		Thisform.Refresh
		This.gridb1.Refresh  
	ENDPROC

	PROCEDURE grdfooterevent
		LPARAMETERS toObj, tcEvt
		
		IF TYPE('this._grdfooter1') = 'O' 
			IF PEMSTATUS(this._grdfooter1, "eventhandler", 5)
				this._grdfooter1.eventhandler(,toObj,tcEvt)
			ENDIF 	
		ENDIF 	
	ENDPROC

	PROCEDURE Init
		DoDefault() 
		thisform.WindowState=2
		this.gridextra1.setup()
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		
		
		*** apelez grdfooter.init pentru repozitionare coloane grdfooter dupa gridextra si recalculare totaluri dupa schimbare controlsource coloane
		this._grdfooter1.Init()
		
		DoDefault(nStyle)
	ENDPROC

	PROCEDURE cknume.Click
		Thisform.afisactual
	ENDPROC

	PROCEDURE Ck_filtru_numar1.Click
		Thisform.afisactual
	ENDPROC

	PROCEDURE Ck_filtru_numar2.Click
		Thisform.afisactual
	ENDPROC

	PROCEDURE Ck_filtru_numar3.Click
		Thisform.afisactual
	ENDPROC

	PROCEDURE Excel1.Command1.Click
		lcTabel = thisform.gridb1.RecordSource 
		
		Dimension AHEADER(10,2)
		AHEADER[1,1]="Nume"
		AHEADER[2,1]="Analitic"
		AHEADER[3,1]=iif(m.plActiv, 'Debit', 'Credit')
		AHEADER[4,1]=iif(m.plActiv, 'Credit', 'Debit')
		AHEADER[5,1]='Rulaj avans'
		AHEADER[6,1]='Sold initial'
		AHEADER[7,1]='Sold final'
		AHEADER[8,1]='Pondere ' + iif(m.plActiv, 'Debit', 'Credit')
		AHEADER[9,1]='Pondere ' + iif(m.plActiv, 'Credit', 'Debit')
		AHEADER[10,1]='Pondere sold final'
		
		AHEADER[1,2]="nume"
		AHEADER[2,2]="analitic"
		AHEADER[3,2]=iif(m.plActiv, 'debit', 'credit')
		AHEADER[4,2]=iif(m.plActiv, 'credit', 'debit')
		AHEADER[5,2]="avans"
		AHEADER[6,2]="sold_initial"
		AHEADER[7,2]="sold_final"
		AHEADER[8,2]=iif(m.plActiv, 'pondere_debit', 'pondere_credit')
		AHEADER[9,2]=iif(m.plActiv, 'pondere_credit', 'pondere_debit')
		AHEADER[10,2]="pondere_sold_final"
		IF m.plActiv 
			Select nume,analitic,debit,credit,avans,sold_initial,sold_final,pondere_debit, pondere_credit,pondere_sold_final FROM (lcTabel) INTO CURSOR crs_Excel
		ELSE 
			Select nume,analitic,credit,debit,avans,sold_initial,sold_final, pondere_credit,pondere_debit,pondere_sold_final FROM (lcTabel) INTO CURSOR crs_Excel
		ENDIF 
		*!*	Do LIST_EXCEL With (lcTabel), thisform.titlufRUMOS1.Caption, AHEADER
		Do export_xls With 'crs_Excel' IN oproceduri_comune.prg
	ENDPROC

	PROCEDURE List1.Command1.Click
		Local lcsel,lcfiltru
		lcsel=Thisform.gridb1.RecordSource
		lcfiltru = Filter(lcsel)
		Select (lcsel)
		Set Filter To &lcfiltru
		Thisform.AlwaysOnTop=.F.
		Private pcTitlu
		
		pcTitlu = thisform.titlufrumos1.Caption
		
		goExport.export2frx(m.lcsel, "rap_pondere_clienti_furnizori")
		*!*	Report Form rap_pondere_clienti To Printer Prompt Preview
		Thisform.AlwaysOnTop=.T.
		Select (lcsel)
		
	ENDPROC

	PROCEDURE _grdfooter1.AfterRowColChange
		LPARAMETERS nColIndex
		THISFORM.grdfooterevent(this,"AfterRowColChange")
	ENDPROC

	PROCEDURE _grdfooter1.Scrolled
		LPARAMETERS nDirection
		THISFORM.grdfooterevent(this,"Scrolled")
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="cntPerioada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblPerioada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblDataReferinta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDataReferinta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblProcentAdaos" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtProcentAdaos" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optOrdine" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 412
		Name = "frm_rentabilitate_clienti"
		Width = 565
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 564
		Lb_titlu_alb_b121.Caption = "Rentabilitate clienti"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Left = 533
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 6
		BUT_TERMIN1.Top = 0
		Resizer1.Label1.Name = "Label1"
		Resizer1.Name = "Resizer1"
		Resizer1.TabIndex = 8
	*</PropValue>

	ADD OBJECT '_label1' AS _label WITH ;
		Caption = "Legenda", ;
		FontBold = .T., ;
		Left = 12, ;
		Name = "_label1", ;
		TabIndex = 11, ;
		Top = 257
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label2' AS _label WITH ;
		Anchor = 10, ;
		AutoSize = .F., ;
		Caption = 'Coloanele "sold initial", "facturat", "incasari", "sold final" se genereaza pe baza balantei de clienti 411', ;
		Height = 21, ;
		Left = 11, ;
		Name = "_label2", ;
		TabIndex = 11, ;
		Top = 277, ;
		Width = 553, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label3' AS _label WITH ;
		Anchor = 10, ;
		AutoSize = .F., ;
		Caption = 'Coloana "sold incert" se genereaza pe baza balantei de clienti 4118 (clienti incerti)', ;
		Height = 24, ;
		Left = 12, ;
		Name = "_label3", ;
		TabIndex = 11, ;
		Top = 383, ;
		Width = 528, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label4' AS _label WITH ;
		Anchor = 10, ;
		AutoSize = .F., ;
		Caption = 'Coloanele "venituri", "cheltuieli" se genereaza din registrul jurnal din notele 411 = 7xx, respectiv 6xx = 3xx sau folosind procentul de adaos pentru facturile care nu descarca gestiunea', ;
		Height = 35, ;
		Left = 12, ;
		Name = "_label4", ;
		TabIndex = 11, ;
		Top = 300, ;
		Width = 528, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label5' AS _label WITH ;
		Anchor = 10, ;
		AutoSize = .F., ;
		Caption = 'Coloanele "sold restant", "sold in termen" din facturile de vanzari 411 prin compararea datei scadente cu data de referinta', ;
		Height = 36, ;
		Left = 12, ;
		Name = "_label5", ;
		TabIndex = 11, ;
		Top = 343, ;
		Width = 528, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		caction = do_excel, ;
		Left = 502, ;
		Name = "But_excel1", ;
		TabIndex = 5, ;
		Top = 0, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'cntPerioada' AS container_perioada WITH ;
		Height = 33, ;
		Left = 12, ;
		Name = "cntPerioada", ;
		TabIndex = 1, ;
		Top = 54, ;
		Width = 317, ;
		Container_data1.cboAnul.Name = "cboAnul", ;
		Container_data1.cboluna.Name = "cboluna", ;
		Container_data1.Name = "Container_data1", ;
		Container_data1.Top = 0, ;
		Container_data2.cboAnul.Name = "cboAnul", ;
		Container_data2.cboluna.Name = "cboluna", ;
		Container_data2.Left = 168, ;
		Container_data2.Name = "Container_data2", ;
		Container_data2.Top = 0
		*< END OBJECT: ClassLib="caut.vcx" BaseClass="container" />

	ADD OBJECT 'lblDataReferinta' AS _label WITH ;
		Caption = "Data referinta scadenta facturi", ;
		Left = 12, ;
		Name = "lblDataReferinta", ;
		TabIndex = 10, ;
		Top = 96
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblPerioada' AS _label WITH ;
		Caption = "Perioada", ;
		Left = 12, ;
		Name = "lblPerioada", ;
		TabIndex = 9, ;
		Top = 36
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblProcentAdaos' AS _label WITH ;
		Caption = "Procent adaos (%) pentru facturile fara descarcare de gestiune", ;
		Left = 11, ;
		Name = "lblProcentAdaos", ;
		TabIndex = 11, ;
		Top = 147
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'optOrdine' AS _optiongrup WITH ;
		AutoSize = .T., ;
		Height = 46, ;
		Left = 11, ;
		Name = "optOrdine", ;
		TabIndex = 4, ;
		Top = 197, ;
		Width = 145, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Ordonare client, luna", ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Ordonare luna,  client", ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'txtDataReferinta' AS _textbox WITH ;
		Alignment = 3, ;
		Left = 12, ;
		Name = "txtDataReferinta", ;
		TabIndex = 2, ;
		Top = 114, ;
		Value = {}
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtProcentAdaos' AS _textbox WITH ;
		Alignment = 3, ;
		Format = "RK", ;
		InputMask = "999 999 999", ;
		Left = 12, ;
		Name = "txtProcentAdaos", ;
		TabIndex = 3, ;
		Top = 165, ;
		Value = 0
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE do_excel
		LOCAL lnAn1, lnAn2, lnLuna1, lnLuna2, lnProcentAdaos, lnOrdine
		
		lnAn1 = this.cntPerioada.nAn1 
		lnAn2 = this.cntPerioada.nAn2
		lnLuna1 = this.cntPerioada.nLuna1
		lnLuna2 = this.cntPerioada.nLuna2
		lnProcentAdaos = this.txtProcentAdaos.Value 
		lnOrdine = this.optOrdine.Value 
		
		
		DO rentabilitate_clienti WITH lnLuna1, lnAn1, lnLuna2, lnAn2, lnProcentAdaos, lnOrdine, 'XLS' IN contabilitate_rapoarte.prg
	ENDPROC

	PROCEDURE do_listare
		LOCAL lnAn1, lnAn2, lnLuna1, lnLuna2, lnProcentAdaos, lnOrdine
		
		lnAn1 = this.cntPerioada.nAn1 
		lnAn2 = this.cntPerioada.nAn2
		lnLuna1 = this.cntPerioada.nLuna1
		lnLuna2 = this.cntPerioada.nLuna2
		lnProcentAdaos = this.txtProcentAdaos.Value 
		lnOrdine = this.optOrdine.Value 
		
		
		DO rentabilitate_clienti WITH lnLuna1, lnAn1, lnLuna2, lnAn2, lnProcentAdaos, lnOrdine, 'FRX' IN contabilitate_rapoarte.prg
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		
		this.cntPerioada.nAn1 = VAL(pcAn)
		this.cntPerioada.nAn2 = VAL(pcAn)
		this.cntPerioada.nLuna1 = VAL(pcNl)
		this.cntPerioada.nLuna2 = VAL(pcNl)
		 
		this.cntPerioada.Setup()
		
		this.txtDataReferinta.Value = DATE()
	ENDPROC

ENDDEFINE
