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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="tachi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label13" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="tdif" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label14" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label15" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="TITLUFRUMOS1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtRest" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cproclabifa
		*p: dif
		*p: ncu_tva
		*p: nrest
		*p: pcfis
		*p: pnfelcont
		*p: sachi
		*p: suma
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cgridsortlist = grid1
		cproclabifa = 
		dif = 0
		DoCreate = .T.
		Height = 474
		Name = "ocompensari"
		ncu_tva = 0
		nrest = 0
		pcfis = ''
		pnfelcont = -1
		sachi = 0
		suma = 0
		Width = 830
		_shape1.Anchor = 10
		_shape1.Height = 30
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = -1
		_shape1.Width = 831
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 768
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 66
		Lb_titlu_alb_b121.Anchor = 4
		Lb_titlu_alb_b121.Left = 630
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 419
		Lb_titlu_alb_b121.Visible = .F.
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 800
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 15, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		HeaderHeight = 19, ;
		Height = 294, ;
		Left = 7, ;
		Name = "Grid1", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RowHeight = 19, ;
		TabIndex = 2, ;
		Top = 59, ;
		Width = 819, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "nract", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 77, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "dataact", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 65, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "datascad", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 72, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "totctva", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.InputMask = (get_mask(12,gnPa)), ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 76, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "achitat", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.InputMask = (get_mask(12,gnPa)), ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 81, ;
		Column6.BackColor = 236,245,255, ;
		Column6.ColumnOrder = 9, ;
		Column6.ControlSource = "ales", ;
		Column6.CurrentControl = "Check1", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .F., ;
		Column6.Sparse = .F., ;
		Column6.Width = 22, ;
		Column7.BackColor = 236,245,255, ;
		Column7.ColumnOrder = 10, ;
		Column7.ControlSource = "sumaachi", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = (get_mask(12,gnPa)), ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .F., ;
		Column7.Width = 101, ;
		Column8.ColumnOrder = 8, ;
		Column8.ControlSource = "totctva - achitat", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(12,gnPa)), ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 75, ;
		Column9.ColumnOrder = 12, ;
		Column9.ControlSource = "acont", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 47, ;
		Column10.ColumnOrder = 13, ;
		Column10.ControlSource = "explicatia", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 99, ;
		Column11.ColumnOrder = 14, ;
		Column11.ControlSource = "explicatia4", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 122, ;
		Column12.ColumnOrder = 15, ;
		Column12.ControlSource = "explicatia5", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column12", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 116, ;
		Column13.ColumnOrder = 1, ;
		Column13.ControlSource = "serie_act", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "Column13", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 34, ;
		Column14.ColumnOrder = 7, ;
		Column14.ControlSource = "achitatl", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.InputMask = (get_mask(12,gnPa)), ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 76, ;
		Column15.ColumnOrder = 11, ;
		Column15.ControlSource = "totctva - achitat - sumaachi", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Format = "RK", ;
		Column15.InputMask = (get_mask(12,gnPa)), ;
		Column15.Name = "Column15", ;
		Column15.ReadOnly = .T., ;
		Column15.Sparse = .F., ;
		Column15.Width = 94
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Suma repusa in luna", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.Column6.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		BackColor = 236,245,255, ;
		BackStyle = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 13, ;
		Name = "Check1", ;
		ReadOnly = .F., ;
		Top = 51, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Grid1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Bifati", ;
		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 Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'Grid1.Column7.Text1' AS textbox WITH ;
		BackColor = 236,245,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 = "Sold", ;
		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 = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'Label1' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Rest:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 406, ;
		Name = "Label1", ;
		TabIndex = 11, ;
		Top = 446, ;
		Width = 33
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label12' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Valoare document de plata:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 405, ;
		Name = "Label12", ;
		TabIndex = 9, ;
		Top = 363, ;
		Width = 161
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label13' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Suma partiala inscrisa:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 405, ;
		Name = "Label13", ;
		TabIndex = 10, ;
		Top = 390, ;
		Width = 135
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label14' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Diferenta:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 405, ;
		Name = "Label14", ;
		TabIndex = 11, ;
		Top = 421, ;
		Width = 57
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label15' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Caut Nr. Doc.:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 602, ;
		Name = "Label15", ;
		TabIndex = 12, ;
		Top = 37, ;
		Visible = .T., ;
		Width = 85
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Line2' AS line WITH ;
		Anchor = 4, ;
		Height = 0, ;
		Left = 398, ;
		Name = "Line2", ;
		Top = 413, ;
		Width = 317
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'tachi' AS textbox WITH ;
		Anchor = 4, ;
		ControlSource = "thisform.sachi", ;
		DisabledBackColor = 236,245,255, ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPa)), ;
		Left = 566, ;
		Name = "tachi", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 386, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'tdif' AS textbox WITH ;
		Anchor = 4, ;
		ControlSource = "thisform.dif", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPa)), ;
		Left = 566, ;
		Name = "tdif", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 417, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text8' AS textbox WITH ;
		Anchor = 4, ;
		BackColor = 255,255,255, ;
		ControlSource = "thisform.suma", ;
		DisabledBackColor = 255,255,255, ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPa)), ;
		Left = 566, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 3, ;
		Top = 362, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text9' AS textbox WITH ;
		Alignment = 3, ;
		Anchor = 8, ;
		FontSize = 10, ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "9999999999999999", ;
		Left = 683, ;
		Name = "Text9", ;
		SpecialEffect = 1, ;
		TabIndex = 1, ;
		Top = 33, ;
		Value = 0, ;
		Visible = .T., ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'TITLUFRUMOS1' AS titlufrumos WITH ;
		AutoSize = .F., ;
		Height = 20, ;
		Left = 5, ;
		Name = "TITLUFRUMOS1", ;
		Top = 4, ;
		Width = 751, ;
		WordWrap = .F.
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="label" />

	ADD OBJECT 'txtRest' AS textbox WITH ;
		Anchor = 4, ;
		ControlSource = "thisform.nRest", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPa)), ;
		Left = 567, ;
		Name = "txtRest", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 442, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		Local r
		Sele (Thisform.pcfis)
		If Eof() Or Bof()
			r=0
		Else
			r=Recno()
		Endif
		Sele (Thisform.pcfis)
		Sum sumaachi, totctva - achitat - sumaachi To Thisform.sachi, Thisform.nRest For ales
		If r<>0
			Goto r
		Endif
		
		Thisform.Dif=Thisform.suma-Thisform.sachi
		
		Thisform.grid1.Refresh
		Thisform.tachi.Refresh
		Thisform.tdif.Refresh
		thisform.txtRest.Refresh
		
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		SELECT (thisform.pcfis)
		REPLACE ALL ales WITH .f.
		RETURN .t.
	ENDPROC

	PROCEDURE inainte_de_do_termin
		SELECT (thisform.pcfis)
		REPLACE ALL sumaachi2 WITH 0 FOR ales 
		IF TYPE("poact.id_set")<> "U" AND INLIST(poact.id_set, 90011,90013)
			poact.suma = thisform.sachi
			RETURN .t.
		ELSE 
			IF thisform.dif#0
				amessagebox("Trebuie sa acoperiti valoarea documentului de plata!",48,"Atentie")
				RETURN .f.
			ELSE 
				RETURN .t.
			ENDIF 
		
		ENDIF 
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		Thisform.Dif=thisform.suma-Thisform.sachi
		lcSel = ALLTRIM(thisform.pcfis)
		IF TYPE(lcSel+'.dataact') = 'T'
			this.grID1.column2.ControlSource = [TTOD(dataact)]
		ENDIF 
		IF TYPE(lcSel+'.datascad') = 'T'
			this.grID1.column3.ControlSource = [TTOD(datascad)]
		ENDIF
		
		IF this.ncu_tva = 1
			lnIndex = THISFORM.Grid1.ColumnCount + 1
			THISFORM.Grid1.AddColumn(lnIndex)   && Insert column at right.
			THISFORM.Grid1.Columns(THISFORM.Grid1.ColumnCount).Name = "Col_procTva"
			THISFORM.Grid1.Col_procTva.fontName = [Arial]
			THISFORM.Grid1.Col_procTva.fontSize = 10
			THISFORM.Grid1.Col_procTva.header1.caption = 'Coef.TVA'
			THISFORM.Grid1.Col_procTva.header1.fontName = [Arial]
			THISFORM.Grid1.Col_procTva.ControlSource = "proc_tva"
			THISFORM.Grid1.Col_procTva.inputMask = '9.99'
			THISFORM.Grid1.Col_procTva.readonly = .F.
			THISFORM.Grid1.Col_procTva.width = 43
			thisform.grid1.Width = thisform.grid1.Width + 45
			thisform.Width = this.Width + 45
		ENDIF 
		
		* Daca se achita partial, colorez toata linia cu factura, nu numai coloana Rest
		Thisform.Grid1.SetAll("DynamicBackColor", [IIF(ales AND totctva - achitat - sumaachi # 0, RGB(200,200,200), RGB(255,255,255))], "Column") && toate  coloanele gri cand suma achitata partial, altfel alb
		Thisform.Grid1.Column6.DynamicBackColor = [IIF(ales AND totctva - achitat - sumaachi # 0, RGB(200,200,200), RGB(236,245,255))] && coloana ales blue 
		Thisform.Grid1.Column7.DynamicBackColor = [IIF(ales AND totctva - achitat - sumaachi # 0, RGB(200,200,200), RGB(236,245,255))] && coloana achitat blue
		
		
		SELECT (lcSel)
		GO TOP 
		thisform.grid1.column6.SetFocus()
		Thisform.gridextra1.setup()	&&	ROACONT v 2.0.156
		
		This.Height = INT(_screen.Height * 0.7) && 70% screen height
		This.Width = INT(_screen.Width * 0.7) && 70% screen width
		This.AutoCenter = .T.
		
	ENDPROC

	PROCEDURE Grid1.Column6.Check1.Valid
		*!* 21.10.2011
		*!* marius.mutu
		*!* la bifarea unei facturi se completeaza cu minimul dintre diferenta ramasa de acoperit si soldul facturii
		
		*!* 06.04.2020
		*!* in contafin se punea soldul, nu minimul. ACN a cerut sa se puna soldul la bifare, astfel incat sa se vada daca clientul a 
		*!* achitat suma integrala din facturile de pe extrasul de cont
		
		*!* 09.04.2020
		*!* am completat din nou cu diferenta ramasa pe ultimul rand bifat, pentru ca au sunat mai multi clienti ca lor le placea inainte :)
		*!* utilizatorul este atentionat deja vizual prin marcarea randului gri daca randul bifat nu are suma egala cu soldul (THISFORM.SHOW)
		
		LOCAL lcVar
		lcVar = thisform.cproclabifa
		IF EMPTY(lcVar )
			if ales
				IF CONT = '408' OR thisform.suma = 0 && suma de plata =0 
					REPLACE sumaachi with ROUND(totctva,gnPa) - ROUND(achitat,gnPa)
				ELSE 	
					REPLACE sumaachi with MIN(Thisform.dif, ROUND(totctva,gnPa) - ROUND(achitat,gnPa))
		*!*				REPLACE sumaachi with ROUND(totctva,gnPa) - ROUND(achitat,gnPa)
				ENDIF 	
			else
				repl sumaachi with 0
			ENDIF
		ELSE 
			if ales
				PRIVATE pnSumaBifata
				STORE 0 TO pnSumaBifata
				LOCAL lcprocedura
				STORE '' TO lcProcedura
				lcProcedura = 'do '+ALLTRIM(thisform.cproclabifa)
				&lcProcedura
				Sele (thisform.pcfis)
			ELSE
				Sele (thisform.pcfis)
				repl sumaachi with 0
			ENDIF		
		ENDIF 
		thisform.actualizeaza_grid1
		
	ENDPROC

	PROCEDURE Grid1.Column7.Text1.InteractiveChange
		If Inlist(Lastkey(),22)
			Keyboard '{TAB}'
		Endif
	ENDPROC

	PROCEDURE Grid1.Column7.Text1.Valid
		If sumaachi>totctva-achitat And ales
			amessagebox("Suma depaseste valoarea soldului!",48,"Atentie")
		*	repl sumaachi with totctva-achitat
		*	return 0
		Endif
		Thisform.actualizeaza_grid1
	ENDPROC

	PROCEDURE Text8.Valid
		thisform.actualizeaza_grid1
		
	ENDPROC

	PROCEDURE Text9.LostFocus
		lcsel = thisform.grid1.RecordSource 
		SELECT (lcsel)
		loca for nract=this.Value 
		thisform.grid1.SETFOCUS 
	ENDPROC

	PROCEDURE TITLUFRUMOS1.MouseDown
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		If nButton = 1
			thisform.MouseIcon='HMOVE.CUR'
			thisform.MousePointer= 99
			ReleaseCapture()
			SendMessage(Thisform.nHWND, 0x112, 0xF012, 0x0)
			thisform.MousePointer= 0
			SendMessage(Thisform.nHWND, 0x202, 0x0, 0x0)	
		Endif
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column16.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column16.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column18.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column18.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column19.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column19.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="tachi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label13" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="tdif" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label14" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label15" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="TITLUFRUMOS1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtRest" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: curs_val
		*p: dif
		*p: ncu_tva
		*p: nrest
		*p: omonedanationala
		*p: pcfis
		*p: pnfelcont
		*p: sachi
		*p: suma
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cgridsortlist = grid1
		curs_val = 0
		dif = 0
		DoCreate = .T.
		Height = 475
		Name = "ocompensari_val"
		ncu_tva = 0
		nrest = 0
		omonedanationala = .NULL.
		pcfis = ''
		pnfelcont = -1
		sachi = 0
		suma = 0
		Width = 784
		_memberdata = <VFPData>
			<memberdata name="omonedanationala" display="oMonedaNationala"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 787
		_shape2.Anchor = 8
		_shape2.Height = 30
		_shape2.Left = 718
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 67
		Lb_titlu_alb_b121.Left = 12
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 36
		Lb_titlu_alb_b121.Visible = .F.
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 751
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 19, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 289, ;
		Left = 5, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 67, ;
		Width = 775, ;
		ZOrderSet = 2, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 3, ;
		Column1.ControlSource = "dataact", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 85, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "datascad", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 88, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 11, ;
		Column3.ControlSource = "sumaval", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.InputMask = (get_mask(12,gnPval)), ;
		Column3.Name = "Column3", ;
		Column3.Width = 78, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 12, ;
		Column4.ControlSource = "achitatval", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.InputMask = (get_mask(12,gnPval)), ;
		Column4.Name = "Column4", ;
		Column4.Width = 82, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "sumaval-achitatval", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.InputMask = (get_mask(12,gnPval)), ;
		Column5.Name = "Column5", ;
		Column5.Width = 75, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 13, ;
		Column6.ControlSource = "totctva", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.InputMask = (get_mask(12,gnPa)), ;
		Column6.Name = "Column6", ;
		Column6.Width = 89, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 14, ;
		Column7.ControlSource = "achitat", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = (get_mask(12,gnPa)), ;
		Column7.Name = "Column7", ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 5, ;
		Column8.ControlSource = "totctva-achitat", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(12,gnPa)), ;
		Column8.Name = "Column8", ;
		Column9.BackColor = 236,245,255, ;
		Column9.ColumnOrder = 8, ;
		Column9.ControlSource = "ales", ;
		Column9.CurrentControl = "Check1", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.Sparse = .F., ;
		Column9.Width = 30, ;
		Column10.BackColor = 236,245,255, ;
		Column10.ColumnOrder = 9, ;
		Column10.ControlSource = "sumaachi2", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.InputMask = (get_mask(12,gnPval)), ;
		Column10.Name = "Column10", ;
		Column10.Width = 95, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 7, ;
		Column11.ControlSource = "numeval", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 46, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 15, ;
		Column12.ControlSource = "cursschimb", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column12", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 72, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 2, ;
		Column13.ControlSource = "nract", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "Column13", ;
		Column13.Width = 69, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 16, ;
		Column14.ControlSource = "acont", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 47, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 17, ;
		Column15.ControlSource = "explicatia", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "Column15", ;
		Column15.Width = 117, ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 18, ;
		Column16.ControlSource = "explicatia4", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "Column16", ;
		Column16.Width = 104, ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 19, ;
		Column17.ControlSource = "explicatia5", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "Column17", ;
		Column17.Width = 108, ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 1, ;
		Column18.ControlSource = "serie_act", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "Column18", ;
		Column18.Width = 63, ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 10, ;
		Column19.ControlSource = "sumaval-achitatval-sumaachi2", ;
		Column19.FontSize = 10, ;
		Column19.InputMask = (get_mask(12,gnPval)), ;
		Column19.Name = "Column19", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 107
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.Column9.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		BackColor = 236,245,255, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 17, ;
		Name = "Check1", ;
		Top = 23, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

	ADD OBJECT 'Label1' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Rest:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 347, ;
		Name = "Label1", ;
		TabIndex = 11, ;
		Top = 447, ;
		Width = 33
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label12' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Valoare document de plata:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 348, ;
		Name = "Label12", ;
		TabIndex = 9, ;
		Top = 364, ;
		Width = 161
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label13' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Suma partiala inscrisa:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 348, ;
		Name = "Label13", ;
		TabIndex = 10, ;
		Top = 391, ;
		Width = 135
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label14' AS label WITH ;
		Anchor = 4, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Diferenta:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 348, ;
		Name = "Label14", ;
		TabIndex = 11, ;
		Top = 422, ;
		Width = 57
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label15' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Caut nr. doc.:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 566, ;
		Name = "Label15", ;
		TabIndex = 12, ;
		Top = 43, ;
		Visible = .T., ;
		Width = 81
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Line2' AS line WITH ;
		Anchor = 4, ;
		Height = 0, ;
		Left = 341, ;
		Name = "Line2", ;
		Top = 414, ;
		Width = 317
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'tachi' AS textbox WITH ;
		Anchor = 4, ;
		ControlSource = "thisform.sachi", ;
		DisabledBackColor = 236,245,255, ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 509, ;
		Name = "tachi", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 387, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'tdif' AS textbox WITH ;
		Anchor = 4, ;
		ControlSource = "thisform.dif", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 509, ;
		Name = "tdif", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 418, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text8' AS textbox WITH ;
		Anchor = 4, ;
		BackColor = 255,255,255, ;
		ControlSource = "thisform.suma", ;
		DisabledBackColor = 255,255,255, ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 509, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 3, ;
		Top = 363, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text9' AS textbox WITH ;
		Alignment = 3, ;
		FontSize = 10, ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "9999999999999999", ;
		Left = 648, ;
		Name = "Text9", ;
		SpecialEffect = 1, ;
		TabIndex = 1, ;
		Top = 39, ;
		Value = 0, ;
		Visible = .T., ;
		Width = 128
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'TITLUFRUMOS1' AS titlufrumos WITH ;
		Anchor = 10, ;
		AutoSize = .F., ;
		Height = 20, ;
		Left = 5, ;
		Name = "TITLUFRUMOS1", ;
		Top = 5, ;
		Width = 703, ;
		WordWrap = .F.
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="label" />

	ADD OBJECT 'txtRest' AS textbox WITH ;
		Anchor = 4, ;
		ControlSource = "thisform.nRest", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPa)), ;
		Left = 508, ;
		Name = "txtRest", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 443, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		Local r
		Sele (thisform.pcfis)
		If Eof() Or Bof()
			r=0
		Else
			r=Recno()
		Endif
		Sele (thisform.pcfis)
		Sum sumaachi2, sumaval-achitatval-sumaachi2 To Thisform.sachi, Thisform.nRest For ales
		If r<>0
			Goto r
		Endif
		
		Thisform.Dif=thisform.suma-Thisform.sachi
		
		Thisform.grid1.Refresh
		Thisform.tachi.Refresh
		Thisform.tdif.Refresh
		Thisform.txtRest.Refresh
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		SELECT (thisform.pcfis)
		REPLACE ALL ales WITH .f.
		RETURN .t.
	ENDPROC

	PROCEDURE inainte_de_do_termin
		SELECT (thisform.pcfis)
		SCAN FOR ales
			REPLACE sumaachi WITH ROUND(sumaachi2*CURSSCHIMB,gnPc)
			IF (sumaachi > totctva - achitat) OR (sumaval - achitatval - sumaachi2 = 0)
				REPLACE sumaachi WITH totctva - achitat
			ENDIF
		ENDSCAN 
		
		IF thisform.dif#0
			DO mesaj WITH 'Trebuie sa acoperiti valoarea ','documentului de plata!'
			RETURN .f.
		ENDIF 
		
		SELECT (thisform.pcfis)
		SCAN FOR ales
			IF this.curs_val # 0
				diferenta = ROUND((CURSSCHIMB - this.curs_val) * sumaachi2, gnPc)
			ELSE
				diferenta=0
			ENDIF
		
			DO CASE
			CASE diferenta>0 AND this.pnfelcont = 1 && pasiv
				REPLACE difplus WITH diferenta
				REPLACE achilei WITH sumaachi - difplus
				REPLACE cursval WITH this.curs_val
				REPLACE cursdif WITH CURSSCHIMB
			CASE diferenta>0 AND this.pnfelcont = 0 && activ
				REPLACE difminus WITH diferenta
				REPLACE achilei WITH sumaachi - difminus
				REPLACE cursval WITH this.curs_val
				REPLACE cursdif WITH CURSSCHIMB
			CASE diferenta<0 AND this.pnfelcont = 1 && pasiv
				REPLACE difminus WITH ABS(diferenta)
				REPLACE achilei WITH sumaachi
				REPLACE cursval WITH CURSSCHIMB
				REPLACE cursdif WITH this.curs_val
			CASE diferenta<0 AND this.pnfelcont = 0 && activ
				REPLACE difplus WITH ABS(diferenta)
				REPLACE achilei WITH sumaachi
				REPLACE cursval WITH CURSSCHIMB
				REPLACE cursdif WITH this.curs_val
			CASE diferenta=0
				REPLACE difplus WITH 0,difminus WITH 0
				REPLACE achilei WITH sumaachi
				REPLACE cursval WITH CURSSCHIMB
				REPLACE cursdif WITH this.curs_val
			ENDCASE
		ENDSCAN
		
		RETURN .t. 
	ENDPROC

	PROCEDURE Show
		*!* 08.08.2014
		*!* marius.mutu
		*!* salvare moneda nationala pentru verificarea soldului in valuta la selectare facturilor cu sold in moneda nationala
		
		Lparameters nStyle
		
		Thisform.Dif=Thisform.suma-Thisform.sachi
		lcSel = Alltrim(Thisform.pcfis)
		If Type(lcSel+'.dataact') = 'T'
			This.grID1.column1.ControlSource = [TTOD(dataact)]
		Endif
		If Type(lcSel+'.datascad') = 'T'
			This.grID1.column2.ControlSource = [TTOD(datascad)]
		Endif
		
		this.oMonedaNationala = GetMonedaNationala()
					
		If This.ncu_tva = 1
			lnIndex = Thisform.grID1.ColumnCount + 1
			Thisform.grID1.AddColumn(lnIndex)   && Insert column at right.
			Thisform.grID1.Columns(Thisform.grID1.ColumnCount).Name = "Col_procTva"
			Thisform.grID1.Col_procTva.FontName = [Arial]
			Thisform.grID1.Col_procTva.FontSize = 10
			Thisform.grID1.Col_procTva.header1.Caption = 'Coef.TVA'
			Thisform.grID1.Col_procTva.header1.FontName = [Arial]
			Thisform.grID1.Col_procTva.ControlSource = "proc_tva"
			Thisform.grID1.Col_procTva.InputMask = '9.99'
			Thisform.grID1.Col_procTva.ReadOnly = .F.
			Thisform.grID1.Col_procTva.Width = 43
			Thisform.grID1.Width = Thisform.grID1.Width + 45
			Thisform.Width = This.Width + 45
		Endif
		
		* Daca se achita partial, colorez toata linia cu factura, nu numai coloana Rest
		Thisform.Grid1.SetAll("DynamicBackColor", [IIF(ales AND sumaval-achitatval-sumaachi2 # 0, RGB(200,200,200), RGB(255,255,255))], "Column")
		Thisform.Grid1.Column9.DynamicBackColor = [IIF(ales AND totctva - achitat - sumaachi # 0, RGB(200,200,200), RGB(236,245,255))] && coloana ales blue 
		Thisform.Grid1.Column10.DynamicBackColor = [IIF(ales AND totctva - achitat - sumaachi # 0, RGB(200,200,200), RGB(236,245,255))] && coloana achitat blue
		
		Select (lcSel)
		Go Top
		Thisform.grID1.column9.SetFocus()
		
		This.Height = INT(_screen.Height * 0.7) && 70% screen height
		This.Width = INT(_screen.Width * 0.7) && 70% screen width
		This.AutoCenter = .T.
		
	ENDPROC

	PROCEDURE Grid1.Column10.Text1.InteractiveChange
		If Inlist(Lastkey(),22)
			Keyboard '{TAB}'
		Endif
	ENDPROC

	PROCEDURE Grid1.Column10.Text1.Valid
		IF sumaachi2 > ROUND(sumaval - achitatval,gnPval) AND ales
			DO mesaj WITH 'Suma depaseste valoarea soldului!',''
		*	REPL sumaachi2 WITH sumaval-achitatval
		*	RETURN 0
		ENDIF
		thisform.actualizeaza_grid1 
	ENDPROC

	PROCEDURE Grid1.Column9.Check1.Valid
		*!* 21.10.2011
		*!* marius.mutu
		*!* la bifarea unei facturi se completeaza cu minimul dintre diferenta ramasa de acoperit si soldul facturii
		
		*!* 08.08.2014
		*!* marius.mutu
		*!* folosesc formularul si pentru plati facturi in moneda nationala cu valuta = nu trebuie sa se verifice soldul  in valuta,nu exista
		
		if ales
				repl sumaachi2 with MIN(thisform.dif, ROUND(sumaval-achitatval,gnPval))
		*!*		repl sumaachi2 with ROUND(sumaval-achitatval,gnPval)
			
			IF sumaachi2 = 0 AND id_valuta <> thisform.oMonedaNationala.id_valuta && folosesc formularul si pentru plati facturi in lei cu valuta
				DO mesaj WITH "Bifati doar inregistrarile","care au sold in valuta!"
				REPLACE ales WITH .f.
			ENDIF 
		else
			repl sumaachi2 with 0
		ENDIF
		
		thisform.actualizeaza_grid1 
	ENDPROC

	PROCEDURE Text8.Valid
		thisform.actualizeaza_grid1 
	ENDPROC

	PROCEDURE Text9.LostFocus
		lcsel = thisform.grid1.RecordSource 
		SELECT (lcsel)
		loca for nract=this.Value 
		thisform.grid1.SETFOCUS 
	ENDPROC

	PROCEDURE TITLUFRUMOS1.MouseDown
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		If nButton = 1
			thisform.MouseIcon='HMOVE.CUR'
			thisform.MousePointer= 99
			ReleaseCapture()
			SendMessage(Thisform.nHWND, 0x112, 0xF012, 0x0)
			thisform.MousePointer= 0
			SendMessage(Thisform.nHWND, 0x202, 0x0, 0x0)	
		Endif
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column9.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column15.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column15.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column16.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column16.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column18.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column18.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column19.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column19.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="tachi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label13" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="tdif" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label14" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label15" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="TITLUFRUMOS1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: curs_val
		*p: dif
		*p: ncu_tva
		*p: omonedanationala
		*p: pcfis
		*p: pnfelcont
		*p: sachi
		*p: sachi2
		*p: suma
		*p: sumaval2conv		&& suma in valuta de incasare care se converteste in valuta facturii
		*p: suma_2
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cgridsortlist = grid1
		curs_val = 0
		dif = 0
		DoCreate = .T.
		Height = 449
		Name = "ocompensari_val_2"
		ncu_tva = 0
		omonedanationala = .NULL.
		pcfis = ''
		pnfelcont = -1
		sachi = 0
		sachi2 = .F.
		suma = 0
		sumaval2conv = 0
		suma_2 = .F.
		Width = 784
		_memberdata = <VFPData>
			<memberdata name="sumaval2conv" type="property" display="SumaVal2Conv"/>
			<memberdata name="omonedanationala" display="oMonedaNationala"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 785
		_shape2.Height = 30
		_shape2.Left = 718
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 67
		Lb_titlu_alb_b121.Left = 12
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.Top = 36
		Lb_titlu_alb_b121.Visible = .F.
		BUT_TERMIN1.Alignment = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 751
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		BackColor = 255,255,255, ;
		ColumnCount = 19, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 289, ;
		Left = 5, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RowHeight = 19, ;
		TabIndex = 1, ;
		Top = 67, ;
		Width = 775, ;
		ZOrderSet = 2, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 3, ;
		Column1.ControlSource = "dataact", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 84, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "datascad", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.Width = 88, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "sumaval", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.InputMask = (get_mask(12,gnPval)), ;
		Column3.Name = "Column3", ;
		Column3.Width = 78, ;
		Column4.BackColor = 255,255,255, ;
		Column4.ColumnOrder = 6, ;
		Column4.ControlSource = "achitatval", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.InputMask = (get_mask(12,gnPval)), ;
		Column4.Name = "Column4", ;
		Column4.Width = 82, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "sumaval-achitatval", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.InputMask = (get_mask(12,gnPval)), ;
		Column5.Name = "Column5", ;
		Column5.Width = 67, ;
		Column6.BackColor = 255,255,255, ;
		Column6.ColumnOrder = 10, ;
		Column6.ControlSource = "totctva", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.InputMask = (get_mask(12,gnPa)), ;
		Column6.Name = "Column6", ;
		Column6.Width = 68, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ColumnOrder = 11, ;
		Column7.ControlSource = "achitat", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.InputMask = (get_mask(12,gnPa)), ;
		Column7.Name = "Column7", ;
		Column7.Width = 70, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ColumnOrder = 12, ;
		Column8.ControlSource = "totctva-achitat", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(12,gnPa)), ;
		Column8.Name = "Column8", ;
		Column8.Width = 69, ;
		Column9.BackColor = 236,245,255, ;
		Column9.ColumnOrder = 13, ;
		Column9.ControlSource = "ales", ;
		Column9.CurrentControl = "Check1", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.Sparse = .F., ;
		Column9.Width = 30, ;
		Column10.BackColor = 236,245,255, ;
		Column10.ColumnOrder = 14, ;
		Column10.ControlSource = "sumaachi22", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.InputMask = (get_mask(12,gnPval)), ;
		Column10.Name = "Column10", ;
		Column10.Width = 95, ;
		Column11.BackColor = 255,255,255, ;
		Column11.ColumnOrder = 8, ;
		Column11.ControlSource = "numeval", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 41, ;
		Column12.BackColor = 255,255,255, ;
		Column12.ColumnOrder = 9, ;
		Column12.ControlSource = "cursschimb", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column12", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 72, ;
		Column13.BackColor = 255,255,255, ;
		Column13.ColumnOrder = 2, ;
		Column13.ControlSource = "nract", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "Column13", ;
		Column13.Width = 82, ;
		Column14.BackColor = 255,255,255, ;
		Column14.ColumnOrder = 16, ;
		Column14.ControlSource = "acont", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 47, ;
		Column15.BackColor = 255,255,255, ;
		Column15.ColumnOrder = 17, ;
		Column15.ControlSource = "explicatia", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "Column15", ;
		Column15.Width = 117, ;
		Column16.BackColor = 255,255,255, ;
		Column16.ColumnOrder = 18, ;
		Column16.ControlSource = "explicatia4", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "Column16", ;
		Column16.Width = 104, ;
		Column17.BackColor = 255,255,255, ;
		Column17.ColumnOrder = 19, ;
		Column17.ControlSource = "explicatia5", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "Column17", ;
		Column17.Width = 108, ;
		Column18.BackColor = 255,255,255, ;
		Column18.ColumnOrder = 1, ;
		Column18.ControlSource = "serie_act", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "Column18", ;
		Column18.Width = 59, ;
		Column19.BackColor = 255,255,255, ;
		Column19.ColumnOrder = 15, ;
		Column19.ControlSource = "nume_val2", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "Column19", ;
		Column19.Width = 94
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.Column9.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		BackColor = 236,245,255, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 17, ;
		Name = "Check1", ;
		Top = 23, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

	ADD OBJECT 'Label12' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Valoare document de plata:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 475, ;
		Name = "Label12", ;
		TabIndex = 9, ;
		Top = 364, ;
		Width = 161
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label13' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Suma partiala inscrisa:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 475, ;
		Name = "Label13", ;
		TabIndex = 10, ;
		Top = 391, ;
		Width = 135
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label14' AS label WITH ;
		Anchor = 12, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Diferenta:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 475, ;
		Name = "Label14", ;
		TabIndex = 11, ;
		Top = 422, ;
		Width = 57
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label15' AS label WITH ;
		Anchor = 8, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Caut nr. doc.:", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 558, ;
		Name = "Label15", ;
		TabIndex = 12, ;
		Top = 43, ;
		Visible = .T., ;
		Width = 81
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Line2' AS line WITH ;
		Anchor = 12, ;
		Height = 0, ;
		Left = 468, ;
		Name = "Line2", ;
		Top = 414, ;
		Width = 317
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'tachi' AS textbox WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.sachi2", ;
		DisabledBackColor = 236,245,255, ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 636, ;
		Name = "tachi", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 387, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'tdif' AS textbox WITH ;
		Anchor = 12, ;
		ControlSource = "thisform.dif", ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 636, ;
		Name = "tdif", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 418, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text8' AS textbox WITH ;
		Anchor = 12, ;
		BackColor = 255,255,255, ;
		ControlSource = "thisform.suma_2", ;
		DisabledBackColor = 255,255,255, ;
		FontSize = 10, ;
		Format = "r", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPval)), ;
		Left = 636, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		TabIndex = 3, ;
		Top = 363, ;
		Width = 142
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Text9' AS textbox WITH ;
		Alignment = 3, ;
		Anchor = 8, ;
		FontSize = 10, ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "9999999999999999", ;
		Left = 636, ;
		Name = "Text9", ;
		SpecialEffect = 1, ;
		TabIndex = 1, ;
		Top = 39, ;
		Value = 0, ;
		Visible = .T., ;
		Width = 140
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'TITLUFRUMOS1' AS titlufrumos WITH ;
		AutoSize = .F., ;
		Height = 20, ;
		Left = 5, ;
		Name = "TITLUFRUMOS1", ;
		Top = 5, ;
		Width = 679, ;
		WordWrap = .F.
		*< END OBJECT: ClassLib="baza.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		
		Local r
		Sele (thisform.pcfis)
		If Eof() Or Bof()
			r = 0
		Else
			r = Recno()
		Endif
		Sele (thisform.pcfis)
		*Sum sumaachi2 To Thisform.sachi For ales
		
		*!* suma in valuta facturii/ in valuta de incasare care se converteste (ex: platesc 14 USD pentru o factura de 10 EURO)
		Sum sumaachi2, sumaachi22 To Thisform.sachi, thisform.SumaVal2Conv  For ales AND id_valuta <> id_valuta2
		SUM sumaachi22 TO thisform.sachi2 FOR ales
		If r<>0
			Goto r
		Endif
		
		*Thisform.Dif = thisform.suma - Thisform.sachi
		Thisform.Dif = thisform.suma_2 - Thisform.sachi2
		
		Thisform.grid1.Refresh
		Thisform.tachi.Refresh
		Thisform.tdif.Refresh
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		Select (Thisform.pcfis)
		Replace All ales With .F.
		Return .T.
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		*!*	19.05.2009
		*!*	alex.lepadatu
		&& sumaachi2 = valoarea in valuta facturii (euro)
		&& sumaachi22 = valoarea in valuta de incasare(usd)
		&& m.suma_32 = cursul usd
		&& m.suma_3 = cursul euro
		*!*	diferenta = valoarea in valuta facturii la cursul facturii - ;
		*!*	valoarea in valuta de incasare la cursul valutei de incasare ;
		*!*	in loc de diferenta de curs * suma incasata
		*!* suma care se converteste din valuta de incasare in valuta facturii (poAct.totftva = suma in lei, poAct.suma_22a = suma in valuta de incasare)
		
		LOCAL lnCurs,lnValoareFacturi, lnDiferentaCurs, lnDiferentaZecimale
		SET STEP ON 
		SELECT (THISFORM.pcfis)
		SCAN FOR ales
			*	lnCurs = Iif(Alltrim(numeval) = Alltrim(nume_42),poact.suma_32,poact.suma_3)
			lnCurs = IIF(id_valuta = id_valuta2, poact.suma_32, poact.suma_3)
			REPLACE sumaachi WITH ROUND(sumaachi2 * CURSSCHIMB,gnPc)
			IF (sumaachi > totctva - achitat) OR (sumaval - achitatval - sumaachi2 = 0)
				REPLACE sumaachi WITH totctva - achitat
			ENDIF
		ENDSCAN
		
		IF THISFORM.DIF # 0
			DO mesaj WITH 'Trebuie sa acoperiti valoarea ','documentului de plata!'
			RETURN .F.
		ENDIF
		
		SELECT (THISFORM.pcfis)
		SCAN FOR ales
			lnCurs = IIF(id_valuta = id_valuta2, poact.suma_32, poact.suma_3)
			IF lnCurs # 0
				*		diferenta = Round((CURSSCHIMB - This.curs_val) * sumaachi2, gnPc)
				*!*			diferenta=Round(CURSSCHIMB * sumaachi2, gnPc) -Round(poact.suma_32 * sumaachi22, gnPc)
				diferenta = ROUND((CURSSCHIMB - lnCurs) * sumaachi2, gnPc)
		
			ELSE
				diferenta=0
			ENDIF
		
		
			DO CASE
				CASE diferenta>0 AND THIS.pnfelcont = 1 && pasiv
					REPLACE difplus WITH diferenta
					REPLACE achilei WITH sumaachi - difplus
					REPLACE cursval WITH lnCurs
					REPLACE cursdif WITH CURSSCHIMB
				CASE diferenta>0 AND THIS.pnfelcont = 0 && activ
					REPLACE difminus WITH diferenta
					REPLACE achilei WITH sumaachi - difminus
					REPLACE cursval WITH lnCurs
					REPLACE cursdif WITH CURSSCHIMB
				CASE diferenta<0 AND THIS.pnfelcont = 1 && pasiv
					REPLACE difminus WITH ABS(diferenta)
					REPLACE achilei WITH sumaachi
					REPLACE cursval WITH CURSSCHIMB
					REPLACE cursdif WITH lnCurs
				CASE diferenta<0 AND THIS.pnfelcont = 0 && activ
					REPLACE difplus WITH ABS(diferenta)
					REPLACE achilei WITH sumaachi
					REPLACE cursval WITH CURSSCHIMB
					REPLACE cursdif WITH lnCurs
				CASE diferenta=0
					REPLACE difplus WITH 0,difminus WITH 0
					REPLACE achilei WITH sumaachi
					REPLACE cursval WITH CURSSCHIMB
					REPLACE cursdif WITH lnCurs
			ENDCASE
		ENDSCAN
		poact.suma_2 = THISFORM.sachi
		poact.suma_22 = THISFORM.sachi2
		
		*!* suma care se converteste din valuta de incasare in valuta facturii (.totftva = suma in lei, suma_22a = suma in valuta de incasare)
		SUM ROUND(sumaachi22*poAct.suma_32, gnPC), sumaachi22 TO poact.totftva, poact.suma_22a FOR ales AND id_valuta <> id_valuta2
		
		CALCULATE SUM(ROUND(CURSSCHIMB * sumaachi2, gnPc)), SUM(IIF(THIS.pnfelcont = 1, difminus-difplus, difplus-difminus)) TO lnValoareFacturi, lnDiferentaCurs
		lnDiferentaZecimale = ROUND(poact.suma_22 * poact.suma_32,gnPc) - (lnValoareFacturi + lnDiferentaCurs)
		LOCATE FOR ales AND (difplus # 0 OR difminus # 0)
		IF FOUND()
			REPLACE difplus WITH IIF(difplus # 0, difplus + lnDiferentaZecimale,0), ;
				difminus WITH IIF(difminus # 0, difminus + lnDiferentaZecimale,0)
		ENDIF
		RETURN .T.
		
		
	ENDPROC

	PROCEDURE Show
		Lparameters nStyle
		
		this.oMonedaNationala = GetMonedaNationala()
		
		Thisform.Dif = Thisform.suma - Thisform.sachi
		lcSel = Alltrim(Thisform.pcfis)
		If Type(lcSel + '.dataact') = 'T'
			This.grID1.column1.ControlSource = [TTOD(dataact)]
		Endif
		If Type(lcSel + '.datascad') = 'T'
			This.grID1.column2.ControlSource = [TTOD(datascad)]
		Endif
		
		If This.ncu_tva = 1
			lnIndex = Thisform.grID1.ColumnCount + 1
			Thisform.grID1.AddColumn(lnIndex)   			&& Insert column at right.
			Thisform.grID1.Columns(Thisform.grID1.ColumnCount).Name = "Col_procTva"
			Thisform.grID1.Col_procTva.FontName = [Arial Narrow]
			Thisform.grID1.Col_procTva.FontSize = 9
			Thisform.grID1.Col_procTva.header1.Caption = 'Coef.TVA'
			Thisform.grID1.Col_procTva.header1.FontName = [Arial Narrow]
			Thisform.grID1.Col_procTva.ControlSource = "proc_tva"
			Thisform.grID1.Col_procTva.InputMask = '9.99'
			Thisform.grID1.Col_procTva.ReadOnly = .F.
			Thisform.grID1.Col_procTva.Width = 43
			Thisform.grID1.Width = Thisform.grID1.Width + 45
			Thisform.Width = This.Width + 45
		Endif
		
		Select (lcSel)
		Go Top
		Thisform.grID1.column9.SetFocus()
		
		
		*!*	26.05.2009
		*!*	daca cursul pt valuta de incasare = 0 (lei) il initializez cu 1
		If poact.suma_32 = 0
			poact.suma_32 = 1
		Endif
		Thisform.suma_2 = poact.suma_22
		Thisform.sachi2 = 0
		Thisform.suma_2 = 0
		Thisform.Dif = Thisform.suma_2 - Thisform.sachi2
		
		thisform.text8.Value = poact.suma_22
		Select (Thisform.grID1.RecordSource)
		
		IF !EMPTY(NVL(poAct.id_valuta2,0))
			replace ALL nume_val2 WITH poact.nume_val2, id_valuta2 WITH poAct.id_valuta2
		ENDIF 	
		thisform.grid1.Refresh()
		
		Go Top
		
		This.Height = INT(_screen.Height * 0.7) && 70% screen height
		This.Width = INT(_screen.Width * 0.7) && 70% screen width
		This.AutoCenter = .T.
		
	ENDPROC

	PROCEDURE Grid1.Column10.Text1.InteractiveChange
		If Inlist(Lastkey(),22)
			Keyboard '{TAB}'
		Endif
	ENDPROC

	PROCEDURE Grid1.Column10.Text1.Valid
		&& sumaachi2 = valoarea in valuta facturii (euro)
		&& sumaachi22 = valoarea in valuta de incasare(usd)
		&& m.suma_32 = cursul usd
		&& m.suma_3 = cursul euro
		
		
		*!* 08.08.2014
		*!* marius.mutu
		*!* tratez cazul platii facturilor in moneda nationala cu valuta, unde nu exista sold in valuta pe facturi
		
		Local lnCurs
		Sele (Thisform.pcfis)
		
		*lncurs = IIF(ALLTRIM(numeval) = ALLTRIM(nume_val2),poact.suma_32,poact.suma_3)
		lnCurs = Iif(id_valuta = id_valuta2, poact.suma_32, poact.suma_3)
		If lnCurs <> 0
			Replace sumaachi2 With Round(sumaachi22 * poact.suma_32 / m.lnCurs, 2)
		Endif
		
		If id_valuta  = Thisform.oMonedaNationala.id_valuta
			If sumaachi2 > Round(totctva - achitat, gnPval) And ales
				Do mesaj With 'Suma depaseste valoarea soldului!',''
				Repl sumaachi2 With totctva - achitat
				Return 0
			Endif
		Else
			If sumaachi2 > Round(sumaval - achitatval,gnPval) And ales
				Do mesaj With 'Suma depaseste valoarea soldului!',''
				Repl sumaachi2 With sumaval - achitatval
				Return 0
			Endif
		Endif
		Thisform.actualizeaza_grid1
		
	ENDPROC

	PROCEDURE Grid1.Column9.Check1.Valid
		&& sumaachi2 = valoarea in valuta facturii (euro)
		&& sumaachi22 = valoarea in valuta de incasare(usd)
		&& m.suma_32 = cursul usd
		&& m.suma_3 = cursul euro
		
		*!* 08.08.2014
		*!* marius.mutu
		*!* folosesc formularul si pentru plati facturi in moneda nationala cu valuta = nu trebuie sa se verifice soldul  in valuta,nu exista
		
		
		Local lncurs
		Sele (Thisform.pcfis)
		
		If ales
			lncurs = Iif(id_valuta = id_valuta2, poact.suma_32, poact.suma_3)
			*	lncurs = Iif(id_valuta = poact.id_valuta2, poact.suma_32, poact.suma_3)
			Repl sumaachi2 With Round(sumaval - achitatval,gnPval)
			If poact.suma_32 > 0
				Replace sumaachi22 With Round(sumaachi2 * m.lncurs / poact.suma_32,2)
			Endif
			If sumaachi2= 0 And id_valuta <> Thisform.oMonedaNationala.id_valuta && folosesc formularul si pentru plati facturi in lei cu valuta
				Do mesaj With "Bifati doar inregistrarile","care au sold in valuta!"
				Replace ales With .F.
			Endif
		Else
			Repl sumaachi2 With 0, sumaachi22 With 0
		Endif
		Thisform.actualizeaza_grid1
		
	ENDPROC

	PROCEDURE Text8.Valid
		thisform.actualizeaza_grid1
	ENDPROC

	PROCEDURE Text9.LostFocus
		lcsel = thisform.grid1.RecordSource 
		SELECT (lcsel)
		loca for nract=this.Value 
		thisform.grid1.SETFOCUS 
	ENDPROC

	PROCEDURE TITLUFRUMOS1.MouseDown
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		If nButton = 1
			thisform.MouseIcon='HMOVE.CUR'
			thisform.MousePointer= 99
			ReleaseCapture()
			SendMessage(Thisform.nHWND, 0x112, 0xF012, 0x0)
			thisform.MousePointer= 0
			SendMessage(Thisform.nHWND, 0x202, 0x0, 0x0)	
		Endif
	ENDPROC

ENDDEFINE
