*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="ointroduceri_cont.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS frm_introd_compact AS formtermin OF "..\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="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container1.Item2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container1.Item3" UniqueID="" Timestamp="" />
	*< 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.Check1" 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.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column13.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column16.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column16.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Label_item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Text_item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Label_item2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Text_item2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Label_item3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Item2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container2.Item3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Verif1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Resizable1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: calculez
		*m: do_cauta_alfa
		*m: do_cauta_partener
		*m: la_iesire
		*m: verificare
		*m: verific_analitic
		*m: verific_cont
		*m: verific_inregistrari
		*m: verific_partener
		*p: achi
		*p: casa
		*p: cscc
		*p: cscd
		*p: datascad
		*p: id_achi
		*p: id_casa
		*p: lverificaacont
		*p: nrchit
		*p: pcexceptii_scc
		*p: pcexceptii_scd
		*p: pcobj
		*p: totctva
		*p: totftva
		*p: tva
	*</DefinedPropArrayMethod>

	*<PropValue>
		achi = ''
		BorderStyle = 1
		casa = ''
		cscc = 
		cscd = 
		datascad = 
		DataSession = 1
		DoCreate = .T.
		Height = 458
		id_achi = 0
		id_casa = 0
		Name = "frm_introd_compact"
		nrchit = 0
		pcobj = ''
		ScrollBars = 0
		totctva = 0
		totftva = 0
		tva = 0
		Width = 801
		Shape1.Height = 36
		Shape1.Left = 0
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 731
		Shape1.ZOrderSet = 2
		Terminat1.Command1.Name = "Command1"
		Terminat1.Imbuton1.Height = 27
		Terminat1.Imbuton1.Name = "Imbuton1"
		Terminat1.Imbuton1.Width = 30
		Terminat1.Left = 689
		Terminat1.Name = "Terminat1"
		Terminat1.TabIndex = 6
		Terminat1.Top = 2
		Terminat1.Visible = .F.
		Terminat1.ZOrderSet = 3
		Titlufrumos1.AutoSize = .T.
		Titlufrumos1.Height = 20
		Titlufrumos1.Left = 7
		Titlufrumos1.Name = "Titlufrumos1"
		Titlufrumos1.TabIndex = 9
		Titlufrumos1.Top = 4
		Titlufrumos1.Width = 104
		Titlufrumos1.WordWrap = .F.
		Titlufrumos1.ZOrderSet = 4
	*</PropValue>

	ADD OBJECT 'Container1' AS container WITH ;
		BackColor = 247,245,238, ;
		BorderColor = 247,245,238, ;
		Height = 50, ;
		Left = 7, ;
		Name = "Container1", ;
		TabIndex = 3, ;
		Top = 321, ;
		Width = 787, ;
		ZOrderSet = 1
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'Container1.Item2' AS item WITH ;
		Comment = "m.tva", ;
		Left = 186, ;
		Name = "Item2", ;
		TabIndex = 1, ;
		Top = 1, ;
		ZOrderSet = 7, ;
		Label_item1.Caption = "TVA", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.tva", ;
		Text_item1.InputMask = (get_mask(12,gnPa)), ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.SpecialEffect = 1, ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Container1.Item3' AS item WITH ;
		Comment = "m.tva", ;
		Left = 186, ;
		Name = "Item3", ;
		TabIndex = 2, ;
		Top = 24, ;
		ZOrderSet = 7, ;
		Label_item1.Caption = "Total cu TVA", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.totctva", ;
		Text_item1.InputMask = (get_mask(12,gnPa)), ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.SpecialEffect = 1, ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Container2' AS container WITH ;
		BackColor = 247,245,238, ;
		BorderColor = 247,245,238, ;
		Height = 76, ;
		Left = 7, ;
		Name = "Container2", ;
		TabIndex = 4, ;
		Top = 377, ;
		Width = 787, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'Container2.Item1' AS item WITH ;
		Left = 241, ;
		Name = "Item1", ;
		Top = 29, ;
		Visible = .F., ;
		Label_item1.Caption = "Numele Achizitorului", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.achi", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Container2.Item2' AS item WITH ;
		Left = 241, ;
		Name = "Item2", ;
		Top = 29, ;
		Visible = .F., ;
		Label_item1.Caption = "Casa Plati", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.casa", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Container2.Item3' AS item WITH ;
		Left = 241, ;
		Name = "Item3", ;
		Top = 50, ;
		Visible = .F., ;
		Label_item1.Caption = "Nr. doc. justificat", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "m.compensat", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Container2.Label_item1' AS label_item WITH ;
		Caption = "Achitat", ;
		Left = 55, ;
		Name = "Label_item1", ;
		TabIndex = 3, ;
		Top = 11
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'Container2.Label_item2' AS label_item WITH ;
		Caption = "cu chitanta nr:", ;
		Left = 474, ;
		Name = "Label_item2", ;
		TabIndex = 5, ;
		Top = 9, ;
		Visible = .F.
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'Container2.Label_item3' AS label_item WITH ;
		Caption = "data scadenta:", ;
		Left = 243, ;
		Name = "Label_item3", ;
		TabIndex = 6, ;
		Top = 9, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'Container2.Optiongroup1' AS optiongroup WITH ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		BorderColor = 247,245,238, ;
		BorderStyle = 0, ;
		ButtonCount = 3, ;
		Height = 65, ;
		Left = 128, ;
		Name = "Optiongroup1", ;
		TabIndex = 1, ;
		Top = 6, ;
		Value = 1, ;
		Width = 97, ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "\<nu", ;
		Option1.FontName = "Courier New", ;
		Option1.ForeColor = 0,0,128, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.TabIndex = 1, ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 61, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "\<din casa,", ;
		Option2.FontName = "Courier New", ;
		Option2.ForeColor = 0,0,128, ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.TabIndex = 2, ;
		Option2.TabStop = .F., ;
		Option2.Top = 24, ;
		Option2.Value = 0, ;
		Option2.Width = 85, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "\<din 542,", ;
		Option3.FontName = "Courier New", ;
		Option3.ForeColor = 0,0,128, ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.TabIndex = 3, ;
		Option3.TabStop = .F., ;
		Option3.Top = 43, ;
		Option3.Value = 0, ;
		Option3.Width = 78
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'Container2.Text_item1' AS text_item WITH ;
		BorderColor = 192,192,192, ;
		BorderStyle = 1, ;
		ControlSource = "thisform.nrchit", ;
		Height = 20, ;
		Left = 582, ;
		Name = "Text_item1", ;
		TabIndex = 4, ;
		Top = 8, ;
		Visible = .F., ;
		Width = 111
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Container2.Text_item2' AS text_item WITH ;
		BorderColor = 192,192,192, ;
		BorderStyle = 1, ;
		ControlSource = "thisform.datascad", ;
		Height = 20, ;
		Left = 344, ;
		Name = "Text_item2", ;
		TabIndex = 2, ;
		Top = 8, ;
		Visible = .T., ;
		Width = 100
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Gridb1' AS gridb WITH ;
		BackColor = 244,250,255, ;
		ColumnCount = 16, ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		GridLineColor = 192,192,192, ;
		Height = 254, ;
		Left = 3, ;
		listaord = 1,3,4, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		RecordSource = "INTRODC", ;
		RowHeight = 20, ;
		TabIndex = 1, ;
		Top = 37, ;
		Width = 795, ;
		ZOrderSet = 5, ;
		Column1.BackColor = 244,250,255, ;
		Column1.ControlSource = "ordine", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.FontSize = 9, ;
		Column1.Header1.Alignment = 2, ;
		Column1.Header1.BackColor = 212,208,200, ;
		Column1.Header1.Caption = "Nr.crt", ;
		Column1.Header1.FontName = "Arial Narrow", ;
		Column1.Header1.FontSize = 9, ;
		Column1.Header1.Name = "Header1", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .F., ;
		Column1.Text1.BackColor = 244,250,255, ;
		Column1.Text1.FontName = "Arial Narrow", ;
		Column1.Text1.FontSize = 9, ;
		Column1.Text1.Name = "Text1", ;
		Column1.Text1.ReadOnly = .F., ;
		Column1.Width = 28, ;
		Column2.BackColor = 244,250,255, ;
		Column2.ControlSource = "explicatie", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.FontSize = 9, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 98, ;
		Column3.Alignment = 1, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "scd", ;
		Column3.DynamicForeColor = "rgb(0,0,128)", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.FontSize = 9, ;
		Column3.Name = "Column3", ;
		Column3.Width = 42, ;
		Column4.Alignment = 1, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "scc", ;
		Column4.DynamicForeColor = "rgb(0,0,128)", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.FontSize = 9, ;
		Column4.Name = "Column4", ;
		Column4.Width = 45, ;
		Column5.BackColor = 244,250,255, ;
		Column5.ColumnOrder = 9, ;
		Column5.ControlSource = "suma", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.FontSize = 9, ;
		Column5.Format = "", ;
		Column5.InputMask = (get_mask(12,gnPa)), ;
		Column5.Name = "Column5", ;
		Column5.Width = 84, ;
		Column6.BackColor = 244,250,255, ;
		Column6.ColumnOrder = 14, ;
		Column6.ControlSource = "cu_tva", ;
		Column6.CurrentControl = "Check1", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.FontSize = 9, ;
		Column6.Name = "Column6", ;
		Column6.Sparse = .F., ;
		Column6.Visible = .T., ;
		Column6.Width = 44, ;
		Column7.BackColor = 244,250,255, ;
		Column7.ColumnOrder = 6, ;
		Column7.ControlSource = "ascd", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.FontSize = 9, ;
		Column7.Name = "Column7", ;
		Column7.Width = 33, ;
		Column8.BackColor = 244,250,255, ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "ascc", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.FontSize = 9, ;
		Column8.Name = "Column8", ;
		Column8.Width = 33, ;
		Column9.BackColor = 244,250,255, ;
		Column9.ColumnOrder = 12, ;
		Column9.ControlSource = "sectie", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.FontSize = 9, ;
		Column9.Name = "Column10", ;
		Column9.Width = 54, ;
		Column10.BackColor = 244,250,255, ;
		Column10.ColumnOrder = 10, ;
		Column10.ControlSource = "nresp", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.FontSize = 9, ;
		Column10.Name = "Column11", ;
		Column10.Width = 68, ;
		Column11.BackColor = 244,250,255, ;
		Column11.ColumnOrder = 11, ;
		Column11.ControlSource = "dst_chlt", ;
		Column11.FontName = "Arial Narrow", ;
		Column11.FontSize = 9, ;
		Column11.Name = "Column12", ;
		Column11.Width = 63, ;
		Column12.BackColor = 244,250,255, ;
		Column12.ColumnOrder = 13, ;
		Column12.ControlSource = "ptva", ;
		Column12.CurrentControl = "Combo1", ;
		Column12.FontName = "Arial Narrow", ;
		Column12.FontSize = 9, ;
		Column12.Name = "Column13", ;
		Column12.Sparse = .F., ;
		Column12.Width = 37, ;
		Column13.BackColor = 244,250,255, ;
		Column13.ColumnOrder = 3, ;
		Column13.ControlSource = "partd", ;
		Column13.FontName = "Arial Narrow", ;
		Column13.FontSize = 9, ;
		Column13.Name = "Column14", ;
		Column13.Width = 69, ;
		Column14.BackColor = 244,250,255, ;
		Column14.ColumnOrder = 4, ;
		Column14.ControlSource = "partc", ;
		Column14.FontName = "Arial Narrow", ;
		Column14.FontSize = 9, ;
		Column14.Name = "Column15", ;
		Column14.Width = 65, ;
		Column15.BackColor = 244,250,255, ;
		Column15.ControlSource = "pereched", ;
		Column15.FontName = "Arial Narrow", ;
		Column15.FontSize = 9, ;
		Column15.Name = "Column9", ;
		Column15.Width = 68, ;
		Column16.BackColor = 244,250,255, ;
		Column16.ControlSource = "perechec", ;
		Column16.FontName = "Arial Narrow", ;
		Column16.FontSize = 9, ;
		Column16.Name = "Column16", ;
		Column16.Width = 68
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'Gridb1.Column12.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip chelt/venit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridb1.Column13.Combo1' AS combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 1, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "0,50", ;
		Comment = "", ;
		FontName = "Arial Narrow", ;
		Height = 10, ;
		Left = 21, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "ttva.ptva,tva", ;
		RowSourceType = 2, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		Top = 23, ;
		Visible = .T., ;
		Width = 10
		*< END OBJECT: BaseClass="combobox" />

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

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

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

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

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

	ADD OBJECT 'Gridb1.Column16.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Doc pereche C", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.Column16.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 = "Explicatia", ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.Column2.Text1' AS textbox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridb1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont Deb", ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridb1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont Cred", ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridb1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma", ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridb1.Column6.Check1' AS checkbox WITH ;
		Alignment = 1, ;
		BackColor = 244,250,255, ;
		Caption = "", ;
		ControlSource = "cu_tva", ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 24, ;
		Name = "Check1", ;
		TabStop = .F., ;
		Top = 32, ;
		Visible = .T., ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Gridb1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cu TVA", ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Gridb1.Column7.Text1' AS textbox WITH ;
		BackColor = 244,250,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 = "Analit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.Column8.Text1' AS textbox WITH ;
		BackColor = 244,250,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 = "Doc pereche D", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< 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 'Item1' AS item WITH ;
		BackColor = 192,192,192, ;
		BackStyle = 0, ;
		Height = 21, ;
		Left = 7, ;
		Name = "Item1", ;
		TabIndex = 2, ;
		Top = 299, ;
		Width = 787, ;
		ZOrderSet = 8, ;
		Label_item1.Caption = "Total suma", ;
		Label_item1.Left = 189, ;
		Label_item1.Name = "Label_item1", ;
		Label_item1.Top = 2, ;
		Text_item1.ControlSource = "thisform.totftva", ;
		Text_item1.DisabledBackColor = 255,255,255, ;
		Text_item1.InputMask = (get_mask(12,gnPa)), ;
		Text_item1.Left = 427, ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Text_item1.SpecialEffect = 1, ;
		Text_item1.Top = 2, ;
		Text_item1.Visible = .T., ;
		Lineo1.Left = 186, ;
		Lineo1.Name = "Lineo1", ;
		Lineo1.Top = 0, ;
		Lineo3.Left = 186, ;
		Lineo3.Name = "Lineo3", ;
		Lineo3.Top = 19, ;
		Lineo4.Left = 638, ;
		Lineo4.Name = "Lineo4", ;
		Lineo4.Top = 0, ;
		Lineo5.Left = 186, ;
		Lineo5.Name = "Lineo5", ;
		Lineo5.Top = 0, ;
		Lineo2.Left = 425, ;
		Lineo2.Name = "Lineo2", ;
		Lineo2.Top = 0
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Renunt1' AS renunt WITH ;
		Left = 734, ;
		Name = "Renunt1", ;
		TabIndex = 7, ;
		Top = 3, ;
		ZOrderSet = 7, ;
		Imbuton1.Height = 27, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Stretch = 2, ;
		Imbuton1.Width = 30, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Resizable1' AS resizable WITH ;
		Left = 24, ;
		Name = "Resizable1", ;
		repositionlist = Renunt Verif GridbTextbox Label Shape Container Titlufrumos Item, ;
		resizelist = Renunt Verif GridbTextbox Label Shape Container Titlufrumos Item, ;
		Top = 324
		*< END OBJECT: ClassLib="..\comun\clase\solution.vcx" BaseClass="custom" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackColor = 247,245,238, ;
		BorderColor = 247,245,238, ;
		BorderStyle = 1, ;
		Height = 31, ;
		Left = 7, ;
		Name = "Shape2", ;
		Top = 295, ;
		Width = 787, ;
		ZOrderSet = 0
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Verif1' AS verif WITH ;
		Left = 767, ;
		Name = "Verif1", ;
		TabIndex = 5, ;
		Top = 3, ;
		ZOrderSet = 9, ;
		IMBUTON1.Height = 26, ;
		IMBUTON1.Name = "IMBUTON1", ;
		IMBUTON1.Width = 26, ;
		COMMAND1.Name = "COMMAND1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />
	
	PROCEDURE calculez
		PARAMETERS calc_baza
		LOCAL lni
		
		SELECT introdc 
		lni=RECNO()
		
		lcExcScd = ALLTRIM(this.pcexceptii_scd)
		lcExcSCC = ALLTRIM(this.pcexceptii_scc)
		
		IF !EMPTY(tcscc)
			SUM suma TO lnBaza FOR !INLIST(VAL(scc), &lcExcscc)
			SUM suma TO lnBazaDiscount FOR INLIST(VAL(scc), &lcExcscc)
		ELSE 
			SUM suma TO lnBaza FOR !INLIST(VAL(scd), &lcExcscd)
			SUM suma TO lnBazaDiscount FOR INLIST(VAL(scd), &lcExcscd)
		ENDIF 
		
		this.totftva = lnBaza - lnBazaDiscount
		IF !calc_baza
			IF !EMPTY(tcscc)
				SUM suma*ptva TO lnTva FOR cu_tva = 1 AND !INLIST(VAL(scc), &lcExcscc)
				SUM suma*ptva TO lnTvaDiscount FOR cu_tva = 1 AND INLIST(VAL(scc), &lcExcscc)
			ELSE 
				SUM suma*ptva TO lnTva FOR cu_tva = 1 AND !INLIST(VAL(scd), &lcExcscd)
				SUM suma*ptva TO lnTvaDiscount FOR cu_tva = 1 AND INLIST(VAL(scd), &lcExcscd)
			ENDIF 	 
			this.tva = ROUND(lnTva/100,gnPC) - ROUND(lnTvaDiscount/100,gnPC)
		ENDIF 
		this.totctva = this.totftva + this.tva 
		
		this.item1.text_item1.Refresh 
		this.container1.item2.text_item1.refresh 
		this.container1.item3.text_item1.refresh 
		
		SELECT introdc 
		IF lni=1
			GOTO TOP 
		ELSE 
			GOTO lni 
		ENDIF 
	ENDPROC

	PROCEDURE do_cauta_alfa
		PARAMETERS tcFis, tcColoane, tcTitlu, tcTitluColoane
		
		*!* 11.07.2007
		pcselect = [select * from ] + tcFis
		pcfiltru = [1=2]
		pcschema = []
		pcorder = ''
		pccoloane = tcColoane
		pcTitlu = tcTitlu 
		pcTitluColoane = tcTitluColoane
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,tcFis) && 11.07.2007
		
		RETURN locauta
	ENDPROC

	PROCEDURE do_cauta_partener
		PARAMETERS tcCont, lcCampId, lcCampNume
		
		lcCont = ALLTRIM(tcCont)
		loHash = GetHash([cTitlu=>Nume partener ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont + [??lVerificaANAF=>1])
		loHash.SetValue('dDataDoc', Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
		loCauta = CautPartenerContabilitate(loHash)
		
		If !Empty(locauta.nume)
			lnid_part=locauta.id_part
			lcnume=Alltrim(locauta.nume)
		Else
			lnId_part = 0
			lcNume = ''
		ENDIF
		
		SELECT introdc
		REPLACE &lcCampId WITH lnid_part, &lcCampNume WITH lcNume
	ENDPROC

	PROCEDURE Init
		IF !EMPTY(tcSCD)
			this.container2.optiongroup1.option2.Caption = "in casa"
			this.container2.optiongroup1.option3.Visible = .F.
			this.container2.item2.label_item1.Caption = "Casa incasari"
		ENDIF 	
		DODEFAULT()
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode=10
			NODEFAULT 
			this.container1.item2.SetFocus 
		ENDIF 
	ENDPROC

	PROCEDURE la_iesire
		lcObj = ALLTRIM(this.pcobj)
		lcExcScd = ALLTRIM(this.pcexceptii_scd)
		lcExcSCC = ALLTRIM(this.pcexceptii_scc)
		
		SELECT actactan
		ZAP
		
		*!*	SELECT introdc
		*!*	REPLACE ALL neimpozab WITH suma FOR ptva=0 AND cu_tva = 1
		*!*	REPLACE ALL neimpozab WITH 0 FOR ptva # 0 AND cu_tva = 1
		
		SELECT introdc
		SCAN FOR !EMPTY(suma)
			SCATTER NAME ointr
			IF tl_calcTva && doar la introduceri care au legatura cu registrele de TVA
				WITH &lcObj
					IF ointr.cu_tva = 1
						.proc_tva = (100 + ointr.ptva) / 100
					ELSE 
						.proc_tva = 0
					ENDIF 
				ENDWITH 
			ENDIF 
			SELECT actactan
			APPEND BLANK
			IF FLOCK()
				GATHER NAME &lcObj
				GATHER NAME ointr
			ENDIF
			UNLOCK
			SELECT introdc
		ENDSCAN
		SET STEP ON 
		IF tl_calcTVA && or thisform.container1.Visible= .T. && sau cu parametrul = .t. --- tl_calcTVA
		
			SELECT actactan
			DO CASE
			CASE !EMPTY(tcscc)
		
				SELECT DISTINCT IIF(!INLIST(VAL(scc), &lcExcScc), ascc, ascd) AS ascc, proc_tva, IIF(!INLIST(VAL(scc), &lcExcScc), id_partc, id_partd) as id_part, IIF(!INLIST(VAL(scc), &lcExcScc), partc, partd) as nume_part ;
				FROM actactan WHERE proc_tva <> 0 INTO CURSOR cascc ORDER BY 1
				SELECT cascc
				SCAN
					SCATTER FIELDS ascc, proc_tva, id_part, nume_part MEMV
					SELECT actactan
					SUM ROUND(suma*(m.proc_tva-1), gnPC) TO lnsuma FOR ascc = m.ascc AND proc_tva=m.proc_tva AND id_partc = m.id_part AND !INLIST(VAL(scc), &lcExcScc)
					SUM ROUND(suma*(m.proc_tva-1), gnPC) TO LnSumDisc FOR ascd = m.ascc AND proc_tva=m.proc_tva AND id_partd = m.id_part AND INLIST(VAL(scc), &lcExcScc)
					lnsuma = lnsuma - LnSumDisc
					APPEND BLANK
					GATHER NAME &lcObj
					GATHER FIELDS ascc, proc_tva MEMVAR
					GATHER NAME ointr FIELDS EXCEPT ascc, proc_tva, id_partc, id_partd, partd,id_factc,id_factd,perechec,pereched
					REPLACE scd WITH tctva, scc WITH tcscc, ascd WITH '',ascc WITH m.ascc, suma WITH lnsuma, id_partc WITH m.id_part, partc WITH m.nume_part
					*REPLACE explicatia WITH ''
					SELECT cascc
				ENDSCAN
				SELECT actactan
				r=RECNO()
				SUM(suma) TO lntottva FOR scd  = tctva
				IF r=1
					GOTO TOP 
				ELSE 
					GOTO r 
				ENDIF 
				REPLACE suma WITH suma + THISFORM.tva - lntottva  &&reglez diferente de rotunjire tva
				USE IN cascc
			CASE !EMPTY(tcscd)
		
				SELECT DISTINCT IIF(!INLIST(VAL(scd), &lcExcScd), ascd, ascc) AS ascd, proc_tva,  IIF(!INLIST(VAL(scd), &lcExcScd), id_partd, id_partc) as id_part, IIF(!INLIST(VAL(scd), &lcExcScd), partd, partc) as nume_part  ;
				FROM actactan WHERE proc_tva <> 0 INTO CURSOR cascd ORDER BY 1
				SELECT cascd
				SCAN
					SCATTER FIELDS ascd,proc_tva,id_part, nume_part MEMV
					SELECT actactan
					SUM ROUND(suma * (m.proc_tva-1), gnPC) TO lnsuma FOR ascd = m.ascd AND proc_tva = m.proc_tva AND id_partd = m.id_part AND !INLIST(VAL(scd), &lcExcScd)
					SUM ROUND(suma * (m.proc_tva-1), gnPC) TO LnSumDisc FOR ascc = m.ascd AND proc_tva = m.proc_tva AND id_partc = m.id_part AND INLIST(VAL(scd), &lcExcScd)
					lnsuma = lnsuma - LnSumDisc
					APPEND BLANK
					GATHER NAME &lcObj
					GATHER FIELDS ascd, proc_tva MEMVAR
					GATHER NAME ointr FIELDS EXCEPT suma, ascd, id_partd, id_partc, partc,id_factc,id_factd,perechec,pereched
					REPLACE scc WITH tctva, scd WITH tcscd, ascc WITH '',ascd WITH m.ascd, suma WITH lnsuma, id_partd WITH m.id_part, partd WITH m.nume_part
					*REPLACE explicatia WITH ''
					SELECT cascd
				ENDSCAN
				SELECT actactan
				r=RECNO()
				SUM(suma) TO lntottva FOR scc = tctva
				IF r=1
					GOTO TOP 
				ELSE 
					GOTO r 
				ENDIF 
				REPLACE suma WITH suma + THISFORM.tva - lntottva &&reglez diferente de rotunjire tva
				USE IN cascd
		
			ENDCASE
		ENDIF
		
		DO CASE
		CASE THISFORM.container2.optiongroup1.VALUE=2
		
			DO CASE
				CASE !EMPTY(tcscc)
					SELECT DISTINCT IIF(!INLIST(VAL(scc), &lcExcScc), ascc, ascd) AS ascc, proc_tva, IIF(!INLIST(VAL(scc), &lcExcScc), id_partc, id_partd) as id_part, IIF(!INLIST(VAL(scc), &lcExcScc), partc, partd) as nume_part ;
					FROM actactan INTO CURSOR cascc ORDER BY 1
					SELECT cascc
					SCAN
						SCATTER FIELDS ascc, proc_tva, id_part, nume_part MEMV
						SELECT actactan
						SUM suma TO lnsuma FOR ascc = m.ascc AND proc_tva=m.proc_tva AND id_partc = m.id_part AND !INLIST(VAL(scc), &lcExcScc)
						SUM suma TO LnSumDisc FOR ascd = m.ascc AND proc_tva=m.proc_tva AND id_partd = m.id_part AND INLIST(VAL(scc), &lcExcScc)
						lnsuma = lnsuma - LnSumDisc
						APPEND BLANK
						GATHER NAME &lcObj
						GATHER FIELDS proc_tva, id_partc, scc, ascc MEMVAR
						GATHER NAME ointr FIELDS EXCEPT suma, ascc, scc, id_partc,id_factc,id_factd,perechec,pereched
						REPLACE partD WITH partC, id_partd WITH id_partc, suma WITH lnsuma
						REPLACE scd WITH scc, ascd WITH ascc, scc WITH '5311', ascc WITH '', perecheD WITH nract, id_factd WITH -1,nract WITH THISFORM.nrchit, partC WITH THISFORM.casa, id_partc WITH THIS.ID_casa
						REPLACE pozitie_1 WITH 2
						SELECT cascc
					ENDSCAN
					USE IN cascc
				CASE !EMPTY(tcscd)
					SELECT DISTINCT IIF(!INLIST(VAL(scd), &lcExcScd), ascd, ascc) AS ascd, proc_tva, IIF(!INLIST(VAL(scd), &lcExcScd), id_partd, id_partc) as id_part, IIF(!INLIST(VAL(scd), &lcExcScd), partd, partc) as nume_part ;
					FROM actactan INTO CURSOR cascd ORDER BY 1
					SELECT cascd
					SCAN
						SCATTER FIELDS ascd, proc_tva, id_part, nume_part MEMV
						SELECT actactan
						SUM suma TO lnsuma FOR ascd = m.ascd AND proc_tva=m.proc_tva AND id_partd = m.id_part AND !INLIST(VAL(scd), &lcExcScd)
						SUM suma TO LnSumDisc FOR ascc = m.ascd AND proc_tva=m.proc_tva AND id_partc = m.id_part AND INLIST(VAL(scd), &lcExcScd)
						lnsuma = lnsuma - LnSumDisc
						APPEND BLANK
						GATHER NAME &lcObj
						GATHER FIELDS proc_tva, id_partd, scd, ascd MEMVAR
						GATHER NAME ointr FIELDS EXCEPT suma, ascd, scd, id_partd,id_factd,id_factc,pereched,perechec
						REPLACE partC WITH partD, id_partc WITH id_partd, suma WITH lnsuma
						REPLACE scc WITH scd, ascc WITH ascd, scd WITH '5311', ascd WITH '', perecheC WITH nract, id_factc WITH -1,nract WITH THISFORM.nrchit, partC WITH THISFORM.casa, id_partd WITH THIS.ID_casa
						REPLACE pozitie_2 WITH 1
						SELECT cascd
					ENDSCAN
					USE IN cascd
							
			ENDCASE 	
		CASE THISFORM.container2.optiongroup1.VALUE=3
		
		*!*		SELECT DISTINCT ascc, scc, id_partc FROM actactan INTO CURSOR cascc ORDER BY ascc
		*!*		SELECT cascc
		*!*		SCAN
		*!*			SCATTER FIELDS ascc, scc, id_partc MEMV
		*!*			SELECT actactan
		*!*			CALCULATE SUM(suma) TO lnsuma FOR ascc = m.ascc AND id_partc = m.id_partc && AND proc_tva=m.proc_tva
			
			SELECT DISTINCT IIF(!INLIST(VAL(scc), &lcExcScc), ascc, ascd) AS ascc, IIF(!INLIST(VAL(scc), &lcExcScc), id_partc, id_partd) as id_part, IIF(!INLIST(VAL(scc), &lcExcScc), partc, partd) as nume_part ;
			FROM actactan INTO CURSOR cascc ORDER BY 1
			SELECT cascc
			SCAN
				SCATTER FIELDS ascc, id_part, nume_part MEMV
				SELECT actactan
				SUM suma TO lnsuma FOR ascc = m.ascc AND id_partc = m.id_part AND !INLIST(VAL(scc), &lcExcScc)
				SUM suma TO LnSumDisc FOR ascd = m.ascc AND id_partd = m.id_part AND INLIST(VAL(scc), &lcExcScc)
				lnsuma = lnsuma - LnSumDisc
				APPEND BLANK
				GATHER NAME &lcObj
				GATHER FIELDS ascc, scc, id_partc MEMVAR
				GATHER NAME ointr FIELDS EXCEPT suma, ascc, scc, id_partc
				REPLACE partD WITH partC, id_partd WITH id_partc, suma WITH lnsuma
				REPLACE scd WITH scc, ascd WITH ascc, scc WITH '542 ', ascc WITH '', perecheD WITH nract, id_factd WITH -1,nract WITH THISFORM.nrchit, partC WITH THISFORM.achi, id_partc WITH THIS.ID_achi
				*REPLACE  explicatia WITH '', dst_chlt WITH ''
			ENDSCAN
			IF USED('actcv542')
				SELECT actcv542
				REPLACE ALL achilei WITH 0 FOR ales
				SUM sumaachi TO lnSuma542
				SELECT actactan 
				SUM suma TO lnSAct FOR ALLTRIM(scc) = '542'
				IF lnSuma542 # lnSAct
					DO mesaj WITH 'Refaceti plata din 542!',''
					RETURN .f.
				ENDIF 
			ENDIF 
			
			SELECT actactan
			SCAN FOR ALLTRIM(scc) = '542' AND perecheC = 0
				SCATTER NAME ocomp
				SELECT actcv542
				LOCATE FOR ales AND achilei < sumaachi
				lnsuma = ocomp.suma - (sumaachi - achilei)
				DO CASE
				CASE lnsuma = 0
					REPLACE achilei WITH sumaachi
					lnNract = nract
					lnIdFact = id_fact
					lcAcont = acont
					SELECT actactan
					REPLACE perecheC WITH lnNract, id_factc WITH lnIdFact,ascc WITH lcAcont
				CASE lnsuma<0
					REPLACE achilei WITH achilei+ocomp.suma
					lnNract = nract
					lnIdFact = id_fact
					lcAcont = acont
					SELECT actactan
					REPLACE perecheC WITH lnNract, id_factc WITH lnIdFact, ascc WITH lcAcont
				CASE lnsuma > 0
					lnSumaAct = sumaachi - achilei
					lnNract = nract
					lnIdFact = id_fact
					lcAcont = acont
					REPLACE achilei WITH achilei + lnSumaAct
					SELECT actactan
					lnr = RECNO()
		
					REPLACE suma WITH lnSumaAct, perecheC WITH lnNract, id_factc WITH lnIdFact, ascc WITH lcAcont
					APPEND BLANK
					GATHER NAME ocomp
					REPLACE suma WITH suma - lnSumaAct
					 
					IF lnr=1
						GOTO TOP 
					ELSE 
						GOTO lnr
					ENDIF 
				ENDCASE
				SELECT actactan
			ENDSCAN
			USE IN cascc
		CASE THISFORM.container2.optiongroup1.VALUE=1 AND tl_plata
			SELECT actactan
			REPLACE ALL datascad WITH THISFORM.datascad
		ENDCASE
		
		
		RELEASE ointr
		
		DELETE FROM ACTACTAN WHERE SUMA = 0
		SELECT actactan
		GO TOP
		
		RETURN .t.
		
		
		
		
		
		
	ENDPROC

	PROCEDURE Resize
		this.resizable1.adjustcontrols 
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		
		lcObj = ALLTRIM(this.pcobj)
		
		WITH &lcObj
			this.datascad = GOMONTH(.dataact, 1)
		ENDWITH 
		
		IF !EMPTY(tcscc)
			THIS.GRIdb1.COLUMN4.ReadOnly=.T.
			THIS.GRIdb1.COLUMN15.ReadOnly=.T.
		ENDIF 
		IF !EMPTY(tcscD)
			THIS.GRIdb1.COLUMN3.ReadOnly=.T.
			THIS.GRIdb1.COLUMN14.ReadOnly=.T.
		ENDIF 
		
		
		IF INLIST(tn_idset,10460)
		*!*		SELECT introdc
		*!*		REPLACE ALL sectie WITH m.sectie,dst_chlt WITH m.dst_chlt nresp WITH m.nresp
			this.gridb1.Refresh 
			this.container1.item2.text_item1.SetFocus
		ELSE 
			this.gridb1.SetFocus
		ENDIF 
	ENDPROC

	PROCEDURE verificare
		LOCAL LL_MARCA
		LL_MARCA=.T.
		DO CASE 
			CASE thisform.container2.optiongroup1.Value=2
				IF EMPTY(thisform.nrchit) OR EMPTY(this.id_casa)
					DO mesaj WITH 'Nu ati completat datele referitoare la plata!',''
					thisform.container2.text_item1.SetFocus 
					LL_MARCA=.F.
				ENDIF 
			CASE thisform.container2.optiongroup1.Value=3
				IF EMPTY(thisform.nrchit) OR EMPTY(this.id_achi)
					DO mesaj WITH 'Nu ati completat datele referitoare la plata!',''
					thisform.container2.text_item1.SetFocus 
					LL_MARCA=.F.
				ENDIF 
		ENDCASE 
		
		IF 	LL_MARCA
		*	IF !EMPTY(THISFORM.TOTctva) OR !EMPTY(THISFORM.TOTftva) OR !EMPTY(THISFORM.TVa)
			LL_MARCA = thisform.la_iesire()
		*	ENDIF 
		ENDIF 
		
		RETURN LL_MARCA
	ENDPROC

	PROCEDURE verific_analitic
		*!*	PARAMETERS tlClick, tccont, tcacont, tcColoana
		
		*!*	m.den=''
		*!*	ll_l=.f.
		
		*!*	IF EMPTY(tccont)
		*!*		RETURN ll_l
		*!*	ENDIF 
		
		*!*	IF USED('TCEVA')
		*!*		USE IN Tceva
		*!*	ENDIF
		
		*!*	lcSql=[select acont || ' - ' || explicatie as den, CONT, ACONT FROM ] + gcS + [.vplcont_ANALITIC where cont=?tcCont and inactiv = 0 and an = ] + pcAn + [ order by acont ]
		*!*	lcCursor = 'tceva'
		*!*	lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		
		*!*	SELECT tceva
		*!*	LOCATE 
		*!*	IF EOF()
		*!*		IF !EMPTY(tcAcont) AND !ISNULL(tcAcont)
		*!*			DO mesaj WITH 'Nu au fost definite simboluri analitice','pentru contul ' + tcCont
		*!*			ll_l=.t.
		*!*		ENDIF 
		*!*		
		*!*		IF USED('TCEVA')
		*!*			USE IN Tceva 
		*!*		ENDIF 
		*!*		SELECT introdc 
		*!*		this.gridb1.SetFocus 
		*!*		RETURN ll_l
		*!*	ELSE 
		*!*		IF !tlClick
		*!*			IF empty(tcAcont)
		*!*	*!*				SELECT introdc
		*!*	*!*				IF FLOCK()
		*!*	*!*					REPLACE &tcColoana WITH '0000'
		*!*	*!*				ENDIF 
		*!*				
		*!*				IF USED('TCEVA')
		*!*					USE IN Tceva 
		*!*				ENDIF 
		*!*				SELECT introdc 
		*!*				this.gridb1.SetFocus 
		*!*				RETURN ll_l
		*!*			ENDIF 
		*!*		ENDIF 
		*!*	ENDIF
		
		*!*	SELECT tceva
		*!*	IF tlClick
		*!*		DO caut_alfa_cursor WITH 'tceva','den','Alegeti simbolul analitic','m.den'
		*!*		SELECT tceva
		*!*		LOCATE FOR ALLTRIM(den) = ALLTRIM(m.den)
		*!*		lcAcont = acont
		
		*!*		SELECT introdc
		*!*		REPLACE &tcColoana WITH lcAcont
		*!*	ELSE 
		*!*		LOCATE FOR ALLTRIM(cont)=ALLTRIM(tccont) AND ALLTRIM(acont)=ALLTRIM(tcacont)
		*!*		IF !FOUND()
		*!*			DO caut_alfa_cursor WITH 'tceva','den','Alegeti simbolul analitic','m.den'
		*!*			SELECT tceva
		*!*			LOCATE FOR ALLTRIM(den) = ALLTRIM(m.den)
		*!*			lcAcont = acont
		
		*!*			SELECT introdc
		*!*			REPLACE &tcColoana WITH lcAcont
		*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF USED('TCEVA')
		*!*		USE IN Tceva 
		*!*	ENDIF  
		
		*!*	SELECT introdc 
		*!*	this.gridb1.SetFocus 
		*!*	RETURN ll_l
	ENDPROC

	PROCEDURE verific_cont
		*!*	PARAMETERS tcCont
		
		*!*	llNuExista = .t.
		*!*	tcCont = ALLTRIM(tcCont)
		
		*!*	lcSql=[select count(*) as exista_cont FROM ] + gcS + [.vplcont_sintetic where cont=?tcCont and inactiv = 0 and an = ?gnAn ]
		*!*	lcCursor = 'crs_cont'
		*!*	lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX('VERIFICARE CONT ' + CHR(13) + goExecutor.cEroare,0+16,"Eroare")
		*!*	ENDIF
		*!*	IF lnSucces > 0 AND _tally > 0
		*!*		SELECT crs_cont
		*!*		LOCATE
		*!*		IF exista_cont > 0
		*!*			llNuExista = .f.
		*!*		ENDIF 
		*!*	ENDIF 
		*!*	IF llNuExista
		*!*		MESSAGEBOX('Acest cont nu este configurat in planul de conturi!',0,'Atentie!')
		*!*	ENDIF 
		
		*!*	RETURN llNuExista
		
	ENDPROC

	PROCEDURE verific_inregistrari
		*!*	PARAMETERS tnFel,toAct,tcControl
		*!*	LOCAL lcSel,lcSelAct,lcControl
		
		*!*	*** tnFel : cum ar tb sa fie contul ca sa ceara doc pereche 0 = Activ , 1 = Pasiv
		*!*	*** toAct : obiect cu varibilele din tabel
		*!*	*** lcControl : calea catre grid raportata la forma
		
		*!*	lcControl = ALLTRIM(tcControl)
		*!*	lcSelAct = &lcControl..RecordSource
		*!*	SELECT (lcSelAct)
		*!*	lnRand = RECNO()
		*!*	pnFelCont = tnFel
		*!*	lnSucces=1
		
		*!*	IF pnFelCont = 0                  && ACTIV
		*!*		pcContul = ALLTRIM(NVL(toAct.scc,[]))
		*!*		pcContCoresp = ALLTRIM(NVL(toAct.scd,[]))
		*!*		pcACont = ALLTRIM(NVL(toAct.ascc,[NULL]))
		*!*		pnIdPart = NVL(toAct.Id_partc,0)
		*!*		pcNume = ALLTRIM(NVL(toAct.partc,[]))
		*!*		pnPereche = [perecheC]
		*!*		pnIdPereche = [id_factC]
		*!*		pnPozCont = 1
		*!*	ELSE                               && PASIV
		*!*		pcContul = ALLTRIM(NVL(toAct.scd,[]))
		*!*		pcContCoresp = ALLTRIM(NVL(toAct.scc,[]))
		*!*		pcACont = ALLTRIM(NVL(toAct.ascd,[NULL]))
		*!*		pnIdPart = NVL(toAct.Id_partd,0)
		*!*		pcNume = ALLTRIM(NVL(toAct.partd,[]))
		*!*		pnPereche = [perecheD]
		*!*		pnIdPereche = [id_factD]
		*!*		pnPozCont = 0
		*!*	ENDIF 
		*!*	lcFis = 'actcv' + ALLTRIM(pcContul)
		
		*!*	lcSelect = [select count(*) as ePereche from ] + gcs + [.vcoresp_tip_cont where cont = ?pcContul and fel_cont = ?pnFelCont and cu_inregistrari = 1 ] + ;
		*!*				[and ?pcContul not in (select cont from ] + gcs + [.exceptii_ireg where cont_c = ?pcContCoresp and invers = 1 and debit =?pnPozCont)] 
		*!*	lcCursor = [crsTest]
		*!*	lnSucces = goexecutor.oExecute(lcSelect,lcCursor)
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX('Modificare:Verific existenta pereche ' +goExecutor.cEroare,0+16,"Eroare")
		*!*	ENDIF 
		
		*!*	IF lnSucces > 0
		*!*		SELECT crsTest
		*!*		LOCATE 
		*!*		IF ePereche = 0
		*!*			lnSucces = -1
		*!*			toact.&pnPereche = 0
		*!*			MESSAGEBOX('Nu trebuie completat documentul pereche!',0,'Informare')
		*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF lnSucces > 0
		*!*		IF TYPE('toAct.Suma_val')# 'U' AND !EMPTY(toAct.Suma_val)
		*!*			llval = .t.
		*!*			pnSuma = toAct.Suma_val
		*!*			lcFormular = [ocompensari_val]
		*!*			IF TYPE('toAct.Id_Valuta')# 'U'
		*!*				pnIdValuta = toAct.Id_Valuta
		*!*			ELSE 
		*!*				pnIdValuta = 0
		*!*			ENDIF 
		*!*		ELSE 
		*!*			llval = .f.
		*!*			pnSuma = toAct.Suma
		*!*			lcFormular = [ocompensari]
		*!*		ENDIF 
		
		*!*		pcDenumire = [Partener ] + pcContul 
		
		*!*		pcCond = [ an = ?gnAn and luna = ?gnluna]
		
		*!*		IF llval
		*!*			pccond= pccond + [ and ABS(i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit)>0 and i.id_valuta = ?pnIdValuta ]
		*!*		ELSE
		*!*			pccond= pccond + [ and (i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit = 0) ]
		*!*		ENDIF
		
		*!*		pcselect = ['select i.* FROM ] + gcs + [.Vireg_parteneri i where 2=2 ']
		*!*		IF ALLTRIM(pcACont) # [NULL]
		*!*			pcfiltru = [ i.id_part = ?pnIdPart AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont = ?pcContul and ] + pcCond
		*!*		ELSE
		*!*			pcfiltru = [ i.id_part = ?pnIdPart AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont = ?pcContul and acont is null and ] + pcCond
		*!*		ENDIF 
		*!*		pcschema = ['']
		*!*		pcorder = ['']
		
		*!*		PRIVATE podateintrod
		*!*		STORE '' TO podateintrod
		
		*!*		gencursor('podateintrod','crs_actcv',pcselect,pcfiltru,[''],'')
		*!*		IF TYPE('podateintrod') # 'O'
		*!*			lnSucces = -1
		*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF lnSucces > 0
		*!*		IF USED(lcFis)
		*!*			USE IN &lcFis
		*!*		ENDIF
		
		*!*		IF pnFelCont = 0
		*!*			lcsel = [SELECT *, ACONT AS ASCC, nume_val as numeval, curs as cursschimb, precdeb + debit as totctva, preccred+credit as achitat, ] +;
		*!*				[precvaldeb + valdebit AS sumaval, precVALcred+VALcredit as achitatval, ] +;
		*!*				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 000000.0000 as cursval, 000000.0000 as cursdif ] +;
		*!*				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		*!*		ELSE
		*!*			lcsel = [SELECT *, ACONT AS ASCD, nume_val as numeval, curs as cursschimb, preccred + credit as totctva, precdeb+debit as achitat, ] + ;
		*!*				[precvalcred + valcredit as sumaval, precVALdeb+VALdebit as achitatval, ] + ;
		*!*				[.f. as ales, 00000000000000.0000 as sumaachi, 00000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 000000.0000 as cursval, 000000.0000 as cursdif ] + ;
		*!*				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		*!*		ENDIF
		*!*		&lcsel
		*!*		IF USED('crs_actcv')
		*!*			USE IN crs_actcv
		*!*		ENDIF 
		*!*		SELECT (lcFis)
		
		*!*		OPLATA=CREATEOBJECT(lcFormular)
		*!*		OPLATA.titlufrumos1.CAPTION = pcDenumire + [: ] + pcNume
		*!*		OPLATA.pcFis = lcFis
		*!*		OPLATA.SUMA = pnSuma
		*!*		OPLATA.pnFelCont = pnFelCont
		*!*		OPLATA.SHOW(1)
		
		*!*		IF gnButon = 1
		*!*			SELECT (lcSelAct)
		*!*			DELETE 
		*!*			SELECT (lcFis)
		*!*			SCAN FOR ales
		*!*				SCATTER NAME oper
		*!*				SELECT (lcSelAct)
		*!*				APPEND BLANK 
		*!*				GATHER NAME toAct
		*!*				REPLACE &pnIdPereche WITH oper.id_fact, &pnPereche WITH oper.nract, suma WITH oper.sumaachi
		*!*				IF TYPE('toAct.Suma_val')# 'U'
		*!*					REPLACE suma_val WITH oper.sumaachi2
		*!*				ENDIF 
		*!*				SELECT (lcFis)
		*!*			ENDSCAN 
		*!*			
		*!*		ELSE 
		*!*			lnSucces = -1
		*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF lnSucces < 0
		*!*		SELECT &lcSelAct
		*!*		lcUpdate = [update ] + lcSelAct + [ set ] + pnPereche + [= ] + ALLTRIM(STR(toact.&pnPereche)) + [ WHERE RECNO() = ] + ALLTRIM(STR(lnRand))
		*!*		&lcUpdate
		*!*		*UPDATE (lcSelAct) SET &pnPereche = toact.&pnPereche WHERE RECNO() = lnRand
		*!*	ELSE 
		*!*		SELECT (lcSelAct)
		*!*		DO nrord WITH lcSelAct
		*!*	ENDIF 
		
		*!*	IF USED(lcFis)
		*!*		USE IN (lcFis)
		*!*	ENDIF 
		*!*	IF USED('crsTest')
		*!*		USE IN crsTest
		*!*	ENDIF 
		
		*!*	SELECT (lcSelAct)
		*!*	&lcControl..SetFocus 
	ENDPROC

	PROCEDURE verific_partener
		PARAMETERS tcCont, tcId, tcNume
		
		IF EMPTY(tcCont)
			RETURN
		ENDIF 
		
		LOCAL llReturn
		llReturn = .f.
		
		SELECT introdc
		lcCont = &tcCont
		lcCont = ALLTRIM(lcCont)
			
		lcSql=[select count(*) as valoare FROM ] + gcS + [.vcoresp_tip_cont where cont = ?lcCont ]
		lcCursor = 'c_part'
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		IF lnSucces < 0
			aMESSAGEBOX('VERIFICARE PARTENER ' + CHR(13) + goExecutor.cEroare,0+16,"Eroare")
		ENDIF
		
		IF lnSucces > 0
			SELECT c_part
			IF valoare > 0
				thisform.do_cauta_partener(lcCont, tcId, tcNume)
			ENDIF 
			IF USED('c_part')
				USE IN c_part
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.GotFocus
		*
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.LostFocus
		IF INLIST(tn_idset,10460) && combustibili cu taxa
			SELECT INTRODC
			LOCATE FOR ptva <> 0 AND suma = 0
			IF FOUND()
				lnProcTva = (100 + ptva)/100
				REPLACE SUMA WITH ROUND(THISFORM.TVA/(lnProcTva-1),gnPC)
			ELSE 
				LOCATE 
			ENDIF 
		ENDIF 
		thisform.calculez(.t.) 
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.When
		*thisform.tva=(m.ctva-1)*thisform.totftva 
		*thisform.totctva=thisform.tva+thisform.totftva
		*this.Refresh 
		*this.Parent.Parent.item3.Refresh 
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.GotFocus
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.LostFocus
		IF INLIST(tn_idset,10460)
			SELECT INTRODC
			SUM SUMA TO LnSuma FOR ptva <> 0 
			SUM Suma TO lnSumaNeimp FOR ptva = 0
			IF ABS(THISFORM.totctva-thisform.tva-LnSuma-lnSumaNeimp)<100   && sa nu calculexe taxa de drum dc e < 100 lei
				LOCATE FOR ptva <> 0 
			ELSE 
				LOCATE FOR ptva = 0 AND UPPER(LEFT(explicatie,4))='TAXA'
			ENDIF 
			IF FOUND()
				REPLACE SUMA WITH suma+THISFORM.totctva-thisform.tva-LnSuma-lnSumaNeimp
			ELSE 
				LOCATE 
			ENDIF 
			thisform.totftva=THISFORM.totctva-thisform.tva
			thisform.item1.text_item1.Refresh 
		ELSE 
			thisform.tva=thisform.totctva-thisform.totftva 
			thisform.container1.item2.text_item1.Refresh 
		ENDIF 
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.When
		*
	ENDPROC

	PROCEDURE Container2.Item1.Text_item1.GotFocus
		*!* 11.07.2007
		pcselect = [select p.nume, p.cod_fiscal, p.id_part FROM Vcoresp_tip_part p  JOIN Vcoresp_tip_cont t on p.id_tip_part = t.id_tip_part ] 
		pcFiltruOriginal = [to_number(t.cont) = 542 and inactiv = 0] 
		pcfiltru = [1=2]
		pcschema = ['']
		pcorder = [P.NUME]
		pccoloane = [NUME,COD_FISCAL]
		pcTitlu = [Numele achizitorului] 
		pcTitluColoane = [Nume,Cod fiscal]
		locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane,'',.F.,pcFiltruOriginal) && 11.07.2007
		
		thisform.achi = ALLTRIM(locauta.nume)
		thisform.id_achi = locauta.id_part
	ENDPROC

	PROCEDURE Container2.Item1.Text_item1.LostFocus
		*this.Refresh 
	ENDPROC

	PROCEDURE Container2.Item1.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container2.Item1.Text_item1.When
		*
	ENDPROC

	PROCEDURE Container2.Item2.Text_item1.GotFocus
		*!* 11.07.2007
		pcselect = [select p.nume, p.cod_fiscal, p.id_part FROM Vcoresp_tip_part p  JOIN Vcoresp_tip_cont t on p.id_tip_part = t.id_tip_part ]
		pcfiltru = [1=2]
		pcschema = []
		pcorder = [P.NUME]
		pccoloane = [NUME]
		pcTitlu = [Casa] 
		pcTitluColoane = [Casa]
		pcFiltruOriginal = [t.cont = '5311' and inactiv = 0]
		locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane,'',.F.,pcFiltruOriginal)  && 11.07.2007
		
		thisform.casa = ALLTRIM(locauta.nume)
		thisform.id_casa = locauta.id_part
	ENDPROC

	PROCEDURE Container2.Item2.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Container2.Item2.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container2.Item2.Text_item1.When
		*
	ENDPROC

	PROCEDURE Container2.Item3.Text_item1.GotFocus
		*!*	DO aleg_doc_plata WITH 'achilun',THISFORM.achi,.F.,'A'
		*!*	m.nume_2=THISFORM.achi
		*!*	lcNume='m.nume_2'
		*!*	m.suma=THISFORM.totctva
		*!*	OPLATA=CREATEOBJECT('compens_multe')
		*!*	OPLATA.txtNume.CONTROLSOURCE=lcNume
		*!*	OPLATA.SHOW(1)
		
		*!*	SELECT actcv
		*!*	CALCULATE CNT() FOR ales TO LnBife
		*!*	IF LnBife=1
		*!*		LOCATE FOR ales
		*!*		m.compensat=nract
		*!*	ELSE
		*!*		m.compensat=0
		*!*	ENDIF
		
		lcContul = '542'
		lccond = [ an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnluna))
		lccond= lccond + [ and (i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit = 0) ]
		
		
		lnIdPart = THISFORM.id_achi
		lcNume = THISFORM.achi
		lnFelCont = 0
		lcDenumire = 'Achizitor'
		
		pcselect = ['select i.* FROM ] + gcs + [.Vireg_parteneri i where 2=2 ']
		pcfiltru = [ i.id_part = ] + ALLTRIM(STR(lnIdPart)) + [ AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont =]+ lcContul + [ and ] + lccond
		pcschema = ['']
		pcorder = ['']
		
		PRIVATE podateintrod
		STORE '' TO podateintrod
		
		gencursor('podateintrod','crs_actcv',pcselect,pcfiltru,[''],'')
		
		lcFis = 'actcv' + ALLTRIM(lcContul)
		
		IF USED(lcFis)
			USE IN &lcFis
		ENDIF
		
		IF lnFelCont = 0
			lcsel = [SELECT *, ACONT AS ASCC, nume_val as numeval, curs as cursschimb, precdeb + debit as totctva, preccred+credit as achitat, ] +;
				[precvaldeb + valdebit AS sumaval, precVALcred+VALcredit as achitatval, ] +;
				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 0000000.0000 as cursval, 0000000.0000 as cursdif ] +;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ELSE
			lcsel = [SELECT *, ACONT AS ASCD, nume_val as numeval, curs as cursschimb, preccred + credit as totctva, precdeb+debit as achitat, ] + ;
				[precvalcred + valcredit as sumaval, precVALdeb+VALdebit as achitatval, ] + ;
				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 0000000.0000 as cursval, 0000000.0000 as cursdif ] + ;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ENDIF
		&lcsel
		
		SELECT (lcFis)
		
		OPLATA=CREATEOBJECT('ocompensari')
		OPLATA.titlufrumos1.CAPTION = lcDenumire + [: ] + lcNume
		OPLATA.pcFis = lcFis
		OPLATA.suma = THISFORM.totctva
		IF TYPE('oplata.curs_val') # 'U'
			OPLATA.curs_val = 0
		ENDIF
		OPLATA.pnFelCont = lnFelCont
		OPLATA.SHOW(1)
		
		SELECT (lcFis)
		CALCULATE CNT() FOR ales TO LnBife
		IF LnBife=1
			LOCATE FOR ales
			m.compensat=nract
		ELSE
			m.compensat=0
		ENDIF
		
	ENDPROC

	PROCEDURE Container2.Item3.Text_item1.LostFocus
		*
	ENDPROC

	PROCEDURE Container2.Item3.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container2.Item3.Text_item1.When
		*
	ENDPROC

	PROCEDURE Container2.Optiongroup1.Valid
		DO CASE 
		CASE this.Value=1
			this.Parent.text_item1.Visible= .F.
			this.Parent.label_item2.Visible= .F.
			this.Parent.text_item2.Visible= .t.
			this.Parent.label_item3.Visible= .t.
			this.Parent.item1.Visible=.f.
			this.Parent.item2.Visible=.f.
			this.Parent.item3.Visible=.f.
		CASE this.Value=2
			this.Parent.text_item1.Visible= .t.
			this.Parent.label_item2.Visible= .t.
			this.Parent.text_item2.Visible= .F.
			this.Parent.label_item3.Visible= .F.
			this.Parent.item1.Visible=.f.
			this.Parent.item3.Visible=.f.
			this.Parent.item2.Visible=.t.
		CASE this.Value=3
			this.Parent.text_item1.Visible= .t.
			this.Parent.label_item2.Visible= .t.
			this.Parent.text_item2.Visible= .F.
			this.Parent.label_item3.Visible= .F.
			this.Parent.item1.Visible=.t.
			this.Parent.item3.Visible=.t.
			this.Parent.item2.Visible=.f.
		ENDCASE  
		this.Parent.Refresh 
	ENDPROC

	PROCEDURE Container2.Text_item1.Valid
		IF thisform.nrchit=0
			DO mesaj WITH 'Completati numarul documentului de plata !',''
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.AfterRowColChange
		LPARAMETERS nColIndex
		*!*	SELECT introdc
		
		*!*	IF LEFT(scd,1) = '6' OR LEFT(scc,1) = '7'
		*!*		this.column10.enabled= .t.
		*!*		this.column11.enabled= .t.
		*!*		this.column12.enabled= .t.
		*!*	ELSE 
		*!*		this.column10.enabled= .f.
		*!*		this.column11.enabled= .f.
		*!*		this.column12.enabled= .f.
		*!*	ENDIF 
			
		*!*	this.refresh 
	ENDPROC

	PROCEDURE Gridb1.Column10.Text1.Click
		locauta = thisform.do_cauta_alfa('vnom_sectii', 'sectie', 'Numele sectiei', 'Sectia')
		SELECT introdc
		REPLACE sectie WITH locauta.sectie, id_sectie WITH locauta.id_sectie
	ENDPROC

	PROCEDURE Gridb1.Column10.Text1.InteractiveChange
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column11.Text1.Click
		*!*	PRIVATE lc_variab
		*!*	LC_VARIAB=''
		*!*	Do CAUT_ALFA With 'RESPONS','NUME_2','RESPONSABIL',lc_variab
		*!*	SELECT introdc
		*!*	REPLACE nresp WITH lc_variab
		
		*!*	this.Refresh 
		
		*!*	locauta = thisform.do_cauta_alfa('Vnom_responsabili', 'nume', 'Numele responsabilului', 'Responsabil')
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Responsabili??cTipuriParteneri=>]+ALLTRIM(STR(gnIdTipResponsabili))+[??lAdaugCorespondente=>1]))
		SELECT introdc
		REPLACE nresp WITH locauta.denumire, id_responsabil WITH locauta.id_part
	ENDPROC

	PROCEDURE Gridb1.Column11.Text1.InteractiveChange
		*!*	PRIVATE lc_variab
		*!*	LC_VARIAB=''
		*!*	Do CAUT_ALFA With 'RESPONS','NUME_2','RESPONSABIL',lc_variab
		
		*!*	SELECT introdc
		*!*	REPLACE nresp WITH lc_variab
		
		*!*	this.refresh 
		
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column12.Text1.Click
		*!*	LOCAL lc_variab
		*!*	LC_VARIAB=''
		*!*	SELECT introdc
		*!*	IF !EMPTY(tcscc)
		*!*		Do CAUT_ALFA With 'chltind','DST_CHLT','DENUMIREA CHELTUIELII',lc_variab
		*!*	ELSE 
		*!*		Do CAUT_ALFA With 'venituri','DST_CHLT','DENUMIREA VENITULUI',lc_variab
		*!*	ENDIF 
		*!*	SELECT introdc 
		*!*	REPLACE DST_CHLT WITH lc_variab
		
		locauta = thisform.do_cauta_alfa('Vnom_venchel ', 'explicatie', 'Numele cheltuielii', 'Cheltuiala')
		SELECT introdc
		REPLACE dst_chlt WITH locauta.explicatie, id_venchelt WITH locauta.id_venchelt
	ENDPROC

	PROCEDURE Gridb1.Column12.Text1.InteractiveChange
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column13.Combo1.Valid
		IF INLIST(tn_idset,10460)
			thisform.calculez(.t.)
		ELSE 	
			thisform.calculez(.f.)
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column14.Text1.Click
		IF EMPTY(id_partd)
			thisform.verific_partener('scd', 'id_partd', 'partd')
		ENDIF 
		
		
	ENDPROC

	PROCEDURE Gridb1.Column14.Text1.InteractiveChange
		thisform.verific_partener('scd', 'id_partd', 'partd')
		
		
	ENDPROC

	PROCEDURE Gridb1.Column14.Text1.LostFocus
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column15.Text1.Click
		IF EMPTY(id_partc)
			thisform.verific_partener('scc', 'id_partc', 'partc')
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column15.Text1.InteractiveChange
		thisform.verific_partener('scc', 'id_partc', 'partc')
		
		
	ENDPROC

	PROCEDURE Gridb1.Column15.Text1.LostFocus
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column16.Text1.DblClick
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Gridb1.Column16.Text1.InteractiveChange
		LOCAL lcSel
		lcSel = this.Parent.Parent.RecordSource
		SELECT (lcSel)
		SCATTER NAME oint
		*thisform.verific_inregistrari(0,oint,'this.gridb1')
		DO aleg_document_pereche WITH 0,oint,lcSel IN oOperatii_comune.prg
		this.Parent.Parent.SetFocus 
	ENDPROC

	PROCEDURE Gridb1.Column2.Header1.Click
		this.Parent.Parent.headerclick(this.Parent.ColumnOrder)
	ENDPROC

	PROCEDURE Gridb1.Column2.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Gridb1.Column2.Text1.InteractiveChange
		*!*	IF scc='462 '  && AND scd = '411 ' 
		*!*		lcsalvN = m.nume
		*!*		lcSalvC = m.cod_fiscal
		*!*		
		*!*		STORE '' TO pccreditor
		
		*!*		Do CAUT_ALFA With 'creditor','nume','Numele creditorului' ,pccreditor
		*!*		IF buton = 1
		*!*			SELECT introdc
		*!*			REPLACE cimp WITH pccreditor
		*!*		ENDIF 
		*!*		SELECT introdc
		*!*		REPLACE ptva WITH 0
		*!*		
		*!*		m.nume = lcSalvN
		*!*		m.cod_fiscal = lcSalvC
		*!*		
		*!*		this.Parent.Parent.column13.Refresh 
		*!*		thisform.calculez(.f.)
		*!*	ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column3.Header1.Click
		this.Parent.Parent.headerclick(this.Parent.ColumnOrder)
	ENDPROC

	PROCEDURE Gridb1.Column3.Text1.InteractiveChange
		SELECT introdc
		REPLACE id_partd WITH 0, partd WITH ''
		
		
		
		
	ENDPROC

	PROCEDURE Gridb1.Column3.Text1.LostFocus
		*llReturn = thisform.verific_cont(introdc.scd)
		lcCont = NVL(introdc.scd,'')
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			REPLACE introdc.scd WITH ''
		ENDIF 
		SELECT introdc 
		IF EMPTY(id_partd)
			thisform.verific_partener('scd', 'id_partd', 'partd')
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column4.Header1.Click
		this.Parent.Parent.headerclick(this.Parent.ColumnOrder)
	ENDPROC

	PROCEDURE Gridb1.Column4.Text1.InteractiveChange
		SELECT introdc
		REPLACE id_partc WITH 0, partc WITH ''
		
	ENDPROC

	PROCEDURE Gridb1.Column4.Text1.LostFocus
		*llReturn = thisform.verific_cont(introdc.scc)
		lcCont = NVL(introdc.scc,'')
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			REPLACE introdc.scc WITH ''
		ENDIF 
		SELECT introdc 
		IF EMPTY(id_partc)
			thisform.verific_partener('scc', 'id_partc', 'partc')
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.InteractiveChange
		*!*	IF scc='471 '
		*!*		DO aleg_doc_plata WITH 'chavans',M.NUME,.f.,'A'
		
		*!*		OPLATA=CREATEOBJECT('AFCUMPVANZANPERALES')
		*!*		oplata.txtNume.controlsource='m.nume'
		*!*		OPLATA.SHOW(1)
		
		*!*		SELECT INTRODC
		*!*		LOCATE FOR scc='471 '
		*!*		REPLACE SUMA WITH m.suma
		*!*	ENDIF 
		
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF NKEYCODE=13   &&ENTER
			PlClick=.f.
			IF LEFT(introdc.scd,1) # '6' AND LEFT(introdc.scc,1) # '7'
				NODEFAULT 
				KEYBOARD '{DNARROW}'
			ENDIF 
		
		ENDIF
		
		
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.LostFocus
		IF !EMPTY(introdc.suma)
			IF EMPTY(introdc.id_partd)
				thisform.verific_partener('scd', 'id_partd', 'partd')
			ENDIF
			IF EMPTY(introdc.id_partc)
				thisform.verific_partener('scc', 'id_partc', 'partc')
			ENDIF
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.Valid
		
		SELECT introdc 
		IF (EMPTY(introdc.scd) OR UPPER(LEFT(introdc.scd,1))='X') AND !EMPTY(introdc.suma)
			DO mesaj WITH 'Completati contul debitor !',''
			RETURN 
		ENDIF 
		IF EMPTY(introdc.scc) OR UPPER(LEFT(introdc.scc,1))='X' AND !EMPTY(introdc.suma)
			DO mesaj WITH 'Completati contul creditor !',''
			RETURN 
		ENDIF 
		
		IF INLIST(tn_idset,10460)
			thisform.calculez(.t.)
		ELSE 	
			thisform.calculez(.f.)
		ENDIF 
		
		*	thisform.gridb1.Refresh 
		
	ENDPROC

	PROCEDURE Gridb1.Column6.Check1.Valid
		SELECT introdc
		thisform.calculez()
		
	ENDPROC

	PROCEDURE Gridb1.Column7.Text1.Click
		*thisform.aleg_ascd()
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Gridb1.Column7.Text1.LostFocus
		PARAMETERS PlClick
		SELECT introdc
		lcCont = NVL(scd,'')
		lcAcont = NVL(ascd,'')
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascd','introdc') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Gridb1.Column8.Text1.Click
		*THISFORM.ALEG_ASCC
		this.LostFocus(.t.) 
	ENDPROC

	PROCEDURE Gridb1.Column8.Text1.LostFocus
		PARAMETERS PlClick
		SELECT introdc
		lcCont = NVL(scc, '')
		lcAcont = NVL(ascc, '')
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascc','introdc') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Gridb1.Column9.Text1.DblClick
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Gridb1.Column9.Text1.InteractiveChange
		LOCAL lcSel
		lcSel = this.Parent.Parent.RecordSource
		SELECT (lcSel)
		SCATTER NAME oint
		*thisform.verific_inregistrari(1,oint,'this.gridb1')
		DO aleg_document_pereche WITH 1,oint,lcSel IN oOperatii_comune.prg
		
		this.Parent.Parent.SetFocus 
	ENDPROC

	PROCEDURE Gridb1.gasestecol
		Parameters ii
		*
	ENDPROC

	PROCEDURE Gridb1.headerclick
		PARAMETERS co
		*
	ENDPROC

	PROCEDURE Gridb1.iesire
		PARAMETERS Y
		*
	ENDPROC

	PROCEDURE Gridb1.Init
		*
	ENDPROC

	PROCEDURE Gridb1.treaba
		*
	ENDPROC

	PROCEDURE Item1.Text_item1.GotFocus
		*
	ENDPROC

	PROCEDURE Item1.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Item1.Text_item1.LostFocus
		SELECT introdc
		LOCATE 
		thisform.calculez(.f.)
	ENDPROC

	PROCEDURE Item1.Text_item1.Valid
		THIS.FORECOLOR=IIF(thisform.totftva>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Item1.Text_item1.When
		*
	ENDPROC

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

	PROCEDURE Terminat1.Command1.Click
		
		IF thisform.verificare()
			DODEFAULT()
		ENDIF 
		
	ENDPROC

	PROCEDURE Verif1.COMMAND1.Click
		IF thisform.verificare()
			DO FORM VERIFICARE WITH .t.,.t.
			IF BUTON=1
				THISFORM.Release 
			ENDIF 
		ENDIF 
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_introd_compact2007 AS formtermin OF "..\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="shpAchitat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_SHAPE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container1.Item2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Container1.Item3" UniqueID="" Timestamp="" />
	*< 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.Check1" 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.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column13.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column16.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column16.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column18.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column18.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column19.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column19.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column20.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column20.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column21.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column21.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column22.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column22.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column22._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column23.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column23.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column23._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column24.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column24.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column25.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column25.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column26.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridb1.Column26.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Item1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Verif1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="CMD_EXECUTA1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optAchitat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNr" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblDataScadenta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="itmDocJustificat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSeria" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblNr" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblSumaAchitata" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSumaAchitata" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblSeria" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDataScadenta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="itmCasaPlati" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="itmAchizitor" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="itmCreditorDivers" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="itmFdocAchitat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cbo_plata_saft" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_plata_saft" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_plata_saft
		*m: calculez
		*m: do_adauga
		*m: do_cauta_alfa
		*m: do_cauta_partener
		*m: do_executa
		*m: la_iesire
		*m: nidfdocachitat_assign
		*m: refreshachitat
		*m: updateexplicatiesaft
		*m: updatepaymentsaft
		*m: verificare
		*m: verific_analitic
		*m: verific_cont
		*m: verific_inregistrari
		*m: verific_partener
		*p: achi
		*p: casa
		*p: cfdocachitat
		*p: cpaymentcode
		*p: cscc
		*p: cscd
		*p: datascad
		*p: id_achi
		*p: id_casa
		*p: id_part462
		*p: lverificaacont
		*p: nidfdocachitat
		*p: nrchit
		*p: part462
		*p: pcexceptii_scc
		*p: pcexceptii_scd
		*p: pcobj
		*p: seriechit
		*p: sumaachitata
		*p: totctva
		*p: totftva
		*p: tva
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		achi = ''
		BorderStyle = 3
		Caption = ""
		casa = ''
		cfdocachitat = 
		cpaymentcode = 
		cscc = 
		cscd = 
		datascad = 
		DataSession = 1
		DoCreate = .T.
		Height = 490
		id_achi = 0
		id_casa = 0
		id_part462 = 0
		KeyPreview = .T.
		Name = "frm_introd_compact2007"
		nidfdocachitat = 0
		nrchit = 0
		part462 = 
		pcobj = ''
		ScrollBars = 0
		seriechit = 
		sumaachitata = 0
		totctva = 0
		totftva = 0
		tva = 0
		Width = 801
		_memberdata = <VFPData>
			<memberdata name="refreshachitat" display="RefreshAchitat"/>
			<memberdata name="cfdocachitat" display="cFdocAchitat"/>
			<memberdata name="nidfdocachitat" display="nIdFdocAchitat"/>
			<memberdata name="updateexplicatiesaft" display="UpdateExplicatieSAFT"/>
			<memberdata name="updatepaymentsaft" display="UpdatePaymentSAFT"/>
			<memberdata name="cpaymentcode" display="cPaymentCode"/>
			<memberdata name="cfdocachitat_assign" display="cFdocAchitat_Assign"/>
			<memberdata name="nidfdocachitat_assign" display="nIdFdocAchitat_Assign"/>
		</VFPData>
		Shape1.Anchor = 10
		Shape1.Height = 36
		Shape1.Left = 0
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 800
		Shape1.ZOrderSet = 1
		Terminat1.Anchor = 8
		Terminat1.Command1.Name = "Command1"
		Terminat1.Imbuton1.Height = 27
		Terminat1.Imbuton1.Name = "Imbuton1"
		Terminat1.Imbuton1.Width = 30
		Terminat1.Left = 679
		Terminat1.Name = "Terminat1"
		Terminat1.TabIndex = 18
		Terminat1.Top = 3
		Terminat1.Visible = .F.
		Terminat1.ZOrderSet = 3
		Titlufrumos1.AutoSize = .T.
		Titlufrumos1.Height = 20
		Titlufrumos1.Left = 7
		Titlufrumos1.Name = "Titlufrumos1"
		Titlufrumos1.TabIndex = 21
		Titlufrumos1.Top = 4
		Titlufrumos1.Width = 104
		Titlufrumos1.WordWrap = .F.
		Titlufrumos1.ZOrderSet = 5
	*</PropValue>

	ADD OBJECT '_SHAPE1' AS _shape WITH ;
		Anchor = 8, ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Height = 36, ;
		Left = 723, ;
		Name = "_SHAPE1", ;
		Top = 0, ;
		Width = 78, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 643, ;
		Name = "But_nou1", ;
		TabIndex = 14, ;
		Top = 4, ;
		Visible = .T., ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cbo_plata_saft' AS combobox WITH ;
		Anchor = 12, ;
		BorderColor = 128,128,128, ;
		BorderStyle = 1, ;
		ColumnCount = 1, ;
		ColumnLines = .F., ;
		ControlSource = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 20, ;
		InputMask = "", ;
		Left = 565, ;
		Name = "cbo_plata_saft", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		TabIndex = 27, ;
		TabStop = .F., ;
		Top = 425, ;
		Visible = .F., ;
		Width = 138
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'CMD_EXECUTA1' AS cmd_executa WITH ;
		Anchor = 12, ;
		Caption = "\<Recalculeazã sume note", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Height = 27, ;
		Left = 156, ;
		Name = "CMD_EXECUTA1", ;
		TabIndex = 23, ;
		Top = 341, ;
		Visible = .F., ;
		Width = 168, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Container1' AS container WITH ;
		Anchor = 12, ;
		BackColor = 247,245,238, ;
		BorderColor = 247,245,238, ;
		Height = 50, ;
		Left = 7, ;
		Name = "Container1", ;
		TabIndex = 2, ;
		Top = 321, ;
		Width = 787, ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'Container1.Item2' AS item WITH ;
		Comment = "m.tva", ;
		Left = 328, ;
		Name = "Item2", ;
		TabIndex = 1, ;
		Top = 1, ;
		ZOrderSet = 7, ;
		Label_item1.Caption = "TVA", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.tva", ;
		Text_item1.InputMask = (get_mask(12,gnPa)), ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.SpecialEffect = 1, ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Container1.Item3' AS item WITH ;
		Comment = "m.tva", ;
		Left = 328, ;
		Name = "Item3", ;
		TabIndex = 2, ;
		Top = 24, ;
		ZOrderSet = 7, ;
		Label_item1.Caption = "Total cu TVA", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.totctva", ;
		Text_item1.InputMask = (get_mask(12,gnPa)), ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.SpecialEffect = 1, ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Gridb1' AS gridb WITH ;
		Anchor = 15, ;
		BackColor = 244,250,255, ;
		ColumnCount = 26, ;
		FontSize = 10, ;
		GridLineColor = 192,192,192, ;
		Height = 254, ;
		Left = 3, ;
		listaord = 1,3,4, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		RecordSource = "INTRODC", ;
		RowHeight = 19, ;
		TabIndex = 16, ;
		TabStop = .F., ;
		ToolTipText = 'Click dreapta pe "Suma" pentru calculare baza din Valoarea cu TVA', ;
		Top = 37, ;
		Width = 795, ;
		ZOrderSet = 6, ;
		Column1.BackColor = 244,250,255, ;
		Column1.ControlSource = "ordine", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Header1.Alignment = 2, ;
		Column1.Header1.BackColor = 212,208,200, ;
		Column1.Header1.Caption = "Nr.crt", ;
		Column1.Header1.FontName = "Arial", ;
		Column1.Header1.FontSize = 10, ;
		Column1.Header1.Name = "Header1", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .F., ;
		Column1.Text1.BackColor = 244,250,255, ;
		Column1.Text1.FontName = "Arial", ;
		Column1.Text1.FontSize = 10, ;
		Column1.Text1.Name = "Text1", ;
		Column1.Text1.ReadOnly = .F., ;
		Column1.Width = 28, ;
		Column2.BackColor = 244,250,255, ;
		Column2.ControlSource = "explicatie", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 98, ;
		Column3.Alignment = 1, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "scd", ;
		Column3.DynamicForeColor = "rgb(0,0,128)", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.Width = 58, ;
		Column4.Alignment = 1, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "scc", ;
		Column4.DynamicForeColor = "rgb(0,0,128)", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.Width = 62, ;
		Column5.BackColor = 244,250,255, ;
		Column5.ColumnOrder = 9, ;
		Column5.ControlSource = "suma", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "", ;
		Column5.InputMask = (get_mask(12,gnPa)), ;
		Column5.Name = "Column5", ;
		Column5.Width = 84, ;
		Column6.BackColor = 244,250,255, ;
		Column6.ColumnOrder = 16, ;
		Column6.ControlSource = "cu_tva", ;
		Column6.CurrentControl = "Check1", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.Sparse = .F., ;
		Column6.Visible = .T., ;
		Column6.Width = 44, ;
		Column7.BackColor = 244,250,255, ;
		Column7.ColumnOrder = 6, ;
		Column7.ControlSource = "ascd", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.Width = 37, ;
		Column8.BackColor = 244,250,255, ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "ascc", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.Width = 37, ;
		Column9.BackColor = 244,250,255, ;
		Column9.ColumnOrder = 12, ;
		Column9.ControlSource = "sectie", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column10", ;
		Column9.Width = 54, ;
		Column10.BackColor = 244,250,255, ;
		Column10.ColumnOrder = 10, ;
		Column10.ControlSource = "nresp", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column11", ;
		Column10.Width = 75, ;
		Column11.BackColor = 244,250,255, ;
		Column11.ColumnOrder = 11, ;
		Column11.ControlSource = "dst_chlt", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column12", ;
		Column11.Width = 83, ;
		Column12.BackColor = 244,250,255, ;
		Column12.ColumnOrder = 15, ;
		Column12.ControlSource = "denumiretax", ;
		Column12.CurrentControl = "Combo1", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column13", ;
		Column12.Sparse = .F., ;
		Column12.Width = 199, ;
		Column13.BackColor = 244,250,255, ;
		Column13.ColumnOrder = 3, ;
		Column13.ControlSource = "partd", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "Column14", ;
		Column13.Width = 69, ;
		Column14.BackColor = 244,250,255, ;
		Column14.ColumnOrder = 4, ;
		Column14.ControlSource = "partc", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "Column15", ;
		Column14.Width = 65, ;
		Column15.BackColor = 244,250,255, ;
		Column15.ColumnOrder = 19, ;
		Column15.ControlSource = "pereched", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "Column9", ;
		Column15.Width = 90, ;
		Column16.BackColor = 244,250,255, ;
		Column16.ColumnOrder = 20, ;
		Column16.ControlSource = "perechec", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "Column16", ;
		Column16.Width = 90, ;
		Column17.BackColor = 244,250,255, ;
		Column17.ColumnOrder = 14, ;
		Column17.ControlSource = "ptva", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.InputMask = "99.99", ;
		Column17.Name = "Column17", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 36, ;
		Column18.BackColor = 244,250,255, ;
		Column18.ColumnOrder = 21, ;
		Column18.ControlSource = "nume_val", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "Column18", ;
		Column18.Width = 75, ;
		Column19.BackColor = 244,250,255, ;
		Column19.ColumnOrder = 22, ;
		Column19.ControlSource = "curs", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.InputMask = (get_mask(12,gnPCurs)), ;
		Column19.Name = "Column19", ;
		Column19.Width = 63, ;
		Column20.BackColor = 244,250,255, ;
		Column20.ColumnOrder = 23, ;
		Column20.ControlSource = "suma_val", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.InputMask = (get_mask(12,gnPVal)), ;
		Column20.Name = "Column20", ;
		Column20.Width = 93, ;
		Column21.BackColor = 244,250,255, ;
		Column21.ColumnOrder = 13, ;
		Column21.ControlSource = "nrord", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "Column21", ;
		Column22.BackColor = 244,250,255, ;
		Column22.Bound = .F., ;
		Column22.ColumnOrder = 17, ;
		Column22.ControlSource = "Iif(Seek(introdc.taxcode,'saft_taxtable','taxcode'),saft_taxtable.taxname,'')", ;
		Column22.CurrentControl = "_combobox1", ;
		Column22.FontSize = 10, ;
		Column22.Name = "Column22", ;
		Column22.Sparse = .F., ;
		Column22.Width = 196, ;
		Column23.BackColor = 244,250,255, ;
		Column23.ColumnOrder = 18, ;
		Column23.ControlSource = "Iif(Seek(introdc.paymentcode,'saft_mecanisme_plati','mcode'),saft_mecanisme_plati.paymentname,'')", ;
		Column23.CurrentControl = "_combobox1", ;
		Column23.FontCharSet = 238, ;
		Column23.FontSize = 10, ;
		Column23.Name = "Column23", ;
		Column23.Sparse = .F., ;
		Column23.Width = 93, ;
		Column24.BackColor = 244,250,255, ;
		Column24.ColumnOrder = 24, ;
		Column24.ControlSource = "explicatia", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "Column24", ;
		Column24.ReadOnly = .F., ;
		Column24.Width = 120, ;
		Column25.BackColor = 244,250,255, ;
		Column25.ColumnOrder = 25, ;
		Column25.ControlSource = "explicatia4", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "Column25", ;
		Column25.ReadOnly = .F., ;
		Column25.Width = 120, ;
		Column26.BackColor = 244,250,255, ;
		Column26.ColumnOrder = 26, ;
		Column26.ControlSource = "explicatia5", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "Column26", ;
		Column26.ReadOnly = .F., ;
		Column26.Width = 120
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

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

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

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

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

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

	ADD OBJECT 'Gridb1.Column13.Combo1' AS combobox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		BoundColumn = 1, ;
		BoundTo = .T., ;
		ColumnCount = 1, ;
		ColumnLines = .F., ;
		ColumnWidths = "250,0,0", ;
		Comment = "", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 10, ;
		Left = 21, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "crsjtva.denumiretax,id_jtva_coloana", ;
		RowSourceType = 2, ;
		Style = 2, ;
		Top = 23, ;
		Visible = .T., ;
		Width = 10
		*< END OBJECT: BaseClass="combobox" />

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

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

	ADD OBJECT 'Gridb1.Column14.Text1' AS textbox WITH ;
		Alignment = 3, ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'Gridb1.Column16.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 'Gridb1.Column17.Header1' AS header WITH ;
		Caption = "TVA%", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'Gridb1.Column18.Text1' AS textbox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

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

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

	ADD OBJECT 'Gridb1.Column22._combobox1' AS _combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 4, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "450,150,40", ;
		ControlSource = "introdc.taxcode", ;
		Left = 41, ;
		Name = "_combobox1", ;
		RowSource = "select taxname, tip, CAST(procent_taxa as N(6,2) null) as procent_taxa, taxcode from saft_taxtable order by tva, tva_livrari, tva_achizitii, wht, taxcode into cursor crsTaxTableX", ;
		RowSourceType = 3, ;
		Top = 46
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Gridb1.Column22.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Taxa SAFT", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.Column22.Text1' AS textbox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridb1.Column23._combobox1' AS _combobox WITH ;
		BorderStyle = 0, ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,150", ;
		ControlSource = "introdc.paymentcode", ;
		Left = 32, ;
		Name = "_combobox1", ;
		ReadOnly = .F., ;
		RowSource = "select paymentname, methodname, mechanismcode from saft_mecanisme_plati where afisat = 1 order by ordine into cursor crsPaymentX", ;
		RowSourceType = 3, ;
		Top = 70
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Gridb1.Column23.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod plata SAFT", ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Gridb1.Column23.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 238, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'Gridb1.Column24.Text1' AS textbox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'Gridb1.Column25.Text1' AS textbox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'Gridb1.Column26.Text1' AS textbox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

	ADD OBJECT 'Gridb1.Column6.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		BackColor = 244,250,255, ;
		Caption = "", ;
		Centered = .T., ;
		ControlSource = "cu_tva", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 24, ;
		Name = "Check1", ;
		TabStop = .F., ;
		Top = 32, ;
		Visible = .T., ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

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

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

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

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

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

	ADD OBJECT 'Item1' AS item WITH ;
		Anchor = 12, ;
		BackColor = 192,192,192, ;
		BackStyle = 0, ;
		Height = 21, ;
		Left = 7, ;
		Name = "Item1", ;
		TabIndex = 1, ;
		Top = 299, ;
		Width = 787, ;
		ZOrderSet = 8, ;
		Label_item1.Caption = "Total sumã", ;
		Label_item1.Left = 331, ;
		Label_item1.Name = "Label_item1", ;
		Label_item1.Top = 2, ;
		Text_item1.ControlSource = "thisform.totftva", ;
		Text_item1.DisabledBackColor = 255,255,255, ;
		Text_item1.InputMask = (get_mask(12,gnPa)), ;
		Text_item1.Left = 569, ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Text_item1.SpecialEffect = 1, ;
		Text_item1.Top = 2, ;
		Text_item1.Visible = .T., ;
		Lineo1.Left = 328, ;
		Lineo1.Name = "Lineo1", ;
		Lineo1.Top = 0, ;
		Lineo3.Left = 330, ;
		Lineo3.Name = "Lineo3", ;
		Lineo3.Top = 19, ;
		Lineo4.Left = 779, ;
		Lineo4.Name = "Lineo4", ;
		Lineo4.Top = 0, ;
		Lineo5.Left = 328, ;
		Lineo5.Name = "Lineo5", ;
		Lineo5.Top = 0, ;
		Lineo2.Left = 567, ;
		Lineo2.Name = "Lineo2", ;
		Lineo2.Top = 0
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'itmAchizitor' AS item WITH ;
		Anchor = 12, ;
		Left = 249, ;
		Name = "itmAchizitor", ;
		TabIndex = 9, ;
		Top = 404, ;
		Visible = .F., ;
		ZOrderSet = 26, ;
		Label_item1.Caption = "Numele achizitorului", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.achi", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'itmCasaPlati' AS item WITH ;
		Anchor = 12, ;
		Left = 249, ;
		Name = "itmCasaPlati", ;
		TabIndex = 8, ;
		Top = 404, ;
		Visible = .F., ;
		ZOrderSet = 25, ;
		Label_item1.Caption = "Casa plãþi", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.casa", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'itmCreditorDivers' AS item WITH ;
		Anchor = 12, ;
		Left = 249, ;
		Name = "itmCreditorDivers", ;
		TabIndex = 9, ;
		Top = 404, ;
		Visible = .F., ;
		ZOrderSet = 26, ;
		Label_item1.Caption = "Numele creditorului", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "thisform.part462", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'itmDocJustificat' AS item WITH ;
		Anchor = 12, ;
		Left = 249, ;
		Name = "itmDocJustificat", ;
		TabIndex = 11, ;
		Top = 445, ;
		Visible = .F., ;
		ZOrderSet = 18, ;
		Label_item1.Caption = "Nr. doc. justificat", ;
		Label_item1.Name = "Label_item1", ;
		Text_item1.ControlSource = "m.compensat", ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Name = "Lineo3", ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'itmFdocAchitat' AS item WITH ;
		Anchor = 12, ;
		Height = 21, ;
		Left = 249, ;
		Name = "itmFdocAchitat", ;
		TabIndex = 5, ;
		Top = 382, ;
		Visible = .F., ;
		Width = 217, ;
		ZOrderSet = 26, ;
		Label_item1.AutoSize = .T., ;
		Label_item1.Caption = "Fel document", ;
		Label_item1.Name = "Label_item1", ;
		Label_item1.TabIndex = 2, ;
		Text_item1.ControlSource = "Thisform.cFdocAchitat", ;
		Text_item1.Height = 18, ;
		Text_item1.Left = 96, ;
		Text_item1.Name = "Text_item1", ;
		Text_item1.ReadOnly = .T., ;
		Text_item1.TabIndex = 1, ;
		Text_item1.Top = 2, ;
		Text_item1.Width = 119, ;
		Lineo1.Name = "Lineo1", ;
		Lineo3.Height = 0, ;
		Lineo3.Left = 0, ;
		Lineo3.Name = "Lineo3", ;
		Lineo3.Top = 19, ;
		Lineo3.Width = 446, ;
		Lineo4.Name = "Lineo4", ;
		Lineo5.Name = "Lineo5", ;
		Lineo2.Name = "Lineo2"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'lb_plata_saft' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cod plata", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,128, ;
		Height = 18, ;
		Left = 499, ;
		Name = "lb_plata_saft", ;
		TabIndex = 25, ;
		Top = 427, ;
		Visible = .F., ;
		Width = 57
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Lb_shortcuts1' AS lb_shortcuts WITH ;
		Caption = "CTRL+F = Verificare; ESC = Renunþare; ALT+N = Neachitat; ALT+C = Achitat din CASÃ; ALT+5  = Achitat din 542", ;
		Left = 7, ;
		Name = "Lb_shortcuts1", ;
		TabIndex = 22, ;
		Top = 23, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'lblDataScadenta' AS label_item WITH ;
		Anchor = 12, ;
		Caption = "Data scadentã", ;
		FontCharSet = 238, ;
		FontItalic = .F., ;
		FontName = "Arial", ;
		Left = 14, ;
		Name = "lblDataScadenta", ;
		TabIndex = 15, ;
		Top = 386, ;
		Visible = .T., ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblNr' AS label_item WITH ;
		Anchor = 12, ;
		Caption = "Nr.", ;
		FontCharSet = 238, ;
		Left = 569, ;
		Name = "lblNr", ;
		TabIndex = 20, ;
		Top = 386, ;
		Visible = .F., ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblSeria' AS label_item WITH ;
		Anchor = 12, ;
		Caption = "Seria", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Left = 473, ;
		Name = "lblSeria", ;
		TabIndex = 19, ;
		Top = 386, ;
		Visible = .F., ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblSumaAchitata' AS label_item WITH ;
		Anchor = 12, ;
		Caption = "Suma achitatã", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Left = 251, ;
		Name = "lblSumaAchitata", ;
		TabIndex = 17, ;
		Top = 427, ;
		Visible = .F., ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="label" />

	ADD OBJECT 'optAchitat' AS optiongroup WITH ;
		Anchor = 12, ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		BorderColor = 247,245,238, ;
		BorderStyle = 0, ;
		ButtonCount = 4, ;
		Height = 79, ;
		Left = 4, ;
		Name = "optAchitat", ;
		TabIndex = 4, ;
		Top = 402, ;
		Value = 1, ;
		Width = 185, ;
		ZOrderSet = 14, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "\<Neachitat (ALT+N)", ;
		Option1.FontCharSet = 238, ;
		Option1.FontName = "Arial", ;
		Option1.FontSize = 10, ;
		Option1.ForeColor = 0,0,128, ;
		Option1.Height = 18, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.TabIndex = 1, ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 126, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Achitat din \<casã (ALT+C)", ;
		Option2.FontCharSet = 238, ;
		Option2.FontName = "Arial", ;
		Option2.FontSize = 10, ;
		Option2.ForeColor = 0,0,128, ;
		Option2.Height = 18, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.TabIndex = 2, ;
		Option2.TabStop = .F., ;
		Option2.Top = 24, ;
		Option2.Value = 0, ;
		Option2.Width = 165, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Achitat din \<542 (ALT+5)", ;
		Option3.FontCharSet = 238, ;
		Option3.FontName = "Arial", ;
		Option3.FontSize = 10, ;
		Option3.ForeColor = 0,0,128, ;
		Option3.Height = 18, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.TabIndex = 3, ;
		Option3.TabStop = .F., ;
		Option3.Top = 43, ;
		Option3.Value = 0, ;
		Option3.Width = 156, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "Achitat din \<462 (ALT+4)", ;
		Option4.FontCharSet = 238, ;
		Option4.FontSize = 10, ;
		Option4.ForeColor = 0,0,128, ;
		Option4.Height = 18, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Top = 63, ;
		Option4.Value = 0, ;
		Option4.Width = 156
		*< END OBJECT: BaseClass="optiongroup" />

	ADD OBJECT 'Renunt1' AS renunt WITH ;
		Anchor = 8, ;
		Left = 730, ;
		Name = "Renunt1", ;
		TabIndex = 13, ;
		ToolTipText = "Renuntare (ESC)", ;
		Top = 3, ;
		ZOrderSet = 7, ;
		Imbuton1.Height = 27, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Stretch = 2, ;
		Imbuton1.Width = 30, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'shpAchitat' AS _shape WITH ;
		Anchor = 12, ;
		BackColor = 218,218,218, ;
		BackStyle = 1, ;
		Height = 110, ;
		Left = 5, ;
		Name = "shpAchitat", ;
		Top = 380, ;
		Width = 792, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'txtDataScadenta' AS text_item WITH ;
		Anchor = 12, ;
		BorderColor = 192,192,192, ;
		BorderStyle = 1, ;
		ControlSource = "thisform.datascad", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Height = 20, ;
		Left = 112, ;
		Name = "txtDataScadenta", ;
		TabIndex = 3, ;
		Top = 384, ;
		Visible = .T., ;
		Width = 100, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtNr' AS text_item WITH ;
		Anchor = 12, ;
		BorderColor = 192,192,192, ;
		BorderStyle = 1, ;
		ControlSource = "thisform.nrchit", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Height = 20, ;
		Left = 591, ;
		Name = "txtNr", ;
		TabIndex = 7, ;
		Top = 384, ;
		Visible = .F., ;
		Width = 111, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtSeria' AS text_item WITH ;
		Anchor = 12, ;
		BorderColor = 192,192,192, ;
		BorderStyle = 1, ;
		ControlSource = "thisform.seriechit", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Format = "!K", ;
		Height = 20, ;
		Left = 513, ;
		Name = "txtSeria", ;
		TabIndex = 6, ;
		TabStop = .T., ;
		Top = 384, ;
		Visible = .F., ;
		Width = 51, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtSumaAchitata' AS text_item WITH ;
		Anchor = 12, ;
		BorderColor = 192,192,192, ;
		BorderStyle = 1, ;
		ControlSource = "thisform.sumaachitata", ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Format = "RK", ;
		Height = 20, ;
		InputMask = (get_mask(12,gnPa)), ;
		Left = 367, ;
		Name = "txtSumaAchitata", ;
		TabIndex = 10, ;
		Top = 425, ;
		Visible = .F., ;
		Width = 122, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Verif1' AS verif WITH ;
		Anchor = 8, ;
		Left = 766, ;
		Name = "Verif1", ;
		TabIndex = 12, ;
		ToolTipText = "Verificare (CTRL+L)", ;
		Top = 3, ;
		ZOrderSet = 10, ;
		IMBUTON1.Height = 26, ;
		IMBUTON1.Name = "IMBUTON1", ;
		IMBUTON1.Width = 26, ;
		COMMAND1.Name = "COMMAND1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_plata_saft
		* Nu actualizez paymentcode dupa fel document, daca deja apelez aceasta procedura la schimbarea documentului
		* Nu actualizez daca nu este optiunea D406 activa si nu este set plata
		Local llVisible
		If !m.gl406
			Return
		Endif
		llVisible = This.cbo_plATA_SAFT.Visible
		
		With This
		* Cod mecanism plata SAFT
			If !Used('saft_mecanisme_plati')
				update_saft_mecanisme_plati()
			Endif
		
			If Empty(.cbo_plATA_SAFT.RowSource)
				.cbo_plATA_SAFT.RowSourceType = 3 && sql
				.cbo_plATA_SAFT.RowSource = [Select paymentname, methodname, mechanismcode From saft_mecanisme_plati where afisat=1 Order By ordine Into Cursor crsMecanismePlatiX]
				.cbo_plATA_SAFT.ControlSource = [Thisform.cPaymentCode]
				.cbo_plATA_SAFT.BoundColumn = 3
				.cbo_plATA_SAFT.BoundTo = .T.
				.cbo_plATA_SAFT.ColumnCount = 2
				.cbo_plATA_SAFT.ColumnWidths = "250,150"
			Endif
			.cbo_plata_saft.visible = m.llVisible && se pune Visible = .T. cand se face BoundTo = .T.
		ENDWITH
		This.UpdatePaymentSAFT()
		
	ENDPROC

	PROCEDURE calculez
		PARAMETERS calc_baza
		LOCAL lni
		SELECT introdc 
		lni=RECNO()
		
		lcExcScd = ALLTRIM(this.pcexceptii_scd)
		lcExcSCC = ALLTRIM(this.pcexceptii_scc)
		
		lcExcScd = strtran(lcExcScd, 'X', '0', 1,100,1)
		lcExcScc = strtran(lcExcScc, 'X', '0', 1,100,1)
		
		IF !EMPTY(tcscc)
			SUM suma TO lnBaza FOR !INLIST(VAL(scc), &lcExcscc)
			SUM suma TO lnBazaDiscount FOR INLIST(VAL(scc), &lcExcscc)
		ELSE 
			SUM suma TO lnBaza FOR !INLIST(VAL(scd), &lcExcscd)
			SUM suma TO lnBazaDiscount FOR INLIST(VAL(scd), &lcExcscd)
		ENDIF 
		
		this.totftva = lnBaza - lnBazaDiscount
		IF !calc_baza
			IF !EMPTY(tcscc)
				SUM suma*ptva TO lnTva FOR cu_tva = 1 AND !INLIST(VAL(scc), &lcExcscc)
				SUM suma*ptva TO lnTvaDiscount FOR cu_tva = 1 AND INLIST(VAL(scc), &lcExcscc)
			ELSE 
				SUM suma*ptva TO lnTva FOR cu_tva = 1 AND !INLIST(VAL(scd), &lcExcscd)
				SUM suma*ptva TO lnTvaDiscount FOR cu_tva = 1 AND INLIST(VAL(scd), &lcExcscd)
			ENDIF 	 
			this.tva = ROUND(lnTva/100,gnPC) - ROUND(lnTvaDiscount/100,gnPC)
		ENDIF 
		this.totctva = this.totftva + this.tva 
		
		* Import din eFactura, transmit tnTotcTVA
		IF TYPE('tnTotcTVA') = 'N'
			thisform.totctva = m.tnTotcTVA
			this.tva = Thisform.totctva-Thisform.totftva
		ENDIF 	
		
		this.SumaAchitata = this.totctva 
		this.txtSumaAchitata.Refresh()
		
		this.item1.text_item1.Refresh 
		this.container1.item2.text_item1.refresh 
		this.container1.item3.text_item1.refresh 
		
		SELECT introdc 
		*!*	modificare	v 2.2.23
		*!*	IF lni=1
		*!*		GOTO TOP 
		*!*	ELSE 
		*!*		GOTO lni 
		*!*	ENDIF 
		GOTO MIN(lni,RECCOUNT('introdc'))
		*!*	modificare	v 2.2.23	^
	ENDPROC

	PROCEDURE do_adauga
		*!*	modificare	v 2.2.23
		Local lnRec, loRec
		Select introdc
		lnRec = Reccount('introdc')
		
		If Inlist(tn_idset, 10609, 10647) && limitare drept deducere 50%, 100%
			Thisform.cmd_executa1.Visible = .F.
			Select * From introdc Into Cursor introdctmp
		
			Append From Dbf('introdctmp')
			Use In (Select('introdctmp'))
		Else
			Select introdc
			Scatter Name loRec Memo
			Append Blank
			Gather Name loRec Memo
		Endif
		*!*	modificare	v 2.2.23	^
		Select introdc
		Replace ordine With Recno() All
		Go lnRec + 1
		
		This.gridb1.SetFocus()
		 
	ENDPROC

	PROCEDURE do_cauta_alfa
		PARAMETERS tcFis, tcColoane, tcTitlu, tcTitluColoane
		
		pcselect = [select * from ] + tcFis
		pcfiltru = [1=2]
		pcschema = []
		pcorder = ''
		pccoloane = tcColoane
		pcTitlu = tcTitlu 
		pcTitluColoane = tcTitluColoane
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,tcFis) && 11.07.2007
		
		RETURN locauta
	ENDPROC

	PROCEDURE do_cauta_partener
		PARAMETERS tcCont, lcCampId, lcCampNume
		
		lcCont = ALLTRIM(tcCont)
		loHash = GetHash([cTitlu=>Nume partener ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont + [??lVerificaANAF=>1])
		loHash.SetValue('dDataDoc', Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
		loCauta = CautPartenerContabilitate(loHash)
		
		If !Empty(locauta.nume)
			lnid_part=locauta.id_part
			lcnume=Alltrim(locauta.nume)
		Else
			lnId_part = 0
			lcNume = ''
		ENDIF
		
		SELECT introdc
		REPLACE &lcCampId WITH lnid_part, &lcCampNume WITH lcNume
		
		This.UpdateExplicatieSAFT() && actualizez explicatia SAFT pentru furnizor TVAI
	ENDPROC

	PROCEDURE do_executa
		Select introdc
		Replace suma With Round((Thisform.container1.item3.text_item1.Value/RECCOUNT('introdc'))/(1+ptva/100),gnPc) All
		Sum suma To Thisform.totftva
		Thisform.tva = Thisform.totctva - Thisform.totftva
		
		Thisform.item1.text_item1.Refresh()
		Thisform.container1.item2.text_item1.Refresh()
		Select introdc
		Go Top
		Thisform.gridb1.column3.text1.SetFocus()
	ENDPROC

	PROCEDURE Init
		IF !EMPTY(tcSCD)
			this.optAchitat.option2.Caption = "în \<casã (ALT+C)"
			this.optAchitat.option3.Visible = .F. && 542
			this.optAchitat.option4.Visible = .F. && 462	
			this.itmCasaPlati.label_item1.Caption = "Casa încasãri"
		ENDIF 	
		
		
		
		THIS.GRIdextra1.setup()
		DODEFAULT()
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*!*	IF nKeyCode=10 && ENTER
		*!*		NODEFAULT 
		*!*		this.container1.item2.SetFocus 
		*!*	ELSE 
			DODEFAULT(nKeyCode, nShiftAltCtrl)	
		*!*	ENDIF 
	ENDPROC

	PROCEDURE la_iesire
		*!* 28.02.2012
		*!* marius.mutu
		*!* se completeaza suma in valuta aferenta liniilor de tva
		
		*!* 26.03.2014
		*!* marius.mutu
		*!* se poate achita partial factura de achizitie / livrare (ex. monetar incasat partial numerar, partial card bancar)
		*!* se calculeaza procentual si suma TVA incasare
		
		*!* 13.10.2014
		*!* marius.mutu
		*!* se modifica nota 4426 = 401 in 4426 = 4427 pentru achizitii taxare inversa, CE
		
		*!* 16.12.2015
		*!* marius.mutu
		*!* se modifica nota 4426 = 401 in 4426 = 4427 pentru achizitii taxare inversa, CE 20%
		
		*!* 04.02.2016
		*!* marius.mutu
		*!* completare analitice pe baza de grupuri utilizatori si pe baza de explicatii TVA
		
		*!* 25.01.2017
		*!* marius.mutu
		*!* se modifica nota 4426 = 401 in 4426 = 4427 pentru achizitii servicii CE 19%
		
		*!*	08.01.2026
		*!*	robert
		*!*	se modifica nota 4426 = 401 in 4426 = 4427 pentru achizitii servicii NON-CE 21%, 11% id_jtva_coloana = 225, 231
		*!* am inlocuit id-urile hardcodate cu selectii din jtva_coloane
		
		*!* 28.04.2022
		*!* Completare taxcode SAFT pentru nota limitare deducere TVA
		Local lcAcont, lcContScc, lcExcSCC, lcExcScd, lcObj, lnCoeficientAchitat, lnIdFact, lnIdSet, lnNract
		Local lnProcentNedeductibil, lnSAct, lnSuma542, lnSumaAchitataTotal, lnSumaAct, lnr, lnsuma
		Local loLinieIncasare, loLinieTva
		Local lnIdJTVALim, lnIdJtvaLim100, lnIdJtvaLim50
		Local llFzRTVAI, llN50, llN100
		*:Global LnSumDisc, ocomp, ointr, r
		
		lcObj = Alltrim(This.pcobj)
		lcExcScd = Alltrim(This.pcexceptii_scd)
		lcExcSCC = Alltrim(This.pcexceptii_scc)
		
		lcExcScd = Strtran(lcExcScd, 'X', '0', 1, 100, 1)
		lcExcSCC = Strtran(lcExcSCC, 'X', '0', 1, 100, 1)
		
		Select actactan
		Zap
		
		Select introdc
		Scan For !Empty(suma)
			Scatter Name ointr
			ointr.id_jtva_coloana = Iif(ointr.cu_tva = 1, ointr.id_jtva_coloana, Null)
			If tl_calcTva && doar la introduceri care au legatura cu registrele de TVA
				With &lcObj
					If ointr.cu_tva = 1
						.proc_tva = (100 + ointr.ptva) / 100
					Else
						.proc_tva = 0
					Endif
				Endwith
			Endif
			Select actactan
			Append Blank
			If Flock()
				Gather Name &lcObj
				Gather Name ointr
			Endif
			Unlock
			Select introdc
		Endscan
		
		* Adaugare linii TVA
		If tl_calcTva && or thisform.container1.Visible= .T. && sau cu parametrul = .t. --- tl_calcTVA
		
			Select actactan
			Do Case
				Case !Empty(tcscc)
		
					Select Distinct Iif(!Inlist(Val(a.scc), &lcExcSCC), a.ascc, a.ascd) As ascc, a.proc_tva, ;
						Iif(!Inlist(Val(a.scc), &lcExcSCC), a.id_partc, a.id_partd) As id_part, ;
						Iif(!Inlist(Val(a.scc), &lcExcSCC), a.partc, a.partd) As nume_part, ;
						a.id_jtva_coloana As id_jtva_orig, b.id_tva As id_jtva_coloana, a.taxcode ;
						From actactan a Left Join jtva_coloane b On a.id_jtva_coloana =  b.id_jtva_coloana ;
						Where a.proc_tva <> 0 Into Cursor cascc Order By 1
					Select cascc
					Scan
						Scatter Fields ascc, proc_tva, id_part, nume_part, id_jtva_coloana, id_jtva_orig, taxcode Name loLinieTva
						Select actactan
						Sum Round(suma * (loLinieTva.proc_tva - 1), gnPC) To lnsuma For ascc = loLinieTva.ascc And id_jtva_coloana = loLinieTva.id_jtva_orig And id_partc = loLinieTva.id_part And !Inlist(Val(scc), &lcExcSCC)
						Sum Round(suma * (loLinieTva.proc_tva - 1), gnPC) To LnSumDisc For ascd = loLinieTva.ascc And id_jtva_coloana = loLinieTva.id_jtva_orig And id_partd = loLinieTva.id_part And Inlist(Val(scc), &lcExcSCC)
						lnsuma = lnsuma - LnSumDisc
						Append Blank
						Gather Name &lcObj Fields Except taxcode, paymentcode
						Gather Name loLinieTva Fields ascc, proc_tva, id_jtva_coloana, taxcode
						Gather Name ointr Fields Except explicatia, explicatia4, explicatia5, ascc, proc_tva, id_partc, id_partd, partd, id_factc, id_factd, perechec, pereched, id_jtva_coloana, taxcode, paymentcode
						Replace scd With tctva, scc With tcscc, ascd With '', ascc With loLinieTva.ascc, suma With lnsuma, id_partc With loLinieTva.id_part, partc With loLinieTva.nume_part
						*!* 28.02.2012
						Replace suma_val With 0
						*!* 28.02.2012 ^
						Select cascc
					Endscan
					Select actactan
					r = Recno()
					Sum(suma) To lntottva For scd  = tctva
					If r = 1
						Goto Top
					Else
						Goto r
					Endif
					Replace suma With suma + Thisform.tva - lntottva  &&reglez diferente de rotunjire tva
					Use In cascc
				Case !Empty(tcscd)
		
					Select Distinct Iif(!Inlist(Val(a.scd), &lcExcScd), a.ascd, a.ascc) As ascd, a.proc_tva, ;
						Iif(!Inlist(Val(a.scd), &lcExcScd), a.id_partd, a.id_partc) As id_part, ;
						Iif(!Inlist(Val(a.scd), &lcExcScd), a.partd, a.partc) As nume_part,  ;
						a.id_jtva_coloana As id_jtva_orig, b.id_tva As id_jtva_coloana, a.taxcode ;
						From actactan a Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
						Where a.proc_tva <> 0 Into Cursor cascd Order By 1
					Select cascd
					Scan
						Scatter Fields ascd, proc_tva, id_part, nume_part, id_jtva_coloana, id_jtva_orig, taxcode Name loLinieTva
						Select actactan
						Sum Round(suma * (loLinieTva.proc_tva - 1), gnPC) To lnsuma For ascd = loLinieTva.ascd And id_jtva_coloana = loLinieTva.id_jtva_orig And id_partd = loLinieTva.id_part And !Inlist(Val(scd), &lcExcScd)
						Sum Round(suma * (loLinieTva.proc_tva - 1), gnPC) To LnSumDisc For ascc = loLinieTva.ascd And id_jtva_coloana = loLinieTva.id_jtva_orig And id_partc = loLinieTva.id_part And Inlist(Val(scd), &lcExcScd)
						lnsuma = lnsuma - LnSumDisc
						Append Blank
						Gather Name &lcObj Fields Except taxcode, paymentcode
						Gather Name loLinieTva Fields ascd, proc_tva, id_jtva_coloana, taxcode
						Gather Name ointr Fields Except explicatia, explicatia4, explicatia5, suma, ascd, id_partd, id_partc, partc, id_factc, id_factd, perechec, pereched, id_jtva_coloana, taxcode, paymentcode
						Replace scc With tctva, scd With tcscd, ascc With '', ascd With loLinieTva.ascd, suma With lnsuma, id_partd With loLinieTva.id_part, partd With loLinieTva.nume_part
						*!* 28.02.2012
						Replace suma_val With 0
						*!* 28.02.2012 ^
						Select cascd
					Endscan
					Select actactan
					r = Recno()
					Sum(suma) To lntottva For scc = tctva
					If r = 1
						Goto Top
					Else
						Goto r
					Endif
					Replace suma With suma + Thisform.tva - lntottva &&reglez diferente de rotunjire tva
					Use In cascd
		
			Endcase
		Endif
		
		*!*	modificare	ROACONT	v 2.4.0
		If Inlist(&lcObj..id_set, 10609, 10647) && limitare drept deducere 50%, 100%
			Select actactan
			Go Top
			lcContScc = Alltrim(scc)
			Replace scc With lcContScc For scc <> lcContScc And scd = '4426'
		Endif
		
		*******************
		* 4111 = 4428 in loc de 4111 = 4427 pentru livrari neexigibile (Tva Incasare)
		lcSql = "select ID_JTVA_COLOANA from JTVA_COLOANE t where coloana_jv LIKE 'RO%NT'"
		lcCursor = 'cJtvaColTemp'
		llSucces = goExecutor.oExecuta(m.lcSql, lcCursor)
		If m.llSucces
			Update actactan Set scc = '4428' Where id_jtva_coloana In (Select id_jtva_coloana From cJtvaColTemp) And scc = '4427' && TVA LIVR.INTERN NEEX.
			* Update actactan Set scc = '4428' Where id_jtva_coloana Inlist(id_jtva_coloana, 22, 24, 26, 30, 32, 38, 42) And scc = '4427' && TVA LIVR.INTERN NEEX.
		Endif
		Use In (Select('cJtvaColTemp'))
		*******************
		
		*******************
		* 4428 = 401 in loc de 4426 = 401 pentru achizitii neexigibile (TVA Incasare)
		lcSql = "select ID_JTVA_COLOANA from JTVA_COLOANE t where coloana_jc LIKE 'RO%NT'"
		lcCursor = 'cJtvaColTemp'
		llSucces = goExecutor.oExecuta(m.lcSql, lcCursor)
		
		If m.llSucces
			Update actactan Set scd = '4428' Where id_jtva_coloana In (Select id_jtva_coloana From cJtvaColTemp) And scd = '4426' && TVA ACH.INTERN NEEX.
			* Update actactan Set scd = '4428' Where Inlist(id_jtva_coloana, 171, 173, 175, 179, 189, 211, 215) And scd = '4426' && TVA ACH.INTERN NEEX.
		Endif
		Use In (Select('cJtvaColTemp'))
		*******************
		
		*** TAXARE INVERSA
		*** select * from jtva_coloane t where DENUMIRE LIKE '%TI%' AND (COLOANA_JC IS NOT NULL OR COLOANA_JC IS NOT NULL) AND ID_TVA IS NULL AND COTA_TVA <> 0 ORDER BY ID_JTVA_COLOANA
		lcSql = "select ID_JTVA_COLOANA from JTVA_COLOANE t where coloana_jc LIKE 'TI%T' or coloana_jc like 'XX%TIT' "
		lcCursor = 'cJtvaColTemp'
		llSucces = goExecutor.oExecuta(m.lcSql, lcCursor)
		If m.llSucces
			UPDATE actactan SET scc = '4427', ascc = '' Where id_jtva_coloana In (Select id_jtva_coloana From cJtvaColTemp)
			UPDATE actactan SET scd = '4426', ascd = '' Where id_jtva_coloana In (Select id_jtva_coloana From cJtvaColTemp)
		Endif
		Use In (Select('cJtvaColTemp'))
		
		*** COMUNITATEA EUROPEANA
		*** select * from jtva_coloane t where DENUMIRE LIKE '%CE%' AND (COLOANA_JC IS NOT NULL OR COLOANA_JC IS NOT NULL) AND ID_TVA IS NULL AND COTA_TVA <> 0 ORDER BY ID_JTVA_COLOANA
		lcSql = "select ID_JTVA_COLOANA from JTVA_COLOANE t where  coloana_jc LIKE 'CE%T' and coloana_jc not LIKE 'CE%FTT' "
		lcCursor = 'cJtvaColTemp'
		llSucces = goExecutor.oExecuta(m.lcSql, lcCursor)
		
		If m.llSucces
			UPDATE actactan SET scc = '4427', ascc = '' Where id_jtva_coloana In (Select id_jtva_coloana From cJtvaColTemp)
			UPDATE actactan SET scd = '4426', ascd = '' Where id_jtva_coloana In (Select id_jtva_coloana From cJtvaColTemp)
		Endif
		Use In (Select('cJtvaColTemp'))
		****************
		* INCASARE/PLATA
		****************
		lnSumaAchitataTotal = This.SumaAchitata
		lnCoeficientAchitat = (This.SumaAchitata / This.Totctva) && pentru proportii TVA incasare
		Do Case
			Case Thisform.optAchitat.Value = 2 && achitat din 5311
		
				Do Case
					Case !Empty(tcscc)
						Select Distinct Iif(!Inlist(Val(a.scc), &lcExcSCC), a.ascc, a.ascd) As ascc, ;
							Iif(!Inlist(Val(a.scc), &lcExcSCC), a.id_partc, a.id_partd) As id_partc, ;
							Iif(!Inlist(Val(a.scc), &lcExcSCC), a.partc, a.partd) As partc, ;
							a.id_jtva_coloana, b.id_tva As id_jtva_tva, (Nvl(b.cota_tva, -100) + 100) / 100 As proc_tva ;
							From actactan a Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
							Where (Nvl(a.id_jtva_coloana, 0) = 0 Or (a.id_jtva_coloana <> 0 And b.afisat > 0)) ;
							And (Inlist(scc, '401', '404', '408', '409', '462') Or Inlist(scd, '401', '404', '408', '409', '462')) ;
							Into Cursor cascc Order By 1
						Select cascc
						Scan
							Scatter Fields ascc, id_partc, partc, id_jtva_coloana, id_jtva_tva, proc_tva Name loLinieIncasare
							Select actactan
							Sum suma To lnsuma For ascc = loLinieIncasare.ascc And id_partc = loLinieIncasare.id_partc And !Inlist(Val(scc), &lcExcSCC) ;
								And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
							Sum suma To LnSumDisc For ascd = loLinieIncasare.ascc And id_partd = loLinieIncasare.id_partc And Inlist(Val(scc), &lcExcSCC) ;
								And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
							lnsuma = lnsuma - LnSumDisc
							lnsuma = Min(m.lnsuma, m.lnSumaAchitataTotal)
							lnSumaAchitataTotal = lnSumaAchitataTotal - m.lnsuma
		
							Append Blank
							Gather Name &lcObj Fields Except serie_act, taxcode, paymentcode
							Gather Name loLinieIncasare Fields id_partc, ascc, id_jtva_coloana, proc_tva, partc
							If !Inlist(&lcObj..scc, '408', '409')
								Replace id_jtva_coloana With Null, proc_tva With 0
							Endif
							Gather Name ointr Fields Except explicatia, explicatia4, explicatia5, suma, ascc, scc, id_partc, id_factc, id_factd, perechec, pereched, id_jtva_coloana, proc_tva, serie_act, taxcode, paymentcode
							Replace partd With partc, id_partd With id_partc, suma With lnsuma
							*!*	modificare	ROACONT v 2.4.0 : am adaugat Thisform.seriechit
							Replace scd With scc, ascd With ascc, scc With '5311', ascc With '', pereched With nract, id_factd With - 1, ;
								serie_act With Nvl(Thisform.seriechit, ''), nract With Thisform.nrchit, partc With Thisform.casa, id_partc With This.ID_casa, ;
								id_fdoc With Thisform.nIdFdocAchitat, fdoc With Thisform.cFdocAchitat, paymentcode With This.cPaymentCode
							Replace pozitie_1 With 2
							*!* 28.02.2012
							Replace suma_val With 0
							*!* 28.02.2012 ^
							Select cascc
						Endscan
						Use In cascc
					Case !Empty(tcscd)
						Select Distinct Iif(!Inlist(Val(a.scd), &lcExcScd), a.ascd, a.ascc) As ascd, ;
							Iif(!Inlist(Val(a.scd), &lcExcScd), a.id_partd, a.id_partc) As id_partd, ;
							Iif(!Inlist(Val(a.scd), &lcExcScd), a.partd, a.partc) As partd, ;
							a.id_jtva_coloana, b.id_tva As id_jtva_tva, (Nvl(b.cota_tva, -100) + 100) / 100 As proc_tva ;
							From actactan a Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
							Where (Nvl(a.id_jtva_coloana, 0) = 0 Or (a.id_jtva_coloana <> 0 And b.afisat > 0)) ;
							And (Inlist(scc, '4111', '418', '419', '461') Or Inlist(scd, '4111', '418', '419', '461')) ;
							Into Cursor cascd Order By 1
						Select cascd
						Scan
							Scatter Fields ascd, id_partd, partd, id_jtva_coloana, id_jtva_tva, proc_tva Name loLinieIncasare
							Select actactan
							Sum suma To lnsuma For ascd = loLinieIncasare.ascd And id_partd = loLinieIncasare.id_partd And !Inlist(Val(scd), &lcExcScd) ;
								And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
							Sum suma To LnSumDisc For ascc = loLinieIncasare.ascd And id_partc = loLinieIncasare.id_partd And Inlist(Val(scd), &lcExcScd) ;
								And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
							lnsuma = lnsuma - LnSumDisc
		
							lnsuma = Min(m.lnsuma, m.lnSumaAchitataTotal)
							lnSumaAchitataTotal = lnSumaAchitataTotal - m.lnsuma
		
							Append Blank
							Gather Name &lcObj Fields Except serie_act, taxcode, paymentcode
							Gather Name loLinieIncasare Fields id_partd, ascd, id_jtva_coloana, proc_tva, partd
							If !Inlist(&lcObj..scd, '418', '419')
								Replace id_jtva_coloana With Null, proc_tva With 0
							Endif
							Gather Name ointr Fields Except explicatia, explicatia4, explicatia5, suma, ascd, scd, id_partd, id_factd, id_factc, pereched, perechec, id_jtva_coloana, proc_tva, serie_act, taxcode, paymentcode
							Replace partc With partd, id_partc With id_partd, suma With lnsuma
							*!*	modificare	ROACONT v 2.4.0	:	am adaugat Thisform.seriechit
							Replace scc With scd, ascc With ascd, scd With '5311', ascd With '', perechec With nract, id_factc With - 1, ;
								serie_act With Nvl(Thisform.seriechit, ''), nract With Thisform.nrchit, partd With Thisform.casa, id_partd With This.ID_casa, ;
								id_fdoc With Thisform.nIdFdocAchitat, fdoc With Thisform.cFdocAchitat, paymentcode With Thisform.cPaymentCode
							Replace pozitie_2 With 1
							*!* 28.02.2012
							Replace suma_val With 0
							*!* 28.02.2012 ^
							Select cascd
						Endscan
						Use In cascd
		
				Endcase
			Case Thisform.optAchitat.Value = 3 && achitat din 542
		
				*!*		SELECT DISTINCT ascc, scc, id_partc FROM actactan INTO CURSOR cascc ORDER BY ascc
				*!*		SELECT cascc
				*!*		SCAN
				*!*			SCATTER FIELDS ascc, scc, id_partc MEMV
				*!*			SELECT actactan
				*!*			CALCULATE SUM(suma) TO lnsuma FOR ascc = m.ascc AND id_partc = m.id_partc && AND proc_tva=m.proc_tva
		
				Select Distinct Iif(!Inlist(Val(a.scc), &lcExcSCC), a.ascc, a.ascd) As ascc, ;
					Iif(!Inlist(Val(a.scc), &lcExcSCC), a.id_partc, a.id_partd) As id_partc, ;
					Iif(!Inlist(Val(a.scc), &lcExcSCC), a.partc, a.partd) As partc, ;
					a.id_jtva_coloana, b.id_tva As id_jtva_tva, (Nvl(b.cota_tva, -100) + 100) / 100 As proc_tva ;
					From actactan a Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
					Where (Nvl(a.id_jtva_coloana, 0) = 0 Or (a.id_jtva_coloana <> 0 And b.afisat > 0)) ;
					And (Inlist(scc, '401', '404', '408', '409', '462') Or Inlist(scd, '401', '404', '408', '409', '462')) ;
					Into Cursor cascc Order By 1
				Select cascc
				Scan
					Scatter Fields ascc, id_partc, partc, id_jtva_coloana, id_jtva_tva, proc_tva Name loLinieIncasare
					Select actactan
					Sum suma To lnsuma For ascc = loLinieIncasare.ascc And id_partc = loLinieIncasare.id_partc And !Inlist(Val(scc), &lcExcSCC) ;
						And Inlist(scc, '401', '404', '408', '409', '462') ;
						And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
					Sum suma To LnSumDisc For ascd = loLinieIncasare.ascc And id_partd = loLinieIncasare.id_partc And Inlist(Val(scc), &lcExcSCC) ;
						And Inlist(scc, '401', '404', '408', '409', '462') ;
						And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
					lnsuma = lnsuma - LnSumDisc
		
					lnsuma = Min(m.lnsuma, m.lnSumaAchitataTotal)
					lnSumaAchitataTotal = lnSumaAchitataTotal - m.lnsuma
		
					Append Blank
					Gather Name &lcObj Fields Except serie_act, taxcode, paymentcode
					Gather Name loLinieIncasare Fields ascc, id_partc, id_jtva_coloana, proc_tva, partc
					If !Inlist(&lcObj..scc, '408', '409')
						Replace id_jtva_coloana With Null, proc_tva With 0
					Endif
					Gather Name ointr Fields Except explicatia, explicatia4, explicatia5, suma, ascc, scc, id_partc, id_jtva_coloana, proc_tva, serie_act, taxcode, paymentcode
					Replace partd With partc, id_partd With id_partc, suma With lnsuma
					*!*	modificare	ROACONT	v 2.4.0	: am adaugat Thisform.seriechit
					Replace scd With scc, ascd With ascc, scc With '542 ', ascc With '', pereched With nract, id_factd With - 1, ;
						serie_act With Nvl(Thisform.seriechit, ''), nract With Thisform.nrchit, partc With Thisform.achi, id_partc With This.ID_achi, ;
						id_fdoc With Thisform.nIdFdocAchitat, fdoc With Thisform.cFdocAchitat, paymentcode With Thisform.cPaymentCode
					*!* 28.02.2012
					Replace suma_val With 0
					*!* 28.02.2012 ^
				Endscan
				If Used('actcv542')
					Select actcv542
					Replace All achilei With 0 For ales
					Sum sumaachi To lnSuma542
					Select actactan
					Sum suma To lnSAct For Alltrim(scc) = '542'
					If lnSuma542 # lnSAct
						amessagebox("Refaceti plata din 542!", 0 + 48, "Atentie")
						Return .F.
					Endif
				Endif
		
				Select actactan
				Scan For Alltrim(scc) = '542' And perechec = 0
					Scatter Name ocomp
					Select actcv542
					Locate For ales And achilei < sumaachi
					lnsuma = ocomp.suma - (sumaachi - achilei)
					Do Case
						Case lnsuma = 0
							Replace achilei With sumaachi
							lnNract = nract
							lnIdFact = id_fact
							lcAcont = acont
							Select actactan
							Replace perechec With lnNract, id_factc With lnIdFact, ascc With lcAcont
						Case lnsuma < 0
							Replace achilei With achilei + ocomp.suma
							lnNract = nract
							lnIdFact = id_fact
							lcAcont = acont
							Select actactan
							Replace perechec With lnNract, id_factc With lnIdFact, ascc With lcAcont
						Case lnsuma > 0
							lnSumaAct = sumaachi - achilei
							lnNract = nract
							lnIdFact = id_fact
							lcAcont = acont
							Replace achilei With achilei + lnSumaAct
							Select actactan
							lnr = Recno()
		
							Replace suma With lnSumaAct, perechec With lnNract, id_factc With lnIdFact, ascc With lcAcont
							Append Blank
							Gather Name ocomp
							Replace suma With suma - lnSumaAct
		
							If lnr = 1
								Goto Top
							Else
								Goto lnr
							Endif
					Endcase
					Select actactan
				Endscan
				Use In cascc
		
			Case Thisform.optAchitat.Value = 4 && achitat din 462
		
				Do Case
					Case !Empty(tcscc)
						Select Distinct Iif(!Inlist(Val(a.scc), &lcExcSCC), a.ascc, a.ascd) As ascc, ;
							Iif(!Inlist(Val(a.scc), &lcExcSCC), a.id_partc, a.id_partd) As id_partc, ;
							Iif(!Inlist(Val(a.scc), &lcExcSCC), a.partc, a.partd) As partc, ;
							a.id_jtva_coloana, b.id_tva As id_jtva_tva, (Nvl(b.cota_tva, -100) + 100) / 100 As proc_tva ;
							From actactan a Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
							Where (Nvl(a.id_jtva_coloana, 0) = 0 Or (a.id_jtva_coloana <> 0 And b.afisat > 0)) ;
							And (Inlist(scc, '401', '404', '408', '409', '462') Or Inlist(scd, '401', '404', '408', '409', '462')) ;
							Into Cursor cascc Order By 1
						Select cascc
						Scan
							Scatter Fields ascc, id_partc, partc, id_jtva_coloana, id_jtva_tva, proc_tva Name loLinieIncasare
							Select actactan
							Sum suma To lnsuma For ascc = loLinieIncasare.ascc And id_partc = loLinieIncasare.id_partc And !Inlist(Val(scc), &lcExcSCC) ;
								And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
							Sum suma To LnSumDisc For ascd = loLinieIncasare.ascc And id_partd = loLinieIncasare.id_partc And Inlist(Val(scc), &lcExcSCC) ;
								And Iif(!Isnull(loLinieIncasare.id_jtva_coloana), Inlist(id_jtva_coloana, loLinieIncasare.id_jtva_coloana, loLinieIncasare.id_jtva_tva), Isnull(id_jtva_coloana))
							lnsuma = lnsuma - LnSumDisc
							lnsuma = Min(m.lnsuma, m.lnSumaAchitataTotal)
							lnSumaAchitataTotal = lnSumaAchitataTotal - m.lnsuma
		
							Append Blank
							Gather Name &lcObj Fields Except serie_act, taxcode, paymentcode
							Gather Name loLinieIncasare Fields id_partc, ascc, id_jtva_coloana, proc_tva, partc
							If !Inlist(&lcObj..scc, '408', '409')
								Replace id_jtva_coloana With Null, proc_tva With 0
							Endif
							Gather Name ointr Fields Except explicatia, explicatia4, explicatia5, suma, ascc, scc, id_partc, id_factc, id_factd, perechec, pereched, id_jtva_coloana, proc_tva, serie_act, taxcode, paymentcode
							Replace partd With partc, id_partd With id_partc, suma With lnsuma
							*!*	modificare	ROACONT v 2.4.0 : am adaugat Thisform.seriechit
							Replace scd With scc, ascd With ascc, scc With '462 ', ascc With '', pereched With nract, id_factd With - 1, ;
								serie_act With Nvl(Thisform.seriechit, ''), nract With Thisform.nrchit, partc With Thisform.part462, id_partc With This.id_part462, ;
								id_fdoc With Thisform.nIdFdocAchitat, fdoc With Thisform.cFdocAchitat, paymentcode With This.cPaymentCode
							Replace pozitie_1 With 2
							*!* 28.02.2012
							Replace suma_val With 0
							*!* 28.02.2012 ^
							Select cascc
						Endscan
						Use In cascc
				Endcase
		
			Case Thisform.optAchitat.Value = 1 And tl_plata
				Select actactan
				Replace All datascad With Thisform.datascad
		Endcase
		
		****************
		* TVA INCASARE
		****************
		*!*	modificare	ROACONT v 2.4.0
		
		If Inlist(Thisform.optAchitat.Value, 2, 3, 4)
			Insert Into actactan(nr_nota, serie_act, luna, an, nract, scd, ascc, scc, ;
				suma, suma_val, pereched, perechec, explicatia, explicatia4, explicatia5, Curs, id_util, ;
				id_responsabil, nresp, id_venchelt, dst_chlt, id_lucrare, nrord, ;
				id_ctr, contract, id_sectie, sectie, proc_tva, id_set, id_fact, ;
				id_factd, id_factc, id_partd, partd, id_partc, partc, ;
				id_sucursala, sucursala, id_fdoc, fdoc, id_gestin, id_jtva_coloana, taxcode, ;
				gestin, id_gestout, gestout, id_valuta, nume_val, dataact, dataireg);
				Select a.nr_nota, Nvl(Thisform.seriechit, '') As serie_act, a.luna, a.an, Thisform.nrchit As nract, '4426' As  scd, a.ascd As ascc, '4428' As scc, ;
				Round(a.suma * m.lnCoeficientAchitat, m.gnPA) As suma, Round(a.suma_val * m.lnCoeficientAchitat, m.gnPval) As suma_val, ;
				a.nract As pereched, a.perechec, a.explicatia, a.explicatia4, a.explicatia5, a.Curs, a.id_util, ;
				a.id_responsabil, a.nresp, a.id_venchelt, a.dst_chlt, a.id_lucrare, a.nrord, ;
				a.id_ctr, a.contract, a.id_sectie, a.sectie, a.proc_tva, a.id_set, -5 As id_fact, ;
				0 As id_factd, 0 As id_factc, 0 As id_partd, '' As partd, 0 As id_partc, '' As partc, ;
				a.id_sucursala, a.sucursala, Thisform.nIdFdocAchitat As id_fdoc, Thisform.cFdocAchitat As fdoc, 0 As id_gestin, ;
				c.id_tva As id_jtva_coloana, ;
				CAST(GetTaxCode(m.gnAn, m.gnLuna, a.dataact, c.id_tva) As N(6) Null) As taxcode,;
				'' As gestin, 0 As id_gestout, '' As gestout, a.id_valuta, a.nume_val, a.dataact, a.dataireg ;
				From actactan a ;
				Left Join jtva_coloane b On a.id_jtva_coloana = b.id_tva ;
				Left Join jtva_coloane c On b.id_jtva_ex = c.id_jtva_coloana ;
				Where a.scd = '4428' And Like('4*', a.scc) And !Isnull(b.id_jtva_ex)
		
			Insert Into actactan(nr_nota, serie_act, luna, an, nract, scc, ascd, scd, ;
				suma, suma_val, pereched, perechec, explicatia, explicatia4, explicatia5, Curs, id_util, ;
				id_responsabil, nresp, id_venchelt, dst_chlt, id_lucrare, nrord, ;
				id_ctr, contract, id_sectie, sectie, proc_tva, id_set, id_fact, ;
				id_factd, id_factc, id_partd, partd, id_partc, partc, ;
				id_sucursala, sucursala, id_fdoc, fdoc, id_gestin, id_jtva_coloana, taxcode, ;
				gestin, id_gestout, gestout, id_valuta, nume_val, dataact, dataireg);
				Select a.nr_nota, Nvl(Thisform.seriechit, '') As serie_act, a.luna, a.an, Thisform.nrchit As nract, '4427' As  scc, a.ascc As ascd, '4428' As scd, ;
				Round(a.suma * m.lnCoeficientAchitat, m.gnPA) As suma, Round(a.suma_val * m.lnCoeficientAchitat, m.gnPval) As suma_val, ;
				a.pereched, a.nract As perechec, a.explicatia, a.explicatia4, a.explicatia5, a.Curs, a.id_util, ;
				a.id_responsabil, a.nresp, a.id_venchelt, a.dst_chlt, a.id_lucrare, a.nrord, ;
				a.id_ctr, a.contract, a.id_sectie, a.sectie, a.proc_tva, a.id_set, -5 As id_fact, ;
				0 As id_factd, 0 As id_factc, 0 As id_partd, '' As partd, 0 As id_partc, '' As partc, ;
				a.id_sucursala, a.sucursala, Thisform.nIdFdocAchitat As id_fdoc, Thisform.cFdocAchitat As fdoc, 0 As id_gestin, ;
				c.id_tva As id_jtva_coloana,  ;
				CAST(GetTaxCode(m.gnAn, m.gnLuna, a.dataact, c.id_tva) As N(6) Null) As taxcode,;
				'' As gestin, 0 As id_gestout, '' As gestout, a.id_valuta, a.nume_val, a.dataact, a.dataireg ;
				From actactan a ;
				Left Join jtva_coloane b On a.id_jtva_coloana = b.id_tva ;
				Left Join jtva_coloane c On b.id_jtva_ex = c.id_jtva_coloana ;
				Where a.scc = '4428' And Like('4*', a.scd) And !Isnull(b.id_jtva_ex)
		Endif
		*!*	modificare	ROACONT v 2.4.0	^
		
		*!*	modificare	ROACONT v 2.4.0	: l-am mutat mai sus ( inainte de schimbarea 4426 in 4428 )
		*!*	*!*	modificare	v 2.2.21
		*!*	If &lcObj..id_set = 10609
		*!*		Select actactan
		*!*		Go Top
		*!*		lcContScc = Alltrim(scc)
		*!*		Replace scc With lcContScc For scc <> lcContScc And scd = '4426'
		*!*	Endif
		*!*	*!*	modificare	v 2.2.21	^
		*!*	modificare	ROACONT v 2.4.0	^
		Release ointr, loLinieTva, loLinieIncasare
		
		*!*	modificare	v 2.2.20
		lnIdSet = &lcObj..id_set
		lnIdJtvaLim50 = 1004
		lnIdJtvaLim100 = 1005
		llLimitareDeducere50 = (&lcObj..deducere = 1)
		llLimitareDeducere100 = (&lcObj..deducere = 2)
		lnProcentNedeductibil = Iif(m.lnIdSet = 10647 Or m.llLimitareDeducere100, 1.0, 0.5) && 10647 = 100% limitare deducere TVA
		
		* Limitare 50% TVA x = 4426
		If Inlist(&lcObj..id_set, 10609, 10647) Or (&lcObj..id_set = 10457 And &lcObj..deducere = 1) Or m.llLimitareDeducere50  Or m.llLimitareDeducere100 && limitare drept deducere 50%, 100%
			*!*	modificare	ROACONT v 2.4.0 : la scc ( in loc de '4426' ), la id_jtva_coloana ( in loc de 1001 ) si
			*!*		am adaugat conditia "and !like('44*',a.scc)"
			lnIdJTVALim = Iif(m.lnIdSet = 10647 Or m.llLimitareDeducere100, m.lnIdJtvaLim100, m.lnIdJtvaLim50)
			llN50 = (m.lnIdSet <> 10647) And !m.llLimitareDeducere100
			llN100 = (m.lnIdSet = 10647) Or m.llLimitareDeducere100
		
			Insert Into actactan(nr_nota, serie_act, luna, an, nract, ascd, scd, scc, ;
				suma, suma_val, pereched, perechec, explicatia, explicatia4, explicatia5, Curs, id_util, ;
				id_responsabil, nresp, id_venchelt, dst_chlt, id_lucrare, nrord, ;
				id_ctr, contract, id_sectie, sectie, proc_tva, id_set, id_fact, ;
				id_factd, id_factc, id_partd, partd, id_partc, partc, ;
				id_sucursala, sucursala, id_fdoc, fdoc, id_gestin, id_jtva_coloana, taxcode,;
				gestin, id_gestout, gestout, id_valuta, nume_val, dataact, dataireg) ;
				Select a.nr_nota, a.serie_act, a.luna, a.an, a.nract, a.ascd, a.scd, ;
				'4426' As scc, ;
				Round(Round(a.suma * (a.proc_tva - 1), gnPC) * m.lnProcentNedeductibil, gnPC) As suma, ;
				Round(Round(a.suma_val * (a.proc_tva - 1), gnPC) * m.lnProcentNedeductibil, gnPC) As suma_val, ;
				a.pereched, a.perechec, a.explicatia, a.explicatia4, a.explicatia5, a.Curs, a.id_util, ;
				a.id_responsabil, a.nresp, a.id_venchelt, a.dst_chlt, a.id_lucrare, a.nrord, ;
				a.id_ctr, a.contract, a.id_sectie, a.sectie, 0 As proc_tva, a.id_set, a.id_fact, ;
				0 As id_factd, 0 As id_factc, 0 As id_partd, '' As partd, 0 As id_partc, '' As partc, ;
				a.id_sucursala, a.sucursala, a.id_fdoc, a.fdoc, 0 As id_gestin, m.lnIdJTVALim As id_jtva_coloana, ;
				CAST(GetTaxCodeIdPart(m.gnAn, m.gnLuna, a.dataact, a.id_jtva_coloana, Nvl(a.id_partc, a.id_partd), m.llN50, m.llN100) As N(6) Null) As taxcode,;
				'' As gestin, 0 As id_gestout, '' As gestout, a.id_valuta, a.nume_val, a.dataact, a.dataireg ;
				From actactan a ;
				Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
				Where (Nvl(a.id_jtva_coloana, 0) = 0 Or (a.id_jtva_coloana <> 0 And b.afisat > 0)) ;
				And !Isnull(b.id_tva) ;						&&	modificare	v 2.4.5
			And Like('4*', a.scc) And !Like('44*', a.scc)	&&	modificare	v 2.2.22
			*!*		AND Inlist(scc,'401','404')			modificare	v 2.2.21
		Endif
		*!*	modificare	v 2.2.20	^
		*!*	modificare	v 2.4.3
		
		* Exigibilizare 50% TVA pentru Limitare deducere TVA 4426 = 4428 pentru furnizorii TVA Incasare
		If Thisform.optAchitat.Value = 1 And &lcObj..tva_incasare = 1 And ;
				((&lcObj..id_set = 10424 And &lcObj..deducere = 1) Or ;
				Inlist(&lcObj..id_set, 10609, 10647) Or ;
				(&lcObj..id_set = 10457 And &lcObj..deducere = 1) Or m.llLimitareDeducere50 Or m.llLimitareDeducere100)
			Insert Into actactan(nr_nota, serie_act, luna, an, nract, scd, scc, ;
				suma, suma_val, pereched, perechec, explicatia, explicatia4, explicatia5, Curs, id_util, ;
				id_responsabil, nresp, id_venchelt, dst_chlt, id_lucrare, nrord, ;
				id_ctr, contract, id_sectie, sectie, proc_tva, id_set, id_fact, ;
				id_factd, id_factc, id_partd, partd, id_partc, partc, ;
				id_sucursala, sucursala, id_fdoc, fdoc, id_gestin, id_jtva_coloana, taxcode, ;
				gestin, id_gestout, gestout, id_valuta, nume_val, dataact, dataireg) ;
				Select a.nr_nota, a.serie_act, a.luna, a.an, a.nract, '4426' As scd, '4428' As scc, ;
				Round(Round(a.suma * (a.proc_tva - 1), gnPC) * m.lnProcentNedeductibil, gnPC) As suma, ;
				Round(Round(a.suma_val * (a.proc_tva - 1), gnPC) * m.lnProcentNedeductibil, gnPC) As suma_val, ;
				a.pereched, a.perechec, a.explicatia, a.explicatia4, a.explicatia5, a.Curs, a.id_util, ;
				a.id_responsabil, a.nresp, a.id_venchelt, a.dst_chlt, a.id_lucrare, a.nrord, ;
				a.id_ctr, a.contract, a.id_sectie, a.sectie, a.proc_tva, a.id_set, a.id_fact, ;
				0 As id_factd, 0 As id_factc, 0 As id_partd, '' As partd, 0 As id_partc, '' As partc, ;
				a.id_sucursala, a.sucursala, a.id_fdoc, a.fdoc, 0 As id_gestin, c.id_tva As id_jtva_coloana, ;
				CAST(GetTaxCode(m.gnAn, m.gnLuna, a.dataact, c.id_tva) As N(6) Null) As taxcode,;
				'' As gestin, 0 As id_gestout, '' As gestout, a.id_valuta, a.nume_val, a.dataact, a.dataireg ;
				From actactan a ;
				Left Join jtva_coloane b On a.id_jtva_coloana = b.id_jtva_coloana ;
				Left Join jtva_coloane c On b.id_jtva_ex = c.id_jtva_coloana ;
				Where (Nvl(a.id_jtva_coloana, 0) = 0 Or (a.id_jtva_coloana <> 0 And b.afisat > 0)) ;
				And !Isnull(b.id_jtva_ex) ;						&&	modificare	v 2.4.5
			And Like('4*', a.scc) And !Like('44*', a.scc)	And !Like('44*', a.scd)
		Endif
		*!*	modificare	v 2.4.3	^
		*!*	modificare	v 2.2.23
		
		*!*	modificare	v 2.2.23	^
		*!* 28.02.2012
		Update actactan Set suma_val = Round(suma / Curs, m.gnPval) Where Nvl(suma_val, 0) = 0 And Curs <> 0
		*!* 28.02.2012 ^
		Delete From actactan Where suma = 0
		
		
		Do completare_gruputil_analitice In oproceduri_comune.prg
		Do completare_tva_analitice In oproceduri_comune.prg
		Do completare_taxname In oproceduri_comune.prg
		Do completare_paymentname In oproceduri_comune.prg
		Do completare_explicatie_tva In oproceduri_comune.prg
		Select actactan
		Go Top
		
		Return .T.
		
		
		
	ENDPROC

	PROCEDURE nidfdocachitat_assign
		lparameters tnIdFdocAchitat
		This.nIdFdocAchitat = tnIdFdocAchitat
		
		Thisform.UpdatePaymentSAFT()
	ENDPROC

	PROCEDURE refreshachitat
		Local llAchitat, llAchitat5311, llAchitat542, llAchitat462, llCuAchitare
		
		llCuAchitare = m.tl_plata
		llAchitat5311 = m.llCuAchitare And (This.optAchitat.Value = 2)
		llAchitat542 = m.llCuAchitare And (This.optAchitat.Value = 3)
		llAchitat462 = m.llCuAchitare And (This.optAchitat.Value = 4)
		llAchitat = (m.llAchitat5311 Or m.llAchitat542 or m.llAchitat462)
		
		With Thisform
			.shpAchitat.Visible = m.llCuAchitare
			.lblDataScadenta.Visible = m.llCuAchitare And !m.llAchitat
			.txtDataScadenta.Visible = m.llCuAchitare And !m.llAchitat
			.itmFdocAchitat.Visible = m.llAchitat
			.lblSeria.Visible = m.llAchitat
			.txtSeria.Visible = m.llAchitat
			.lblNr.Visible = m.llAchitat
			.txtNr.Visible = m.llAchitat
			.itmAchizitor.Visible = m.llAchitat542
			.itmCreditorDivers.Visible = m.llAchitat462
			.itmCasaPlati.Visible = m.llAchitat5311
			.lblSumaAchitata.Visible = m.llAchitat
			.txtSumaAchitata.Visible = m.llAchitat
			.itmDocJustificat.Visible = m.llAchitat542
			*!*	modificare	ROACONT v 2.5.45
			.optAchitat.Visible = m.llCuAchitare
			*!*	modificare	ROACONT v 2.5.45	^
			.lb_plata_saft.visible = m.gl406 and m.llAchitat
			.cbo_plata_saft.visible = m.gl406 and m.llAchitat	
		Endwith
		IF m.gl406 AND m.llAchitat
			This.actualizeaza_plata_saft()
		ENDIF 	
		
		Thisform.Refresh()
		
	ENDPROC

	PROCEDURE Show
		Lparameters nStyle
		*!*	modificare	ROACONT v 2.5.45	:	am modificat anchor-ul de la gridb1 ( de la 15 la 11 ) si item1 ( de la 12 la 8 ) 
		*!*		pentru ca atunci cand se modifica inaltimea ferestrei, gridul si itemul erau ancorate in jos pe absolut si se 
		*!*		"ridicau" pe masura ce se diminua inaltimea ferestrei
		
		*!* 10.10.2014
		*!* marius.mutu
		*!* modificat anchor container1 de la 12 la 8 pentru ca se ridica sub grid si nu se mai vedea
		
		*!*	29.10.2014
		*!*	marius.muut
		*!*	am marit fereastra pe latime la sfarsit
		
		LOCAL lnHeight
		
		lcObj = Alltrim(This.pcobj)
		
		With &lcObj
			&& modif v3.0.61 - 03nov2008
			*!*		this.datascad = GOMONTH(.dataact, 1)
		
			If Type('.datascad') = 'D'
				This.datascad = .datascad
			Else
				This.datascad = Gomonth(.dataact, 1)
			Endif
			&& modif v3.0.61 - 03nov2008 ^
		Endwith
		
		thisform.nIdFdocAchitat = &lcObj..id_fdoc
		thisform.cFdocAchitat = &lcObj..fdoc
		
		*!*	modificare	v 2.2.21
		*!*	IF !EMPTY(tcscc)
		* Nu mai fac inactive coloanele de cont, partener. Poate sa modifice orice coloana
		
		*!*	If !Empty(tcscc) And !Inlist(tn_idset,10609, 10647) && limitare deducere 50% / 100%
		*!*		*!*	modificare	v 2.2.21	^
		*!*		This.GRIdb1.COLUMN4.ReadOnly=.T.
		*!*		This.GRIdb1.COLUMN15.ReadOnly=.T.
		*!*	Endif
		*!*	If !Empty(tcscD)
		*!*		This.GRIdb1.COLUMN3.ReadOnly=.T.
		*!*		This.GRIdb1.COLUMN14.ReadOnly=.T.
		*!*	Endif
		
		Do Case
			Case Inlist(tn_idset,10460)
				*!*		SELECT introdc
				*!*		REPLACE ALL sectie WITH m.sectie,dst_chlt WITH m.dst_chlt nresp WITH m.nresp
				This.GRIdb1.Refresh
				This.container1.item2.text_item1.SetFocus
			Case INLIST(tn_idset, 10609, 10647)		&&	modificare	v 2.2.22
				*!*	modificare	2.2.23
				* Am facut butonul Nou vizibil permanent
		*!*			Thisform.but_nou1.Visible = .T.
		*!*			Thisform._shaPE1.Width = Thisform._shaPE1.Width + 42
		*!*			Thisform._shaPE1.Left = Thisform._shaPE1.Left - 42
				*!*	modificare	2.2.23	^
				Thisform.container1.item3.text_item1.SetFocus()
			Otherwise
				This.GRIdb1.SetFocus
		Endcase
		
		
		If !m.tl_plata
			This.Height = This.shpAchitat.Top
		Else
			This.optACHITAT.Value = 1
		Endif
		
		This.RefreshAchitat()
		
		If !m.tl_calcTVA
			this.container1.Visible = .F.
		*!*	modificare	ROACONT v 2.5.45
		*!*		this.Height = obj.container1.Top + 10
			This.Height = Thisform.item1.Top + Thisform.item1.Height + 10
		*!*	modificare	ROACONT v 2.5.45	^
			this.GRIdb1.column13.Visible = .F.
		ENDIF
		lnHeight = this.Height 
		this.WindowState= 2
		this.Height = MAX(m.lnHeight, INT(_screen.Height*2/3))
		
		This.gridb1.column22.Visible = m.gl406 && taxcode
		This.gridb1.column23.Visible = m.gl406 && taxcode descriere
		
		* Calculez totaluri la inceput, in caz ca intru cu note si sume din import eFactura
		* Initalizez Totctva din import eFactura
		If Inlist(tn_idset,10460)
			Thisform.calculez(.T.)
		Else
			Thisform.calculez(.F.)
		ENDIF
		GO TOP IN introdc
	ENDPROC

	PROCEDURE updateexplicatiesaft
		* Daca nu este activata SAFT 406 nu fac nimic
		IF !m.gl406
			RETURN
		ENDIF
		 
		Local loPartenerRTVAI As "empty"
		Local loPartenerRTVAIX As "empty"
		Local lcCodFiscal, lcNumePart, ldDataAct, llFurnizorRTVAI, lnIdJtva, lnIdPart, lnTaxCode, lcSelect, llN50, llN100, lnLimitareDeducere50, llNeexigibil
		
		lcSelect = SELECT()
		
		
		ldDataAct = poAct.dataact
		lnIdJtva = introdc.id_jtva_coloana
		llFurnizorRTVAI = .F.
		lnIdPart = Nvl(introdc.id_partc, introdc.id_partd)
		
		lcObj = Alltrim(This.pcobj)
		lnIdSet = &lcObj..id_set
		lnLimitareDeducere50 = &lcObj..deducere
		* llN50/llN100 = .T. doar pentru linia cu Explicatie TVA = "Limitare deducere TVA"
		llN50 = .F. && (m.lnIdSet = 10609) or (m.lnLimitareDeducere50 = 1)
		llN100 = .F. && (m.lnIdSet = 10647)
		llNeexigibil = LEFT(scd,3) = '418' or LEFT(scc,3) =  '408' && facturi neintocmite/nesosite
		
		lnTaxCode = GetTaxCodeIdPart(m.gnAn, m.gnLuna, m.ldDataAct, m.lnIdJtva, m.lnIdPart, m.llN50, m.llN100, m.llNeexigibil)
		
		Replace taxcode With m.lnTaxCode In introdc
		*This.gridb1.column22._combobox1.ForeColor = Rgb(255, 0, 0)
		This.gridb1.column22._combobox1.Refresh()
		This.gridb1.column23.text1.Refresh()
		
		SELECT (m.lcSelect)
	ENDPROC

	PROCEDURE updatepaymentsaft
		Local llAchitat
		If !m.gl406
			Return
		ENDIF
		
		lnIdFdoc = NVL(Thisform.nIdFdocAchitat,0)
		
		IF !EMPTY(m.lnIdFdoc)
			this.cPaymentCode = GetPaymentCode(m.lnIdFdoc)
		ELSE
			llAchitat = m.tl_plata And Inlist(This.optAchitat.Value, 2, 3)
			this.cPaymentCode = IIF(m.llAchitat, '10', '')
		ENDIF 	
		
		This.cbo_plata_saft.Refresh()
		
	ENDPROC

	PROCEDURE verificare
		Local LL_MARCA
		LL_MARCA=.T.
		If Used('crsv')
			Use In crsv
		Endif
		Select Count(*) As nr From introdc Where !Empty(suma) And Empty(Nvl(id_jtva_coloana,0)) And cu_tva = 1 Into Cursor crsv
		Select crsv
		lnNr = nr
		Use In crsv
		
		Do Case
		Case lnNr > 0
			aMESSAGEBOX("Nu ati completat explicatia TVA pentru toate sumele!",0+48,"Atentie")
			Select introdc
			Locate For !Empty(suma) And Empty(Nvl(id_jtva_coloana,0)) And cu_tva = 1
			Thisform.gridb1.column13.SetFocus()
			LL_MARCA = .F.
		Case Thisform.optAchitat.Value = 2
			If Empty(Thisform.nrchit) Or Empty(This.id_casa)
				aMESSAGEBOX("Nu ati completat datele referitoare la plata!",0+48,"Atentie")
				Thisform.txtNr.SetFocus
				LL_MARCA=.F.
			Endif
		Case Thisform.optAchitat.Value=3
			If Empty(Thisform.nrchit) Or Empty(This.id_achi)
				aMESSAGEBOX("Nu ati completat datele referitoare la plata!",0+48,"Atentie")
				Thisform.txtNr.SetFocus
				LL_MARCA=.F.
			Endif
		Endcase
		
		If 	LL_MARCA
			LL_MARCA = Thisform.la_iesire()
		Endif
		
		Return LL_MARCA
	ENDPROC

	PROCEDURE verific_analitic
	ENDPROC

	PROCEDURE verific_cont
		this.lblDataScadenta.Visible = .F.
		this.
	ENDPROC

	PROCEDURE verific_inregistrari
	ENDPROC

	PROCEDURE verific_partener
		Parameters tcCont, tcId, tcNume
		
		If Empty(tcCont)
			Return
		Endif
		
		Local llReturn
		llReturn = .F.
		
		Select introdc
		lcCont = &tcCont
		lcCont = Alltrim(lcCont)
		
		lcSql=[select count(*) as valoare FROM ] + gcS + [.vcoresp_tip_cont where cont = ?lcCont ]
		lcCursor = 'c_part'
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		If lnSucces < 0
			aMESSAGEBOX('VERIFICARE PARTENER ' + Chr(13) + goExecutor.cEroare,0+16,"Eroare")
		Endif
		
		If lnSucces > 0
			Select c_part
			If valoare > 0
				Thisform.do_cauta_partener(lcCont, tcId, tcNume)
			Endif
			If Used('c_part')
				Use In c_part
			Endif
		Endif
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.GotFocus
		*
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.LostFocus
		IF INLIST(tn_idset,10460) && combustibili cu taxa
			SELECT INTRODC
			LOCATE FOR ptva <> 0 AND suma = 0
			IF FOUND()
				lnProcTva = (100 + ptva)/100
				REPLACE SUMA WITH ROUND(THISFORM.TVA/(lnProcTva-1),gnPC)
			ELSE 
				LOCATE 
			ENDIF 
		ENDIF 
		thisform.calculez(.t.) 
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container1.Item2.Text_item1.When
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.GotFocus
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.LostFocus
		Do Case
			Case  Inlist(tn_idset,10460)
				Select INTRODC
				Sum SUMA To LnSuma For ptva <> 0
				Sum SUMA To lnSumaNeimp For ptva = 0
				If Abs(Thisform.totctva-Thisform.tva-LnSuma-lnSumaNeimp)<100   && sa nu calculexe taxa de drum dc e < 100 lei
					Locate For ptva <> 0
				Else
					Locate For ptva = 0 And Upper(Left(explicatie,4))='TAXA'
				Endif
				If Found()
					Replace SUMA With SUMA+Thisform.totctva-Thisform.tva-LnSuma-lnSumaNeimp
				Else
					Locate
				Endif
				Thisform.totftva=Thisform.totctva-Thisform.tva
				Thisform.item1.text_item1.Refresh
		*!*	modificare	v 2.2.23
		*!*		Case tn_idset = 10609		&&	modificare	v 2.2.22
		*!*			&&	nu am discounturi
		*!*			Select INTRODC
		*!*			Replace SUMA With Round((This.Value/2)/(1+ptva/100),gnPc) All
		*!*			Sum SUMA To Thisform.totftva
		*!*			Thisform.tva = Thisform.totctva - Thisform.totftva
		*!*			Thisform.item1.text_item1.Refresh()
		*!*			Thisform.container1.item2.text_item1.Refresh()
		*!*			Select INTRODC
		*!*			Go Top
		*!*			Thisform.gridb1.column3.text1.SetFocus()
			Case tn_idset = 10609 AND !Thisform.cmd_executa1.Visible && AND RECCOUNT('introdc') = 2
				Thisform.do_executa()
				Thisform.cmd_executa1.Visible = .T.	
		*!*	modificare	v 2.2.23	^
			Case tn_idset = 10647 AND !Thisform.cmd_executa1.Visible AND RECCOUNT('introdc') = 1
				Thisform.do_executa()
				Thisform.cmd_executa1.Visible = .T.	
			Otherwise
				Thisform.tva=Thisform.totctva-Thisform.totftva
				Thisform.container1.item2.text_item1.Refresh
		Endcase
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE Container1.Item3.Text_item1.When
		*
	ENDPROC

	PROCEDURE Gridb1.AfterRowColChange
		LPARAMETERS nColIndex
		*!*	SELECT introdc
		
		*!*	IF LEFT(scd,1) = '6' OR LEFT(scc,1) = '7'
		*!*		this.column10.enabled= .t.
		*!*		this.column11.enabled= .t.
		*!*		this.column12.enabled= .t.
		*!*	ELSE 
		*!*		this.column10.enabled= .f.
		*!*		this.column11.enabled= .f.
		*!*		this.column12.enabled= .f.
		*!*	ENDIF 
			
		*!*	this.refresh 
	ENDPROC

	PROCEDURE Gridb1.Column10.Text1.Click
		locauta = thisform.do_cauta_alfa('vnom_sectii', 'sectie', 'Numele sectiei', 'Sectia')
		SELECT introdc
		REPLACE sectie WITH locauta.sectie, id_sectie WITH locauta.id_sectie
	ENDPROC

	PROCEDURE Gridb1.Column10.Text1.InteractiveChange
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column11.Text1.Click
		*!*	PRIVATE lc_variab
		*!*	LC_VARIAB=''
		*!*	Do CAUT_ALFA With 'RESPONS','NUME_2','RESPONSABIL',lc_variab
		*!*	SELECT introdc
		*!*	REPLACE nresp WITH lc_variab
		
		*!*	this.Refresh 
		
		*!*	locauta = thisform.do_cauta_alfa('Vnom_responsabili', 'nume', 'Numele responsabilului', 'Responsabil')
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Responsabili??cTipuriParteneri=>]+ALLTRIM(STR(gnIdTipResponsabili))+[??lAdaugCorespondente=>1]))
		SELECT introdc
		REPLACE nresp WITH locauta.denumire, id_responsabil WITH locauta.id_part
	ENDPROC

	PROCEDURE Gridb1.Column11.Text1.InteractiveChange
		*!*	PRIVATE lc_variab
		*!*	LC_VARIAB=''
		*!*	Do CAUT_ALFA With 'RESPONS','NUME_2','RESPONSABIL',lc_variab
		
		*!*	SELECT introdc
		*!*	REPLACE nresp WITH lc_variab
		
		*!*	this.refresh 
		
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column12.Text1.Click
		*!*	LOCAL lc_variab
		*!*	LC_VARIAB=''
		*!*	SELECT introdc
		*!*	IF !EMPTY(tcscc)
		*!*		Do CAUT_ALFA With 'chltind','DST_CHLT','DENUMIREA CHELTUIELII',lc_variab
		*!*	ELSE 
		*!*		Do CAUT_ALFA With 'venituri','DST_CHLT','DENUMIREA VENITULUI',lc_variab
		*!*	ENDIF 
		*!*	SELECT introdc 
		*!*	REPLACE DST_CHLT WITH lc_variab
		
		locauta = thisform.do_cauta_alfa('Vnom_venchel ', 'explicatie', 'Numele cheltuielii', 'Cheltuiala')
		SELECT introdc
		REPLACE dst_chlt WITH locauta.explicatie, id_venchelt WITH locauta.id_venchelt
	ENDPROC

	PROCEDURE Gridb1.Column12.Text1.InteractiveChange
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column13.Combo1.Valid
		*!*	modificare ROACONT v 2.4.0 : am inlocuit crsjtva cu crsjtax
		lnId = crsjtva.id_jtva_coloana
		lnPtva = crsjtva.cota_Tva
		Select introdc
		Replace id_jtva_coloana With lnId
		Replace ptva With lnPtva
		
		If Inlist(tn_idset,10460)
			Thisform.calculez(.T.)
		Else
			Thisform.calculez(.F.)
		ENDIF
		
		* Actualizez Cod Taxa SAFT in functie de Cota TVA
		Thisform.UpdateExplicatieSAFT()
	ENDPROC

	PROCEDURE Gridb1.Column14.Text1.Click
		IF EMPTY(id_partd) AND !EMPTY(scd)
			thisform.verific_partener('scd', 'id_partd', 'partd')
		ENDIF 
		
		
	ENDPROC

	PROCEDURE Gridb1.Column14.Text1.InteractiveChange
		thisform.verific_partener('scd', 'id_partd', 'partd')
		
		
		
	ENDPROC

	PROCEDURE Gridb1.Column14.Text1.LostFocus
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column15.Text1.Click
		IF EMPTY(id_partc) AND !EMPTY(scc)
			thisform.verific_partener('scc', 'id_partc', 'partc')
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column15.Text1.InteractiveChange
		thisform.verific_partener('scc', 'id_partc', 'partc')
		
		
	ENDPROC

	PROCEDURE Gridb1.Column15.Text1.LostFocus
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column16.Text1.DblClick
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Gridb1.Column16.Text1.InteractiveChange
		LOCAL lcSel
		lcSel = this.Parent.Parent.RecordSource
		SELECT (lcSel)
		SCATTER NAME oint
		*thisform.verific_inregistrari(0,oint,'this.gridb1')
		DO aleg_document_pereche WITH 0,oint,lcSel IN oOperatii_comune.prg
		this.Parent.Parent.SetFocus 
	ENDPROC

	PROCEDURE Gridb1.Column18.Text1.Click
		LOCAL loCauta
		locauta = caut_valuta(1,.f.,.t.)
		SELECT introdc
		REPLACE nume_val WITH locauta.nume_val, id_valuta WITH locauta.id_valuta
	ENDPROC

	PROCEDURE Gridb1.Column18.Text1.InteractiveChange
		this.Click 
	ENDPROC

	PROCEDURE Gridb1.Column19.Text1.LostFocus
		SELECT introdc
		REPLACE suma WITH ROUND(suma_val*curs,gnPC)
		If Inlist(tn_idset,10460)
			Thisform.calculez(.T.)
		Else
			Thisform.calculez(.F.)
		Endif
		
	ENDPROC

	PROCEDURE Gridb1.Column2.Header1.Click
		this.Parent.Parent.headerclick(this.Parent.ColumnOrder)
	ENDPROC

	PROCEDURE Gridb1.Column2.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Gridb1.Column20.Text1.LostFocus
		SELECT introdc
		REPLACE suma WITH ROUND(suma_val*curs,gnPC)
		If Inlist(tn_idset,10460)
			Thisform.calculez(.T.)
		Else
			Thisform.calculez(.F.)
		Endif
		
	ENDPROC

	PROCEDURE Gridb1.Column21.Text1.Click
		locauta = thisform.do_cauta_alfa('vnom_lucrari', 'nrord', 'Numele lucrarii', 'Lucrare')
		SELECT introdc
		REPLACE nrord WITH locauta.nrord, id_lucrare WITH locauta.id_lucrare
	ENDPROC

	PROCEDURE Gridb1.Column21.Text1.InteractiveChange
		this.Click
	ENDPROC

	PROCEDURE Gridb1.Column3.Header1.Click
		this.Parent.Parent.headerclick(this.Parent.ColumnOrder)
	ENDPROC

	PROCEDURE Gridb1.Column3.Text1.InteractiveChange
		SELECT introdc
		REPLACE id_partd WITH 0, partd WITH ''
		
		
		
		
	ENDPROC

	PROCEDURE Gridb1.Column3.Text1.LostFocus
		*llReturn = thisform.verific_cont(introdc.scd)
		lcCont = NVL(introdc.scd,'')
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			REPLACE introdc.scd WITH ''
		ENDIF 
		SELECT introdc 
		IF EMPTY(id_partd)
			thisform.verific_partener('scd', 'id_partd', 'partd')
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column4.Header1.Click
		this.Parent.Parent.headerclick(this.Parent.ColumnOrder)
	ENDPROC

	PROCEDURE Gridb1.Column4.Text1.InteractiveChange
		SELECT introdc
		REPLACE id_partc WITH 0, partc WITH ''
		
	ENDPROC

	PROCEDURE Gridb1.Column4.Text1.LostFocus
		*llReturn = thisform.verific_cont(introdc.scc)
		lcCont = NVL(introdc.scc,'')
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			REPLACE introdc.scc WITH ''
		ENDIF 
		SELECT introdc 
		IF EMPTY(id_partc)
			thisform.verific_partener('scc', 'id_partc', 'partc')
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.InteractiveChange
		*!*	IF scc='471 '
		*!*		DO aleg_doc_plata WITH 'chavans',M.NUME,.f.,'A'
		
		*!*		OPLATA=CREATEOBJECT('AFCUMPVANZANPERALES')
		*!*		oplata.txtNume.controlsource='m.nume'
		*!*		OPLATA.SHOW(1)
		
		*!*		SELECT INTRODC
		*!*		LOCATE FOR scc='471 '
		*!*		REPLACE SUMA WITH m.suma
		*!*	ENDIF 
		
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF NKEYCODE=13   &&ENTER
			PlClick=.f.
			IF LEFT(introdc.scd,1) # '6' AND LEFT(introdc.scc,1) # '7'
				NODEFAULT 
				KEYBOARD '{DNARROW}'
			ENDIF 
		
		ENDIF
		
		
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.LostFocus
		IF !EMPTY(introdc.suma)
			IF EMPTY(introdc.id_partd) AND !EMPTY(introdc.scd)
				thisform.verific_partener('scd', 'id_partd', 'partd')
			ENDIF
			IF EMPTY(introdc.id_partc) AND !EMPTY(introdc.scc)
				thisform.verific_partener('scc', 'id_partc', 'partc')
			ENDIF
		ENDIF 
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.RightClick
		Local laCoteTVA[1], lcMenu, lnCota, lnCotaTva, lnCote, lnOptiune
		
		Select Distinct cota_tva From crsjtva Where !Empty(Nvl(cota_tva, 0)) Order By cota_tva Desc Into Array laCoteTVA
		
		lnCote = _Tally
		If m.lnCote > 0
			lcMenu = [\Calculeaza baza]
			For lnCota = 1 To m.lnCote
				lnCotaTva = m.laCoteTVA[m.lnCota]
				lcMenu = m.lcMenu + ';' + Alltrim(Str(Int(m.lnCotaTva))) + '%'
			Endfor
		
			lnOptiune = xmenu(m.lcMenu)
			If m.lnOptiune = 0
				Return
			Endif
		
			lnCota = m.lnOptiune - 1
			lnCotaTva = m.laCoteTVA[m.lnCota]
			SELECT introdc
			Replace suma With Round(suma * 100 / (100 + m.lnCotaTva), m.gnPA) 
			this.Refresh()
		Endif
		
		
	ENDPROC

	PROCEDURE Gridb1.Column5.Text1.Valid
		Select introdc
		If (Empty(introdc.scd) Or Upper(Left(introdc.scd,1))='X') And !Empty(introdc.suma)
			amessagebox("Completati contul debitor !",0+48,"Atentie")
			Return
		Endif
		If Empty(introdc.scc) Or Upper(Left(introdc.scc,1))='X' And !Empty(introdc.suma)
			amessagebox("Completati contul creditor !",0+48,"Atentie")
			Return
		Endif
		
		If Inlist(tn_idset,10460)
			Thisform.calculez(.T.)
		Else
			Thisform.calculez(.F.)
		Endif
		
		*	thisform.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Gridb1.Column6.Check1.Valid
		SELECT introdc
		thisform.calculez()
		
	ENDPROC

	PROCEDURE Gridb1.Column7.Text1.Click
		*thisform.aleg_ascd()
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Gridb1.Column7.Text1.LostFocus
		PARAMETERS PlClick
		SELECT introdc
		lcCont = scd
		lcAcont = ascd
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascd','introdc') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Gridb1.Column8.Text1.Click
		*THISFORM.ALEG_ASCC
		this.LostFocus(.t.) 
	ENDPROC

	PROCEDURE Gridb1.Column8.Text1.LostFocus
		PARAMETERS PlClick
		SELECT introdc
		lcCont = scc
		lcAcont = ascc
		IF EMPTY(lcCont)
			RETURN
		ENDIF 
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascc','introdc') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Gridb1.Column9.Text1.DblClick
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Gridb1.Column9.Text1.InteractiveChange
		LOCAL lcSel
		lcSel = this.Parent.Parent.RecordSource
		SELECT (lcSel)
		SCATTER NAME oint
		*thisform.verific_inregistrari(1,oint,'this.gridb1')
		DO aleg_document_pereche WITH 1,oint,lcSel IN oOperatii_comune.prg
		
		this.Parent.Parent.SetFocus 
	ENDPROC

	PROCEDURE Gridb1.gasestecol
		Parameters ii
		*
	ENDPROC

	PROCEDURE Gridb1.headerclick
		PARAMETERS co
		*
	ENDPROC

	PROCEDURE Gridb1.iesire
		PARAMETERS Y
		*
	ENDPROC

	PROCEDURE Gridb1.Init
		*
	ENDPROC

	PROCEDURE Gridb1.treaba
		*
	ENDPROC

	PROCEDURE Item1.Text_item1.GotFocus
		*
	ENDPROC

	PROCEDURE Item1.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE Item1.Text_item1.LostFocus
		SELECT introdc
		LOCATE 
		thisform.calculez(.f.)
	ENDPROC

	PROCEDURE Item1.Text_item1.Valid
		*THIS.FORECOLOR=IIF(thisform.totftva>=0, RGB(0,0,0), RGB(255,0,0))
	ENDPROC

	PROCEDURE Item1.Text_item1.When
		*
	ENDPROC

	PROCEDURE itmAchizitor.Text_item1.GotFocus
		*!* CautPartenerContabilitate
		lcCont = [542]
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti achizitorul??lAdaugCorespondente=>1??cCont=>] + lcCont))
		If !Empty(loCauta.denumire)
			Thisform.achi = Alltrim(loCauta.denumire)
			Thisform.id_achi = loCauta.id_part
		Endif
		
		*!*	pcselect = ['select p.nume, p.cod_fiscal, p.id_part FROM ] + gcs + [.Vcoresp_tip_part p  JOIN ] + GCS + [.Vcoresp_tip_cont t on p.id_tip_part = t.id_tip_part where to_number(t.cont) = 542 ']
		*!*	pcfiltru = [1=2]
		*!*	pcschema = ['']
		*!*	pcorder = [P.NUME]
		*!*	pccoloane = [NUME,COD_FISCAL]
		*!*	pcTitlu = [Numele achizitorului]
		*!*	pcTitluColoane = [Nume,Cod fiscal]
		*!*	locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane,'')
		*!*	Thisform.achi = Alltrim(locauta.denumire)
		*!*	Thisform.id_achi = locauta.id_part
	ENDPROC

	PROCEDURE itmAchizitor.Text_item1.LostFocus
		*this.Refresh 
	ENDPROC

	PROCEDURE itmAchizitor.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE itmAchizitor.Text_item1.When
		*
	ENDPROC

	PROCEDURE itmCasaPlati.Text_item1.GotFocus
		lcCont = [5311]
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti casa??lAdaugCorespondente=>1??cCont=>] + lcCont))
		If !Empty(loCauta.denumire)
			Thisform.casa = Alltrim(locauta.denumire)
			Thisform.id_casa = locauta.id_part
		Endif
		
		*!*	pcselect = ['select p.nume, p.cod_fiscal, p.id_part FROM ] + gcs + [.Vcoresp_tip_part p  JOIN ] + gcs + [.Vcoresp_tip_cont t on p.id_tip_part = t.id_tip_part where to_number(t.cont) = 5311 ']
		*!*	pcfiltru = [1=2]
		*!*	pcschema = ['']
		*!*	pcorder = [P.NUME]
		*!*	pccoloane = [NUME]
		*!*	pcTitlu = [Casa]
		*!*	pcTitluColoane = [Casa]
		*!*	locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane,'')
		
		*!*	If Empty(locauta.nume)
		*!*		Thisform.casa = Alltrim(locauta.nume)
		*!*		Thisform.id_casa = locauta.id_part
		*!*	Endif
	ENDPROC

	PROCEDURE itmCasaPlati.Text_item1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		*
	ENDPROC

	PROCEDURE itmCasaPlati.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE itmCasaPlati.Text_item1.When
		*
	ENDPROC

	PROCEDURE itmCreditorDivers.Text_item1.GotFocus
		*!* CautPartenerContabilitate
		lcCont = [462]
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Alegeti creditorul??lAdaugCorespondente=>1??cCont=>] + lcCont))
		If !Empty(loCauta.denumire)
			Thisform.part462 = Alltrim(loCauta.denumire)
			Thisform.id_part462 = loCauta.id_part
		Endif
		
	ENDPROC

	PROCEDURE itmCreditorDivers.Text_item1.LostFocus
		*this.Refresh 
	ENDPROC

	PROCEDURE itmCreditorDivers.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE itmCreditorDivers.Text_item1.When
		*
	ENDPROC

	PROCEDURE itmDocJustificat.Text_item1.GotFocus
		*!* 27.03.2014
		*!* marius.mutu
		*!* suma platita de achizitor = suma partiala/totala modificata de utilizator
		
		lcContul = '542'
		&&	modificare 2.0.131 : am adaugat gcCondSucursala
		lccond = [ an = ] + ALLTRIM(STR(gnAn)) + [ and luna = ] + ALLTRIM(STR(gnluna)) + gcCondSucursala
		lccond= lccond + [ and (i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit = 0) ]
		
		
		lnIdPart = THISFORM.id_achi
		lcNume = THISFORM.achi
		lnFelCont = 0
		lcDenumire = 'Achizitor'
		
		pcselect = ['select i.* FROM ] + gcs + [.Vireg_parteneri i where 2=2 ']
		pcfiltru = [ i.id_part = ] + ALLTRIM(STR(lnIdPart)) + [ AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont =]+ lcContul + [ and ] + lccond
		pcschema = ['']
		pcorder = ['']
		
		PRIVATE podateintrod
		STORE '' TO podateintrod
		
		gencursor('podateintrod','crs_actcv',pcselect,pcfiltru,[''],'')
		
		lcFis = 'actcv' + ALLTRIM(lcContul)
		
		IF USED(lcFis)
			USE IN &lcFis
		ENDIF
		
		IF lnFelCont = 0
			lcsel = [SELECT *, ACONT AS ASCC, nume_val as numeval, curs as cursschimb, precdeb + debit as totctva, preccred+credit as achitat, ] +;
				[precvaldeb + valdebit AS sumaval, precVALcred+VALcredit as achitatval, ] +;
				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 0000000.0000 as cursval, 0000000.0000 as cursdif ] +;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ELSE
			lcsel = [SELECT *, ACONT AS ASCD, nume_val as numeval, curs as cursschimb, preccred + credit as totctva, precdeb+debit as achitat, ] + ;
				[precvalcred + valcredit as sumaval, precVALdeb+VALdebit as achitatval, ] + ;
				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 0000000.0000 as cursval, 0000000.0000 as cursdif ] + ;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ENDIF
		&lcsel
		
		SELECT (lcFis)
		
		OPLATA=CREATEOBJECT('ocompensari')
		OPLATA.titlufrumos1.CAPTION = lcDenumire + [: ] + lcNume
		OPLATA.pcFis = lcFis
		*!*	OPLATA.suma = THISFORM.totctva
		OPLATA.suma = thisform.sumaachitata
		IF TYPE('oplata.curs_val') # 'U'
			OPLATA.curs_val = 0
		ENDIF
		OPLATA.pnFelCont = lnFelCont
		OPLATA.SHOW(1)
		
		SELECT (lcFis)
		CALCULATE CNT() FOR ales TO LnBife
		IF LnBife=1
			LOCATE FOR ales
			m.compensat=nract
		ELSE
			m.compensat=0
		ENDIF
		
	ENDPROC

	PROCEDURE itmDocJustificat.Text_item1.LostFocus
		*
	ENDPROC

	PROCEDURE itmDocJustificat.Text_item1.Valid
		*
	ENDPROC

	PROCEDURE itmDocJustificat.Text_item1.When
		*
	ENDPROC

	PROCEDURE itmFdocAchitat.Text_item1.GotFocus
		Local llNou, llToateIreg, loCauta
		llToateIreg = .F.
		llNou = .T.
		loCauta = caut_fdoc(m.llToateIreg, m.llNou)
		
		If !Empty(NVL(loCauta.fel_document,''))
			Thisform.cFdocAchitat = Alltrim(loCauta.fel_document)
			Thisform.nIdFdocAchitat = loCauta.id_fdoc
		Endif
	ENDPROC

	PROCEDURE itmFdocAchitat.Text_item1.LostFocus
		*this.Refresh 
	ENDPROC

	PROCEDURE itmFdocAchitat.Text_item1.Valid
		*
		
	ENDPROC

	PROCEDURE itmFdocAchitat.Text_item1.When
		*
	ENDPROC

	PROCEDURE optAchitat.Valid
		thisform.RefreshAchitat()
	ENDPROC

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

	PROCEDURE Terminat1.Command1.Click
		
		IF thisform.verificare()
			DODEFAULT()
		ENDIF 
		
	ENDPROC

	PROCEDURE Verif1.COMMAND1.Click
		If Thisform.verificare()
			Do Form verificare With .T.,.T.
			If BUTON=1
				Thisform.Release
			Endif
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_note AS formtermin OF "..\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="Pageframe1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column11.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column18.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column18.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_SHAPE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Help1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Renunt1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: aleg_document_pereche
		*m: calcul_data
		*m: calcul_suma
		*m: do_caut_nomenclator
		*m: verificare
		*m: verific_analitic
		*p: introducere_libera
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 411
		introducere_libera = .F.
		Name = "frm_note"
		Width = 790
		Shape1.Height = 36
		Shape1.Left = 0
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 792
		Shape1.ZOrderSet = 0
		Terminat1.Command1.Name = "Command1"
		Terminat1.Imbuton1.Height = 29
		Terminat1.Imbuton1.Name = "Imbuton1"
		Terminat1.Imbuton1.Width = 27
		Terminat1.Left = 757
		Terminat1.Name = "Terminat1"
		Terminat1.Top = 3
		Terminat1.ZOrderSet = 7
		Titlufrumos1.Caption = "NOTE FARA PREDEFINIRE"
		Titlufrumos1.Height = 30
		Titlufrumos1.Left = 9
		Titlufrumos1.Name = "Titlufrumos1"
		Titlufrumos1.Top = 6
		Titlufrumos1.Width = 364
		Titlufrumos1.ZOrderSet = 1
	*</PropValue>

	ADD OBJECT '_SHAPE1' AS _shape WITH ;
		BackColor = 255,255,255, ;
		Height = 36, ;
		Left = 684, ;
		Name = "_SHAPE1", ;
		Top = 0, ;
		Width = 107, ;
		ZOrderSet = 4
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Help1' AS help WITH ;
		Left = 691, ;
		Name = "Help1", ;
		Top = 3, ;
		ZOrderSet = 5, ;
		Imbuton1.Name = "Imbuton1", ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Pageframe1' AS pageframe WITH ;
		ErasePage = .T., ;
		Height = 349, ;
		Left = 7, ;
		Name = "Pageframe1", ;
		PageCount = 3, ;
		TabStyle = 1, ;
		Top = 48, ;
		Width = 778, ;
		ZOrderSet = 2, ;
		Page1.BackColor = 255,255,255, ;
		Page1.Caption = "Note-Sume", ;
		Page1.Name = "Page1", ;
		Page2.BackColor = 240,240,240, ;
		Page2.Caption = "Date", ;
		Page2.Name = "Page2", ;
		Page3.BackColor = 228,228,228, ;
		Page3.Caption = "Explicatii", ;
		Page3.Name = "Page3"
		*< END OBJECT: BaseClass="pageframe" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1' AS gridb WITH ;
		ColumnCount = 10, ;
		FontName = "Arial Narrow", ;
		GridLineColor = 255,255,255, ;
		GridLines = 3, ;
		HeaderHeight = 25, ;
		Height = 260, ;
		Left = 5, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordMark = .T., ;
		RecordSource = "actactan", ;
		RowHeight = 22, ;
		Top = 11, ;
		Width = 763, ;
		COLUMN1.Alignment = 2, ;
		COLUMN1.BackColor = 245,245,245, ;
		COLUMN1.ControlSource = "nrcrt()", ;
		COLUMN1.DynamicBackColor = "RGB(245,245,245)", ;
		COLUMN1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Caption = "Nr.", ;
		COLUMN1.Header1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Name = "Header1", ;
		COLUMN1.Name = "COLUMN1", ;
		COLUMN1.ReadOnly = .F., ;
		COLUMN1.Text1.Alignment = 2, ;
		COLUMN1.Text1.BackColor = 245,245,245, ;
		COLUMN1.Text1.FontName = "Arial Narrow", ;
		COLUMN1.Text1.Name = "Text1", ;
		COLUMN1.Text1.ReadOnly = .F., ;
		COLUMN1.Width = 37, ;
		Column2.Alignment = 1, ;
		Column2.BackColor = 247,245,238, ;
		Column2.ControlSource = "scd", ;
		Column2.DynamicBackColor = "RGB(247,245,238)", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Format = "XXXX.", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 59, ;
		Column3.Alignment = 0, ;
		Column3.BackColor = 247,245,238, ;
		Column3.ControlSource = "ascd", ;
		Column3.DynamicBackColor = "RGB(247,245,238)", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .F., ;
		Column3.Width = 53, ;
		Column4.Alignment = 1, ;
		Column4.BackColor = 226,226,226, ;
		Column4.ControlSource = "scc", ;
		Column4.DynamicBackColor = "RGB(226,226,226)", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Format = "XXXX.", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .F., ;
		Column4.Width = 63, ;
		Column5.Alignment = 0, ;
		Column5.BackColor = 226,226,226, ;
		Column5.ControlSource = "ascc", ;
		Column5.DynamicBackColor = "RGB(226,226,226)", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .F., ;
		Column5.Width = 49, ;
		Column6.BackColor = 214,214,214, ;
		Column6.ControlSource = "suma", ;
		Column6.DynamicBackColor = "rgb(214,214,214)", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.InputMask = (get_mask(12,gnPa)), ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .F., ;
		Column6.Width = 114, ;
		Column7.BackColor = 214,214,214, ;
		Column7.ColumnOrder = 7, ;
		Column7.ControlSource = "suma_val", ;
		Column7.DynamicBackColor = "rgb(214,214,214)", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.InputMask = (get_mask(12,gnPval)), ;
		Column7.Name = "Column8", ;
		Column7.ReadOnly = .F., ;
		Column7.Width = 87, ;
		Column8.BackColor = 214,214,214, ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "curs", ;
		Column8.DynamicBackColor = "rgb(214,214,214)", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.InputMask = (get_mask(12,gnPcurs)), ;
		Column8.Name = "Column9", ;
		Column8.ReadOnly = .F., ;
		Column8.Width = 76, ;
		Column9.BackColor = 214,214,214, ;
		Column9.ColumnOrder = 9, ;
		Column9.ControlSource = "nume_val", ;
		Column9.CurrentControl = "Text1", ;
		Column9.DynamicBackColor = "rgb(214,214,214)", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Name = "Column10", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 112, ;
		Column10.Alignment = 0, ;
		Column10.BackColor = 214,214,214, ;
		Column10.ColumnOrder = 10, ;
		Column10.ControlSource = "descriere", ;
		Column10.CurrentControl = "Combo1", ;
		Column10.DynamicBackColor = "rgb(214,214,214)", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.Name = "Column11", ;
		Column10.ReadOnly = .F., ;
		Column10.Sparse = .F., ;
		Column10.Width = 72
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column11.Combo1' AS combobox WITH ;
		Alignment = 0, ;
		BorderStyle = 0, ;
		BoundColumn = 2, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "100,68", ;
		Height = 24, ;
		Left = 32, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "cote_tva2.descriere,proc_tva", ;
		RowSourceType = 2, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		Top = 44, ;
		Width = 100
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column11.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont debitor", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column2.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 247,245,238, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic D", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column3.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 247,245,238, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont creditor ", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column4.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 226,226,226, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic C", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma in valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Curs valutar", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Pageframe1.Page1.Nou1' AS nou WITH ;
		Left = 16, ;
		Name = "Nou1", ;
		Top = 279, ;
		Imbuton1.Height = 29, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 27, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Pageframe1.Page1.Sterge1' AS sterge WITH ;
		Left = 52, ;
		Name = "Sterge1", ;
		Top = 279, ;
		Imbuton1.Height = 26, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 26, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1' AS gridb WITH ;
		BackColor = 240,240,240, ;
		ColumnCount = 9, ;
		FontName = "Arial Narrow", ;
		GridLineColor = 255,255,255, ;
		HeaderHeight = 26, ;
		Height = 297, ;
		Left = 11, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordMark = .T., ;
		RecordSource = "actactan", ;
		RowHeight = 23, ;
		Top = 11, ;
		Width = 753, ;
		COLUMN1.BackColor = 240,240,240, ;
		COLUMN1.ControlSource = "nrcrt()", ;
		COLUMN1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Caption = "Nr.", ;
		COLUMN1.Header1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Name = "Header1", ;
		COLUMN1.Name = "COLUMN1", ;
		COLUMN1.ReadOnly = .T., ;
		COLUMN1.Text1.BackColor = 240,240,240, ;
		COLUMN1.Text1.FontName = "Arial Narrow", ;
		COLUMN1.Text1.Name = "Text1", ;
		COLUMN1.Text1.ReadOnly = .T., ;
		COLUMN1.Width = 24, ;
		Column2.BackColor = 240,240,240, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "fdoc", ;
		Column2.CurrentControl = "Text1", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 105, ;
		Column3.BackColor = 240,240,240, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "dataireg", ;
		Column3.CurrentControl = "Text1", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .F., ;
		Column3.Sparse = .F., ;
		Column3.Width = 83, ;
		Column4.BackColor = 240,240,240, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "dataact", ;
		Column4.CurrentControl = "Text1", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .F., ;
		Column4.Sparse = .F., ;
		Column4.Width = 87, ;
		Column5.BackColor = 240,240,240, ;
		Column5.ColumnOrder = 5, ;
		Column5.ControlSource = "datascad", ;
		Column5.CurrentControl = "Text1", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .F., ;
		Column5.Sparse = .F., ;
		Column5.Width = 83, ;
		Column6.BackColor = 240,240,240, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "nract", ;
		Column6.CurrentControl = "Text1", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .F., ;
		Column6.Sparse = .F., ;
		Column7.BackColor = 240,240,240, ;
		Column7.ColumnOrder = 7, ;
		Column7.ControlSource = "pereched", ;
		Column7.CurrentControl = "Text1", ;
		Column7.DynamicBackColor = "", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .F., ;
		Column7.Sparse = .F., ;
		Column7.Width = 68, ;
		Column8.BackColor = 240,240,240, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "nnir", ;
		Column8.CurrentControl = "Text1", ;
		Column8.DynamicBackColor = "", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .F., ;
		Column8.Sparse = .F., ;
		Column9.BackColor = 240,240,240, ;
		Column9.ColumnOrder = 8, ;
		Column9.ControlSource = "perechec", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 71
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel document", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column2.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data inregistrarii", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column3.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data document", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column4.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data scadenta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column5.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. document", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column6.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pereche Debit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column7.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. NIR/BON", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column8.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pereche Credit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Pageframe1.Page3.Gridb1' AS gridb WITH ;
		BackColor = 228,228,228, ;
		ColumnCount = 9, ;
		FontName = "Arial Narrow", ;
		GridLineColor = 255,255,255, ;
		HeaderHeight = 25, ;
		Height = 298, ;
		Left = 7, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordMark = .T., ;
		RecordSource = "actactan", ;
		RowHeight = 23, ;
		Top = 10, ;
		Width = 759, ;
		COLUMN1.BackColor = 228,228,228, ;
		COLUMN1.ColumnOrder = 1, ;
		COLUMN1.ControlSource = "nrcrt()", ;
		COLUMN1.DynamicBackColor = "rgb(228,228,228)", ;
		COLUMN1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.BackColor = 228,228,228, ;
		COLUMN1.Header1.Caption = "Nr.", ;
		COLUMN1.Header1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Name = "Header1", ;
		COLUMN1.Name = "COLUMN1", ;
		COLUMN1.ReadOnly = .T., ;
		COLUMN1.Text1.BackColor = 228,228,228, ;
		COLUMN1.Text1.FontName = "Arial Narrow", ;
		COLUMN1.Text1.Name = "Text1", ;
		COLUMN1.Text1.ReadOnly = .T., ;
		COLUMN1.Width = 21, ;
		Column2.BackColor = 228,228,228, ;
		Column2.ColumnOrder = 5, ;
		Column2.ControlSource = "nrord", ;
		Column2.CurrentControl = "Text1", ;
		Column2.DynamicBackColor = "rgb(228,228,228)", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column7", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 95, ;
		Column3.BackColor = 228,228,228, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "nresp", ;
		Column3.CurrentControl = "Text1", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column8", ;
		Column3.ReadOnly = .F., ;
		Column3.Width = 110, ;
		Column4.BackColor = 228,228,228, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "dst_chlt", ;
		Column4.CurrentControl = "Text1", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column9", ;
		Column4.ReadOnly = .F., ;
		Column4.Sparse = .F., ;
		Column4.Width = 108, ;
		Column5.BackColor = 228,228,228, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "sectie", ;
		Column5.CurrentControl = "Text1", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column10", ;
		Column5.ReadOnly = .F., ;
		Column5.Width = 96, ;
		Column6.BackColor = 228,228,228, ;
		Column6.ColumnOrder = 4, ;
		Column6.ControlSource = "explicatia", ;
		Column6.DynamicBackColor = "rgb(226,226,226)", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Format = "k!", ;
		Column6.Name = "Column14", ;
		Column6.ReadOnly = .F., ;
		Column6.Width = 110, ;
		Column7.BackColor = 228,228,228, ;
		Column7.ColumnOrder = 2, ;
		Column7.ControlSource = "partd", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "Column17", ;
		Column7.ReadOnly = .F., ;
		Column7.Width = 105, ;
		Column8.BackColor = 228,228,228, ;
		Column8.ColumnOrder = 3, ;
		Column8.ControlSource = "partc", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "Column18", ;
		Column8.ReadOnly = .F., ;
		Column8.Width = 105, ;
		Column9.BackColor = 228,228,228, ;
		Column9.ControlSource = "sucursala", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Name = "Column2", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 95
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column10.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 226,226,226, ;
		Caption = "Explicatia", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column14.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 226,226,226, ;
		Caption = "Partener Debit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column17.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column18.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 226,226,226, ;
		Caption = "Partener Credit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column18.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 228,228,228, ;
		Caption = "Contract/Lucrare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column7.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 228,228,228, ;
		Caption = "Responsabil", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column8.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 228,228,228, ;
		Caption = "Cheltuiala/Venit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column9.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Renunt1' AS renunt WITH ;
		Left = 724, ;
		Name = "Renunt1", ;
		Top = 3, ;
		ZOrderSet = 6, ;
		Imbuton1.Height = 27, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 30, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackColor = 0,128,255, ;
		Height = 24, ;
		Left = 624, ;
		Name = "Shape2", ;
		Top = 7, ;
		Visible = .F., ;
		Width = 49, ;
		ZOrderSet = 3
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE aleg_document_pereche
		PARAMETERS tcFel,toAct
		LOCAL lcSel,lcSelAct
		lcSelAct = this.pageframe1.paGE2.gridb1.RecordSource
		pnFelCont = tcFel
		
		IF pnFelCont = 0                  && ACTIV
			pcContul = ALLTRIM(NVL(toAct.scc,[]))
			pcACont = ALLTRIM(NVL(toAct.ascc,[NULL]))
			pnIdPart = NVL(toAct.Id_partc,0)
			pcNume = ALLTRIM(NVL(toAct.partc,[]))
			pnPereche = [perecheC]
			pnIdPereche = [id_factC]
		ELSE                               && PASIV
			pcContul = ALLTRIM(NVL(toAct.scd,[]))
			pcACont = ALLTRIM(NVL(toAct.ascd,[NULL]))
			pnIdPart = NVL(toAct.Id_partd,0)
			pcNume = ALLTRIM(NVL(toAct.partd,[]))
			pnPereche = [perecheD]
			pnIdPereche = [id_factD]
		ENDIF 
		
		lcSelect = [select count(*) as ePereche from ] + gcs + [.vcoresp_tip_cont where cont = ?pcContul and fel_cont = ?pnFelCont and cu_inregistrari = 1 ]
		lcCursor = [crsTest]
		lnSucces = goexecutor.oExecute(lcSelect,lcCursor)
		IF lnSucces < 0
			aMESSAGEBOX('Modificare:Verific existenta pereche ' +goExecutor.cEroare,0+16,"Eroare")
			SELECT (lcSelAct)
			this.pageframe1.paGE2.gridb1.SetFocus 
			RETURN 
		ENDIF 
		
		SELECT crsTest
		LOCATE 
		IF ePereche = 0
			USE IN crsTest
			SELECT (lcSelAct)
			this.pageframe1.paGE2.gridb1.SetFocus 
			RETURN
		ENDIF 
		
		
		IF !EMPTY(toAct.Suma_val)
			llval = .t.
			pnSuma = toAct.Suma_val
			lcFormular = [ocompensari_val]
		ELSE 
			llval = .f.
			pnSuma = toAct.Suma
			lcFormular = [ocompensari]
		ENDIF 
		pnIdValuta = toAct.Id_Valuta
		pcDenumire = [Partener ] + pcContul 
		
		pcCond = [ an = ?gnAn and luna = ?gnluna]
		
		IF llval
			pccond= pccond + [ and ABS(i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit)>0 and i.id_valuta = ?pnIdValuta ]
		ELSE
			pccond= pccond + [ and (i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit = 0) ]
		ENDIF
		
		pcselect = ['select i.* FROM ] + gcs + [.Vireg_parteneri i where 2=2 ']
		IF ALLTRIM(pcACont) # [NULL]
			pcfiltru = [ i.id_part = ?pnIdPart AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont = ?pcContul and ] + pcCond
		ELSE
			pcfiltru = [ i.id_part = ?pnIdPart AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont = ?pcContul and acont is null and ] + pcCond
		ENDIF 
		pcschema = ['']
		pcorder = ['']
		
		PRIVATE podateintrod
		STORE '' TO podateintrod
		
		gencursor('podateintrod','crs_actcv',pcselect,pcfiltru,[''],'')
		
		lcFis = 'actcv' + ALLTRIM(pcContul)
		
		IF USED(lcFis)
			USE IN &lcFis
		ENDIF
		
		IF pnFelCont = 0
			lcsel = [SELECT *, ACONT AS ASCC, nume_val as numeval, curs as cursschimb, precdeb + debit as totctva, preccred+credit as achitat, ] +;
				[precvaldeb + valdebit AS sumaval, precVALcred+VALcredit as achitatval, ] +;
				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 000000.0000 as cursval, 000000.0000 as cursdif ] +;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ELSE
			lcsel = [SELECT *, ACONT AS ASCD, nume_val as numeval, curs as cursschimb, preccred + credit as totctva, precdeb+debit as achitat, ] + ;
				[precvalcred + valcredit as sumaval, precVALdeb+VALdebit as achitatval, ] + ;
				[.f. as ales, 00000000000000.0000 as sumaachi, 00000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 000000.0000 as cursval, 000000.0000 as cursdif ] + ;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ENDIF
		&lcsel
		
		USE IN crs_actcv
		SELECT (lcFis)
		
		OPLATA=CREATEOBJECT(lcFormular)
		OPLATA.titlufrumos1.CAPTION = pcDenumire + [: ] + pcNume
		OPLATA.pcFis = lcFis
		OPLATA.SUMA = pnSuma
		OPLATA.pnFelCont = pnFelCont
		OPLATA.SHOW(1)
		
		IF gnButon = 1
			SELECT (lcSelAct)
			DELETE 
			SELECT (lcFis)
			SCAN FOR ales
				SCATTER NAME oper
				SELECT (lcSelAct)
				APPEND BLANK 
				GATHER NAME toAct
				REPLACE &pnIdPereche WITH oper.id_fact, &pnPereche WITH oper.nract, suma WITH oper.sumaachi, suma_val WITH oper.sumaachi2
				SELECT (lcFis)
			ENDSCAN 
		ELSE 
			SELECT (lcSelAct)
			REPLACE &pnPereche WITH toact.&pnPereche 
		ENDIF 
		
		IF USED(lcFis)
			USE IN (lcFis)
		ENDIF 
		SELECT (lcSelAct)
		DO nrord WITH lcSelAct
		this.pageframe1.paGE2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE calcul_data
		PARAMETERS tcControl
		LOCAL ll_verif
		STORE .f. to ll_verif 
		lcControl = ALLTRIM(tcControl)
		
		DO CASE 
		Case UPPER(ALLTRIM(lcControl))='ACTACTAN.DATASCAD'
			ld_DataScad = GOMONTH(dataact,1)
			SELECT ACTACTAN
			REPLACE DATASCAD WITH LD_DATASCAD
			
		Case UPPER(ALLTRIM(lcControl))='ACTACTAN.DATAIREG'
			If !(Month(dataireg)= gnLuna And Year(dataireg) = gnAn)
				Do mesaj With 'Data trebuie sa fie din luna',Alltrim(pcNl)+' '+Alltrim(pcAn)
				ll_verif=.t.
			ELSE 
				ll_verif=.f.
				SELECT ACTACTAN
				REPLACE dataact WITH dataireg 
			ENDIF
		
		Case UPPER(ALLTRIM(lcControl))='ACTACTAN.DATAACT'
			If !((Month(DATAACT)<= gnLuna And Year(DATAACT)=gnAn) Or Year(DATAACT)<gnAn)
				Do mesaj With 'Data trebuie sa fie inainte sau in luna',Alltrim(pcnl)+' '+Alltrim(pcan)
				ll_verif=.t.
			ELSE 
				ll_verif=.f.
			ENDIF 
		
			LD_DATASCAD=GOMONTH(dataact,1)
			SELECT ACTACTAN
			REPLACE DATASCAD WITH LD_DATASCAD
		ENDCASE 
		
		RETURN ll_verif
	ENDPROC

	PROCEDURE calcul_suma
	ENDPROC

	PROCEDURE do_caut_nomenclator
		PARAMETERS tcFis, tcNume, tcId, tcTitlu
		
		pcselect = [select ] + tcNume + [,] + tcId + [ from ] + tcFis
		pcfiltru = [1=2]
		pcschema = []
		pcorder = tcNume
		pccoloane = tcNume
		pcTitlu = tcTitlu 
		locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitlu, tcFis) && 11.07.2007
		
		RETURN locauta
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode = 13 AND nShiftAltCtrl = 2
			this.introducere_libera  = !this.introducere_libera
			this.shape2.Visible = !this.shape2.Visible
		ENDIF 
	ENDPROC

	PROCEDURE Load
		SET SAFETY OFF
		
		d=Date()
		LD_DATAireg=d
		If Month(Date())<>gnLuna Or Year(Date())<>gnAn
			LD_dataireg=ultimazi()
		ENDIF
		
		SELECT ACTACTAN
		ZAP
		APPEND BLANK 
		REPLACE dataireg WITH LD_dataireg, dataact WITH LD_dataireg
		DO nrord WITH "actactan"
		
		
		
		
		
		
	ENDPROC

	PROCEDURE verificare
		LOCAL compl,TE
		TE=''
		compl=.t.
		
		SELECT ACTACTAN
		ii=1
		SCAN		
			lcScd = scd
			lcScc = scc
			IF empty(suma)
				compl=.f.
				TE=TE+','+'suma'
			ENDIF
		*!* la clasele 8 si 9 se poate sa nu fie contul corespondent completat
			IF empty(scd) AND !INLIST(LEFT(NVL(scc,''),1),'8','9')
				compl=.f.
			TE=TE+','+'contul debitor'
			ENDIF
			IF empty(scc) AND !INLIST(LEFT(NVL(scd,''),1),'8','9')
				compl=.f.
			TE=TE+','+'contul creditor'
			ENDIF
			IF empty(nract)
				compl=.f.
			TE=TE+','+'nr.document'
			ENDIF
			IF (!EMPTY(suma_val) OR !EMPTY(curs)) AND EMPTY(id_valuta)
				compl=.f.
				TE=TE+','+'nume valuta'
			ENDIF
			
			IF !compl
				DO mesaj WITH 'La nota nr. '+ALLTRIM(STR(ii))+' nu ati completat campurile:',LEFT(te,60)+'...'
				RETURN compl 
			ENDIF
			ii=ii+1
		ENDSCAN
		
		
		RETURN compl  
	ENDPROC

	PROCEDURE verific_analitic
		*!*	PARAMETERS tlClick, tccont, tcacont, tcColoana
		
		*!*	m.den=''
		*!*	ll_l=.f.
		
		*!*	IF EMPTY(tccont)
		*!*		RETURN ll_l
		*!*	ENDIF 
		
		*!*	IF USED('TCEVA')
		*!*		USE IN Tceva
		*!*	ENDIF
		
		*!*	lcSql=[select acont || ' - ' || explicatie as den, CONT, ACONT FROM ] + gcS + [.vplcont_ANALITIC where to_number(cont) = ] + tcCont + [ and inactiv = 0 and an = ] + pcAn + [ order by acont ]
		*!*	lcCursor = 'tceva'
		*!*	lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		
		*!*	SELECT tceva
		*!*	LOCATE 
		*!*	IF EOF()
		*!*		IF !EMPTY(tcAcont) AND !ISNULL(tcAcont)
		*!*			DO mesaj WITH 'Nu au fost definite simboluri analitice','pentru contul ' + tcCont
		*!*			ll_l=.t.
		*!*		ENDIF 
		*!*		
		*!*		IF USED('TCEVA')
		*!*			USE IN Tceva 
		*!*		ENDIF 
		*!*		SELECT actactan 
		*!*		this.pageframe1.page1.gridb1.SetFocus 
		*!*		RETURN ll_l
		*!*	ELSE 
		*!*		IF !tlClick
		*!*			IF empty(tcAcont)
		*!*				IF USED('TCEVA')
		*!*					USE IN Tceva 
		*!*				ENDIF 
		*!*				SELECT actactan 
		*!*				this.pageframe1.page1.gridb1.SetFocus 
		*!*				RETURN ll_l
		*!*			ENDIF 
		*!*		ENDIF 
		*!*	ENDIF
		
		*!*	SELECT tceva
		*!*	IF tlClick
		*!*		DO caut_alfa_cursor WITH 'tceva','den','Alegeti simbolul analitic','m.den'
		*!*		SELECT tceva
		*!*		LOCATE FOR ALLTRIM(den) = ALLTRIM(m.den)
		*!*		lcAcont = acont
		
		*!*		SELECT actactan
		*!*		REPLACE &tcColoana WITH lcAcont
		*!*	ELSE 
		*!*		LOCATE FOR ALLTRIM(cont)=ALLTRIM(tccont) AND ALLTRIM(acont)=ALLTRIM(tcacont)
		*!*		IF !FOUND()
		*!*			DO caut_alfa_cursor WITH 'tceva','den','Alegeti simbolul analitic','m.den'
		*!*			SELECT tceva
		*!*			LOCATE FOR ALLTRIM(den) = ALLTRIM(m.den)
		*!*			lcAcont = acont
		
		*!*			SELECT actactan
		*!*			REPLACE &tcColoana WITH lcAcont
		*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF USED('TCEVA')
		*!*		USE IN Tceva 
		*!*	ENDIF  
		
		*!*	SELECT actactan 
		*!*	this.pageframe1.page1.gridb1.SetFocus 
		*!*	RETURN ll_l
	ENDPROC

	PROCEDURE Help1.Click
		*!*	ohelpcont=createobj('help_pltree')
		*!*	ohelpcont.show(1)
	ENDPROC

	PROCEDURE Pageframe1.Page1.Activate
		this.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column10.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column10.Text1.InteractiveChange
		*tcFis, tcNume, tcId, tcTitlu
		locauta = thisform.do_caut_nomenclator('Vnom_valute','nume_val','id_valuta','Numele Valutei')
		SELECT actactan
		REPLACE nume_val WITH locauta.nume_val, id_valuta WITH locauta.id_valuta
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column11.Combo1.Valid
		SELECT actactan 
		REPLACE proc_tva WITH cote_tva2.proc_tva
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column2.Text1.InteractiveChange
		REPLACE id_partd WITH 0, partd WITH ''
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column2.Text1.LostFocus
		lcCont = actactan.scd
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			REPLACE actactan.scd WITH ''
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column3.Text1.Click
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column3.Text1.LostFocus
		PARAMETERS PlClick
		SELECT actactan
		lcCont = scd
		lcAcont = ascd
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascd','actactan') && in oOperatii_comune.prg
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column4.Text1.InteractiveChange
		REPLACE id_partc WITH 0, partc WITH ''
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column4.Text1.LostFocus
		lcCont = actactan.scc
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			REPLACE actactan.scc WITH ''
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column5.Text1.Click
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column5.Text1.LostFocus
		PARAMETERS PlClick
		SELECT actactan
		lcCont = scc
		lcAcont = ascc
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascc','actactan') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column6.Text1.LostFocus
		*!*	PlClick = .f.
		
		*!*	SELECT actactan
		*!*	lcContD = scd
		*!*	lcAcontD = ascd
		*!*	lcContC = scc
		*!*	lcAcontC = ascc
		
		*!*	IF EMPTY(ascc) 
		*!*		ll_l=THISFORM.verific_analitic(plClick, lcContC, lcAcontC,'ascc')
		*!*	*!*		IF ll_l
		*!*	*!*			REPLACE actactan.ASCC WITH ''
		*!*	*!*			RETURN 0
		*!*	*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF EMPTY(ascd) 
		*!*		ll_l=THISFORM.verific_analitic(plClick, lcContD, lcAcontD,'ascd')
		*!*	*!*		IF ll_l
		*!*	*!*			REPLACE actactan.ASCD WITH ''
		*!*	*!*			RETURN 0
		*!*	*!*		ENDIF 
		*!*	ENDIF 
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column8.Text1.LostFocus
		IF !thisform.introducere_libera 
			IF !EMPTY(suma_val) OR !EMPTY(curs)
				REPLACE suma WITH ROUND(suma_val*curs,gnPc)
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column9.Text1.LostFocus
		IF !thisform.introducere_libera 
			IF !EMPTY(curs) OR !EMPTY(suma_val)
				REPLACE suma WITH ROUND(curs*suma_val, gnPc)
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Nou1.Command1.Click
		SELECT actactan
		SCATTER NAME oact
		APPEND BLANK
		GATHER NAME oact FIELDS EXCEPT scd, ascd,scc,ascc,proc_tva, id_partd, partd, id_partc, partc, id_factd, pereched, id_factc, perechec, suma, sumaval, curs, id_valuta, nume_val
		REPLACE id_set WITH 99999
		DO nrord WITH 'actactan'
		THIS.PARENT.parent.GRIDB1.REFRESH
		
		 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Sterge1.Command1.Click
		SELECT actactan
		DELETE
		DO nrord WITH 'actactan'
		THIS.PARENT.parent.GRIDB1.REFRESH
	ENDPROC

	PROCEDURE Pageframe1.Page2.Activate
		this.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column2.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column2.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_fdoc','fel_document','id_fdoc','Felul Documentului')
		SELECT actactan
		REPLACE fdoc WITH locauta.fel_document, id_fdoc WITH locauta.id_fdoc
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column3.Text1.LostFocus
		*thisform.pageframe1.ActivePage=2
		thisform.pageframe1.page2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column3.Text1.Valid
		*ld_dataireg=actactan.dataireg
		lcControl = this.ControlSource 
		ll=thisform.calcul_data(lcControl) 
		IF ll 
			RETURN 0
		ENDIF
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column4.Text1.LostFocus
		thisform.pageframe1.page2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column4.Text1.Valid
		*ld_dataact=actactan.dataact
		lcControl=this.ControlSource 
		ll=thisform.calcul_data(lcControl) 
		IF ll
			RETURN 0
		ENDIF 
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column5.Text1.LostFocus
		*thisform.pageframe1.ActivePage=2
		thisform.pageframe1.page2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column5.Text1.When
		*!*	M=this.ControlSource 
		*!*	thisform.calcul_data 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column7.Text1.InteractiveChange
		IF !thisform.introducere_libera 
			lcSel = this.Parent.Parent.RecordSource
			SELECT (lcSel)
			SCATTER NAME odoc
			&& 0 = ACTIV
			&& 1 = PASIV
			*thisform.aleg_document_pereche(1,odoc)
			DO aleg_document_pereche WITH 1,odoc,lcSel IN oOperatii_comune.prg
			this.Parent.Parent.SetFocus 
			RELEASE odoc 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column8.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode=13 OR nKeyCode=9
			thisform.pageframe1.ActivePage=3
			thisform.pageframe1.page3.gridb1.SetFocus 
		ELSE 
			DODEFAULT()
		ENDIF 
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column9.Text1.InteractiveChange
		IF !thisform.introducere_libera 
			lcSel = this.Parent.Parent.RecordSource
			SELECT (lcSel)
			SCATTER NAME odoc
			&& 0 = ACTIV
			&& 1 = PASIV
			*thisform.aleg_document_pereche(0,odoc)
			DO aleg_document_pereche WITH 0,odoc,lcSel IN oOperatii_comune.prg
			this.Parent.Parent.SetFocus 
			RELEASE odoc 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Activate
		this.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column10.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column10.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_sectii','sectie','id_sectie','Sectia')
		SELECT actactan
		REPLACE id_sectie WITH locauta.id_sectie, sectie WITH locauta.sectie 
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column17.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column17.Text1.InteractiveChange
		LOCAL lcCont
		LOCAL loCauta
		SELECT actactan
		lcCont = ALLTRIM(scd)
		
		IF EMPTY(lcCont)	
			RETURN
		ENDIF 
		
		
		loHash = GetHash([cTitlu=>Alegeti partenerul ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont + [??lVerificaANAF=>1])
		loHash.SetValue('dDataDoc', Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
		loCauta = CautPartenerContabilitate(loHash)
		
		SELECT actactan
		REPLACE id_partd WITH loCauta.id_part, partd WITH locauta.nume
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column18.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column18.Text1.InteractiveChange
		LOCAL lcCont
		LOCAL loCauta
		SELECT actactan
		lcCont = ALLTRIM(scc)
		
		IF EMPTY(lcCont)	
			RETURN
		ENDIF 
		
		
		loHash = GetHash([cTitlu=>Alegeti partenerul ] + lcCont + [??lAdaugCorespondente=>1??cCont=>] + lcCont + [??lVerificaANAF=>1])
		loHash.SetValue('dDataDoc', Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
		loCauta = CautPartenerContabilitate(loHash)
		
		SELECT actactan
		REPLACE id_partc WITH loCauta.id_part, partc WITH locauta.nume
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column2.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column2.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_sucursale','SUCURSALA','id_SUCURSALA','Sucursala')
		SELECT actactan
		REPLACE id_SUCURSALA WITH locauta.id_SUCURSALA, SUCURSALA WITH locauta.SUCURSALA 
		RELEASE locauta
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column7.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column7.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_lucrari','nrord','id_lucrare','Lucrarea / Contractul')
		SELECT actactan
		REPLACE nrord WITH locauta.nrord, id_lucrare WITH locauta.id_lucrare
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column8.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column8.Text1.InteractiveChange
		*!*	locauta = thisform.do_caut_nomenclator('Vnom_responsabili','nume','id_responsabil','Nume responsabil')
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Responsabili??cTipuriParteneri=>]+ALLTRIM(STR(gnIdTipResponsabili))+[??lAdaugCorespondente=>1]))
		SELECT actactan
		REPLACE nresp WITH locauta.denumire, id_responsabil WITH locauta.id_part
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column9.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column9.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_venchel','explicatie','id_venchelt','Cheltuiala / Venit')
		SELECT actactan
		REPLACE dst_chlt WITH locauta.explicatie, id_venchelt WITH locauta.id_venchelt
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Init
		*!*	this.column1.header1.BackColor=this.column1.dynamicBackColor
		
		
		*!*	FOR i=1 TO this.ColumnCount 
		*!*		t='this.column'+ALLTRIM(STR(i))+'.header1.backcolor=this.column'+ALLTRIM(STR(i))+'.backcolor'
		*!*		&t
		*!*	ENDFOR
		*!*	this.Refresh 
	ENDPROC

	PROCEDURE Terminat1.Command1.Click
		e_complet=thisform.verificare()
		*!*	SELECT actactan
		*!*	BROWSE 
		*!*	RETURN 
		*!*	SELECT actactan
		IF !e_complet
			RETURN
		ELSE 
			buton=1
			SELECT actactan
			LOCATE 
			lVerificAnalitic = .t.
			lCompletareParteneri = .f.
			DO FORM verificare WITH lVerificAnalitic, lCompletareParteneri 
			IF buton = 1
				SELECT actactan
				REPLACE ALL id_set WITH 99999
				REPLACE ALL AN WITH gnAn,luna WITH gnLuna, ID_UTIL WITH gnidutil
				lnSucces  = oscrie_in_fisiere(0)
		 		IF lnSucces > 0	
		 			thisform.Release 
		 		ENDIF 
			ENDIF 
		ENDIF 
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_note2007 AS formtermin OF "..\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="Pageframe1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column11.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column12._CHECKBOX1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.Gridb1.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column18.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page3.Gridb1.Column18.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_SHAPE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Help1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Renunt1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: aleg_document_pereche
		*m: calcul_data
		*m: calcul_suma
		*m: do_caut_nomenclator
		*m: verificare
		*m: verific_analitic
		*p: introducere_libera
		*p: lnuverificcont
		*p: lverificareanalitic
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 400
		introducere_libera = .F.
		lnuverificcont = .F.
		lverificareanalitic = .T.
		Name = "frm_note2007"
		Width = 792
		Shape1.Height = 36
		Shape1.Left = 0
		Shape1.Name = "Shape1"
		Shape1.Top = 0
		Shape1.Width = 792
		Shape1.ZOrderSet = 0
		Terminat1.Command1.Name = "Command1"
		Terminat1.Imbuton1.Height = 29
		Terminat1.Imbuton1.Name = "Imbuton1"
		Terminat1.Imbuton1.Width = 27
		Terminat1.Left = 757
		Terminat1.Name = "Terminat1"
		Terminat1.Top = 3
		Terminat1.ZOrderSet = 7
		Titlufrumos1.Caption = "NOTE FARA PREDEFINIRE"
		Titlufrumos1.Height = 30
		Titlufrumos1.Left = 9
		Titlufrumos1.Name = "Titlufrumos1"
		Titlufrumos1.Top = 6
		Titlufrumos1.Width = 364
		Titlufrumos1.ZOrderSet = 1
	*</PropValue>

	ADD OBJECT '_SHAPE1' AS _shape WITH ;
		BackColor = 255,255,255, ;
		Height = 36, ;
		Left = 684, ;
		Name = "_SHAPE1", ;
		Top = 0, ;
		Width = 107, ;
		ZOrderSet = 4
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Help1' AS help WITH ;
		Left = 691, ;
		Name = "Help1", ;
		Top = 3, ;
		ZOrderSet = 5, ;
		Imbuton1.Name = "Imbuton1", ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Pageframe1' AS pageframe WITH ;
		ErasePage = .T., ;
		Height = 349, ;
		Left = 8, ;
		Name = "Pageframe1", ;
		PageCount = 3, ;
		TabStyle = 1, ;
		Top = 45, ;
		Width = 778, ;
		ZOrderSet = 2, ;
		Page1.BackColor = 255,255,255, ;
		Page1.Caption = "Note-Sume", ;
		Page1.Name = "Page1", ;
		Page2.BackColor = 240,240,240, ;
		Page2.Caption = "Date", ;
		Page2.Name = "Page2", ;
		Page3.BackColor = 228,228,228, ;
		Page3.Caption = "Explicatii", ;
		Page3.Name = "Page3"
		*< END OBJECT: BaseClass="pageframe" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1' AS gridb WITH ;
		ColumnCount = 15, ;
		FontName = "Arial Narrow", ;
		GridLineColor = 255,255,255, ;
		GridLines = 3, ;
		HeaderHeight = 25, ;
		Height = 260, ;
		Left = 5, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordMark = .T., ;
		RecordSource = "actactan", ;
		RowHeight = 22, ;
		Top = 11, ;
		Width = 763, ;
		COLUMN1.Alignment = 2, ;
		COLUMN1.BackColor = 245,245,245, ;
		COLUMN1.ControlSource = "nrcrt()", ;
		COLUMN1.DynamicBackColor = "RGB(245,245,245)", ;
		COLUMN1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Caption = "Nr.", ;
		COLUMN1.Header1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Name = "Header1", ;
		COLUMN1.Name = "COLUMN1", ;
		COLUMN1.ReadOnly = .F., ;
		COLUMN1.Text1.Alignment = 2, ;
		COLUMN1.Text1.BackColor = 245,245,245, ;
		COLUMN1.Text1.FontName = "Arial Narrow", ;
		COLUMN1.Text1.Name = "Text1", ;
		COLUMN1.Text1.ReadOnly = .F., ;
		COLUMN1.Text1.Visible = .T., ;
		COLUMN1.Visible = .T., ;
		COLUMN1.Width = 37, ;
		Column2.Alignment = 1, ;
		Column2.BackColor = 247,245,238, ;
		Column2.ControlSource = "scd", ;
		Column2.DynamicBackColor = "RGB(247,245,238)", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Format = "XXXX.", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Visible = .T., ;
		Column2.Width = 59, ;
		Column3.Alignment = 0, ;
		Column3.BackColor = 247,245,238, ;
		Column3.ControlSource = "ascd", ;
		Column3.DynamicBackColor = "RGB(247,245,238)", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .F., ;
		Column3.Visible = .T., ;
		Column3.Width = 53, ;
		Column4.Alignment = 1, ;
		Column4.BackColor = 226,226,226, ;
		Column4.ControlSource = "scc", ;
		Column4.DynamicBackColor = "RGB(226,226,226)", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Format = "XXXX.", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .F., ;
		Column4.Visible = .T., ;
		Column4.Width = 63, ;
		Column5.Alignment = 0, ;
		Column5.BackColor = 226,226,226, ;
		Column5.ControlSource = "ascc", ;
		Column5.DynamicBackColor = "RGB(226,226,226)", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .F., ;
		Column5.Visible = .T., ;
		Column5.Width = 49, ;
		Column6.BackColor = 214,214,214, ;
		Column6.ControlSource = "suma", ;
		Column6.DynamicBackColor = "rgb(214,214,214)", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.InputMask = (get_mask(12,gnPa)), ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .F., ;
		Column6.Visible = .T., ;
		Column6.Width = 114, ;
		Column7.BackColor = 214,214,214, ;
		Column7.ColumnOrder = 7, ;
		Column7.ControlSource = "suma_val", ;
		Column7.DynamicBackColor = "rgb(214,214,214)", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.InputMask = (get_mask(12,gnPval)), ;
		Column7.Name = "Column8", ;
		Column7.ReadOnly = .F., ;
		Column7.Visible = .T., ;
		Column7.Width = 87, ;
		Column8.BackColor = 214,214,214, ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "curs", ;
		Column8.DynamicBackColor = "rgb(214,214,214)", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.InputMask = (get_mask(12,gnPcurs)), ;
		Column8.Name = "Column9", ;
		Column8.ReadOnly = .F., ;
		Column8.Visible = .T., ;
		Column8.Width = 76, ;
		Column9.BackColor = 214,214,214, ;
		Column9.ColumnOrder = 9, ;
		Column9.ControlSource = "nume_val", ;
		Column9.CurrentControl = "Text1", ;
		Column9.DynamicBackColor = "rgb(214,214,214)", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Name = "Column10", ;
		Column9.ReadOnly = .F., ;
		Column9.Visible = .T., ;
		Column9.Width = 112, ;
		Column10.Alignment = 0, ;
		Column10.BackColor = 214,214,214, ;
		Column10.ColumnOrder = 12, ;
		Column10.ControlSource = "explicatie_tva", ;
		Column10.CurrentControl = "Combo1", ;
		Column10.DynamicBackColor = "rgb(214,214,214)", ;
		Column10.DynamicCurrentControl = "IIF(actactan.cu_tva=0,'Text1','Combo1')", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.Name = "Column11", ;
		Column10.ReadOnly = .F., ;
		Column10.Sparse = .F., ;
		Column10.Visible = .T., ;
		Column10.Width = 72, ;
		Column11.BackColor = 214,214,214, ;
		Column11.ColumnOrder = 11, ;
		Column11.ControlSource = "proc_tva", ;
		Column11.FontName = "Arial Narrow", ;
		Column11.InputMask = "99.99", ;
		Column11.Name = "Column7", ;
		Column11.ReadOnly = .T., ;
		Column11.Visible = .T., ;
		Column11.Width = 65, ;
		Column12.BackColor = 214,214,214, ;
		Column12.ColumnOrder = 10, ;
		Column12.ControlSource = "cu_tva", ;
		Column12.FontName = "Arial Narrow", ;
		Column12.Name = "Column12", ;
		Column12.ReadOnly = .F., ;
		Column12.Sparse = .F., ;
		Column12.Visible = .T., ;
		Column12.Width = 42, ;
		Column13.BackColor = 214,214,214, ;
		Column13.ControlSource = "id_fact", ;
		Column13.FontName = "Arial Narrow", ;
		Column13.Name = "Column13", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 63, ;
		Column14.BackColor = 214,214,214, ;
		Column14.ControlSource = "id_factd", ;
		Column14.FontName = "Arial Narrow", ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 69, ;
		Column15.BackColor = 214,214,214, ;
		Column15.ControlSource = "id_factc", ;
		Column15.FontName = "Arial Narrow", ;
		Column15.Name = "Column15", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 68
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column10.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column11.Combo1' AS combobox WITH ;
		Alignment = 0, ;
		BorderStyle = 0, ;
		BoundColumn = 1, ;
		BoundTo = .T., ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "250,0,0", ;
		Enabled = .T., ;
		FontName = "Arial Narrow", ;
		Height = 24, ;
		Left = 32, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "jtva_coloane.denumire,cota_tva,id_jtva_coloana", ;
		RowSourceType = 2, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		Top = 44, ;
		Visible = .T., ;
		Width = 100
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column11.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column11.Text1' AS _textbox WITH ;
		FontName = "Arial Narrow", ;
		Left = 44, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		Top = 32
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column12._CHECKBOX1' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		ControlSource = "cu_tva", ;
		FontName = "Arial Narrow", ;
		Left = 27, ;
		Name = "_CHECKBOX1", ;
		ReadOnly = .F., ;
		Top = 32, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column12.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cu TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column13.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id Factura", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column13.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id Factura d", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column14.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column15.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "ID Factura c", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column15.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont debitor", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column2.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 247,245,238, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic D", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column3.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 247,245,238, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont creditor ", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column4.Text1' AS textbox WITH ;
		Alignment = 1, ;
		BackColor = 226,226,226, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic C", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column5.Text1' AS textbox WITH ;
		Alignment = 0, ;
		BackColor = 226,226,226, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column6.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column7.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma in valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column8.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Curs valutar", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1.Gridb1.Column9.Text1' AS textbox WITH ;
		BackColor = 214,214,214, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.Nou1' AS nou WITH ;
		Left = 16, ;
		Name = "Nou1", ;
		Top = 279, ;
		Imbuton1.Height = 29, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 27, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Pageframe1.Page1.Sterge1' AS sterge WITH ;
		Left = 52, ;
		Name = "Sterge1", ;
		Top = 279, ;
		Imbuton1.Height = 26, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 26, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1' AS gridb WITH ;
		BackColor = 240,240,240, ;
		ColumnCount = 10, ;
		FontName = "Arial Narrow", ;
		GridLineColor = 255,255,255, ;
		HeaderHeight = 26, ;
		Height = 297, ;
		Left = 11, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordMark = .T., ;
		RecordSource = "actactan", ;
		RowHeight = 23, ;
		Top = 11, ;
		Width = 753, ;
		COLUMN1.BackColor = 240,240,240, ;
		COLUMN1.ControlSource = "nrcrt()", ;
		COLUMN1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Caption = "Nr.", ;
		COLUMN1.Header1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Name = "Header1", ;
		COLUMN1.Name = "COLUMN1", ;
		COLUMN1.ReadOnly = .T., ;
		COLUMN1.Text1.BackColor = 240,240,240, ;
		COLUMN1.Text1.FontName = "Arial Narrow", ;
		COLUMN1.Text1.Name = "Text1", ;
		COLUMN1.Text1.ReadOnly = .T., ;
		COLUMN1.Width = 24, ;
		Column2.BackColor = 240,240,240, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "fdoc", ;
		Column2.CurrentControl = "Text1", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 105, ;
		Column3.BackColor = 240,240,240, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "dataireg", ;
		Column3.CurrentControl = "Text1", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .F., ;
		Column3.Sparse = .F., ;
		Column3.Width = 83, ;
		Column4.BackColor = 240,240,240, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "dataact", ;
		Column4.CurrentControl = "Text1", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .F., ;
		Column4.Sparse = .F., ;
		Column4.Width = 87, ;
		Column5.BackColor = 240,240,240, ;
		Column5.ColumnOrder = 5, ;
		Column5.ControlSource = "datascad", ;
		Column5.CurrentControl = "Text1", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .F., ;
		Column5.Sparse = .F., ;
		Column5.Width = 83, ;
		Column6.BackColor = 240,240,240, ;
		Column6.ColumnOrder = 7, ;
		Column6.ControlSource = "nract", ;
		Column6.CurrentControl = "Text1", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .F., ;
		Column6.Sparse = .F., ;
		Column7.BackColor = 240,240,240, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "pereched", ;
		Column7.CurrentControl = "Text1", ;
		Column7.DynamicBackColor = "", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .F., ;
		Column7.Sparse = .F., ;
		Column7.Width = 68, ;
		Column8.BackColor = 240,240,240, ;
		Column8.ColumnOrder = 10, ;
		Column8.ControlSource = "nnir", ;
		Column8.CurrentControl = "Text1", ;
		Column8.DynamicBackColor = "", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .F., ;
		Column8.Sparse = .F., ;
		Column9.BackColor = 240,240,240, ;
		Column9.ColumnOrder = 9, ;
		Column9.ControlSource = "perechec", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 71, ;
		Column10.BackColor = 240,240,240, ;
		Column10.ColumnOrder = 6, ;
		Column10.ControlSource = "serie_act", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.Format = "!", ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .F., ;
		Column10.Width = 52
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel document", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column2.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data inregistrarii", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column3.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data document", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column4.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data scadenta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column5.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. document", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column6.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pereche Debit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column7.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. NIR/BON", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column8.Text1' AS textbox WITH ;
		BackColor = 240,240,240, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pereche Credit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Pageframe1.Page3.Gridb1' AS gridb WITH ;
		BackColor = 228,228,228, ;
		ColumnCount = 8, ;
		FontName = "Arial Narrow", ;
		GridLineColor = 255,255,255, ;
		HeaderHeight = 25, ;
		Height = 298, ;
		Left = 7, ;
		Name = "Gridb1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordMark = .T., ;
		RecordSource = "actactan", ;
		RowHeight = 23, ;
		Top = 10, ;
		Width = 759, ;
		COLUMN1.BackColor = 228,228,228, ;
		COLUMN1.ColumnOrder = 1, ;
		COLUMN1.ControlSource = "nrcrt()", ;
		COLUMN1.DynamicBackColor = "rgb(228,228,228)", ;
		COLUMN1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.BackColor = 228,228,228, ;
		COLUMN1.Header1.Caption = "Nr.", ;
		COLUMN1.Header1.FontName = "Arial Narrow", ;
		COLUMN1.Header1.Name = "Header1", ;
		COLUMN1.Name = "COLUMN1", ;
		COLUMN1.ReadOnly = .T., ;
		COLUMN1.Text1.BackColor = 228,228,228, ;
		COLUMN1.Text1.FontName = "Arial Narrow", ;
		COLUMN1.Text1.Name = "Text1", ;
		COLUMN1.Text1.ReadOnly = .T., ;
		COLUMN1.Width = 21, ;
		Column2.BackColor = 228,228,228, ;
		Column2.ColumnOrder = 5, ;
		Column2.ControlSource = "nrord", ;
		Column2.CurrentControl = "Text1", ;
		Column2.DynamicBackColor = "rgb(228,228,228)", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column7", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 95, ;
		Column3.BackColor = 228,228,228, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "nresp", ;
		Column3.CurrentControl = "Text1", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column8", ;
		Column3.ReadOnly = .F., ;
		Column3.Width = 110, ;
		Column4.BackColor = 228,228,228, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "dst_chlt", ;
		Column4.CurrentControl = "Text1", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column9", ;
		Column4.ReadOnly = .F., ;
		Column4.Sparse = .F., ;
		Column4.Width = 108, ;
		Column5.BackColor = 228,228,228, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "sectie", ;
		Column5.CurrentControl = "Text1", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column10", ;
		Column5.ReadOnly = .F., ;
		Column5.Width = 96, ;
		Column6.BackColor = 228,228,228, ;
		Column6.ColumnOrder = 4, ;
		Column6.ControlSource = "explicatia", ;
		Column6.DynamicBackColor = "rgb(226,226,226)", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Format = "k!", ;
		Column6.Name = "Column14", ;
		Column6.ReadOnly = .F., ;
		Column6.Width = 110, ;
		Column7.BackColor = 228,228,228, ;
		Column7.ColumnOrder = 2, ;
		Column7.ControlSource = "partd", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "Column17", ;
		Column7.ReadOnly = .F., ;
		Column7.Width = 105, ;
		Column8.BackColor = 228,228,228, ;
		Column8.ColumnOrder = 3, ;
		Column8.ControlSource = "partc", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "Column18", ;
		Column8.ReadOnly = .F., ;
		Column8.Width = 105
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="grid" />

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

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column10.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 226,226,226, ;
		Caption = "Explicatia", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column14.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 226,226,226, ;
		Caption = "Partener Debit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column17.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column18.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 226,226,226, ;
		Caption = "Partener Credit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column18.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 228,228,228, ;
		Caption = "Contract/Lucrare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column7.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 228,228,228, ;
		Caption = "Responsabil", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column8.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 228,228,228, ;
		Caption = "Cheltuiala/Venit", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page3.Gridb1.Column9.Text1' AS textbox WITH ;
		BackColor = 228,228,228, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Renunt1' AS renunt WITH ;
		Left = 724, ;
		Name = "Renunt1", ;
		Top = 3, ;
		ZOrderSet = 6, ;
		Imbuton1.Height = 27, ;
		Imbuton1.Name = "Imbuton1", ;
		Imbuton1.Width = 30, ;
		Command1.Name = "Command1"
		*< END OBJECT: ClassLib="..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Shape2' AS shape WITH ;
		BackColor = 0,128,255, ;
		Height = 24, ;
		Left = 624, ;
		Name = "Shape2", ;
		Top = 7, ;
		Visible = .F., ;
		Width = 49, ;
		ZOrderSet = 3
		*< END OBJECT: BaseClass="shape" />
	
	PROCEDURE aleg_document_pereche
		PARAMETERS tcFel,toAct
		LOCAL lcSel,lcSelAct
		lcSelAct = this.pageframe1.paGE2.gridb1.RecordSource
		pnFelCont = tcFel
		
		IF pnFelCont = 0                  && ACTIV
			pcContul = ALLTRIM(NVL(toAct.scc,[]))
			pcACont = ALLTRIM(NVL(toAct.ascc,[NULL]))
			pnIdPart = NVL(toAct.Id_partc,0)
			pcNume = ALLTRIM(NVL(toAct.partc,[]))
			pnPereche = [perecheC]
			pnIdPereche = [id_factC]
		ELSE                               && PASIV
			pcContul = ALLTRIM(NVL(toAct.scd,[]))
			pcACont = ALLTRIM(NVL(toAct.ascd,[NULL]))
			pnIdPart = NVL(toAct.Id_partd,0)
			pcNume = ALLTRIM(NVL(toAct.partd,[]))
			pnPereche = [perecheD]
			pnIdPereche = [id_factD]
		ENDIF 
		
		lcSelect = [select count(*) as ePereche from ] + gcs + [.vcoresp_tip_cont where cont = ?pcContul and fel_cont = ?pnFelCont and cu_inregistrari = 1 ]
		lcCursor = [crsTest]
		lnSucces = goexecutor.oExecute(lcSelect,lcCursor)
		IF lnSucces < 0
			aMESSAGEBOX('Modificare:Verific existenta pereche ' +goExecutor.cEroare,0+16,"Eroare")
			SELECT (lcSelAct)
			this.pageframe1.paGE2.gridb1.SetFocus 
			RETURN 
		ENDIF 
		
		SELECT crsTest
		LOCATE 
		IF ePereche = 0
			USE IN crsTest
			SELECT (lcSelAct)
			this.pageframe1.paGE2.gridb1.SetFocus 
			RETURN
		ENDIF 
		
		
		IF !EMPTY(toAct.Suma_val)
			llval = .t.
			pnSuma = toAct.Suma_val
			lcFormular = [ocompensari_val]
		ELSE 
			llval = .f.
			pnSuma = toAct.Suma
			lcFormular = [ocompensari]
		ENDIF 
		pnIdValuta = toAct.Id_Valuta
		pcDenumire = [Partener ] + pcContul 
		
		pcCond = [ an = ?gnAn and luna = ?gnluna]
		
		IF llval
			pccond= pccond + [ and ABS(i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit)>0 and i.id_valuta = ?pnIdValuta ]
		ELSE
			pccond= pccond + [ and (i.precvaldeb + i.valdebit - i.precvalcred - i.valcredit = 0) ]
		ENDIF
		
		pcselect = ['select i.* FROM ] + gcs + [.Vireg_parteneri i where 2=2 ']
		IF ALLTRIM(pcACont) # [NULL]
			pcfiltru = [ i.id_part = ?pnIdPart AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont = ?pcContul and ] + pcCond
		ELSE
			pcfiltru = [ i.id_part = ?pnIdPart AND ABS(i.precdeb + i.debit - i.preccred - i.credit)<>0 AND i.cont = ?pcContul and acont is null and ] + pcCond
		ENDIF 
		pcschema = ['']
		pcorder = ['']
		
		PRIVATE podateintrod
		STORE '' TO podateintrod
		
		gencursor('podateintrod','crs_actcv',pcselect,pcfiltru,[''],'')
		
		lcFis = 'actcv' + ALLTRIM(pcContul)
		
		IF USED(lcFis)
			USE IN &lcFis
		ENDIF
		
		IF pnFelCont = 0
			lcsel = [SELECT *, ACONT AS ASCC, nume_val as numeval, curs as cursschimb, precdeb + debit as totctva, preccred+credit as achitat, ] +;
				[precvaldeb + valdebit AS sumaval, precVALcred+VALcredit as achitatval, ] +;
				[.f. as ales, 00000000000000.0000 as sumaachi, 000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 000000.0000 as cursval, 000000.0000 as cursdif ] +;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ELSE
			lcsel = [SELECT *, ACONT AS ASCD, nume_val as numeval, curs as cursschimb, preccred + credit as totctva, precdeb+debit as achitat, ] + ;
				[precvalcred + valcredit as sumaval, precVALdeb+VALdebit as achitatval, ] + ;
				[.f. as ales, 00000000000000.0000 as sumaachi, 00000000000000.0000 as sumaachi2, 00000000000000.0000 as achilei, 00000000000000.0000 as difplus, 00000000000000.0000 as difminus, 000000.0000 as cursval, 000000.0000 as cursdif ] + ;
				[FROM crs_actcv INTO CURSOR ] + lcFis + [ READWRITE ]
		ENDIF
		&lcsel
		
		USE IN crs_actcv
		SELECT (lcFis)
		
		OPLATA=CREATEOBJECT(lcFormular)
		OPLATA.titlufrumos1.CAPTION = pcDenumire + [: ] + pcNume
		OPLATA.pcFis = lcFis
		OPLATA.SUMA = pnSuma
		OPLATA.pnFelCont = pnFelCont
		OPLATA.SHOW(1)
		
		IF gnButon = 1
			SELECT (lcSelAct)
			DELETE 
			SELECT (lcFis)
			SCAN FOR ales
				SCATTER NAME oper
				SELECT (lcSelAct)
				APPEND BLANK 
				GATHER NAME toAct
				REPLACE &pnIdPereche WITH oper.id_fact, &pnPereche WITH oper.nract, suma WITH oper.sumaachi, suma_val WITH oper.sumaachi2
				SELECT (lcFis)
			ENDSCAN 
		ELSE 
			SELECT (lcSelAct)
			REPLACE &pnPereche WITH toact.&pnPereche 
		ENDIF 
		
		IF USED(lcFis)
			USE IN (lcFis)
		ENDIF 
		SELECT (lcSelAct)
		DO nrord WITH lcSelAct
		this.pageframe1.paGE2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE calcul_data
		Parameters tcControl
		Local ll_verif
		Store .F. To ll_verif
		lcControl = Alltrim(tcControl)
		
		Do Case
		Case Upper(Alltrim(lcControl))='ACTACTAN.DATASCAD'
			ld_DataScad = Gomonth(dataact,1)
			Select ACTACTAN
			Replace DATASCAD With ld_DataScad
		
		Case Upper(Alltrim(lcControl))='ACTACTAN.DATAIREG'
			If !(Month(dataireg)= gnLuna And Year(dataireg) = gnAn)
		*!*			Do mesaj With 'Data trebuie sa fie din luna',Alltrim(pcNl)+' '+Alltrim(pcAn)
				amessagebox("Data trebuie sa fie din luna " + Alltrim(pcNl)+"/"+Alltrim(pcAn)+" !",0+48,"Atentie")
				ll_verif=.T.
			Else
				ll_verif=.F.
				Select ACTACTAN
				Replace dataact With dataireg
			Endif
		
		Case Upper(Alltrim(lcControl))='ACTACTAN.DATAACT'
			If !((Month(dataact)<= gnLuna And Year(dataact)=gnAn) Or Year(dataact)<gnAn)
		*!*			Do mesaj With 'Data trebuie sa fie inainte sau in luna',Alltrim(pcnl)+' '+Alltrim(pcan)
				amessagebox("Data trebuie sa fie inainte sau in luna "+Alltrim(pcNl)+"/"+Alltrim(pcAn)+" !",0+48,"Atentie")
				ll_verif=.T.
			Else
				ll_verif=.F.
			Endif
		
			ld_DataScad=Gomonth(dataact,1)
			Select ACTACTAN
			Replace DATASCAD With ld_DataScad
		Endcase
		
		Return ll_verif
	ENDPROC

	PROCEDURE calcul_suma
	ENDPROC

	PROCEDURE do_caut_nomenclator
		PARAMETERS tcFis, tcNume, tcId, tcTitlu
		
		pcselect = [select ] + tcNume + [,] + tcId + [ from ] + tcFis
		pcfiltru = [1=2]
		pcschema = []
		pcorder = tcNume
		pccoloane = tcNume
		llAllInList = .F.
		lcFiltruOriginal = "inactiv=0"
		*!* 24.03.2008
		If Upper(tcFis) = 'VNOM_SECTII'
			lcFiltruOriginal = lcFiltruOriginal + gcCondSucursala
		EndIf 
		*!* 24.03.2008 ^
		pcTitlu = tcTitlu 
		
		locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitlu, tcFis, llAllInList, lcFiltruOriginal) && 11.07.2007
		
		RETURN locauta
		&& tcselect,tcfiltru,tcschema,tcorder,tccoloana,tcTitlu,tcTitluColoana,tcNume_Proc,tl_AllInList,tcFiltruOriginal,tcPrimaColoana, tnPornire, tnTipReturn, tcIdColumn, tlDesktop, tcGroup, tcGridDynamicBackColor, tcGridToolTip, tlModParam
	ENDPROC

	PROCEDURE Init
		LPARAMETERS tlVerificareAnalitic, tlNuVerificCont
		*!* 19.02.2008
		*!* pot sa apelez nota fara predefinire cu sau fara verificare analitice
		*!* 11.03.2008
		*!* nota fara predefinire cu/fara verificare conturi completate
		IF PCOUNT() > 0
			this.lVerificareAnalitic = tlVerificareAnalitic
			this.lNuVerificCont = tlNuVerificCont
		ELSE 
			this.lVerificareAnalitic = .T.
			this.lNuVerificCont = .F.
		ENDIF 
		*!* 19.02.2008 ^
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode = 13 AND nShiftAltCtrl = 2
			this.introducere_libera  = !this.introducere_libera
			this.shape2.Visible = !this.shape2.Visible
		ENDIF 
	ENDPROC

	PROCEDURE Load
		Set Safety Off
		ld_dataireg=Ttod(get_ora())
		If Month(ld_dataireg)<>gnLuna Or Year(ld_dataireg)<>gnAn
			ld_dataireg=ultimazi()
		Endif
		
		Select ACTACTAN
		Zap
		Append Blank
		Replace dataireg With ld_dataireg, dataact With ld_dataireg
		If !glEMama And !Isnull(gnIdMama)
			Replace id_sucursala With gnIdSucursala,sucursala With Alltrim(gcFirma)
		Endif
		
		Do nrord With "actactan"
	ENDPROC

	PROCEDURE verificare
		*!*	LOCAL COMPL,TE
		*!*	TE=''
		*!*	COMPL=.T.
		
		*!*	SELECT ACTACTAN
		*!*	ii=1
		*!*	SCAN
		*!*		lcScd = scd
		*!*		lcScc = scc
		*!*		IF EMPTY(suma)
		*!*			COMPL=.F.
		*!*			TE=TE+','+'suma'
		*!*		ENDIF
		*!*		*!* la clasele 8 si 9 se poate sa nu fie contul corespondent completat
		*!*		IF EMPTY(scd) AND !INLIST(LEFT(NVL(scc,''),1),'8','9')
		*!*			COMPL=.F.
		*!*			TE=TE+','+'contul debitor'
		*!*		ENDIF
		*!*		IF EMPTY(scc) AND !INLIST(LEFT(NVL(scd,''),1),'8','9')
		*!*			COMPL=.F.
		*!*			TE=TE+','+'contul creditor'
		*!*		ENDIF
		*!*		IF EMPTY(nract)
		*!*			COMPL=.F.
		*!*			TE=TE+','+'nr.document'
		*!*		ENDIF
		*!*		IF (!EMPTY(suma_val) OR !EMPTY(CURS)) AND EMPTY(id_valuta)
		*!*			COMPL=.F.
		*!*			TE=TE+','+'nume valuta'
		*!*		ENDIF
		*!*		IF cu_tva = 1 AND EMPTY(NVL(id_jtva_coloana,0))
		*!*			COMPL = .F.
		*!*			TE=TE+','+'explicatie TVA'
		*!*		ENDIF
		*!*		IF !COMPL
		*!*			*!*			DO mesaj WITH 'La nota nr. '+ALLTRIM(STR(ii))+' nu ati completat campurile:',LEFT(te,60)+'...'
		*!*			amessagebox("La nota nr. "+ALLTRIM(STR(ii))+" nu ati completat campurile:"+SUBSTR(TE,2,60)+"...",0+48,"Atentie")
		*!*			RETURN COMPL
		*!*		ENDIF
		*!*		ii=ii+1
		*!*	ENDSCAN
		
		
		*!*	RETURN COMPL
		*!*	modificare 21.02.2008
		lVerificAnalitic = .T.
		lCompletezPartener = .F.
		llRet = verificare_note_contabile('ACTACTAN',lVerificAnalitic,lCompletezPartener) && in oOperatii_comune
		RETURN llRet
		*!*	modificare 21.02.2008	^
	ENDPROC

	PROCEDURE verific_analitic
	ENDPROC

	PROCEDURE Help1.Click
		*!*	ohelpcont=createobj('help_pltree')
		*!*	ohelpcont.show(1)
	ENDPROC

	PROCEDURE Pageframe1.Page1.Activate
		this.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column10.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column10.Text1.InteractiveChange
		*tcFis, tcNume, tcId, tcTitlu
		locauta = thisform.do_caut_nomenclator('Vnom_valute','nume_val','id_valuta','Numele Valutei')
		SELECT actactan
		REPLACE nume_val WITH locauta.nume_val, id_valuta WITH locauta.id_valuta
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column11.Combo1.InteractiveChange
		Select actactan
		Replace proc_tva With (jtva_coloane.cota_tva+100)/100,id_jtva_coloana With jtva_coloane.id_jtva_coloana
		Thisform.pageframe1.page1.gridb1.Refresh()
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column12._CHECKBOX1.Click
		This.Parent.Parent.Refresh()
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column15.Text1.KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		If nKeyCode=13 Or nKeyCode=9
			Thisform.pageframe1.ActivePage=2
			Thisform.pageframe1.page2.gridb1.SetFocus
		Else
			DoDefault()
		Endif
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column2.Text1.InteractiveChange
		REPLACE id_partd WITH 0, partd WITH ''
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column2.Text1.LostFocus
		lcCont = actactan.scd
		If !Empty(lcCont)
			llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
			If !llReturn
				Replace actactan.scd With ''
			Endif
		Endif
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column3.Text1.Click
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column3.Text1.LostFocus
		Parameters PlClick
		*!* 11.03.2008
		*!* nu verific analiticul
		If !thisform.lVerificareAnalitic
			Return
		EndIf 
		*!* 11.03.2008 ^
		Select actactan
		lcCont = scd
		lcAcont = ascd
		If !Empty(lcCont)
			llReturn = verific_analitic(PlClick, lcCont, lcAcont,'ascd','actactan') && in oOperatii_comune.prg
		Endif
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column4.Text1.InteractiveChange
		REPLACE id_partc WITH 0, partc WITH ''
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column4.Text1.LostFocus
		lcCont = actactan.scc
		If !Empty(lcCont)
			llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
			If !llReturn
				Replace actactan.scc With ''
			Endif
		Endif
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column5.Text1.Click
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column5.Text1.LostFocus
		Parameters PlClick
		*!* 11.03.2008
		*!* nu verific analiticul
		If !thisform.lVerificareAnalitic
			Return
		EndIf 
		*!* 11.03.2008 ^
		Select actactan
		lcCont = scc
		lcAcont = ascc
		If !Empty(lcCont)
			llReturn = verific_analitic(PlClick, lcCont, lcAcont,'ascc','actactan') && in oOperatii_comune.prg
		Endif
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column6.Text1.LostFocus
		*!*	PlClick = .f.
		
		*!*	SELECT actactan
		*!*	lcContD = scd
		*!*	lcAcontD = ascd
		*!*	lcContC = scc
		*!*	lcAcontC = ascc
		
		*!*	IF EMPTY(ascc) 
		*!*		ll_l=THISFORM.verific_analitic(plClick, lcContC, lcAcontC,'ascc')
		*!*	*!*		IF ll_l
		*!*	*!*			REPLACE actactan.ASCC WITH ''
		*!*	*!*			RETURN 0
		*!*	*!*		ENDIF 
		*!*	ENDIF 
		
		*!*	IF EMPTY(ascd) 
		*!*		ll_l=THISFORM.verific_analitic(plClick, lcContD, lcAcontD,'ascd')
		*!*	*!*		IF ll_l
		*!*	*!*			REPLACE actactan.ASCD WITH ''
		*!*	*!*			RETURN 0
		*!*	*!*		ENDIF 
		*!*	ENDIF 
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column8.Text1.LostFocus
		IF !thisform.introducere_libera 
			IF !EMPTY(suma_val) OR !EMPTY(curs)
				REPLACE suma WITH ROUND(suma_val*curs,gnPc)
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Gridb1.Column9.Text1.LostFocus
		IF !thisform.introducere_libera 
			IF !EMPTY(curs) OR !EMPTY(suma_val)
				REPLACE suma WITH ROUND(curs*suma_val, gnPc)
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page1.Nou1.Command1.Click
		Select actactan
		Scatter Name oact
		Append Blank
		Gather Name oact Fields Except scd, ascd,scc,ascc,proc_tva,id_jtva_coloana,explicatie_tva,cu_tva,id_partd, partd, id_partc, partc, id_factd, pereched, id_factc, perechec, suma, sumaval, Curs, id_valuta, nume_val
		*!* 13.03.2008 note fara predefinire * fara verificare completare cont sintetic/analitic
		Replace id_set With Iif(THISform.lnuverificcont, 99998, 99999)
		*!* 13.03.2008 ^
		If !glEMama And !Isnull(gnIdMama)
			Replace id_sucursala With gnIdSucursala,sucursala With Alltrim(gcFirma)
		Endif
		Do nrord With 'actactan'
		This.Parent.Parent.GRIDB1.Refresh
		
		
	ENDPROC

	PROCEDURE Pageframe1.Page1.Sterge1.Command1.Click
		SELECT actactan
		DELETE
		DO nrord WITH 'actactan'
		THIS.PARENT.parent.GRIDB1.REFRESH
	ENDPROC

	PROCEDURE Pageframe1.Page2.Activate
		this.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column2.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column2.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_fdoc','fel_document','id_fdoc','Felul Documentului')
		SELECT actactan
		REPLACE fdoc WITH locauta.fel_document, id_fdoc WITH locauta.id_fdoc
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column3.Text1.LostFocus
		*thisform.pageframe1.ActivePage=2
		thisform.pageframe1.page2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column3.Text1.Valid
		*ld_dataireg=actactan.dataireg
		lcControl = This.ControlSource
		*!*	modificare	v 2.0.131
		If Thisform.pageframe1.ActivePage = 2
			If Thisform.calcul_data(lcControl)
				Return 0
			Endif
		Endif
		*!*	ll=thisform.calcul_data(lcControl)
		*!*	IF ll
		*!*		RETURN 0
		*!*	ENDIF
		*!*	modificare	v 2.0.131	^
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column4.Text1.LostFocus
		thisform.pageframe1.page2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column4.Text1.Valid
		*ld_dataact=actactan.dataact
		lcControl=this.ControlSource 
		*!*	modificare	v 2.0.131
		If Thisform.pageframe1.ActivePage = 2
			If Thisform.calcul_data(lcControl)
				Return 0
			Endif
		Endif
		*!*	ll=thisform.calcul_data(lcControl)
		*!*	IF ll
		*!*		RETURN 0
		*!*	ENDIF
		*!*	modificare	v 2.0.131	^
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column5.Text1.LostFocus
		*thisform.pageframe1.ActivePage=2
		thisform.pageframe1.page2.gridb1.SetFocus 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column5.Text1.When
		*!*	M=this.ControlSource 
		*!*	thisform.calcul_data 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column7.Text1.InteractiveChange
		IF !thisform.introducere_libera 
			lcSel = this.Parent.Parent.RecordSource
			SELECT (lcSel)
			SCATTER NAME odoc
			&& 0 = ACTIV
			&& 1 = PASIV
			*thisform.aleg_document_pereche(1,odoc)
			DO aleg_document_pereche WITH 1,odoc,lcSel IN oOperatii_comune.prg
			this.Parent.Parent.SetFocus 
			RELEASE odoc 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column8.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode=13 OR nKeyCode=9
			thisform.pageframe1.ActivePage=3
			thisform.pageframe1.page3.gridb1.SetFocus 
		ELSE 
			DODEFAULT()
		ENDIF 
		
	ENDPROC

	PROCEDURE Pageframe1.Page2.Gridb1.Column9.Text1.InteractiveChange
		IF !thisform.introducere_libera 
			lcSel = this.Parent.Parent.RecordSource
			SELECT (lcSel)
			SCATTER NAME odoc
			&& 0 = ACTIV
			&& 1 = PASIV
			*thisform.aleg_document_pereche(0,odoc)
			DO aleg_document_pereche WITH 0,odoc,lcSel IN oOperatii_comune.prg
			this.Parent.Parent.SetFocus 
			RELEASE odoc 
		ENDIF 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Activate
		this.gridb1.Refresh
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column10.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column10.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_sectii','sectie','id_sectie','Sectia')
		SELECT actactan
		REPLACE id_sectie WITH locauta.id_sectie, sectie WITH locauta.sectie 
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column17.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column17.Text1.InteractiveChange
		Local lcCont, lnIdPartd
		Local loCauta
		Select actactan
		Private pcCont
		pcCont = Alltrim(Nvl(scd,''))
		lnIdPartd = id_partd
		If Empty(pcCont)
			Return
		Endif
		Local lnrezultat,lnsucces
		lnrezultat=0
		lnsucces=0
		lcSql="select count(*) from config_cont_ireg where cont = ?pcCont"
		lnsucces=goExecutor.oSelect2Value(lcSql,@lnrezultat)
		
		If lnsucces=1
			If lnrezultat>0
				loHash = GetHash([cTitlu=>Alegeti partenerul ] + pcCont + [??lAdaugCorespondente=>1??cCont=>] + pcCont + [??lVerificaANAF=>1])
				loHash.SetValue('dDataDoc', Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
				loCauta = CautPartenerContabilitate(loHash)
				Select actactan
				Replace id_partd With loCauta.id_part, partd With loCauta.nume
				IF lnIdPartd <> loCauta.id_part
					Select actactan
					REPLACE pereched WITH 0, id_factd WITH 0
				ENDIF 
			Else
				AMESSAGEBOX("Contul " + pcCont + " nu este configurat cu parteneri", 0 + 16 ,"Eroare")
			Endif
		Else
			AMESSAGEBOX(goExecutor.oPrelucrareEroare, 0 + 16 ,"Eroare")
		Endif
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column18.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column18.Text1.InteractiveChange
		Local lcCont, lnIdPartc
		Local loCauta
		Select actactan
		Private pcCont
		pcCont = Alltrim(Nvl(scc,''))
		lnIdPartc = id_partc
		
		If Empty(pcCont)
			Return
		Endif
		Local lnrezultat,lnsucces
		lnrezultat=0
		lnsucces=0
		lcSql="select count(*) from config_cont_ireg where cont = ?pcCont"
		lnsucces=goExecutor.oSelect2Value(lcSql,@lnrezultat)
		
		If lnsucces=1
			If lnrezultat>0
				loHash = GetHash([cTitlu=>Alegeti partenerul ] + pcCont + [??lAdaugCorespondente=>1??cCont=>] + pcCont + [??lVerificaANAF=>1])
				loHash.SetValue('dDataDoc', Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
				loCauta = CautPartenerContabilitate(loHash)
				Select actactan
				Replace id_partc With loCauta.id_part, partc With loCauta.nume
				IF lnIdPartc <> loCauta.id_part
					Select actactan
					REPLACE perechec WITH 0, id_factc WITH 0
				ENDIF 
			Else
				AMESSAGEBOX("Contul " + pcCont + " nu este configurat cu parteneri", 0 + 16 ,"Eroare")
			Endif
		Else
			AMESSAGEBOX(goExecutor.oPrelucrareEroare, 0 + 16 ,"Eroare")
		Endif
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column7.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column7.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_lucrari','nrord','id_lucrare','Lucrarea / Contractul')
		SELECT actactan
		REPLACE nrord WITH locauta.nrord, id_lucrare WITH locauta.id_lucrare
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column8.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column8.Text1.InteractiveChange
		*!*	locauta = thisform.do_caut_nomenclator('Vnom_responsabili','nume','id_responsabil','Nume responsabil')
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Responsabili??cTipuriParteneri=>]+ALLTRIM(STR(gnIdTipResponsabili))+[??lAdaugCorespondente=>1]))
		SELECT actactan
		REPLACE nresp WITH locauta.denumire, id_responsabil WITH locauta.id_part
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column9.Text1.Click
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Column9.Text1.InteractiveChange
		locauta = thisform.do_caut_nomenclator('Vnom_venchel','explicatie','id_venchelt','Cheltuiala / Venit')
		SELECT actactan
		REPLACE dst_chlt WITH locauta.explicatie, id_venchelt WITH locauta.id_venchelt
		RELEASE locauta
		
	ENDPROC

	PROCEDURE Pageframe1.Page3.Gridb1.Init
		*!*	this.column1.header1.BackColor=this.column1.dynamicBackColor
		
		
		*!*	FOR i=1 TO this.ColumnCount 
		*!*		t='this.column'+ALLTRIM(STR(i))+'.header1.backcolor=this.column'+ALLTRIM(STR(i))+'.backcolor'
		*!*		&t
		*!*	ENDFOR
		*!*	this.Refresh 
	ENDPROC

	PROCEDURE Terminat1.Command1.Click
		*!*	modificare 21.02.2008
		*!*	e_complet=Thisform.verificare()
		*!*	If e_complet
		*!*	modificare 21.02.2008	^
			buton=1
			Select actactan
		*!*	modificare 21.02.2008
		*!*		DELETE for suma=0
		*!*	modificare 21.02.2008	^
			Replace proc_tva With 0 For cu_tva = 0
			
			GO top
		*!* 19.02.2008
		*!*		lVerificAnalitic = .T.
			lVerificAnalitic = thisform.lVerificareAnalitic
		*!* 11.03.2008
			Local lNuVerificCont
			lNuVerificCont = thisform.lNuverificcont 
		*!* 19.02.2008	
			lCompletareParteneri = .F.
			*!* 14.03.2008 - nu mai fac nici o verificare pentru notele 99998
			If !lNuVerificCont
				Do Form verificare With lVerificAnalitic, lCompletareParteneri, .F., lNuVerificCont
			Else
				buton = 1
			EndIf 	
			*!* 14.03.2008 ^	
			If buton = 1
				Select actactan
			 	Replace all id_set With Iif(THISform.lnuverificcont, 99998, 99999)	
				Replace All AN With gnAn,luna With gnLuna, ID_UTIL With gnidutil
				Replace id_jtva_coloana With Null For cu_tva = 0
				lnSucces  = oscrie_in_fisiere(0)
				If lnSucces > 0
					Thisform.Release
				Endif
			Else
		*!*	pun la loc proc_tva ptr. cazul in care rebifeaza cu_tva si nu mai alege din lista explicatia_tva
				Select jtva_coloane
				lnNrRecno = Recno()
				Select actactan
				Scan For cu_tva = 0
					If !Empty(Nvl(id_jtva_coloana,0))
						lnIdJtva = id_jtva_coloana
						Select jtva_coloane
						Locate For id_jtva_coloana = lnIdJtva
						If Found()
							lnProcTva = (cota_tva + 100)/100
						Else
							lnProcTva = 0
						Endif
						Select actactan
						Replace proc_tva With lnProcTva
					Endif
				Endscan
				Select jtva_coloane
				Go lnNrRecno
				Select actactan
				Go Top
			Endif
		*!*	modificare 21.02.2008
		*!*	Endif
		*!*	modificare 21.02.2008	^
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_plati_impozite 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="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.Column10._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: ntotal
		*p: oact
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 500
		Name = "frm_plati_impozite"
		ntotal = 0
		oact = 
		Width = 700
		WindowType = 1
		_SHAPE1.Anchor = 10
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 701
		_SHAPE2.Anchor = 8
		_SHAPE2.Height = 30
		_SHAPE2.Left = 629
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = -1
		_SHAPE2.Width = 71
		LB_TITLU_ALB_B121.Caption = "Plati impozite"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 667
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Anchor = 12, ;
		Left = 399, ;
		Name = "Clb_tx_simplu1", ;
		Top = 466, ;
		TEXT_SIMPLU1.ControlSource = "thisform.ntotal", ;
		TEXT_SIMPLU1.InputMask = (get_mask(14,gnPA)), ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Total", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 11, ;
		FontSize = 10, ;
		Height = 426, ;
		Left = 7, ;
		Name = "Grid1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordSource = "plimp", ;
		RowHeight = 19, ;
		Top = 37, ;
		Width = 683, ;
		Column1.BackColor = 244,250,255, ;
		Column1.ControlSource = "nract", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .F., ;
		Column1.Width = 69, ;
		Column2.ControlSource = "explicatia", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 198, ;
		Column3.ControlSource = "scd", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .F., ;
		Column3.Width = 58, ;
		Column4.ControlSource = "ascd", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .F., ;
		Column4.Width = 47, ;
		Column5.ControlSource = "scc", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .F., ;
		Column5.Width = 62, ;
		Column6.ControlSource = "ascc", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .F., ;
		Column6.Width = 47, ;
		Column7.BackColor = 244,250,255, ;
		Column7.ControlSource = "suma", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = (get_mask(14,gnPA)), ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .F., ;
		Column7.Width = 120, ;
		Column8.ControlSource = "partd", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .F., ;
		Column8.Width = 87, ;
		Column9.ControlSource = "partc", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 91, ;
		Column10.BackColor = 244,250,255, ;
		Column10.Bound = .F., ;
		Column10.ControlSource = "Iif(Seek(plimp.taxcode,'saft_taxtable','taxcode'),saft_taxtable.taxname,'')", ;
		Column10.CurrentControl = "_combobox1", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 141, ;
		Column11.BackColor = 244,250,255, ;
		Column11.Bound = .F., ;
		Column11.ControlSource = "Iif(Seek(plimp.paymentcode,'saft_mecanisme_plati','mcode'),saft_mecanisme_plati.paymentname,'')", ;
		Column11.CurrentControl = "_combobox1", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.ReadOnly = .T., ;
		Column11.Sparse = .F., ;
		Column11.Width = 89
		*< END OBJECT: BaseClass="grid" />

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

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

	ADD OBJECT 'Grid1.Column10._combobox1' AS _combobox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "450,50", ;
		ControlSource = "plimp.taxcode", ;
		Left = 66, ;
		Name = "_combobox1", ;
		ReadOnly = .F., ;
		RowSource = "select taxname, procent_taxa, taxcode from saft_taxtable where wht = 1 order by tva, tva_livrari, tva_achizitii, wht, taxcode into cursor crsTaxTableX", ;
		RowSourceType = 3, ;
		Top = 82
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="combobox" />

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

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

	ADD OBJECT 'Grid1.Column11._combobox1' AS _combobox WITH ;
		BackColor = 244,250,255, ;
		BorderStyle = 0, ;
		BoundColumn = 3, ;
		BoundTo = .T., ;
		ColumnCount = 2, ;
		ColumnLines = .F., ;
		ColumnWidths = "300,150", ;
		ControlSource = "plimp.paymentcode", ;
		Left = 68, ;
		Name = "_combobox1", ;
		ReadOnly = .F., ;
		RowSource = "select paymentname, methodname, mechanismcode from saft_mecanisme_plati where afisat = 1 order by ordine into cursor crsPaymentX", ;
		RowSourceType = 3, ;
		Top = 82
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Grid1.Column11.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Plata SAFT", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatia", ;
		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", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont Deb", ;
		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", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		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", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont Cred", ;
		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", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		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", ;
		ReadOnly = .F.
		*< 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 = 244,250,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Partener Debit", ;
		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", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Partener Credit", ;
		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", ;
		ReadOnly = .F.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		Left = 265, ;
		Name = "Gridextra1", ;
		Top = 457
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />
	
	PROCEDURE do_executa
		LOCAL i
		
		SELECT plimp
		i = recno()
		SELECT plimp
		sum suma to tsuma
		GOTO i
		
		this.ntotal = tsuma
		this.clb_tx_simplu1.Refresh 
	ENDPROC

	PROCEDURE inainte_de_do_termin
		PRIVATE pobj 
		pobj = this.oact 
		
		SELECT actactan
		ZAP 
		
		* SAFT
		IF !m.gl406
			UPDATE plimp SET taxcode = null, paymentcode = null
		ENDIF 
		
		SELECT plimp
		SCAN FOR suma <> 0
			SCATTER NAME oplimp
			SELECT actactan
			APPEND BLANK 
			GATHER NAME pobj
			GATHER NAME oplimp
			SELECT plimp 
		ENDSCAN 
		
		SELECT actactan
		LOCATE 
		lVerificAnalitic = .t.
		lCompletareParteneri = .f.
		DO FORM verificare WITH lVerificAnalitic, lCompletareParteneri 
		IF gnButon <> 1
			RETURN .f.
		ENDIF 
			
		Select actactan
		
		RETURN .t.
		
		
		
		
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		
		this.gridextra1.setup()
		this.grid1.SetFocus
		
		*SAFT
		this.grid1.column10.Visible = m.gl406
		this.grid1.column11.Visible = m.gl406
		
		this.Height = INT(_screen.Height*0.7)
		this.Width = INT(_screen.Width*0.7)
		this.AutoCenter= .T.
	ENDPROC

	PROCEDURE Grid1.Column3.Text1.InteractiveChange
		REPLACE id_partd WITH 0, partd WITH ''
	ENDPROC

	PROCEDURE Grid1.Column3.Text1.LostFocus
		lcCont = scd
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			SELECT plimp
			REPLACE scd WITH ''
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.Column4.Text1.Click
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Grid1.Column4.Text1.LostFocus
		PARAMETERS PlClick
		SELECT plimp
		lcCont = scd
		lcAcont = ascd
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascd','plimp') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Grid1.Column5.Text1.InteractiveChange
		REPLACE id_partc WITH 0, partc WITH ''
	ENDPROC

	PROCEDURE Grid1.Column5.Text1.LostFocus
		lcCont = scc
		llReturn = exista_cont_in_plan_conturi(lcCont) && in oOperatii_comune.prg
		IF !llReturn 
			SELECT plimp
			REPLACE scc WITH ''
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.Column6.Text1.Click
		this.LostFocus(.t.)
	ENDPROC

	PROCEDURE Grid1.Column6.Text1.LostFocus
		PARAMETERS PlClick
		SELECT plimp
		lcCont = scc
		lcAcont = ascc
		llReturn = verific_analitic(plClick, lcCont, lcAcont,'ascc','plimp') && in oOperatii_comune.prg
	ENDPROC

	PROCEDURE Grid1.Column7.Text1.Valid
		thisform.do_executa
	ENDPROC

	PROCEDURE Grid1.Column8.Text1.DblClick
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Grid1.Column8.Text1.InteractiveChange
		SELECT plimp
		lcCont = ALLTRIM(scd)
		
		IF EMPTY(lcCont)	
			RETURN
		ENDIF 
		
		lnId_part = 0
		lcNume = ''
		
		lcSql=[select count(*) as valoare FROM ] + gcS + [.vcoresp_tip_cont where to_number(cont) = ] + lcCont 
		lcCursor = 'c_part'
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		
		SELECT c_part
		IF valoare > 0
			lcTitlu = 'Nume partener ' + lcCont
			locauta = caut_parteneri(lcCont, lcTitlu, .F., .F., .F., .T., Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
		
			If !Empty(locauta.denumire) AND !EMPTY(locauta.id_part)
				lnid_part=locauta.id_part
				lcnume=Alltrim(locauta.denumire)
			ENDIF
		
		ENDIF 
		
		SELECT plimp
		REPLACE id_partd WITH lnid_part, partd WITH lcNume
			
		IF USED('c_part')
			USE IN c_part
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.Column9.Text1.DblClick
		this.InteractiveChange 
	ENDPROC

	PROCEDURE Grid1.Column9.Text1.InteractiveChange
		SELECT plimp
		lcCont = ALLTRIM(scc)
		
		IF EMPTY(lcCont)	
			RETURN
		ENDIF 
		
		lnId_part = 0
		lcNume = ''
		
		lcSql=[select count(*) as valoare FROM ] + gcS + [.vcoresp_tip_cont where to_number(cont) = ] + lcCont 
		lcCursor = 'c_part'
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		
		SELECT c_part
		IF valoare > 0
			lcTitlu = 'Nume partener ' + lcCont
			locauta = caut_parteneri(lcCont, lcTitlu, .F., .F., .F., .T., Iif(Type('poAct.dataact') = 'D', poAct.dataact, {}))
		
			If !Empty(locauta.denumire) AND !EMPTY(locauta.id_part)
				lnid_part=locauta.id_part
				lcnume=Alltrim(locauta.denumire)
			ENDIF
		
		ENDIF 
		
		SELECT plimp
		REPLACE id_partc WITH lnid_part, partc WITH lcNume
			
		IF USED('c_part')
			USE IN c_part
		ENDIF 
	ENDPROC

ENDDEFINE
