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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cLuna.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cLuna.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cAn.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cAn.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataInventar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataInventar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cValidat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataOraV.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataOraV.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtilV.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtilV.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cNract.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cNract.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cNnir.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cNnir.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cIdfact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cIdfact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_help1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	#INCLUDE "..\roa.h"
	*<DefinedPropArrayMethod>
		*p: ldeblocarecorectie
		*p: lmagazin
		*p: ntip		&& Tipul inventarului; daca e -1, atunci le arata pe toate.
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 521
		ldeblocarecorectie = .F.
		lmagazin = .F.
		Name = "frm_inventar_centralizator"
		ntip = -1
		Width = 681
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 681
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 456
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Visible = .T.
		_shape2.Width = 226
		Lb_titlu_alb_b121.Caption = "LISTA INVENTARE"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Left = 650
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 12
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 42
	*</PropValue>

	ADD OBJECT 'But_help1' AS but_help WITH ;
		Anchor = 9, ;
		Left = 457, ;
		Name = "But_help1", ;
		Picture = ..\grafice\help_sus.bmp, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = do_modifica, ;
		Left = 590, ;
		Name = "But_modifica2", ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Left = 532, ;
		Name = "But_start_criterii1", ;
		Top = 1
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		Anchor = 9, ;
		caction = do_sterge, ;
		Left = 620, ;
		Name = "But_sterge2", ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdinventare' AS _grdbase WITH ;
		Anchor = 15, ;
		ColumnCount = 12, ;
		DeleteMark = .F., ;
		Height = 469, ;
		Left = 14, ;
		Name = "grdinventare", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crsinventare", ;
		RowHeight = 19, ;
		TabIndex = 2, ;
		Top = 47, ;
		Width = 658, ;
		Column1.ControlSource = "luna", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cLuna", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 45, ;
		Column2.ControlSource = "an", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cAn", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 36, ;
		Column3.ControlSource = "data_inventar", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDataInventar", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 78, ;
		Column4.ControlSource = "util", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cUtil", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 103, ;
		Column5.ControlSource = "descriere", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cDescriere", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 106, ;
		Column6.ControlSource = "validat", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cValidat", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 53, ;
		Column7.Comment = "dataorav", ;
		Column7.ControlSource = "dataorav", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cDataOraV", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 111, ;
		Column8.Comment = "utilv", ;
		Column8.ControlSource = "utilv", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cUtilV", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 102, ;
		Column9.ControlSource = "IIF(TIP=1, 'Inventar materiale/marfa', IIF(TIP=2, 'Inventar Obiecte de inventar in folosinta', IIF(TIP=3, 'Inventar cu bon de consum', IIF(TIP=4,'Inventar productie vin','Inventar magazin'))))", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cTip", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 164, ;
		Column10.ControlSource = "nract", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cNract", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 88, ;
		Column11.ControlSource = "nnir", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cNnir", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 90, ;
		Column12.ControlSource = "id_fact", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cIdfact", ;
		Column12.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'grdinventare.cUtil.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Utilizator inventar", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdinventare.cUtilV.Header1' AS header WITH ;
		Caption = "Utilizator validare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdinventare.cValidat.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 51, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 36, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.grdInventare, ;
		Height = 17, ;
		Left = 136, ;
		Name = "Gridextra1", ;
		Top = 33, ;
		Width = 20
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru=tcFiltru
		
		If Empty(lcFiltru)
			lcFiltru=poInventare.ca_baza1.cfiltru
		Endif
		
		Thisform.MousePointer = 11
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grdinventare)
		poInventare.ca_baza1.cfiltru=lcFiltru
		poInventare.ca_baza1.afisare()
		restore_grid_tag(Thisform.grdinventare)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE do_adauga
		*!* 24.02.2010
		*!* marius.mutu
		*!* integrare cu INVENTAR MAGAZIN (TIP 5)
		
		*!* 31.05.2010
		*!* marius.mutu
		*!* pack_inventar.adauga_inventar( + stocfaptic0)
		*!* daca se initializeaza stocul faptic cu 0 sau cu stocul scriptic
		
		*!* 02.06.2010
		*!* marius.mutu
		*!* ofer posibilitatea cu initializare stoc faptic 0 si la inventar normal
		
		*!* 14.07.2017
		*!* marius.mutu
		*!* Se verifica stocul precedent inainte de adaugarea inventarului
				
		Private pnIdCInventar
		pnIdCInventar = 0
		
		Local loFrmAdaugare, lcGestiuni, lcIdGestiune, lcListaDenumireGestiuni, lcListaIdGestiuni
		Private poArt,nTipInv
		Select crsinventare
		Scatter Name poArt Blank Memo
		*!* 24.02.2010
		ADDPROPERTY(poArt, 'OptiuneInventar', 1)
		ADDPROPERTY(poArt, 'NumarLuni', 1)
		*!* 24.02.2010 ^
		
		*!* 31.05.2010
		ADDPROPERTY(poArt, 'StocFaptic0', 0)
		*!* 31.05.2010 ^
		
		poArt.descriere = ""
		poArt.an = gnAn
		poArt.luna = gnLuna
		poArt.id_util = gnIdUtil
		*!*	modificare	ROAVIN v 2.0.0
		If Thisform.nTip <> - 1
			nTipInv = Thisform.nTip
		Else
		*!*	modificare	ROAVIN v 2.0.0	^
			nTipInv = 1
			lofrmTip = Createobject("tip_inventar")
			lofrmTip.Show(1)
		*!*	modificare	ROAVIN v 2.0.0
		Endif
		*!*	modificare	ROAVIN v 2.0.0	^
		
		*!*	lcXMLGestiune = caut_gestiune_xml(2,.t.) && gestiunile pe care are drept utilizatorul, <toate inregistrarile> 
		*!*	modificare	v 2.0.186
		*!*	lcXMLGestiune = caut_gestiune_xml(2,.t., CA_PORNIRE_INCEPE)&& gestiunile pe care are drept utilizatorul, <toate inregistrarile> 
		*!*	lcXMLGestiune = caut_gestiune_xml(2,.F., CA_PORNIRE_INCEPE)&& gestiunile pe care are drept utilizatorul, <toate inregistrarile> 
		*!*	modificare	v 2.0.186	^
		lcListaDenumireGestiuni = ""
		lcListaIdGestiuni = ""
		
		lcXMLGestiune = caut_gestiune_xml(2,.T., CA_PORNIRE_INCEPE, .T., @lcListaIdGestiuni, @lcListaDenumireGestiuni)&& gestiunile pe care are drept utilizatorul, <toate inregistrarile>
		If !Empty(m.lcXMLGestiune) And gnButon = 1 AND !EMPTY(m.lcListaIdGestiuni)
		
			poArt.id_gestiuni = m.lcListaIdGestiuni
			poArt.descriere = m.lcListaDenumireGestiuni
			loFrmAdaugare = Createobject("frm_inventar_nou")
			loFrmAdaugare.cDescriereGestiuni = m.lcListaDenumireGestiuni
			*!* 24.02.2010
			IF nTipInv <> 5 && INVENTAR MAGAZIN -- ascund optiunile doar pentru inventarul de magazin
				loFrmAdaugare.optInventar.visible = .F.
				loFrmAdaugare.txtNumarLuni.visible = .F.
				*!* 02.06.2010
		*!*			loFrmAdaugare.HEIGHT = loFrmAdaugare.ed_tx_simplu1.top + loFrmAdaugare.ed_tx_simplu1.height + 10
				loFrmAdaugare.HEIGHT = loFrmAdaugare.chkstocfaptic.top + loFrmAdaugare.chkstocfaptic.height + 10
				loFrmAdaugare.chkstocfaptic.left =  loFrmAdaugare.ed_tx_simplu1.left
				*!* 02.06.2010 ^		
			ENDIF  		
			*!* 24.02.2010 ^	
			
			loFrmAdaugare.Show(1)
			If gnButon = 1
			*** Verificare stoc precedent gestiuni alese
				lcMesajVerificare = INAINTE_DE_STOC(m.gnAn, m.gnLuna, 0, IIF(m.nTipInv = 2, 1, 0), poArt.id_gestiuni) && in oinainte_de.prg
				IF !EMPTY(m.lcMesajVerificare)
					gnButon = AMESSAGEBOX('Refaceti stocul in luna curenta pe gestiunile cu diferenta de preluare din precedent si apoi reveniti!' + CHR(13) + CHR(10) + CHR(13) + CHR(10) + ;
					'Continuati acum cu stoc incorect (De acord) sau anulati operatia (Abandon)!',1,_screen.Caption)
				ENDIF 	
			ENDIF 
			
			IF m.gnButon = 1	
			*!* 24.02.2010	
		*!*			lcSql = [begin pack_inventar.adauga_inventar(] + Alltrim(Str(poArt.luna)) + [,] + Alltrim(Str(poArt.an)) + [,] + ;
		*!*				['] + Alltrim(Nvl(poArt.descriere,'')) + [',] + lcIdGestiune + [,] + Alltrim(Str(gnIdUtil)) + [,?nTipInv,?gnIdSucursala,?@pnIdCInventar); end;]
				
				lcSql = [begin pack_inventar.adauga_inventar(] + Alltrim(Str(poArt.luna)) + [,] + Alltrim(Str(poArt.an)) + [,] + ;
					['] + Alltrim(Nvl(poArt.descriere,'')) + [',] + poArt.id_gestiuni + [,] + Alltrim(Str(gnIdUtil)) + [,?nTipInv,?gnIdSucursala,?poArt.OptiuneInventar,?poArt.NumarLuni,?poArt.StocFaptic0, ?@pnIdCInventar,] + ;
					IIF(EMPTY(poArt.id_subgrupe_articole), [''], poArt.id_subgrupe_articole) + [,] + IIF(EMPTY(poArt.id_articole), [''], poArt.id_articole) + [); end;]			
			*!* 24.02.2010 ^			
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
					Thisform.grdinventare.SetFocus()
				Else
					*			Thisform.inainte_de_do_termin()
					Thisform.actualizeaza_grid1()
					This.DO_MODIFICA(pnIdCInventar)
				Endif
			Else
				Thisform.grdinventare.SetFocus()
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru, lcValoare1, lcValoare2, loCollection, i, lcTitlu, lnTip
		*!*	modificare ROAVIN v 2.0.0
		*!*	lcFiltru = [2=2]
		lcFiltru = Iif(Thisform.ntip<>-1,[tip = ] + Alltrim(Str(Thisform.ntip)),[2=2])
		*!*	modificare ROAVIN v 2.0.0	^
		If Len(Thisform.filtru_pretty)>0
			lcFiltru = lcFiltru+" and (" + Alltrim(Thisform.filtru_pretty) + ")"
		Endif
		
		If (This.filtru_pretty#"none")
			Thisform.actualizeaza_grid1(lcFiltru)
			If Reccount('crsinventare')=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			Endif
		Endif
		
		Thisform.grdinventare.SetFocus()
		
	ENDPROC

	PROCEDURE do_help
		LOCAL lcFile
		lcFile = gcAppPath + "help\help_inventar.rtf"
		IF FILE(lcFile)
			OPEN_DEFAULT_APP(lcFile)
		ELSE 
			AMESSAGEBOX('Nu exista fisierul ' + lcFile, 0+48,_screen.caption)
		ENDIF 	
	ENDPROC

	PROCEDURE do_modifica
		Lparameters tnIdCInventar
		Local lnIdCInventar, llValidat, llCorectie
		
		lnIdCInventar = Iif(!Empty(tnIdCInventar) And Type('tnIdCInventar') = 'N', tnIdCInventar, 0)
		llValidat = 0
		llCorectie = .F.
		
		This.AlwaysOnTop = .F.
		
		If Empty(m.lnIdCInventar) && MODIFICARE
			If Reccount('crsInventare')>0
				Select crsinventare
				If crsinventare.An*12+crsinventare.Luna=gnan*12+gnluna
					lnIdCInventar = crsinventare.id_c_inventar
					llValidat = NVL(crsinventare.validat,0) = 1
					IF Thisform.lDeblocareCorectie AND m.llValidat
						llCorectie = aMESSAGEBOX("Doriti sa corectati inventarul?",4+32+256, _screen.caption) = 6
					ENDIF 
				Else
					AMESSAGEBOX("Intrati in luna " + Alltrim(Str(crsinventare.Luna)) + "/" + Alltrim(Str(crsinventare.An)), 0+48, "Inventar")
				Endif
			Endif
		Endif
		
		If !Empty(m.lnIdCInventar)
			If crsinventare.tip = 5
				Do vizualizeaza_inventar_magazin With m.lnIdCInventar, m.llCorectie In ointroduceri.prg
			Else
				Do vizualizeaza_inventar With m.lnIdCInventar, m.llCorectie In ointroduceri.prg
			Endif
			This.do_cauta() && daca se valideaza centralizatorul - actualizez tabelul
			Select crsinventare
			Locate For id_c_inventar = m.lnIdCInventar
			If !Found()
				Go Top
			Endif
		ENDIF && !Empty(m.lnIdCInventar)
		
		This.AlwaysOnTop = .T.
		
	ENDPROC

	PROCEDURE do_sterge
		Local lnSucces
		
		If Reccount('crsInventare')>0 and Nvl(crsInventare.id_c_inventar,0) > 0 and Nvl(crsInventare.validat,0) = 0
			If aMessageBox('Doriti sa stergeti inventarul?',4+32,'Inventar') = 6
				lcSql = [begin pack_inventar.sterge_inventar(] + Alltrim(Str(crsInventare.id_c_inventar)) + [,] + Alltrim(Str(gnIdUtil)) + [); end;]
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					amessagebox(goExecutor.cEroare,16,"Eroare")
					Thisform.grdinventare.SetFocus()
				Else
					Thisform.actualizeaza_grid1()
					Thisform.grdinventare.SetFocus()			
				Endif
			EndIf 
		EndIf 
	ENDPROC

	PROCEDURE grid_sort_bind
		* nu sterge - sortarea se face de gridextra
	ENDPROC

	PROCEDURE Init
		*!*	modificare ROAVIN	v 2.0.0
		Lparameters tnTip
		Thisform.ntip = Iif(Empty(tnTip),-1, tnTip)
		*!*	modificare ROAVIN	v 2.0.0	^
		DoDefault()
		Thisform.grdinventare.SetAll("DynamicBackColor","IIF(validat=1,Rgb(220,220,220),Rgb(255,255,255))","Column")
		
		*!* 16.06.2010
		this.gridextra1.setup()
		*!* 16.06.2010 ^
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		lcStringCriterii = "Validate\nofiled\E\(validat = 1)\" + crlf + ;
			"Nevalidate\nofiled\E\(validat = 0)\" + crlf + ;	
			"Data validarii\trunc(dataorav)\D\none\" + crlf + ;
			"Operator validare\utilv\T\ID_UTILv\nom_utilizator" + crlf + ;
			"Perioada\an*12+luna\D1\none\"
		DODEFAULT()
	ENDPROC

	PROCEDURE grdinventare.AfterRowColChange
		LPARAMETERS nColIndex
		If Inlist(This.RowColChange,0,1,3)
			If Reccount('crsInventare')>0
				Select crsinventare
				pnIdCInventar = id_c_inventar
				pnValidat = validat
			Else
				pnIdCInventar = 0
			Endif
		Endif
		
	ENDPROC

	PROCEDURE _shape2.DblClick
		Thisform.lDeblocareCorectie = !Thisform.lDeblocareCorectie
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="grdDocumente" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cAles._linie1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cDataact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cDataact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cNract.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cNract.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cId_fact.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cId_fact.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cDataora.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cDataora.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSerie_act.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSerie_act.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSters.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSters.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cSters.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cDataOras.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cDataOras.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cUtils.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdDocumente.cUtils.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cCodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cCodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cCante.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cCante.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cPretVCTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cPretVCTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cPretCTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cPretCTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cCant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cCant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cNume_gestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdArticole.cNume_gestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_ach_iesiri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_ach_intrari" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_ach_intrari.Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_vz_iesiri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_vz_intrari" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_vz_intrari.Line2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actual_afisare
		*m: do_adauga_ireg
		*m: do_modifica_ireg
		*m: do_sterge_ireg
		*m: refacere_tabel
		*p: nvalachiesiri
		*p: nvalachintrari
		*p: nvalvziesiri
		*p: nvalvzintrari
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 599
		Name = "frm_inventar_doc"
		nvalachiesiri = 0
		nvalachintrari = 0
		nvalvziesiri = 0
		nvalvzintrari = 0
		Width = 752
		_SHAPE1.Anchor = 10
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 792
		_SHAPE2.Anchor = 8
		_SHAPE2.Height = 29
		_SHAPE2.Left = 682
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Visible = .T.
		_SHAPE2.Width = 71
		LB_TITLU_ALB_B121.Caption = "Documente introduse dupa inceperea inventarului"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 1
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 720
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Left = -2
		GRIDSORT1.Name = "GRIDSORT1"
		GRIDSORT1.Top = 33
	*</PropValue>

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

	ADD OBJECT 'clb_ach_iesiri' AS clb_tx_simplu WITH ;
		Anchor = 12, ;
		BorderWidth = 0, ;
		Height = 36, ;
		Left = 492, ;
		Name = "clb_ach_iesiri", ;
		TabIndex = 35, ;
		Top = 542, ;
		Width = 250, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nValAchIesiri", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 155, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 6, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Valoare ach. fara TVA iesiri:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 1, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_ach_intrari' AS clb_tx_simplu WITH ;
		Anchor = 12, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 198, ;
		Name = "clb_ach_intrari", ;
		TabIndex = 33, ;
		Top = 546, ;
		Width = 250, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nValAchIntrari", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 155, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 0, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Valoare ach. fara TVA intrari:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 2, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_ach_intrari.Line2' AS line WITH ;
		Height = 0, ;
		Left = 298, ;
		Name = "Line2", ;
		Top = 13, ;
		Width = 8
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'clb_vz_iesiri' AS clb_tx_simplu WITH ;
		Anchor = 12, ;
		BorderWidth = 0, ;
		Height = 36, ;
		Left = 492, ;
		Name = "clb_vz_iesiri", ;
		TabIndex = 35, ;
		Top = 567, ;
		Width = 250, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nValVzIesiri", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 155, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 6, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Valoare vanz. cu TVA iesiri:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 1, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_vz_intrari' AS clb_tx_simplu WITH ;
		Anchor = 12, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 198, ;
		Name = "clb_vz_intrari", ;
		TabIndex = 33, ;
		Top = 571, ;
		Width = 250, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nValVzIntrari", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 155, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 0, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Valoare vanz. cu TVA intrari:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 2, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_vz_intrari.Line2' AS line WITH ;
		Height = 0, ;
		Left = 298, ;
		Name = "Line2", ;
		Top = 13, ;
		Width = 8
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'grdArticole' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 8, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		HeaderHeight = 33, ;
		Height = 218, ;
		Left = 12, ;
		Name = "grdArticole", ;
		Panel = 1, ;
		RecordSource = "crstmpintart", ;
		TabIndex = 3, ;
		Top = 322, ;
		Width = 732, ;
		Column1.ControlSource = "codmat", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cCodmat", ;
		Column1.Width = 72, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "serie", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "cSerie", ;
		Column2.Width = 84, ;
		Column3.ColumnOrder = 7, ;
		Column3.ControlSource = "cante", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.InputMask = (get_mask(14,gnPCant)), ;
		Column3.Name = "cCante", ;
		Column3.Width = 54, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "pretvctva", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.InputMask = (get_mask(14,gnPPretV)), ;
		Column4.Name = "cPretVCTVA", ;
		Column4.Width = 68, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "pret", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.InputMask = (get_mask(14,gnPPret)), ;
		Column5.Name = "cPretCTVA", ;
		Column5.Width = 67, ;
		Column6.ColumnOrder = 2, ;
		Column6.ControlSource = "denumire", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "cDenumire", ;
		Column6.Width = 160, ;
		Column7.ColumnOrder = 6, ;
		Column7.ControlSource = "cant", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.InputMask = (get_mask(14,gnPCant)), ;
		Column7.Name = "cCant", ;
		Column7.Width = 56, ;
		Column8.ControlSource = "nume_gestiune", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "cNume_gestiune", ;
		Column8.Width = 133
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

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

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

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

	ADD OBJECT 'grdArticole.cNume_gestiune.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 'grdArticole.cPretCTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret achizitie fara TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdArticole.cPretCTVA.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 'grdArticole.cPretVCTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret vanzare cu TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdArticole.cSerie.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 'grdDocumente' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 12, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		HeaderHeight = 50, ;
		Height = 272, ;
		Left = 12, ;
		Name = "grdDocumente", ;
		Panel = 1, ;
		RecordSource = "crstmpintdoc", ;
		TabIndex = 3, ;
		Top = 40, ;
		Width = 732, ;
		Column1.ControlSource = "ales", ;
		Column1.DynamicCurrentControl = "IIF(tip=0,'_checkbox1','_linie1')", ;
		Column1.FontName = "Arial", ;
		Column1.Name = "cAles", ;
		Column1.Sparse = .F., ;
		Column1.Width = 31, ;
		Column2.ControlSource = "dataact", ;
		Column2.FontName = "Arial", ;
		Column2.Name = "cDataact", ;
		Column2.Width = 49, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "nract", ;
		Column3.FontName = "Arial", ;
		Column3.InputMask = (get_mask(14,0)), ;
		Column3.Name = "cNract", ;
		Column3.Width = 84, ;
		Column4.ColumnOrder = 8, ;
		Column4.ControlSource = "id_fact", ;
		Column4.FontName = "Arial", ;
		Column4.InputMask = (get_mask(20,0)), ;
		Column4.Name = "cId_fact", ;
		Column4.Width = 64, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "utilizator", ;
		Column5.FontName = "Arial", ;
		Column5.Name = "cUtilizator", ;
		Column5.Width = 134, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "dataora", ;
		Column6.FontName = "Arial", ;
		Column6.Name = "cDataora", ;
		Column6.Width = 79, ;
		Column7.ColumnOrder = 3, ;
		Column7.ControlSource = "serie_act", ;
		Column7.FontName = "Arial", ;
		Column7.Name = "cSerie_act", ;
		Column7.Width = 66, ;
		Column8.ColumnOrder = 7, ;
		Column8.ControlSource = "explicatia", ;
		Column8.FontName = "Arial", ;
		Column8.Name = "cExplicatie", ;
		Column8.Width = 112, ;
		Column9.ControlSource = "sucursala", ;
		Column9.FontName = "Arial", ;
		Column9.Name = "cSucursala", ;
		Column9.Width = 71, ;
		Column10.ControlSource = "sters", ;
		Column10.CurrentControl = "Check1", ;
		Column10.FontName = "Arial", ;
		Column10.Name = "cSters", ;
		Column10.Sparse = .F., ;
		Column10.Width = 42, ;
		Column11.ControlSource = "dataoras", ;
		Column11.Name = "cDataOras", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 102, ;
		Column12.ControlSource = "utils", ;
		Column12.Name = "cUtils", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 100
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdDocumente.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		Left = 25, ;
		Name = "_checkbox1", ;
		Top = 55
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdDocumente.cAles._linie1' AS _linie WITH ;
		Left = 25, ;
		Name = "_linie1", ;
		Top = 55
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="line" />

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

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

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

	ADD OBJECT 'grdDocumente.cDataora.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data introd.", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDocumente.cDataOras.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora sters", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDocumente.cDataOras.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 'grdDocumente.cExplicatie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdDocumente.cNract.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.document", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdDocumente.cSters.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Height = 17, ;
		Left = 32, ;
		Name = "Check1", ;
		Top = 103, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grdDocumente.cSters.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sters", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdDocumente.cUtilizator.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Utilizator", ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdDocumente.cUtils.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Utilizator stergere", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdDocumente.cUtils.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid2
		LPARAMETERS tnIdFact
		lcCursor = THISFORM.grdArticole.RECORDSOURCE
		THISFORM.grdArticole.salveaza_grid()
		lcSql = [{call pack_inventar.citeste_articole(] + ALLTRIM(STR(tnIdFact)) + [)}]
		lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		IF lnSucces < 0
			amessagebox(goExecutor.cEroare,64,"Eroare")
		ELSE
			CALCULATE SUM(ROUND(pret*cant, 2)), SUM(ROUND(pret*cante, 2)), SUM(ROUND(pretvctva*cant, 2)), SUM(ROUND(pretvctva*cante, 2)) ;
				TO THISFORM.nValAchIntrari, THISFORM.nValAchIesiri, THISFORM.nValVzIntrari, THISFORM.nValVzIesiri IN crstmpintart
		
			THISFORM.clb_ach_iesiri.REFRESH
			THISFORM.clb_ach_intrari.REFRESH
			THISFORM.clb_vz_iesiri.REFRESH
			THISFORM.clb_vz_intrari.REFRESH
			GO TOP IN crstmpintart
		ENDIF
		THISFORM.grdArticole.incarca_grid()
		
	ENDPROC

	PROCEDURE actual_afisare
	ENDPROC

	PROCEDURE do_adauga_ireg
	ENDPROC

	PROCEDURE do_modifica_ireg
	ENDPROC

	PROCEDURE do_sterge_ireg
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Thisform.grdDocumente.SetAll("DynamicBackColor","IIF(tip=1,RGB(128,128,128),RGB(255,255,255))","Column")
		Thisform.grdDocumente.SetAll("DynamicForeColor","IIF(sters=0,RGB(0,0,0),RGB(255,0,0))","Column")
		Thisform.grdDocumente.SetFocus()
		
	ENDPROC

	PROCEDURE refacere_tabel
	ENDPROC

	PROCEDURE grdDocumente.AfterRowColChange
		Lparameters nColIndex
		If This.RowColChange <> 2
			lcCursor = This.RecordSource
			Select (lcCursor)
			Thisform.actualizeaza_grid2(id_fact)
		Endif
		
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="grdinventare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cLuna.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cLuna.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cAn.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cAn.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataInventar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataInventar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cValidat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataOraV.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cDataOraV.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtilV.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cUtilV.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdinventare.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />

	#INCLUDE "..\roa.h"
	*<PropValue>
		BorderStyle = 3
		DoCreate = .T.
		Height = 503
		Name = "frm_inventar_magazin_centralizator"
		Width = 666
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 672
		_shape2.Left = 613
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "LISTA INVENTARE MAGAZIN"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 633
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		caction = do_modifica, ;
		Left = 574, ;
		Name = "But_modifica2", ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 544, ;
		Name = "But_nou1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Left = 486, ;
		Name = "But_reset_criterii1", ;
		Top = 1
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Left = 516, ;
		Name = "But_start_criterii1", ;
		Top = 1
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		caction = do_sterge, ;
		Left = 604, ;
		Name = "But_sterge2", ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdinventare' AS _grdbase WITH ;
		ColumnCount = 9, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 457, ;
		Left = 5, ;
		Name = "grdinventare", ;
		Panel = 1, ;
		RecordSource = "crsinventare", ;
		TabIndex = 2, ;
		Top = 45, ;
		Width = 651, ;
		Column1.ControlSource = "luna", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cLuna", ;
		Column1.Width = 45, ;
		Column2.ControlSource = "an", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "cAn", ;
		Column2.Width = 36, ;
		Column3.ControlSource = "data_inventar", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "cDataInventar", ;
		Column3.Width = 78, ;
		Column4.ControlSource = "util", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "cUtil", ;
		Column4.Width = 90, ;
		Column5.ControlSource = "descriere", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "cDescriere", ;
		Column5.Width = 106, ;
		Column6.ControlSource = "validat", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "cValidat", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 53, ;
		Column7.Comment = "dataorav", ;
		Column7.ControlSource = "dataorav", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "cDataOraV", ;
		Column7.Width = 111, ;
		Column8.Comment = "utilv", ;
		Column8.ControlSource = "utilv", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.Name = "cUtilV", ;
		Column9.ControlSource = "IIF(TIP=1, 'Inventar materiale/marfa', IIF(TIP=2, 'Inventar Obiecte de inventar in folosinta', IIF(TIP=3, 'Inventar cu bon de consum', IIF(TIP=4,'Inventar productie vin','Inventar magazin'))))", ;
		Column9.FontName = "Arial Narrow", ;
		Column9.Name = "cTip", ;
		Column9.Width = 164
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

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

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

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

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

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

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

	ADD OBJECT 'grdinventare.cUtil.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 'grdinventare.cUtilV.Header1' AS header WITH ;
		Caption = "Utilizator validare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdinventare.cUtilV.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 'grdinventare.cValidat.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 51, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 36, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grdinventare.cValidat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Validat", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru=tcFiltru
		
		If Empty(lcFiltru)
			lcFiltru=poInventare.ca_baza1.cfiltru
		Endif
		
		Thisform.MousePointer = 11
		Thisform.LockScreen = .T.
		save_grid_tag(Thisform.grdinventare)
		poInventare.ca_baza1.cfiltru=lcFiltru
		poInventare.ca_baza1.afisare()
		restore_grid_tag(Thisform.grdinventare)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE do_adauga
		Private pnIdCInventar
		pnIdCInventar = 0
		
		Local loFrmAdaugare, lcGestiuni, lcIdGestiune
		Private poArt,nTipInv
		Select crsinventare
		Scatter Name poArt Blank Memo
		ADDPROPERTY(poArt, 'OptiuneInventar', 1)
		ADDPROPERTY(poArt, 'NumarLuni', 1)
		
		
		poArt.descriere = ""
		poArt.an = gnAn
		poArt.luna = gnLuna
		poArt.id_util = gnIdUtil
		nTipInv=5
		*!*	lofrmTip = Createobject("tip_inventar")
		*!*	lofrmTip.Show(1)
		lcXMLGestiune = caut_gestiune_xml(2,.t., CA_PORNIRE_INCEPE) && gestiunile pe care are drept utilizatorul, <toate inregistrarile> 
		If !Empty(lcXMLGestiune) And gnButon = 1
			Xmltocursor(lcXMLGestiune, "crsGestTemp")
			If Reccount('crsGestTemp') = 0
				AMessageBox('Nu ati selectat nici o gestiune!',0+48,'Inventar')
				Return
			EndIf 
			Select crsGestTemp
			Locate For id_gestiune = 0
			If Found() And Reccount('crsGestTemp') = 1
				lcIdGestiune = [NULL]
				lcGestiuni = [TOATE GESTIUNILE]
			Else
				lcIdGestiune = ['] + cursor2lista("crsGestTemp", "id_gestiune", "|")
				lcGestiuni = cursor2lista("crsGestTemp", "nume_gestiune", ",")
			Endif
			Use In crsGestTemp
			If(Right(lcIdGestiune,1)#"|" And lcIdGestiune #[NULL])
				lcIdGestiune=lcIdGestiune+"|"
			Endif
			If lcIdGestiune=[NULL]
			Else
				lcIdGestiune=lcIdGestiune+"'"
			Endif
			
			poArt.descriere = lcGestiuni
			
			loFrmAdaugare = Createobject("frm_inventar_magazin_nou")
			loFrmAdaugare.Show(1)
			If gnButon = 1
				lcSql = [begin pack_inventar.adauga_inventar(] + Alltrim(Str(poArt.luna)) + [,] + Alltrim(Str(poArt.an)) + [,] + ;
					['] + Alltrim(Nvl(poArt.descriere,'')) + [',] + lcIdGestiune + [,] + Alltrim(Str(gnIdUtil)) + [,?nTipInv,?gnIdSucursala,?poArt.OptiuneInventar,?poArt.NumarLuni,?@pnIdCInventar); end;]
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
					Thisform.grdinventare.SetFocus()
				Else
					*			Thisform.inainte_de_do_termin()
					Thisform.actualizeaza_grid1()
					This.DO_MODIFICA(pnIdCInventar)
				Endif
			Else
				Thisform.grdinventare.SetFocus()
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru, lcValoare1, lcValoare2, loCollection, i, lcTitlu
		lcFiltru = [2=2]
		If Len(Thisform.filtru_pretty)>0
			lcFiltru = lcFiltru+" and (" + Alltrim(Thisform.filtru_pretty) + ")"
		Endif
		
		If (This.filtru_pretty#"none")
			Thisform.actualizeaza_grid1(lcFiltru)
			If Reccount('crsinventare')=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			Endif
		Endif
		
		Thisform.grdinventare.SetFocus()
		
	ENDPROC

	PROCEDURE do_modifica
		Lparameters tnIdCInventar
		Local lnRecno
		lnRecno = Recno('crsInventare')
		
		
		This.AlwaysOnTop = .F.
		If Pcount() = 0 && MODIFICARE
			If Reccount('crsInventare')>0
				Select crsinventare
				If crsinventare.An*12+crsinventare.Luna=gnan*12+gnluna
					Do vizualizeaza_inventar_magazin With crsinventare.id_c_inventar In ointroduceri.prg
					This.do_cauta() && daca se valideaza centralizatorul - actualizez tabelul
					Select crsinventare
					If Reccount() >= lnRecno
						Goto lnRecno
					Endif
				Else
					AMESSAGEBOX("Intrati in luna " + Alltrim(Str(crsinventare.luna)) + "/" + Alltrim(Str(crsinventare.an)), 0+48, "Inventar")
				Endif
			Endif
		Else && ADAUGARE + MODIFICARE
			Do vizualizeaza_inventar_magazin With tnIdCInventar In ointroduceri.prg
			This.do_cauta() && daca se valideaza centralizatorul - actualizez tabelul
			Select crsinventare
			Locate For id_c_inventar = tnIdCInventar
			If !Found()
				Go Top
			Endif
		Endif
		
		
		
		This.AlwaysOnTop = .T.
		
	ENDPROC

	PROCEDURE do_sterge
		Local lnSucces
		
		If Reccount('crsInventare')>0 and Nvl(crsInventare.id_c_inventar,0) > 0 and Nvl(crsInventare.validat,0) = 0
			If aMessageBox('Doriti sa stergeti inventarul?',4+32,'Inventar') = 6
				lcSql = [begin pack_inventar.sterge_inventar(] + Alltrim(Str(crsInventare.id_c_inventar)) + [,] + Alltrim(Str(gnIdUtil)) + [); end;]
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					amessagebox(goExecutor.cEroare,16,"Eroare")
					Thisform.grdinventare.SetFocus()
				Else
					Thisform.actualizeaza_grid1()
					Thisform.grdinventare.SetFocus()			
				Endif
			EndIf 
		EndIf 
	ENDPROC

	PROCEDURE Init
		DoDefault()
		Thisform.grdinventare.SetAll("DynamicBackColor","IIF(validat=1,Rgb(220,220,220),Rgb(255,255,255))","Column")
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		lcStringCriterii = "Validate\nofiled\E\(validat = 1)\" + crlf + ;
			"Nevalidate\nofiled\E\(validat = 0)\" + crlf + ;	
			"Data validarii\trunc(dataorav)\D\none\" + crlf + ;
			"Operator validare\utilv\T\ID_UTILv\nom_utilizator" + crlf + ;
			"Perioada\an*12+luna\D1\none\"
		DODEFAULT()
	ENDPROC

	PROCEDURE grdinventare.AfterRowColChange
		LPARAMETERS nColIndex
		If Inlist(This.RowColChange,0,1,3)
			If Reccount('crsInventare')>0
				Select crsinventare
				pnIdCInventar = id_c_inventar
				pnValidat = validat
			Else
				pnIdCInventar = 0
			Endif
		Endif
		
	ENDPROC

ENDDEFINE

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

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

	*<DefinedPropArrayMethod>
		*p: dnf
		*p: lobinv
		*p: obj
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		dnf = 0
		DoCreate = .T.
		Height = 219
		lobinv = .F.
		Name = "frm_inventar_magazin_nou"
		obj = 
		Width = 354
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Inventar nou"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Left = 321
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Height = 84, ;
		Left = 24, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 314, ;
		_edbase1.ControlSource = "poArt.Descriere", ;
		_edbase1.Format = "!", ;
		_edbase1.Height = 75, ;
		_edbase1.Left = 68, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Top = 2, ;
		_edbase1.Width = 244, ;
		_LBBASE1.Caption = "Descriere:", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'optInventar' AS _optiongrup WITH ;
		AutoSize = .T., ;
		ButtonCount = 3, ;
		ControlSource = "poArt.OptiuneInventar", ;
		Height = 65, ;
		Left = 24, ;
		Name = "optInventar", ;
		Top = 144, ;
		Width = 198, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Articolele din stoc", ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Fara articole", ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Articolele intrate in ultimele luni", ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 43, ;
		Option3.Width = 188
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'txtNumarLuni' AS _textbox WITH ;
		ControlSource = "poArt.NumarLuni", ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "99", ;
		Left = 226, ;
		Name = "txtNumarLuni", ;
		Top = 184, ;
		Visible = .F., ;
		Width = 62
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE optInventar.Valid
		thisform.txtNumarLuni.Visible = THIS.Value = 3
		IF THIS.Value = 3
			thisform.txtNumarLuni.SetFocus()
		ENDIF 
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="optInventar" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtNumarLuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkStocFaptic" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdGestiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdSubgrupe" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdArticole" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_articole
		*m: do_alege_gestiuni
		*m: do_alege_subgrupe
		*m: refreshdescriere
		*p: cdescrierearticole
		*p: cdescrieregestiuni
		*p: cdescrieresubgrupe
		*p: dnf
		*p: lobinv
		*p: obj
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cdescrierearticole = 
		cdescrieregestiuni = 
		cdescrieresubgrupe = 
		dnf = 0
		DoCreate = .T.
		Height = 256
		lobinv = .F.
		Name = "frm_inventar_nou"
		obj = 
		Width = 483
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 600
		_shape2.Height = 29
		_shape2.Left = 420
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Inventar nou"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 449
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'chkStocFaptic' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Stoc faptic 0", ;
		ControlSource = "poArt.stocfaptic0", ;
		Left = 232, ;
		Name = "chkStocFaptic", ;
		ToolTipText = "Bifati doar daca doriti sa completati cantitatea faptica la toate articolele. NU bifati daca doriti sa completati cantitatea faptica doar la articolele cu diferente (ex: inventar partial).", ;
		Top = 192
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'cmdArticole' AS cmd_executa WITH ;
		AutoSize = .T., ;
		caction = do_alege_articole, ;
		Caption = "... Alege \<articole", ;
		Left = 347, ;
		Name = "cmdArticole", ;
		ToolTipText = "Alegeti articolele pentru care se face inventarul (Optional)", ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdGestiuni' AS cmd_executa WITH ;
		AutoSize = .T., ;
		caction = do_alege_gestiuni, ;
		Caption = "... Alege \<gestiuni", ;
		Left = 12, ;
		Name = "cmdGestiuni", ;
		ToolTipText = "Alegeti gestiunile pentru care se face inventarul (Obligatoriu)", ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cmdSubgrupe' AS cmd_executa WITH ;
		AutoSize = .T., ;
		caction = do_alege_subgrupe, ;
		Caption = "... Alege \<subgrupe articole", ;
		Left = 148, ;
		Name = "cmdSubgrupe", ;
		ToolTipText = "Alegeti subgrupele de articole pentru care se face inventarul (Optional)", ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 108, ;
		Left = 12, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 72, ;
		Width = 467, ;
		_edbase1.ControlSource = "poArt.Descriere", ;
		_edbase1.Format = "!", ;
		_edbase1.Height = 102, ;
		_edbase1.Left = 68, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Top = 2, ;
		_edbase1.Width = 388, ;
		_LBBASE1.Caption = "Descriere:", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'optInventar' AS _optiongrup WITH ;
		AutoSize = .T., ;
		ButtonCount = 3, ;
		ControlSource = "poArt.OptiuneInventar", ;
		Height = 66, ;
		Left = 14, ;
		Name = "optInventar", ;
		Top = 188, ;
		Width = 210, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Articolele din stoc", ;
		Option1.FontSize = 10, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Fara articole", ;
		Option2.FontSize = 10, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 24, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Articolele intrate in ultimele luni", ;
		Option3.FontSize = 10, ;
		Option3.Height = 18, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 43, ;
		Option3.Width = 200
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'txtNumarLuni' AS _textbox WITH ;
		ControlSource = "poArt.NumarLuni", ;
		Format = "RK", ;
		Height = 23, ;
		InputMask = "99", ;
		Left = 227, ;
		Name = "txtNumarLuni", ;
		ToolTipText = ">= 1 luna pentru lista de articole din rulaj; 0 luni pentru lista de articole din stoc", ;
		Top = 228, ;
		Visible = .F., ;
		Width = 62
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE do_alege_articole
		Local lcXMLArticole, lcListaArticoleId, lcListaArticoleDenumire
		Local lcFiltruOriginal, llLoud
		
		lcListaArticoleId = ""
		lcListaArticoleDenumire = ""
		lcFiltruOriginal = ""
		llLoud = .T.
		
		lcXMLArticole = cauta_articole(m.lcFiltruOriginal, , m.llLoud, @lcListaArticoleId, @lcListaArticoleDenumire)  && ocautare.prg
		IF gnButon = 1
			poArt.id_articole = lcListaArticoleId
			This.cDescrierearticole = lcListaArticoleDenumire
		ENDIF 
		This.RefreshDescriere()
	ENDPROC

	PROCEDURE do_alege_gestiuni
		Local lcXMLGestiune, lcListaIdGestiuni, lcListaDenumireGestiuni
		lcListaDenumireGestiuni = ""
		lcListaIdGestiuni = ""
		&&	CA_PORNIRE_INCEPE	=	1
		lcXMLGestiune = caut_gestiune_xml(2,.F., 1, .T., @lcListaIdGestiuni, @lcListaDenumireGestiuni)&& gestiunile pe care are drept utilizatorul, <toate inregistrarile>
		IF gnButon = 1
			poArt.id_gestiuni = lcListaIdGestiuni
			This.cDescriereGestiuni = lcListaDenumireGestiuni
		ENDIF 	
		
		This.RefreshDescriere()
	ENDPROC

	PROCEDURE do_alege_subgrupe
		Local lcXMLArticole, lcListaSubgrupeId, lcListaSubgrupeDenumire
		Local lcFiltruOriginal, llLoud
		Local llMultipleArticles, llToateIreg
		
		lcListaSubgrupeId = ""
		lcListaSubgrupeDenumire = ""
		lcFiltruOriginal = ""
		llLoud = .T.
		llToateIreg = .F.
		llMultipleArticles = .T.
		
		lcXMLArticole = caut_subgrupa_articole(m.lcFiltruOriginal, m.llToateIreg, m.llMultipleArticles, , m.llLoud, @lcListaSubgrupeId, @lcListaSubgrupeDenumire)  && ocautare.prg
		IF gnButon = 1
			poArt.id_subgrupe_articole = lcListaSubgrupeId
			This.cDescrieresubgrupe = lcListaSubgrupeDenumire
		ENDIF 
		
		This.RefreshDescriere()
		
	ENDPROC

	PROCEDURE refreshdescriere
		poArt.descriere = IIF(!EMPTY(this.cDescriereGestiuni), this.cDescriereGestiuni + '; ', '') + ;
			IIF(!EMPTY(this.cDescriereSubgrupe), this.cDescriereSubgrupe + '; ', '') + this.cDescriereArticole 
			
		this.ed_tx_simplu1._edbase1.Refresh()	
	ENDPROC

	PROCEDURE optInventar.Valid
		thisform.txtNumarLuni.Visible = THIS.Value = 3
		thisform.chkStocFaptic.Visible = THIS.Value = 1
		IF THIS.Value = 3
			thisform.txtNumarLuni.SetFocus()
		ENDIF 
	ENDPROC

ENDDEFINE

DEFINE CLASS inventar_stoc 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.cNrcrt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrcrt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUM.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUM.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPret_unitar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPret_unitar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStoc_scriptic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStoc_scriptic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cstoc_faptic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cstoc_faptic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDiferenta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDiferenta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValdif.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValdif.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDepreciere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDepreciere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cMotiv_depreciere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cMotiv_depreciere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCants.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCants.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccante.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccante.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cresponsabil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cresponsabil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdatapif.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdatapif.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdnf.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdnf.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cMeserie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cMeserie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFormatia.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFormatia.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataang.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataang.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDatalic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDatalic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdns_luni.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdns_luni.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUzura_faptic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUzura_faptic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDif_dns_luni.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDif_dns_luni.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cData_expirare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cData_expirare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCant_zahar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCant_zahar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cGrade_alcool.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cGrade_alcool.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPotential.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPotential.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAn_prod.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAn_prod.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStadiu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStadiu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAcronim.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAcronim.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSerie.Text1" 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.cCodbare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodbare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPart_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPart_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrord_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrord_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataIn.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataIn.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPretv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPretv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cTVAv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cTVAv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cProcTVAv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cProcTVAv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cIdArticol.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cIdArticol.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValidat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValidat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOraValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOraValidat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOraAdaugat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOraAdaugat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cLot.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cLot.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cIdResponsabil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cIdResponsabil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2.Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5.Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_explicatie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu8.Line2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copiaza1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: citeste_doc
		*m: corderby_assign
		*m: do_cauta_furnizor
		*m: updateserver
		*p: acronim
		*p: an_prod
		*p: cant_zahar
		*p: casc
		*p: cfiltru
		*p: cfiltruoriginal
		*p: cid_gestiuni
		*p: cnumecursor
		*p: corder
		*p: cschema
		*p: cselect
		*p: cvalue
		*p: dataang
		*p: datalic
		*p: ddatainventar		&& data inceperii inventarului
		*p: explicatie
		*p: formatie
		*p: grade_alcool
		*p: grupegest
		*p: lbonconsum
		*p: lcorectie
		*p: linventarroavin
		*p: lmagazin
		*p: lmodparam
		*p: lobinv
		*p: lvalidat
		*p: meserie
		*p: ncdiferenta
		*p: ncod
		*p: ncstoc_faptic
		*p: ncstoc_scriptic
		*p: ndiferenta
		*p: ndiferentav
		*p: nevalidat
		*p: nidcinventar
		*p: nidfact
		*p: nstoc_faptic
		*p: nstoc_fapticv
		*p: nstoc_scriptic
		*p: nstoc_scripticv
		*p: nvalue
		*p: ocursor
		*p: potential
		*p: respons
		*p: stadiu
		*p: validat
	*</DefinedPropArrayMethod>

	*<PropValue>
		acronim = .F.
		an_prod = .F.
		cant_zahar = .F.
		casc = ASC
		cfiltru = .F.
		cfiltruoriginal = .F.
		cgridsortlist = grid1
		cid_gestiuni = 
		cnumecursor = crs_inventar
		corder = denumire
		cschema = .F.
		cselect = .F.
		cvalue = 
		dataang = .F.
		datalic = .F.
		ddatainventar = {}
		DoCreate = .T.
		explicatie = .F.
		formatie = .F.
		grade_alcool = .F.
		grupegest = .T.
		Height = 484
		lactiv4 = .T.
		lbonconsum = .F.
		lcorectie = .F.
		linventarroavin = .F.
		lmagazin = .F.
		lmodparam = .F.
		lobinv = .F.
		lvalidat = .F.
		meserie = .F.
		Name = "inventar_stoc"
		ncdiferenta = 0
		ncod = 0
		ncstoc_faptic = 0
		ncstoc_scriptic = 0
		ndiferenta = 0
		ndiferentav = 0
		nevalidat = .T.
		nidcinventar = 0
		nidfact = 0
		nstoc_faptic = 0
		nstoc_fapticv = 0
		nstoc_scriptic = 0
		nstoc_scripticv = 0
		nvalue = 0
		ocursor = 
		potential = .F.
		respons = .F.
		stadiu = .F.
		validat = .T.
		Width = 793
		WindowType = 1
		_memberdata = <VFPData>
			<memberdata name="ddatainventar" type="property" display="dDataInventar"/>
		</VFPData>
		_SHAPE1.Anchor = 10
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 797
		_SHAPE2.Anchor = 8
		_SHAPE2.Height = 29
		_SHAPE2.Left = 605
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 194
		LB_TITLU_ALB_B121.Caption = "Nota de inventariere si constatare diferente"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 40
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 762
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 31
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 360
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 4
	*</PropValue>

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

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 701, ;
		Name = "But_excel1", ;
		TabIndex = 30, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Exportare in Excel", ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 612, ;
		Name = "But_nou1", ;
		TabIndex = 29, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Left = 553, ;
		Name = "But_start_criterii1", ;
		Top = 1
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 670, ;
		Name = "But_sterge1", ;
		TabIndex = 39, ;
		Top = 1, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 36, ;
		Left = 227, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 35, ;
		Top = 56, ;
		Width = 216, ;
		TEXT_SIMPLU1.Alignment = 1, ;
		TEXT_SIMPLU1.ControlSource = "thisform.nStoc_scriptic", ;
		TEXT_SIMPLU1.FontName = "Arial Narrow", ;
		TEXT_SIMPLU1.FontSize = 10, ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPa)), ;
		TEXT_SIMPLU1.Left = 125, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 6, ;
		TEXT_SIMPLU1.Width = 90, ;
		LB_SIMPLU1.Caption = "Valoare ach. stoc scriptic:", ;
		LB_SIMPLU1.FontName = "Arial Narrow", ;
		LB_SIMPLU1.FontSize = 10, ;
		LB_SIMPLU1.Left = 1, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 33, ;
		Top = 60, ;
		Width = 216, ;
		TEXT_SIMPLU1.Alignment = 1, ;
		TEXT_SIMPLU1.ControlSource = "thisform.nStoc_faptic", ;
		TEXT_SIMPLU1.FontName = "Arial Narrow", ;
		TEXT_SIMPLU1.FontSize = 10, ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPa)), ;
		TEXT_SIMPLU1.Left = 121, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 0, ;
		TEXT_SIMPLU1.Width = 90, ;
		LB_SIMPLU1.Caption = "Valoare ach. stoc faptic:", ;
		LB_SIMPLU1.FontName = "Arial Narrow", ;
		LB_SIMPLU1.FontSize = 10, ;
		LB_SIMPLU1.Left = 2, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.Top = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2.Line2' AS line WITH ;
		Height = 0, ;
		Left = 298, ;
		Name = "Line2", ;
		Top = 13, ;
		Width = 8
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 491, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 37, ;
		Top = 60, ;
		Width = 145, ;
		TEXT_SIMPLU1.Alignment = 1, ;
		TEXT_SIMPLU1.ControlSource = "thisform.nDiferenta", ;
		TEXT_SIMPLU1.FontName = "Arial Narrow", ;
		TEXT_SIMPLU1.FontSize = 10, ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPa)), ;
		TEXT_SIMPLU1.Left = 5, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 2, ;
		TEXT_SIMPLU1.Width = 92, ;
		LB_SIMPLU1.Caption = "", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 24, ;
		Left = 225, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 34, ;
		Top = 32, ;
		Width = 218, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.ncStoc_scriptic", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPcant)), ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 1, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Stoc scriptic:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 3, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 24, ;
		Left = 10, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 32, ;
		Top = 35, ;
		Width = 218, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.ncStoc_faptic", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPcant)), ;
		Text_simplu1.Left = 123, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 1, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Stoc faptic:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 3, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 4
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5.Line2' AS line WITH ;
		Height = 0, ;
		Left = 298, ;
		Name = "Line2", ;
		Top = 13, ;
		Width = 8
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'Clb_tx_simplu6' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 490, ;
		Name = "Clb_tx_simplu6", ;
		TabIndex = 36, ;
		Top = 30, ;
		Width = 134, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.ncDiferenta", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPcant)), ;
		Text_simplu1.Left = 5, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 2, ;
		Text_simplu1.Width = 93, ;
		Lb_simplu1.Caption = "", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu7' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 36, ;
		Left = 227, ;
		Name = "Clb_tx_simplu7", ;
		TabIndex = 35, ;
		Top = 81, ;
		Width = 216, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nStoc_scripticv", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 125, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 6, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Valoare vanz. stoc scriptic:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 1, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu8' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu8", ;
		TabIndex = 33, ;
		Top = 85, ;
		Width = 216, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nStoc_fapticv", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 121, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 0, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Valoare vanz. stoc faptic:", ;
		Lb_simplu1.FontName = "Arial Narrow", ;
		Lb_simplu1.FontSize = 10, ;
		Lb_simplu1.Left = 2, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu8.Line2' AS line WITH ;
		Height = 0, ;
		Left = 298, ;
		Name = "Line2", ;
		Top = 13, ;
		Width = 8
		*< END OBJECT: BaseClass="line" />

	ADD OBJECT 'Clb_tx_simplu9' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 491, ;
		Name = "Clb_tx_simplu9", ;
		TabIndex = 37, ;
		Top = 85, ;
		Width = 145, ;
		Text_simplu1.Alignment = 1, ;
		Text_simplu1.ControlSource = "thisform.nDiferentav", ;
		Text_simplu1.FontName = "Arial Narrow", ;
		Text_simplu1.FontSize = 10, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(16,gnPa)), ;
		Text_simplu1.Left = 5, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 2, ;
		Text_simplu1.Width = 92, ;
		Lb_simplu1.Caption = "", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 56, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		GridLineColor = 128,128,128, ;
		HeaderHeight = 19, ;
		Height = 368, ;
		HighlightBackColor = 83,130,206, ;
		HighlightStyle = 2, ;
		Left = 5, ;
		Name = "Grid1", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crs_inventar", ;
		RowHeight = 19, ;
		SelectedItemBackColor = 29,60,112, ;
		TabIndex = 27, ;
		Top = 111, ;
		Width = 783, ;
		Column1.ControlSource = "recno()", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNrcrt", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 24, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "codmat", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cCodmat", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 68, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "denumire", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDenumire", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 123, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "um", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cUM", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 28, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "cgest", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cCgest", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 41, ;
		Column6.ColumnOrder = 9, ;
		Column6.ControlSource = "cont", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "ccont", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 38, ;
		Column7.ColumnOrder = 10, ;
		Column7.ControlSource = "acont", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cAcont", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 37, ;
		Column8.ColumnOrder = 11, ;
		Column8.ControlSource = "pret", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(9,gnPpret)), ;
		Column8.Name = "cPret_unitar", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 70, ;
		Column9.ColumnOrder = 15, ;
		Column9.ControlSource = "stoc_scriptic", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.InputMask = (get_mask(9,gnPcant)), ;
		Column9.Name = "cStoc_scriptic", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 66, ;
		Column10.BackColor = 234,249,255, ;
		Column10.ColumnOrder = 16, ;
		Column10.ControlSource = "stoc_faptic", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.ForeColor = 0,64,128, ;
		Column10.InputMask = (get_mask(9,gnPcant)), ;
		Column10.Name = "cstoc_faptic", ;
		Column10.ReadOnly = .F., ;
		Column10.Width = 83, ;
		Column11.ColumnOrder = 17, ;
		Column11.ControlSource = "stoc_faptic-stoc_scriptic", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.InputMask = (get_mask(9,gnPcant)), ;
		Column11.Name = "cDiferenta", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 48, ;
		Column12.ColumnOrder = 18, ;
		Column12.ControlSource = "round(pret_unitar*(stoc_faptic-stoc_scriptic),gnPC)", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.InputMask = (get_mask(16,gnPC)), ;
		Column12.Name = "cValdif", ;
		Column12.ReadOnly = .T., ;
		Column13.BackColor = 234,249,255, ;
		Column13.ColumnOrder = 19, ;
		Column13.ControlSource = "depreciere", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.InputMask = (get_mask(9,gnPcant)), ;
		Column13.Name = "cDepreciere", ;
		Column13.ReadOnly = .F., ;
		Column14.BackColor = 234,249,255, ;
		Column14.ColumnOrder = 20, ;
		Column14.ControlSource = "motiv_depreciere", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cMotiv_depreciere", ;
		Column14.ReadOnly = .F., ;
		Column14.Width = 97, ;
		Column15.ColumnOrder = 22, ;
		Column15.ControlSource = "cants", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.InputMask = (get_mask(9,gnPcant)), ;
		Column15.Name = "cCants", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 49, ;
		Column16.ColumnOrder = 24, ;
		Column16.ControlSource = "cant", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.InputMask = (get_mask(9,gnPcant)), ;
		Column16.Name = "ccant", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 39, ;
		Column17.ColumnOrder = 25, ;
		Column17.ControlSource = "cante", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.InputMask = (get_mask(9,gnPcant)), ;
		Column17.Name = "ccante", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 36, ;
		Column18.ColumnOrder = 27, ;
		Column18.ControlSource = "utilizator", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "cUtilizator", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 99, ;
		Column19.ColumnOrder = 28, ;
		Column19.ControlSource = "responsabil", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "cresponsabil", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 148, ;
		Column20.ColumnOrder = 23, ;
		Column20.ControlSource = "TTOD(datapif)", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cdatapif", ;
		Column20.ReadOnly = .T., ;
		Column20.Width = 49, ;
		Column21.ColumnOrder = 33, ;
		Column21.ControlSource = "dnf", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cdnf", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 70, ;
		Column22.ColumnOrder = 29, ;
		Column22.ControlSource = "meserie", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cMeserie", ;
		Column22.ReadOnly = .T., ;
		Column22.Width = 74, ;
		Column23.ColumnOrder = 30, ;
		Column23.ControlSource = "formatia", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cFormatia", ;
		Column23.ReadOnly = .T., ;
		Column23.Width = 68, ;
		Column24.ColumnOrder = 31, ;
		Column24.ControlSource = "ttod(dataang)", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cDataang", ;
		Column24.ReadOnly = .T., ;
		Column24.Width = 50, ;
		Column25.ColumnOrder = 32, ;
		Column25.ControlSource = "ttod(datalic)", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cDatalic", ;
		Column25.ReadOnly = .T., ;
		Column25.Width = 44, ;
		Column26.ColumnOrder = 34, ;
		Column26.ControlSource = "iif(dnf<>0, round((dnf-dns_luni)/dnf*100,0),0)", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.InputMask = "999999", ;
		Column26.Name = "cdns_luni", ;
		Column26.ReadOnly = .T., ;
		Column26.Width = 57, ;
		Column27.BackColor = 234,249,255, ;
		Column27.ColumnOrder = 35, ;
		Column27.ControlSource = "uzura_faptic", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.InputMask = "999999", ;
		Column27.Name = "cUzura_faptic", ;
		Column27.ReadOnly = .F., ;
		Column27.Width = 53, ;
		Column28.ColumnOrder = 36, ;
		Column28.ControlSource = "iif(dnf<>0, ROUND((dnf-dns_luni)/dnf*100, 0),0) - uzura_faptic", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.InputMask = "999999", ;
		Column28.Name = "cDif_dns_luni", ;
		Column28.ReadOnly = .T., ;
		Column28.Width = 43, ;
		Column29.BackColor = 234,249,255, ;
		Column29.ColumnOrder = 37, ;
		Column29.ControlSource = "data_expirare", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cData_expirare", ;
		Column29.ReadOnly = .F., ;
		Column29.Width = 53, ;
		Column30.ColumnOrder = 38, ;
		Column30.ControlSource = "cant_zahar", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.InputMask = (get_mask(16,gnPCant)), ;
		Column30.Name = "cCant_zahar", ;
		Column30.ReadOnly = .T., ;
		Column30.Width = 58, ;
		Column31.ColumnOrder = 39, ;
		Column31.ControlSource = "grade_alcool", ;
		Column31.FontName = "Arial", ;
		Column31.FontSize = 10, ;
		Column31.InputMask = (get_mask(14,gnPCant)), ;
		Column31.Name = "cGrade_alcool", ;
		Column31.ReadOnly = .T., ;
		Column32.ColumnOrder = 40, ;
		Column32.ControlSource = "potential", ;
		Column32.FontName = "Arial", ;
		Column32.FontSize = 10, ;
		Column32.InputMask = (get_mask(14,gnPCant)), ;
		Column32.Name = "cPotential", ;
		Column32.ReadOnly = .T., ;
		Column32.Width = 67, ;
		Column33.ColumnOrder = 41, ;
		Column33.ControlSource = "an_prod", ;
		Column33.FontName = "Arial", ;
		Column33.FontSize = 10, ;
		Column33.InputMask = "9999", ;
		Column33.Name = "cAn_prod", ;
		Column33.ReadOnly = .T., ;
		Column33.Width = 56, ;
		Column34.ColumnOrder = 42, ;
		Column34.ControlSource = "stadiu", ;
		Column34.FontName = "Arial", ;
		Column34.FontSize = 10, ;
		Column34.Name = "cStadiu", ;
		Column34.ReadOnly = .T., ;
		Column35.ColumnOrder = 43, ;
		Column35.ControlSource = "explicatie", ;
		Column35.FontName = "Arial", ;
		Column35.FontSize = 10, ;
		Column35.Name = "cExplicatie", ;
		Column35.ReadOnly = .T., ;
		Column36.ColumnOrder = 44, ;
		Column36.ControlSource = "acronim", ;
		Column36.FontName = "Arial", ;
		Column36.FontSize = 10, ;
		Column36.Name = "cAcronim", ;
		Column36.ReadOnly = .T., ;
		Column36.Width = 39, ;
		Column37.ColumnOrder = 5, ;
		Column37.ControlSource = "serie", ;
		Column37.FontName = "Arial", ;
		Column37.FontSize = 10, ;
		Column37.Name = "cSerie", ;
		Column37.ReadOnly = .T., ;
		Column38.ColumnOrder = 47, ;
		Column38.ControlSource = "Grupa", ;
		Column38.FontName = "Arial", ;
		Column38.FontSize = 10, ;
		Column38.Name = "Column1", ;
		Column38.ReadOnly = .T., ;
		Column39.ColumnOrder = 48, ;
		Column39.ControlSource = "Subgrupa", ;
		Column39.FontName = "Arial", ;
		Column39.FontSize = 10, ;
		Column39.Name = "Column2", ;
		Column39.ReadOnly = .T., ;
		Column40.ColumnOrder = 13, ;
		Column40.ControlSource = "pretd", ;
		Column40.FontName = "Arial", ;
		Column40.FontSize = 10, ;
		Column40.Format = "R", ;
		Column40.InputMask = (get_mask(16,gnPPretVal)), ;
		Column40.Name = "Column3", ;
		Column40.ReadOnly = .T., ;
		Column40.Width = 54, ;
		Column41.ColumnOrder = 14, ;
		Column41.ControlSource = "Valuta", ;
		Column41.FontName = "Arial", ;
		Column41.FontSize = 10, ;
		Column41.Name = "Column4", ;
		Column41.ReadOnly = .T., ;
		Column41.Width = 46, ;
		Column42.ColumnOrder = 12, ;
		Column42.ControlSource = "pretv+tvav", ;
		Column42.FontName = "Arial", ;
		Column42.FontSize = 10, ;
		Column42.InputMask = (get_mask(12,gnPPretV)), ;
		Column42.Name = "Column5", ;
		Column42.ReadOnly = .T., ;
		Column43.ColumnOrder = 2, ;
		Column43.ControlSource = "codbare", ;
		Column43.FontName = "Arial", ;
		Column43.FontSize = 10, ;
		Column43.Name = "cCodbare", ;
		Column43.ReadOnly = .T., ;
		Column43.Width = 60, ;
		Column44.ColumnOrder = 45, ;
		Column44.ControlSource = "part_rez", ;
		Column44.FontName = "Arial", ;
		Column44.FontSize = 10, ;
		Column44.Name = "cPart_rez", ;
		Column44.ReadOnly = .T., ;
		Column45.ColumnOrder = 46, ;
		Column45.ControlSource = "nrord_rez", ;
		Column45.FontName = "Arial", ;
		Column45.FontSize = 10, ;
		Column45.Name = "cNrord_rez", ;
		Column45.ReadOnly = .T., ;
		Column46.ColumnOrder = 26, ;
		Column46.ControlSource = "datain", ;
		Column46.FontName = "Arial", ;
		Column46.FontSize = 10, ;
		Column46.Name = "cDataIn", ;
		Column46.ReadOnly = .T., ;
		Column47.ColumnOrder = 49, ;
		Column47.ControlSource = "pretv", ;
		Column47.FontName = "Arial", ;
		Column47.FontSize = 10, ;
		Column47.Format = "RK", ;
		Column47.InputMask = (get_mask(12,gnPPretV)), ;
		Column47.Name = "cPretv", ;
		Column47.ReadOnly = .T., ;
		Column47.Width = 64, ;
		Column48.ColumnOrder = 50, ;
		Column48.ControlSource = "tvav", ;
		Column48.FontName = "Arial", ;
		Column48.FontSize = 10, ;
		Column48.Format = "RK", ;
		Column48.InputMask = (get_mask(12,gnPPretV)), ;
		Column48.Name = "cTVAv", ;
		Column48.ReadOnly = .T., ;
		Column48.Width = 72, ;
		Column49.ColumnOrder = 51, ;
		Column49.ControlSource = "proc_tvav", ;
		Column49.FontName = "Arial", ;
		Column49.FontSize = 10, ;
		Column49.Format = "R", ;
		Column49.InputMask = "99.99", ;
		Column49.Name = "cProcTVAv", ;
		Column49.ReadOnly = .T., ;
		Column49.Width = 49, ;
		Column50.BackColor = 234,249,255, ;
		Column50.ColumnOrder = 21, ;
		Column50.ControlSource = "furnizor", ;
		Column50.FontName = "Arial", ;
		Column50.FontSize = 10, ;
		Column50.Name = "cFurnizor", ;
		Column50.ReadOnly = .T., ;
		Column50.ToolTipText = "Dublu click pentru modificare", ;
		Column50.Width = 139, ;
		Column51.ColumnOrder = 52, ;
		Column51.ControlSource = "id_articol", ;
		Column51.FontName = "Arial", ;
		Column51.FontSize = 10, ;
		Column51.Name = "cIdArticol", ;
		Column51.ReadOnly = .T., ;
		Column52.ColumnOrder = 53, ;
		Column52.ControlSource = "validat", ;
		Column52.CurrentControl = "Check1", ;
		Column52.FontName = "Arial", ;
		Column52.FontSize = 10, ;
		Column52.Name = "cValidat", ;
		Column52.ReadOnly = .T., ;
		Column52.Sparse = .F., ;
		Column52.Width = 32, ;
		Column53.ColumnOrder = 54, ;
		Column53.ControlSource = "dataora_validat", ;
		Column53.FontName = "Arial", ;
		Column53.FontSize = 10, ;
		Column53.Name = "cDataOraValidat", ;
		Column53.ReadOnly = .T., ;
		Column53.Width = 112, ;
		Column54.ColumnOrder = 55, ;
		Column54.ControlSource = "dataora", ;
		Column54.FontName = "Arial", ;
		Column54.FontSize = 10, ;
		Column54.Name = "cDataOraAdaugat", ;
		Column54.ReadOnly = .T., ;
		Column54.Width = 99, ;
		Column55.ColumnOrder = 6, ;
		Column55.ControlSource = "lot", ;
		Column55.FontName = "Arial", ;
		Column55.FontSize = 10, ;
		Column55.Name = "cLot", ;
		Column55.ReadOnly = .T., ;
		Column56.ControlSource = "id_responsabil", ;
		Column56.FontSize = 10, ;
		Column56.Name = "cIdResponsabil", ;
		Column56.ReadOnly = .T., ;
		Column56.Width = 88
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cData_expirare.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'Grid1.cDataIn.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ControlSource = "datain", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cDepreciere.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cDif_dns_luni.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Diferenta (%)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'Grid1.cdnf.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Durata functionare (luni)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cdns_luni.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Uzura scriptica (%)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cFurnizor.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 29,60,112, ;
		ToolTipText = "Dublu click pentru modificare"
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

	ADD OBJECT 'Grid1.cIdResponsabil.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

	ADD OBJECT 'Grid1.cMotiv_depreciere.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

	ADD OBJECT 'Grid1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Grupa", ;
		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", ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Subgrupa", ;
		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", ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret 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, ;
		ControlSource = "pretd", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "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, ;
		ControlSource = "id_valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret vanzare cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< 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", ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cstoc_faptic.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,64,128, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cUzura_faptic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Uzura faptica (%)", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cUzura_faptic.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

	ADD OBJECT 'Grid1.cValidat.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 29,60,112
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'Label1' AS label WITH ;
		Anchor = 10, ;
		BackStyle = 0, ;
		Caption = "Diferenta", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 448, ;
		Name = "Label1", ;
		Top = 36, ;
		Width = 49
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label2' AS label WITH ;
		Anchor = 10, ;
		BackStyle = 0, ;
		Caption = "Diferenta", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 449, ;
		Name = "Label2", ;
		Top = 66, ;
		Width = 49
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Label3' AS label WITH ;
		Anchor = 10, ;
		BackStyle = 0, ;
		Caption = "Diferenta", ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 449, ;
		Name = "Label3", ;
		Top = 91, ;
		Width = 49
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lb_explicatie' AS _label WITH ;
		Anchor = 8, ;
		BackStyle = 0, ;
		Caption = "* Articolele pot fi inventariate doar din ROAVIN.", ;
		FontItalic = .T., ;
		FontName = "Arial Narrow", ;
		ForeColor = 128,128,128, ;
		Left = 590, ;
		Name = "lb_explicatie", ;
		Top = 38
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		
		lcFiltru=pcFiltru
		*!*	IF EMPTY(lcFiltru)
		*!*		lcFiltru=this.ocursor.ca_baza1.cfiltruOriginal
		*!*	ELSE 
		*!*		lcFiltru = lcFiltru + [ and ] + this.ocursor.ca_baza1.cfiltruOriginal
		*!*	ENDIF
		IF EMPTY(lcFiltru)
			lcFiltru=this.ocursor.ca_baza1.cfiltru
		ENDIF 
		
		lcOrder = this.corder + [ ] + this.casc
		save_grid(This.grid1)
		this.ocursor.ca_baza1.lAfisare = .F.
		this.ocursor.ca_baza1.cfiltru = lcfiltru
		this.ocursor.ca_baza1.corder = lcOrder 
		this.ocursor.ca_baza1.afisare()
		restore_grid(This.grid1)
		
		thisform.do_executa 
		
	ENDPROC

	PROCEDURE citeste_doc
		Private pcReturnValue
		pcReturnValue = []
		
		lcSql = [pack_inventar.citeste_documente_atasate(] + Alltrim(Str(Thisform.nidcinventar)) + [)]
		lnSucces = goExecutor.oFunction2Value(lcSql, @pcReturnValue)
		If lnSucces < 0 Then
			amessagebox(goExecutor.cEroare,64,"Eroare")
		Endif
		
		Return pcReturnValue
	ENDPROC

	PROCEDURE corderby_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		
		IF THIS.corder = m.vNewVal
			lcASC = IIF(this.casc = 'ASC','DESC','ASC')
		ELSE
			lcASC = 'ASC'
		ENDIF 
		THIS.cOrder = m.vNewVal
		this.cAsc = lcAsc
		this.actualizeaza_grid1()
		
	ENDPROC

	PROCEDURE do_adauga
		LPARAMETERS tlCopiere
		* tlCopiere: .T. daca se adauga un articol prin copiere. Se deschide formularul de adaugare, dar cu acelasi articol, pret ...
		
		LOCAL llCopiere
		llCopiere = IIF(PCOUNT() = 0, .F., m.tlCopiere)
		
		*!* 31.01.2011
		*!* marius.mutu
		*!* la append in crs_inventar da eroare id_grupa cannot accept null values, in cazul unui articol fara grupa
		*!* desi am pus schema cu ID_GRUPA = NULL, cursorul nu accepta NULL,  la o cautare ulterioara.
					
		*!*	lcSql = 'select * from ' + gcs + '.vnom_articole order by denumire,codmat'
		*!*	lnSucces = goExecutor.oExecute(lcSql,'crsArticole')
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX(goExecutor.ceroare,0)
		*!*		RETURN
		*!*	ENDIF
		
		If Thisform.lvalidat And !Thisform.lCorectie
			Return
		Endif
		
		*!* v 2.0.22
		*!* pentru cresterea vitezei introducerii de articole noi - copii gestiunea, cont, acont, proc_tvav
		lcsel = [select cota_tva,denumire from vjtva_coloane ] + ;
			[where jv=1 and afisat = 1 and id_jtva_coloana > 0 order by ordine]
		lccursor = [crs_cote_tva_inventar]
		If !goExecutor.oExecuta(lcsel,lccursor)
			Return
		Endif
		
		*!*	modificare	v 2.2.6 : dintre gestiunile pe care are dreptul utilizatorul arat doar gestiunile alese la inceperea inventarului
		*!*	lcSql = 'select * from vnom_gestiuni where inactiv = 0 order by nume_gestiune,cgest'
		lcSql = [select distinct c.nume_gestiune,c.cgest,b.id_gestiune,c.nr_pag,c.cont ] + ;
			[from gest_coresp_util_grupe a ] + ;
			[left join gest_coresp_grupe_gestiuni b on a.id_grupe=b.id_grupe ] + ;
			[left join nom_gestiuni c on b.id_gestiune=c.id_gestiune ] + ;
			[where a.id_util = ] + Alltrim(Str(gnIdUtil)) + Strtran(gcCondSucursala,[id_sucursala],[c.id_sucursala]) + ;
			[ and c.inactiv = 0 ] + ;
			iif(!Empty(Nvl(Thisform.cId_gestiuni,'')),[and b.id_gestiune in (] + Thisform.cId_gestiuni + [)],[]) + ;
			[ order by c.nume_gestiune,c.cgest]
		*!*	modificare	v 2.2.6 	^
		If !goExecutor.oExecuta(lcSql,'crsGestiuni')
			Return
		Endif
		
		lcSql = 'select * from vnom_valute where inactiv = 0 order by moneda_nationala desc, nume_val'
		if !goExecutor.oExecuta(lcSql,'crsValuteTemp')
			Return
		Endif
		
		If This.lobinv
			lcSql = 'select id_responsabil, nume from vnom_responsabili where inactiv = 0 order by nume'
			lnsucces = goExecutor.oExecute(lcSql,'crsResponsabili2')
			If lnsucces < 0
				AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
			Create Cursor crsResponsabili (id_responsabil N(20) Null, nume C(100))
			Insert Into crsResponsabili (id_responsabil, nume) Values (Null,'')
			Insert Into crsResponsabili Select id_responsabil, nume From crsResponsabili2
			Select crsResponsabili
			Go Top
			Use In crsResponsabili2
		Endif
		Local lcCursorInventar
		lcCursorInventar = Thisform.cnumecursor
		
		
		Select (Thisform.cnumecursor)
		Scatter Name oinv_orig
		IF !m.llCopiere
			Scatter Name oinv Blank
			oinv.DATAPIF = Date()
		ELSE 
			oinv = CloneObj(oinv_orig)
			oinv.stoc_scriptic = 0
		ENDIF 
		
		oinv.id_gestiune = oinv_orig.id_gestiune
		oinv.nume_gestiune = oinv_orig.nume_gestiune
		oinv.proc_tvav = oinv_orig.proc_tvav
		oinv.id_valuta = oinv_orig.id_valuta
		oinv.valuta = oinv_orig.valuta
		oinv.Cont = oinv_orig.Cont
		oinv.acont = oinv_orig.acont
		oinv.id_furnizor = oinv_orig.id_furnizor
		oinv.furnizor = oinv_orig.furnizor
		oinv.id_rul_aux = oinv_orig.id_rul_aux
		
		Select crsGestiuni
		Locate For id_gestiune = oinv.id_gestiune
		If !Found()
			Go Top
			oinv.id_gestiune = crsGestiuni.id_gestiune
			oinv.nume_gestiune = crsGestiuni.nume_gestiune
		Endif
		
		Select crsValuteTemp
		Locate For id_valuta = oinv.id_valuta
		If !Found()
			Go Top
			oinv.id_valuta = crsValuteTemp.id_valuta
			oinv.valuta = crsValuteTemp.nume_val
		Endif
		
		Select crs_cote_tva_inventar
		Locate For cota_tva = oinv.proc_tvav
		If !Found()
			Go Top
			oinv.proc_tvav = cota_tva
		ENDIF
		*!* v 2.0.22 ^
		
		oAdd = Createobject(Iif(Thisform.linventarroavin,'new_inventar_vin','new_inventar'))
		oAdd.lobinv = This.lobinv
		oAdd.obj = oinv
		oAdd.lCopiere = m.llCopiere
		oAdd.Show()
		Private pnIdInventar
		pnIdInventar = 0
		
		oinv.dns_luni = oinv.dnf
		SET STEP ON 
		If gnButon = 1
			pnpretvaluta = oinv.pretd
			pnidvaluta = oinv.id_valuta
		
			pnid_articol = oinv.id_articol
			pnid_gestiune = oinv.id_gestiune
			pnid_responsabil = oinv.id_responsabil
			pccont = Left(Alltrim(NVL(oinv.Cont,'')),4)
			pcacont = Left(Alltrim(Nvl(oinv.acont,'')),4)
			pnpret = oinv.Pret
			pnpretv = oinv.pretv
			pntvav = oinv.tvav
			pnproc_tvav = oinv.proc_tvav
			pddatapif = oinv.DATAPIF
			pndns_luni = oinv.dns_luni
			pcSerie = NVL(oinv.serie, '')
			pcLot = NVL(oinv.lot, '')
			pcIdSucursala = Iif(Nvl(gnIdSucursala,0) = 0, 'NULL', Alltrim(Str(gnIdSucursala)))
			pnIdRulAux = NVL(oinv.id_rul_aux, 0)
			lcIdRulAux = 'NULL'
			
			If !This.linventarroavin
				IF !EMPTY(NVL(oinv.id_furnizor,0))
					lcSql = [begin pack_contafin.GetRulajAuxiliarFurnizor(] + Transform(oinv.id_furnizor) + [, ?@pnIdRulAux); end;]
					lnsucces = goExecutor.oExecute(m.lcSql)
					If m.lnsucces < 0
						AMESSAGEBOX(goExecutor.cEroare, 0 + 48, _Screen.Caption)
						Return m.lnsucces
					ELSE
						lcIdRulAux = ALLTRIM(STR(m.pnIdRulAux))	
					ENDIF
				ENDIF 	
				
				lcSql = [insert into gest_inventar (an,luna,id_articol,id_gestiune,cont,acont,pret,pretv,tvav,proc_tvav,data_referinta, ] + ;
						[id_responsabil,datapif,dns_luni,id_rul_aux,serie,lot,pretd,id_Valuta,id_sucursala,id_c_inventar,id_part_rez,id_lucrare_rez) ] +;
					 [values(] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,] + Alltrim(Str(pnid_articol)) + [,] + ;
					 Alltrim(Str(pnid_gestiune)) + [,'] + pccont + [','] + pcacont + [',] + Alltrim(Str(pnpret,20,4)) + [,] + Alltrim(Str(pnpretv,20,4)) + [,] + ;
					 Alltrim(Str(pntvav,10,4)) + [,] + Alltrim(Str(pnproc_tvav,10,4)) + [,TO_DATE('] + Iif(!Empty(Nvl(pdDataRef,{})),Dtos(pddataRef), '') + [','YYYYMMDD'),] + ;
					 IIF(ISNULL(pnid_responsabil), 'NULL', Alltrim(Str(pnid_responsabil))) + ;
					 [, TO_DATE('] + Iif(!Empty(Nvl(pdDatapif,{})),Dtos(pddatapif), '') + [','YYYYMMDD'),] + Alltrim(Str(pndns_luni)) + [,] + m.lcIdRulAux + [,'] + ;
					 Alltrim(pcSerie) + [','] + Alltrim(pcLot) + [',] + Alltrim(Str(pnpretvaluta,20,4)) + [,] + ;
					 IIF(ISNULL(pnIdValuta), 'NULL', Alltrim(Str(pnidvaluta))) + [,] + ;
					 pcIdSucursala + [, ] + ;
			         Alltrim(Str(This.nidcinventar)) + [,] + ;
			         IIF(ISNULL(oinv.id_part_rez), 'NULL', Alltrim(Str(oinv.id_part_rez))) + [,] + ;
			         IIF(ISNULL(oinv.id_lucrare_rez), 'NULL', Alltrim(Str(oinv.id_lucrare_rez))) + [) ] + ;
					[ RETURNING ID_INVENTAR INTO ?@pnIdInventar]
			Else
				pnCantZahar = oinv.cant_zahar
				pnIdVinStadiu = oinv.id_vin_stadiu
				pnGradeAlcool = oinv.grade_alcool
				pnPotential = oinv.potential
				pnAnProd = oinv.an_prod
				pnIdVenchelt = oinv.id_venchelt
				pnIdCategCalitate = oinv.id_categ_calitate
		
				*!*	 de adaugat This.nidcinventar
		*!*			lcSql = [begin pack_vin.adauga_articol_inventar(?gnAn,?gnLuna,?pnid_articol,?pnid_gestiune,?pccont,?pcacont,?pnpret,] + ;
		*!*				[?pnpretv,?pntvav,?pnproc_tvav,?pdDataRef,?pnid_responsabil,?pddatapif,?pndns_luni,?pcSerie,?pnpretvaluta,?pnidvaluta,] + ;
		*!*				[?pnCantZahar,?pnIdVinStadiu,?pnGradeAlcool,?pnPotential,?pnAnProd,?pnIdVenchelt,?pnIdCategCalitate,?@pnIdInventar); end;]
		 		lcSql = [begin pack_vin.adauga_articol_inventar(] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,] + Alltrim(Str(pnid_articol)) + [,] + ;
					 Alltrim(Str(pnid_gestiune)) + [,'] + pccont + [','] + pcacont + [',] + Alltrim(Str(pnpret,20,4)) + [,] + Alltrim(Str(pnpretv,20,4)) + [,] + ;
					 Alltrim(Str(pntvav,10,4)) + [,] + Alltrim(Str(pnproc_tvav,10,4)) + [,TO_DATE('] + Iif(!Empty(Nvl(pdDataRef,{})),Dtos(pddataRef), '') + [','YYYYMMDD'),] + ;
					 Alltrim(Str(pnid_responsabil)) + [, TO_DATE('] + Iif(!Empty(Nvl(pdDatapif,{})),Dtos(pddatapif), '') + [','YYYYMMDD'),] + Alltrim(Str(pndns_luni)) + [,] + ;
					 ['] + Alltrim(pcSerie) + [',] + ['] + Alltrim(pcLot) + [',] + Alltrim(Str(pnpretvaluta,20,4)) + [,] + Alltrim(Str(pnidvaluta)) + [,] + ;
					Alltrim(Str(pnCantZahar,20,4)) + [,] + ;
					Iif(Empty(Nvl(pnIdVinStadiu,0)),[NULL],Alltrim(Str(pnIdVinStadiu))) + [,] + ;
					Alltrim(Str(pnGradeAlcool,10,4)) + [,] + ;
					Alltrim(Str(pnPotential,20,4)) + [,] + Alltrim(Str(pnAnProd)) + [,] + ;
					Iif(Empty(Nvl(pnIdVenchelt,0)),[NULL],Alltrim(Str(pnIdVenchelt))) + [,] + ;
					Iif(Empty(Nvl(pnIdCategCalitate,0)),[NULL],Alltrim(Str(pnIdCategCalitate))) + [,] + ;
					Alltrim(Str(This.nidcinventar)) + [,] + pcIdSucursala + [,?@pnIdInventar); end;]
			         
			Endif
			lnsucces = goExecutor.oExecute(lcSql)
			If lnsucces < 0
				AMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
				gnButon = 2
			Else
		
				lcSql = 'select * from ' + Iif(This.linventarroavin,[vvin_gest_inventar],[vgest_inventar]) + ' where id_inventar = ?pnIdInventar'
				lnsucces = goExecutor.oExecute(lcSql, "crsInventarNou")
				If lnsucces < 0
					AMESSAGEBOX(goExecutor.cEroare,16,"Eroare")
					This.actualizeaza_grid1()
				ELSE
					*!* 31.01.2011
					SELECT crsInventarNou
					REPLACE ALL id_grupa with NVL(id_grupa,0), id_subgrupa with NVL(id_subgrupa,0), grupa with NVL(grupa,''), subgrupa with NVL(subgrupa, '') IN crsInventarNou 
					*!* 31.01.2011 ^			
					Select (lcCursorInventar)
					Append From Dbf('crsInventarNou')
					Use In crsInventarNou
				Endif
		
			Endif
		Endif
		
		If Used('crsArticole')
			Use In crsArticole
		Endif
		If Used('crsGestiuni')
			Use In crsGestiuni
		Endif
		If Used('crsResponsabili')
			Use In crsResponsabili
		Endif
		Use in (Select('crs_cote_tva_inventar'))
		Use In (Select('crsValuteTemp'))
		
		This.grid1.SetFocus()
		
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru = "1=1" + gcCondSucursala
		
		*!*	If Thisform.ck_denumire.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_denumire.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_respons.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_respons.filtru_ora
		*!*	ENDIF
		
		*!*	IF thisform.ck_filtru_meserie.Value=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_meserie.filtru_ora
		*!*	ENDIF 
		
		*!*	IF thisform.ck_filtru_formatie.Value = 1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_formatie.filtru_ora
		*!*	ENDIF 
		
		*!*	IF THISFORM.ck_filtru_dataang.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_dataang.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_datalic.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_datalic.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_codmat.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_codmat.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_cont.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_cont.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_acont.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_acont.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_diferenta.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_diferenta.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_pretu.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_pretu.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_stoc_scriptic.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_stoc_scriptic.filtru
		*!*	ENDIF
		*!*	If Thisform.ck_stoc_faptic.Value=1
		*!*		lcFiltru = lcFiltru + Thisform.ck_stoc_faptic.filtru
		*!*	ENDIF
		*!*	If Thisform.ck_filtru_gestiune.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_gestiune.filtru_ora
		*!*	ENDIF
		
		*!*	IF thisform.ck_acronim.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_acronim.filtru_ora
		*!*	ENDIF
		
		*!*	IF thisform.ck_cant_zahar.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_cant_zahar.filtru
		*!*	ENDIF
		
		*!*	IF thisform.ck_grade_alcool.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_grade_alcool.filtru
		*!*	ENDIF
		
		*!*	IF thisform.ck_an_prod.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_an_prod.filtru
		*!*	ENDIF
		
		*!*	IF thisform.ck_potential.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_potential.filtru
		*!*	ENDIF
		
		*!*	IF thisform.ck_stadiu.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_stadiu.filtru
		*!*	ENDIF
		
		*!*	IF thisform.ck_explicatie.Value = 1
		*!*		lcFiltru = lcFiltru + thisform.ck_explicatie.filtru
		*!*	ENDIF
		
		*!*	IF thisform.ck_validat.value = 1
		*!*		lcFiltru=lcFiltru + [ and validat = 1]
		*!*	ENDIF 
		*!*	IF thisform.ck_nevalidat.value = 1
		*!*		lcFiltru=lcFiltru + [ and validat = 0]
		*!*	ENDIF 
		
		*!*	If Thisform.ck_filtru_grupegest.Value=1
		*!*		lcFiltru=lcFiltru+[ and id_gestiune in (select id_gestiune from ]+ gcS +;
		*!*		[.vgest_coresp_grupe_gestiuni where ] + SUBSTR(Thisform.ck_filtru_grupegest.filtru_ora,5)+[)]
		*!*	ENDIF
		
		IF LEN(THISFORM.filtru_pretty)>0
			lcFiltru = lcFiltru+" and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"
		ENDIF
		IF !EMPTY(lcFiltru)
			IF UPPER(ALLTRIM(LEFT(ALLTRIM(lcFiltru),4)))="AND"
				lcFiltru =SUBSTR(lcfiltru,4)
			ENDIF
			
			IF UPPER(ALLTRIM(LEFT(ALLTRIM(lcFiltru),3)))="OR"
				lcFiltru =SUBSTR(lcfiltru,3)
			ENDIF
		ENDIF 	
		IF (THIS.filtru_pretty#"none")
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		THISFORM.actualizeaza_grid1(lcFiltru)
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
			IF RECCOUNT(this.cnumecursor)=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE do_cauta_furnizor
		Local locauta
		Local lcFiltru, lcFiltruOriginal, lcIdColumn, lcNumeProc, lcOrder, lcPrimaColoana, lcSchema
		Local lcSelect, lcTitlu, lcTitluColoane, lccoloane, llToateIreg, lnId, lnPornire, lnSucces
		lcFiltru = [2=2]
		lcSchema = []
		lcOrder = [denumire,cod_fiscal,id_part]
		lccoloane = [denumire,cod_fiscal,id_part]
		lcTitlu = [Alegeti furnizorul]
		lcTitluColoane = [Denumire,Cod fiscal,Id]
		lcSelect = [select denumire, cod_fiscal, id_part from vnom_parteneri ]
		
		lcFiltruOriginal = [ INACTIV = 0 ]
		lcNumeProc = [nom_parteneri]
		
		llToateIreg = .F.
		lcPrimaColoana = [denumire]
		lnPornire = 1
		lcIdColumn = "id_part"
		locauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana, ;
			  lnPornire, , lcIdColumn)
		
		If gnbuton <> 2
		
			lnId = crs_inventar.id_inventar
			lnSucces = This.UpdateServer(lnId, 'id_furnizor', locauta.id_part)
			If m.lnSucces > 0
				Select crs_inventar
				Replace id_furnizor With locauta.id_part, furnizor With locauta.denumire
				This.grid1.Refresh()
			Endif
		Endif
		
		
	ENDPROC

	PROCEDURE do_copiaza
		this.do_adauga(.T.)
	ENDPROC

	PROCEDURE do_excel
		If Reccount(This.grid1.RecordSource)>0
			lcOrder = "denumire"
			export_excel_grid(This.grid1, lcOrder)
		Else
			amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_executa
		lcSel = ALLTRIM(this.cnumecursor)
		
		SELECT (lcSel)
		lnRandCrt = RECNO()
		thisform.LockScreen = .T.
		
		SUM ROUND(pret*stoc_scriptic,gnPc) TO thisform.nstoc_scriptic 
		SUM ROUND(pret*stoc_faptic,gnPc) TO thisform.nstoc_faptic
		
		SUM ROUND((pretv+tvav)*stoc_scriptic,gnPc) TO thisform.nstoc_scripticv 
		SUM ROUND((pretv+tvav)*stoc_faptic,gnPc) TO thisform.nstoc_fapticv
		
		SUM ROUND(stoc_scriptic,gnPcant) TO thisform.ncstoc_scriptic 
		SUM ROUND(stoc_faptic,gnPcant) TO thisform.ncstoc_faptic
		
		thisform.ndiferenta =  thisform.nstoc_faptic - thisform.nstoc_scriptic
		thisform.ndiferentav =  thisform.nstoc_fapticv - thisform.nstoc_scripticv
		thisform.ncdiferenta =  thisform.ncstoc_faptic - thisform.ncstoc_scriptic
		
		SELECT (lcSel)
		IF lnRandCrt > 1
			GO RECORD lnRandCrt
		ELSE 
			LOCATE 
		ENDIF 
		
		this.clb_tx_simplu1.Refresh 
		this.clb_tx_simplu2.Refresh 
		this.clb_tx_simplu3.Refresh 
		
		this.clb_tx_simplu4.Refresh 
		this.clb_tx_simplu5.Refresh 
		this.clb_tx_simplu6.Refresh 
		
		this.clb_tx_simplu7.Refresh 
		this.clb_tx_simplu8.Refresh 
		this.clb_tx_simplu9.Refresh 
		
		thisform.LockScreen = .F.
	ENDPROC

	PROCEDURE do_listare
		*!* 10.11.2020
		*!* + pcNewPageOnGroup - se sare la pagina noua pentru fiecare responsabil (inventar ob inv in folosinta pe responsabili)
		
		Local lcRaport
		Local lcFiltru, lcMenu, lcSel, lnx
		Private pcGrup, pcHeaderGrup, pcFooterGrup, pcIdGrup, pcNewPageOnGroup
		Private pcSubtitlu, pcDataOra
		pcSubtitu = []
		pcHeaderGrup = []
		pcFooterGrup = []
		pcIdGrup = []
		pcGrup = []
		pcNewPageOnGroup = [1]
		lcRaport = []
		
		lcMenu = "Lista de inventariere;Lista de inventariere (stoc faptic necompletat);Lista de inventariere (necompletat)"
		lnx = xmenu(m.lcMenu)
		If Empty(m.lnx)
			Return
		Endif
		
		pcSubtitlu = Thisform.citeste_doc()
		If !Empty(Nvl(pcSubtitlu, []))
			pcSubtitlu = [Documente incluse pe inventar dupa inceperea acestuia : ] + Alltrim(pcSubtitlu) + Chr(13) + Chr(10)
		Else
			pcSubtitlu = ''
		Endif
		pcSubtitlu = pcSubtitlu + This.filtru_pretty_ro_full
		pcDataOra = get_ora(2)
		
		Do Case
			Case lnx = 1 And Thisform.linventarroavin
				lcRaport = [rap_vin_nota_inv]
			Case lnx = 2 And Thisform.linventarroavin
				lcRaport = [rap_vin_nota_inv_necompletat]
			Case lnx = 1
				lcRaport = [rap_nota_inv2005]
			Case lnx = 2
				lcRaport = [rap_nota_inv2005_necompletat]
			Case lnx = 3
				lcRaport = [rap_nota_inv2005_necompletat_tot]
				
		Endcase
		
		lcSel = This.cnumecursor
		lcFiltru = This.ocursor.ca_baza1.cfiltru
		
		* Filtru GridExtra
		lcFilter = FILTER(This.cnumecursor)
		IF !EMPTY(m.lcFilter)
			lcFiltru = IIF(!EMPTY(m.lcFiltru), m.lcFiltru + [ and ] , []) + [(] + m.lcFilter + [)]
		ENDIF 
		
		If !Empty(lcFiltru)
			lcFiltru = [ where ] + lcFiltru
		ENDIF
		
		
		If This.lobinv
			pcHeaderGrup = [Responsabil : ]
			pcFooterGrup = [ RESPONSABIL : ]
			pcIdGrup = [id_responsabil]
			pcGrup = [responsabil]
			pcNewPageOnGroup = [id_responsabil]
		Else
			pcHeaderGrup = [Gestiunea : ]
			pcFooterGrup = [ GESTIUNE : ]	
			pcIdGrup = [id_gestiune]
			pcGrup = [nume_gestiune]
			pcNewPageOnGroup = [1]
		Endif
		
		Select * From (lcSel) &lcFiltru ;
			Order By &pcGrup, denumire, codmat, Cont, acont ;
			Into Cursor crsListare nofilter
		*!*	SET STEP ON
		*!*		LOCAL lcText
		*!*		m.pcTextLunaAn = 'Luna contabila ' + allt(str(m.gnLuna)) + '/' + allt(str(m.gnAn)) + 'Inventar ' + transform(m.pdDataInceputInventar)+ NVL(m.pdDataSfarsitInventar, ' -  ' + transform(m.pdDataSfarsitInventar), '') + NVL(m.pnNract, ' Nr act ' + alltrim(str(pnNract)),'') + NVL(m.pnNnir, ' Nr bon ' + alltrim(str(pnNnir)),'') + NVL(m.pdDataNotaInventar, ' Data ' + transform(m.pdDataNotaInventar), '')
		This.AlwaysOnTop = .F.
		
		Select crsListare
		Keyboard '{CTRL+F10}'
		*!*		Report Form (lcRaport) To Printer Prompt Preview
		
		*!*	* Rulez raportul o data fara preview pentru calcularea PageTotal pe grupuri (la responsabil se reseteaza pagina la 1 la fiecare responsabil)
		*!*	REPORT FORM (m.lcRaport) TO FILE TestTxt.TXT NOCONSOLE NODIALOG
		*!*	ERASE TestTxt.TXT
		goExport.export2frx([crsListare], lcRaport, , , , , , .T.)
		
		This.AlwaysOnTop = .T.
		
		Use In (SELECT('crsListare'))
		
		*!*	* Inchid cursorul folosit la calcularea PageTotal pe grupuri
		*!*	USE IN (SELECT('cPageTotalTemp')) && UpdatePageTotalGroup()
	ENDPROC

	PROCEDURE do_reface
		*!* 05.06.2012
		*!* marius.mutu
		*!* se poate reface inventarul chiar daca este validat, la corectie de inventar
		
		*!* 15.12.2017
		*!* marius.mutu
		*!* se poate reface inventarul si daca este corectie, indiferent daca nOptiune inventar = 1 sau 3 (inventar initial cu golire de stoc)
		
		*!* 05.01.2018
		*!* marius.mutu
		*!* adaugarea de articole in inventar din documente dupa introducerea inventarului - nu se completeaza stocul faptic, indiferent de ce optiune s-a ales la inceputul inventarului
		*!* ca sa nu se denatureze inventarierea faptica. In plus nu s-ar inregistra nici o diferenta daca stoc faptic = stoc scriptic
		
		LOCAL llReturn
		llReturn = .T.
		If this.lCorectie OR !This.lvalidat
			Local lcCursor,lcSql,lnSucces,loFrm,lcListaIdFact
			lcCursor = [crstmpintdoc]
			lcSql = [{call pack_inventar.citeste_documente(] + Alltrim(Str(Thisform.nidcinventar)) + [)}]
			lnSucces = goExecutor.oExecute(lcSql,lcCursor+[1])
			If lnSucces < 0
				amessagebox(goExecutor.cEroare,64,"Eroare")
				llReturn = .F.
			Else
				If Reccount(lcCursor+[1]) > 0
					copiaza_structura_cursor(lcCursor+[1],lcCursor)
					Insert Into (lcCursor) Select * From (lcCursor+[1]) Order By tip Desc,ales Desc,dataact,dataora
					Go Top
					Use In (Select(lcCursor+[1]))
					loFrm = Createobject("frm_inventar_doc")
					loFrm.Show(1)
					If gnButon = 1
						Select (lcCursor)
						Set Filter To ales = 1 And tip = 0
						lcListaIdFact = []
						Scan
							lcListaIdFact = lcListaIdFact + Alltrim(Str(id_fact)) + [|]
						Endscan
						If !Empty(lcListaIdFact)
							lcSql = [begin pack_inventar.adauga_documente(] + Alltrim(Str(Thisform.nidcinventar)) + [,] + ;
								['] + Alltrim(lcListaIdFact) + [',?gnIdUtil, 1); end;]
							lnSucces = goExecutor.oExecute(lcSql)
							If lnSucces < 0
								amessagebox(goExecutor.cEroare,64,"Eroare")
								llReturn = .F.
							Else
								save_grid_tag(Thisform.grid1)
								podecabaza.ca_baza1.afisare()
								restore_grid_tag(Thisform.grid1)
							Endif
						Endif
					Else
						llReturn = .F.
					Endif
				Else
					amessagebox("Nu exista documente introduse dupa inceperea inventarului!",48,"Atentie")
				Endif
				Use In (Select(lcCursor))
			Endif
		ENDIF
		RETURN llReturn
	ENDPROC

	PROCEDURE do_sterge
		IF thisform.lvalidat
			Return
		EndIf 
		
		If Reccount('crs_inventar')>0
			Select crs_inventar
			Scatter Name loArticolS
			IF NVL(loArticolS.stoc_scriptic,0) <> 0 AND !This.lCorectie
				aMessagebox("Nu puteti sterge un articol cu stoc scriptic diferit de 0!",0+48,_Screen.Caption)
				RETURN
			ENDIF 	
			lcNumeArticol=Upper(Alltrim(loArticolS.denumire))
			If aMessagebox("Doriti sa stergeti articolul "+lcNumeArticol+" din inventar?",4+32+256,"Confirmare stergere")==6
				lcSql = 'delete from ' + gcs + '.gest_inventar where id_inventar='+Alltrim(Str(loArticolS.id_inventar))
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					aMessagebox(goExecutor.ceroare,16,"Eroare")
					gnButon = 2
				Endif
				This.actualizeaza_grid1
			Endif
			Store "" To loArticolS
		Endif
		
	ENDPROC

	PROCEDURE do_termin
		If This.inainte_de_do_termin()
			gnButon = 1
			pnButon = 1
			Buton = 1
			pnIesire = 1
			This.Release
		Else
			This.Visible = .T.
		*!*	modificare serii numere	- 10.2007
			If Type([_Screen.nId_tipdoc]) = 'N' And !Empty(_Screen.nid_tipdoc)
				poGeneratorNumere.dezaloca_numar(_Screen.nid_tipdoc)
			Endif
		*!*		IF PEMSTATUS(_SCREEN,'nIdSerie',5)
		*!*			lnIdSerieBon =  _SCREEN.nIdSerie  && il salvez in item.when
		*!*			IF TYPE('lnIdSerieBon') = 'N' AND !EMPTY(lnIdSerieBon)
		*!*				lcSql = [update ] + gcS + [.serii_numere  set alocat = 0 where ] +;
		*!*					[ id_numar = ?lnIdSerieBon]
		*!*				lnSucces = goExecutor.oExecute(lcSql)
		*!*				IF lnSucces < 0
		*!*					lcTitlu = [Eroare]
		*!*					lcTip = [Avertizare]
		*!*					lcImagine = [exclam.ico]
		*!*					lcMesaj = goExecutor.cEroare
		*!*					ofrm_eroare = CREATEOBJECT('frm_mesaj',lcTitlu,lcImagine,lcTip,lcMesaj)
		*!*					ofrm_eroare.SHOW(1)
		*!*					RELEASE ofrm_eroare
		*!*				ENDIF
		*!*			ENDIF
		*!*		ENDIF
		*!*	modificare serii numere	- 10.2007	^
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		*!* 08.02
		*!*	IF !INLIST(poact.id_set, 26000) && Bon de consum cu inventar
		
		
		Local lcCrs
		Local ofrm_eroare As 'frm_mesaj'
		Local lCompletareParteneri, lVerificAnalitic, lcContCoresp, lcCursor, lcFiltruOriginal, lcImagine
		Local lcMesaj, lcSchema, lcSel, lcTip, lcTitlu, lcgroup, llCorectie, llModParam, lnCod, lnIdFact
		Local lnSucces, loAct
		*:Global gnButon, onota
		lcCrs = This.cnumecursor
		
		llCorectie = This.lCorectie
		lnCod = This.nCod
		lnIdFact = This.nIdFact
		
		
		*!*	modificare	v 2.0.186
		If !Thisform.do_reface()
			Return .F.
		ENDIF
		
		*!* VERIFIC DACA EXISTA INREGISTRARI MODIFICATE (ID_UTIL) CARE NU AU FOST VALIDATE
		IF this.lCorectie 
			SELECT crs_inventar
			LOCATE FOR EMPTY(NVL(validat,0))
			IF !FOUND()
				AMESSAGEBOX('Nu exista modificari nevalidate!',0,'Inventariere')
				Return .F.	
			ENDIF 
		ELSE 
			If This.lvalidat
				AMESSAGEBOX('Nu exista modificari nevalidate!',0,'Inventariere')
				Return .F.
			Endif
		ENDIF 		
		
		
		If !This.lBonConsum
			lcTitlu = [Nota Inventariere]
			lcTip = [INTREBARE]
			lcImagine = [intreb.ico]
			lcMesaj = [Doriti sa incheiati nota de inventariere?]
			ofrm_eroare = Createobject('frm_mesaj', lcTitlu, lcImagine, lcTip, lcMesaj)
			ofrm_eroare.Show(1)
			Release ofrm_eroare
		Else
			gnButon = 1
		Endif
		
		
		
		
		Local lnIdSet
		*!*	modificare	15.08.2007
		Do Case
			Case Thisform.linventarroavin
				lnIdSet = 30009
				*!*	modificare ROAPRODUCTIE	v 2.0.0
			Case Thisform.lBonConsum
				lnIdSet	= 26000
				*!*	modificare ROAPRODUCTIE	v 2.0.0	^
			Otherwise
				lnIdSet = 90101
		Endcase
		*!*	modificare 	15.08.2007	^
		
		Local llReturn
		llReturn = .T.
		
		If gnButon = 1
			*!* aduc toate inregistrarile de pe server (daca sunt filtrate este posibil sa nu fie pe local toate modificarile din sesiunea curenta)
			*!*		IF !EMPTY(this.filtru_pretty_ro_full)
			This.but_reset_criterii1.Click()
			*!*		ENDIF
		
			*!*		This.do_reset
			*!*	*!*		THIS.actualizeaza_grid1()
			*!*		Thisform.actualizeaza_grid1("2=2")
		
			*!*	modificare	v 2.2.34
			Use In (Select("rul_temp"))
			Use In (Select("rul_temp_obinv"))
			*!*	modificare	v 2.2.34	^
		
			lcSel = [Select * from ] + gcs + [.vrul where 1=2]
			lcSchema = ['']
			lcCursor = [rul_temp]
		
			If This.lobinv
				lcSel = [Select * from ] + gcs + [.vrul_obinv where 1=2]
				lcSchema = ['']
				lcCursor = [rul_temp_obinv]
			Endif
		
			lnSucces = goExecutor.oExecute(lcSel, lcCursor)
			If lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
				Return .F.
			Endif
		
		
			*!* 07.07.2006
			*!* marius.mutu
			*!* in cererea de date se afiseaza prima gestiune din inventar (pentru numere de bonuri pe gestiuni)
			*!*		SELECT (lcCrs)
			*!*		LOCATE FOR stoc_scriptic - stoc_faptic <> 0 AND VALIDAT = 0
			*!*		IF FOUND()
			*!*			lnIdGestiune = id_gestiune
			*!*			lcGestiune = nume_gestiune
			*!*		ELSE
			*!*			lnIdGestiune = 0
			*!*			lcGestiune = ""
			*!*		ENDIF
			*!*		LOCAL taValori
			*!*		Dimension taValori[2,3]
			*!*		taValori[1,1]="poAct.id_gestout"
			*!*		taValori[1,2]=Alltrim(Str(lnIdGestiune ))
			*!*		taValori[1,3]= !EMPTY(lnIdGestiune )
		
			*!*		taValori[2,1]="poAct.gestout"
			*!*		taValori[2,2]=IIF(!EMPTY(lnIdGestiune ),lcGestiune,[])
			*!*		taValori[2,3]=!EMPTY(lnIdGestiune )
		
			This.Hide
			&& cerere date
		
			If !This.lBonConsum
				gnButon = lans(lnIdSet)
			Endif
			*!*		gnButon =lans(90101,.F.,.F.,@taValori)
		
			If gnButon <> 2 && renunt
				Select actactan
				Locate
				Scatter Name loAct
		
				&& completare actactan
				If .T. && nu mai fac ramura speciala pentru nota obiecte inventar in folosinta !This.lobinv
					lcCrs = This.cnumecursor
					Select Cont, acont, nr_pag, id_gestiune, proc_tvav, ;
						Sum(Round(Pret * (stoc_scriptic - stoc_faptic), gnPc)) As valoare_achizitie, ;
						Sum(Round((pretv - Pret) * (stoc_scriptic - stoc_faptic), gnPc)) As valoare_adaos, ;
						Sum(Round(tvav * (stoc_scriptic - stoc_faptic), gnPc)) As valoare_tva ;
						From (lcCrs) ;
						WHERE stoc_scriptic - stoc_faptic <> 0  AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie) ;				
						Group By Cont, acont, nr_pag, id_gestiune, proc_tvav ;
						Order By nr_pag, Cont, acont, proc_tvav ;
						Into Cursor tcrs
		
					Select actactan
					Delete All
		
					Select tcrs
					Scan
						Scatter Name onota
						Select actactan
						Append Blank
		
						If This.lBonConsum
							Private poF_doc
							Store '' To poF_doc
		
							Local lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
							lcSchema1 = []
							lcSelect1 = [select * from vnom_fdoc ]
							lcOrder1 = []
							lcgroup = []
							lcFiltru1 = [ TRIM(UPPER(fel_document)) = 'BON CONSUM']
							lcFiltruOriginal = []
							llModParam = .T.
							llAfiseaza = .F.
		
							gencursor('poF_doc', 'crsF_doc', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza,  lcgroup, llModParam, lcFiltruOriginal)
							poF_doc.ca_baza1.afisare()
		
							Select crsF_doc
							Go Top
							poact.id_fdoc = id_fdoc
							poact.fdoc = fel_document
		
							Select actactan
							Gather Name poact && 21.09.2006 - bon consum
		
							Release poF_doc
							If Used('crsF_doc')
								Use In crsF_doc
							Endif
						Endif
		
						*!*	modificare	ROAVIN v 2.0.1 ( 19.05.2011 )
						Select crsconfigcvc
						Locate For Cont = Upper(Alltrim(onota.Cont))
						If Found()
							lcContCoresp = Alltrim(cont_chelt)
						Else
							If Left(Alltrim(onota.Cont), 2) = '34'
								lcContCoresp = '711'
							Else
								If Alltrim(onota.Cont) # '371'
									lcContCoresp = Strtran(onota.Cont, '3', '6', 1, 1)
								Else
									lcContCoresp = '607 '
								Endif
							Endif
						Endif
						*!*					If Left(Alltrim(onota.Cont),2)='34'
						*!*						lcContCoresp = '711'
						*!*					Else
						*!*						If Alltrim(onota.Cont) # '371'
						*!*							lcContCoresp = Strtran(onota.Cont, '3', '6', 1, 1)
						*!*						Else
						*!*							lcContCoresp = '607 '
						*!*						Endif
						*!*					Endif
						*!*	modificare	ROAVIN v 2.0.1 ( 19.05.2011 )	^
						
						* obiecte de inventar in folosinta - clasa 8 nu are corespondent
						IF LEFT(onota.Cont,1) = '8'
							lcContCoresp = ''
						ENDIF 
						
						loAct.scc = onota.Cont
						loAct.ascc = onota.acont
						loAct.id_gestout = onota.id_gestiune
		
						Select actactan
						If This.lBonConsum && 21.09.2006 - bon consum
							Replace scc With loAct.scc, ;
								ascc With loAct.ascc
						Else
							Gather Name loAct
						Endif
		
						
						Replace suma With onota.valoare_achizitie, scd With lcContCoresp
						If onota.nr_pag = 6 && marfa la pret de vanzare
							Select actactan
							Append Blank
							Gather Name loAct
							Replace suma With onota.valoare_adaos, scd With '378 ', proc_tva With onota.proc_tvav
							If onota.proc_tvav <> 1
								Select actactan
								Append Blank
								Gather Name loAct
								Replace suma With onota.valoare_tva, scd With '4428', proc_tva With onota.proc_tvav
							Endif
						Endif
						Select tcrs
					Endscan
					Use In tcrs		&&	modificare	23.10.2012
				Else
					Select actactan
					Locate
					Replace scd With '603 ', scc With '303 '
				Endif
				&& completare rul_temp
		
				lcCrs = This.cnumecursor
		
				If This.lobinv
		
					Insert Into rul_temp_obinv (id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, cante, tvav, proc_tvav, id_responsabil, datapif, dns_luni, id_set, id_rul_aux, serie, lot) ;
						Select id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, stoc_scriptic - stoc_faptic As cante, ;
						tvav, proc_tvav, id_responsabil, datapif, dns_luni, lnIdSet, id_rul_aux, serie, lot ;
						From &lcCrs ;
						Where stoc_scriptic-stoc_faptic <>0 AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie)
					***-------
					** modificarea uzurii (dns_luni)
					Insert Into rul_temp_obinv (id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, cante, tvav, proc_tvav, id_responsabil, datapif, dns_luni, id_tip_rulaj, id_set, id_rul_aux, serie, lot) ;
						Select id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, stoc_faptic As cante, ;
						tvav, proc_tvav, id_responsabil, datapif, dns_luni, 4 As id_tip_rulaj, lnIdSet, id_rul_aux, serie, lot ;
						From &lcCrs ;
						Where (stoc_scriptic <> 0 Or stoc_faptic <> 0) And dns_luni_faptic <> dns_luni  AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie)
		
					Insert Into rul_temp_obinv ( id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, cant, tvav, proc_tvav, id_responsabil, datapif, dns_luni, id_tip_rulaj, id_set, id_rul_aux, serie, lot) ;
						Select  id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, stoc_faptic As cant, ;
						tvav, proc_tvav, id_responsabil, datapif, dns_luni_faptic, 4 As id_tip_rulaj, lnIdSet, id_rul_aux, serie, lot ;
						From &lcCrs ;
						Where (stoc_scriptic <> 0 Or stoc_faptic <> 0) And dns_luni_faptic <> dns_luni AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie)
		
					lcCursor = [rul_temp_obinv]
					Select (lcCursor)
					Replace All nnir With loAct.nnir, dataact With loAct.dataact, nract With loAct.nract, serie_Act With loAct.serie_Act
					Replace All datapif With loAct.dataact For cant <> 0
					Replace All id_set With lnIdSet For Empty(id_set)
				Else
		
					If This.lBonConsum
						Insert Into rul_temp(id_articol, id_gestiune, id_lucrare, Cont, acont, Pret, pretd, ID_Valuta, pretv, cante, tvav, proc_tvav, id_set, id_rul_aux, serie, lot, adata_expirare, id_lucrare_rez, id_part_rez) ;
							Select  id_articol, id_gestiune, poact.id_lucrare As id_lucrare, Cont, acont, Pret, pretd, ID_Valuta, pretv, stoc_scriptic - stoc_faptic As cante, tvav, proc_tvav, id_set, id_rul_aux, serie, lot, adata_expirare, id_lucrare_rez, id_part_rez ;
							From &lcCrs Where stoc_scriptic - stoc_faptic <> 0  AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie)
					Else && de unde pune id_set la productie ????
						Insert Into rul_temp( id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, cante, tvav, proc_tvav, id_set, id_rul_aux, serie, lot, adata_expirare, id_lucrare_rez, id_part_rez) ;
							Select id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, stoc_scriptic - stoc_faptic As cante, tvav, proc_tvav, lnIdSet, id_rul_aux, serie, lot, adata_expirare, id_lucrare_rez, id_part_rez ;
							From &lcCrs Where stoc_scriptic - stoc_faptic <> 0  AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie)
					Endif
					lcCursor = [rul_temp]
					Select (lcCursor)
					Replace All nnir With loAct.nnir, dataact With loAct.dataact, nract With loAct.nract, serie_Act With loAct.serie_Act
					Replace All id_set With lnIdSet For Empty(id_set)
				Endif
		
		
				If This.lBonConsum && prg Productie
					Select (lcCursor)
					Replace All nnir With poact.nnir, ;
						dataact With poact.dataact, ;
						id_sectie With poact.id_sectie, ;
						id_responsabil With poact.id_responsabil, ;
						id_gestiune With poact.id_gestiune, nract With loAct.nract, serie_Act With loAct.serie_Act
				Endif
		
				&& verificare note contabile
				Select actactan
				Locate
				lVerificAnalitic = .T.
				lCompletareParteneri = .T.
		
				*!*			IF !INLIST(poact.id_set, 26000) && Bon de consum cu inventar
				If !This.lBonConsum
					Do Form verificare With lVerificAnalitic, lCompletareParteneri
				Endif
			Endif
		
			llReturn = gnButon = 1
		Else
			llReturn = .F.
		Endif
		
		Return llReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters tnIdCInventar
		DoDefault()
		This.nidcinventar = tnIdCInventar
		
		This.gridextra1.Setup()
	ENDPROC

	PROCEDURE Show
		Lparameters nStyle
		*** CREEZ CURSORUL INITIAL
		
		*!*	lcSelect = ALLTRIM(This.cSelect)
		*!*	lcFiltru = Iif(!Empty(This.cFiltru),This.cFiltru + [ AND ] + This.cFiltruOriginal,This.cFiltruOriginal)
		*!*	lcFiltruOriginal = ALLTRIM(This.cFiltruOriginal)
		*!*	lcSchema = ALLTRIM(This.cSchema)
		lcOrder = Alltrim(This.cOrder)
		*llAfisare = .F.
		*lcNumeCursor = This.cNumecursor
		
		*llModParam = this.lmodparam
		
		*!* INREGISTRARILE MODIFICATE VALIDATE: GRI RGB(230,230,230)
		*!* INREGISTRARILE MODIFICATE NEVALIDATE: BLUE PAL RGB(240,241,255)
		*this.grid1.SetAll("DynamicBackColor","IIF(NVL(VALIDAT,0) = 1, RGB(230,230,230), IIF(!EMPTY(NVL(ID_UTIL,0)), RGB(240,241,255), RGB(255,255,255)))","Column")
		
		*!* COLOANELE CARE SE POT MODIFICA: ALBASTRU RGB(234,249,255)
		this.grid1.cstoc_faptic.DynamicBackColor = "RGB(234,249,255)"
		this.grid1.cMotiv_depreciere.DynamicBackColor = "RGB(234,249,255)"
		this.grid1.cDepreciere.DynamicBackColor = "RGB(234,249,255)"
		this.grid1.cUzura_faptic.DynamicBackColor = "RGB(234,249,255)"
		this.grid1.cData_expirare.DynamicBackColor = "RGB(234,249,255)"
		
		IF this.lvalidat AND !this.lCorectie 
			this.but_nou1.Visible= .F.
			this.but_sterge1.Visible = .F.
			this.but_terMIN1.Visible = .F.
		ENDIF
		
		This.grid1.cCants.Visible = .F.
		This.grid1.cCant.Visible = .F.
		This.grid1.cCante.Visible = .F.
		
		*!*	modificare	15.08.2007
		If !This.lInventarroavin
			This.grid1.SetAll("DynamicFontItalic","IIF(NVL(id_rul_aux,0)<>0,.T.,.F.)","Column")
			This.grid1.SetAll("DynamicForeColor","IIF(NVL(id_rul_aux,0)<>0,RGB(128,128,128),RGB(0,0,0))","Column")
			This.grid1.RemoveObject("cCant_zahar")
			This.grid1.RemoveObject("cGrade_alcool")
			This.grid1.RemoveObject("cPotential")
			This.grid1.RemoveObject("cStadiu")
			This.grid1.RemoveObject("cAn_prod")
			This.grid1.RemoveObject("cExplicatie")
			This.grid1.RemoveObject("cAcronim")
		
			Thisform.acronim = .F.
			Thisform.cant_zahar= .F.
			Thisform.grade_alcool= .F.
			Thisform.an_prod= .F.
			Thisform.potential= .F.
			Thisform.stadiu= .F.
			Thisform.explicatie = .F.
		Else
			This.lb_explicatie.Visible = .F.
		Endif
		*!*	modificare	15.08.2007	^
		
		If This.lobinv
			This.grid1.cResponsabil.Visible = .T.
			This.grid1.cMeserie.Visible = .T.
			This.grid1.cFormatia.Visible = .T.
			This.grid1.cDataAng.Visible = .T.
			This.grid1.cDatalic.Visible = .T.
			This.grid1.cDatapif.Visible = .T.
			This.grid1.cDns_luni.Visible = .T.
			This.grid1.cuzura_faptic.Visible = .T.
			This.grid1.cdif_dns_luni.Visible = .T.
			This.grid1.cDNF.Visible = .T.
			This.grid1.cdata_expirare.Visible = .T.
		
			This.grid1.cResponsabil.ColumnOrder = 2
			This.grid1.cCodmat.ColumnOrder = 3
			This.grid1.cDenumire.ColumnOrder = 4
			This.grid1.cSerie.ColumnOrder = 5
			This.grid1.cUM.ColumnOrder = 6
			This.grid1.cCgest.ColumnOrder = 7
			This.grid1.ccont.ColumnOrder = 8
			This.grid1.cacont.ColumnOrder = 9
			This.grid1.cpret_unitar.ColumnOrder = 10
			This.grid1.cstoc_scriptic.ColumnOrder = 11
			This.grid1.cstoc_faptic.ColumnOrder = 12
			This.grid1.cdiferenta.ColumnOrder = 13
			This.grid1.cvaldif.ColumnOrder = 14
		
			This.grid1.cDns_luni.ColumnOrder = 15
			This.grid1.cuzura_faptic.ColumnOrder = 16
			This.grid1.cdif_dns_luni.ColumnOrder = 17
		
			This.grid1.cdepreciere.ColumnOrder = 18
			This.grid1.cmotiv_depreciere.ColumnOrder = 19
		
			This.grid1.cMeserie.ColumnOrder = 20
			This.grid1.cFormatia.ColumnOrder = 21
			This.grid1.cDataAng.ColumnOrder = 22
			This.grid1.cDatalic.ColumnOrder = 23
		
			This.grid1.cCants.ColumnOrder = 24
			This.grid1.cCant.ColumnOrder = 25
			This.grid1.cCante.ColumnOrder = 26
			This.grid1.cUtilizator.ColumnOrder = 27
			This.grid1.cDataIn.ColumnOrder = 28
		*	This.grid1.cValidat.ColumnOrder = 28
		
			This.respons= .T.
			This.meserie= .T.
			This.formatie= .T.
			This.dataang= .T.
			This.datalic= .T.
			*This.ck_diferenta_dns_luni.Visible = .T.
		Else
			This.grid1.cResponsabil.Visible = .F.
			This.grid1.cMeserie.Visible = .F.
			This.grid1.cFormatia.Visible = .F.
			This.grid1.cDataAng.Visible = .F.
			This.grid1.cDatalic.Visible = .F.
			This.grid1.cDatapif.Visible = .F.
			This.grid1.cDns_luni.Visible = .F.
			This.grid1.cuzura_faptic.Visible = .F.
			This.grid1.cdif_dns_luni.Visible = .F.
			This.grid1.cDNF.Visible = .F.
			This.grid1.cdata_expirare.Visible = .F.
		
			This.respons= .F.
			This.meserie= .F.
			This.formatie= .F.
			This.dataang= .F.
			This.datalic= .F.
			*This.ck_diferenta_dns_luni.Visible = .F.
		Endif
		
		If This.lbonconsum
			This.lb_TITLU_ALB_B121.Caption="Bon de consum cu inventar"
		
			This.grid1.ColumnCount = 16
			This.validat = .F.
			This.nevalidat = .F.
			This.grupegest = .F.
		
			This.but_nou1.Visible = .F.
			This.but_sterge1.Visible = .F.
			This.but_excel1.Visible = .F.
			This.but_listare1.Visible = .F.
		Endif
		
		
		
		*!*	* Replace default headers with custom one
		*!*	lcOrder = this.corder
		*!*	i=0
		*!*	For Each loColumn In This.GRID1.Columns
		*!*		i = i + 1
		*!*		With loColumn
		*!*			If !Empty(loColumn.ControlSource)
		
		*!*				* Save default caption, color and font
		
		*!*				lcOldCaption   = loColumn.Header1.Caption
		*!*				lcOldFontName = loColumn.Header1.FontName
		*!*				lnOldForeColor = loColumn.Header1.ForeColor
		*!*				llOldFontUnderline = loColumn.Header1.FontUnderline
		*!*				llOldWordWrap = loColumn.Header1.WordWrap
		*!*
		*!*				* Name Header Obj after ControlSource
		
		*!*				lcControlSrc = loColumn.ControlSource
		*!*				lnControlSrc = Rat(".", lcControlSrc) + 1
		*!*				lcControlSrc = Substr(lcControlSrc, lnControlSrc)
		
		*!*				*	Metoda dupa care se face ordonarea relativa la grid
		*!*				lcMethodName = 'parent.corderby_assign'
		*!*				lcPropColOrder = 'parent.cOrder'
		*!*				lcPropSensOrder = 'parent.cAsc'
		*!*				* Remove old and create new header
		
		*!*				.RemoveObject("Header1")
		*!*				.AddObject("grh"+ALLTRIM(STR(i)), ;
		*!*					"PSHeader", ;
		*!*					lcOldCaption, lcOldFontName,lnOldForeColor,llOldFontUnderline,lcMethodName,lcControlSrc,llOldWordWrap)
		
		*!*				If Upper(Alltrim(lcControlSrc)) = Upper(Alltrim(lcOrder))
		*!*					lcCuloare = [locolumn.grh] + ALLTRIM(STR(i)) + [.forecolor = RGB(0,0,255)]
		*!*					&lcCuloare
		*!*					lcUnderline = [locolumn.grh] + ALLTRIM(STR(i)) + [.FontUnderline = .t.]
		*!*					&lcUnderline
		*!*				Endif
		*!*			Endif
		*!*		Endwith
		*!*	ENDFOR
		This.do_executa
		This.grid1.SetFocus
		
		This.WindowState = 2
	ENDPROC

	PROCEDURE updateserver
		Parameters tnId, tcCol, tValue
		LOCAL lnSucces
		PRIVATE pnIdRulAux
		pnIdRulAux = 0
		lnSucces = 1
		If LOWER(ALLTRIM(m.tcCol)) = 'id_furnizor'
			lcSql = [begin pack_contafin.GetRulajAuxiliarFurnizor(] + TRANSFORM(tValue) + [, ?@pnIdRulAux); end;]
			lnSucces = goExecutor.oExecute(m.lcSql)
			IF m.lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare, 0+48, _screen.Caption)
				RETURN m.lnSucces 
			ELSE
				tcCol = 'id_rul_aux'	
				tValue = m.pnIdRulAux
			ENDIF 
		ENDIF 
		
		lcSql = 'update gest_inventar set id_util = ?gnIdUtil, ' + tcCol + ' = ?tValue where id_inventar = ?tnId'
		lnSucces = goExecutor.oExecute(lcSql)
		If lnSucces < 0
			aMESSAGEBOX('Nu s-au facut modificari pe server!',0+16,"Eroare")
		Endif
		
		Thisform.do_executa
		
		RETURN m.lnSucces
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		Parameters tacriterii
		External Array tacriterii
		#Define crlf Chr(13)+Chr(10)
		lcStringCriterii="Denumire articol\denumire\T\id_articol\nom_articol"+ crlf + ;
			"Cod material\codmat\T\none\"+ crlf + ;
			"Cod bare\codbare\T\none\"+ crlf + ;
			"Pret achizitie\pret\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret vanzare\pretv+tvav\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret valuta\pretd\N|get_mask(12,gnPPretval)\none\" + crlf + ;
			"Cont\cont\T\none\" + crlf + ;
			"Analitic\acont\T\none\" + crlf + ;
			"Gestiune\id_gestiune\I\id_gestiune\nom_gestiune" + crlf + ;
			"Grupa articol\none\I\id_grupa\nom_grupa_articol"+ crlf + ;
			"Subgrupa articol\none\I\id_subgrupa\nom_subgrupa_articol"+ crlf
		If (Thisform.Validat=.T.)
			lcStringCriterii=lcStringCriterii+"Validat\nofiled\E\ validat=1\" + crlf
		Endif
		If (Thisform.nevalidat=.T.)
			lcStringCriterii=lcStringCriterii+	"Nevalidat\nofiled\E\ validat=0\" + crlf
		Endif
		If (Thisform.grupegest=.T.)
			lcStringCriterii=lcStringCriterii+"Grupe gestiuni\|E|" + ;
				[id_gestiune in ( ] + ;
				[ select ID_GESTIUNE ] + ;
				[	from vgest_coresp_grupe_gestiuni] + ;
				[       where id_grupe = <<VALOARE>>)] + ;
				[\I\none\nom_grupa_gestiune] + crlf
		Endif
		lcStringCriterii=lcStringCriterii+"Stoc scriptic\stoc_scriptic\N\none\" + crlf + ;
			"Stoc faptic\stoc_faptic\N\none\" + crlf + ;
			"Diferenta\stoc_faptic-stoc_scriptic\N\none\" + crlf + ;
			"Data intrare\datain\D\none\" + crlf + ;
			"Data PIF\datapif\D\none\" + crlf + ;	
			"Lucrare rezervare\nrord_rez\T\ID_LUCRARE_REZ\nom_lucrare" + crlf + ;
			"Partener rezervare\part_rez\T\id_part_rez\nom_parteneri" + crlf + ;
			"TVA vanz. eronat\nofiled\E\ ABS(pretv * (proc_tvav - 1) - tvav) > 0.1\" + crlf	
			
		If Thisform.respons=.T.
			lcStringCriterii=lcStringCriterii +	"Responsabil\responsabil\T\id_responsabil\nom_responsabil" + crlf + ;
				"Meserie\meserie\T\id_meserie\nom_meserie" + crlf + ;
				"Formatie\formatia\T\id_formatia\nom_formatie" + crlf + ;
				"Data angajarii\dataang\D\none\" + crlf + ;
				"Data plecarii\datalic\D\none\"
		Endif
		
		DoDefault()
		*	"An prod\an_prod\N\none\" + crlf + ;
		ENDPROC
		
	ENDPROC

	PROCEDURE Grid1.cData_expirare.Text1.GotFocus
		*!*	modificare	15.08.2007
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
			This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		Endif
		*!*	modificare	15.08.2007	^
	ENDPROC

	PROCEDURE Grid1.cData_expirare.Text1.LostFocus
		IF EMPTY(this.value)
			WAIT WINDOW "Completati data expirarii !"
			this.value = thisform.nValue 
			RETURN 
		ENDIF 
		
		IF NVL(thisform.nvalue,{//::}) # NVL(this.value,{//::})
			* lnDNS_LUNI_FAPTIC =  ROUND(dnf *(100-uzura_faptic)/100, 0)
			lnDNS_LUNI_FAPTIC = (YEAR(data_expirare)*12+MONTH(data_expirare)) - (gnAn*12+gnLuna)
			
			lnUzura_faptic = IIF(DNF = 0, 0, round((dnf - lnDNS_LUNI_FAPTIC) / dnf * 100, 0))	
			REPLACE uzura_faptic WITH lnUzura_faptic
			
			lnId = crs_inventar.id_inventar
			thisform.UpdateServer(lnId,'uzura_faptic', lnUzura_faptic)
			thisform.UpdateServer(lnId,'dns_luni_faptic', lnDNS_LUNI_FAPTIC)	
		ENDIF
	ENDPROC

	PROCEDURE Grid1.cData_expirare.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF
		thisform.nValue = this.Value
		
	ENDPROC

	PROCEDURE Grid1.cDepreciere.Text1.GotFocus
		*!* readonly daca este id_rul_aux completat (adica inventarul provine din alt program)
		*!* daca id_furnizor este completat, din gestiuni
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = (nvl(id_rul_aux,0)<>0 and NVL(id_furnizor,0) = 0)
			This.ReadOnly = (nvl(id_rul_aux,0)<>0 and NVL(id_furnizor,0) = 0)
		Endif
	ENDPROC

	PROCEDURE Grid1.cDepreciere.Text1.LostFocus
		IF thisform.nvalue # this.Value 
			lnId = crs_inventar.id_inventar
			thisform.UpdateServer(lnId,'depreciere',this.Value)
		ENDIF
	ENDPROC

	PROCEDURE Grid1.cDepreciere.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF 
		thisform.nvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cFurnizor.Text1.Click
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF 	
		
		IF crs_inventar.stoc_scriptic <> 0
			RETURN .F.
		ENDIF 
		
		thisform.do_cauta_furnizor()
	ENDPROC

	PROCEDURE Grid1.cFurnizor.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF 	
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cMotiv_depreciere.Text1.GotFocus
		*!* readonly daca este id_rul_aux completat (adica inventarul provine din alt program)
		*!* daca id_furnizor este completat, din gestiuni
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = (nvl(id_rul_aux,0)<>0 and NVL(id_furnizor,0) = 0)
			This.ReadOnly = (nvl(id_rul_aux,0)<>0 and NVL(id_furnizor,0) = 0)
		Endif
	ENDPROC

	PROCEDURE Grid1.cMotiv_depreciere.Text1.LostFocus
		IF thisform.cvalue # this.Value 
			lnId = crs_inventar.id_inventar
			thisform.UpdateServer(lnId,'Motiv_Depreciere',this.Value)
		ENDIF
	ENDPROC

	PROCEDURE Grid1.cMotiv_depreciere.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF 
		thisform.cvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.GotFocus
		*!* readonly daca este id_rul_aux completat (adica inventarul provine din alt program)
		*!* daca id_furnizor este completat, din gestiuni
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = (nvl(id_rul_aux,0)<>0 and NVL(id_furnizor,0) = 0)
			This.ReadOnly = (nvl(id_rul_aux,0)<>0 and NVL(id_furnizor,0) = 0)
		Endif
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.LostFocus
		IF THIS.VALUE < 0
			SELECT crs_inventar
			REPLACE stoc_faptic WITH stoc_scriptic
		ELSE
			IF THISFORM.nvalue # THIS.VALUE
				lnId = crs_inventar.id_inventar
				THISFORM.UpdateServer(lnId,'stoc_faptic',THIS.VALUE)
			ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF 	
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cUzura_faptic.Text1.GotFocus
		*!*	modificare	15.08.2007
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
			This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		Endif
		*!*	modificare	15.08.2007	^
	ENDPROC

	PROCEDURE Grid1.cUzura_faptic.Text1.LostFocus
		IF NVL(thisform.nvalue,0) # this.Value 
			lnDNS_LUNI_FAPTIC =  ROUND(dnf *(100-uzura_faptic)/100, 0)
			lnUzura_faptic = IIF(DNF = 0, 0, round((dnf - lnDNS_LUNI_FAPTIC) / dnf * 100, 0))	
			REPLACE uzura_faptic WITH lnUzura_faptic
			
			lnId = crs_inventar.id_inventar
			thisform.UpdateServer(lnId,'uzura_faptic', lnUzura_faptic)
			thisform.UpdateServer(lnId,'dns_luni_faptic', lnDNS_LUNI_FAPTIC)	
		ENDIF
	ENDPROC

	PROCEDURE Grid1.cUzura_faptic.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF
		thisform.nvalue = this.Value
		
	ENDPROC

	PROCEDURE Gridextra1.applyfilter
		DODEFAULT()
		thisform.do_executa()
	ENDPROC

	PROCEDURE Gridextra1.clearfilter
		DODEFAULT()
		thisform.do_executa()
	ENDPROC

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

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrcrt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrcrt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUM.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUM.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPret_unitar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPret_unitar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cstoc_faptic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cstoc_faptic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCants.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCants.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccante.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.ccante.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cresponsabil.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cresponsabil.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdatapif.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdatapif.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdnf.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdnf.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cMeserie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cMeserie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFormatia.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFormatia.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataang.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataang.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDatalic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDatalic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdns_luni.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cdns_luni.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUzura_faptic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cUzura_faptic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDif_dns_luni.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDif_dns_luni.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cData_expirare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cData_expirare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cGrupa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cGrupa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSubgrupa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cSubgrupa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPretd.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPretd.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPretcTVA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPretcTVA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodbare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cCodbare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPart_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cPart_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrord_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cNrord_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cProc_TVAv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cProc_TVAv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cProc_TVAv._combobox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocFaptic5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocScriptic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cStocScriptic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFirstUpdatedAt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFirstUpdatedAt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cIdArticol.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cIdArticol.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValidat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cValidat.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOraValidat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOraValidat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOra.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.cDataOra.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_stergeX" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_codbare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblAtentie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copiaza1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_reface1" UniqueID="" Timestamp="" />

	#INCLUDE "..\roa.h"
	*<DefinedPropArrayMethod>
		*m: citeste_doc
		*m: corder_assign
		*m: do_adauga_inform
		*m: do_cautacodbare
		*m: do_cauta_articol
		*m: do_cauta_codbare
		*m: do_cauta_furnizor
		*m: do_cauta_gestiune
		*m: updateserver
		*m: validcantitate		&& Valideaza cantitatea - sa nu fie prea mare - daca se citeste codul de bare pe coloanele stoc faptic
		*m: validpret		&& valideaza pretul - sa nu fie pret prea mare - citire cod de bare pe coloana pret
		*p: casc
		*p: cdescriere
		*p: cfiltru
		*p: cfiltruoriginal
		*p: cid_gestiuni		&& lista gestiunilor pe care se face inventar
		*p: cnumecursor
		*p: cnume_gest
		*p: corder
		*p: cschema
		*p: cselect
		*p: dataang
		*p: datalic
		*p: ddatainventar		&& data incepere inventar
		*p: explicatie
		*p: formatie
		*p: grupegest
		*p: lcorectie
		*p: linregistrarevalidata
		*p: lmodparam
		*p: lobinv
		*p: lvalidat
		*p: meserie
		*p: ncod
		*p: ncstoc_faptic
		*p: nevalidat
		*p: nidcinventar
		*p: nidfact
		*p: nid_gestiune
		*p: nid_gestiuni
		*p: nmaxcantitate		&& Cantitatea maxima care poate fi introdusa pe celulele stoc faptic - pentru evitarea erorilor de tastare / cod de bare in stoc faptic
		*p: nmaxpret		&& Cantitatea maxima care poate fi introdusa pe celulele pret - pentru evitarea erorilor de tastare / cod de bare in pret
		*p: noptiuneinventar		&& 1 = stoc, 2 = fara articole, 3 = articolele intrate in ultimele x luni
		*p: npretvtva
		*p: nproc_tvav
		*p: nstoc_faptic
		*p: nstoc_fapticv
		*p: nvalue
		*p: ocursor
		*p: respons
		*p: stadiu
		*p: validat
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		casc = ASC
		cdescriere = 
		cfiltru = .F.
		cfiltruoriginal = .F.
		cgridsortlist = 
		cid_gestiuni = 
		cnumecursor = crs_inventar
		cnume_gest = 
		corder = denumire
		cschema = .F.
		cselect = .F.
		dataang = .F.
		datalic = .F.
		ddatainventar = {}
		DoCreate = .T.
		explicatie = .F.
		formatie = .F.
		grupegest = .T.
		Height = 502
		lcorectie = .F.
		linregistrarevalidata = .F.
		lmodparam = .F.
		lobinv = .F.
		lvalidat = .F.
		meserie = .F.
		Name = "inventar_stoc_magazin"
		ncod = 0
		ncstoc_faptic = .F.
		nevalidat = .T.
		nidcinventar = 0
		nidfact = 0
		nid_gestiune = 0
		nid_gestiuni = 
		nmaxcantitate = 1000000
		nmaxpret = 1000000
		noptiuneinventar = 1
		npretvtva = 0
		nproc_tvav = 1.19
		nstoc_faptic = .F.
		nstoc_fapticv = .F.
		nvalue = .F.
		ocursor = .F.
		respons = .F.
		stadiu = .F.
		validat = .F.
		Width = 793
		WindowState = 2
		_memberdata = <VFPData>
			<memberdata name="noptiuneinventar" type="property" display="nOptiuneInventar"/>
			<memberdata name="ddatainventar" type="property" display="dDataInventar"/>
			<memberdata name="nmaxcantitate" type="property" display="nMaxCantitate"/>
			<memberdata name="nmaxpret" type="property" display="nMaxPret"/>
			<memberdata name="validcantitate" type="method" display="ValidCantitate"/>
			<memberdata name="validpret" type="method" display="ValidPret"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 797
		_shape1.ZOrderSet = 1
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 480
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Visible = .T.
		_shape2.Width = 313
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Nota de inventariere"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 4
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 762
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
		BUT_RENUNT1.Anchor = 8
		BUT_RENUNT1.Left = 733
		BUT_RENUNT1.Name = "BUT_RENUNT1"
		BUT_RENUNT1.TabIndex = 6
		BUT_RENUNT1.Top = 1
		BUT_RENUNT1.ZOrderSet = 6
	*</PropValue>

	ADD OBJECT '_shape3' AS _shape WITH ;
		Height = 82, ;
		Left = 3, ;
		Name = "_shape3", ;
		Top = 71, ;
		Width = 367, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'But_copiaza1' AS but_copiaza WITH ;
		Anchor = 8, ;
		caction = do_copie, ;
		Left = 610, ;
		Name = "But_copiaza1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 703, ;
		Name = "But_excel1", ;
		TabIndex = 9, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Exportare in Excel", ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'but_reface1' AS but_reface WITH ;
		Anchor = 8, ;
		caction = do_reface, ;
		Left = 575, ;
		Name = "but_reface1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset_criterii1' AS but_reset_criterii WITH ;
		Anchor = 9, ;
		Left = 479, ;
		Name = "But_reset_criterii1", ;
		TabIndex = 15, ;
		Top = 1, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Left = 509, ;
		Name = "But_start_criterii1", ;
		TabIndex = 14, ;
		Top = 1, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_stergeX' AS but_sterge WITH ;
		Anchor = 8, ;
		caction = do_sterge, ;
		Left = 672, ;
		Name = "But_stergeX", ;
		TabIndex = 13, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_codbare' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_codbare", ;
		TabIndex = 1, ;
		Top = 117, ;
		Width = 313, ;
		ZOrderSet = 18, ;
		Text_simplu1.ControlSource = "oinv.codbare", ;
		Text_simplu1.Left = 125, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Cod bare", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 3, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 10, ;
		TabStop = .F., ;
		Top = 36, ;
		Width = 216, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.Alignment = 1, ;
		TEXT_SIMPLU1.ControlSource = "thisform.ncStoc_faptic", ;
		TEXT_SIMPLU1.FontName = "Arial Narrow", ;
		TEXT_SIMPLU1.FontSize = 10, ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPcant)), ;
		TEXT_SIMPLU1.Left = 123, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 1, ;
		TEXT_SIMPLU1.Width = 90, ;
		LB_SIMPLU1.Caption = "Stoc faptic:", ;
		LB_SIMPLU1.FontName = "Arial Narrow", ;
		LB_SIMPLU1.FontSize = 10, ;
		LB_SIMPLU1.Left = 3, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.Top = 4
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 228, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 11, ;
		TabStop = .F., ;
		Top = 36, ;
		Width = 216, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.Alignment = 1, ;
		TEXT_SIMPLU1.ControlSource = "thisform.nStoc_faptic", ;
		TEXT_SIMPLU1.FontName = "Arial Narrow", ;
		TEXT_SIMPLU1.FontSize = 10, ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPa)), ;
		TEXT_SIMPLU1.Left = 121, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 0, ;
		TEXT_SIMPLU1.Width = 90, ;
		LB_SIMPLU1.Caption = "Valoare ach. stoc faptic:", ;
		LB_SIMPLU1.FontName = "Arial Narrow", ;
		LB_SIMPLU1.FontSize = 10, ;
		LB_SIMPLU1.Left = 2, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.Top = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		BorderWidth = 0, ;
		Height = 29, ;
		Left = 444, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 12, ;
		TabStop = .F., ;
		Top = 36, ;
		Width = 216, ;
		ZOrderSet = 11, ;
		TEXT_SIMPLU1.Alignment = 1, ;
		TEXT_SIMPLU1.ControlSource = "thisform.nStoc_fapticv", ;
		TEXT_SIMPLU1.FontName = "Arial Narrow", ;
		TEXT_SIMPLU1.FontSize = 10, ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPa)), ;
		TEXT_SIMPLU1.Left = 121, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 0, ;
		TEXT_SIMPLU1.Width = 90, ;
		LB_SIMPLU1.Caption = "Valoare vanz. stoc faptic:", ;
		LB_SIMPLU1.FontName = "Arial Narrow", ;
		LB_SIMPLU1.FontSize = 10, ;
		LB_SIMPLU1.Left = 2, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.Top = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_gestiune' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(oinv.id_gestiune,0)), ;
		cprocedura = thisform.do_cauta_gestiune, ;
		cvar_afisata = thisform.cNume_gest, ;
		Left = 12, ;
		Name = "Ct_clb_gestiune", ;
		TabIndex = 3, ;
		Top = 84, ;
		ZOrderSet = 19, ;
		shape_cautare.Name = "shape_cautare", ;
		img_cautare.Name = "img_cautare", ;
		lb_cautare.Caption = "Gestiune", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Name = "tx_cautare"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		Anchor = 15, ;
		ColumnCount = 46, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		GridLineColor = 128,128,128, ;
		HeaderHeight = 34, ;
		Height = 334, ;
		HighlightBackColor = 50,97,173, ;
		HighlightStyle = 1, ;
		Left = 3, ;
		Name = "Grid1", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "crs_inventar", ;
		SelectedItemBackColor = 0,255,255, ;
		SelectedItemForeColor = 0,0,0, ;
		TabIndex = 2, ;
		Top = 156, ;
		Width = 783, ;
		ZOrderSet = 8, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "recno()", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cNrcrt", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 24, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "codmat", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "cCodmat", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 68, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "denumire", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "cDenumire", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 123, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "um", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "cUM", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 28, ;
		Column5.BackColor = 234,249,255, ;
		Column5.ColumnOrder = 19, ;
		Column5.ControlSource = "cgest", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cCgest", ;
		Column5.ReadOnly = .T., ;
		Column5.ToolTipText = "Click pentru schimbarea gestiunii", ;
		Column5.Width = 100, ;
		Column6.BackColor = 234,249,255, ;
		Column6.ColumnOrder = 16, ;
		Column6.ControlSource = "cont", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "ccont", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 38, ;
		Column7.BackColor = 234,249,255, ;
		Column7.ColumnOrder = 17, ;
		Column7.ControlSource = "acont", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "cAcont", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 37, ;
		Column8.BackColor = 234,249,255, ;
		Column8.ColumnOrder = 15, ;
		Column8.ControlSource = "pret", ;
		Column8.FontName = "Arial Narrow", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = (get_mask(9,gnPpret)), ;
		Column8.Name = "cPret_unitar", ;
		Column8.ReadOnly = .F., ;
		Column8.Width = 70, ;
		Column9.BackColor = 234,249,255, ;
		Column9.ColumnOrder = 9, ;
		Column9.ControlSource = "stoc_faptic", ;
		Column9.FontBold = .T., ;
		Column9.FontName = "Arial Narrow", ;
		Column9.FontSize = 10, ;
		Column9.ForeColor = 0,64,128, ;
		Column9.Format = "RK", ;
		Column9.InputMask = (get_mask(9,gnPcant)), ;
		Column9.Name = "cstoc_faptic", ;
		Column9.ReadOnly = .F., ;
		Column9.Width = 83, ;
		Column10.ColumnOrder = 22, ;
		Column10.ControlSource = "cants", ;
		Column10.FontName = "Arial Narrow", ;
		Column10.InputMask = (get_mask(9,gnPcant)), ;
		Column10.Name = "cCants", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 49, ;
		Column11.ColumnOrder = 24, ;
		Column11.ControlSource = "cant", ;
		Column11.FontName = "Arial Narrow", ;
		Column11.InputMask = (get_mask(9,gnPcant)), ;
		Column11.Name = "ccant", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 39, ;
		Column12.ColumnOrder = 25, ;
		Column12.ControlSource = "cante", ;
		Column12.FontName = "Arial Narrow", ;
		Column12.InputMask = (get_mask(9,gnPcant)), ;
		Column12.Name = "ccante", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 36, ;
		Column13.ColumnOrder = 26, ;
		Column13.ControlSource = "utilizator", ;
		Column13.FontName = "Arial Narrow", ;
		Column13.Name = "cUtilizator", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 99, ;
		Column14.ColumnOrder = 27, ;
		Column14.ControlSource = "responsabil", ;
		Column14.FontName = "Arial Narrow", ;
		Column14.Name = "cresponsabil", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 148, ;
		Column15.ColumnOrder = 23, ;
		Column15.ControlSource = "TTOD(datapif)", ;
		Column15.FontName = "Arial Narrow", ;
		Column15.Name = "cdatapif", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 49, ;
		Column16.ColumnOrder = 32, ;
		Column16.ControlSource = "dnf", ;
		Column16.FontName = "Arial Narrow", ;
		Column16.Name = "cdnf", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 70, ;
		Column17.ColumnOrder = 28, ;
		Column17.ControlSource = "meserie", ;
		Column17.FontName = "Arial Narrow", ;
		Column17.Name = "cMeserie", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 74, ;
		Column18.ColumnOrder = 29, ;
		Column18.ControlSource = "formatia", ;
		Column18.FontName = "Arial Narrow", ;
		Column18.Name = "cFormatia", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 68, ;
		Column19.ColumnOrder = 30, ;
		Column19.ControlSource = "ttod(dataang)", ;
		Column19.FontName = "Arial Narrow", ;
		Column19.Name = "cDataang", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 50, ;
		Column20.ColumnOrder = 31, ;
		Column20.ControlSource = "ttod(datalic)", ;
		Column20.FontName = "Arial Narrow", ;
		Column20.Name = "cDatalic", ;
		Column20.ReadOnly = .T., ;
		Column20.Width = 44, ;
		Column21.ColumnOrder = 33, ;
		Column21.ControlSource = "iif(dnf<>0, round((dnf-dns_luni)/dnf*100,0),0)", ;
		Column21.FontName = "Arial Narrow", ;
		Column21.InputMask = "999999", ;
		Column21.Name = "cdns_luni", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 57, ;
		Column22.BackColor = 234,249,255, ;
		Column22.ColumnOrder = 34, ;
		Column22.ControlSource = "uzura_faptic", ;
		Column22.FontName = "Arial Narrow", ;
		Column22.FontSize = 10, ;
		Column22.InputMask = "999999", ;
		Column22.Name = "cUzura_faptic", ;
		Column22.ReadOnly = .F., ;
		Column22.Width = 53, ;
		Column23.ColumnOrder = 35, ;
		Column23.ControlSource = "iif(dnf<>0, ROUND((dnf-dns_luni)/dnf*100, 0),0) - uzura_faptic", ;
		Column23.FontName = "Arial Narrow", ;
		Column23.InputMask = "999999", ;
		Column23.Name = "cDif_dns_luni", ;
		Column23.ReadOnly = .T., ;
		Column23.Width = 43, ;
		Column24.BackColor = 234,249,255, ;
		Column24.ColumnOrder = 36, ;
		Column24.ControlSource = "data_expirare", ;
		Column24.FontName = "Arial Narrow", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cData_expirare", ;
		Column24.ReadOnly = .F., ;
		Column24.Width = 53, ;
		Column25.BackColor = 234,249,255, ;
		Column25.ColumnOrder = 18, ;
		Column25.ControlSource = "serie", ;
		Column25.FontName = "Arial Narrow", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cSerie", ;
		Column25.ReadOnly = .F., ;
		Column26.ColumnOrder = 40, ;
		Column26.ControlSource = "Grupa", ;
		Column26.FontName = "Arial Narrow", ;
		Column26.Name = "cGrupa", ;
		Column26.ReadOnly = .T., ;
		Column27.ColumnOrder = 41, ;
		Column27.ControlSource = "Subgrupa", ;
		Column27.FontName = "Arial Narrow", ;
		Column27.Name = "cSubgrupa", ;
		Column27.ReadOnly = .T., ;
		Column28.ColumnOrder = 20, ;
		Column28.ControlSource = "pretd", ;
		Column28.FontName = "Arial Narrow", ;
		Column28.Format = "R", ;
		Column28.InputMask = (get_mask(16,gnPPretVAL)), ;
		Column28.Name = "cPretd", ;
		Column28.ReadOnly = .T., ;
		Column28.Width = 54, ;
		Column29.ColumnOrder = 21, ;
		Column29.ControlSource = "Valuta", ;
		Column29.FontName = "Arial Narrow", ;
		Column29.Name = "cValuta", ;
		Column29.ReadOnly = .T., ;
		Column29.Width = 46, ;
		Column30.BackColor = 234,249,255, ;
		Column30.ColumnOrder = 7, ;
		Column30.ControlSource = "pretctvav", ;
		Column30.FontBold = .T., ;
		Column30.FontName = "Arial Narrow", ;
		Column30.FontSize = 10, ;
		Column30.Format = "RK", ;
		Column30.InputMask = (get_mask(12,gnPPretV)), ;
		Column30.Name = "cPretcTVA", ;
		Column30.ReadOnly = .F., ;
		Column31.ColumnOrder = 2, ;
		Column31.ControlSource = "codbare", ;
		Column31.FontName = "Arial Narrow", ;
		Column31.Name = "cCodbare", ;
		Column31.ReadOnly = .T., ;
		Column31.Width = 60, ;
		Column32.ColumnOrder = 38, ;
		Column32.ControlSource = "part_rez", ;
		Column32.FontName = "Arial Narrow", ;
		Column32.Name = "cPart_rez", ;
		Column32.ReadOnly = .T., ;
		Column33.ColumnOrder = 39, ;
		Column33.ControlSource = "nrord_rez", ;
		Column33.FontName = "Arial Narrow", ;
		Column33.Name = "cNrord_rez", ;
		Column33.ReadOnly = .T., ;
		Column34.BackColor = 234,249,255, ;
		Column34.ColumnOrder = 6, ;
		Column34.ControlSource = "crs_inventar.proc_tvav", ;
		Column34.CurrentControl = "_combobox1", ;
		Column34.FontName = "Arial Narrow", ;
		Column34.FontSize = 10, ;
		Column34.Format = "RK", ;
		Column34.InputMask = "9.99", ;
		Column34.Name = "cProc_TVAv", ;
		Column34.ReadOnly = .F., ;
		Column34.Width = 43, ;
		Column35.BackColor = 234,249,255, ;
		Column35.ColumnOrder = 10, ;
		Column35.ControlSource = "stoc_faptic1", ;
		Column35.FontName = "Arial Narrow", ;
		Column35.FontSize = 10, ;
		Column35.ForeColor = 0,64,128, ;
		Column35.Format = "RK", ;
		Column35.InputMask = (get_mask(9,gnPcant)), ;
		Column35.Name = "cStocFaptic1", ;
		Column35.ReadOnly = .F., ;
		Column36.BackColor = 234,249,255, ;
		Column36.ColumnOrder = 11, ;
		Column36.ControlSource = "stoc_faptic2", ;
		Column36.FontName = "Arial Narrow", ;
		Column36.FontSize = 10, ;
		Column36.Format = "RK", ;
		Column36.InputMask = (get_mask(9,gnPcant)), ;
		Column36.Name = "cStocFaptic2", ;
		Column36.ReadOnly = .F., ;
		Column37.BackColor = 234,249,255, ;
		Column37.ColumnOrder = 12, ;
		Column37.ControlSource = "stoc_faptic3", ;
		Column37.FontName = "Arial Narrow", ;
		Column37.FontSize = 10, ;
		Column37.Format = "RK", ;
		Column37.InputMask = (get_mask(9,gnPcant)), ;
		Column37.Name = "cStocFaptic3", ;
		Column37.ReadOnly = .F., ;
		Column38.BackColor = 234,249,255, ;
		Column38.ColumnOrder = 13, ;
		Column38.ControlSource = "stoc_faptic4", ;
		Column38.FontName = "Arial Narrow", ;
		Column38.FontSize = 10, ;
		Column38.Format = "RK", ;
		Column38.InputMask = (get_mask(9,gnPcant)), ;
		Column38.Name = "cStocFaptic4", ;
		Column38.ReadOnly = .F., ;
		Column39.BackColor = 234,249,255, ;
		Column39.ColumnOrder = 14, ;
		Column39.ControlSource = "stoc_faptic5", ;
		Column39.FontName = "Arial Narrow", ;
		Column39.FontSize = 10, ;
		Column39.Format = "RK", ;
		Column39.InputMask = (get_mask(9,gnPcant)), ;
		Column39.Name = "cStocFaptic5", ;
		Column39.ReadOnly = .F., ;
		Column40.ColumnOrder = 8, ;
		Column40.ControlSource = "stoc_scriptic", ;
		Column40.FontName = "Arial Narrow", ;
		Column40.InputMask = (get_mask(9,gnPcant)), ;
		Column40.Name = "cStocScriptic", ;
		Column40.ReadOnly = .T., ;
		Column41.BackColor = 234,249,255, ;
		Column41.ColumnOrder = 42, ;
		Column41.ControlSource = "first_updated_at", ;
		Column41.FontName = "Arial Narrow", ;
		Column41.Name = "cFirstUpdatedAt", ;
		Column41.ReadOnly = .F., ;
		Column41.Width = 161, ;
		Column42.BackColor = 234,249,255, ;
		Column42.ColumnOrder = 37, ;
		Column42.ControlSource = "furnizor", ;
		Column42.FontName = "Arial Narrow", ;
		Column42.Name = "cFurnizor", ;
		Column42.ReadOnly = .T., ;
		Column42.Width = 180, ;
		Column43.ControlSource = "id_articol", ;
		Column43.FontName = "Arial Narrow", ;
		Column43.Name = "cIdArticol", ;
		Column43.ReadOnly = .T., ;
		Column44.ControlSource = "validat", ;
		Column44.CurrentControl = "Check1", ;
		Column44.FontName = "Arial Narrow", ;
		Column44.Name = "cValidat", ;
		Column44.ReadOnly = .T., ;
		Column44.Sparse = .F., ;
		Column44.Width = 32, ;
		Column45.ControlSource = "dataora_validat", ;
		Column45.FontName = "Arial Narrow", ;
		Column45.Name = "cDataOraValidat", ;
		Column45.ReadOnly = .T., ;
		Column45.Width = 103, ;
		Column46.ControlSource = "dataora", ;
		Column46.FontName = "Arial Narrow", ;
		Column46.Name = "cDataOra", ;
		Column46.ReadOnly = .T., ;
		Column46.Width = 101
		*< END OBJECT: BaseClass="grid" />

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

	ADD OBJECT 'Grid1.cAcont.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

	ADD OBJECT 'Grid1.cCants.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc Precedent", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.ccont.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cData_expirare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data expirare", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cData_expirare.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cDataang.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data angajarii", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cDatalic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data plecarii", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cDataOra.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora adaugat", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cDataOraValidat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Dataora validat", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cdatapif.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data PIF", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'Grid1.cDif_dns_luni.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Diferenta (%)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cdnf.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Durata functionare (luni)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cdns_luni.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Uzura scriptica (%)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cFirstUpdatedAt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inventariat la", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cFirstUpdatedAt.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'Grid1.cFurnizor.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cNrcrt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. Crt.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cNrord_rez.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lucrare rez.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cPart_rez.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Part. rez.", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cPret_unitar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret Achizitie", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cPret_unitar.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "k", ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cPretcTVA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret vanzare cu TVA", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cPretcTVA.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "k", ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cPretd.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'Grid1.cProc_TVAv._combobox1' AS _combobox WITH ;
		BorderStyle = 0, ;
		BoundTo = .T., ;
		FontName = "Arial Narrow", ;
		Left = 29, ;
		Name = "_combobox1", ;
		RowSource = "cote_tva.proc_tva", ;
		RowSourceType = 2, ;
		Top = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="combobox" />

	ADD OBJECT 'Grid1.cProc_TVAv.Header1' AS header WITH ;
		Caption = "Cota Tva", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cProc_TVAv.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Format = "RK", ;
		InputMask = "9.99", ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'Grid1.cSerie.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cstoc_faptic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc faptic", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cstoc_faptic.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontBold = .T., ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,64,128, ;
		Format = "", ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cStocFaptic1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc faptic 1", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cStocFaptic1.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,64,128, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cStocFaptic2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc faptic 2", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cStocFaptic2.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cStocFaptic3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc faptic 3", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cStocFaptic3.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cStocFaptic4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc faptic 4", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cStocFaptic4.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cStocFaptic5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc faptic 5", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cStocFaptic5.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cStocScriptic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Stoc scriptic", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

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

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

	ADD OBJECT 'Grid1.cUzura_faptic.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Uzura faptica (%)", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Grid1.cUzura_faptic.Text1' AS textbox WITH ;
		BackColor = 234,249,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .F., ;
		SelectedBackColor = 0,255,255, ;
		SelectedForeColor = 0,0,0
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Grid1.cValidat.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Height = 17, ;
		Left = 20, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 71, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

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

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

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

	ADD OBJECT 'lblAtentie' AS lb_simplu WITH ;
		Caption = "", ;
		ForeColor = 255,0,0, ;
		Left = 377, ;
		Name = "lblAtentie", ;
		TabIndex = 16, ;
		Top = 128
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		
		lcFiltru=pcFiltru
		*!*	IF EMPTY(lcFiltru)
		*!*		lcFiltru=this.ocursor.ca_baza1.cfiltruOriginal
		*!*	ELSE 
		*!*		lcFiltru = lcFiltru + [ and ] + this.ocursor.ca_baza1.cfiltruOriginal
		*!*	ENDIF
		IF EMPTY(lcFiltru)
			lcFiltru=this.ocursor.ca_baza1.cfiltru
		ENDIF 
		
		lcOrder = this.corder + [ ] + this.casc
		save_grid(This.grid1)
		this.ocursor.ca_baza1.lAfisare = .F.
		this.ocursor.ca_baza1.cfiltru = lcfiltru
		this.ocursor.ca_baza1.corder = lcOrder 
		this.ocursor.ca_baza1.afisare()
		restore_grid(This.grid1)
		
		thisform.do_executa 
		
	ENDPROC

	PROCEDURE citeste_doc
		Private pcReturnValue
		pcReturnValue = []
		If This.nOptiuneInventar = 1
			lcSql = [pack_inventar.citeste_documente_atasate(] + Alltrim(Str(Thisform.nidcinventar)) + [)]
			lnSucces = goExecutor.oFunction2Value(lcSql, @pcReturnValue)
			If lnSucces < 0 Then
				amessagebox(goExecutor.cEroare,64,"Eroare")
			Endif
		Endif
		Return pcReturnValue
	ENDPROC

	PROCEDURE corder_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		
		IF THIS.corder = m.vNewVal
			lcASC = IIF(this.casc = 'ASC','DESC','ASC')
		ELSE
			lcASC = 'ASC'
		ENDIF 
		THIS.cOrder = m.vNewVal
		this.cAsc = lcAsc
		this.actualizeaza_grid1()
		
	ENDPROC

	PROCEDURE do_adauga
		*!*	lcSql = 'select * from ' + gcs + '.vnom_articole order by denumire,codmat'
		*!*	lnSucces = goExecutor.oExecute(lcSql,'crsArticole')
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX(goExecutor.ceroare,0)
		*!*		RETURN
		*!*	ENDIF
		
		Local oAdd As 'new_inventar_magazin'
		Local lcSql, lccursor, lcsel, lnsucces, lcIdRulAux
		*:Global gnButon, oinv, oinv_orig
		PRIVATE pndns_luni, pnid_articol, pnid_gestiune, pnid_responsabil, pnidvaluta, pnpret, pnpretv, pcIdSucursala, pcSerie, pcacont, pccont, pddatapif, pnIdRulAux
		PRIVATE pnpretvaluta, pnproc_tvav, pnstoc_faptic, pntvav, tValue, tcCol
		If Thisform.lvalidat And !Thisform.lCorectie
			Return
		Endif
		*!* v 2.0.22
		*!* pentru cresterea vitezei introducerii de articole noi - copii gestiunea, cont, acont, proc_tvav
		lcsel = [select 1 + round(cota_tva/100, 2) as cota_tva,denumire from vjtva_coloane ] + ;
			[where jv=1 and afisat = 1 and id_jtva_coloana > 0 order by ordine]
		lccursor = [crs_cote_tva_inventar]
		If !goExecutor.oExecuta(lcsel, lccursor)
			Return
		Endif
		
		
		*!*	modificare	v 2.2.6 : dintre gestiunile pe care are dreptul utilizatorul arat doar gestiunile alese la inceperea inventarului
		*!*	lcSql = 'select * from vnom_gestiuni where inactiv = 0 order by nume_gestiune,cgest'
		lcSql = [select distinct c.nume_gestiune,c.cgest,b.id_gestiune,c.nr_pag,c.cont,c.acont ] + ;
			[from gest_coresp_util_grupe a ] + ;
			[left join gest_coresp_grupe_gestiuni b on a.id_grupe=b.id_grupe ] + ;
			[left join nom_gestiuni c on b.id_gestiune=c.id_gestiune ] + ;
			[where a.id_util = ] + Alltrim(Str(gnIdUtil)) + Strtran(gcCondSucursala, [id_sucursala], [c.id_sucursala]) + ;
			[ and c.inactiv = 0 ] + ;
			Iif(!Empty(Nvl(Thisform.cId_gestiuni, '')), [and b.id_gestiune in (] + Thisform.cId_gestiuni + [)], []) + ;
			[ order by c.nume_gestiune,c.cgest]
		*!*	modificare	v 2.2.6 	^
		If !goExecutor.oExecuta(lcSql, 'crsGestiuni')
			Return
		Endif
		
		lcSql = 'select * from vnom_valute where inactiv = 0 order by moneda_nationala desc, nume_val'
		If !goExecutor.oExecuta(lcSql, 'crsValuteTemp')
			Return
		Endif
		
		If This.lobinv
			lcSql = 'select id_responsabil, nume from vnom_responsabili where inactiv = 0 order by nume'
			lnsucces = goExecutor.oExecute(lcSql, 'crsResponsabili2')
			If lnsucces < 0
				AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
				Return
			Endif
			Create Cursor crsResponsabili (id_responsabil N(20) Null, nume C(100))
			Insert Into crsResponsabili (id_responsabil, nume) Values (Null, '')
			Insert Into crsResponsabili Select id_responsabil, nume From crsResponsabili2
			Select crsResponsabili
			Go Top
			Use In crsResponsabili2
		Endif
		Local lcCursorInventar
		lcCursorInventar = Thisform.cnumecursor
		
		
		Select (Thisform.cnumecursor)
		Scatter Name oinv_orig
		Scatter Name oinv Blank
		oinv.DATAPIF = Date()
		oinv.id_gestiune = oinv_orig.id_gestiune
		oinv.nume_gestiune = oinv_orig.nume_gestiune
		oinv.proc_tvav = oinv_orig.proc_tvav
		oinv.id_valuta = oinv_orig.id_valuta
		oinv.valuta = oinv_orig.valuta
		oinv.Cont = oinv_orig.Cont
		oinv.acont = oinv_orig.acont
		oinv.pretv = 0
		oinv.tvav = 0
		oinv.id_furnizor = oinv_orig.id_furnizor
		oinv.furnizor = oinv_orig.furnizor
		oinv.id_rul_aux = oinv_orig.id_rul_aux
		
		Select crsGestiuni
		Locate For id_gestiune = oinv.id_gestiune
		If !Found()
			Go Top
			oinv.id_gestiune = crsGestiuni.id_gestiune
			oinv.nume_gestiune = crsGestiuni.nume_gestiune
		Endif
		
		Select crsValuteTemp
		Locate For id_valuta = oinv.id_valuta
		If !Found()
			Go Top
			oinv.id_valuta = crsValuteTemp.id_valuta
			oinv.valuta = crsValuteTemp.nume_val
		Endif
		
		Select crs_cote_tva_inventar
		Locate For cota_tva = oinv.proc_tvav
		If !Found()
			Go Top
			oinv.proc_tvav = cota_tva
		Endif
		*!* v 2.0.22 ^
		
		oAdd = Createobject('new_inventar_magazin')
		*!*	oAdd.lobinv = This.lobinv
		oAdd.obj = oinv
		oAdd.Show()
		
		Private pnIdInventar
		pnIdInventar = 0
		
		oinv.dns_luni = oinv.dnf
		
		If gnButon = 1
			pnpretvaluta = oinv.pretd
			pnidvaluta = oinv.id_valuta
		
			pnid_articol = oinv.id_articol
			pnid_gestiune = oinv.id_gestiune
			pnid_responsabil = oinv.id_responsabil
			pccont = Left(Alltrim(oinv.Cont), 4)
			pcacont = Left(Alltrim(Nvl(oinv.acont, '')), 4)
			pnpret = Nvl(oinv.Pret, 0)
			pnpretv = Nvl(oinv.pretv, 0)
			pntvav = Nvl(oinv.tvav, 0)
			pnproc_tvav = Nvl(oinv.proc_tvav, 0)
			pddatapif = oinv.DATAPIF
			pndns_luni = Nvl(oinv.dns_luni, 0)
			pcSerie = Nvl(oinv.serie, '')
			pcIdSucursala = Iif(Nvl(gnIdSucursala, 0) = 0, 'NULL', Alltrim(Str(gnIdSucursala)))
			pnstoc_faptic = Nvl(oinv.stoc_faptic, 0)
			pnIdRulAux = NVL(oinv.id_rul_aux, 0)
			lcIdRulAux = 'NULL'
			
			IF !EMPTY(NVL(oinv.id_furnizor,0))
				lcSql = [begin pack_contafin.GetRulajAuxiliarFurnizor(] + Transform(oinv.id_furnizor) + [, ?@pnIdRulAux); end;]
				lnsucces = goExecutor.oExecute(m.lcSql)
				If m.lnsucces < 0
					AMESSAGEBOX(goExecutor.cEroare, 0 + 48, _Screen.Caption)
					Return m.lnsucces
				ELSE
					lcIdRulAux = ALLTRIM(STR(m.pnIdRulAux))	
				ENDIF
			ENDIF 
		
			lcSql = [insert into gest_inventar (an,luna,id_articol,id_gestiune,cont,acont,pret,pretv,tvav,proc_tvav,data_referinta, ] + ;
				[id_responsabil,datapif,dns_luni,id_rul_aux,serie,pretd,id_Valuta,id_sucursala,id_c_inventar,id_part_rez,id_lucrare_rez,stoc_faptic, stoc_faptic1, id_util ) ] + ;
				[values(] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,] + Alltrim(Str(pnid_articol)) + [,] + ;
				Alltrim(Str(pnid_gestiune)) + [,'] + pccont + [','] + pcacont + [',] + Alltrim(Str(pnpret, 20, 4)) + [,] + Alltrim(Str(pnpretv, 20, 4)) + [,] + ;
				Alltrim(Str(pntvav, 10, 4)) + [,] + Alltrim(Str(pnproc_tvav, 10, 4)) + [,TO_DATE('] + Iif(!Empty(Nvl(pdDataRef, {})), Dtos(pdDataRef), '') + [','YYYYMMDD'),] + ;
				Alltrim(Str(pnid_responsabil)) + [, TO_DATE('] + Iif(!Empty(Nvl(pddatapif, {})), Dtos(pddatapif), '') + [','YYYYMMDD'),] + Alltrim(Str(pndns_luni)) + [,] + m.lcIdRulAux + [,'] + ;
				Alltrim(pcSerie) + [',] + Alltrim(Str(pnpretvaluta, 20, 4)) + [,] + Alltrim(Str(pnidvaluta)) + [,] + pcIdSucursala + [, ] + ;
				Alltrim(Str(This.nidcinventar)) + ',' + Alltrim(Str(oinv.id_part_rez)) + [,] + Alltrim(Str(oinv.id_lucrare_rez)) + [,] + Alltrim(Str(pnstoc_faptic, 18, 3)) + ;
				[,] + Alltrim(Str(pnstoc_faptic, 18, 3)) + [,] + Alltrim(Str(gnIdUtil)) + [) ] + ;
				[ RETURNING ID_INVENTAR INTO ?@pnIdInventar]
			lnsucces = goExecutor.oExecute(lcSql)
			If lnsucces < 0
				AMESSAGEBOX(goExecutor.cEroare, 16, "Eroare")
				gnButon = 2
			Else
		
				lcSql = 'select * from vgest_inventar where id_inventar = ?pnIdInventar'
				lnsucces = goExecutor.oExecute(lcSql, "crsInventarNou")
				If lnsucces < 0
					AMESSAGEBOX(goExecutor.cEroare, 16, "Eroare")
					This.actualizeaza_grid1()
				Else
					Select (lcCursorInventar)
					Append From Dbf('crsInventarNou')
					Use In crsInventarNou
				Endif
		
			Endif
		Endif
		
		If Used('crsArticole')
			Use In crsArticole
		Endif
		If Used('crsGestiuni')
			Use In crsGestiuni
		Endif
		If Used('crsResponsabili')
			Use In crsResponsabili
		Endif
		Use In (Select('crs_cote_tva_inventar'))
		Use In (Select('crsValuteTemp'))
		Thisform.do_executa()
		This.grid1.SetFocus()
		
	ENDPROC

	PROCEDURE do_adauga_inform
		*!* 04.05.2010
		*!* marius.mutu
		*!* ultimul pret, tva de achizitie dupa data iesirii din stoc
		
		Private pnIdInventar
		pnIdInventar = 0
		Local lcCursorInventar
		lcCursorInventar = Thisform.cnumecursor
		oinv.dns_luni = oinv.dnf
		
		Local pnpretvaluta,pnidvaluta,pnid_articol ,pnid_gestiune ,pnid_responsabil ,pccont ,pcacont ,pnpretv ,pntvav ,pnproc_tvav ,pddatapif ,pndns_luni ,pcSerie ,pcIdSucursala ,pnstoc_faptic
		LOCAL pnPret, pnTva
		pnPret = 0
		pnTva = 0
		
		*!* 04.05.2010
		*!*	lcSql = [select a.* from  (select a.dataora,a.pret,a.tva, a.tvav,a.pretv,a.PRETV+a.TVAV as pretvtva ]+;
		*!*		[ from rul a where a.ID_ARTICOL = ]+Alltrim(Str(oinv.id_articol)) + [ and a.sters = 0 and ((a.cant<>0  and a.id_tip_rulaj = 0) or (a.cante<0 and a.id_tip_rulaj = 1) )]+;
		*!*		[ and an*12+luna between ]+ Alltrim(Str(gnAn*12+gnluna-1))+[ and ]+ Alltrim(Str(gnAn*12+gnluna)) +;
		*!*		[ order by a.an desc, a.luna desc, a.dataora desc) a where rownum = 1]
		*!*	*!* v 2.0.18 ^
		
		TEXT TO lcSql NOSHOW 
		select max(pret) as pret, max(tva) as tva
		      from (select last_value(pret) OVER(ORDER BY dataout ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as pret,
		                   last_value(tva) OVER(ORDER BY dataout ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as tva
		              from stoc
		             where an in (<<gnAn>>, <<gnAn-1>>)
		               and id_articol = <<oinv.id_articol>>)
		ENDTEXT 
		*!* 04.05.2010 ^
		               
		lnSucces=goExecutor.oExecute(lcSql,'crsPretUltim')
		If lnSucces < 0
			amessagebox(goExecutor.cEroare,0+16,'Eroare')
		Else
			pnpret = Nvl(crsPretUltim.Pret,0)
			pntva = Nvl(crsPretUltim.tva,0)
		ENDIF
		
		Use In (SELECT('crsPretUltim'))
		
		pnpretvaluta=oinv.pretd
		pnidvaluta=oinv.id_valuta
		
		pnid_articol = oinv.id_articol
		pnid_gestiune = Thisform.nid_gestiune
		pnid_responsabil = oinv.id_responsabil
		pccont = Left(Alltrim(oinv.Cont),4)
		pcacont = Left(Alltrim(Nvl(oinv.acont,'')),4)
		
		pnpretv = Nvl(oinv.pretv,0)
		pntvav = Nvl(oinv.tvav,0)
		pnproc_tvav = Iif(Empty(Nvl(oinv.proc_tvav,0)),Thisform.nproc_tvav, Nvl(oinv.proc_tvav,0))
		
		If !Empty(Nvl(oinv.proc_tvav,0))
			Thisform.nproc_tvav = Nvl(oinv.proc_tvav,0)
		Endif
		
		pddatapif = oinv.DATAPIF
		pndns_luni = oinv.dns_luni
		pcSerie = oinv.serie
		pcIdSucursala = Iif(Nvl(gnIdSucursala,0) = 0, 'NULL', Alltrim(Str(gnIdSucursala)))
		pnstoc_faptic = Nvl(oinv.stoc_faptic,0)
		*!*	TEXT TO lcLog TEXTMERGE NOSHOW
		*!*	insert into gest_inventar (an,luna,id_articol,id_gestiune,cont,acont,pret,pretv,tvav,proc_tvav,data_referinta, ] + ;
		*!*		[id_responsabil,datapif,dns_luni,id_rul_aux,serie,pretd,id_Valuta,id_sucursala,id_c_inventar,id_part_rez,id_lucrare_rez,stoc_faptic,id_util ) ] +;
		*!*		[values(] + Alltrim(Str(<<gnAn>>)) + [,] + Alltrim(Str(<<gnluna>>)) + [,] + Alltrim(Str(<<pnid_articol>>)) + [,] + ;
		*!*		Alltrim(Str(<<pnid_gestiune>>)) + [,'] + <<pccont>> + [','] + <<pcacont>> + [',] + Alltrim(Str(<<pnpret>>,20,4)) + [,] + Alltrim(Str(<<pnpretv>>,20,4)) + [,] + ;
		*!*		Alltrim(Str(<<pntvav>>,10,4)) + [,] + Alltrim(Str(<<pnproc_tvav>>,10,4)) + [,TO_DATE('] + Iif(!Empty(Nvl(<<pdDataRef>>,{})),Dtos(<<pdDataRef>>), '') + [','YYYYMMDD'),] + ;
		*!*		Alltrim(Str(<<pnid_responsabil>>)) + [, TO_DATE('] + Iif(!Empty(Nvl(<<pddatapif>>,{})),Dtos(<<pddatapif>>), '') + [','YYYYMMDD'),] + Alltrim(Str(<<pndns_luni>>)) + [,0,'] + ;
		*!*		Alltrim(<<pcSerie>>) + [',] + Alltrim(Str(<<pnpretvaluta>>,20,4)) + [,] + Alltrim(Str(<<pnidvaluta>>)) + [,] + <<pcIdSucursala>> + [, ] + ;
		*!*		Alltrim(Str(<<This.nidcinventar>>)) + ',' + Alltrim(Str(<<oinv.id_part_rez>>)) + [,] + Alltrim(Str(<<oinv.id_lucrare_rez>>)) +[,]+Alltrim(Str(<<pnstoc_faptic>>,18,3))+;
		*!*		[,]+Alltrim(Str(<<gnIdUtil>>))+ [) ]
		*!*	ENDTEXT
		
		
		*!*	golog.log(lcLog,PROGRAM())
		
		lcSql = [insert into gest_inventar (an,luna,id_articol,id_gestiune,cont,acont,pret,tva,pretv,tvav,proc_tvav,data_referinta, ] + ;
			[id_responsabil,datapif,dns_luni,id_rul_aux,serie,pretd,id_Valuta,id_sucursala,id_c_inventar,id_part_rez,id_lucrare_rez,stoc_faptic,id_util ) ] +;
			[values(] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnluna)) + [,] + Alltrim(Str(pnid_articol)) + [,] + ;
			Alltrim(Str(pnid_gestiune)) + [,'] + pccont + [','] + pcacont + [',] + Alltrim(Str(pnPret,20,4)) + [,] + Alltrim(Str(pnTva,20,4)) + [,] + Alltrim(Str(pnpretv,20,4)) + [,] + ;
			Alltrim(Str(pntvav,20,4)) + [,] + Alltrim(Str(pnproc_tvav,10,4)) + [,TO_DATE('] + Iif(!Empty(Nvl(pdDataRef,{})),Dtos(pdDataRef), '') + [','YYYYMMDD'),] + ;
			Alltrim(Str(pnid_responsabil)) + [, TO_DATE('] + Iif(!Empty(Nvl(pddatapif,{})),Dtos(pddatapif), '') + [','YYYYMMDD'),] + Alltrim(Str(pndns_luni)) + [,0,'] + ;
			Alltrim(pcSerie) + [',] + Alltrim(Str(pnpretvaluta,20,4)) + [,] + Alltrim(Str(pnidvaluta)) + [,] + pcIdSucursala + [, ] + ;
			Alltrim(Str(This.nidcinventar)) + ',' + Alltrim(Str(oinv.id_part_rez)) + [,] + Alltrim(Str(oinv.id_lucrare_rez)) +[,]+Alltrim(Str(pnstoc_faptic,18,3))+;
			[,]+Alltrim(Str(gnIdUtil))+ [) ] + ;
			[ RETURNING ID_INVENTAR INTO ?@pnIdInventar]
		lnSucces = goExecutor.oExecute(lcSql)
		If lnSucces < 0
			amessagebox(goExecutor.cEroare,16,"Eroare")
			gnButon = 2
		Else
			*!*			DEBUG
			*!*			SUSPEND
		
			Use In Select('crsInventarNou')
			lcSql = 'select * from vgest_inventar where id_inventar = ?pnIdInventar'
			lnSucces = goExecutor.oExecute(lcSql, "crsInventarNou")
			If lnSucces < 0
				amessagebox(goExecutor.cEroare,16,"Eroare")
				This.actualizeaza_grid1()
			Else
				Select (lcCursorInventar)
				Append From Dbf('crsInventarNou')
				Use In crsInventarNou
			Endif
		
		Endif
		Thisform.do_executa()
		
		*!* 23.02.2010
		*!* marius.mutu
		*!* nu stiu de ce nu pune focusul pe coloana corespunzatoare, desi intra pe ramura cu setfocus
		Select crs_inventar
		Locate For id_inventar = pnIdInventar
		If Found()
			If Empty(proc_tvav)
				Thisform.grid1.cproc_TVAv.text1.SetFocus()
			Else
				If Empty(pretctvav)
					Thisform.grid1.cPretcTVA.text1.SetFocus()
				Else
		
					Thisform.grid1.cstoc_faptic.text1.SetFocus()
		
					Replace stoc_faptic With 0
				Endif
			Endif
		Endif	
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru = "1=1" + gcCondSucursala
		
		IF LEN(THISFORM.filtru_pretty)>0
			lcFiltru = lcFiltru+" and (" + ALLTRIM(THISFORM.filtru_pretty) + ")"
		ENDIF
		IF !EMPTY(lcFiltru)
			IF UPPER(ALLTRIM(LEFT(ALLTRIM(lcFiltru),4)))="AND"
				lcFiltru =SUBSTR(lcfiltru,4)
			ENDIF
			
			IF UPPER(ALLTRIM(LEFT(ALLTRIM(lcFiltru),3)))="OR"
				lcFiltru =SUBSTR(lcfiltru,3)
			ENDIF
		ENDIF 	
		IF (THIS.filtru_pretty#"none")
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		THISFORM.actualizeaza_grid1(lcFiltru)
		Thisform.LockScreen=.F.
		Thisform.MousePointer= 0
			IF RECCOUNT(this.cnumecursor)=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE do_cautacodbare
	ENDPROC

	PROCEDURE do_cauta_articol
		*!* 19.04.2010
		*!* marius.mutu
		*!* analitic din gestiune/articol
		Local locauta
		
		lcFiltru = [1=2]
		lcSchema = []
		lcOrder = [denumire]
		lccoloane = [denumire,codmat,codbare,id_articol]
		lcTitlu = [Alegeti articolul]
		lcTitluColoane = [Denumire,Cod Material,Cod bare,Id]
		*!* 19.04.2010
		*!*	lcSelect = [select a.ID_ARTICOL,a.DENUMIRE,a.CODMAT,a.CODBARE,a.INACTIV,a.cont,a.acont,c.pret,c.proc_tvav,c.pretftva,c.pretctva ] +;
		*!*		[ from nom_articole a ]+;
		*!*		[ left join ]+;
		*!*		[ (select distinct b.id_articol,max(NVL(b.pret,0)) as pret,max(NVL(b.proc_tvav,0)) as proc_tvav, ]+;
		*!*		[ max(NVL(b.pretftva,0)) as pretftva,max(NVL(b.pretctva,0)) as pretctva ]+;
		*!*		[ from crm_politici_pret_art b ]+;
		*!*		[ where b.id_pol in (select b1.id_pol from crm_vpolpretcurutil b1 where b1.id_util = ?gnIdUtil) ]+;
		*!*		[ group by b.id_articol) c on a.ID_ARTICOL = c.id_articol]
		
		lcSelect = [select a.ID_ARTICOL, a.DENUMIRE, a.CODMAT, a.CODBARE, a.INACTIV, NVL(g.cont, a.cont) as cont, NVL(g.acont, a.acont) as acont,c.pret,c.proc_tvav,c.pretftva,c.pretctva ] +;
			[ from nom_articole a ]+;
			[ left join (select id_gestiune, cont, acont from nom_gestiuni) g on g.id_gestiune = ] + Alltrim(Str(thisform.nid_gestiune)) + ;
			[ left join ]+;
			[ (select distinct b.id_articol,max(NVL(b.pret,0)) as pret,max(NVL(b.proc_tvav,0)) as proc_tvav, ]+;
			[ max(NVL(b.pretftva,0)) as pretftva,max(NVL(b.pretctva,0)) as pretctva ]+;
			[ from crm_politici_pret_art b ]+;
			[ where b.id_pol in (select b1.id_pol from crm_vpolpretcurutil b1 where b1.id_util = ?gnIdUtil) ]+;
			[ group by b.id_articol) c on a.ID_ARTICOL = c.id_articol]
		*!* 19.04.2010 ^
		
		lcFiltruOriginal = [ a.INACTIV = 0 and a.sters = 0 ]
		lcNumeProc = [nom_articole]
		
		llToateIreg = .F.
		lcPrimaColoana = [denumire]
		lnPornire = 1
		lcIdColumn = "id_articol"
		locauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana,;
			lnPornire, , lcIdColumn)
		If gnbuton <> 2
			oinv.denumire = locauta.denumire
			oinv.id_articol = locauta.id_articol
			oinv.proc_tvav = locauta.proc_tvav
			Thisform.npretvtva = locauta.pretctva
			oinv.pretv = locauta.pretftva
			oinv.tvav = Thisform.npretvtva - oinv.pretv
			oinv.stoc_faptic = 0
			oinv.Cont = Alltrim(Nvl(locauta.Cont,''))
			oinv.acont = Alltrim(Nvl(locauta.acont,''))
		
			If Upper(Alltrim(oinv.codbare)) <>Upper(Alltrim(locauta.codbare)) And !(Empty(locauta.codbare) Or Isnull(locauta.codbare)) And !(Empty(oinv.codbare) Or Isnull(oinv.codbare))
				If amessagebox([Codul de bare vechi pe articolul ]+Alltrim(locauta.denumire)+;
						[ este: ]+Alltrim(locauta.codbare)+[. Il inlocuim cu: ]+;
						ALLTRIM(oinv.codbare)+[?],4+32,'Atentie!') = 6
					lcsel = [update nom_articole set codbare =  ] + Alltrim(oinv.codbare)+;
						[where id_articol = ]+Alltrim(Str(locauta.id_articol))
					lnSucces = goExecutor.oExecute(lcsel)
					If lnSucces < 0
						amessagebox(goExecutor.cEroare ,0+16, 'Eroare')
					Endif
				Else
					oinv.codbare = locauta.codbare
				Endif
			Else
				lcsel = [update nom_articole set codbare = '] + Alltrim(oinv.codbare)+;
					[' where id_articol = ]+Alltrim(Str(locauta.id_articol))
				lnSucces = goExecutor.oExecute(lcsel)
				If lnSucces < 0
					amessagebox(goExecutor.cEroare ,0+16, 'Eroare')
				Endif
		
			Endif
		
			lcSql = [select a.* from  (select a.dataora,a.pret,a.tva, a.tvav,a.pretv,a.PRETV+a.TVAV as pretvtva ]+;
				[ from rul a where a.ID_ARTICOL = ]+Alltrim(Str(oinv.id_articol)) + [ and a.sters = 0 and ((a.cant<>0  and a.id_tip_rulaj = 0) or (a.cante<0 and a.id_tip_rulaj = 1) )]+;
				[ and an*12+luna between ]+ Alltrim(Str(gnAn*12+gnluna-1))+[ and ]+ Alltrim(Str(gnAn*12+gnluna)) +;
				[ order by a.an desc, a.luna desc, a.dataora desc) a where rownum = 1]
			*!* v 2.0.18 ^
			lnSucces=goExecutor.oExecute(lcSql,'crsPretUltim')
			If lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,'Eroare')
			Else
				pnpret = Nvl(crsPretUltim.Pret,0)
				Use In crsPretUltim
			Endif
		
			*!*		This.ct_clb_articol.Refresh()
			*!*
			*!*		Thisform.clb_vanzare.Refresh
			*!*		Thisform.clb_cont.Refresh
			*!*		thisform.clb_tx_simplu1.Refresh
			*!*		Select crs_inventar
			*!*		Scatter Name oinv Blank
			*!*		Thisform.Refresh()
			*!*		thisform.CLB_TX_PretValuta.Refresh
			*!*		THISFORM.clb_tx_Valuta.Refresh
		Else
			Return
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_codbare
		*!* 23.02.2010
		*!* marius.mutu
		*!* la pozitionarea pe un articol se copia si stocul faptic de pe articolul anterior (nu se cunoaste cauza)
		*!* s-a suprascris stocul faptic cu 0
		
		*!* 31.05.2010
		*!* marius.mutu
		*!* daca este un inventar din stoc, stoc_faptic si stoc_faptic1 sunt deja completate, desi nu au fost verificate
		*!* la citirea unui cod de bare verific daca stoc_faptic2 = 0 si nu este completat first_updated_at, nu se pozitioneaza pe stoc_faptic2 ci pe stoc_faptic1				
		
		Local lcSelect, lnRecno, lnArticole
		Private pcCodBare
		
		lcSelect = Select()
		pcCodBare = Alltrim(oinv.codbare)
		This.lblAtentie.Caption = ''
		 
		If Empty(m.pcCodBare)
			Return
		Endif
		*!* caut articolul in inventar si ma pozitionez pe el daca il gasesc
		Select crs_inventar
		lnRecno = Recno()
		Calculate Cnt() To lnArticole For Alltrim(codbare) = m.pcCodBare
		
		If lnArticole > 0
			This.lblAtentie.Caption = 'Exista ' + Alltrim(Str(lnArticole)) + ' pozitii pentru acest cod de bare'
			Locate For Alltrim(codbare) = m.pcCodBare
			If !Found()
				If lnReco > 0
					Goto lnRecno
				Else
					Go Top
				Endif
			ELSE
		*!*			goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' do_cauta_codbare 1 stoc faptic ' + STR(crs_inventar.stoc_faptic))
				Do Case
					Case Empty(proc_tvav)
						Thisform.grid1.cproc_TVAv.text1.SetFocus()
					Case Empty(pretctvav)
						Thisform.grid1.cPretcTVA.text1.SetFocus()
					Case Empty(stoc_faptic)
		*!*					goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' do_cauta_codbare 2 stoc faptic' + STR(crs_inventar.stoc_faptic))				
						Thisform.grid1.cstoc_faptic.text1.SetFocus()
						*!* 23.02.2010
						REPLACE stoc_faptic WITH 0 IN crs_inventar
						*!* 23.02.2010				
		*!*					goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' do_cauta_codbare 3 stoc faptic ' + STR(crs_inventar.stoc_faptic))				
					Case Empty(stoc_faptic1)
						Thisform.grid1.cstocfaptic1.text1.SetFocus()
						*!* 23.02.2010
						REPLACE stoc_faptic1 WITH 0 IN crs_inventar
						*!* 23.02.2010				
					Case Empty(stoc_faptic2)
						*!* 31.05.2010
		*!*					IF EMPTY(NVL(first_updated_at, {}))
		*!*						REPLACE stoc_faptic1 WITH stoc_faptic1
		*!*						Thisform.grid1.cstocfaptic1.text1.SetFocus()
		*!*					ELSE 	
							Thisform.grid1.cstocfaptic2.text1.SetFocus()
							*!* 23.02.2010
							REPLACE stoc_faptic2 WITH 0 IN crs_inventar
		*!*						*!* 23.02.2010				
		*!*					ENDIF 	
						*!* 31.05.2010 ^
					Case Empty(stoc_faptic3)
						Thisform.grid1.cstocfaptic3.text1.SetFocus()
						*!* 23.02.2010
						REPLACE stoc_faptic3 WITH 0 IN crs_inventar
						*!* 23.02.2010						
					Case Empty(stoc_faptic4)
						Thisform.grid1.cstocfaptic4.text1.SetFocus()
						*!* 23.02.2010
						REPLACE stoc_faptic4 WITH 0 IN crs_inventar
						*!* 23.02.2010						
					Case Empty(stoc_faptic5)
						Thisform.grid1.cstocfaptic5.text1.SetFocus()
						*!* 23.02.2010
						REPLACE stoc_faptic5 WITH 0 IN crs_inventar
						*!* 23.02.2010						
					Otherwise
						Thisform.grid1.cstoc_faptic.text1.SetFocus()
				Endcase
			Endif
		Else
		
			*!* caut codul de bare in nomenclatorul de articole + pretul din politicile de preturi ???pe care are drepturi utilizatorul respectiv???
			*!* cont.analitic din nomenclatorul de gestiuni sau de pe articol
			TEXT TO lcSel NOSHOW TEXTMERGE 
		select id_articol,
		       codbare,
		       denumire,
		       proc_tvav,
		       pretftva,
		       pretctva,
		       NVL(g_cont, a_cont) as cont,
		       NVL(g_acont, a_acont) as acont
		  from (select a.ID_ARTICOL,
		               a.DENUMIRE,
		               a.CODMAT,
		               a.CODBARE,
		               a.INACTIV,
		               a.cont       as a_cont,
		               a.acont      as a_acont,
		               g.cont       as g_cont,
		               g.acont      as g_acont,
		               c.pret,
		               c.proc_tvav,
		               c.pretftva,
		               c.pretctva
		          from nom_articole a
		          left join (select id_gestiune, cont, acont from nom_gestiuni) g
		            on g.id_gestiune = <<ALLTRIM(STR(thisform.nid_gestiune))>>
		  left join (select distinct b.id_articol,
		                             max(NVL(b.pret, 0)) as pret,
		                             max(NVL(b.proc_tvav, 0)) as proc_tvav,
		                             max(NVL(b.pretftva, 0)) as pretftva,
		                             max(NVL(b.pretctva, 0)) as pretctva
		               from crm_politici_pret_art b
		              where b.id_pol in (select b1.id_pol
		                                   from crm_vpolpretcurutil b1
		                                  where b1.id_util = ?gnIdUtil)
		              group by b.id_articol) c
		    on a.ID_ARTICOL = c.id_articol
		 where a.INACTIV = 0
		   and a.sters = 0
		   and a.codbare = ?pcCodBare)
			ENDTEXT 	
			lccursor = [crs_ArtCodbare]
			lnsucces = goExecutor.oExecute(lcsel,lccursor)
			If lnsucces < 0
				AMESSAGEBOX(goExecutor.cEroare ,0+16, 'Eroare')
				Return
			Endif
		
			Select crs_ArtCodbare
			If Reccount()<1
				AMESSAGEBOX('Nu exista codul de bare introdus! Alegeti din nomenclator articolul cu codul de bare introdus!',0+64,'Atentie')
				Thisform.do_cauta_articol()
				If gnbuton = 2
					Return
				Endif
			Else
				If Reccount()>1
		
					lcFiltru = [2=2]
					lcSchema = []
					lcOrder = [denumire]
					lccoloane = [denumire,codmat,codbare,id_articol]
					lcTitlu = [Alegeti articolul]
					lcTitluColoane = [Denumire,Cod Material,Cod bare,Id]
					lcSelect = [select a.ID_ARTICOL, a.DENUMIRE, a.CODMAT, a.CODBARE, a.INACTIV, NVL(g.cont, a.cont) as cont, NVL(g.acont, a.acont) as acont,c.pret,c.proc_tvav,c.pretftva,c.pretctva ] +;
						[ from nom_articole a ]+;
						[ left join (select id_gestiune, cont, acont from nom_gestiuni) g on g.id_gestiune = ] + ALLTRIM(STR(thisform.nid_gestiune)) + ;				
						[ left join ]+;
						[ (select distinct b.id_articol,max(NVL(b.pret,0)) as pret,max(NVL(b.proc_tvav,0)) as proc_tvav, ]+;
						[ max(NVL(b.pretftva,0)) as pretftva,max(NVL(b.pretctva,0)) as pretctva ]+;
						[ from crm_politici_pret_art b ]+;
						[ where b.id_pol in (select b1.id_pol from crm_vpolpretcurutil b1 where b1.id_util = ?gnIdUtil) ]+;
						[ group by b.id_articol) c on a.ID_ARTICOL = c.id_articol]
		
					lcFiltruOriginal = [ a.INACTIV = 0 and a.sters = 0  and a.codbare = ']+Alltrim(oinv.codbare)+[']
					lcNumeProc = [nom_articole]
		
					llToateIreg = .F.
					lcPrimaColoana = [denumire]
					lnPornire = 1
					lcIdColumn = "id_articol"
					loCauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana,;
						lnPornire, , lcIdColumn)		&& 11.07.2007
					If gnbuton = 2
						Return
					Endif
		
					oinv.denumire = loCauta.denumire
					oinv.id_articol = loCauta.id_articol
					oinv.proc_tvav = loCauta.proc_tvav
					Thisform.npretvtva = loCauta.pretctva
					oinv.pretv = loCauta.pretftva
					oinv.tvav = Thisform.npretvtva - oinv.pretv
					oinv.stoc_faptic = 0
					oinv.Cont = Alltrim(Nvl(loCauta.Cont,''))
					oinv.acont = Alltrim(Nvl(loCauta.acont,''))
				Else
					oinv.denumire = crs_ArtCodbare.denumire
					oinv.id_articol = crs_ArtCodbare.id_articol
					oinv.proc_tvav = crs_ArtCodbare.proc_tvav
					Thisform.npretvtva  = crs_ArtCodbare.pretctva
					oinv.pretv = crs_ArtCodbare.pretftva
					oinv.tvav = Thisform.npretvtva - oinv.pretv
					oinv.stoc_faptic = 0
					oinv.Cont = Alltrim(Nvl(crs_ArtCodbare.Cont,''))
					oinv.acont = Alltrim(Nvl(crs_ArtCodbare.acont,''))
				Endif && Reccount()>1
			Endif && Reccount()<1
		
		
			Thisform.do_adauga_inform()
		
		Endif && !Found()
		*!* caut articolul in inventar si ma pozitionez pe el daca il gasesc ^
		
		Select crs_inventar
		Scatter Name oinv Blank
		*!*	goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' do_cauta_codbare 4 stoc faptic ' + STR(crs_inventar.stoc_faptic))
		Thisform.Refresh()
		
	ENDPROC

	PROCEDURE do_cauta_furnizor
		Local locauta
		Local lcFiltru, lcFiltruOriginal, lcIdColumn, lcNumeProc, lcOrder, lcPrimaColoana, lcSchema
		Local lcSelect, lcTitlu, lcTitluColoane, lccoloane, llToateIreg, lnId, lnPornire, lnSucces
		lcFiltru = [2=2]
		lcSchema = []
		lcOrder = [denumire,cod_fiscal,id_part]
		lccoloane = [denumire,cod_fiscal,id_part]
		lcTitlu = [Alegeti furnizorul]
		lcTitluColoane = [Denumire,Cod fiscal,Id]
		lcSelect = [select denumire, cod_fiscal, id_part from vnom_parteneri ]
		
		lcFiltruOriginal = [ INACTIV = 0 ]
		lcNumeProc = [nom_parteneri]
		
		llToateIreg = .F.
		lcPrimaColoana = [denumire]
		lnPornire = 1
		lcIdColumn = "id_part"
		locauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana, ;
			  lnPornire, , lcIdColumn)
		
		If gnbuton <> 2
		
			lnId = crs_inventar.id_inventar
			lnSucces = This.UpdateServer(lnId, 'id_furnizor', locauta.id_part)
			If m.lnSucces > 0
				Select crs_inventar
				Replace id_furnizor With locauta.id_part, furnizor With locauta.denumire
				This.grid1.Refresh()
			Endif
		Endif
		
		
	ENDPROC

	PROCEDURE do_cauta_gestiune
		*!* 22.02.2010
		*!* marius.mutu
		*!* parametru tlModifica
		
		LPARAMETERS tlModifica
		*!* tlModifica = click pe coloana gestiune din tabel - se modifica gestiunea pe linia curenta
		
		Local locauta
		lcFiltru = [2=2]
		lcSchema = []
		lcOrder = [a.nume_gestiune,a.cgest]
		lccoloane = [nume_gestiune,cgest,cont,acont,nr_pag,id_gestiune]
		lcTitlu = [Alegeti gestiunea]
		lcTitluColoane = [Denumire,Cgest,Cont,Acont,Nr.pag,Id]
		lcSelect = [select a.* from vnom_gestiuni a ]
		
		lcFiltruOriginal = [ a.INACTIV = 0 and a.id_gestiune in (]+Alltrim(Thisform.cid_gestiuni)+[)]
		lcNumeProc = [nom_gestiuni]
		
		llToateIreg = .F.
		lcPrimaColoana = [nume_gestiune]
		lnPornire = 1
		lcIdColumn = "id_gestiune"
		locauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana,;
			lnPornire, , lcIdColumn)
		
		If gnbuton <> 2
			IF tlModifica
				lnId = crs_inventar.id_inventar
				lnSucces = this.UpdateServer(lnId,'id_gestiune',loCauta.id_gestiune)
				IF lnSucces > 0
					SELECT crs_inventar
					REPLACE id_gestiune WITH loCauta.id_gestiune, nume_gestiune WITH loCauta.nume_gestiune, cgest WITH loCauta.cgest
					this.grid1.Refresh()
				ENDIF 	
			ELSE 
				oinv.nume_gestiune = locauta.nume_gestiune
				oinv.id_gestiune = locauta.id_gestiune
				thisform.nid_gestiune = locauta.id_gestiune
				thisform.cnume_gest = locauta.nume_gestiune
				thisform.Ct_clb_gestiune.Refresh()
			ENDIF 	
		Endif
		
		
	ENDPROC

	PROCEDURE do_copie
		Private pnIdInventar
		Local lnIdInventar, lnSucces, lcSql
		Local lcIdRulAux, lnRecno, lcIdRulAux
		PRIVATE oinv, pcIdLucrareRez, pcIdPartRez, pcIdSucursala, pcSerie, pcacont, pccont
		PRIVATE pcid_responsabil, pddatapif, pndns_luni, pnid_articol, pnid_gestiune, pnidvaluta, pnpret
		PRIVATE  pnpretv, pnpretvaluta, pnproc_tvav, pnstoc_faptic, pntvav
		
		If Thisform.lvalidat And !Thisform.lCorectie
			Return
		Endif
		
		pnIdInventar = 0
		lnIdInventar = crs_inventar.id_inventar
		
		If Empty(Nvl(lnIdInventar, 0))
			Return
		Endif
		
		*!*	TEXT TO lcSql TEXTMERGE NOSHOW
		*!*	insert into gest_inventar
		*!*	  (id_articol, id_gestiune, stoc_faptic, id_util, an, luna, pret, pretv, tva, tvav, cont, pretd, acont, proc_tvav, data_referinta, depreciere, motiv_depreciere, id_responsabil, datapif, dns_luni, dns_ramas, id_meseria, id_formatia, dataang, datalic, dns_luni_faptic, uzura_faptic, dnf, data_expirare, id_rul_aux, serie, id_valuta, id_sucursala, id_lucrare_rez, id_part_rez, lot, adata_expirare, id_c_inventar)
		*!*	select id_articol, id_gestiune, 0 as stoc_faptic, <<gnIdUtil>> as id_util, an, luna, pret, pretv, tva, tvav, cont, pretd, acont, proc_tvav, data_referinta, depreciere, motiv_depreciere, id_responsabil, datapif, dns_luni, dns_ramas, id_meseria, id_formatia, dataang, datalic, dns_luni_faptic, uzura_faptic, dnf, data_expirare, id_rul_aux, serie, id_valuta, id_sucursala, id_lucrare_rez, id_part_rez, lot, adata_expirare, id_c_inventar
		*!*	from gest_inventar where id_inventar = <<m.lnIdInventar>>
		*!*	RETURNING ID_INVENTAR INTO ?@pnIdInventar
		*!*	ENDTEXT
		
		Select crs_inventar
		Scatter Name oinv
		
		If Nvl(oinv.id_gestiune, 0) = 0
			Messagebox('Gestiunea nu este completata!', 0 + 48, _Screen.Caption)
			Return
		Endif
		If Nvl(oinv.id_articol, 0) = 0
			Messagebox('Articolul nu este completat!', 0 + 48, _Screen.Caption)
			Return
		Endif
		
		
		oinv.DATAPIF = Date()
		oinv.dns_luni = Nvl(oinv.dnf, 0)
		
		pnpretvaluta = Nvl(oinv.pretd, 0)
		pnidvaluta = Nvl(oinv.id_valuta, 0)
		pnid_articol = oinv.id_articol
		pnid_gestiune = oinv.id_gestiune
		pcid_responsabil = Iif(Isnull(oinv.id_responsabil), 'NULL', Alltrim(Str(oinv.id_responsabil)))
		pccont = Left(Alltrim(Nvl(oinv.Cont, '')), 4)
		pcacont = Left(Alltrim(Nvl(oinv.acont, '')), 4)
		pnpret = Nvl(oinv.Pret, 0)
		pnpretv = Nvl(oinv.pretv, 0)
		pntvav = Nvl(oinv.tvav, 0)
		pnproc_tvav = Nvl(oinv.proc_tvav, 0)
		pddatapif = oinv.DATAPIF
		pndns_luni = Nvl(oinv.dns_luni, 0)
		pcSerie = Nvl(oinv.serie, '')
		pcIdSucursala = Iif(Nvl(oinv.id_sucursala, 0) = 0, 'NULL', Alltrim(Str(oinv.id_sucursala)))
		pnstoc_faptic = 0
		pcIdPartRez = Iif(Isnull(oinv.id_part_rez), 'NULL', Alltrim(Str(oinv.id_part_rez)))
		pcIdLucrareRez = Iif(Isnull(oinv.id_lucrare_rez), 'NULL', Alltrim(Str(oinv.id_lucrare_rez)))
		lcIdRulAux = Iif(Isnull(oinv.id_rul_aux), 'NULL', Alltrim(Str(oinv.id_rul_aux)))
		
		lcSql = [insert into gest_inventar (an,luna,id_articol,id_gestiune,cont,acont,pret,pretv,tvav,proc_tvav,data_referinta, ] + ;
			[id_responsabil,datapif,dns_luni,id_rul_aux,serie,pretd,id_Valuta,id_sucursala,id_c_inventar,id_part_rez,id_lucrare_rez,stoc_faptic, stoc_faptic1, id_util ) ] + ;
			[values(] + Alltrim(Str(gnAn)) + [,] + Alltrim(Str(gnLuna)) + [,] + Alltrim(Str(pnid_articol)) + [,] + ;
			Alltrim(Str(pnid_gestiune)) + [,'] + pccont + [','] + pcacont + [',] + Alltrim(Str(pnpret, 20, 4)) + [,] + Alltrim(Str(pnpretv, 20, 4)) + [,] + ;
			Alltrim(Str(pntvav, 10, 4)) + [,] + Alltrim(Str(pnproc_tvav, 10, 4)) + [,TO_DATE('] + Iif(!Empty(Nvl(pdDataRef, {})), Dtos(pdDataRef), '') + [','YYYYMMDD'),] + ;
			pcid_responsabil + [, TO_DATE('] + Iif(!Empty(Nvl(pddatapif, {})), Dtos(pddatapif), '') + [','YYYYMMDD'),] + Alltrim(Str(pndns_luni)) + [,] + m.lcIdRulAux + [,'] + ;
			Alltrim(pcSerie) + [',] + Alltrim(Str(pnpretvaluta, 20, 4)) + [,] + Alltrim(Str(pnidvaluta)) + [,] + pcIdSucursala + [, ] + ;
			Alltrim(Str(This.nidcinventar)) + ',' + pcIdPartRez + [,] + pcIdLucrareRez + [,] + Alltrim(Str(pnstoc_faptic, 18, 3)) + ;
			[,] + Alltrim(Str(pnstoc_faptic, 18, 3)) + [,] + Alltrim(Str(gnIdUtil)) + [) ] + ;
			[ RETURNING ID_INVENTAR INTO ?@pnIdInventar]
		lnSucces = goExecutor.oExecute(lcSql)
		If lnSucces < 0
			AMESSAGEBOX(goExecutor.cEroare, 16, "Eroare")
		Else
			lcSql = 'select * from vgest_inventar where id_inventar = ?pnIdInventar'
			lnSucces = goExecutor.oExecute(lcSql, "crsInventarNou")
			If lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare, 16, "Eroare")
				This.actualizeaza_grid1()
			Else
				Select crs_inventar
				Append From Dbf('crsInventarNou')
				Use In crsInventarNou
				Select crs_inventar
				lnRecno = Recno()
				Locate For id_inventar = pnIdInventar
				If !Found()
					If lnRecno > 0
						Goto lnRecno
					Endif
				Endif
				This.grid1.cstoc_faptic.SetFocus()
			Endif
		
		Endif
		
	ENDPROC

	PROCEDURE do_excel
		If Reccount(This.grid1.RecordSource)>0
			lcOrder = "denumire"
			export_excel_grid(This.grid1, lcOrder)
		Else
			amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_executa
		lcSel = ALLTRIM(this.cnumecursor)
		
		SELECT (lcSel)
		lnRandCrt = RECNO()
		thisform.LockScreen = .T.
		
		SUM ROUND(pret*stoc_faptic,gnPc) TO thisform.nstoc_faptic
		
		SUM ROUND(pretctvav*stoc_faptic,gnPc) TO thisform.nstoc_fapticv
		
		SUM ROUND(stoc_faptic,gnPcant) TO thisform.ncstoc_faptic
		
		SELECT (lcSel)
		IF lnRandCrt > 1
			TRY 
				GO RECORD lnRandCrt
			CATCH 
				LOCATE 
			ENDTRY 	
		ELSE 
			LOCATE 
		ENDIF 
		
		this.clb_tx_simplu1.Refresh 
		this.clb_tx_simplu2.Refresh 
		this.clb_tx_simplu3.Refresh 
		
		thisform.LockScreen = .F.
	ENDPROC

	PROCEDURE do_listare
		*!* 22.03.2010
		*!* marius.mutu
		*!* apareau doar stoc_faptic > 0, nu si stoc_faptic <> stoc_scriptic
		
		*!* 15.04.2010
		*!* marius.mutu
		*!* LCFILTRU = nu avea where
		
		*!* 16.06.2010
		*!* marius.mutu
		*!* LCFILTRU = fara id_articol = 0	
		
		Local lcRaport, lnOptiuneListare, lcOrdine1, lcOrdine2, lcOrdine3, lcOrdine4, lcFilter
		Private pcSubtitlu,pCNumeGest
		lnOptiuneListare = xmenu('Listare alfabetica;Listare cronologica;\-;Listare necompletat;Listare necompletat redus')
		IF !INLIST(m.lnOptiuneListare, 1, 2, 4, 5)
			RETURN
		ENDIF 
		
		pCNumeGest = oInventar.cNume_gest
		pcSubtitlu = Thisform.citeste_doc()
		IF !EMPTY(NVL(pcSubtitlu,[]))
			pcSubtitlu = [Documente incluse pe inventar dupa inceperea acestuia : ] + ALLTRIM(pcSubtitlu) + CHR(13) + CHR(10)
		endif
		pcSubtitlu = pcSubtitlu + This.filtru_pretty_ro_full
		*!*	pcChiosc = This.cdescriere
		lcRaport = [rap_nota_inv2005_mag]
		*!* 03.06.2010
		DO CASE 
			CASE INLIST(lnOptiuneListare, 1, 2)
				lcRaport = [rap_nota_inv2005_mag]
			CASE lnOptiuneListare = 4
				lcRaport = [rap_nota_inv2005_mag_necompletat]
			CASE lnOptiuneListare = 5
				lcRaport = [rap_nota_inv2005_mag_necompletat_redus]
		ENDCASE 		
		*!* 03.06.2010 ^
				
		Private pcDataOra
		pcDataOra = get_ora(2)
		lcSel = This.cnumecursor
		lcFiltru = This.ocursor.ca_baza1.cfiltru
		*!* 15.04.2010
		*!* 16.06.2010
		If !Empty(lcFiltru)
			lcFiltru = [ where (NVL(id_articol,0) <> 0) and ] + lcFiltru
		ELSE 
			lcFiltru = [ where NVL(id_articol,0) <> 0 ]
		ENDIF 
		
		* Filtru GridExtra
		lcFilter = FILTER(This.cnumecursor)
		IF !EMPTY(m.lcFilter)
			lcFiltru = m.lcFiltru + [ and (] + m.lcFilter + [)]
		ENDIF
		
		*!* 16.06.2010 ^
		*!* 15.04.2010 ^
		
		*!* 22.03.2010
		*!*	If !Empty(lcFiltru)
		*!*		lcFiltru = [ where ] + lcFiltru + [ and stoc_faptic > 0]
		*!*	Else
		*!*		lcFiltru = [ where stoc_faptic > 0]
		*!*	Endif
		*!* 22.03.2010 ^
		
		pcHeaderGrup = [Grupa articol : ]
		pcIdGrup = [id_grupa]
		pcGrup = [grupa]
		*!* 17.04.2010
		lcOrdine1 = "2"
		IF INLIST(lnOptiuneListare, 1, 4, 5) && alfabetic
			lcOrdine2 = '3'
			lcOrdine3 = '4'
			lcOrdine4 = '5'	
		ELSE 
			lcOrdine2 = '6'
			lcOrdine3 = '3'
			lcOrdine4 = '5'		
		ENDIF 
		
		Select (lcSel)
		*!* 03.06.2010
		*!*	Select grupa,denumire,codmat,MIN(first_updated_at) as  first_updated_at, ;
		*!*		id_articol,um,id_gestiune,nume_gestiune,Pret,pretv,pret_unitar,depreciere,motiv_depreciere,serie,id_grupa, ;
		*!*		Sum(stoc_faptic) As stoc_faptic,Sum(cants) As cants,;
		*!*		SUM(cant) As cant, Sum(cante) As cante,Sum(stoc_scriptic) As stoc_scriptic, ;
		*!*		Max(data_referinta) As data_referinta ;
		*!*		From (lcSel) &lcFiltru;
		*!*		GROUP By id_articol,denumire,codmat,um,id_gestiune,nume_gestiune,Pret,pretv,pret_unitar,depreciere,motiv_depreciere,serie,grupa,id_grupa;
		*!*		ORDER By &lcOrdine1, &lcOrdine2, &lcOrdine3 ;
		*!*		INTO Cursor crsListare nofilter
		SELECT grupa,denumire,codmat,serie,first_updated_at, ;
			id_articol,um,id_gestiune,nume_gestiune,pret_unitar,depreciere,motiv_depreciere,id_grupa, ;
			stoc_faptic, cants,;
			cant, cante, stoc_scriptic, data_referinta ;
			From (lcSel) WHERE .F. ;
			INTO Cursor crsListareTemp READWRITE 
		
		
		IF INLIST(lnOptiuneListare, 4, 5) && necompletat
			SELECT c1.grupa, c1.id_grupa ;
				from (SELECT distinct grupa, id_grupa ;
				FROM (lcSel) &lcFiltru ) c1, ;
				(select 'x' as dummy from (lcSel) where RECNO() <= 30) c2;
				order by 1,2 ;
				INTO CURSOR crsGrupeTemp
		
			 SELECT crsListareTemp
			 APPEND FROM DBF('crsGrupeTemp')
			 USE IN (SELECT('crsGrupeTemp'))
		ENDIF 	 
		
		Select 1 as tip, grupa,denumire,codmat,serie,MIN(first_updated_at) as  first_updated_at, ;
			id_articol,um,id_gestiune,nume_gestiune,pret_unitar,depreciere,motiv_depreciere,id_grupa, ;
			Sum(stoc_faptic) As stoc_faptic,Sum(cants) As cants,;
			SUM(cant) As cant, Sum(cante) As cante,Sum(stoc_scriptic) As stoc_scriptic, ;
			Max(data_referinta) As data_referinta ;
			From (lcSel) &lcFiltru;
			GROUP By id_articol,denumire,codmat,um,id_gestiune,nume_gestiune,pret_unitar,depreciere,motiv_depreciere,serie,grupa,id_grupa;
		UNION ALL ;
		SELECT 2 as tip, grupa,denumire,codmat,serie,first_updated_at, ;
			id_articol,um,id_gestiune,nume_gestiune,pret_unitar,depreciere,motiv_depreciere,id_grupa, ;
			stoc_faptic, cants,;
			cant, cante, stoc_scriptic, data_referinta ;
			FROM crsListareTemp ;
			ORDER By &lcOrdine1, 1, &lcOrdine2, &lcOrdine3, &lcOrdine4 ;
			INTO Cursor crsListare nofilter
		*!* 03.06.2010 ^
		
		USE IN (SELECT('crsListareTemp'))
		*!*	Select Distinct a.id_grupa,a.grupa,Sum(a.pret_unitar*a.stoc_faptic) As suma  From crsListare a ;
		*!*		Group By a.id_grupa,a.grupa Order By grupa Into Cursor crsRecapitulatie nofilter Readwrite
		
		*!*	Insert Into crsRecapitulatie (grupa) Values ('MONETAR CASA')
		
		This.AlwaysOnTop = .F.
		*!* In raport, pe footer.onentry se apeleaza poRecapitulatie.NewPage
		*!* se salveaza in cRecapitulatieInventarPagini grupul, pagina si totalul pe pagina (grup, pagina, valoare)
		PRIVATE poRecapitulatie
		poRecapitulatie = CREATEOBJECT("recapitulatie_inventar")
		*!* In raport, pe footer.onentry se apeleaza poRecapitulatie.NewPage ^
		
		Select crsListare
		Keyboard '{CTRL+F10}'
		*!*	Report Form (lcRaport) To Printer Prompt Preview
		goExport.export2frx([crsListare],lcRaport,, , , , , .T.)
		
		SELECT 1 as tip, GRUP AS ID, PADR('MONETAR ' + grup, 100) AS GRUP, CAST(0 AS N(18,2)) AS valoare, SPACE(100) as pagina, CAST(0 as n(5)) as npagina FROM cRecapitulatieInventarPagini ;
		union ;
		SELECT 2 as tip, GRUP AS ID, PADR(grup,100) AS GRUP, valoare, PADR('Fila ' + ALLTRIM(STR(pagina)), 100) as pagina, pagina as npagina FROM cRecapitulatieInventarPagini;
		union ;
		SELECT 3 as tip, GRUP AS ID, PADR('TOTAL ' + ALLTRIM(grup), 100) AS  GRUP, SUM(valoare) as valoare, SPACE(100) as pagina, CAST(0 as n(5)) as npagina FROM cRecapitulatieInventarPagini ;
		GROUP BY GRUP ;
		union ;
		SELECT 4 as tip, 'ZZZZ' AS ID, PADR('TOTAL GENERAL', 100) AS  GRUP, SUM(valoare) as valoare, SPACE(100) as pagina, CAST(0 as n(5)) as npagina FROM cRecapitulatieInventarPagini ;
		INTO CURSOR crsRecapitulatie ;
		ORDER BY 2,1,6 && grup/subgrupa articol, tip, numar pagina - ordonat numeric
		
		Select crsRecapitulatie
		Keyboard '{CTRL+F10}'
		*!*	Report Form rap_recap_inv2005_mag To Printer Prompt Preview
		goExport.export2frx([crsRecapitulatie],[rap_recap_inv2005_mag],, , , , , .T.)
		
		This.AlwaysOnTop = .T.
		
		If Used('crsListare')
			Use In crsListare
		Endif
		If Used('crsRecapitulatie')
			Use In crsRecapitulatie
		Endif
		
	ENDPROC

	PROCEDURE do_reface
		*!* 05.06.2012
		*!* marius.mutu
		*!* se poate reface inventarul chiar daca este validat, la corectie de inventar
		
		*!* 15.12.2017
		*!* marius.mutu
		*!* se poate reface inventarul si daca este corectie, indiferent daca nOptiune inventar = 1 sau 3 (inventar initial cu golire de stoc)
		
		*!* 05.01.2018
		*!* marius.mutu
		*!* adaugarea de articole in inventar din documente dupa introducerea inventarului - nu se completeaza stocul faptic, indiferent de ce optiune s-a ales la inceputul inventarului
		*!* ca sa nu se denatureze inventarierea faptica. In plus nu s-ar inregistra nici o diferenta daca stoc faptic = stoc scriptic
		
		LOCAL llReturn
		llReturn = .T.
		If (This.nOptiuneInventar = 1 OR this.lCorectie) And (!This.lvalidat OR thisform.lCorectie)
			Local lcCursor,lcSql,lnSucces,loFrm,lcListaIdFact
			lcCursor = [crstmpintdoc]
			lcSql = [{call pack_inventar.citeste_documente(] + Alltrim(Str(Thisform.nidcinventar)) + [)}]
			lnSucces = goExecutor.oExecute(lcSql,lcCursor+[1])
			If lnSucces < 0
				amessagebox(goExecutor.cEroare,64,"Eroare")
				llReturn = .F.
			Else
				If Reccount(lcCursor+[1]) > 0
					copiaza_structura_cursor(lcCursor+[1],lcCursor)
					Insert Into (lcCursor) Select * From (lcCursor+[1]) Order By tip Desc,ales Desc,dataact,dataora
					Go Top
					Use In (Select(lcCursor+[1]))
					loFrm = Createobject("frm_inventar_doc")
					loFrm.Show(1)
					If gnButon = 1
						Select (lcCursor)
						Set Filter To ales = 1 And tip = 0
						lcListaIdFact = []
						Scan
							lcListaIdFact = lcListaIdFact + Alltrim(Str(id_fact)) + [|]
						Endscan
						If !Empty(lcListaIdFact)
							lcSql = [begin pack_inventar.adauga_documente(] + Alltrim(Str(Thisform.nidcinventar)) + [,] + ;
								['] + Alltrim(lcListaIdFact) + [',?gnIdUtil, 1); end;]
							lnSucces = goExecutor.oExecute(lcSql)
							If lnSucces < 0
								amessagebox(goExecutor.cEroare,64,"Eroare")
								llReturn = .F.
							Else
								save_grid_tag(Thisform.grid1)
								podecabaza.ca_baza1.afisare()
								restore_grid_tag(Thisform.grid1)
							Endif
						Endif
					Else
						llReturn = .F.
					Endif
				Else
					amessagebox("Nu exista documente introduse dupa inceperea inventarului!",48,"Atentie")
				Endif
				Use In (Select(lcCursor))
			Endif
		ENDIF
		RETURN llReturn
	ENDPROC

	PROCEDURE do_sterge
		*!* 07.12.2011
		*!* marius.mutu
		*!* nu se poate sterge un articol cu stoc scriptic diferit de 0
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
		If Reccount('crs_inventar')>0
			Select crs_inventar
			Scatter Name loArticolS
			lcNumeArticol=Upper(Alltrim(loArticolS.denumire))
			IF NVL(loArticolS.stoc_scriptic,0) <> 0 AND !This.lCorectie
				aMessagebox("Nu puteti sterge un articol cu stoc scriptic diferit de 0!",0+48,_Screen.Caption)
				RETURN
			ENDIF 
			If aMessagebox("Doriti sa stergeti articolul "+lcNumeArticol+" din inventar?",4+32+256,"Confirmare stergere")==6
				lcSql = 'delete from ' + gcs + '.gest_inventar where id_inventar='+Alltrim(Str(loArticolS.id_inventar))
				lnSucces = goExecutor.oExecute(lcSql)
				If lnSucces < 0
					aMessagebox(goExecutor.ceroare,16,"Eroare")
					gnButon = 2
				ELSE 
					Select crs_inventar
					lnRecno = RECNO() - 1
					DELETE
					GO TOP 
					IF lnRecno > 0
						GOTO lnRecno
					ENDIF 	
					this.grid1.SetFocus()
				Endif
		*!*			This.actualizeaza_grid1
			Endif
			Store "" To loArticolS
			thisform.do_executa()	
		Endif
		
	ENDPROC

	PROCEDURE do_termin
		If This.inainte_de_do_termin()
			gnButon = 1
			pnButon = 1
			Buton = 1
			pnIesire = 1
			This.Release
		Else
			This.Visible = .T.
		*!*	modificare serii numere	- 10.2007
		*!*		If Type([_Screen.nId_tipdoc]) = 'N' And !Empty(_Screen.nid_tipdoc)
		*!*			poGeneratorNumere.dezaloca_numar(_Screen.nid_tipdoc)
		*!*		Endif
		*!*		IF PEMSTATUS(_SCREEN,'nIdSerie',5)
		*!*			lnIdSerieBon =  _SCREEN.nIdSerie  && il salvez in item.when
		*!*			IF TYPE('lnIdSerieBon') = 'N' AND !EMPTY(lnIdSerieBon)
		*!*				lcSql = [update ] + gcS + [.serii_numere  set alocat = 0 where ] +;
		*!*					[ id_numar = ?lnIdSerieBon]
		*!*				lnSucces = goExecutor.oExecute(lcSql)
		*!*				IF lnSucces < 0
		*!*					lcTitlu = [Eroare]
		*!*					lcTip = [Avertizare]
		*!*					lcImagine = [exclam.ico]
		*!*					lcMesaj = goExecutor.cEroare
		*!*					ofrm_eroare = CREATEOBJECT('frm_mesaj',lcTitlu,lcImagine,lcTip,lcMesaj)
		*!*					ofrm_eroare.SHOW(1)
		*!*					RELEASE ofrm_eroare
		*!*				ENDIF
		*!*			ENDIF
		*!*		ENDIF
		*!*	modificare serii numere	- 10.2007	^
		Endif
	ENDPROC

	PROCEDURE grid_sort_bind
		* NU STERGE
		* SE FOLOSESTE GRIDEXTRA PENTRU SORTARE PE COLOANE
	ENDPROC

	PROCEDURE inainte_de_do_termin
		*!* 23.02.2010
		*!* INREGISTRARE INVENTAR DEFALCAT PE SUCURSALELE CORESPUNZATOARE GESTIUNILOR
		*!* CAND FAC INVENTARUL PE O SUCURSALA, POT SA ALEG DOAR GESTIUNI DIN SUCURSALA RESPECTIVA
		*!* CAND FAC INVENTARUL PE FIRMA MAMA, POT ALEGE GESTIUNI DIN MAI MULTE SUCURSALE SI TREBUIE SA SE GENEREZE NOTE SI RULAJE PE FIECARE SUCURSALA
		
		*!* 24.02.2010
		*!* marius.mutu
		*!* daca se foloseste amessagebox, nu se mai afiseaza actbaza2007.items
		
		*!* 22.03.2010
		*!* marius.mutu
		*!* note contabile defalcate si dupa subgrupa de articole (act.explicatia4)
		*!* pentru a se putea verifica notele cu listarea grupata pe subgrupe articole
		*!* + sectia din nom_gestiuni.id_sectie
		
		*!* 23.03.2010 analitice
		*!* marius.mutu
		*!* completare analitice din config_analitice
		
		*!* 15.06.2010
		*!* marius.mutu
		*!* id_sectie din lans sau din cursor
		
		*!* 21.06.2010
		*!* marius.mutu
		*!* Nu mai adaug in act linii cu suma 0 pentru golirea de stoc (au analitice/gestiuni gresite)
		
		*!* 23.03.2010
		LOCAL lcAcontD, lcAcontC, llCorectie, lnCod, lnIdFact 
		PRIVATE poActactan, poRul
		poActactan = NULL
		poRul = NULL
		*!* 23.03.2010 ^
		
		*!* 21.12.2011
		llCorectie = this.lCorectie 
		lnCod = this.nCod
		lnIdFact = this.nIdFact 
		*!* 21.12.2011 ^
		
		Private pdDataFinal, pdDataInceput
		pdDataFinal = Date()
		pdDataInceput = Date()
		
		Local lcSel, lcSchema, lcCursor, lnSucces, lcContCoresp, lVerificAnalitic, lCompletareParteneri
		Local loAct, onota, lcSql, ldDataInventar, ldDataServer
		
		Local lcCrs
		Local llReturn
		Local lnIdSet
		Local llGolireStoc
		
		lnIdSet = 90103
		llReturn = .T.
		lcCrs = This.cnumecursor
		llGolireStoc = .F.
		
		*!*	modificare	v 2.0.186
		If !Thisform.do_reface()
			Return .F.
		Endif
		*!*	modificare	v 2.0.186	^
		
		*!* VERIFIC DACA EXISTA INREGISTRARI MODIFICATE (ID_UTIL) CARE NU AU FOST VALIDATE
		*!* 21.12.2011
		IF this.lCorectie 
			SELECT crs_inventar
			LOCATE FOR EMPTY(NVL(validat,0))
			IF !FOUND()
				AMESSAGEBOX('Nu exista modificari nevalidate!',0,'Inventariere')
				Return .F.	
			ENDIF 
		ELSE 
			If This.lvalidat
				AMESSAGEBOX('Nu exista modificari nevalidate!',0,'Inventariere')
				Return .F.
			Endif
		ENDIF 		
		
		*!* 24.02.2010
		*!*	If AMESSAGEBOX([Doriti sa incheiati nota de inventariere?],4+32,_Screen.Caption) <> 6
		*!*		Return  .F.
		*!*	Endif
		
		lcTitlu = [Nota Inventariere]
		lcTip = [INTREBARE]
		lcImagine = [intreb.ico]
		lcMesaj = [Doriti sa incheiati nota de inventariere?]
		ofrm_eroare = Createobject('frm_mesaj',lcTitlu,lcImagine,lcTip,lcMesaj)
		ofrm_eroare.Show(1)
		Release ofrm_eroare
		If gnButon = 2
			Return .F.
		Endif
		*!* 24.02.2010 ^
		
		If !m.llCorectie AND This.nOptiuneInventar <> RG_INV_OPT_STOC And aMESSAGEBOX('Doriti sa goliti stocul inainte de inregistrarea inventarului?',4+32,"Inventariere") = 6
			llGolireStoc = .T.
		Endif
		
		*!*	This.Hide
		This.AlwaysOnTop = .F.
		gnButon = lans(lnIdSet)
		
		If gnButon = 2 && renunt
			This.AlwaysOnTop = .T.
		
			*!*		This.Show(1)
			Return .F.
		Endif
		
		*!* aduc toate inregistrarile de pe server (daca sunt filtrate este posibil sa nu fie pe local toate modificarile din sesiunea curenta)
		This.but_reset_criterii1.Click()
		
		lcSel = [Select * from ] + gcs + [.vrul where 1=2]
		lcSchema = ['']
		lcCursor = [rul_temp]
		
		lnSucces = goExecutor.oExecute(lcSel,lcCursor)
		If lnSucces < 0
			AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
			This.AlwaysOnTop = .T.
			*!*		This.Show(1)
			Return .F.
		Endif
		
		
		Select actactan
		Locate
		Scatter Name loAct
		&& completare actactan
		*!* 15.06.2010
		lcCrs = This.cnumecursor
		Select INT(lnCod) as cod, lnIdFact as id_fact, Cont, acont, nr_pag, id_gestiune, proc_tvav, Nvl(id_sucursala_gestiune, id_sucursala) As id_sucursala, NVL(id_sectie, loAct.id_sectie) as id_sectie, id_subgrupa, subgrupa, ;
			SUM(Round(Pret*(stoc_scriptic-stoc_faptic),gnPc)) As valoare_achizitie, ;
			SUM(Round((pretv-Pret)*(stoc_scriptic-stoc_faptic),gnPc)) As valoare_adaos, ;
			SUM(Round(tvav*(stoc_scriptic-stoc_faptic),gnPc)) As valoare_tva ;
			FROM (lcCrs) ;
			WHERE stoc_scriptic - stoc_faptic <> 0  AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie) ;
		Group By 1,2,3,4,5,6,7,8,9,10,11 ;
			ORDER By nr_pag, Cont, acont, proc_tvav ;
			INTO Cursor tcrs
		
		Select actactan
		Delete All
		
		Select tcrs
		Scan
			Scatter Name onota
			*!* 607 = 371
			Select actactan
			Append Blank
		
		
		
			If Left(Alltrim(onota.Cont),2)='34'
				lcContCoresp = '711'
			Else
				If Alltrim(onota.Cont) # '371'
					lcContCoresp = Strtran(onota.Cont, '3', '6', 1, 1)
				Else
					lcContCoresp = '607 '
				Endif
			ENDIF
			
			* obiecte de inventar in folosinta - clasa 8 nu are corespondent
			IF LEFT(onota.Cont,1) = '8'
				lcContCoresp = ''
			ENDIF 	
		
			loAct.scc = onota.Cont
			loAct.ascc = onota.acont
			loAct.id_gestout = onota.id_gestiune
			loAct.id_sucursala = onota.id_sucursala
			*!* 22.03.2010
			loAct.id_sectie = onota.id_sectie
			loAct.explicatia4 = ALLTRIM(onota.subgrupa) + ' (' + ALLTRIM(STR(onota.id_subgrupa)) + ')'
			*!* 22.03.2010 ^
				
			Select actactan
			Gather Name loAct
		
		
			Replace suma With onota.valoare_achizitie, scd With lcContCoresp
			
			*!* 378 = 371
			*!* 21.12.2011
			*!* nu se genereaza adaos si tva neexigibil decat pentru gestiuni de marfa la pret de vanzare
			If onota.nr_pag = 6 && marfa la pret de vanzare
				Select actactan
				Append Blank
				Gather Name loAct
				Replace suma With onota.valoare_adaos, scd With '378 ', proc_tva With onota.proc_tvav
				*!* 4428 = 371
				If onota.proc_tvav <> 1
					Select actactan
					Append Blank
					Gather Name loAct
					Replace suma With onota.valoare_tva, scd With '4428', proc_tva With onota.proc_tvav
				ENDIF
			Endif
			Select tcrs
		Endscan
		use in tcrs	&&	modificare	23.10.2012
		&& completare rul_temp
		
		lcCrs = This.cnumecursor
		
		*!* GOLESC STOCUL PENTRU INVENTARE FARA STOC
		If llGolireStoc
			ldDataServer = Ttod(Get_Ora())
			ldDataInventar = TTOD(this.dDataInventar)
		
			*!* daca data inventarului = data serverului - selectez din stocul curent, altfel din stocul pana la data inventarului
			TEXT TO lcSqlStoc TEXTMERGE Noshow
					select an,
					       luna,
					       id_sucursala,
					       id_articol,
					       id_gestiune,
					       id_valuta,
					       id_rul_aux,
					       serie,
					       cont,
					       acont,
					       pret,
					       pretv,
					       tva,
					       tvav,
					       proc_tvav,
					       pretd,
					       cants+cant-cante as cante,
					       <<lnIdSet>> as id_set,
					       7 as id_tip_rulaj
					  from <<IIF(ldDataServer = ldDataInventar, 'vstoc', 'vstoc_per')>>
					 where cants+cant-cante <> 0 
					   <<IIF(ldDataServer = ldDataInventar, 'and an = ' + ALLTRIM(STR(gnAn)) + ' and luna = ' + ALLTRIM(STR(gnLuna)), '')>>
					   and id_gestiune in
					   (select x
					      FROM table(cast(CHARN2COLLECTION((SELECT ID_GESTIUNI
					                                         FROM GEST_CENTR_INVENTAR
					                                        WHERE ID_C_INVENTAR =
					                                              <<this.nidcinventar>>),
					                                       '|') as num_tab)))
			ENDTEXT
		
			*!* daca data inventarului = data serverului - selectez din stocul curent, altfel din stocul pana la data inventarului
			If ldDataServer <> ldDataInventar
				lnTranzactieManuala = SQLSetprop(gnHandle,"Transactions", 2)
				If lnTranzactieManuala < 0
					Messagebox('Eroare setare tranzactie manuala la golire stoc!',0+16, _Screen.Caption)
					Return .F.
				Else
					pdDataFinal = ldDataInventar
					pdDataInceput = Date(Year(pdDataFinal), Month(pdDataFinal), 1)
		
					lcSql = [begin   pack_sesiune.set_data_init(?pdDataInceput);  pack_sesiune.set_data_final(?pdDataFinal); end;]
					lnSucces = goExecutor.oExecute(lcSql)
					If lnSucces = CT_INSUCCES
						Messagebox(goExecutor.cEroare, 0+16, _Screen.Caption)
						Return .F.
					Endif && pack_sesiune
				Endif && tranzactie manuala
			Endif && ldDataServer
		
		
		
			lnSucces = goExecutor.oExecute(lcSqlStoc, "cAnulareStoc")
			If ldDataServer <> ldDataInventar
				lnTranzactieAutomata = SQLSetprop(gnHandle,"Transactions", 1)
				If lnTranzactieAutomata < 0
					Messagebox('Eroare setare tranzactie automata la golire stoc!',0+16, _Screen.Caption)
					Return .F.
				Endif
			Endif
		
			If lnSucces = CT_INSUCCES
				Messagebox(goExecutor.cEroare,0+16, _Screen.Caption)
				Return .F.
			Else
				Select RUL_TEMP
				Append From Dbf('cAnulareStoc')
		
				*!* 21.06.2010
				&& ADAUG LINII 607 = 371 CU SUMA 0
		*!*			Select Cont, acont, proc_tvav As proc_tva, lnIdSet As id_set, id_gestiune As id_gestout, ;
		*!*				0 As suma,  Iif( Left(Alltrim(Cont),2)='34', '711', Iif(Alltrim(Cont) # '371', Strtran(Cont, '3', '6', 1, 1), '607')) As scd, ;
		*!*				cont As scc, acont As ascc, id_sucursala ;
		*!*				FROM cAnulareStoc ;
		*!*				Group By Cont, acont, id_gestiune, proc_tvav, id_sucursala ;
		*!*				ORDER By id_sucursala, Cont, acont, proc_tvav ;
		*!*				INTO Cursor cActAnulareStoc
		
		*!*			Select cActAnulareStoc
		*!*			Scan
		*!*				Scatter Name onota
		
		*!*				loAct.scd = onota.scd
		*!*				loAct.scc = onota.scc
		*!*				loAct.ascc = onota.ascc
		*!*				loAct.id_gestout = onota.id_gestout
		*!*				loAct.id_sucursala = onota.id_sucursala
		
		*!*				Insert Into actactan From Name loAct
		*!*			Endscan && cActAnulareStoc
		
		*!*			Use In (Select('cActAnulareStoc'))
				*!* 21.06.2010
				Use In (Select('cAnulareStoc'))
		
				
			Endif && cAnulareStoc
		Endif && llGolireStoc
		
		*!* STOC FAPTIC
		Insert Into RUL_TEMP(cod, id_fact, id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, cante, tvav, proc_tvav, id_set, id_rul_aux, serie, lot, adata_expirare, id_lucrare_rez, id_part_rez, id_sucursala, id_tip_rulaj) ;
			SELECT INT(lnCod) as cod, lnIdFact as id_fact, id_articol, id_gestiune, Cont, acont, Pret, pretd, ID_Valuta, pretv, stoc_scriptic-stoc_faptic As cante, tvav, proc_tvav, ;
			lnIdSet, id_rul_aux, serie, lot, adata_expirare, id_lucrare_rez, id_part_rez, ;
			NVL(id_sucursala_gestiune, id_sucursala) As id_sucursala, 6 as id_tip_rulaj ;
			From &lcCrs Where stoc_scriptic-stoc_faptic <>0 AND ((m.llCorectie AND NVL(validat,0) = 0) OR !m.llCorectie) ;
		
		lcCursor = [rul_temp]
		Select (lcCursor)
		Replace All nnir With loAct.nnir, dataact With loAct.dataact, nract With loAct.nract, serie_Act With loAct.serie_Act
		Replace All id_set With lnIdSet For Empty(id_set)
		
		
		*!* 23.03.2010 analitice
		SELECT ACTACTAN
		SCAN FOR EMPTY(NVL(ascd,'')) OR EMPTY(NVL(ascc,''))
			SELECT actactan
			SCATTER NAME poActactan
			ADDPROPERTY(poActactan, "id_gestiune", poActactan.id_gestout)
			
			poRul = CREATEOBJECT("custom")
		
			IF EMPTY(NVL(ascd,''))
				lcAcontD = do_assign_analitic(poActactan.scd, "poRul", "poActactan") && ooperatii_comune.prg
				REPLACE ascd WITH lcAcontD IN actactan
			ENDIF 	
			IF EMPTY(NVL(ascc,''))	
				lcAcontC = do_assign_analitic(poActactan.scc, "poRul", "poActactan") && ooperatii_comune.prg
				REPLACE ascc WITH lcAcontC IN actactan
			ENDIF 	
		ENDSCAN 
		*!* 23.03.2010 analitice ^
		
		&& verificare note contabile
		Select actactan
		*!* 21.12.2011
		*!* pentru corectia de inventar
		REPLACE ALL cod WITH INT(m.lnCod), id_fact WITH m.lnIdFact
		*!* 21.12.2011 ^
		Locate
		lVerificAnalitic = .T.
		lCompletareParteneri = .T.
		
		*!*			IF !INLIST(poact.id_set, 26000) && Bon de consum cu inventar
		Do Form verificare With lVerificAnalitic, lCompletareParteneri
		
		
		llReturn = gnButon = 1
		
		
		Return llReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters tnIdCInventar
		DoDefault()
		This.nidcinventar = tnIdCInventar
		This.gridextra1.Setup()
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		
	ENDPROC

	PROCEDURE Show
		*!* 31.05.2010
		*!*	marius.mutu
		*!*	colorez in albastru inregistrarile modificate/inventariate  - first_udpated_at
		
		LPARAMETERS nStyle
		*!*	modificare	v 2.0.186
		If This.nOptiuneInventar = 1 And !This.lvalidat
			This.but_reface1.Visible = .T.
		Else
			This.but_reface1.Visible = .F.
		Endif
		*!*	modificare	v 2.0.186	^
		*!*	lcSelect = ALLTRIM(This.cSelect)
		lcOrder = Alltrim(This.cOrder)
		*llAfisare = .F.
		*lcNumeCursor = This.cNumecursor
		
		*llModParam = this.lmodparam
		
		*!* INREGISTRARILE MODIFICATE VALIDATE: GRI RGB(230,230,230)
		*!* INREGISTRARILE MODIFICATE NEVALIDATE: BLUE PAL RGB(240,241,255)
		*this.grid1.SetAll("DynamicBackColor","IIF(NVL(VALIDAT,0) = 1, RGB(230,230,230), IIF(!EMPTY(NVL(ID_UTIL,0)), RGB(240,241,255), RGB(255,255,255)))","Column")
		
		*!* COLOANELE CARE SE POT MODIFICA: ALBASTRU RGB(234,249,255)
		this.grid1.cstoc_faptic.DynamicBackColor = "RGB(234,249,255)"
		this.grid1.cUzura_faptic.DynamicBackColor = "RGB(234,249,255)"
		this.grid1.cData_expirare.DynamicBackColor = "RGB(234,249,255)"
		
		
		IF this.lvalidat AND !this.lCorectie 
			this.but_nou1.Visible= .F.
			this.but_copiaza1.Visible = .F.
			this.but_stergeX.Visible = .F.
			this.but_terMIN1.Visible = .F.
		ENDIF
		
		This.grid1.cCants.Visible = .F.
		This.grid1.cCant.Visible = .F.
		This.grid1.cCante.Visible = .F.
		*This.grid1.SetAll("DynamicFontItalic","IIF(NVL(id_rul_aux,0)<>0,.T.,.F.)","Column")
		*This.grid1.SetAll("DynamicForeColor","IIF(NVL(id_rul_aux,0)<>0,RGB(128,128,128),RGB(0,0,0))","Column")
		this.grid1.cstoc_faptic.DynamicForeColor = "iif(stoc_faptic <> stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5,  RGB(255,0,0), RGB(0,0,0))"
		this.grid1.cstoc_faptic.DynamicForeColor = "iif(stoc_faptic <> stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5,  RGB(255,0,0), RGB(0,0,0))"
		*!* 31.05.2010
		this.grid1.ccodmat.DynamicForeColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(0,0,255), RGB(0,0,0))"
		this.grid1.ccodmat.DynamicBackColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(192,192,192), RGB(255,255,255))"
		this.grid1.ccodmat.DynamicFontBold = "!EMPTY(NVL(first_updated_at,{}))"
		this.grid1.cum.DynamicForeColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(0,0,255), RGB(0,0,0))"
		this.grid1.cum.DynamicBackColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(192,192,192), RGB(255,255,255))"
		this.grid1.cum.DynamicFontBold = "!EMPTY(NVL(first_updated_at,{}))"
		this.grid1.cdenumire.DynamicForeColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(0,0,255), RGB(0,0,0))"
		this.grid1.cdenumire.DynamicBackColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(192,192,192), RGB(255,255,255))"
		this.grid1.cdenumire.DynamicFontBold = "!EMPTY(NVL(first_updated_at,{}))"
		this.grid1.cnrcrt.DynamicForeColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(0,0,255), RGB(0,0,0))"
		this.grid1.cnrcrt.DynamicBackColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(192,192,192), RGB(255,255,255))"
		this.grid1.cnrcrt.DynamicFontBold = "!EMPTY(NVL(first_updated_at,{}))"
		this.grid1.ccodbare.DynamicForeColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(0,0,255), RGB(0,0,0))"
		this.grid1.ccodbare.DynamicBackColor = "iif(!EMPTY(NVL(first_updated_at,{})),  RGB(192,192,192), RGB(255,255,255))"
		this.grid1.ccodbare.DynamicFontBold = "!EMPTY(NVL(first_updated_at,{}))"
		*!* 31.05.2010 ^
		This.grid1.cResponsabil.Visible = .F.
		This.grid1.cMeserie.Visible = .F.
		This.grid1.cFormatia.Visible = .F.
		This.grid1.cDataAng.Visible = .F.
		This.grid1.cDatalic.Visible = .F.
		This.grid1.cDatapif.Visible = .F.
		This.grid1.cDns_luni.Visible = .F.
		This.grid1.cuzura_faptic.Visible = .F.
		This.grid1.cdif_dns_luni.Visible = .F.
		This.grid1.cDNF.Visible = .F.
		This.grid1.cdata_expirare.Visible = .F.
		This.respons= .F.
		This.meserie= .F.
		This.formatie= .F.
		This.dataang= .F.
		This.datalic= .F.
		This.do_executa
		IF this.Clb_tx_codbare.Visible = .f.
			this.grid1.SetFocus()
		ELSE 
			This.Clb_tx_codbare.text_simplu1.SetFocus()
		ENDIF 
		
		This.WindowState = 2
	ENDPROC

	PROCEDURE updateserver
		*!* 31.05.2010
		*!*	marius.mutu
		*!*	crs_inventar.first_updated_at - colorez liniile care au fost modificate/inventariate
		Parameters tnId, tcCol, tValue
		Local lnRecno, lcSql, lnSucces
		PRIVATE pnIdRulAux
		pnIdRulAux = 0
		If LOWER(ALLTRIM(m.tcCol)) = 'id_furnizor'
			lcSql = [begin pack_contafin.GetRulajAuxiliarFurnizor(] + TRANSFORM(tValue) + [, ?@pnIdRulAux); end;]
			lnSucces = goExecutor.oExecute(m.lcSql)
			IF m.lnSucces < 0
				AMESSAGEBOX(goExecutor.cEroare, 0+48, _screen.Caption)
				RETURN m.lnSucces 
			ELSE
				tcCol = 'id_rul_aux'	
				tValue = m.pnIdRulAux
			ENDIF 
		ENDIF 
		
		*!*	If Empty(Nvl(first_updated_at,{})) And Upper(Alltrim(tcCol)) = 'STOC_FAPTIC'
		*!*		lcSql = 'update /*+ index_ffs(gest_inventar pk_id_inventar) */ gest_inventar set id_util = ?gnIdUtil, ' + tcCol + ' = ?tValue, first_updated_at = SYSDATE where id_inventar = ' + ALLTRIM(STR(tnId))
		*!*	Else
		*!*		lcSql = 'update /*+ index_ffs(gest_inventar pk_id_inventar) */ gest_inventar set id_util = ?gnIdUtil, ' + tcCol + ' = ?tValue where id_inventar = ' + ALLTRIM(STR(tnId))
		*!*	Endif
		
		If Empty(Nvl(crs_inventar.first_updated_at,{})) And Upper(Alltrim(m.tcCol)) = 'STOC_FAPTIC'
			lcSql = 'update gest_inventar set id_util = ?gnIdUtil, ' + tcCol + ' = ?tValue, first_updated_at = SYSDATE where id_inventar = ' + ALLTRIM(STR(m.tnId))
		Else
			lcSql = 'update gest_inventar set id_util = ?gnIdUtil, ' + tcCol + ' = ?tValue where id_inventar = ' + ALLTRIM(STR(m.tnId))
		ENDIF
		
		lnSucces = goExecutor.oExecute(lcSql)
		If lnSucces < 0
			aMESSAGEBOX(goExecutor.cEroare, 0+16, _Screen.Caption)
		Else
			*!* 31.05.2010
			If Empty(Nvl(crs_inventar.first_updated_at,{})) And Upper(Alltrim(m.tcCol)) = 'STOC_FAPTIC'
				Replace first_updated_at With Datetime() In crs_inventar
			Endif
		Endif
		Thisform.do_executa
		Return lnSucces
		
		
		
	ENDPROC

	PROCEDURE validcantitate		&& Valideaza cantitatea - sa nu fie prea mare - daca se citeste codul de bare pe coloanele stoc faptic
		LPARAMETERS tnCantitate
		
		LOCAL lnMaxCantitate, llValid
		llValid = .T.
		lnMaxCantitate = thisform.nMaxCantitate 
		IF m.lnMaxCantitate > 0
			IF tnCantitate > m.lnMaxCantitate
				llValid = .F.
			ENDIF 
		ENDIF 
		
		IF !m.llValid
			AMESSAGEBOX('Cantitate invalida!',0+48, _screen.Caption)
		ENDIF 	
		
		RETURN llValid
	ENDPROC

	PROCEDURE validpret		&& valideaza pretul - sa nu fie pret prea mare - citire cod de bare pe coloana pret
		Lparameters tnPret
		
		Local lnMaxPret, llValid
		llValid = .T.
		lnMaxPret = Thisform.nMaxCantitate
		If m.lnMaxPret > 0
			If tnPret > m.lnMaxPret
				llValid = .F.
			Endif
		Endif
		If !m.llValid
			AMESSAGEBOX('Pret invalid!',0+48, _Screen.Caption)
		Endif
		
		Return llValid
		
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		Parameters tacriterii
		External Array tacriterii
		*!*	#Define crlf Chr(13)+Chr(10)
		lcStringCriterii="Denumire articol\denumire\T\id_articol\nom_articol"+ crlf + ;
			"Cod material\codmat\T\none\"+ crlf + ;
			"Cod bare\codbare\T\none\"+ crlf + ;
			"Pret achizitie\pret\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret vanzare\pretv+tvav\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret valuta\pretd\N|get_mask(12,gnPPretval)\none\" + crlf + ;
			"Cont\cont\T\none\" + crlf + ;
			"Analitic\acont\T\none\" + crlf + ;
			"Gestiune\id_gestiune\I\id_gestiune\nom_gestiune" + crlf + ;
			"Grupa articol\none\I\id_grupa\nom_grupa_articol"+ crlf + ;
			"Subgrupa articol\none\I\id_subgrupa\nom_subgrupa_articol"+ crlf
		If (Thisform.Validat)
			lcStringCriterii=lcStringCriterii+"Validat\nofiled\E\ validat=1\" + crlf
		Endif
		If (Thisform.nevalidat)
			lcStringCriterii=lcStringCriterii+	"Nevalidat\nofiled\E\ validat=0\" + crlf
		Endif
		If (Thisform.grupegest)
			lcStringCriterii=lcStringCriterii+"Grupe gestiuni\|E|" + ;
				[id_gestiune in ( ] + ;
				[ select ID_GESTIUNE ] + ;
				[	from vgest_coresp_grupe_gestiuni] + ;
				[       where id_grupe = <<VALOARE>>)] + ;
				[\I\none\nom_grupa_gestiune] + crlf
		Endif
		lcStringCriterii=lcStringCriterii+"Stoc scriptic\stoc_scriptic\N\none\" + crlf + ;
			"Stoc faptic\stoc_faptic\N\none\" + crlf + ;
			"Diferenta\stoc_faptic-stoc_scriptic\N\none\" + crlf + ;
			"Data intrare\datain\D\none\" + crlf + ;
			"Data PIF\datapif\D\none\" + crlf + ;		
			"Lucrare rezervare\nrord_rez\T\ID_LUCRARE_REZ\nom_lucrare" + crlf + ;
			"Partener rezervare\part_rez\T\id_part_rez\nom_parteneri" + crlf + ;
		    "Inventariat\nofiled\A\Inventariat,Neinventariat,Toate" + ;
			"#first_updated_at is not null,first_updated_at is null,1=1\" + crlf
			 
		If Thisform.respons
			lcStringCriterii=lcStringCriterii +	"Responsabil\responsabil\T\id_responsabil\nom_responsabil" + crlf + ;
				"Meserie\meserie\T\id_meserie\nom_meserie" + crlf + ;
				"Formatie\formatia\T\id_formatia\nom_formatie" + crlf + ;
				"Data angajarii\dataang\D\none\" + crlf + ;
				"Data plecarii\datalic\D\none\"
		Endif
		
		DoDefault()
		*	"An prod\an_prod\N\none\" + crlf + ;
		ENDPROC
		
	ENDPROC

	PROCEDURE Clb_tx_codbare.Text_simplu1.GotFocus
		this.BackColor = RGB(0,255,255)
		
	ENDPROC

	PROCEDURE Clb_tx_codbare.Text_simplu1.LostFocus
		this.BackColor = RGB(255,255,255)
		
		*!*	goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' txtCodBare LostFocus')
		thisform.do_cauta_codbare()
	ENDPROC

	PROCEDURE Grid1.AfterRowColChange
		*!* 22.02.2010
		*!* marius.mutu
		*!* la adaugarea unui articol nou prin citirea codului de bare - sa se preia ultima gestiune, cota_tva
		
		*!* 21.12.2011
		*!* marius.mutu
		*!* daca este corectie de inventar si o inregistrare nu este validata, se poate modifica stocul scriptic!!!
		
		Lparameters nColIndex
		
		LOCAL llInregistrareValidata
		
		*!* 22.02.2010
		Thisform.nproc_tvav = crs_inventar.proc_tvav
		*thisform.nId_gestiune = crs_inventar.id_gestiune
		*!* 22.02.2010 ^
		
		*!* 21.12.2011
		llCorectie = thisform.lCorectie 
		llInregistrareValidata = Nvl(crs_inventar.Validat,0) = 1
		Thisform.lInregistrareValidata = m.llInregistrareValidata
		Thisform.grid1.cstocscriptic.ReadOnly = !(m.llCorectie and !m.llInregistrareValidata and NVL(crs_inventar.stoc_scriptic, 0) = 0)
		*!* 21.12.2011
		
	ENDPROC

	PROCEDURE Grid1.cAcont.Text1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
	ENDPROC

	PROCEDURE Grid1.cAcont.Text1.LostFocus
		Local lnId, lcAcont
		lnId = crs_inventar.id_inventar
		lcAcont = Alltrim(NVL(crs_inventar.acont,''))
		
		Thisform.UpdateServer(m.lnId, 'acont', m.lcAcont)
		
		
	ENDPROC

	PROCEDURE Grid1.cAcont.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
			
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cCgest.Text1.Click
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		 	
		
		IF stoc_scriptic <> 0
			RETURN .F.
		ENDIF 
		
		thisform.do_cauta_gestiune(.T.)
	ENDPROC

	PROCEDURE Grid1.cCgest.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
			
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.LostFocus
		Local lnId, lcCont
		lnId = crs_inventar.id_inventar
		lcCont = Alltrim(NVL(crs_inventar.cont,''))
		
		Thisform.UpdateServer(m.lnId, 'cont', m.lcCont)
		
		
	ENDPROC

	PROCEDURE Grid1.ccont.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cData_expirare.Text1.GotFocus
		*!*	modificare	15.08.2007
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
			This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		Endif
		*!*	modificare	15.08.2007	^
	ENDPROC

	PROCEDURE Grid1.cData_expirare.Text1.LostFocus
		IF EMPTY(this.value)
			WAIT WINDOW "Completati data expirarii !"
			this.value = thisform.nValue 
			RETURN 
		ENDIF 
		
		IF NVL(thisform.nvalue,{//::}) # NVL(this.value,{//::})
			* lnDNS_LUNI_FAPTIC =  ROUND(dnf *(100-uzura_faptic)/100, 0)
			lnDNS_LUNI_FAPTIC = (YEAR(data_expirare)*12+MONTH(data_expirare)) - (gnAn*12+gnLuna)
			
			lnUzura_faptic = IIF(DNF = 0, 0, round((dnf - lnDNS_LUNI_FAPTIC) / dnf * 100, 0))	
			REPLACE uzura_faptic WITH lnUzura_faptic
			
			lnId = crs_inventar.id_inventar
			thisform.UpdateServer(lnId,'uzura_faptic', lnUzura_faptic)
			thisform.UpdateServer(lnId,'dns_luni_faptic', lnDNS_LUNI_FAPTIC)	
		ENDIF
	ENDPROC

	PROCEDURE Grid1.cData_expirare.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF
		thisform.nValue = this.Value
		
	ENDPROC

	PROCEDURE Grid1.cFirstUpdatedAt.Text1.LostFocus
		Local lnId, ldFirstUpdatedAt
		lnId = crs_inventar.id_inventar
		ldFirstUpdatedAt = IIF(EMPTY(NVL(crs_inventar.first_updated_at, {})), null, crs_inventar.first_updated_at)
		
		*!*	If m.lcSerie <> NVL(Thisform.nvalue, '')
		Thisform.UpdateServer(m.lnId, 'first_updated_at', m.ldFirstUpdatedAt)
		*!*	Endif
		
	ENDPROC

	PROCEDURE Grid1.cFirstUpdatedAt.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF
		thisform.nValue = this.Value
	ENDPROC

	PROCEDURE Grid1.cFurnizor.Text1.Click
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		 	
		
		IF stoc_scriptic <> 0
			RETURN .F.
		ENDIF 
		
		thisform.do_cauta_furnizor()
	ENDPROC

	PROCEDURE Grid1.cFurnizor.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF
			
	ENDPROC

	PROCEDURE Grid1.cPretcTVA.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cPretcTVA.Text1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
	ENDPROC

	PROCEDURE Grid1.cPretcTVA.Text1.LostFocus
		Local lnPretCtvav, lnId
		Local lnPretv,lntvav
		
		Select crs_inventar
		lnPretCtvav = crs_inventar.pretctvav
		lnId = crs_inventar.id_inventar
		
		If lnPretCtvav < 0
			Replace pretctvav With 0
		Endif
		*IF thisform.nValue <> m.lnPretCtvav
		If proc_tvav  <> 0
			lntvav = Round(((proc_tvav -1)/proc_tvav)* m.lnPretCtvav, gnPPretV)
		Else
			lntvav = 0
		Endif
		
		lnPretv = m.lnPretCtvav - m.lntvav
		REPLACE pretv WITH lnPretv, tvav WITH m.lnTvav
		
		Thisform.UpdateServer(lnId,'tvav', m.lntvav)
		Thisform.UpdateServer(lnId,'Pretv', m.lnPretv )
		*ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cPretcTVA.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidPret(crs_inventar.pretctvav)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cPretcTVA.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
			
		thisform.nvalue = crs_inventar.pretctvav
		
	ENDPROC

	PROCEDURE Grid1.cPret_unitar.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cPret_unitar.Text1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
	ENDPROC

	PROCEDURE Grid1.cPret_unitar.Text1.KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		
		IF nKeyCode = 13 And crs_inventar.stoc_faptic <> 0
			Nodefault
			Thisform.Clb_tx_codbare.text_simplu1.SetFocus()
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cPret_unitar.Text1.LostFocus
		If This.Value < 0
			Select crs_inventar
			Replace Pret With Thisform.nvalue
		Endif
		*!*		IF THISFORM.nvalue # THIS.VALUE
		lnId = crs_inventar.id_inventar
		Thisform.UpdateServer(lnId,'pret',This.Value)
		*!*		ENDIF
		
		
	ENDPROC

	PROCEDURE Grid1.cPret_unitar.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv.Text1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
		
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv.Text1.LostFocus
		Local lnProcTvav, lnPretv,lntvav, lnId
		
		Select crs_inventar
		lnProcTvav = proc_tvav
		lnId = id_inventar
		
		Do Case
			Case m.lnProcTvav < 0
				Replace proc_tvav With Thisform.nvalue
				lnProcTvav = proc_tvav
			Case m.lnProcTvav >= 2 && 9 in loc de 1.09, 1.19 etc.
				Replace proc_tvav With 1 + Round(This.Value/100,2)
				lnProcTvav = proc_tvav
		Endcase
		*		If Thisform.nvalue # m.lnProcTvav
		If m.lnProcTvav  <> 0
			lntvav = Round(((This.Value-1)/This.Value)* pretctvav  ,gnPPretV)
			lnPretv = pretctvav  - lntvav
		Else
			lntvav = 0
			lnPretv = pretctvav
		Endif
		REPLACE tvav WITH lnTvav, pretv WITH lnPretv
		
		Thisform.UpdateServer(lnId,'proc_tvav', lnProcTvav)
		Thisform.UpdateServer(lnId,'tvav', lntvav)
		Thisform.UpdateServer(lnId,'Pretv', lnPretv )
		*		Endif
		
		
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv.Text1.Valid
		LOCAL lnProcTvav
		lnProcTvav = crs_inventar.proc_tvav
		SELECT cote_tva
		LOCATE FOR proc_tva = m.lnProcTvav
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF 	
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv._combobox1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
		this.Enabled = stoc_scriptic = 0
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv._combobox1.LostFocus
		Local lnProcTvav, lnPretv,lntvav, lnId
		
		Select crs_inventar
		lnProcTvav = proc_tvav
		lnId = id_inventar
		
		*!*	Do Case
		*!*		Case m.lnProcTvav < 0
		*!*			Replace proc_tvav With Thisform.nvalue
		*!*			lnProcTvav = proc_tvav
		*!*		Case m.lnProcTvav >= 2 && 9 in loc de 1.09, 1.19 etc.
		*!*			Replace proc_tvav With 1 + Round(This.Value/100,2)
		*!*			lnProcTvav = proc_tvav
		*!*	Endcase
		*		If Thisform.nvalue # m.lnProcTvav
		If m.lnProcTvav  <> 0
			lntvav = Round(((This.Value-1)/This.Value)* pretctvav  ,gnPPretV)
			lnPretv = pretctvav  - lntvav
		Else
			lntvav = 0
			lnPretv = pretctvav
		Endif
		REPLACE tvav WITH lnTvav, pretv WITH lnPretv
		
		Thisform.UpdateServer(lnId,'proc_tvav', m.lnProcTvav)
		Thisform.UpdateServer(lnId,'tvav', m.lntvav)
		Thisform.UpdateServer(lnId,'Pretv', m.lnPretv )
		*		Endif
		
	ENDPROC

	PROCEDURE Grid1.cProc_TVAv._combobox1.When
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
			
		thisform.nvalue = crs_inventar.proc_tvav
		
	ENDPROC

	PROCEDURE Grid1.cSerie.Text1.GotFocus
		*!* 15.04.2010
		*!* marius.mutu
		*!* daca inregistrarea provine din stoc (stoc scriptic <> 0) nu se poate modifica decat stocul faptic
		*!* doar la inventarul initial stoc scriptic = 0
		
		This.Parent.ReadOnly = stoc_scriptic <> 0
		This.ReadOnly = stoc_scriptic <> 0
	ENDPROC

	PROCEDURE Grid1.cSerie.Text1.LostFocus
		Local lnId
		lnId = crs_inventar.id_inventar
		lcSerie = Alltrim(NVL(crs_inventar.serie,''))
		
		*!*	If m.lcSerie <> NVL(Thisform.nvalue, '')
		Thisform.UpdateServer(m.lnId, 'serie', m.lcSerie)
		*!*	Endif
		
	ENDPROC

	PROCEDURE Grid1.cSerie.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
			
		thisform.nvalue = this.Value 
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic1.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cStocFaptic1.Text1.GotFocus
		*!*	goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' GotFocus stoc_faptic_1 this.Value ' + STR(this.value))
		
		This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic1.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nkeycode = 13 AND this.Value <> 0
			Thisform.Clb_tx_codbare.SetFocus()
		ENDIF 	
	ENDPROC

	PROCEDURE Grid1.cStocFaptic1.Text1.LostFocus
		*!* 14.08.2009
		*!* marius.mutu
		*!* stoc_faptic este suma(stoc_faptic1..stoc_faptic5) 
		
		*!* 04.09.2009
		*!*	marius.mutu
		*!*	focus pe codbare
		*!*	goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' LostFocus stoc_faptic_1 this.Value ' + STR(this.value))
		
		*!* 13.04.2010
		*!* marius.mutu
		*!* nu se mai actualizeaza stoc_faptic.. stoc_faptic5 pe baza diferentei dintre valoarea initiala si valoarea finala
		
		*!* 10.02.2012
		*!* marius.mutu
		*!* daca este corectie de inventar, permit si stoc negativ
		
		IF THIS.VALUE < 0
			*!* 10.02.2012
			IF !thisform.lCorectie 
			*!* 10.02.2012 ^
				SELECT crs_inventar
				REPLACE stoc_faptic1 WITH THISFORM.nvalue
			ENDIF 	
		ELSE
		*	IF THISFORM.nvalue # THIS.VALUE
				lnId = crs_inventar.id_inventar
				THISFORM.UpdateServer(lnId,'stoc_faptic1',THIS.VALUE)
				*!* 14.08.2009		
				SELECT crs_inventar
		*!*			REPLACE stoc_faptic WITH stoc_faptic + this.Value - THISFORM.nvalue
				REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
				THISFORM.UpdateServer(lnId,'stoc_faptic', crs_inventar.stoc_faptic)		
				*!* 14.08.2009 ^
				
				*!* 04.09.2009
		*!*			thisform.Clb_tx_codbare.SetFocus()
				*!* 04.09.2009 ^
		*	ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic1.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidCantitate(crs_inventar.stoc_faptic1)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic1.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
			
		thisform.nvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic2.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cStocFaptic2.Text1.GotFocus
		This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic2.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nkeycode = 13 AND this.Value <> 0
			Thisform.Clb_tx_codbare.SetFocus()
		ENDIF 	
	ENDPROC

	PROCEDURE Grid1.cStocFaptic2.Text1.LostFocus
		*!* 14.08.2009
		*!* marius.mutu
		*!* stoc_faptic este suma(stoc_faptic1..stoc_faptic5) 
		
		*!* 04.09.2009
		*!*	marius.mutu
		*!*	focus pe codbare
		
		*!* 13.04.2010
		*!* marius.mutu
		*!* nu se mai actualizeaza stoc_faptic.. stoc_faptic5 pe baza diferentei dintre valoarea initiala si valoarea finala
		
		IF THIS.VALUE < 0
			SELECT crs_inventar
			REPLACE stoc_faptic2 WITH THISFORM.nvalue
		ELSE
		*	IF THISFORM.nvalue # THIS.VALUE
				lnId = crs_inventar.id_inventar
				THISFORM.UpdateServer(lnId,'stoc_faptic2',THIS.VALUE)
				*!* 14.08.2009		
				SELECT crs_inventar
		*!*			REPLACE stoc_faptic WITH stoc_faptic + this.Value - THISFORM.nvalue
		*!*			REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5 + (this.Value - THISFORM.nvalue)
				REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
				THISFORM.UpdateServer(lnId,'stoc_faptic', crs_inventar.stoc_faptic)		
				*!* 14.08.2009 ^
		
				*!* 04.09.2009
		*!*			thisform.Clb_tx_codbare.SetFocus()
				*!* 04.09.2009 ^		
		*	ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic2.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidCantitate(crs_inventar.stoc_faptic2)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic2.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
		thisform.nvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic3.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cStocFaptic3.Text1.GotFocus
		This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic3.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nkeycode = 13 AND this.Value <> 0
			Thisform.Clb_tx_codbare.SetFocus()
		ENDIF 	
	ENDPROC

	PROCEDURE Grid1.cStocFaptic3.Text1.LostFocus
		*!* 14.08.2009
		*!* marius.mutu
		*!* stoc_faptic este suma(stoc_faptic1..stoc_faptic5) 
		
		*!* 04.09.2009
		*!*	marius.mutu
		*!*	focus pe codbare
		
		*!* 13.04.2010
		*!* marius.mutu
		*!* nu se mai actualizeaza stoc_faptic.. stoc_faptic5 pe baza diferentei dintre valoarea initiala si valoarea finala
		
		
		IF THIS.VALUE < 0
			SELECT crs_inventar
			REPLACE stoc_faptic3 WITH THISFORM.nvalue
		ELSE
		*	IF THISFORM.nvalue # THIS.VALUE
				lnId = crs_inventar.id_inventar
				THISFORM.UpdateServer(lnId,'stoc_faptic3',THIS.VALUE)
				*!* 14.08.2009		
				SELECT crs_inventar
		*!*			REPLACE stoc_faptic WITH stoc_faptic + this.Value - THISFORM.nvalue
		*!*			REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic4 + stoc_faptic5 + (this.Value - THISFORM.nvalue)
				REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
				THISFORM.UpdateServer(lnId,'stoc_faptic', crs_inventar.stoc_faptic)		
				*!* 14.08.2009 ^
		
				*!* 04.09.2009
		*!*			thisform.Clb_tx_codbare.SetFocus()
				*!* 04.09.2009 ^		
		*	ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic3.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidCantitate(crs_inventar.stoc_faptic3)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic3.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
		thisform.nvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic4.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cStocFaptic4.Text1.GotFocus
		This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic4.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nkeycode = 13 AND this.Value <> 0
			Thisform.Clb_tx_codbare.SetFocus()
		ENDIF 	
	ENDPROC

	PROCEDURE Grid1.cStocFaptic4.Text1.LostFocus
		*!* 14.08.2009
		*!* marius.mutu
		*!* stoc_faptic este suma(stoc_faptic1..stoc_faptic5) 
		
		*!* 04.09.2009
		*!*	marius.mutu
		*!*	focus pe codbare
		
		*!* 13.04.2010
		*!* marius.mutu
		*!* nu se mai actualizeaza stoc_faptic.. stoc_faptic5 pe baza diferentei dintre valoarea initiala si valoarea finala
		
		IF THIS.VALUE < 0
			SELECT crs_inventar
			REPLACE stoc_faptic4 WITH THISFORM.nvalue
		ELSE
		*	IF THISFORM.nvalue # THIS.VALUE
				lnId = crs_inventar.id_inventar
				THISFORM.UpdateServer(lnId,'stoc_faptic4',THIS.VALUE)
				*!* 14.08.2009		
				SELECT crs_inventar
		*!*			REPLACE stoc_faptic WITH stoc_faptic + this.Value - THISFORM.nvalue
		*		REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic5 + (this.Value - THISFORM.nvalue)
				REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
				THISFORM.UpdateServer(lnId,'stoc_faptic', crs_inventar.stoc_faptic)		
				*!* 14.08.2009 ^
				*!* 04.09.2009
		*!*			thisform.Clb_tx_codbare.SetFocus()
				*!* 04.09.2009 ^
		*	ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic4.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidCantitate(crs_inventar.stoc_faptic4)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic4.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
		thisform.nvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic5.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cStocFaptic5.Text1.GotFocus
		This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic5.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nkeycode = 13 AND this.Value <> 0
			Thisform.Clb_tx_codbare.SetFocus()
		ENDIF 	
	ENDPROC

	PROCEDURE Grid1.cStocFaptic5.Text1.LostFocus
		*!* 14.08.2009
		*!* marius.mutu
		*!* stoc_faptic este suma(stoc_faptic1..stoc_faptic5) 
		
		*!* 04.09.2009
		*!*	marius.mutu
		*!*	focus pe codbare
		
		*!* 13.04.2010
		*!* marius.mutu
		*!* nu se mai actualizeaza stoc_faptic.. stoc_faptic5 pe baza diferentei dintre valoarea initiala si valoarea finala
		
		IF THIS.VALUE < 0
			SELECT crs_inventar
			REPLACE stoc_faptic5 WITH THISFORM.nvalue
		ELSE
		*	IF THISFORM.nvalue # THIS.VALUE
				lnId = crs_inventar.id_inventar
				THISFORM.UpdateServer(lnId,'stoc_faptic5',THIS.VALUE)
				*!* 14.08.2009		
				SELECT crs_inventar
		*!*			REPLACE stoc_faptic WITH stoc_faptic + this.Value - THISFORM.nvalue
		*!*			REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + (this.Value - THISFORM.nvalue)
				REPLACE stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
				THISFORM.UpdateServer(lnId,'stoc_faptic', crs_inventar.stoc_faptic)		
				*!* 14.08.2009 ^
				*!* 04.09.2009
		*!*			thisform.Clb_tx_codbare.SetFocus()
				*!* 04.09.2009 ^
		*	ENDIF
		ENDIF
		
	ENDPROC

	PROCEDURE Grid1.cStocFaptic5.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidCantitate(crs_inventar.stoc_faptic5)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cStocFaptic5.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
		
		thisform.nvalue = this.Value 
	ENDPROC

	PROCEDURE Grid1.cStocScriptic.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cStocScriptic.Text1.LostFocus
		*!* 21.12.2011
		IF thisform.lInregistrarevalidata
			RETURN .F.
		ENDIF 	
		IF !thisform.lCorectie 
			RETURN .F.
		ENDIF 
		
		Local lnStocScriptic, lnId, lnCant
		
		Select crs_inventar
		lnStocScriptic = NVL(crs_inventar.stoc_scriptic, 0)
		lnId = crs_inventar.id_inventar
		
		lnCant = m.lnStocScriptic - (cants + cant - cante)
		REPLACE cant WITH m.lnCant
		
		Thisform.UpdateServer(lnId,'cant', m.lnCant)
		*!* 21.12.2011 ^
	ENDPROC

	PROCEDURE Grid1.cStocScriptic.Text1.When
		*!* NU SE POATE MODIFICA STOCUL SCRIPTIC DECAT LA O INREGISTRARE NEVALIDATA SI DOAR DACA ESTE CORECTIE DE INVENTAR (ADICA O INREGISTRARE ADAUGATA)
		*!* 21.12.2011
		*!*	thisform.lvalidat
		If Thisform.lInregistrarevalidata
			Return .F.
		Endif
		If !Thisform.lCorectie
			Return .F.
		Endif
		*!* 21.12.2011 ^
		
		Thisform.nvalue = Nvl(crs_inventar.stoc_scriptic, 0)
		
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.Click
		THIS.SelStart =  0
		THIS.SelLength = 100
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.GotFocus
		*!*	goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' GotFocus ' + STR(crs_inventar.stoc_faptic))
		
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nkeycode = 13 AND this.value <> 0
		*	Nodefault
			Thisform.Clb_tx_codbare.SetFocus()
		ENDIF 	
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.LostFocus
		*!* 14.08.2009
		*!* marius.mutu
		*!* suma(stoc_faptic1..stoc_faptic5) trebuie sa fie egale cu stoc_faptic
		
		*!* 04.09.2009
		*!*	marius.mutu
		*!*	focus pe codbare
		*!*	goLog.Log(ALLTRIM(crs_inventar.codbare) + ' ' + ALLTRIM(crs_inventar.denumire) + ' LostFocus this.Value ' + STR(this.value))
		
		*!* 13.04.2010
		*!* marius.mutu
		*!* nu se mai actualizeaza stoc_faptic.. stoc_faptic5 pe baza diferentei dintre valoarea initiala si valoarea finala
		
		If This.Value < 0
			Select crs_inventar
			Replace stoc_faptic With stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
		Else
			*!* 13.04.2010
			*	IF THISFORM.nvalue # THIS.VALUE
			lnId = crs_inventar.id_inventar
		
			*!* 14.08.2009
			Select crs_inventar
			If stoc_faptic = 0
				Replace stoc_faptic1 With 0, stoc_faptic2 With 0, stoc_faptic3 With 0, stoc_faptic4 With 0, stoc_faptic5 With 0
			Else
				If stoc_faptic < stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
					aMessagebox('Nu puteti introduce o cantitate mai mica decat suma cantitatilor 1..5' + Chr(13) + 'Modificati cantitatile 1..5!',0+48, _Screen.Caption)
					Replace stoc_faptic WITH stoc_faptic1 + stoc_faptic2 + stoc_faptic3 + stoc_faptic4 + stoc_faptic5
					this.Refresh()
				Else
					Replace stoc_faptic1 With stoc_faptic - stoc_faptic2 - stoc_faptic3 - stoc_faptic4 - stoc_faptic5
				Endif
			Endif
		
			Thisform.UpdateServer(lnId,'stoc_faptic', crs_inventar.stoc_faptic)
			Thisform.UpdateServer(lnId,'stoc_faptic1', crs_inventar.stoc_faptic1)
			Thisform.UpdateServer(lnId,'stoc_faptic2', crs_inventar.stoc_faptic2)
			Thisform.UpdateServer(lnId,'stoc_faptic3', crs_inventar.stoc_faptic3)
			Thisform.UpdateServer(lnId,'stoc_faptic4', crs_inventar.stoc_faptic4)
			Thisform.UpdateServer(lnId,'stoc_faptic5', crs_inventar.stoc_faptic5)
			*!* 14.08.2009 ^
		
			*!* 04.09.2009
		*!*		Thisform.Clb_tx_codbare.SetFocus()
			*!* 04.09.2009 ^
			*	ENDIF
			*!* 13.04.2010 ^
		Endif
		
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.Valid
		LOCAL llValid
		llValid = Thisform.ValidCantitate(crs_inventar.stoc_faptic)
		IF !llValid
			RETURN 0
		ENDIF 
	ENDPROC

	PROCEDURE Grid1.cstoc_faptic.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		
		*!* 21.12.2011
		*!*	thisform.lvalidat
		IF thisform.lInregistrarevalidata 
			RETURN .F.
		ENDIF 	
		*!* 21.12.2011 ^
			
		thisform.nvalue = crs_inventar.stoc_faptic 
		
	ENDPROC

	PROCEDURE Grid1.cUzura_faptic.Text1.GotFocus
		*!*	modificare	15.08.2007
		If !Thisform.linventarroavin
			This.Parent.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
			This.ReadOnly = Iif(id_rul_aux<>0,.T.,.F.)
		Endif
		*!*	modificare	15.08.2007	^
	ENDPROC

	PROCEDURE Grid1.cUzura_faptic.Text1.LostFocus
		IF NVL(thisform.nvalue,0) # this.Value 
			lnDNS_LUNI_FAPTIC =  ROUND(dnf *(100-uzura_faptic)/100, 0)
			lnUzura_faptic = IIF(DNF = 0, 0, round((dnf - lnDNS_LUNI_FAPTIC) / dnf * 100, 0))	
			REPLACE uzura_faptic WITH lnUzura_faptic
			
			lnId = crs_inventar.id_inventar
			thisform.UpdateServer(lnId,'uzura_faptic', lnUzura_faptic)
			thisform.UpdateServer(lnId,'dns_luni_faptic', lnDNS_LUNI_FAPTIC)	
		ENDIF
	ENDPROC

	PROCEDURE Grid1.cUzura_faptic.Text1.When
		*!* NU SE POATE MODIFICA O INREGISTRARE VALIDATA
		IF thisform.lvalidat
			RETURN .F.
		ENDIF
		thisform.nvalue = this.Value
		
	ENDPROC

	PROCEDURE Gridextra1.applyfilter
		DODEFAULT()
		thisform.do_executa()
	ENDPROC

	PROCEDURE Gridextra1.clearfilter
		DODEFAULT()
		thisform.do_executa()
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="clb_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_serie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_acont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_pret" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Tx_tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.cb_cota_tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_PretValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_Valuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_Valuta.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_articol" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_part_rez" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_nrord_rez" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_furnizor" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_obinv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_obinv.Tx_datapif" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_obinv.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_obinv.txtDnf" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_obinv.Label3" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: alege_gestiune
		*m: do_cauta_articol
		*m: do_cauta_furnizor
		*m: do_cauta_lucrare_rez
		*m: do_cauta_part_rez
		*p: dnf
		*p: lcopiere
		*p: lobinv
		*p: npretvtva
		*p: obj
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		dnf = 0
		DoCreate = .T.
		Height = 485
		lcopiere = .F.
		lobinv = .F.
		Name = "new_inventar"
		npretvtva = 0
		obj = 
		Width = 375
		_memberdata = <VFPData>
			<memberdata name="lcopiere" display="lCopiere"/>
		</VFPData>
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 0
		_shape2.Height = 29
		_shape2.Left = 310
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 65
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "Adaugare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 17
		Lb_titlu_alb_b121.ZOrderSet = 2
		BUT_TERMIN1.Left = 343
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 15
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 3
		GRIDSORT1.Left = 324
		GRIDSORT1.Name = "GRIDSORT1"
		GRIDSORT1.Top = 144
		But_renunt1.Left = 313
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 16
		But_renunt1.Top = 1
		But_renunt1.ZOrderSet = 5
	*</PropValue>

	ADD OBJECT 'Clb_acont' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_acont", ;
		TabIndex = 6, ;
		Top = 155, ;
		Width = 294, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.ControlSource = "oinv.acont", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Analitic", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_cont' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_cont", ;
		TabIndex = 5, ;
		Top = 127, ;
		Width = 294, ;
		ZOrderSet = 7, ;
		TEXT_SIMPLU1.ControlSource = "oinv.cont", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Cont", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_gestiune' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "clb_gestiune", ;
		TabIndex = 2, ;
		Top = 65, ;
		Width = 358, ;
		ZOrderSet = 6, ;
		_CBBASE1.ColumnCount = 2, ;
		_CBBASE1.ColumnWidths = "250,100", ;
		_CBBASE1.ControlSource = "oinv.nume_gestiune", ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 70, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "crsGestiuni.nume_gestiune,cgest", ;
		_CBBASE1.RowSourceType = 2, ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Width = 286, ;
		_LBBASE1.Caption = "Gestiune", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_obinv' AS cb_tx_simplu WITH ;
		Height = 85, ;
		Left = 234, ;
		Name = "Clb_obinv", ;
		TabIndex = 12, ;
		Top = 303, ;
		Visible = .F., ;
		Width = 335, ;
		ZOrderSet = 18, ;
		_cbbase1.ColumnWidths = "300", ;
		_cbbase1.ControlSource = "oinv.responsabil", ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 122, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "", ;
		_cbbase1.RowSourceType = 2, ;
		_cbbase1.TabIndex = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 206, ;
		_lbbase1.Caption = "Responsabil", ;
		_lbbase1.Left = 8, ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 4
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_obinv.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Data dare in folosinta", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label2", ;
		TabIndex = 6, ;
		Top = 34, ;
		Width = 119
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_obinv.Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Durata normata de functionare", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label3", ;
		TabIndex = 8, ;
		Top = 61, ;
		Width = 169
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_obinv.Tx_datapif' AS textbox WITH ;
		ControlSource = "oinv.datapif", ;
		Format = "K", ;
		Height = 23, ;
		Left = 197, ;
		Name = "Tx_datapif", ;
		TabIndex = 2, ;
		Top = 28, ;
		Width = 130
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Clb_obinv.txtDnf' AS textbox WITH ;
		ControlSource = "oinv.dnf", ;
		Format = "K", ;
		Height = 23, ;
		InputMask = "", ;
		Left = 197, ;
		Name = "txtDnf", ;
		ReadOnly = .T., ;
		TabIndex = 7, ;
		TabStop = .F., ;
		Top = 55, ;
		Width = 130
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Clb_pret' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_pret", ;
		TabIndex = 7, ;
		Top = 183, ;
		Width = 294, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pret", ;
		TEXT_SIMPLU1.InputMask = (get_mask(9,gnPpret)), ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Pret achizitie", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_PretValuta' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_PretValuta", ;
		TabIndex = 8, ;
		Top = 211, ;
		Width = 294, ;
		ZOrderSet = 12, ;
		Text_simplu1.ControlSource = "oinv.Pretd", ;
		Text_simplu1.InputMask = (get_mask(16,gnPPretVAL)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Lb_simplu1.Caption = "Pret valuta", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_serie' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_serie", ;
		TabIndex = 3, ;
		Top = 99, ;
		Width = 195, ;
		ZOrderSet = 8, ;
		Text_simplu1.ControlSource = "oinv.serie", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 52, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 139, ;
		Lb_simplu1.Caption = "Serie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 203, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 4, ;
		Top = 99, ;
		Width = 163, ;
		ZOrderSet = 8, ;
		Text_simplu1.ControlSource = "oinv.lot", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 38, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 120, ;
		Lb_simplu1.Caption = "Lot", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_Valuta' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_Valuta", ;
		TabIndex = 9, ;
		Top = 239, ;
		Width = 294, ;
		ZOrderSet = 13, ;
		Text_simplu1.ControlSource = "oinv.pret", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.InputMask = (get_mask(9,gnPpret)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Value = , ;
		Lb_simplu1.Caption = "Valuta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_Valuta.Combo1' AS combobox WITH ;
		ColumnCount = 1, ;
		ControlSource = "oinv.valuta", ;
		Height = 25, ;
		HideSelection = .F., ;
		Left = 102, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "crsValuteTemp.nume_val", ;
		RowSourceType = 2, ;
		Style = 2, ;
		Top = 2, ;
		Width = 183
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Clb_vanzare' AS clb_tx_simplu WITH ;
		Height = 114, ;
		Left = 9, ;
		Name = "Clb_vanzare", ;
		TabIndex = 11, ;
		Top = 303, ;
		Width = 294, ;
		ZOrderSet = 11, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pretv", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(12,gnPPretV)), ;
		TEXT_SIMPLU1.Left = 101, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.ReadOnly = .T., ;
		TEXT_SIMPLU1.TabIndex = 3, ;
		TEXT_SIMPLU1.TabStop = .F., ;
		TEXT_SIMPLU1.Top = 60, ;
		TEXT_SIMPLU1.Width = 184, ;
		LB_SIMPLU1.Caption = "Pret vanzare", ;
		LB_SIMPLU1.Left = 8, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.TabIndex = 5, ;
		LB_SIMPLU1.Top = 63
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_vanzare.cb_cota_tva' AS combobox WITH ;
		BorderColor = 128,128,128, ;
		BorderStyle = 1, ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "200,10,0", ;
		Comment = "F", ;
		ControlSource = "", ;
		Height = 20, ;
		InputMask = "", ;
		Left = 102, ;
		Name = "cb_cota_tva", ;
		RowSource = "crs_cote_tva_inventar.denumire,cota_tva", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		TabIndex = 1, ;
		TabStop = .F., ;
		Top = 4, ;
		Visible = .T., ;
		Width = 184
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Clb_vanzare.Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "TVA vanzare", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label1", ;
		TabIndex = 6, ;
		Top = 92, ;
		Width = 68
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cota TVA", ;
		Height = 17, ;
		Left = 9, ;
		Name = "Label2", ;
		TabIndex = 8, ;
		Top = 7, ;
		Width = 52
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Pret vanzare cu TVA", ;
		Height = 32, ;
		Left = 8, ;
		Name = "Label3", ;
		TabIndex = 7, ;
		Top = 28, ;
		Width = 85, ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Text1' AS textbox WITH ;
		ControlSource = "thisform.nPretvTVA", ;
		Format = "!K", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPPretV)), ;
		Left = 101, ;
		Name = "Text1", ;
		TabIndex = 2, ;
		Top = 30, ;
		Width = 184
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Clb_vanzare.Tx_tva' AS textbox WITH ;
		ControlSource = "oinv.tvav", ;
		Format = "!K", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPPretV)), ;
		Left = 101, ;
		Name = "Tx_tva", ;
		ReadOnly = .T., ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 86, ;
		Width = 184
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Ct_clb_articol' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(oinv.id_articol,0)), ;
		cprocedura = thisform.do_cauta_articol, ;
		cvar_afisata = oinv.denumire, ;
		Left = 8, ;
		Name = "Ct_clb_articol", ;
		TabIndex = 1, ;
		Top = 36, ;
		ZOrderSet = 14, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		LB_CAUTARE.Caption = "Articol", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.Name = "TX_CAUTARE"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_furnizor' AS ct_clb_cautare_var WITH ;
		Anchor = 0, ;
		cconditie = 1=2, ;
		cprocedura = thisform.do_cauta_furnizor, ;
		cvar_afisata = oinv.furnizor, ;
		Left = 8, ;
		Name = "Ct_clb_furnizor", ;
		TabIndex = 10, ;
		Top = 266, ;
		ZOrderSet = 17, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		LB_CAUTARE.Caption = "Furnizor", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.Name = "TX_CAUTARE"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_nrord_rez' AS ct_clb_cautare_var WITH ;
		Anchor = 4, ;
		cprocedura = thisform.do_cauta_lucrare_rez, ;
		cvar_afisata = oinv.nrord_rez, ;
		Left = 8, ;
		Name = "Ct_clb_nrord_rez", ;
		TabIndex = 14, ;
		Top = 450, ;
		ZOrderSet = 16, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		LB_CAUTARE.Caption = "Lucrare rez.", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.Name = "TX_CAUTARE"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_part_rez' AS ct_clb_cautare_var WITH ;
		Anchor = 4, ;
		cprocedura = thisform.do_cauta_part_rez, ;
		cvar_afisata = oinv.part_rez, ;
		Left = 8, ;
		Name = "Ct_clb_part_rez", ;
		TabIndex = 13, ;
		Top = 422, ;
		ZOrderSet = 15, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		LB_CAUTARE.Caption = "Partener rez.", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.Name = "TX_CAUTARE"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />
	
	PROCEDURE alege_gestiune
		Select crsGestiuni
		Scatter Name oart
		oinv.id_gestiune = oart.id_gestiune
		*oinv.nr_pag = oart.nr_pag
		If !Thisform.lobinv
			If oart.nr_pag = 6
		*!*			If !Thisform.clb_vanzare.Visible
				Thisform.clb_vanzare.Visible = .T.
		*!*				Thisform.ct_clb_nrord_rez.Top = Thisform.ct_clb_nrord_rez.Top + Thisform.clb_vanzare.Height + 5
		*!*				Thisform.ct_clb_part_rez.Top = Thisform.ct_clb_part_rez.Top + Thisform.clb_vanzare.Height + 5
		*!*			Endif
				Thisform.Height = 485
			Else
		*!*			If Thisform.clb_vanzare.Visible
				Thisform.clb_vanzare.Visible  = .F.
		*!*				Thisform.ct_clb_nrord_rez.Top = Thisform.ct_clb_nrord_rez.Top - Thisform.clb_vanzare.Height
		*!*				Thisform.ct_clb_part_rez.Top = Thisform.ct_clb_part_rez.Top - Thisform.clb_vanzare.Height
		*!*			Endif
				Thisform.Height = 390
			Endif
			Thisform.Refresh()
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_articol
		locauta = caut_articol()
		If !Isnull(locauta)
			oinv.denumire = locauta.denumire
			oinv.id_articol = locauta.id_articol
		*!*		oinv.PretValuta = locauta.pretd
		*!*		oinv.ID_Valuta = locauta.ID_Valuta
			If Thisform.lobinv
				oinv.Cont = gcContObInv
				* thisform.dnf = loCauta.dnf	
				oinv.dnf = loCauta.dnf	
			Else
				oinv.Cont = locauta.Cont
			Endif
		
		*!*		oinv.pretv = locauta.pretv
		*!*		oinv.tvav = locauta.tvav
			oinv.proc_tvav = oinv.proc_tvav
		
			This.ct_clb_articol.Refresh()	
			
			Thisform.clb_vanzare.Refresh
			Thisform.clb_cont.Refresh
		*!*		thisform.CLB_TX_PretValuta.Refresh
		*!*		THISFORM.clb_tx_Valuta.Refresh
		Endif
	ENDPROC

	PROCEDURE do_cauta_furnizor
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Furnizor]))
		If !Empty(Nvl(loCauta.id_part,0)) And !Empty(loCauta.denumire)
			oinv.furnizor = loCauta.denumire
			oinv.id_furnizor = loCauta.id_part
		Else
			oinv.furnizor = []
			oinv.id_furnizor = null
		Endif
		Thisform.ct_clb_furnizor.SetFocus()
		
	ENDPROC

	PROCEDURE do_cauta_lucrare_rez
		Local loCauta
		loCauta = caut_lucrare()
		If !Empty(Nvl(loCauta.id_lucrare,0))
			oinv.id_lucrare_rez = loCauta.id_lucrare
			oinv.nrord_rez = loCauta.nrord
		
			This.ct_clb_nrord_rez.Refresh()
		Else
			oinv.id_lucrare_rez = 0
			oinv.nrord_rez = []
		Endif
		Thisform.but_TERMIN1.SetFocus()
		
	ENDPROC

	PROCEDURE do_cauta_part_rez
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Partener rezervare]))
		If !Empty(Nvl(loCauta.id_part,0)) And !Empty(loCauta.denumire)
			oinv.part_rez = loCauta.denumire
			oinv.id_part_rez = loCauta.id_part
		
			This.ct_clb_part_rez.Refresh()
		Else
			oinv.part_rez = []
			oinv.id_part_rez = 0
		Endif
		Thisform.ct_clb_nrord_rez.SetFocus()
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		IF oinv.id_articol = 0 OR ISNULL(oinv.id_articol)
			AMESSAGEBOX('Alegeti articolul', 0+16, 'Atentie')
			this.but_cautare1.SetFocus()
			RETURN .F.
		ENDIF 	
		
		IF oinv.id_gestiune= 0 OR ISNULL(oinv.id_gestiune)
			AMESSAGEBOX('Alegeti gestiunea', 0+16, 'Atentie')
			this.clb_gestiune._cbBASE1.SetFocus()
			RETURN .F.
		ENDIF 	
		
		IF this.lobinv 
			IF EMPTY(oinv.datapif) 
				AMESSAGEBOX('Completati data dare in folosinta', 0+16, 'Atentie')
				this.clb_obinv.tx_datapif.SetFocus()
				RETURN .F.
			ENDIF 
		ENDIF 	
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS tlCopiere
		
		DODEFAULT()
		
		This.lCopiere = m.tlCopiere
		
	ENDPROC

	PROCEDURE Show
		Lparameters nStyle
		*!*	this.clb_cont.teXT_SIMPLU1.ControlSource = thisform.obj.cont
		*!*	this.clb_acont.teXT_SIMPLU1.ControlSource = thisform.obj.acont
		*!*	this.clb_pret.teXT_SIMPLU1.ControlSource = thisform.obj.pret
		*!*	this.clb_vanzare.teXT_SIMPLU1.ControlSource = this.obj.pretv
		*!*	this.clb_vanzare.tx_proc_tvav.ControlSource = this.obj.proc_tvav
		*!*	this.clb_vanzare.tx_tvav.ControlSource = this.obj.tvav
		
		Select crs_cote_tva_inventar
		This.clb_vanzare.Cb_cota_tva.Value = Alltrim(denumire)
		
		If This.lobinv
			This.clb_obinv._cbbase1.RowSource = [crsResponsabili.nume]
			This.clb_obinv.Visible = .T.
			This.clb_obinv.Left = This.clb_vanzare.Left
			This.clb_vanzare.Visible = .F.
		*!*	modificare	ROAOBINV v 2.0.3
			This.ct_clb_nrord_rez.Visible = .F.
			This.ct_clb_part_rez.Visible = .F.
			this.Height = 390
			this.Refresh()
		*!*	modificare	ROAOBINV v 2.0.3	^
		Else
			This.clb_obinv.Visible = .F.
		Endif
		
		IF !this.lCopiere
			This.do_cauta_articol()
		ENDIF 	
		This.clb_gestiune._cbbase1.SetFocus()
		Thisform.alege_gestiune()	&&	modificare	v 2.2.6
	ENDPROC

	PROCEDURE clb_gestiune._CBBASE1.Valid
		*!*	modificare	v 2.2.6
		Thisform.alege_gestiune()
		*!*	Select crsGestiuni
		*!*	Scatter Name oart
		*!*	oinv.id_gestiune = oart.id_gestiune
		*!*	*oinv.nr_pag = oart.nr_pag
		*!*	If !Thisform.lobinv
		*!*		If oart.nr_pag = 6
		*!*	*!*			If !Thisform.clb_vanzare.Visible
		*!*				Thisform.clb_vanzare.Visible = .T.
		*!*	*!*				Thisform.ct_clb_nrord_rez.Top = Thisform.ct_clb_nrord_rez.Top + Thisform.clb_vanzare.Height + 5
		*!*	*!*				Thisform.ct_clb_part_rez.Top = Thisform.ct_clb_part_rez.Top + Thisform.clb_vanzare.Height + 5
		*!*	*!*			Endif
		*!*			Thisform.Height = 420 +50
		*!*		Else
		*!*	*!*			If Thisform.clb_vanzare.Visible
		*!*				Thisform.clb_vanzare.Visible  = .F.
		*!*	*!*				Thisform.ct_clb_nrord_rez.Top = Thisform.ct_clb_nrord_rez.Top - Thisform.clb_vanzare.Height
		*!*	*!*				Thisform.ct_clb_part_rez.Top = Thisform.ct_clb_part_rez.Top - Thisform.clb_vanzare.Height
		*!*	*!*			Endif
		*!*			Thisform.Height = 310	+50
		*!*		Endif
		*!*		Thisform.Refresh()
		*!*	Endif
		*!*	modificare	v 2.2.6	^
	ENDPROC

	PROCEDURE Clb_obinv._cbbase1.Valid
		SELECT crsResponsabili
		SCATTER NAME oart
		oinv.id_responsabil = oart.id_responsabil
		oinv.responsabil = oart.nume
	ENDPROC

	PROCEDURE Clb_Valuta.Combo1.Valid
		oinv.id_Valuta = crsValuteTemp.id_valuta
	ENDPROC

	PROCEDURE Clb_vanzare.cb_cota_tva.InteractiveChange
		oinv.proc_tvav = 1 + Round(crs_cote_tva_inventar.cota_tva/100,2)
		oinv.pretv = Round(thisform.nPretvtva / oinv.proc_tvav , gnPPretV)
		oinv.tvav = thisform.nPretvtva - oinv.pretv
		this.Parent.text_simplu1.Refresh()
		This.Parent.tx_tva.Refresh()
		SELECT crs_cote_tva_inventar
		*!*	BROWSE 
	ENDPROC

	PROCEDURE Clb_vanzare.Text1.Valid
		oinv.proc_tvav = 1 + Round(crs_cote_tva_inventar.cota_tva/100,2)
		oinv.pretv = Round(thisform.npretvtva / oinv.proc_tvav, gnPPretV)
		oinv.tvav = this.Value - oinv.pretv
		thisform.clb_vanzare.text_simplu1.Refresh()
		thisform.clb_vanzare.tx_tva.Refresh()
	ENDPROC

	PROCEDURE Clb_vanzare.TEXT_SIMPLU1.Valid
		*!*	modificare	v 2.0.194
		*!*	oinv.proc_tvav = 1 + Round(crs_cote_tva_inventar.cota_tva/100,2)
		*!*	Thisform.nPretvtva = Round(oinv.pretv * oinv.proc_tvav,gnPc)
		*!*	oinv.tvav = Thisform.nPretvtva - oinv.pretv
		*!*	This.Parent.tx_tva.Refresh()
		*!*	This.Parent.text1.Refresh()
		*!*	modificare	v 2.0.194	^
	ENDPROC

	PROCEDURE Clb_vanzare.Tx_tva.Valid
		*!*	modificare	v 2.0.194
		*!*	thisform.nPretvtva = oinv.pretv + oinv.tvav
		*!*	this.Parent.text1.Refresh()
		*!*	modificare	v 2.0.194	^
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="clb_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_acont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_Valuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_Valuta.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_pret" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Tx_tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.cb_cota_tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_PretValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_articol" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_furnizor" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: alege_gestiune
		*m: do_cauta_articol
		*m: do_cauta_codbare
		*m: do_cauta_furnizor
		*p: npretvtva
		*p: obj
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 500
		Name = "new_inventar_magazin"
		npretvtva = 0
		obj = .F.
		Width = 380
		_shape1.Name = "_shape1"
		_shape2.Name = "_shape2"
		Lb_titlu_alb_b121.Caption = "Adaugare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 15
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 13
		Gridsort1.Name = "Gridsort1"
		BUT_RENUNT1.Name = "BUT_RENUNT1"
		BUT_RENUNT1.TabIndex = 14
	*</PropValue>

	ADD OBJECT 'Clb_acont' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_acont", ;
		TabIndex = 7, ;
		Top = 216, ;
		Width = 294, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.ControlSource = "oinv.acont", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Analitic", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_cont' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_cont", ;
		TabIndex = 6, ;
		Top = 188, ;
		Width = 294, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "oinv.cont", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Cont", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_gestiune' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 10, ;
		Name = "clb_gestiune", ;
		TabIndex = 5, ;
		Top = 160, ;
		Width = 358, ;
		ZOrderSet = 7, ;
		_CBBASE1.ColumnCount = 2, ;
		_CBBASE1.ColumnWidths = "250,100", ;
		_CBBASE1.ControlSource = "oinv.nume_gestiune", ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 70, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "crsGestiuni.nume_gestiune,cgest", ;
		_CBBASE1.RowSourceType = 2, ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Width = 286, ;
		_LBBASE1.Caption = "Gestiune", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_pret' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_pret", ;
		TabIndex = 8, ;
		Top = 251, ;
		Width = 294, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pret", ;
		TEXT_SIMPLU1.InputMask = (get_mask(9,gnPpret)), ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Pret achizitie", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_PretValuta' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_PretValuta", ;
		TabIndex = 9, ;
		Top = 279, ;
		Width = 294, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.ControlSource = "oinv.Pretd", ;
		TEXT_SIMPLU1.InputMask = (get_mask(16,gnPPretVAL)), ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.TabIndex = 1, ;
		LB_SIMPLU1.Caption = "Pret valuta", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 39, ;
		Width = 294, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "oinv.codbare", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Cod bare", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 4, ;
		Top = 132, ;
		Width = 294, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "oinv.stoc_faptic", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Cantitate", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 3, ;
		Top = 95, ;
		Width = 294, ;
		ZOrderSet = 8, ;
		Text_simplu1.ControlSource = "oinv.serie", ;
		Text_simplu1.Format = "K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Lb_simplu1.Caption = "Serie", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_Valuta' AS clb_tx_simplu WITH ;
		Left = 10, ;
		Name = "Clb_Valuta", ;
		TabIndex = 10, ;
		Top = 307, ;
		Width = 294, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pret", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.InputMask = (get_mask(9,gnPpret)), ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Value = , ;
		LB_SIMPLU1.Caption = "Valuta", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_Valuta.Combo1' AS combobox WITH ;
		ColumnCount = 1, ;
		ControlSource = "oinv.valuta", ;
		Height = 25, ;
		HideSelection = .F., ;
		Left = 102, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "crsValuteTemp.nume_val", ;
		RowSourceType = 2, ;
		Style = 2, ;
		Top = 2, ;
		Width = 183
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Clb_vanzare' AS clb_tx_simplu WITH ;
		Height = 114, ;
		Left = 10, ;
		Name = "Clb_vanzare", ;
		TabIndex = 12, ;
		Top = 382, ;
		Width = 294, ;
		ZOrderSet = 11, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pretv", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(12,gnPPretV)), ;
		TEXT_SIMPLU1.Left = 101, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.TabIndex = 3, ;
		TEXT_SIMPLU1.Top = 59, ;
		TEXT_SIMPLU1.Width = 184, ;
		LB_SIMPLU1.Caption = "Pret vanzare", ;
		LB_SIMPLU1.Left = 8, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		LB_SIMPLU1.TabIndex = 5, ;
		LB_SIMPLU1.Top = 63
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_vanzare.cb_cota_tva' AS combobox WITH ;
		BorderColor = 128,128,128, ;
		BorderStyle = 1, ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "200,10,0", ;
		Comment = "F", ;
		ControlSource = "", ;
		Height = 20, ;
		InputMask = "", ;
		Left = 102, ;
		Name = "cb_cota_tva", ;
		RowSource = "crs_cote_tva_inventar.denumire,cota_tva", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		TabIndex = 1, ;
		TabStop = .T., ;
		Top = 4, ;
		Visible = .T., ;
		Width = 184
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Clb_vanzare.Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "TVA vanzare", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label1", ;
		TabIndex = 6, ;
		Top = 92, ;
		Width = 68
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cota TVA", ;
		Height = 17, ;
		Left = 9, ;
		Name = "Label2", ;
		TabIndex = 8, ;
		Top = 7, ;
		Width = 52
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Label3' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Pret vanzare cu TVA", ;
		Height = 32, ;
		Left = 8, ;
		Name = "Label3", ;
		TabIndex = 7, ;
		Top = 28, ;
		Width = 85, ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Text1' AS textbox WITH ;
		ControlSource = "thisform.nPretvTVA", ;
		Format = "!K", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPPretV)), ;
		Left = 101, ;
		Name = "Text1", ;
		TabIndex = 2, ;
		Top = 30, ;
		Width = 184
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Clb_vanzare.Tx_tva' AS textbox WITH ;
		ControlSource = "oinv.tvav", ;
		Format = "!K", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPPretV)), ;
		Left = 101, ;
		Name = "Tx_tva", ;
		TabIndex = 4, ;
		Top = 86, ;
		Width = 184
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Ct_clb_articol' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(oinv.id_articol,0)), ;
		cprocedura = thisform.do_cauta_articol, ;
		cvar_afisata = oinv.denumire, ;
		Left = 9, ;
		Name = "Ct_clb_articol", ;
		TabIndex = 2, ;
		Top = 66, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		LB_CAUTARE.Caption = "Articol", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.Height = 23, ;
		TX_CAUTARE.Left = 102, ;
		TX_CAUTARE.Name = "TX_CAUTARE", ;
		TX_CAUTARE.Top = 4, ;
		TX_CAUTARE.Width = 206
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_furnizor' AS ct_clb_cautare_var WITH ;
		Anchor = 0, ;
		cconditie = 1=2, ;
		cprocedura = thisform.do_cauta_furnizor, ;
		cvar_afisata = oinv.furnizor, ;
		Left = 10, ;
		Name = "Ct_clb_furnizor", ;
		TabIndex = 11, ;
		Top = 342, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		LB_CAUTARE.Caption = "Furnizor", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.Name = "TX_CAUTARE"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />
	
	PROCEDURE alege_gestiune
		Select crsGestiuni
		Scatter Name oart
		oinv.id_gestiune = oart.id_gestiune
		*oinv.nr_pag = oart.nr_pag
		oinv.Cont = oart.Cont
		oinv.aCont = oart.aCont
		If oart.nr_pag = 6
			Thisform.clb_vanzare.Visible = .T.
			Thisform.Height = 500
		Else
			Thisform.Height = 375
		Endif
		Thisform.Refresh()
	ENDPROC

	PROCEDURE do_cauta_articol
		*!* 07.09.2009
		*!* marius.mutu
		*!* actualizare cod bare
		
		Local locauta
		
		lcFiltru = [2=2]
		lcSchema = []
		lcOrder = [denumire]
		lccoloane = [denumire,codmat,codbare,id_articol]
		lcTitlu = [Alegeti articolul]
		lcTitluColoane = [Denumire,Cod Material,Cod bare,Id]
		lcSelect = [select a.ID_ARTICOL,a.DENUMIRE,a.CODMAT,a.CODBARE,a.INACTIV,c.pret,c.proc_tvav,c.pretftva,c.pretctva ] +;
			[ from nom_articole a ]+;
			[ left join ]+;
			[ (select distinct b.id_articol,max(NVL(b.pret,0)) as pret,max(NVL(b.proc_tvav,0)) as proc_tvav, ]+;
			[ max(NVL(b.pretftva,0)) as pretftva,max(NVL(b.pretctva,0)) as pretctva ]+;
			[ from crm_politici_pret_art b ]+;
			[ where b.id_pol in (select b1.id_pol from crm_vpolpretcurutil b1 where b1.id_util = ?gnIdUtil) ]+;
			[ group by b.id_articol) c on a.ID_ARTICOL = c.id_articol]
		
		lcFiltruOriginal = [ a.INACTIV = 0 and a.sters = 0 ]
		lcNumeProc = [nom_articole]
		
		llToateIreg = .F.
		lcPrimaColoana = [denumire]
		lnPornire = 1
		lcIdColumn = "id_articol"
		locauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana,;
			lnPornire, , lcIdColumn)
		
		*!*	locauta = caut_articol()
		If !Isnull(locauta)
			Select crs_cote_tva_inventar
			Locate For cota_tva = (locauta.proc_tvav - 1)*100
			oinv.denumire = locauta.denumire
			oinv.id_articol = locauta.id_articol
			oinv.proc_tvav = locauta.proc_tvav
			Thisform.npretvtva = locauta.pretctva
			oinv.pretv = locauta.pretftva
			oinv.tvav = Thisform.npretvtva - oinv.pretv
		
		
			If Upper(Alltrim(NVL(oinv.codbare,''))) <> Upper(Alltrim(NVL(locauta.codbare,''))) And !Empty(NVL(locauta.codbare,'')) And !Empty(NVL(oinv.codbare,''))
				If aMESSAGEBOX([Codul de bare vechi pe articolul ]+Alltrim(locauta.denumire)+;
						[ este: ]+Alltrim(locauta.codbare)+[. Il inlocuim cu: ]+;
						ALLTRIM(oinv.codbare)+[?],4+32,'Atentie!') = 6
					lcsel = [update nom_articole set codbare =  '] + Alltrim(oinv.codbare) + [' where id_articol = ] + locauta.id_articol
					lnsucces = goExecutor.oExecute(lcsel)
					If lnsucces < 0
						aMESSAGEBOX(goExecutor.cEroare ,0+16, 'Eroare')
					Endif
				Else
					oinv.codbare = locauta.codbare
				Endif
		*!*		ELSE
		*!*			IF !EMPTY(NVL(loCauta.codbare,''))
		*!*				lcsel = [update nom_articole set codbare =  '] + Alltrim(oinv.codbare)+;
		*!*					[' where id_articol = ]+Alltrim(Str(locauta.id_articol))
		*!*				lnsucces = goExecutor.oExecute(lcsel)
		*!*				If lnsucces < 0
		*!*					aMESSAGEBOX(goExecutor.cEroare ,0+16, 'Eroare')
		*!*				ENDIF
		*!*			ENDIF 	
			Endif
			This.ct_clb_articol.Refresh()
		
			Thisform.clb_vanzare.Refresh
			Thisform.clb_cont.Refresh
			Thisform.clb_tx_simplu1.Refresh
			Thisform.Refresh()
			*!*		thisform.CLB_TX_PretValuta.Refresh
			*!*		THISFORM.clb_tx_Valuta.Refresh
		
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_codbare
		IF EMPTY(oinv.codbare)
			RETURN
		ENDIF 
		lcsel = [select id_articol, codbare, denumire,proc_tvav,pretftva,pretctva from ]+;
			[(select a.ID_ARTICOL,a.DENUMIRE,a.CODMAT,a.CODBARE,a.INACTIV,c.pret,c.proc_tvav,c.pretftva,c.pretctva ] +;
								[ from nom_articole a ]+;
								[ left join ]+;
								[ (select distinct b.id_articol,max(NVL(b.pret,0)) as pret,max(NVL(b.proc_tvav,0)) as proc_tvav, ]+;
								[ max(NVL(b.pretftva,0)) as pretftva,max(NVL(b.pretctva,0)) as pretctva ]+;
								[ from crm_politici_pret_art b ]+;
								[ where b.id_pol in (select b1.id_pol from crm_vpolpretcurutil b1 where b1.id_util = ?gnIdUtil) ]+;
								[ group by b.id_articol) c on a.ID_ARTICOL = c.id_articol where a.INACTIV = 0 and a.sters = 0  and a.codbare = ']+ALLTRIM(oinv.codbare)+[')]
		lccursor = [crs_ArtCodbare]
		lnsucces = goExecutor.oExecute(lcsel,lccursor)
		If lnsucces < 0
			AMESSAGEBOX(goExecutor.cEroare ,0+16, 'Eroare')
			RETURN 
		ENDIF 
		
		SELECT crs_ArtCodbare
		IF RECCOUNT()<1
			aMESSAGEBOX('Nu exista codul de bare introdus! Alegeti din nomenclator articolul cu codul de bare introdus!',0+64,_screen.Caption)
			thisform.do_cauta_articol()
			ELSE 
				IF RECCOUNT()>1
		
					lcFiltru = [2=2]
					lcSchema = []
					lcOrder = [denumire]
					lccoloane = [denumire,codmat,codbare,id_articol]
					lcTitlu = [Alegeti articolul]
					lcTitluColoane = [Denumire,Cod Material,Cod bare,Id]
					lcSelect = [select a.ID_ARTICOL,a.DENUMIRE,a.CODMAT,a.CODBARE,a.INACTIV,c.pret,c.proc_tvav,c.pretftva,c.pretctva ] +;
								[ from nom_articole a ]+;
								[ left join ]+;
								[ (select distinct b.id_articol,max(NVL(b.pret,0)) as pret,max(NVL(b.proc_tvav,0)) as proc_tvav, ]+;
								[ max(NVL(b.pretftva,0)) as pretftva,max(NVL(b.pretctva,0)) as pretctva ]+;
								[ from crm_politici_pret_art b ]+;
								[ where b.id_pol in (select b1.id_pol from crm_vpolpretcurutil b1 where b1.id_util = ?gnIdUtil) ]+;
								[ group by b.id_articol) c on a.ID_ARTICOL = c.id_articol]
								
					lcFiltruOriginal = [ a.INACTIV = 0 and a.sters = 0  and a.codbare = ']+ALLTRIM(oinv.codbare)+[']
					lcNumeProc = [nom_articole]
					
					llToateIreg = .F.
					lcPrimaColoana = [denumire]
					lnPornire = 1
					lcIdColumn = "id_articol"
					loCauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana,;
					 lnPornire, , lcIdColumn)		&& 11.07.2007
				
		*!*				lcFiltru = [1=2]
		*!*				lcSchema = []
		*!*				lcOrder = [denumire]
		*!*				lccoloane = [denumire,codmat,codbare,id_articol]
		*!*				lcTitlu = [Alegeti articolul]
		*!*				lcTitluColoane = [Denumire,Cod Material,Cod bare,Id]
		*!*				lcSelect = [select distinct a.denumire,a.codmat,a.codbare,a.um,a.cont,a.acont,] + ;
		*!*					[a.id_articol, a.grupa, a.subgrupa, a.id_grupa, a.id_subgrupa, a.dnf, 0 as id_tipgest from vnom_articole a ]
		*!*				lcFiltruOriginal = [a.inactiv=0 and a.codbare = ]+ALLTRIM(STR(oinv.codbare))
		*!*				lcNumeProc = [nom_articole]
		*!*				
		*!*				llToateIreg = .T.
		*!*				lcPrimaColoana = [denumire]
		*!*				lnPornire = 1
		*!*				lcIdColumn = "id_articol"
		*!*				loCauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, llToateIreg, lcFiltruOriginal, lcPrimaColoana,;
		*!*				 lnPornire, , lcIdColumn)		&& 11.07.2007
						SELECT crs_cote_tva_inventar
						LOCATE FOR cota_tva = (loCauta.proc_tvav - 1)*100
		
						oinv.denumire = loCauta.denumire
						oinv.id_articol = loCauta.id_articol
						oinv.proc_tvav = loCauta.proc_tvav
						thisform.npretvtva = loCauta.pretctva
						oinv.pretv = loCauta.pretftva 
						oinv.tvav = thisform.nPretvtva - oinv.pretv				
				ELSE 
						SELECT crs_cote_tva_inventar
						LOCATE FOR cota_tva = (crs_ArtCodbare.proc_tvav - 1)*100
						
						oinv.denumire = crs_ArtCodbare.denumire
						oinv.id_articol = crs_ArtCodbare.id_articol
						oinv.proc_tvav = crs_ArtCodbare.proc_tvav
						thisform.npretvtva  = crs_ArtCodbare.pretctva
						oinv.pretv = crs_ArtCodbare.pretftva 
						oinv.tvav = thisform.nPretvtva - oinv.pretv				
				ENDIF 
		ENDIF 
		
		thisform.Refresh()
	ENDPROC

	PROCEDURE do_cauta_furnizor
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Furnizor]))
		If !Empty(Nvl(loCauta.id_part,0)) And !Empty(loCauta.denumire)
			oinv.furnizor = loCauta.denumire
			oinv.id_furnizor = loCauta.id_part
		Else
			oinv.furnizor = []
			oinv.id_furnizor = null
		Endif
		Thisform.ct_clb_furnizor.SetFocus()
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		IF oinv.id_articol = 0 OR ISNULL(oinv.id_articol)
			AMESSAGEBOX('Alegeti articolul', 0+16, 'Atentie')
			this.but_cautare1.SetFocus()
			RETURN .F.
		ENDIF 	
		
		IF oinv.id_gestiune= 0 OR ISNULL(oinv.id_gestiune)
			AMESSAGEBOX('Alegeti gestiunea', 0+16, 'Atentie')
			this.clb_gestiune._cbBASE1.SetFocus()
			RETURN .F.
		ENDIF 	
		
	ENDPROC

	PROCEDURE Show
		Lparameters nStyle
		*!*	this.clb_cont.teXT_SIMPLU1.ControlSource = thisform.obj.cont
		*!*	this.clb_acont.teXT_SIMPLU1.ControlSource = thisform.obj.acont
		*!*	this.clb_pret.teXT_SIMPLU1.ControlSource = thisform.obj.pret
		*!*	this.clb_vanzare.teXT_SIMPLU1.ControlSource = this.obj.pretv
		*!*	this.clb_vanzare.tx_proc_tvav.ControlSource = this.obj.proc_tvav
		*!*	this.clb_vanzare.tx_tvav.ControlSource = this.obj.tvav
		
		Select crs_cote_tva_inventar
		This.clb_vanzare.Cb_cota_tva.Value = Alltrim(denumire)
		
		*!*	If This.lobinv
		*!*		This.clb_obinv._cbbase1.RowSource = [crsResponsabili.nume]
		*!*		This.clb_obinv.Visible = .T.
		*!*		This.clb_obinv.Left = This.clb_vanzare.Left
		*!*		This.clb_vanzare.Visible = .F.
		*!*	*!*	modificare	ROAOBINV v 2.0.3
		*!*		this.Height = 365
		*!*		this.Refresh()
		*!*	*!*	modificare	ROAOBINV v 2.0.3	^
		*!*	Else
		*!*		This.clb_obinv.Visible = .F.
		*!*	Endif
		
		*!*	This.do_cauta_articol()
		*!*	This.clb_gestiune._cbbase1.SetFocus()
		Thisform.alege_gestiune()	&&	modificare	v 2.2.6
	ENDPROC

	PROCEDURE clb_gestiune._CBBASE1.LostFocus
		*!*	modificare	v 2.2.6
		Thisform.alege_gestiune()
		*!*	Select crsGestiuni
		*!*	Scatter Name oart
		*!*	oinv.id_gestiune = oart.id_gestiune
		*!*	*oinv.nr_pag = oart.nr_pag
		*!*	oinv.Cont = oart.Cont
		*!*	oinv.aCont = oart.aCont
		*!*	If oart.nr_pag = 6
		*!*		Thisform.clb_vanzare.Visible = .T.
		*!*		Thisform.Height = 470
		*!*	ELSE 
		*!*		Thisform.Height = 340
		*!*	Endif
		*!*	Thisform.Refresh()
		*!*	modificare	v 2.2.6	^
	ENDPROC

	PROCEDURE Clb_tx_simplu1.TEXT_SIMPLU1.LostFocus
		thisform.do_cauta_codbare()
	ENDPROC

	PROCEDURE Clb_Valuta.Combo1.Valid
		oinv.id_Valuta = crsValuteTemp.id_valuta
	ENDPROC

	PROCEDURE Clb_vanzare.cb_cota_tva.LostFocus
		this.Valid()
	ENDPROC

	PROCEDURE Clb_vanzare.cb_cota_tva.Valid
		*!* 19.04.2010
		*!*  marius.mutu
		*!* se folosea 19 in loc de 1.19
		
		*!*	oinv.proc_tvav = 1 + Round(crs_cote_tva_inventar.cota_tva/100,2)
		*!*	oinv.pretv = Round(thisform.nPretvtva / oinv.proc_tvav , gnPC)
		LOCAL lnPretvtva
		lnPretvtva = thisform.nPretvtva
		
		oinv.proc_tvav = crs_cote_tva_inventar.cota_tva
		oinv.tvav = ROUND(lnPretvtva * (oinv.proc_tvav - 1 ) / oinv.proc_tvav, gnPPretV)
		oinv.pretv = m.lnPretvtva - oinv.tvav 
		
		thisform.clb_vanzare.text1.Refresh()
		thisform.clb_vanzare.text_simplu1.Refresh()
		thisform.clb_vanzare.tx_tva.Refresh()
		
	ENDPROC

	PROCEDURE Clb_vanzare.Text1.Valid
		*!* 19.04.2010
		*!*  marius.mutu
		*!* se folosea 19 in loc de 1.19
		
		*!*	oinv.pretv = Round(thisform.npretvtva / oinv.proc_tvav, gnPc)
		*!*	oinv.tvav = this.Value - oinv.pretv
		LOCAL lnPretvtva
		lnPretvtva = thisform.nPretvtva
		
		oinv.proc_tvav = crs_cote_tva_inventar.cota_tva
		oinv.tvav = ROUND(lnPretvtva * (oinv.proc_tvav - 1 ) / oinv.proc_tvav, gnPPretV)
		oinv.pretv = m.lnPretvtva - oinv.tvav 
		
		thisform.clb_vanzare.text_simplu1.Refresh()
		thisform.clb_vanzare.tx_tva.Refresh()
		
	ENDPROC

	PROCEDURE Clb_vanzare.TEXT_SIMPLU1.InteractiveChange
		
		
		
		
	ENDPROC

	PROCEDURE Clb_vanzare.TEXT_SIMPLU1.Valid
		*!* 19.04.2010
		*!*  marius.mutu
		*!* se folosea 19 in loc de 1.19
		
		LOCAL lnPretvtva
		lnPretvtva = thisform.nPretvtva
		*!*	oinv.proc_tvav = 1 + Round(crs_cote_tva_inventar.cota_tva/100,2)
		*!*	oinv.tvav = thisform.nPretvtva - oinv.pretv
		oinv.proc_tvav = crs_cote_tva_inventar.cota_tva
		oinv.tvav = thisform.nPretvtva - oinv.pretv
		
		This.Parent.tx_tva.Refresh()
	ENDPROC

	PROCEDURE Clb_vanzare.Tx_tva.Valid
		thisform.nPretvtva = oinv.pretv + oinv.tvav
		this.Parent.text1.Refresh()
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="clb_gestiune" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_PretValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_acont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_Valuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_Valuta.Combo1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_pret" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Tx_tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_vanzare.cb_cota_tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_an_prod" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cant_zahar" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_stadiu" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_soi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_categ_calitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_grade_alcool" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_potential" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_articol" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: alege_gestiune
		*m: do_cauta_articol
		*m: do_cauta_categ_calitate
		*m: do_cauta_stadiu
		*m: do_cauta_venchelt
		*p: dnf
		*p: lcopiere
		*p: lobinv
		*p: obj
	*</DefinedPropArrayMethod>

	*<PropValue>
		dnf = 0
		DoCreate = .T.
		Height = 347
		lcopiere = .F.
		lobinv = .F.
		Name = "new_inventar_vin"
		obj = 
		Width = 683
		_memberdata = <VFPData>
			<memberdata name="lcopiere" display="lCopiere"/>
		</VFPData>
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 684
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 620
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 65
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Adãugare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 19
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Left = 653
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 17
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		GRIDSORT1.Left = 384
		GRIDSORT1.Name = "GRIDSORT1"
		GRIDSORT1.Top = 36
		But_renunt1.Left = 623
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 18
		But_renunt1.Top = 1
		But_renunt1.ZOrderSet = 6
	*</PropValue>

	ADD OBJECT 'Clb_acont' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_acont", ;
		TabIndex = 5, ;
		Top = 132, ;
		Width = 294, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.ControlSource = "oinv.acont", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Analitic", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_an_prod' AS clb_tx_simplu WITH ;
		Anchor = 4, ;
		Height = 29, ;
		Left = 325, ;
		Name = "Clb_an_prod", ;
		TabIndex = 14, ;
		Top = 216, ;
		Width = 314, ;
		Text_simplu1.Alignment = 3, ;
		Text_simplu1.ControlSource = "oinv.an_prod", ;
		Text_simplu1.InputMask = "9999", ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "An producþie", ;
		Lb_simplu1.Left = 8, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_cant_zahar' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 325, ;
		Name = "Clb_cant_zahar", ;
		TabIndex = 11, ;
		Top = 132, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "oinv.cant_zahar", ;
		Text_simplu1.InputMask = (get_mask(14,gnPcant)), ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Cantitate zahãr", ;
		Lb_simplu1.Left = 8, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_cont' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_cont", ;
		TabIndex = 4, ;
		Top = 104, ;
		Width = 294, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "oinv.cont", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Cont", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_gestiune' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "clb_gestiune", ;
		TabIndex = 3, ;
		Top = 76, ;
		Width = 358, ;
		ZOrderSet = 7, ;
		_CBBASE1.ColumnCount = 2, ;
		_CBBASE1.ColumnWidths = "250,100", ;
		_CBBASE1.Comment = "oinv.nume_gestiune", ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 70, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "crsGestiuni.nume_gestiune,cgest", ;
		_CBBASE1.RowSourceType = 2, ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Width = 286, ;
		_LBBASE1.Caption = "Gestiune", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_grade_alcool' AS clb_tx_simplu WITH ;
		Anchor = 4, ;
		Height = 29, ;
		Left = 325, ;
		Name = "Clb_grade_alcool", ;
		TabIndex = 12, ;
		Top = 160, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "oinv.grade_alcool", ;
		Text_simplu1.InputMask = "999.999", ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.MaxLength = 6, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Grade alcool", ;
		Lb_simplu1.Left = 8, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_potential' AS clb_tx_simplu WITH ;
		Anchor = 4, ;
		Height = 29, ;
		Left = 325, ;
		Name = "Clb_potential", ;
		TabIndex = 13, ;
		Top = 188, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "oinv.potential", ;
		Text_simplu1.InputMask = "999 999 999 999.999", ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.MaxLength = 15, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Potenþial", ;
		Lb_simplu1.Left = 8, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_pret' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_pret", ;
		TabIndex = 6, ;
		Top = 160, ;
		Width = 294, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pret", ;
		TEXT_SIMPLU1.InputMask = (get_mask(9,gnPpret)), ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Preþ achiziþie", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_PretValuta' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_PretValuta", ;
		TabIndex = 7, ;
		Top = 188, ;
		Width = 294, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "oinv.Pretd", ;
		Text_simplu1.InputMask = (get_mask(16,gnPPretVAL)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Lb_simplu1.Caption = "Preþ valutã", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_Valuta' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "Clb_Valuta", ;
		TabIndex = 8, ;
		Top = 216, ;
		Width = 294, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "oinv.pret", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.InputMask = (get_mask(9,gnPpret)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Value = , ;
		Lb_simplu1.Caption = "Valuta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_Valuta.Combo1' AS combobox WITH ;
		ColumnCount = 1, ;
		ControlSource = "oinv.valuta", ;
		Height = 25, ;
		HideSelection = .F., ;
		Left = 102, ;
		Name = "Combo1", ;
		ReadOnly = .F., ;
		RowSource = "crsValuteTemp.nume_val", ;
		RowSourceType = 2, ;
		Style = 2, ;
		Top = 2, ;
		Width = 183
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Clb_vanzare' AS clb_tx_simplu WITH ;
		Height = 85, ;
		Left = 9, ;
		Name = "Clb_vanzare", ;
		TabIndex = 9, ;
		Top = 248, ;
		Width = 294, ;
		ZOrderSet = 11, ;
		TEXT_SIMPLU1.ControlSource = "oinv.pretv", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.InputMask = (get_mask(12,gnPPretV)), ;
		TEXT_SIMPLU1.Left = 101, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Width = 184, ;
		LB_SIMPLU1.Caption = "Preþ vânzare", ;
		LB_SIMPLU1.Left = 8, ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_vanzare.cb_cota_tva' AS combobox WITH ;
		BorderColor = 128,128,128, ;
		BorderStyle = 1, ;
		ColumnCount = 3, ;
		ColumnLines = .F., ;
		ColumnWidths = "200,10,0", ;
		Comment = "F", ;
		ControlSource = "", ;
		Height = 20, ;
		InputMask = "", ;
		Left = 101, ;
		Name = "cb_cota_tva", ;
		RowSource = "crs_cote_tva_inventar.denumire,cota_tva", ;
		RowSourceType = 6, ;
		SpecialEffect = 1, ;
		Style = 2, ;
		TabIndex = 25, ;
		TabStop = .F., ;
		Top = 56, ;
		Visible = .T., ;
		Width = 184
		*< END OBJECT: BaseClass="combobox" />

	ADD OBJECT 'Clb_vanzare.Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "TVA vânzare", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label1", ;
		Top = 36, ;
		Width = 68
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Label2' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Cota TVA", ;
		Height = 17, ;
		Left = 8, ;
		Name = "Label2", ;
		Top = 59, ;
		Width = 52
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Clb_vanzare.Tx_tva' AS textbox WITH ;
		ControlSource = "oinv.tvav", ;
		Format = "!K", ;
		Height = 23, ;
		InputMask = (get_mask(12,gnPPretV)), ;
		Left = 101, ;
		Name = "Tx_tva", ;
		Top = 30, ;
		Width = 184
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Ct_clb_articol' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(oinv.id_articol,0)), ;
		cprocedura = thisform.do_cauta_articol, ;
		cvar_afisata = oinv.denumire, ;
		Left = 8, ;
		Name = "Ct_clb_articol", ;
		TabIndex = 1, ;
		Top = 36, ;
		shape_cautare.Name = "shape_cautare", ;
		img_cautare.Name = "img_cautare", ;
		lb_cautare.Caption = "Articol", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Name = "tx_cautare"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_categ_calitate' AS ct_clb_cautare WITH ;
		Anchor = 4, ;
		cconditie = EMPTY(NVL(oinv.id_categ_calitate,0)), ;
		cprocedura = thisform.do_cauta_categ_calitate, ;
		cvar_afisata = oinv.categorie_calitate, ;
		Left = 324, ;
		Name = "Ct_clb_categ_calitate", ;
		TabIndex = 16, ;
		Top = 271, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Categorie calitate", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_soi' AS ct_clb_cautare WITH ;
		Anchor = 4, ;
		cconditie = EMPTY(NVL(oinv.id_venchelt,0)), ;
		cprocedura = thisform.do_cauta_venchelt, ;
		cvar_afisata = oinv.explicatie, ;
		Left = 324, ;
		Name = "Ct_clb_soi", ;
		TabIndex = 15, ;
		Top = 243, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Soi", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_stadiu' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(oinv.id_vin_stadiu,0)), ;
		cprocedura = thisform.do_cauta_stadiu, ;
		cvar_afisata = oinv.stadiu, ;
		Left = 324, ;
		Name = "Ct_clb_stadiu", ;
		TabIndex = 10, ;
		Top = 103, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Stadiu", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />
	
	PROCEDURE alege_gestiune
		Select crsGestiuni
		Scatter Name oart
		oinv.id_gestiune = oart.id_gestiune
		*oinv.nr_pag = oart.nr_pag
		If !Thisform.lobinv
			If oart.nr_pag = 6
				Thisform.clb_vanzare.Visible = .T.
		*!*			thisform.Height = 320 +50
			Else
				Thisform.clb_vanzare.Visible  = .F.
		*!*			thisform.Height = 229	+50
			Endif
		Endif
	ENDPROC

	PROCEDURE Destroy
		If Used('crs_cote_tva_inventar')
			Use In 'crs_cote_tva_inventar'
		Endif
	ENDPROC

	PROCEDURE do_cauta_articol
		locauta = caut_articol()
		If !Isnull(locauta)
			oinv.denumire = locauta.denumire
			oinv.id_articol = locauta.id_articol
		*!*		oinv.PretValuta = locauta.pretd
		*!*		oinv.ID_Valuta = locauta.ID_Valuta
			If Thisform.lobinv
				oinv.Cont = gcContObInv
		* thisform.dnf = loCauta.dnf
				oinv.dnf = locauta.dnf
			Else
				oinv.Cont = locauta.Cont
			Endif
		
		*!*		oinv.pretv = locauta.pretv
		*!*		oinv.tvav = locauta.tvav
			oinv.proc_tvav = oinv.proc_tvav
		
			Thisform.ct_clb_articol.Refresh()
			Thisform.clb_vanzare.Refresh
			Thisform.clb_cont.Refresh
		*!*		thisform.CLB_TX_PretValuta.Refresh
		*!*		THISFORM.clb_tx_Valuta.Refresh
		EndIf
		
	ENDPROC

	PROCEDURE do_cauta_categ_calitate
		Local loCauta
		loCauta = cauta_categ_calitate()
		If !Empty(Nvl(loCauta.id_categ_calitate,0))
			oinv.id_categ_calitate = loCauta.id_categ_calitate
			oinv.categorie_calitate = loCauta.categorie_calitate
		
			Thisform.but_termin1.SetFocus()
		Else
			oinv.id_categ_calitate = Null
			oinv.categorie_calitate = []
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_stadiu
		Local loCauta
		loCauta = cauta_stadiu_vin()
		If !Empty(Nvl(loCauta.id_vin_stadiu,0))
			oinv.id_vin_stadiu = loCauta.id_vin_stadiu
			oinv.stadiu = loCauta.stadiu
		
			Thisform.clb_cant_zahar.SetFocus()
		Else
			oinv.id_vin_stadiu = Null
			oinv.stadiu = []
		Endif
		
	ENDPROC

	PROCEDURE do_cauta_venchelt
		Local loCauta
		loCauta = caut_venchelt()
		If !Empty(Nvl(loCauta.id_venchelt,0))
			oinv.id_venchelt = loCauta.id_venchelt
			oinv.explicatie = loCauta.explicatie
		
			Thisform.ct_clb_categ_calitate.SetFocus()
		Else
			oinv.id_venchelt = NULL
			oinv.explicatie = []
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		If oinv.id_articol = 0 Or Isnull(oinv.id_articol)
			AMESSAGEBOX('Alegeti articolul', 0+16, 'Atentie')
			This.but_cautare1.SetFocus()
			Return .F.
		Endif
		
		If oinv.id_gestiune= 0 Or Isnull(oinv.id_gestiune)
			AMESSAGEBOX('Alegeti gestiunea', 0+16, 'Atentie')
			This.clb_gestiune._cbBASE1.SetFocus()
			Return .F.
		Endif
	ENDPROC

	PROCEDURE Init
		LPARAMETERS tlCopiere
		
		This.lCopiere = m.tlCopiere
		DODEFAULT()
	ENDPROC

	PROCEDURE Load
		If Used('crs_cote_tva_inventar')
			Use In 'crs_cote_tva_inventar'
		Endif
		If !Used('crs_cote_tva_inventar')
			lcsel3 = [select cota_tva,denumire from ] + gcS + [.vjtva_coloane ] + ;
				[where jv=1 and afisat = 1 and id_jtva_coloana > 0 order by ordine]
		*!*		lcsel3 = [select procent,proc_tva from ] + gcS + [.vcote_tva where an = ?gnAn and luna = ?gnLuna]
			lccursor3 = [crs_cote_tva_inventar]
			lnsucces3 = goExecutor.oExecute(lcsel3,lccursor3)
			If lnsucces3 < 0
				AMESSAGEBOX(goExecutor.cEroare ,0+16, 'Eroare')
			Endif
		Endif
	ENDPROC

	PROCEDURE Show
		Lparameters nStyle
		*!*	this.clb_cont.teXT_SIMPLU1.ControlSource = thisform.obj.cont
		*!*	this.clb_acont.teXT_SIMPLU1.ControlSource = thisform.obj.acont
		*!*	this.clb_pret.teXT_SIMPLU1.ControlSource = thisform.obj.pret
		*!*	this.clb_vanzare.teXT_SIMPLU1.ControlSource = this.obj.pretv
		*!*	this.clb_vanzare.tx_proc_tvav.ControlSource = this.obj.proc_tvav
		*!*	this.clb_vanzare.tx_tvav.ControlSource = this.obj.tvav
		
		Select crs_cote_tva_inventar
		This.clb_vanzare.Cb_cota_tva.Value = Alltrim(denumire)
		
		IF !this.lCopiere
			This.do_cauta_articol()
		ENDIF 	
		This.clb_gestiune._cbbase1.SetFocus()
		Thisform.alege_gestiune()	&&	modificare	v 2.2.6
	ENDPROC

	PROCEDURE clb_gestiune._CBBASE1.Valid
		*!*	modificare	v 2.2.6
		Thisform.alege_gestiune()
		*!*	SELECT crsGestiuni
		*!*	SCATTER NAME oart
		*!*	oinv.id_gestiune = oart.id_gestiune
		*!*	*oinv.nr_pag = oart.nr_pag
		*!*	IF !thisform.lobinv
		*!*		IF oart.nr_pag = 6
		*!*			thisform.clb_vanzare.Visible = .t.
		*!*	*!*			thisform.Height = 320 +50
		*!*		ELSE 
		*!*			thisform.clb_vanzare.Visible  = .f.
		*!*	*!*			thisform.Height = 229	+50
		*!*		ENDIF 
		*!*	ENDIF 
		*!*	modificare	v 2.2.6	^
	ENDPROC

	PROCEDURE Clb_Valuta.Combo1.Valid
		oinv.id_Valuta = crsValuteTemp.id_valuta
	ENDPROC

	PROCEDURE Clb_vanzare.cb_cota_tva.InteractiveChange
		oinv.proc_tvav = crs_cote_tva_inventar.cota_tva
		oinv.tvav = oinv.pretv * oinv.proc_tvav / 100
		This.Parent.tx_tva.Refresh()
	ENDPROC

	PROCEDURE Clb_vanzare.TEXT_SIMPLU1.InteractiveChange
		oinv.proc_tvav = crs_cote_tva_inventar.cota_tva
		oinv.tvav = This.Value * oinv.proc_tvav / 100
		This.Parent.tx_tva.Refresh()
	ENDPROC

ENDDEFINE

DEFINE CLASS recapitulatie_inventar AS custom 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<DefinedPropArrayMethod>
		*m: newpage
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		Name = "recapitulatie_inventar"
		_memberdata = <VFPData>
			<memberdata name="newpage" type="method" display="NewPage"/>
		</VFPData>
	*</PropValue>
	
	PROCEDURE Destroy
		LOCAL lcSelect
		lcSelect = SELECT()
		USE IN (SELECT('cRecapitulatieInventarPagini'))
		
		SELECT (lcSelect)
	ENDPROC

	PROCEDURE Init
		LOCAL lcSelect
		lcSelect = SELECT()
		
		CREATE CURSOR cRecapitulatieInventarPagini (grup c(250) NULL, pagina i, valoare n(18,4))
		
		SELECT (lcSelect)
	ENDPROC

	PROCEDURE newpage
		LPARAMETERS tcGrup, tnPagina, tnValoare
		LOCAL lcSelect
		lcSelect = SELECT()
		
		SELECT cRecapitulatieInventarPagini
		LOCATE FOR pagina = tnPagina
		IF !FOUND()
			INSERT INTO cRecapitulatieInventarPagini (grup, pagina, valoare) VALUES (tcGrup, tnPagina, tnValoare)
		ENDIF 	
		
		SELECT (lcSelect)
	ENDPROC

ENDDEFINE

DEFINE CLASS tip_inventar 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="Optiongroup1" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 152
		Name = "tip_inventar"
		Width = 292
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 288
		_shape2.Height = 29
		_shape2.Left = 264
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 27
		Lb_titlu_alb_b121.Caption = "Tipul inventarului"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 260
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'Optiongroup1' AS optiongroup WITH ;
		BackStyle = 0, ;
		ButtonCount = 5, ;
		Height = 107, ;
		Left = 26, ;
		Name = "Optiongroup1", ;
		Top = 35, ;
		Value = 1, ;
		Width = 243, ;
		Option1.AutoSize = .T., ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Inventariere materiale/marfã", ;
		Option1.FontCharSet = 238, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.TabIndex = 1, ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 172, ;
		Option2.AutoSize = .T., ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Inventariere obiecte inventar în folosinþã", ;
		Option2.FontCharSet = 238, ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.TabIndex = 2, ;
		Option2.Top = 24, ;
		Option2.Value = 0, ;
		Option2.Width = 234, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Inventar cu bon de consum", ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 43, ;
		Option3.Value = 0, ;
		Option3.Width = 166, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "Inventar ROAVIN", ;
		Option4.Height = 17, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Top = 62, ;
		Option4.Value = 0, ;
		Option4.Width = 108, ;
		Option5.AutoSize = .T., ;
		Option5.BackStyle = 0, ;
		Option5.Caption = "Inventar magazin", ;
		Option5.Height = 17, ;
		Option5.Left = 5, ;
		Option5.Name = "Option5", ;
		Option5.Top = 81, ;
		Option5.Value = 0, ;
		Option5.Width = 111
		*< END OBJECT: BaseClass="optiongroup" />
	
	PROCEDURE inainte_de_do_termin
		*!*	1 = INVENTAR STOC 
		*!*	2 = INVENTAR STOC OBIECTE DE INVENTAR IN FOLOSINTA
		*!*	3 = INVENTAR CU BON CONSUM
		*!*	4 = INVENTAR ROAVIN
		*!*	5 = INVENTAR MAGAZIN
		
		*!* ROAVIN 2.0.0
		
		*!* 24.02.2010
		*!* marius.mutu
		*!* inventar bon de consum TIP = 3
		*!* inventar magazin TIP = 5
		
		nTipInv = Thisform.optiongroup1.Value
		
	ENDPROC

	PROCEDURE Optiongroup1.Option3.When
		*!* 24.02.2010
		*!* marius.mutu
		*!* nu se face inventar cu bon de consum de aici
		*!* daca se da de aici - da erori legate de actactan in inventar.inainte_de_do_termin
		RETURN .F.
	ENDPROC

ENDDEFINE
