*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="stocuri.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS frm_fara_miscare 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="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="data1Lbl" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="data2Lbl" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 161
		Name = "frm_fara_miscare"
		Width = 334
		WindowState = 0
		_shape1.Height = 29
		_shape1.Left = -1
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 340
		_shape2.Height = 29
		_shape2.Left = 302
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 32
		Lb_titlu_alb_b121.Caption = "Stocuri fara miscare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 3
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 303
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'data1Lbl' AS _label WITH ;
		BackStyle = 0, ;
		Caption = "", ;
		FontName = "Arial Narrow", ;
		Height = 18, ;
		Left = 139, ;
		Name = "data1Lbl", ;
		Top = 107, ;
		Width = 2
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'data2Lbl' AS _label WITH ;
		BackStyle = 0, ;
		Caption = "", ;
		FontName = "Arial Narrow", ;
		Height = 18, ;
		Left = 139, ;
		Name = "data2Lbl", ;
		Top = 131, ;
		Width = 2
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label1' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Selectati articolele care nu au mai ", ;
		Height = 18, ;
		Left = 11, ;
		Name = "Label1", ;
		TabIndex = 4, ;
		Top = 57, ;
		Width = 203
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label2' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "- Data intrarii <= ", ;
		Height = 18, ;
		Left = 68, ;
		Name = "Label2", ;
		TabIndex = 5, ;
		Top = 106, ;
		Width = 100
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label3' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "- Data iesirii <=", ;
		Height = 18, ;
		Left = 68, ;
		Name = "Label3", ;
		TabIndex = 6, ;
		Top = 130, ;
		Width = 91
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label4' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Explicatie: ", ;
		Height = 18, ;
		Left = 12, ;
		Name = "Label4", ;
		TabIndex = 7, ;
		Top = 106, ;
		Width = 67
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label5' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "avut miscare din data", ;
		Height = 18, ;
		Left = 66, ;
		Name = "Label5", ;
		TabIndex = 8, ;
		Top = 74, ;
		Width = 125
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label6' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "(sau nula)", ;
		Height = 18, ;
		Left = 265, ;
		Name = "Label6", ;
		TabIndex = 9, ;
		Top = 106, ;
		Width = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Label7' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "(sau nula)", ;
		Height = 18, ;
		Left = 265, ;
		Name = "Label7", ;
		TabIndex = 10, ;
		Top = 130, ;
		Width = 59
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Text1' AS _textbox WITH ;
		ControlSource = "ldDataFM", ;
		Format = "K", ;
		Height = 23, ;
		Left = 218, ;
		Name = "Text1", ;
		TabIndex = 1, ;
		Top = 63, ;
		Width = 109
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Activate
		thisform.data1Lbl.Caption = DTOC(ldDataFM)
		thisform.data2Lbl.Caption = DTOC(ldDataFM)
	ENDPROC

	PROCEDURE Text1.Valid
		thisform.data1Lbl.Caption = DTOC(ldDataFM)
		thisform.data2Lbl.Caption = DTOC(ldDataFM)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_stocuri 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="optgrup" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cum.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cum.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccants.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccants.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccante.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccante.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cstoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cstoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cacont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cacont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretvtva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretvtva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ctvav.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ctvav.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretd.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretd.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdatain.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdatain.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdataout.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdataout.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column19.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column19.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cIdArticol.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cIdArticol.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCantBax.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCantBax.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cUm2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cUm2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column23.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column23.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column24.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column24.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cNume_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cNume_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodmatF.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodmatF.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataExpirare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataExpirare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cLot.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cLot.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cPart_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cPart_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cNrord_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cNrord_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodbare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodbare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cfurn_princ.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cfurn_princ.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cValoarePretA.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cValoarePretA.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cValoarePretV.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cValoarePretV.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodNC8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodNC8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGreutate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGreutate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cTaraOrigine.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cTaraOrigine.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shp_total" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text9" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text12" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Chk_fara_miscare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cboValuta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: butappend
		*m: calcul_sume
		*m: do_listare_articol
		*m: do_listare_borderou
		*m: do_listare_fisa_magazie
		*m: do_listare_fisa_magazie_explicativa
		*m: do_listare_fisa_magazie_in_valuta
		*m: do_listare_selectie
		*m: initializare
		*p: cfiltruinitial
		*p: cmonedanationala
		*p: cnewvalue
		*p: coldvalue
		*p: cvalutatotal
		*p: data_f_misc
		*p: data_ref
		*p: lmodificare_totaluri
		*p: lmodificata
		*p: ngridheight
		*p: nidmonedanationala
		*p: nidvalutatotal
		*p: ntipgest
		*p: vstoc_final
		*p: vstoc_finalv
		*p: vstoc_final_tot
		*p: vstoc_in
		*p: vstoc_inv
		*p: vstoc_in_tot
		*p: vstoc_out
		*p: vstoc_outv
		*p: vstoc_out_tot
		*p: vstoc_prec
		*p: vstoc_precv
		*p: vstoc_prec_tot
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cbuton2 = but_listare1;but_listare2
		cgridsortlist = grdStocuri
		cmonedanationala = 
		cnewvalue = .F.
		coldvalue = .F.
		cvalutatotal = 
		data_f_misc = .F.
		data_ref = {}
		DoCreate = .T.
		FontName = "Arial Narrow"
		Height = 411
		lmodificare_totaluri = .F.
		lmodificata = .F.
		Name = "frm_stocuri"
		ngridheight = 0
		nidmonedanationala = 0
		nidvalutatotal = 0
		ntipgest = 0
		vstoc_final = 0
		vstoc_finalv = 0
		vstoc_final_tot = 0
		vstoc_in = 0
		vstoc_inv = 0
		vstoc_in_tot = 0
		vstoc_out = 0
		vstoc_outv = 0
		vstoc_out_tot = 0
		vstoc_prec = 0
		vstoc_precv = 0
		vstoc_prec_tot = 0
		Width = 867
		WindowState = 2
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "RESIZABLE,NOVERTICAL_RESIZE"
		_shape1.Top = 0
		_shape1.Width = 867
		_shape1.ZOrderSet = 2
		_shape2.Height = 28
		_shape2.Left = 688
		_shape2.Name = "_shape2"
		_shape2.Tag = "MOVABLE,NOVERTICAL_MOVE"
		_shape2.Top = 1
		_shape2.Width = 208
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "STOCURI"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 45
		Lb_titlu_alb_b121.Top = 1
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 837
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 22
		BUT_TERMIN1.Tag = "MOVABLE,NOVERTICAL_MOVE"
		BUT_TERMIN1.ToolTipText = "Terminare"
		BUT_TERMIN1.Top = 2
		BUT_TERMIN1.Width = 30
		BUT_TERMIN1.ZOrderSet = 49
		Gridsort1.Left = 204
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 34
	*</PropValue>

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

	ADD OBJECT 'But_listare2' AS but_listare WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 807, ;
		Name = "But_listare2", ;
		TabIndex = 26, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Listare selectie", ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = butappend, ;
		Height = 27, ;
		Left = 720, ;
		Name = "But_modifica1", ;
		TabIndex = 29, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 45
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 690, ;
		Name = "But_reface1", ;
		TabIndex = 30, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 46
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 748, ;
		Name = "But_verifica1", ;
		SpecialEffect = 1, ;
		TabIndex = 28, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'cboValuta' AS _cbbase WITH ;
		ControlSource = "thisform.cValutaTotal", ;
		Height = 24, ;
		Left = 221, ;
		Name = "cboValuta", ;
		RowSource = "cValuteRulTemp.nume_val", ;
		RowSourceType = 2, ;
		SpecialEffect = 2, ;
		Top = 56, ;
		Visible = .F., ;
		Width = 125
		*< END OBJECT: ClassLib="_cb_base.vcx" BaseClass="combobox" />

	ADD OBJECT 'Chk_fara_miscare' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Fara miscare", ;
		Height = 18, ;
		Left = 7, ;
		Name = "Chk_fara_miscare", ;
		TabIndex = 19, ;
		Top = 33, ;
		Width = 95, ;
		ZOrderSet = 52
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdStocuri' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 40, ;
		DeleteMark = .F., ;
		HeaderHeight = 38, ;
		Height = 250, ;
		Left = 6, ;
		Name = "grdStocuri", ;
		Panel = 1, ;
		RecordSource = "crsStocuri", ;
		RowHeight = 19, ;
		TabIndex = 31, ;
		Tag = "RESIZABLE", ;
		Top = 153, ;
		Width = 855, ;
		ZOrderSet = 12, ;
		Column1.ControlSource = "nr_crt", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 34, ;
		Column2.ControlSource = "codmat", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Ccodmat", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 94, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "denumire", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Cdenumire", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 200, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "um", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Cum", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 45, ;
		Column5.ColumnOrder = 10, ;
		Column5.ControlSource = "pret", ;
		Column5.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "r", ;
		Column5.InputMask = (get_mask(16,gnPPRET)), ;
		Column5.Name = "Cpret", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 82, ;
		Column6.ColumnOrder = 11, ;
		Column6.ControlSource = "cants", ;
		Column6.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "r", ;
		Column6.InputMask = (get_mask(14,gnPCANT)), ;
		Column6.Name = "Ccants", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 97, ;
		Column7.ColumnOrder = 12, ;
		Column7.ControlSource = "cant", ;
		Column7.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Format = "r", ;
		Column7.InputMask = (get_mask(14,gnPCANT)), ;
		Column7.Name = "Ccant", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 73, ;
		Column8.ColumnOrder = 13, ;
		Column8.ControlSource = "cante", ;
		Column8.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "r", ;
		Column8.InputMask = (get_mask(14,gnPCANT)), ;
		Column8.Name = "Ccante", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 67, ;
		Column9.ColumnOrder = 14, ;
		Column9.ControlSource = "cants+cant-cante", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Format = "r", ;
		Column9.InputMask = (get_mask(16,gnPCANT)), ;
		Column9.Name = "Cstoc", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 73, ;
		Column10.ColumnOrder = 16, ;
		Column10.ControlSource = "cont", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Ccont", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 55, ;
		Column11.ColumnOrder = 17, ;
		Column11.ControlSource = "acont", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Cacont", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 54, ;
		Column12.ColumnOrder = 18, ;
		Column12.ControlSource = "cgest", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Ccgest", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 124, ;
		Column13.ColumnOrder = 21, ;
		Column13.ControlSource = "pretv", ;
		Column13.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "r", ;
		Column13.InputMask = (get_mask(16,gnPPretV)), ;
		Column13.Name = "Cpretv", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 96, ;
		Column14.ColumnOrder = 19, ;
		Column14.ControlSource = "pretv+tvav", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "r", ;
		Column14.InputMask = (get_mask(16,gnPPretV)), ;
		Column14.Name = "Cpretvtva", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 83, ;
		Column15.ColumnOrder = 22, ;
		Column15.ControlSource = "tvav", ;
		Column15.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Format = "r", ;
		Column15.InputMask = (get_mask(16,gnPPretV)), ;
		Column15.Name = "Ctvav", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 82, ;
		Column16.ColumnOrder = 24, ;
		Column16.ControlSource = "pretd", ;
		Column16.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Format = "r", ;
		Column16.InputMask = (get_mask(16,gnPPretVAL)), ;
		Column16.Name = "Cpretd", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 80, ;
		Column17.ColumnOrder = 26, ;
		Column17.ControlSource = "datain", ;
		Column17.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "Cdatain", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 99, ;
		Column18.ColumnOrder = 27, ;
		Column18.ControlSource = "dataout", ;
		Column18.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "Cdataout", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 102, ;
		Column19.Alignment = 1, ;
		Column19.ColumnOrder = 23, ;
		Column19.ControlSource = "proc_tvav", ;
		Column19.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.InputMask = "99.99", ;
		Column19.Name = "Column19", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 58, ;
		Column20.ColumnOrder = 34, ;
		Column20.ControlSource = "id_articol", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cIdArticol", ;
		Column20.ReadOnly = .T., ;
		Column20.Width = 70, ;
		Column21.ColumnOrder = 6, ;
		Column21.ControlSource = "cant_bax", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cCantBax", ;
		Column21.Width = 40, ;
		Column22.ColumnOrder = 7, ;
		Column22.ControlSource = "um2", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cUm2", ;
		Column22.Width = 39, ;
		Column23.ColumnOrder = 8, ;
		Column23.ControlSource = "grupa", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "Column23", ;
		Column23.Width = 107, ;
		Column24.ColumnOrder = 9, ;
		Column24.ControlSource = "subgrupa", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "Column24", ;
		Column24.Width = 108, ;
		Column25.ColumnOrder = 4, ;
		Column25.ControlSource = "serie", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cSerie", ;
		Column26.ColumnOrder = 25, ;
		Column26.ControlSource = "nume_val", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cNume_val", ;
		Column26.Width = 68, ;
		Column27.ColumnOrder = 28, ;
		Column27.ControlSource = "codmatf", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "cCodmatF", ;
		Column27.Width = 92, ;
		Column28.ColumnOrder = 30, ;
		Column28.ControlSource = "adata_expirare", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Name = "cDataExpirare", ;
		Column28.Width = 100, ;
		Column29.ColumnOrder = 29, ;
		Column29.ControlSource = "lot", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cLot", ;
		Column30.ColumnOrder = 33, ;
		Column30.ControlSource = "sucursala", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.Name = "cSucursala", ;
		Column30.ReadOnly = .T., ;
		Column30.Width = 136, ;
		Column31.ColumnOrder = 31, ;
		Column31.ControlSource = "part_rez", ;
		Column31.FontName = "Arial", ;
		Column31.FontSize = 10, ;
		Column31.Name = "cPart_rez", ;
		Column31.Width = 114, ;
		Column32.ColumnOrder = 32, ;
		Column32.ControlSource = "nrord_rez", ;
		Column32.FontName = "Arial", ;
		Column32.FontSize = 10, ;
		Column32.Name = "cNrord_rez", ;
		Column32.Width = 112, ;
		Column33.ColumnOrder = 35, ;
		Column33.ControlSource = "codbare", ;
		Column33.FontName = "Arial", ;
		Column33.FontSize = 10, ;
		Column33.Name = "cCodbare", ;
		Column33.ReadOnly = .T., ;
		Column33.Width = 163, ;
		Column34.ColumnOrder = 36, ;
		Column34.ControlSource = "furn_princ", ;
		Column34.FontName = "Arial", ;
		Column34.FontSize = 10, ;
		Column34.Name = "cfurn_princ", ;
		Column34.ReadOnly = .T., ;
		Column34.Width = 123, ;
		Column35.ColumnOrder = 37, ;
		Column35.ControlSource = "furnizor", ;
		Column35.FontName = "Arial", ;
		Column35.FontSize = 10, ;
		Column35.Name = "cFurnizor", ;
		Column35.ReadOnly = .T., ;
		Column35.Width = 147, ;
		Column36.ColumnOrder = 15, ;
		Column36.ControlSource = "round((cants+cant-cante)*pret, gnPA)", ;
		Column36.FontName = "Arial", ;
		Column36.FontSize = 10, ;
		Column36.Format = "R", ;
		Column36.InputMask = (get_mask(16,gnPa)), ;
		Column36.Name = "cValoarePretA", ;
		Column36.ReadOnly = .T., ;
		Column36.Width = 140, ;
		Column37.ColumnOrder = 20, ;
		Column37.ControlSource = "round((cants+cant-cante)*(pretv+tvav), gnPA)", ;
		Column37.FontName = "Arial", ;
		Column37.FontSize = 10, ;
		Column37.Format = "R", ;
		Column37.InputMask = (get_mask(16,gnPa)), ;
		Column37.Name = "cValoarePretV", ;
		Column37.ReadOnly = .T., ;
		Column37.Width = 96, ;
		Column38.ControlSource = "codnc8", ;
		Column38.Name = "cCodNC8", ;
		Column38.ReadOnly = .T., ;
		Column38.Width = 150, ;
		Column39.ControlSource = "greutate", ;
		Column39.Name = "cGreutate", ;
		Column39.ReadOnly = .T., ;
		Column40.ControlSource = "tara_origine", ;
		Column40.Name = "cTaraOrigine", ;
		Column40.ReadOnly = .T., ;
		Column40.Width = 166
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.cCodbare.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 'grdStocuri.Ccodmat.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod. Mat.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdStocuri.cCodNC8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod NC8", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.Cdatain.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 'grdStocuri.Cdataout.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data ultimei iesiri", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdStocuri.cFurnizor.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 'grdStocuri.cGreutate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Greutate (Kg)", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.Cnr_crt.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, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.Column19.Text1' AS textbox WITH ;
		Alignment = 1, ;
		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 'grdStocuri.Column23.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Grupa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.Cpret.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 'grdStocuri.Cpretd.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.Cpretd.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 'grdStocuri.Cpretv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret vanzare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

	ADD OBJECT 'grdStocuri.cTaraOrigine.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 240,240,240, ;
		Caption = "Tara origine", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdStocuri.cValoarePretA.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare stoc pret ach.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.cValoarePretA.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 'grdStocuri.cValoarePretV.Header1' AS header WITH ;
		Alignment = 1, ;
		Caption = "Valoare stoc pret vz. cu TVA", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.cValoarePretV.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 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.grdStocuri, ;
		Height = 17, ;
		Left = 279, ;
		Name = "Gridextra1", ;
		Top = 37, ;
		Width = 33
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

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

	ADD OBJECT 'lbl1' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Stoc Precedent", ;
		Height = 21, ;
		Left = 349, ;
		Name = "lbl1", ;
		TabIndex = 49, ;
		Top = 59, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl2' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Intrari", ;
		Height = 21, ;
		Left = 475, ;
		Name = "lbl2", ;
		TabIndex = 50, ;
		Top = 59, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl3' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Iesiri", ;
		Height = 21, ;
		Left = 601, ;
		Name = "lbl3", ;
		TabIndex = 52, ;
		Top = 59, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl4' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Stoc Final", ;
		Height = 21, ;
		Left = 728, ;
		Name = "lbl4", ;
		TabIndex = 51, ;
		Top = 59, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl5' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Preturi de achizitie fara TVA", ;
		Height = 21, ;
		Left = 177, ;
		Name = "lbl5", ;
		TabIndex = 46, ;
		Top = 81, ;
		Visible = .F., ;
		Width = 169, ;
		ZOrderSet = 30
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl6' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Preturi de vanzare cu TVA", ;
		Height = 21, ;
		Left = 177, ;
		Name = "lbl6", ;
		TabIndex = 47, ;
		Top = 103, ;
		Visible = .F., ;
		Width = 169, ;
		ZOrderSet = 31
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl7' AS _label WITH ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Diferenta vanzare - achizitie:", ;
		Height = 21, ;
		Left = 177, ;
		Name = "lbl7", ;
		TabIndex = 48, ;
		Top = 125, ;
		Visible = .F., ;
		Width = 169, ;
		ZOrderSet = 32
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblValuta' AS _label WITH ;
		AutoSize = .T., ;
		BackColor = 255,255,255, ;
		BackStyle = 0, ;
		Caption = "Valuta", ;
		Height = 18, ;
		Left = 179, ;
		Name = "lblValuta", ;
		TabIndex = 10, ;
		Top = 59, ;
		Visible = .F., ;
		Width = 39, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'optgrup' AS _optiongrup WITH ;
		AutoSize = .F., ;
		BackColor = 239,239,239, ;
		BackStyle = 1, ;
		ButtonCount = 4, ;
		Height = 96, ;
		Left = 1, ;
		Name = "optgrup", ;
		TabIndex = 32, ;
		Top = 55, ;
		Value = 3, ;
		Width = 172, ;
		ZOrderSet = 1, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Gestiuni la pret de achizitie", ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Style = 0, ;
		Option1.Top = 27, ;
		Option1.Value = 0, ;
		Option1.Width = 165, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Gestiuni la pret de vanzare", ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 47, ;
		Option2.Value = 0, ;
		Option2.Width = 163, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Toate gestiunile", ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 66, ;
		Option3.Value = 1, ;
		Option3.Width = 106, ;
		Option4.AutoSize = .T., ;
		Option4.BackStyle = 0, ;
		Option4.Caption = "Gestiuni la pret de achizitie*", ;
		Option4.Height = 17, ;
		Option4.Left = 5, ;
		Option4.Name = "Option4", ;
		Option4.Top = 8, ;
		Option4.Width = 170
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'shp_total' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 239,239,239, ;
		BackStyle = 1, ;
		Height = 96, ;
		Left = 174, ;
		Name = "shp_total", ;
		SpecialEffect = 0, ;
		Top = 55, ;
		Width = 688, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Text1' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_prec", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 349, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 33, ;
		Top = 81, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text10' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_in_tot", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 475, ;
		Name = "Text10", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 38, ;
		Top = 125, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text11' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_out_tot", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 601, ;
		Name = "Text11", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 41, ;
		Top = 125, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 28
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text12' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_final_tot", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 728, ;
		Name = "Text12", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 44, ;
		Top = 125, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 29
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text2' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_in", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 475, ;
		Name = "Text2", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 36, ;
		Top = 81, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text3' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_out", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 601, ;
		Name = "Text3", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 39, ;
		Top = 81, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text4' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_final", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 728, ;
		Name = "Text4", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 42, ;
		Top = 81, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text5' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_precv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 349, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 34, ;
		Top = 103, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 22
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text6' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_inv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 475, ;
		Name = "Text6", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 37, ;
		Top = 103, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text7' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_outv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 601, ;
		Name = "Text7", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 40, ;
		Top = 103, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text8' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_finalv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 728, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 43, ;
		Top = 103, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text9' AS _textbox WITH ;
		Alignment = 1, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_prec_tot", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 349, ;
		Name = "Text9", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 35, ;
		Top = 125, ;
		Visible = .F., ;
		Width = 125, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS tcFiltru
		LOCAL lcFiltru
		IF EMPTY(tcFiltru)
			lcFiltru = poStocuri.ca_baza1.cfiltru
		ELSE
			lcFiltru = tcFiltru
		ENDIF 
		
		save_grid_tag(This.grdStocuri)
		poStocuri.ca_baza1.cfiltru=lcFiltru
		poStocuri.ca_baza1.afisare()
		restore_grid_tag(This.grdStocuri)
		this.grdStocuri.refresh
		
		
	ENDPROC

	PROCEDURE butappend
		If glLunaInchisa
			aMESSAGEBOX('Luna este inchisa!',0+48,"Atentie")
			RETURN
		ENDIF
		
		*RETURN 
		
		Private lcText,lcFis,lnOpt
		
		
		If Thisform.grdStocuri.ReadOnly
			lcText=[\<Deblocare;]
			lcText=lcText+[\-;]
			lcText=lcText+[\Adauga Blanc;]
			lcText=lcText+[\Sterge]
		Else
			If Thisform.lmodificata
				Thisform.do_modifica()
			Endif
			lcText=[\<Revenire;]
			lcText=lcText+[\-;]
			lcText=lcText+[\<Adauga Blanc;]
			lcText=lcText+[\<Sterge]
		Endif
		lnOpt=xmenu(lcText)
		Do Case
		Case lnOpt=1
			Thisform.initializare()
		Case lnOpt=3
			Thisform.do_adauga()
		Case lnOpt=4
			Thisform.do_sterge()
		Endcase
	ENDPROC

	PROCEDURE calcul_sume
		LPARAMETERS tlRefreshValute
		LOCAL lcSelect, lcFilter
		lcSelect = SELECT()
		&& tlRefreshValute = .T. din this.actualizeazagrid1 - sa reconstruiasca cursorul cu valutele existente in selectie
		&& tlRefreshValute = .F. - doar schimb valuta din cboValute - recalculez totalurile fara sa reconstruiesc cursorul cu valute
		
		
		SELECT crsStocuri
		lcFilter = FILTER('crsStocuri')
		lcFilter = STRTRAN(m.lcFilter, 'crsstocuri.','',1,10,1)
		WITH THISFORM
		
			IF tlRefreshValute
				this.cboValuta.RowSource = ""
				*!* cursor valute pentru calcul totaluri intr-o valuta
				SELECT this.nIdMonedaNationala  AS id_valuta, this.cMonedaNationala AS nume_val ;
					FROM dual ;
					UNION ;
					SELECT DISTINCT id_valuta, nume_val;
					FROM crsStocuri ;
					WHERE id_valuta <> this.nIdMonedaNationala ;
					INTO CURSOR cValuteRulTemp
		
				this.cboValuta.RowSource = "cValuteRulTemp.nume_val"	
				this.cboValuta.ControlSource = "thisform.cValutaTotal"		
			ENDIF
		
			&& daca am ales moneda nationala pentru calcul total - cant*pret
			&& daca am ales o valuta - total = cant*pretd si id_valuta aleasa
			IF .nIdValutaTotal = .nIdMonedaNationala OR INLIST(UPPER(ALLTRIM(.cValutaTotal)),'LEI','RON','ROL') 
				lcWhere = "2=2"
				lcPret = "pret"
			ELSE
				lcWhere = "id_valuta = " + ALLTRIM(STR(.nIdValutaTotal))
				lcPret = "pretd"
			ENDIF
			lcWhere = lcWhere + IIF(!EMPTY(m.lcFilter), [ and ] + m.lcFilter, [])
			
			SELECT crsStocuri
			IF .optgrup.VALUE!=3
				CALCULATE SUM(ROUND(&lcPret*cants,gnPc)), ;
					SUM(ROUND(&lcPret*cant,gnPc)), ;
					SUM(ROUND(&lcPret*cante,gnPc)), ;
					SUM(ROUND(&lcPret*(cants+cant-cante),gnPc)) ;
					FOR &lcWhere ;
					TO .vstoc_prec,.vstoc_in,.vstoc_out,.vstoc_final IN crsStocuri
		
				IF INLIST(.optgrup.VALUE, 2,4)
					CALCULATE SUM(ROUND((pretv+tvav)*cants,gnPc)),SUM(ROUND((pretv+tvav)*cant,gnPc)),SUM(ROUND((pretv+tvav)*cante,gnPc)), SUM(ROUND((pretv+tvav)*(cants+cant-cante),gnPc));
						TO .vstoc_precv,.vstoc_inv,.vstoc_outv, .vstoc_finalv IN crsStocuri
		
					.vstoc_prec_tot = .vstoc_precv - .vstoc_prec
					.vstoc_in_tot = .vstoc_inv - .vstoc_in
					.vstoc_out_tot = .vstoc_outv - .vstoc_out
					.vstoc_final_tot = .vstoc_finalv - .vstoc_final
				ENDIF
			ENDIF
			FOR i=1 TO 4 DO
		
				lcRefresh1 = IIF(.optgrup.VALUE=3,'',[.text]+ALLTRIM(STR(i))+[.refresh])
				lcRefresh2 = IIF(.optgrup.VALUE!=2,'',[.text]+ALLTRIM(STR(4+i))+[.refresh])
				lcRefresh3 = IIF(.optgrup.VALUE!=2,'',[.text]+ALLTRIM(STR(8+i))+[.refresh])
				&lcRefresh1
				&lcRefresh2
				&lcRefresh3
			ENDFOR
		
		ENDWITH
		
		thisform.Refresh 
	ENDPROC

	PROCEDURE do_adauga
		Local lcdenumire, lccodmat, lcum , lcExplicatieC,lcCont,lcAcont,lcExplicatieA, lcnume_gest,lccgest
		LOCAL lnpret,lnpretd,lnpretv,lntvav,lnproc_tvav
		LOCAL lnid_articol, lnid_gestiune
		*!*	Store "" To locauta
		*!*	pcselect = [select distinct a.denumire,a.codmat,a.um,a.pret,a.pretd,a.pretv,a.tvav,a.proc_tvav, ] + ;
		*!*			   [a.id_articol,b.id_tipgest from ] + gcs + [.vnom_articole a  inner join coresp_cont_tipgest b on a.cont = b.cont]
		*!*	pcfiltru = [1=2]
		*!*	pcschema = ['']
		*!*	pcorder = [denumire]
		*!*	pccoloane = [denumire,codmat]
		*!*	pcTitlu = [Alegeti denumirea]
		*!*	pcTitluColoane = [Denumire,Cod Material]
		*!*	pcFiltruOriginal = [ b.id_tipgest = ]+ALLTRIM(STR(tntipgest))
		*!*	lcNumeProc = [nom_articole]
		*!*	llToateIreg = .F.
		*!*	locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane, lcNumeProc, llToateIreg, pcFiltruOriginal)
		lntg = thisform.ntipgest 
		IF EMPTY(lntg)
			aMESSAGEBOX('Tip gestiune incorect!',16,'Eroare')
			RETURN 
		ENDIF 	
		locauta = caut_articol(lntg)
		
		If !Empty(locauta.denumire)
			lcdenumire = ALLTRIM(locauta.denumire)
			lccodmat = ALLTRIM(locauta.codmat)
			lcum = ALLTRIM(locauta.um)	
		*!*		lnpret=locauta.pret
		*!*		lnpretd=locauta.pretd
		*!*		lnpretv=locauta.pretv
		*!*		lntvav=locauta.tvav
		*!*		lnproc_tvav=locauta.proc_tvav
			lnid_articol=locauta.id_articol
			
		Else
			RETURN
		ENDIF
		
		
		Store "" To locauta
		
		*!*	pcselect = [select a.explicatie,a.cont,a.id_plcont,b.id_tipgest from ]+gcs+[.plcont a inner join coresp_cont_tipgest b on a.cont = b.cont] 
		*!*	pcfiltru = [1=2]
		*!*	pcschema = ['']
		*!*	pcorder = [cont]
		*!*	pccoloane = [cont,explicatie]
		*!*	pcTitlu = [Alegeti Contul]
		*!*	pcTitluColoane = [Cont,Explicatie]
		*!*	pcFiltruOriginal = [ b.id_tipgest = ]+ALLTRIM(STR(tntipgest))+[ and a.an=]+ALLTRIM(STR(gnan))
		*!*	lcNumeProc = []
		*!*	llToateIreg = .F.
		*!*	lcPrimaColoana = [a.cont]
		*!*	locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane, lcNumeProc, llToateIreg, pcFiltruOriginal, lcPrimaColoana)
		locauta = caut_cont(lntg)
		If !Empty(locauta.cont)
			lcExplicatieC = ALLTRIM(locauta.explicatie)
			lccont = ALLTRIM(locauta.cont)
			lcAcont = ALLTRIM(locauta.acont)
		Else
			Return
		ENDIF
		
		Store "" To locauta
		*!*	pcselect = [select a.acont,a.explicatie,a.id_plcont,a.an,b.id_tipgest FROM ] + gcs + [.vplcont_analitic a inner join coresp_cont_tipgest b on a.cont = b.cont] 
		*!*	pcfiltru = [1=2]
		*!*	pcschema = ['']
		*!*	pcorder = [acont]
		*!*	pccoloane = [acont,explicatie]
		*!*	pcTitlu = [Alegeti contul analitic]
		*!*	pcTitluColoane = [Acont,Explicatie]
		*!*	pcFiltruOriginal = [ a.cont=]+Alltrim(lccont)+[ and a.an=]+Alltrim(Str(gnAn))+[ and b.id_tipgest = ]+ALLTRIM(STR(tntipgest))
		*!*	lcNumeProc = []
		*!*	llToateIreg = .F.
		*!*	lcPrimaColoana = [a.acont]
		*!*	locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane, lcNumeProc, llToateIreg, pcFiltruOriginal, lcPrimaColoana)
		
		*!*	modificare	18.02.2008
		*!*	locauta = caut_acont(lccont)
		*!*	If !Empty(locauta.acont)
		*!*		lcExplicatieA = ALLTRIM(locauta.explicatie)
		*!*		lcAcont = ALLTRIM(locauta.acont)
		*!*	Else
		*!*		If gnButon=2
		*!*			Return
		*!*		Else
		*!*		lcExplicatieA = ""
		*!*		lcAcont = ""
		*!*		Endif
		*!*	ENDIF
		*!*	modificare	18.02.2008	^
		
		Store "" To locauta
		*!*	pcselect = [select nume_gestiune,cgest,id_gestiune,nr_pag,cont  from ]+gcs+[.vnom_gestiuni  ]
		*!*	pcfiltru = [ 1=2 ]
		*!*	pcschema = ['']
		*!*	pcorder = [nume_gestiune]
		*!*	pccoloane = [nume_gestiune,cgest]
		*!*	pcTitlu = [Alegeti Gestiunea]
		*!*	pcTitluColoane = [Gestiune,Cgest]
		*!*	pcFiltruOriginal = [nr_pag = ]+ALLTRIM(STR(tntipgest)) 
		*!*	lcNumeProc = []
		*!*	llToateIreg = .F.
		*!*	locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane, lcNumeProc, llToateIreg, pcFiltruOriginal)
		locauta = caut_gestiune(lntg,gnidutil)
		
		If !Empty(locauta.cgest) OR !EMPTY(locauta.nume_gestiune)
			lcnume_gest = ALLTRIM(locauta.nume_gestiune)
			lccgest = ALLTRIM(locauta.cgest)
			lnid_gestiune=locauta.id_gestiune
		Else
			Return
		ENDIF
		
		
		Select crsStocuri
		Locate For id_stoc = 0  And acont=lcAcont And cont=lccont AND cgest=lccgest 
		If !Found()
			Append Blank
			REPLACE id_gestiune	WITH lnid_gestiune
			REPLACE id_articol 	WITH lnid_articol
			REPLACE codmat		WITH lccodmat 
			REPLACE denumire 	WITH lcdenumire
			REPLACE um 			WITH lcum
			REPLACE pret 		WITH 0
			REPLACE cants 		WITH 0
			REPLACE cant 		WITH 0
			REPLACE cante 		WITH 0
			Replace Cont 		With lccont
			Replace acont 		With lcacont
			REPLACE cgest		WITH lccgest
			REPLACE pretv 		WITH 0
			REPLACE tvav 		WITH 0
			REPLACE proc_tvav 	WITH 0
			REPLACE pretd 		WITH 0
			REPLACE datain 		WITH DATE()
			REPLACE dataout 	WITH DATE()
			Thisform.lmodificata=.T.
		Endif
		Thisform.grdStocuri.SetFocus()
	ENDPROC

	PROCEDURE do_cauta
		Lparameters tcFiltru, tlForceSerch
		
		Local lcFiltru
		If !Empty(tcFiltru)
			lcFiltru = [ and ] + tcFiltru
		Else
			lcFiltru = []
		Endif
		
		****
		With Thisform
			.lbl5.Visible = Iif(.optgrup.Value=3,.F.,.T.)
			.lblValuta.Visible = Iif(.optgrup.Value=3,.F.,.T.)	
			.cboValuta.Visible = Iif(.optgrup.Value=3,.F.,.T.)		
			.lbl6.Visible = Iif(INLIST(.optgrup.Value,2,4),.T.,.F.)
			.lbl7.Visible = Iif(INLIST(.optgrup.Value,2,4),.T.,.F.)
		
			IF .optgrup.Value = 3
				.cValutatotal = .cMonedanationala 
				.nIdvalutatotal = .nIdmonedanationala 	
			ENDIF 
			
			For i=1 To 4 Do
				lcVisible1 = [.text]+Alltrim(Str(i))+[.visible=IIF(.optgrup.value=3,.f.,.t.)]
				lcVisible2 = [.text]+Alltrim(Str(4+i))+[.visible=IIF(INLIST(.optgrup.Value,2,4),.t.,.f.)]
				lcVisible3 = [.text]+Alltrim(Str(8+i))+[.visible=IIF(INLIST(.optgrup.Value,2,4),.t.,.f.)]
				lcVisible4 = [.lbl]+Alltrim(Str(i))+[.visible=IIF(.optgrup.value=3,.f.,.t.)]
				&lcVisible1
				&lcVisible2
				&lcVisible3
				&lcVisible4
			Endfor
		Endwith
		****
		
		*!*	If Thisform.ck_filtru_denumire.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_denumire.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_codmat.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_codmat.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_serie.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_serie.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_gestiune.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_gestiune.filtru_ora
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_grupegest.Value=1
		*!*		Set Textmerge On To Memvar lcFiltruTempG Noshow
		*!*			\ and a.id_gestiune in (
		*!*			\ select ID_GESTIUNE
		*!*			\	from <<gcS>>.vgest_coresp_grupe_gestiuni c
		*!*			\	join (select id_grupe
		*!*			\       from <<gcS>>.gest_nom_grupe
		*!*			\       where sters = 0
		*!*		    \       start with <<SUBSTR(THISFORM.ck_filtru_grupegest.filtru_ora,5)>>
		*!*			\       connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe )
		*!*		Set Textmerge To
		
		*!*		lcFiltru=lcFiltru + lcFiltruTempG
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_cont.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_cont.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_acont.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_acont.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_datain.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_datain.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_dataout.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_dataout.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_pret.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_pret.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_pretd.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_pretd.filtru
		*!*	ENDIF
		
		*!*	If Thisform.ck_filtru_pretv.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_pretv.filtru
		*!*	Endif
		
		*!*	If Thisform.ck_filtru_stoc.Value=1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_stoc.filtru
		*!*	Endif
		
		*!*	IF thisform.ck_filtru_valuta.Value = 1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_valuta.filtru_ora
		*!*	ENDIF
		
		*!*	IF thisform.ck_filtru_subgrupa.Value = 1
		*!*		lcFiltru=lcFiltru+Thisform.ck_filtru_subgrupa.filtru_ora
		*!*	ENDIF 
		
		*!*	If Thisform.ck_stoc_negativ.Value = 1
		*!*		lcFiltru = lcFiltru + [ AND a.cants+a.cant-a.cante<0]
		*!*	Endif
		
		*!*	If Thisform.ck_cu_rulaj.Value = 1
		*!*		lcFiltru = lcFiltru + [ AND (a.cant!=0 or a.cante!=0)]
		*!*	Endif
		
		*!*	If Thisform.ck_fara_rulaj.Value = 1
		*!*		lcFiltru = lcFiltru + [ AND (a.cant=0 and a.cante=0)]
		*!*	ENDIF
		
		If Thisform.chk_fara_miscare.Value = 1
			ldDataFM = This.data_f_misc
			lcFiltru = lcFiltru + [ AND (a.datain is null OR a.datain <= to_date('] + Dtos(ldDataFM)  +;
				[','YYYYMMDD'))] +;
				[ AND (a.dataout is null OR a.dataout <= to_date('] + Dtos(ldDataFM) +;
				[','YYYYMMDD'))]
		Endif
		
		
		If Thisform.optgrup.Enabled = .T.
			Do Case
			Case Thisform.optgrup.Value = 1
				lcFiltru = lcFiltru + [ AND a.nr_pag not in (6,7)]
			Case Thisform.optgrup.Value = 2
				lcFiltru = lcFiltru + [ AND a.nr_pag=6]
			Case Thisform.optgrup.Value = 4
				lcFiltru = lcFiltru + [ AND a.nr_pag=7]
			Endcase
		Endif
		
		If !Empty(lcFiltru)
			lcFiltru = This.cfiltruinitial + lcFiltru
		Else
			lcFiltru = This.cfiltruinitial
		Endif
		
		&& filtru pretty
		IF LEN(THISFORM.filtru_pretty)>0
			filtrutext=THISFORM.filtru_pretty
			lcFiltru=lcFiltru+" and ("+ALLTRIM(filtrutext)+")"
		ENDIF
		
		IF (THIS.filtru_pretty#"none" OR tlForceSerch)
			THISFORM.actualizeaza_grid1(lcFiltru)
			THIS.calcul_sume()
			IF RECCOUNT('crsStocuri')=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			ENDIF
			SELECT crsStocuri
			GO top
			THIS.GRdStocuri.REFRESH
		ENDIF
		THISFORM.but_start_criterii1.SETFOCUS
		
		
		
	ENDPROC

	PROCEDURE do_excel
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		lcAlias = This.grdStocuri.RecordSource
		
		If Reccount(lcAlias) > 0
			If This.optgrup.Value = 1
				With This.grdStocuri
					Store .F. To .cpretv.Visible,.cpretvtva.Visible,.ctvav.Visible
				Endwith
			Endif
		
		
		*!*	export_excel(this.grdStocuri,[STOCURI])
		
			lcFiltru = Filter(lcAlias)
			If Empty(lcFiltru)
				lcFiltru = '.T.'
			Endif
		
			lcColumnList = ''
			lcHeaderList = ''
			lcSelect = ''
			llSelect = .T.
			lcType = 'CURSOR'
			lcFrom = lcAlias
			lcWhere = lcFiltru
			lcOrder = 'codmat,denumire'
			lcOutput = 'crsStoc'
		
			If Used(lcOutput)
				Use In (lcOutput)
			Endif
		
			get_schema_grid(This.grdStocuri,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
			&lcSelect
		
			If Used(lcOutput)
				Do export_xls With lcOutput In oproceduri_comune.prg
				Use In (lcOutput)
			Endif
		
		
			If This.optgrup.Value = 1
				With This.grdStocuri
					Store .T. To .cpretv.Visible,.cpretvtva.Visible,.ctvav.Visible
				Endwith
			Endif
		
		Else
			amessagebox("Nu exista inregistrari pentru export!",48,"Atentie")
		Endif
		
		
		
	ENDPROC

	PROCEDURE do_listare
		X = XMENU("\<Listare selectie lei;Listare selectie \<valuta;Listare cumulata pe \<articole;\<Borderou de verificare valorica;\<Fisa magazie;Fisa \<magazie explicativa;\<Fisa magazie (cu preturi in valuta)")
		PRIVATE plListareValuta
		plListareValuta = .F.
		
		PRIVATE pcSubtitlu
		pcSubtitlu = THIS.filtru_pretty_ro_full
		
		DO CASE
			CASE X = 1
				plListareValuta = .F.
				THIS.do_listare_selectie()
			CASE X = 2
				plListareValuta = .T.
				THIS.do_listare_selectie()
			CASE X = 3
				THIS.do_listare_articol()
			CASE X = 4
				THIS.do_listare_borderou()
			CASE X = 5
				THIS.do_listare_fisa_magazie()
			CASE X = 6
				THIS.do_listare_fisa_magazie_explicativa()
			CASE X = 7
			    THIS.do_listare_fisa_magazie_in_valuta()	
		ENDCASE
		
		RELEASE plListareValuta
		
	ENDPROC

	PROCEDURE do_listare_articol
		* cumulez cantitatile pe articole, fara pret
		If Reccount('crsStocuri')>0
			Private pcTitlu,pcDataora
			Store "" To pcTitlu,pcDataora
			Local lcOrder, lcOrderColumn, loColumnSort, lcFilter, lcFiltru
			lcOrder = ""
			lcOrderColumn = ""
		
			lcFilter = Filter('crsStocuri')
			lcFiltru = Iif(!Empty(m.lcFilter), 'where ' + m.lcFilter, '')
			lcFiltru = Strtran(m.lcFiltru, 'crsstocuri.','a.',1,10,1)
		
			loColumnSort = Thisform.gridextra1.currentcolumn
			lcColoanaOrdonare = []
			If Type('loColumnSort') == 'O'
				lcOrderColumn = [1] + Iif(Thisform.gridextra1.Ascending,[ DESC],[])
				lcColoanaOrdonare = Strtran(Upper(Alltrim(loColumnSort.ControlSource)),[CRSSTOCURI.],[a.]) + [ as colord1,]
			Endif
		
		
			If Empty(lcOrderColumn)
				lcOrder = "a.nume_gestiune,a.denumire,a.codmat"
			Else
				Do Case
					Case lcOrderColumn = 'CODMAT'
						lcOrder = "a.nume_gestiune,a.CODMAT,a.denumire"
					Case lcOrderColumn = 'DENUMIRE'
						lcOrder = "a.nume_gestiune,a.DENUMIRE,a.CODMAT"
					Otherwise
						lcOrder = "a.nume_gestiune," + lcOrderColumn
				Endcase
			Endif
		SET STEP ON 
			lcComanda = [Select nume_gestiune, serie, lot, um, codmat, denumire, SUM(cants) as cants, SUM(cant) as cant, SUM(cante) as cante, SUM(cants+cant-cante) as stoc ] + ;
				[ From crsStocuri a ] + m.lcFiltru + ;
				[ group by nume_gestiune, serie, lot, um, codmat, denumire ] + ;
				[ Order By ] + lcOrder + ;
				[ Into Cursor crs_rap]
			&lcComanda
		
			pcTitlu = [STOCURI - ARTICOLE]
			Thisform.AlwaysOnTop=.F.
			goExport.export2frx([crs_rap],[rap_stoc_art_cant],.T., , , , , .T.)
		
			Thisform.AlwaysOnTop=.T.
			IF AMESSAGEBOX('Doriti sa salvati in format xls?',4+32,_Screen.Caption) = 6
				goExport.export2xls("crs_rap", "stoc_articole.xls")
			ENDIF 
			Use In (SELECT('crs_rap'))
		Else
			amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_listare_borderou
		Thisform.AlwaysOnTop=.F.
		DO rap_compar_stoc_bal
		Thisform.AlwaysOnTop=.T.
		*!*	If Reccount('crsStocuri')>0
		*!*		Select Nvl(Cont,'    ') As Cont,Nvl(acont,'    ') As acont,;
		*!*			pret,cants,cant,cante From crsStocuri Into  Cursor crsStocuri_temp
		
		*!*		Select Distinct Cont,acont,;
		*!*			000000000000000000.0000 As Prec,000000000000000000.0000 As intrari,;
		*!*			000000000000000000.0000 As iesiri,000000000000000000.0000 As sold ;
		*!*			WHERE !Empty(Cont);
		*!*			FROM crsStocuri_temp Into Cursor crsConturi Readwrite Order By Cont,acont
		
		*!*		Select crsConturi
		*!*		Scan
		*!*			Scatter Name loCont
		*!*			Select crsStocuri_temp
		*!*			Calculate Sum(Round(cants*Pret,gnPC)), Sum(Round(cant*Pret,gnPC)),Sum(Round(cante*Pret,gnPC)) ;
		*!*				FOR Alltrim(Cont)=Alltrim(loCont.Cont) And Alltrim(acont)=Alltrim(loCont.acont) To ;
		*!*				loCont.Prec,loCont.intrari,loCont.iesiri;
		
		*!*			Select crsConturi
		*!*			Gather Name loCont
		*!*		Endscan
		
		*!*		Select crsConturi
		*!*		Replace All sold With Prec+intrari-iesiri
		*!*		lcTitlu = [Borderou de verificare valorica]
		*!*		pcTitlu = ceretitlu_rap([Titlul raportului],lcTitlu)
		*!*		pcDataora = get_Ora(2)
		
		*!*		Thisform.AlwaysOnTop=.F.
		*!*		Select crsConturi
		*!*		Report Form rap_stoc_borderou.frx To Printer Prompt Preview
		*!*		Thisform.AlwaysOnTop=.T.
		
		*!*		Use In crsConturi
		*!*		Use In crsStocuri_temp
		*!*	Else
		*!*		amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		*!*	Endif
	ENDPROC

	PROCEDURE do_listare_fisa_magazie
		PRIVATE PcCodul,pcdenumire,pcondper
		STORE '' TO pcondper
		LOCAL ldata1,ldata2,lcd1,lcd2
		IF RECCOUNT('crsstocuri')>0
			THISFORM.ALWAYSONTOP=.F.
			SELECT crsstocuri
		
			PcCodul=VAL(ALLTRIM(STR(id_articol)))
			pcdenumire=UPPER(ALLTRIM(denumire))
			pnIdGestiune = id_gestiune
			pcNumeGestiune = ALLTRIM(nume_gestiune)
			pcSerie = ALLTRIM(serie)
		
			DO fisa_magazie_fifo WITH THISFORM.ntipgest,pnIdGestiune,pcNumeGestiune,PcCodul,pcSerie
		
			THISFORM.ALWAYSONTOP=.T.
		ELSE
			amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		ENDIF
		
	ENDPROC

	PROCEDURE do_listare_fisa_magazie_explicativa
		lcCursor = Thisform.grdStocuri.RecordSource
		LOCAL lcCondArticol  
		lcCondArticol =""
		Local llScanez,lcArticole
		Store .F. To llScanez
		If  aMESSAGEBOX('Se listeaza fisa explicativa pentru toate articolele selectate?',4+32,'Listare') = 6
			llScanez = .T.
		Endif
		
		lcCursorRaport = [crsraport]
		SELECT (lcCursor)
		If Reccount(lcCursor) > 0
			Private lnAn1, lnLuna1, lnAn2, lnLuna2
			Private pnIdArticol, pnPerInceput, pnPerSfarsit,pnIdGest, pcSerie
			Private pcTitlu,pcPerioada,pcDataOra
		*!*		Private pncantin,pnCanout,pnValin,pnValout
		*!*		Store 0 To pncantin,pnCantout,pnValin,pnValout
			Store 0 To lnAn1, lnLuna1, lnAn2, lnLuna2, pnIdArticol, pnPerInceput, pnPerSfarsit,pnIdGest
			Store '' To pcTitlu, pcPerioada,pcSerie
		
			Select (lcCursor)
			pnIdArticol = id_articol
			pnIdGest = id_gestiune
			pcSerie = ALLTRIM(serie)
		
			pcTitlu = [FISA DE MAGAZIE EXPLICATIVA]
		
			loLuna = get_oluna(gnAn, gnLuna)
			lcLuna1 = Padl(loLuna.lunamin,2,'0') + Padl(loLuna.anmin,4,'0')
			lcLuna2 = Padl(loLuna.lunamax,2,'0') + Padl(loLuna.anmax,4,'0')
		
			pcondper=""
			ofrmperioada=Createobject('frm_perioada_luni')
			With ofrmperioada
				._textbox1.Value=lcLuna1
				._textbox2.Value=lcLuna2
				._optiongrup1.Value = 2
				._optiongrup1.Valid()
			Endwith
			ofrmperioada.Show(1)
			If gnButon=2
				Thisform.ck_denumire.SetFocus()
				Return
			Endif
		
			plPerioada=.F.
			lnPoz=At('_',pcondper)
			If lnPoz>0
				plPerioada=.T.
			Endif
		
			If plPerioada
				lnAn1 = Val(Substr(pcondper,3,4))
				lnLuna1 = Val(Substr(pcondper,1,2))
				lnAn2 = Val(Substr(pcondper,10,4))
				lnLuna2 = Val(Substr(pcondper,8,2))
		
				pnPerInceput = lnAn1 * 12 + lnLuna1
				pnPerSfarsit = lnAn2 * 12 + lnLuna2
				pcPerioada = [Perioada : ] + Substr(pcondper,1,2)+'/'+Substr(pcondper,3,4) + ' - ' + Substr(pcondper,8,2)+'/'+Substr(pcondper,10,4)
			Else
				lnAn1 = Val(Substr(pcondper,3,4))
				lnLuna1 = Val(Substr(pcondper,1,2))
				lnAn2 = Val(Substr(pcondper,3,4))
				lnLuna2 = Val(Substr(pcondper,1,2))
		
				pnPerInceput = lnAn1 * 12 + lnLuna1
				pnPerSfarsit = lnAn2 * 12 + lnLuna2
				pcPerioada = [Luna : ] + Substr(pcondper,1,2)+'/'+Substr(pcondper,3,4)
			Endif
		
		
			If pnIdArticol = 0
				lcCond  = " and id_gestiune = " + Str(pnIdGest) + gcCondSucursala
				lcCondArticol = " in (select a.id_articol from vstoc a where  " + poStocuri.ca_baza1.cfiltru + ")"
			ELSE
				IF llScanez = .t.
					lcCond = " and id_gestiune = " + Str(pnIdGest) + " and id_articol in (select a.id_articol from vstoc a where  " + poStocuri.ca_baza1.cfiltru + ")"
					lcCondArticol = " in (select a.id_articol from vstoc a where  " + poStocuri.ca_baza1.cfiltru + ")"
				ELSE 
					lcCond = " and id_gestiune = " + Str(pnIdGest) + " and id_articol = " + Str(pnIdArticol) + gcCondSucursala
		*!*		modificare 12.02.2008
		*!*				lcCond = " and id_gestiune = " + Str(pnIdGest) + " and id_articol = " + Str(pnIdArticol) + gcCondSucursala
		*!*		modificare 12.02.2008	^
					lcCondArticol = " = " + Str(pnIdArticol)
				ENDIF 
			Endif
			If tnTipGest = 6
				lcPret = "pretv"
			Else
				lcPret = "pret"
			Endif
			lcStoc = 'crsStoc'
			lcRulaje = 'crsRulaje'
		
			If Used(lcCursorRaport)
				Use In (lcCursorRaport)
			Endif
		
			lcSqlStoc = "select id_articol,denumire,serie,"+ lcPret +;
				" as pret,codmat,um,id_gestiune,cants,cante,cant,datain,cgest "+;
				" from vstoc where an = " + Str(lnAn1) + " and luna = " + Str(lnLuna1) + lcCond + ;
				IIF(!EMPTY(NVL(pcSerie,''))," and serie = ?pcSerie","")
			lcSqlRulaje = "select nnir,id_articol,denumire,serie,codmat,um,id_gestiune,cant,cante,"+ lcPret +;
				" as pret,valoare,dataact,datain,dataout,cgestc,nrord,cgest"+;
				" from vrul where an * 12 + luna between " + Str(lnAn1*12+lnLuna1) + " and " + ;
				STR(lnAn2*12+lnLuna2) + lcCond + IIF(!EMPTY(NVL(pcSerie,''))," and serie = ?pcSerie","")
		
		
			lnSucces = goExecutor.oExecute(lcSqlStoc,lcStoc)
			If lnSucces < 0
				amessage('SELECT stoc' + Chr(13) + goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
			lnSucces = goExecutor.oExecute(lcSqlRulaje,lcRulaje)
			If lnSucces < 0
				amessage('SELECT rulaje' + Chr(13) + goExecutor.cEroare,0+16,"Eroare")
				Return
			Endif
			Select crsStoc
			Replace All denumire With Nvl(denumire,''),serie WITH NVL(serie,''),codmat With Nvl(codmat,''), um With Nvl(um,''), datain With Nvl(datain,{//::})
			Select crsRulaje
			Replace All nnir With Nvl(nnir,0),denumire With Nvl(denumire,''),serie WITH NVL(serie,''),codmat With Nvl(codmat,''), um With Nvl(um,''), datain With Nvl(datain,{//::}), dataout With Nvl(dataout,{//::}), dataact With Nvl(dataact,{//::})
		
		
			Select id_articol, serie, codmat, denumire, um,cgest From crsStoc ;
				UNION ;
				SELECT id_articol, serie, codmat, denumire, um,cgest From crsRulaje;
				INTO Cursor crsArticole;
				ORDER By 2, 3
		
			If Used('fisa_stoc')
				Use In fisa_stoc
			Endif
		
			Create Cursor fisa_stoc (id_articol N(20),denumire c(100),codmat c(50),serie c(100),um c(6),ldata d,nrdoc c(15),cantin N(12,3),;
				pretin N(12,3),valin N(14,2),cantout N(12,3),pretout N(12,3),valout N(14,2),cantf N(12,3),pretf N(12,3),;
				valf N(14,2),idf N(10),nrord c(100),sectie c(50),cgestc c(50),cgest c(20))
		
			Select crsArticole
			Scan
				lnIdArticol = id_articol
				lcDenumire = Alltrim(denumire)
				lcCodMat = Alltrim(codmat)
				lcUm = Alltrim(um)
				lcCgest = Alltrim(cgest)
				lcSerie = ALLTRIM(serie)
		
				Select id_articol,cants As cantf, Pret As pretf,cants*Pret As valf, datain As ldata,"               " As nrdoc,;
					SPACE(10) as serie_act,denumire,codmat,serie,um,000000000000.000 As cantin,000000000000.000 As pretin,00000000000000.00 As valin,;
					000000000000.000 As cantout,000000000000.000 As pretout,00000000000000.000 As valout,0000000000 As idf,;
					SPACE(20) As cgestc,cgest ;
					FROM crsStoc Where id_articol = lnIdArticol And cants <> 0 AND NVL(serie,'+_') = NVL(lcSerie,'+_') ;
					INTO Cursor cstoc Order By datain Readwrite
		
				Select cstoc
				Sum cantf To lnCantf
				Sum valf To lnValf
				Locate For Empty(idf)
				If Found()
					Replace cantin With lnCantf, valin With lnValf,nrdoc With 'Stoc initial'
					Replace denumire With lcDenumire, codmat With lcCodMat, um With lcUm, id_articol With lnIdArticol, serie WITH lcSerie
					Replace All idf With 1 For Empty(idf)
				Endif
		
				If _Tally > 0
		*!*	modificare 28.11.2006
		*!*				lcDbfStoc = DBF("cstoc")
		*!*				SELECT fisa_stoc
		*!*				APPEND FROM (lcDbfStoc)
					Select fisa_stoc
					Append From Dbf('cstoc')
		*!*	modificare 28.11.2006	^
				Else
					Select fisa_stoc
					Append Blank
					Replace cantin With lnCantf, valin With lnValf,nrdoc With 'Stoc initial'
					Replace denumire With lcDenumire, codmat With lcCodMat, um With lcUm, id_articol With lnIdArticol, serie WITH lcSerie
					Replace  cgest With lcCgest
					Replace All idf With 1 For Empty(idf)
				Endif
			Endscan
			Select fisa_stoc
		
			pcDataOra = get_ora(2)
		
			lcSql = [select c.codmat, c.denumire as nume_articol,x.serie, c.um, c.cant_bax, c.um2,c.id_articol, d.sectie, d.csectie, e.nrord, f.nume_gestiune, ] + ;
				[f.cgest, g.nume_gestiune as nume_gestiunec, g.cgest as cgestc,] + ;
				[(case when g.nr_pag = 6 then x.pretv + x.tvav else x.pret end) as pret, x.cant, x.cante,  ] + ;
				[ROUND(x.cant*(case when g.nr_pag = 6 then x.pretv + x.tvav else x.pret end),]+TRANSFORM(gnPc)+[) as val_intrari,] + ;
				[ROUND(x.cante*(case when g.nr_pag = 6 then x.pretv + x.tvav else x.pret end),]+TRANSFORM(gnPc)+[) as val_iesiri,] + ;
				[b.dataact, to_char(b.nnir) as nnir,decode(b.nract,b.nnir,null,b.serie_act) as serie_act,] + ;
				[decode(b.nract,b.nnir,null,b.nract) as nract, b.explicatia, h.denumire, i.fel_document, j.descriere as tip_rulaj ] + ;
				[from ] + gcS + [.rul x ] + ;
				[left join ] + ;
				[(select distinct cod,dataact,max(nnir) over(partition by cod) as nnir,id_fdoc,nract,serie_act,] + ;
				[max(id_partd) over(partition by cod) as id_partd,] + ;
				[first_value(explicatia) over(partition by cod order by explicatia ASC) as explicatia ] + ;
				[from ] + gcS + [.act where sters = 0 and cod in (select cod ] + ;
				[from ] + gcS + [.rul where id_articol ] + lcCondArticol + ;
				IIF(!EMPTY(NVL(pcSerie,'')),[ and serie = ?pcSerie],[]) + [ and sters = 0] + gcCondSucursala +[)] + ;
				[and scc not in ('4427', '4111', '667')) b on x.cod = b.cod ] + ;
				[left join ] + gcS + [.nom_articole c on x.id_articol = c.id_articol ] + ;
				[left join ] + gcS + [.nom_sectii d on x.id_sectie = d.id_sectie ] + ;
				[left join ] + gcS + [.vnom_lucrari e on x.id_lucrare = e.id_lucrare ] + ;
				[left join ] + gcS + [.nom_gestiuni f on x.id_gestiune = f.id_gestiune ] + ;
				[left join ] + gcS + [.nom_gestiuni g on x.id_gestiunec = g.id_gestiune ] + ;
				[left join ] + gcS + [.nom_parteneri h on b.id_partd = h.id_part ] + ;
				[left join ] + gcS + [.nom_fdoc i on b.id_fdoc = i.id_fdoc ] + ;
				[left join ] + gcS + [.nom_tip_rulaj j on x.id_tip_rulaj = j.id_tip_rulaj ] + ;
				[where x.sters = 0] + STRTRAN(gcCondSucursala,[id_sucursala],[x.id_sucursala]) +[ and x.id_articol  ] +lcCondArticol  + ;
				IIF(!EMPTY(NVL(pcSerie,'')),[ and x.serie = ?pcSerie],"") + ;
				[ and x.luna + x.an * 12 between ]+TRANSFORM(pnPerInceput)+[ and ]+TRANSFORM(pnPerSfarsit)+[ and x.id_gestiune = ]+TRANSFORM(pnidgest) +;
				[ order by c.denumire,b.serie_act,b.dataact]
			lnSucces = goExecutor.oExecute(lcSql,lcCursorRaport)
		
			If lnSucces < 0
				aMESSAGEBOX(goExecutor.oPrelucrareEroare(),0+16,"Eroare")
			Else
		
				Insert Into (lcCursorRaport) (codmat, nume_articol,serie,um,cgest,;
					pret,cant,cante,val_intrari,val_iesiri,dataact,nnir,id_articol) ;
					SELECT codmat,denumire,serie,um,cgest,pretf,cantin,cantout,valin,valout,ldata,nrdoc,id_articol From fisa_stoc
				Select fisa_stoc
		*!*			Sum cantin To pncantin
		*!*			Sum cantout To pnCante
		*!*			Sum valin To pnValin
		*!*			Sum valout To pnValout
				Use In fisa_stoc
				Select * From (lcCursorRaport) Order By nume_articol,id_articol,dataact,serie Into Cursor crsRaportfinal
				
		*!*			SELECT crsRaportFinal
		*!*			CURSORTOXML("crsRaportFinal","c:\crsRaporFinal.xml",1,512,0,"1")
		*!*			BROWSE 
				SELECT crsRaportfinal
				If Reccount(lcCursorRaport)>0
					Thisform.AlwaysOnTop=.F.
		
					Select crsRaportfinal
					*Keyboard '{CTRL+F10}'
					*Report Form fisa_explicativa To Printer Prompt Preview
					goExport.export2frx([crsRaportfinal],[fisa_explicativa],.T., , , , , .T.)		
					Thisform.AlwaysOnTop=.T.
		
				Else
					aMESSAGEBOX("Nu exista inregistrari pentru listare!",0+48,"Atentie")
				Endif
			Endif
			If Used('crsRaportfinal')
				Use In crsRaportfinal
			Endif
			If Used(lcCursorRaport)
				Use In (lcCursorRaport)
			Endif
		
		Else
			aMESSAGEBOX("Nu ati ales articolul! Efectuati o noua cautare!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_listare_fisa_magazie_in_valuta
		*!*	PRIVATE PcCodul,pcdenumire,pcondper
		*!*	STORE '' TO pcondper
		*!*	LOCAL ldata1,ldata2,lcd1,lcd2
		*!*	IF RECCOUNT('crsstocuri')>0
		*!*		THISFORM.ALWAYSONTOP=.F.
		*!*		SELECT crsstocuri
		
		*!*		PcCodul=VAL(ALLTRIM(STR(id_articol)))
		*!*		pcdenumire=UPPER(ALLTRIM(denumire))
		*!*		pnIdGestiune = id_gestiune
		*!*		pcNumeGestiune = ALLTRIM(nume_gestiune)
		*!*		pcSerie = ALLTRIM(serie)
		
		*!*		DO fisa_magazie_fifo WITH THISFORM.ntipgest,pnIdGestiune,pcNumeGestiune,PcCodul,pcSerie
		
		*!*		THISFORM.ALWAYSONTOP=.T.
		*!*	ELSE
		*!*		amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		*!*	ENDIF
		Private pnIdArticol,pcDenumire,pnId_gestiune,pcNumeGestiune,pcSerie,pcUm,pcCodMaterial,pcTitlu, pcPerioada, pcDataOra,pnIdValuta,pcValuta
		Store '' To pcTitlu,pcNumeGestiune,pcSerie,pcUm,pcCodMaterial,pcDataOra,pcValuta
		*!*	SET STEP ON  
		If Used('crstemp')
			Use In crstemp
		Endif
		
		Select crsstocuri	
		pnIdArticol = id_articol
		pnIdGestiune = id_gestiune
		pcDenumire = Upper(Alltrim(denumire))
		pcUm = Upper(Alltrim(um))
		pcCodMaterial = Upper(Alltrim(codmat))
		pcSerie = Upper(Alltrim(serie))
		pcNumeGestiune = Upper(Alltrim(nume_gestiune))
		pnIdValuta = Nvl(id_valuta,0)
		pcValuta = ALLTRIM(nume_val)
		
		Thisform.AlwaysOnTop=.F.
		do fisa_magazie_FIFO_valuta WITH thisform.ntipgest , pnIdGestiune , pcNumeGestiune, pnIdArticol , pcSerie ,pnIdValuta ,pcValuta 
		Thisform.AlwaysOnTop=.t.
	ENDPROC

	PROCEDURE do_listare_selectie
		If Reccount('crsStocuri')>0
			Private pcTitlu,pcDataora
			Store "" To pcTitlu,pcDataora
			Local lcOrder, lcOrderColumn, loColumnSort, lcFilter, lcFiltru
			lcOrder = ""
			lcOrderColumn = ""
		
			lcFilter = FILTER('crsStocuri')
			lcFiltru = IIF(!EMPTY(m.lcFilter), 'where ' + m.lcFilter, '')
			lcFiltru = STRTRAN(m.lcFiltru, 'crsstocuri.','a.',1,10,1)
			
		*!*	modificare	v 2.0.169
		*!*		loColumnSort = This.gridsort1.ocolumnreference
		*!*		If Type('loColumnSort') = 'O'
		*!*			lcOrderColumn = Upper(Alltrim(loColumnSort.ControlSource))
		*!*		Endif
			loColumnSort = Thisform.gridextra1.currentcolumn
			lcColoanaOrdonare = []
			If Type('loColumnSort') == 'O'
				lcOrderColumn = [1] + Iif(Thisform.gridextra1.Ascending,[ DESC],[])
				lcColoanaOrdonare = STRTRAN(UPPER(ALLTRIM(loColumnSort.ControlSource)),[CRSSTOCURI.],[a.]) + [ as colord1,]
			Endif
		*!*	modificare	v 2.0.169	^
		
			If Empty(lcOrderColumn)
				lcOrder = "a.nume_gestiune,a.denumire,a.codmat"
			Else
				Do Case
				Case lcOrderColumn = 'CODMAT'
					lcOrder = "a.nume_gestiune,a.CODMAT,a.denumire"
				Case lcOrderColumn = 'DENUMIRE'
					lcOrder = "a.nume_gestiune,a.DENUMIRE,a.CODMAT"
				Otherwise
					lcOrder = "a.nume_gestiune," + lcOrderColumn
				Endcase
			Endif
			*!*	modificare v 2.0.169
			*!*		Select * From crsStocuri  Into Cursor crs_rap Order By &lcOrder
			lcComanda = [Select ] + lcColoanaOrdonare + [a.* From crsStocuri a ] + m.lcFiltru + [ Into Cursor crs_rap Order By ] + lcOrder
			&lcComanda
			*!*	modificare v 2.0.169 ^
		
		*!*	modificare	ROAGEST v 2.0.118
			pcTitlu = [STOCURI - GESTIUNI]
		*!*		*!* 21.11.2007
		*!*	*!*		If Thisform.ck_fara_rulaj.Value=1
		*!*	*!*			lcTitlu = [STOCURI FARA MISCARE IN ULTIMELE ]+Thisform.nzile+[ ZILE]
		*!*	*!*		Else
		*!*			lcTitlu = [STOCURI - GESTIUNI]
		*!*	*!*		Endif
		*!*		pcTitlu = ceretitlu_rap([Titlul raportului],lcTitlu)
		*!*		pcDataora = get_Ora(2)
			Thisform.AlwaysOnTop=.F.
		*!*		Select crs_rap
		*!*		KEYBOARD '{CTRL+F10}'
		*!*		Report Format rap_stoc.FRX To Printer Prompt Noconsole Preview
			goExport.export2frx([crs_rap],[rap_stoc],.T., , , , , .T.)
		*!*	modificare	ROAGEST v 2.0.118	^
			Thisform.AlwaysOnTop=.T.
			Use In crs_rap
		Else
			amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modifica
		LPARAMETERS tlIesire
		
		
		IF glLunaInchisa
			aMESSAGEBOX('Luna este inchisa!',0+48,"Atentie")
			RETURN
		ENDIF
		
		LOCAL lcFunctie,lcSql,lcMesaj,lcActiune,lcTitlu,llIesire,lcProc
		PRIVATE poRec
		
		llIesire=tlIesire
		IF EMPTY(llIesire)
			llIesire=.F.
		ENDIF
		SELECT crsStocuri
		SCATTER NAME poRec
		
		nrlin=RECNO()
		THISFORM.grdStocuri.SETALL('DynamicFontBold','IIF(RECNO()=nrlin,.T.,.F.)','Column')
		THISFORM.grdStocuri.REFRESH()
		lnluna=luna
		
		IF lnluna = 0
			lcMesaj=[Doriti sa adaugati aceasta inregistrare?]
			lcActiune=[adaugata]
			lcTitlu=[Adaugare]
		ELSE
			lcMesaj=[Doriti sa modificati aceasta inregistrare?]
			lcActiune=[modificata]
			lcTitlu=[Modificare]
		ENDIF
		
		
		IF aMESSAGEBOX(lcMesaj,4+32+256,lcTitlu)==6
			lcProc = IIF(lnluna = 0, [stocinsproc], [stocupdproc])
			lcSql = [begin pack_stoc.] + lcProc + [(?gcs, ?@.id_stoc, ?gnLuna, ?gnAn, ?.id_articol, ?.PRET, ?.pretv, ?.tvav, ?.cants, ]
			lcSql = lcSql + [?.cant, ?.cante, ?.CONT, ?.acont, ?.pretd, ?.datain, ?.dataout, ?.proc_tvav, ?.id_gestiune, ?gnIdSucursala, ] + ;
			[?.id_lucrare_rez,?.id_part_rez); end;]
			
		
			WITH poRec
				lnSucces = goExecutor.oExecute(lcSql)
			ENDWITH 
			IF lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
				RETURN
			ENDIF
			SELECT crsStocuri
			REPLACE id_stoc WITH poRec.id_stoc
			THISFORM.MOUSEPOINTER= 11
			THISFORM.LOCKSCREEN=.T.
			THIS.do_cauta() 
			&&thisform.actualizeaza_grid1()
			THISFORM.LOCKSCREEN=.F.
			THISFORM.MOUSEPOINTER= 0
			aMESSAGEBOX("Inregistrarea a fost "+lcActiune+"!",0+64,lcTitlu)
			THISFORM.coldvalue = THISFORM.cnewvalue
			SELECT crsStocuri
			LOCATE FOR id_stoc = poRec.id_stoc
		
		ELSE
			IF !llIesire
				THISFORM.MOUSEPOINTER= 11
				THISFORM.LOCKSCREEN=.T.
				this.do_cauta()
				&&THISFORM.actualizeaza_grid1()
				THISFORM.LOCKSCREEN=.F.
				THISFORM.MOUSEPOINTER= 0
			ENDIF
		ENDIF
		THISFORM.lmodificata=.F.
		THISFORM.grdStocuri.SETALL('DynamicFontBold','.F.','Column')
		THISFORM.grdStocuri.REFRESH()
		
	ENDPROC

	PROCEDURE do_reface
		*!* 20.01.2011
		*!* marius.mutu
		*!* adaugare optiune refacere pe gestiuni
		
		*!*	17.12.2020
		*!*	marius.mutu
		*!*	am scos refacerea lunara - se pune 0 (accidental) pe stoc precedent daca daca nu stie ce face
		*!* probabil este nevoie de refacere lunara intr-o situatie de initializare
		
		If m.glLunaInchisa
			AMESSAGEBOX('Luna este inchisa! Nu se pot da refaceri!',0+64,_screen.Caption)
			Return
		ENDIF
		
		Local l, lnSucces, lnIdGestiune, lcSql
		Local lcCont, x, lcSursa, lnLuna, lnAn, lcLunar
		Local lcExecute, loCautaGestiune
		lnSucces = 0
		lnIdGestiune = 0
		
		
		lcCont = []
		lcSursa = [STOC]
		lnLuna = gnLuna
		lnAn = gnAn
		
		x = xmenu('Refacere cu \<precedente;Refacere cu precedente pe \<gestiuni')
		lnIdGestiune = 0
		Do Case
		*!*		Case x = 1
		*!*			lcLunar = [0]
		*!*			*lcExec = [begin pack_refaceri.refac_stoc(?gcS,?gnAn,?gnLuna,0); end;]
			Case x = 1
				lcLunar = [1]
				*lcExec = [begin pack_refaceri.refac_stoc(?gcS,?gnAn,?gnLuna,1); end;]
			Case x = 2
				lcLunar = [1]
				loCautaGestiune = caut_gestiune()
				lnIdGestiune = Nvl(loCautaGestiune.id_gestiune, 0)
				If Empty(lnIdGestiune)
					Return
				Endif
			Otherwise
				Return
		Endcase
		
		
		*!*	lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
		lcSql = [begin pack_refaceri.refac_stoc(?gnAn,?gnLuna,] + lcLunar + Iif(! Empty(m.lnIdGestiune), [,] + Alltrim(Str(m.lnIdGestiune)), []) + [); end;]
		lcExecute = [begin pack_contafin.SET_ID_SUCURSALA(?gnIdSucursala); end;]
		lnSucces = goExecutor.oExecute(lcExecute)
		If lnSucces < 0
			amessagebox(goExecutor.cEroare, 0 + 16, "Eroare")
		Else
			lnSucces = goExecutor.oExecute(lcSql)
			If lnSucces < 0
				amessagebox(lcProc + CRLF + goExecutor.cEroare, 0 + 16, "Eroare")
			Else
				amessagebox("Refacerea s-a terminat!", 0 + 64, "Refacere stocuri")
			Endif
		Endif
		
		
		
		
		
		
	ENDPROC

	PROCEDURE do_sterge
		Local lcSql,lnRec
		PRIVATE poRec
		If aMessagebox("Doriti sa stergeti aceasta inregistrare?",4+32+256,"Stergere")==6
			Select crsStocuri  
			SCATTER NAME poRec
			lcSql =[BEGIN PACK_STOC.STOCDELPROC(?gcs, ?.id_stoc); END;]
			WITH poRec
				lnSucces = goExecutor.oExecute(lcSql)
			ENDWITH 	
			If lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
				Return
			ENDIF
			SELECT crsStocuri
			DELETE 
			
			aMessagebox("Inregistrarea a fost stearsa!",0+64,"Stergere")
		*!*		Thisform.MousePointer= 11
		*!*		Thisform.LockScreen=.T.
		*!*		Thisform.actualizeaza_grid1()
		*!*		Thisform.LockScreen=.F.
		*!*		Thisform.MousePointer=0
		*!*	 	Select crsStocuri  
		*!*		GO TOP 
			
		ENDIF
		Thisform.grdStocuri.Refresh 
		Thisform.grdStocuri.SetFocus()
		
	ENDPROC

	PROCEDURE do_verifica
		LOCAL contselect
		contselect= ''
		IF THIS.optgrup.VALUE = 3
			lcTitlu = [Atentie]
			lcImagine = [exclam.ico]
			lcTip = [AVERTIZARE]
			lcMesaj1 = [Alegeti <Gestiuni la pret de achizitie>]
			lcMesaj2 = [sau <Gestiuni la pret de vanzare>]
			omesaj = CREATEOBJECT([frm_mesaj],lcTitlu,lcImagine,lcTip,lcMesaj1,lcMesaj2)
			omesaj.SHOW(1)
			RETURN
		ENDIF
		
		SELECT DISTINCT CONT FROM crsStocuri INTO CURSOR cConturiTemp
		IF _TALLY = 1
			contselect=ALLTRIM(cConturiTemp.CONT)
		ELSE
			contselect=''
		ENDIF
		USE IN (SELECT('cConturiTemp'))
		*!*	If Thisform.ck_filtru_cont.Value=1
		*!*		contselect=Thisform.ck_filtru_cont.filtru
		*!*		contselect=Strtran(contselect,'AND','')
		*!*		contselect=Strtran(contselect,'(','')
		*!*		contselect=Strtran(contselect,')','')
		*!*		contselect=Strtran(contselect,'A.CONT','')
		*!*		contselect=Strtran(contselect,"'",'')
		*!*		contselect=Strtran(contselect,'%','')
		*!*		contselect=Strtran(contselect,'LIKE','')
		*!*		contselect=Alltrim(contselect)
		*!*	Else
		*!*		contselect=''
		*!*	Endif
		
		DO verific_stoc_cu_balanta WITH contselect,THISFORM.optgrup.VALUE
		
		
	ENDPROC

	PROCEDURE grid_sort_bind
		*!*
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		this.gridextra1.setup()
	ENDPROC

	PROCEDURE initializare
		Thisform.grdStocuri.ReadOnly = !Thisform.grdStocuri.ReadOnly
		Thisform.but_start_criterii1.Enabled = !Thisform.but_start_criterii1.Enabled
		Thisform.but_reset_criterii1.Enabled = !Thisform.but_reset_criterii1.Enabled
		Thisform.but_reface1.Enabled = !Thisform.but_reface1.Enabled
		
		With Thisform.grdStocuri
		
			.cnr_crt.ReadOnly=.T.
			.ccodmat.ReadOnly=.T.
			.cdenumire.ReadOnly=.T.
			.cum.ReadOnly=.T.
			.ccont.ReadOnly=.T.
			.cacont.ReadOnly=.T.
			.ccgest.ReadOnly=.T.
			.cpretvtva.ReadOnly=.T.
			.cstoc.ReadOnly=.T.
		
		Endwith
		Thisform.grdStocuri.SetFocus
		
	ENDPROC

	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		LOCAL lbviz
		lbviz=THIS.bvizualizare
		*!*	am suprascris KeyPress ca sa nu se poata apela do_adauga prin combinatii de taste
		DO CASE
		case nKeyCode=13 And nShiftAltCtrl=2 && CTRL + M
			NODEFAULT
			IF this.but_modifica1.visible
				this.but_modifica1.Click()
			ENDIF 	
		CASE nKeyCode=27 AND nShiftAltCtrl=0
				NODEFAULT
				IF aMessagebox("Sunteti sigur ca doriti sa inchideti fereastra?",4+32+256,"Confirmare")==6
					THIS.do_renunt()
				ENDIF
		CASE nKeyCode=5 AND nShiftAltCtrl=2 AND lbviz=.F.
				NODEFAULT
				IF PEMSTATUS(THIS,"inainte_de_do_excel",5)
					THIS.inainte_de_do_excel()
				ENDIF
		CASE nKeyCode=6 AND nShiftAltCtrl=2
			NODEFAULT
			THIS.do_termin()
		CASE nKeyCode=16 AND nShiftAltCtrl=2 AND lbviz=.F.
			NODEFAULT
			IF PEMSTATUS(THIS,"inainte_de_do_listare",5)
				THIS.inainte_de_do_listare()
			ENDIF
			*!* Criterii Selectie - Vasile Cristian 25.oct.2007
		CASE nKeyCode = 17 AND nShiftAltCtrl=2 && CTRL + Q
			NODEFAULT
			IF TYPE('THIS.but_start_criterii1') = 'O'
				THIS.but_start_criterii1.CLICK()
			ENDIF 	
			
		CASE nKeyCode = 20 AND nShiftAltCtrl=2 && CTRL + T
			NODEFAULT
			IF TYPE('THIS.but_reset_criterii1') = 'O'
				THIS.but_reset_criterii1.CLICK()
			ENDIF	
		ENDCASE
	ENDPROC

	PROCEDURE Load
		LOCAL loMonedaNationala
		LOCAL lcSelect
		lcSelect = SELECT()
		
		loMonedaNationala = GetMonedaNationala() && updateserver.prg
		this.nIdMonedaNationala = loMonedaNationala.id_valuta
		this.cMonedaNationala = loMonedaNationala.nume_val
		
			
		SELECT this.nIdMonedaNationala as id_valuta, this.cMonedaNationala as nume_val ;
			FROM dual ;
			INTO CURSOR cValuteRulTemp
		this.nIdvalutatotal = this.nIdMonedaNationala	
		this.cValutaTotal = this.cMonedaNationala
		SELECT (lcSelect)
	ENDPROC

	PROCEDURE Release
		this.cboValuta.RowSource = ""
		USE IN (SELECT('cValuteRulTemp'))
	ENDPROC

	PROCEDURE But_start_criterii1.loadcriterii
		PARAMETERS tacriterii
		EXTERNAL ARRAY tacriterii
		#DEFINE crlf CHR(13)+CHR(10)
		PRIVATE lcStringCriterii
		lcStringCriterii="Denumire articol\denumire\T\id_articol\nom_articol"+ crlf + ;
			"Cod material\codmat\T\none\" + crlf + ;
			"Serie articol\serie\T\none\" + crlf + ;
			"Subgrupa articol\subgrupa\T\id_subgrupa\nom_subgrupa_articol"+ crlf + ;
			"Cod bare\codbare\T\none\"+ crlf + ;
			"Gestiune\none\I\id_gestiune\nom_gestiune" + crlf + ;
			"Grupe gestiuni\|E|" + ;
				[a.id_gestiune in ( ] + ;
				[ select ID_GESTIUNE ] + ;
				[	from vgest_coresp_grupe_gestiuni c ] + ;
				[	join (select id_grupe ] + ;
				[       from gest_nom_grupe ] + ;
				[       where sters = 0 ] + ;
			    [       start with id_grupe = <<VALOARE>> ] + ;
				[      connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe )\I\none\nom_grupa_gestiune] + crlf + ;
			"Cont\cont\T\none\"+ crlf + ;
			"Cont analitic\acont\T\none\"+ crlf + ;
			"Data intrare\trunc(datain)\D\none\"+ crlf + ;
			"Data iesire\trunc(dataout)\D\none\"+ crlf + ;
			"Pret achizitie\pret\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret vz.\pretv\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret vz. TVA\(pretv+tvav)\N|get_mask(12,gnPpret)\none\"+ crlf + ;	
			"Pret valuta\pretd\N|get_mask(12,gnPPretval)\none\" + crlf + ;
			"Valuta\nume_val\T\ID_VALUTA\nom_valuta" + crlf + ;
			"Furnizor principal\furn_princ\T\id_part\nom_parteneri" + crlf + ;
			"Furnizor\furnizor\T\id_furnizor\nom_parteneri" + crlf + ;	
			"Lucrare rezervare\nrord_rez\T\ID_LUCRARE_REZ\nom_lucrare" + crlf + ;	
			"Partener rezervare\part_rez\T\id_part_rez\nom_parteneri" + crlf + ;	
			"Stoc\cants+cant-cante\N|get_mask(12,gnPcant)\none\" + crlf + ;
			"Stoc negativ\nofiled\E\(cants+cant-cante<0)\" + crlf + ;
			"Cu rulaj\nofiled\E\(cant!=0 or cante!=0)\" + crlf + ;	
			"Fara rulaj\nofiled\E\(cant=0 and a.cante=0)\" + crlf + ;
			"Cota TVA\proc_tvav\N|get_mask(12,2)\none\" + crlf + ;
			IIF(EMPTY(gcCondSucursala) and glEMama,"Sucursala\sucursala\C\none\",[])
		DODEFAULT()
		
	ENDPROC

	PROCEDURE cboValuta.Valid
		thisform.nIdValutaTotal = cValuteRulTemp.id_valuta
		thisform.calcul_sume()
	ENDPROC

	PROCEDURE Chk_fara_miscare.InteractiveChange
		IF THIS.VALUE = 1
			THISFORM.data_f_misc = DATE(YEAR(DATE()),1,1)
			ldDataFM = THISFORM.data_f_misc
			loFaraMiscare = CREATEOBJECT("frm_fara_miscare")
			loFaraMiscare.SHOW()
			THISFORM.data_f_misc = ldDataFM
			IF !PEMSTATUS(THIS,"cTraducere",5)
				THIS.ADDPROPERTY("cTraducere","")
			ENDIF
		
		
			THIS.cTraducere = "Data intrare/iesire <= " + DTOC(ldDataFM)
		ELSE
			THIS.cTraducere = ""
		ENDIF
		
		THISFORM.do_cauta()
		THISFORM.but_start_criterii1.refreshstatus()
		
	ENDPROC

	PROCEDURE grdStocuri.AfterRowColChange
		LPARAMETERS nColIndex
		Local lnluna
		With Thisform.grdStocuri
			Select crsStocuri  
			lnluna = luna	
			If Thisform.lmodificata
				Thisform.lmodificare_totaluri = .T.
				Thisform.calcul_sume()
				If lnluna = 0
					Thisform.lmodificare_totaluri = .F.
				Endif
				thisform.grdStocuri.Refresh
			Endif
			 
		Endwith
		 
	ENDPROC

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

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

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

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

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

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

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

	PROCEDURE grdStocuri.Cdatain.Text1.GotFocus
		
		Thisform.coldvalue=This.Value
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.Cdatain.Text1.InteractiveChange
		
		Thisform.cnewvalue=This.Value
	ENDPROC

	PROCEDURE grdStocuri.Cdataout.Text1.GotFocus
		Thisform.coldvalue=This.Value
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.Cdataout.Text1.InteractiveChange
		Thisform.cnewvalue=This.Value
	ENDPROC

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

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

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

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

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

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

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

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

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

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

	PROCEDURE grdStocuri.Init
		*
	ENDPROC

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

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

	PROCEDURE optgrup.Valid
		LOCAL lcTraducere
		lcTraducere = ""
		DO CASE 
			CASE this.Value = 4
				pcListTipGest = [7]
			CASE this.Value = 3
				pcListTipGest = [2,3,4,5,6]
			CASE this.Value = 2
				pcListTipGest = [6]
				lcTraducere = "Gestiuni la pret de vanzare"		
			CASE this.Value = 1
				pcListTipGest = [2,3,4,5]
				lcTraducere = "Gestiuni la pret de achizitie"
		ENDCASE 
		
		IF !PEMSTATUS(THIS,"cTraducere",5)
			THIS.ADDPROPERTY("cTraducere","")
		ENDIF
		
		
		THIS.cTraducere = lcTraducere
		
		
		thisform.do_cauta()
		thisform.but_start_criterii1.refreshstatus()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_stocuri_obinv 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="optgrup" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cum.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cum.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpret.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpret.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccants.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccants.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccante.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccante.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cstoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cstoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cacont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cacont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretd.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretd.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdatain.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdatain.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdataout.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdataout.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cdatapif.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cdatapif.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.c_dns_luni.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.c_dns_luni.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cresp.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cresp.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cMeserie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cMeserie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFormatia.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFormatia.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataAng.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataAng.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataLic.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataLic.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDNF.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDNF.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataExpirare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataExpirare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGrupa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGrupa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSubgrupa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSubgrupa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column27.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column27.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column28.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column28.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFurn_princ.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFurn_princ.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodNC8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodNC8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGreutate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGreutate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cTaraOrigine.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cTaraOrigine.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cMarca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cMarca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cLot.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cLot.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shp_total" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: butappend
		*m: calcul_sume
		*m: do_listare_articole
		*m: do_listare_borderou
		*m: do_listare_selectie
		*m: initializare
		*p: cfiltruinitial
		*p: cnewvalue
		*p: coldvalue
		*p: data_ref
		*p: lmodificare_totaluri
		*p: lmodificata
		*p: ngridheight
		*p: ntipgest
		*p: vstoc_final
		*p: vstoc_finalv
		*p: vstoc_final_tot
		*p: vstoc_in
		*p: vstoc_inv
		*p: vstoc_in_tot
		*p: vstoc_out
		*p: vstoc_outv
		*p: vstoc_out_tot
		*p: vstoc_prec
		*p: vstoc_precv
		*p: vstoc_prec_tot
	*</DefinedPropArrayMethod>

	*<PropValue>
		cbuton2 = but_listare1;but_listare2
		cgridsortlist = grdStocuri
		cnewvalue = .F.
		coldvalue = .F.
		data_ref = {}
		DoCreate = .T.
		FontName = "Arial Narrow"
		Height = 430
		lmodificare_totaluri = .F.
		lmodificata = .F.
		Name = "frm_stocuri_obinv"
		ngridheight = 0
		ntipgest = 0
		vstoc_final = 0
		vstoc_finalv = 0
		vstoc_final_tot = 0
		vstoc_in = 0
		vstoc_inv = 0
		vstoc_in_tot = 0
		vstoc_out = 0
		vstoc_outv = 0
		vstoc_out_tot = 0
		vstoc_prec = 0
		vstoc_precv = 0
		vstoc_prec_tot = 0
		Width = 770
		WindowState = 2
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "RESIZABLE,NOVERTICAL_RESIZE"
		_shape1.Top = 0
		_shape1.Width = 770
		_shape1.ZOrderSet = 2
		_shape2.Height = 28
		_shape2.Left = 533
		_shape2.Name = "_shape2"
		_shape2.Tag = "MOVABLE,NOVERTICAL_MOVE"
		_shape2.Top = 0
		_shape2.Width = 208
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "STOCURI"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 39
		Lb_titlu_alb_b121.Top = 1
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Height = 26
		BUT_TERMIN1.Left = 741
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 25
		BUT_TERMIN1.Tag = "MOVABLE,NOVERTICAL_MOVE"
		BUT_TERMIN1.ToolTipText = "Terminare"
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 9, ;
		Height = 26, ;
		Left = 679, ;
		Name = "But_excel1", ;
		TabIndex = 33, ;
		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_listare2' AS but_listare WITH ;
		Anchor = 9, ;
		Height = 26, ;
		Left = 708, ;
		Name = "But_listare2", ;
		TabIndex = 27, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Listare selectie", ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = butappend, ;
		Height = 26, ;
		Left = 621, ;
		Name = "But_modifica1", ;
		TabIndex = 29, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 39
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 9, ;
		Height = 26, ;
		Left = 591, ;
		Name = "But_reface1", ;
		TabIndex = 30, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 38
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 9, ;
		Height = 26, ;
		Left = 649, ;
		Name = "But_verifica1", ;
		SpecialEffect = 1, ;
		TabIndex = 28, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdStocuri' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 36, ;
		DeleteMark = .F., ;
		Height = 335, ;
		Left = 1, ;
		Name = "grdStocuri", ;
		Panel = 1, ;
		RecordSource = "crsStocuri", ;
		RowHeight = 19, ;
		TabIndex = 32, ;
		Tag = "RESIZABLE", ;
		Top = 88, ;
		Width = 767, ;
		ZOrderSet = 12, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "nr_crt", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 23, ;
		Column2.ColumnOrder = 8, ;
		Column2.ControlSource = "codmat", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Ccodmat", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 60, ;
		Column3.ColumnOrder = 9, ;
		Column3.ControlSource = "denumire", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Cdenumire", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 135, ;
		Column4.ColumnOrder = 12, ;
		Column4.ControlSource = "um", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Cum", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 39, ;
		Column5.ColumnOrder = 15, ;
		Column5.ControlSource = "pret", ;
		Column5.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "r", ;
		Column5.InputMask = (get_mask(16,gnPPRET)), ;
		Column5.Name = "Cpret", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 82, ;
		Column6.ColumnOrder = 16, ;
		Column6.ControlSource = "cants", ;
		Column6.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "r", ;
		Column6.InputMask = (get_mask(14,gnPCANT)), ;
		Column6.Name = "Ccants", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 53, ;
		Column7.ColumnOrder = 17, ;
		Column7.ControlSource = "cant", ;
		Column7.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Format = "r", ;
		Column7.InputMask = (get_mask(14,gnPCANT)), ;
		Column7.Name = "Ccant", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 48, ;
		Column8.ColumnOrder = 18, ;
		Column8.ControlSource = "cante", ;
		Column8.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "r", ;
		Column8.InputMask = (get_mask(14,gnPCANT)), ;
		Column8.Name = "Ccante", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 45, ;
		Column9.ColumnOrder = 19, ;
		Column9.ControlSource = "cants+cant-cante", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Format = "r", ;
		Column9.InputMask = (get_mask(16,gnPCANT)), ;
		Column9.Name = "Cstoc", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 50, ;
		Column10.ColumnOrder = 20, ;
		Column10.ControlSource = "cont", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Ccont", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 36, ;
		Column11.ColumnOrder = 21, ;
		Column11.ControlSource = "acont", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Cacont", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 37, ;
		Column12.ColumnOrder = 22, ;
		Column12.ControlSource = "cgest", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Ccgest", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 40, ;
		Column13.ColumnOrder = 23, ;
		Column13.ControlSource = "pretd", ;
		Column13.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "r", ;
		Column13.InputMask = (get_mask(16,gnPPretVAL)), ;
		Column13.Name = "Cpretd", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 56, ;
		Column14.ColumnOrder = 24, ;
		Column14.ControlSource = "datain", ;
		Column14.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "Cdatain", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 66, ;
		Column15.ColumnOrder = 25, ;
		Column15.ControlSource = "dataout", ;
		Column15.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "Cdataout", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 75, ;
		Column16.ColumnOrder = 26, ;
		Column16.ControlSource = "datapif", ;
		Column16.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cdatapif", ;
		Column16.ReadOnly = .T., ;
		Column17.ColumnOrder = 28, ;
		Column17.ControlSource = "dns_luni", ;
		Column17.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "c_dns_luni", ;
		Column17.ReadOnly = .T., ;
		Column18.ColumnOrder = 2, ;
		Column18.ControlSource = "nresp", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "cresp", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 114, ;
		Column19.ColumnOrder = 4, ;
		Column19.ControlSource = "meserie", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "cMeserie", ;
		Column20.ColumnOrder = 5, ;
		Column20.ControlSource = "formatia", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cFormatia", ;
		Column21.ColumnOrder = 6, ;
		Column21.ControlSource = "dataang", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cDataAng", ;
		Column22.ColumnOrder = 7, ;
		Column22.ControlSource = "datalic", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cDataLic", ;
		Column23.ColumnOrder = 27, ;
		Column23.ControlSource = "dnf", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cDNF", ;
		Column24.ColumnOrder = 29, ;
		Column24.ControlSource = "gomonth(datapif,dns_luni)", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cDataExpirare", ;
		Column25.ColumnOrder = 30, ;
		Column25.ControlSource = "grupa", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cGrupa", ;
		Column26.ColumnOrder = 31, ;
		Column26.ControlSource = "subgrupa", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cSubgrupa", ;
		Column27.ColumnOrder = 13, ;
		Column27.ControlSource = "um2", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "Column27", ;
		Column27.Width = 40, ;
		Column28.ColumnOrder = 14, ;
		Column28.ControlSource = "cant_bax", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Name = "Column28", ;
		Column28.Width = 40, ;
		Column29.ColumnOrder = 10, ;
		Column29.ControlSource = "serie", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cSerie", ;
		Column29.ReadOnly = .T., ;
		Column30.ColumnOrder = 32, ;
		Column30.ControlSource = "sucursala", ;
		Column30.FontName = "Arial", ;
		Column30.FontSize = 10, ;
		Column30.Name = "cSucursala", ;
		Column30.ReadOnly = .T., ;
		Column31.ColumnOrder = 33, ;
		Column31.ControlSource = "furn_princ", ;
		Column31.FontName = "Arial", ;
		Column31.FontSize = 10, ;
		Column31.Name = "cFurn_princ", ;
		Column31.Width = 127, ;
		Column32.ColumnOrder = 34, ;
		Column32.ControlSource = "codnc8", ;
		Column32.Name = "cCodNC8", ;
		Column32.ReadOnly = .T., ;
		Column32.Width = 152, ;
		Column33.ColumnOrder = 35, ;
		Column33.ControlSource = "greutate", ;
		Column33.Name = "cGreutate", ;
		Column33.ReadOnly = .T., ;
		Column34.ColumnOrder = 36, ;
		Column34.ControlSource = "tara_origine", ;
		Column34.Name = "cTaraOrigine", ;
		Column34.ReadOnly = .T., ;
		Column34.Width = 152, ;
		Column35.ColumnOrder = 3, ;
		Column35.ControlSource = "marca", ;
		Column35.Name = "cMarca", ;
		Column35.ReadOnly = .T., ;
		Column35.Width = 54, ;
		Column36.ColumnOrder = 11, ;
		Column36.ControlSource = "lot", ;
		Column36.Name = "cLot", ;
		Column36.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdStocuri.c_dns_luni.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Durata ramasa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.c_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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdStocuri.cCodNC8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod NC8", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

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

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

	ADD OBJECT 'grdStocuri.cGreutate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Greutate (Kg)", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

	ADD OBJECT 'grdStocuri.cMarca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Marca", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

	ADD OBJECT 'grdStocuri.Cnr_crt.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, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

	ADD OBJECT 'grdStocuri.Cpret.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 'grdStocuri.Cpretd.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret valuta", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdStocuri.Cstoc.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 'grdStocuri.cSubgrupa.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Subgrupa articole", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

	ADD OBJECT 'grdStocuri.cTaraOrigine.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tara origine", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.grdStocuri, ;
		Height = 17, ;
		Left = 287, ;
		Name = "Gridextra1", ;
		Top = 45, ;
		Width = 33
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

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

	ADD OBJECT 'lbl1' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Stoc Precedent", ;
		FontName = "Arial Narrow", ;
		Height = 21, ;
		Left = 344, ;
		Name = "lbl1", ;
		TabIndex = 40, ;
		Top = 38, ;
		Visible = .T., ;
		Width = 108, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl2' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Intrari", ;
		FontName = "Arial Narrow", ;
		Height = 21, ;
		Left = 453, ;
		Name = "lbl2", ;
		TabIndex = 41, ;
		Top = 38, ;
		Visible = .T., ;
		Width = 103, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl3' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Iesiri", ;
		FontName = "Arial Narrow", ;
		Height = 21, ;
		Left = 557, ;
		Name = "lbl3", ;
		TabIndex = 43, ;
		Top = 38, ;
		Visible = .T., ;
		Width = 103, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl4' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Stoc Final", ;
		FontName = "Arial Narrow", ;
		Height = 21, ;
		Left = 661, ;
		Name = "lbl4", ;
		TabIndex = 42, ;
		Top = 38, ;
		Visible = .T., ;
		Width = 103, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl5' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Preturi de achizitie fara TVA", ;
		FontName = "Arial Narrow", ;
		Height = 21, ;
		Left = 187, ;
		Name = "lbl5", ;
		TabIndex = 31, ;
		Top = 60, ;
		Visible = .T., ;
		Width = 149, ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'optgrup' AS _optiongrup WITH ;
		AutoSize = .F., ;
		BackColor = 239,239,239, ;
		BackStyle = 1, ;
		ButtonCount = 3, ;
		Height = 52, ;
		Left = 1, ;
		Name = "optgrup", ;
		TabIndex = 34, ;
		Top = 34, ;
		Value = 1, ;
		Width = 176, ;
		ZOrderSet = 1, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Gestiuni la pret de achizitie", ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Style = 0, ;
		Option1.Top = 1, ;
		Option1.Value = 1, ;
		Option1.Width = 165, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Gestiuni la pret de vanzare", ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 16, ;
		Option2.Value = 0, ;
		Option2.Visible = .F., ;
		Option2.Width = 163, ;
		Option3.AutoSize = .T., ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Toate gestiunile", ;
		Option3.Height = 17, ;
		Option3.Left = 5, ;
		Option3.Name = "Option3", ;
		Option3.Top = 31, ;
		Option3.Value = 0, ;
		Option3.Visible = .F., ;
		Option3.Width = 106
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT 'shp_total' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 239,239,239, ;
		BackStyle = 1, ;
		Height = 52, ;
		Left = 340, ;
		Name = "shp_total", ;
		SpecialEffect = 0, ;
		Top = 34, ;
		Width = 429, ;
		ZOrderSet = 13
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Text1' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 8, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_prec", ;
		FontName = "Arial Narrow", ;
		FontSize = 9, ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 344, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 35, ;
		Top = 60, ;
		Visible = .T., ;
		Width = 108, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text2' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 8, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_in", ;
		FontName = "Arial Narrow", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 453, ;
		Name = "Text2", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 36, ;
		Top = 60, ;
		Visible = .T., ;
		Width = 103, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text3' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 8, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_out", ;
		FontName = "Arial Narrow", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 557, ;
		Name = "Text3", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 37, ;
		Top = 60, ;
		Visible = .T., ;
		Width = 103, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text4' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 8, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_final", ;
		FontName = "Arial Narrow", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 661, ;
		Name = "Text4", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 38, ;
		Top = 60, ;
		Visible = .T., ;
		Width = 103, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS tcFiltru
		LOCAL lcFiltru
		IF EMPTY(tcFiltru)
			lcFiltru = poStocuri.ca_baza1.cfiltru
		ELSE
			lcFiltru = tcFiltru
		ENDIF 
		
		save_grid_tag(This.grdStocuri)
		poStocuri.ca_baza1.cfiltru=lcFiltru
		poStocuri.ca_baza1.afisare()
		restore_grid_tag(This.grdStocuri)
		this.grdStocuri.refresh
		
		
	ENDPROC

	PROCEDURE butappend
		If glLunaInchisa
			aMESSAGEBOX('Luna este inchisa!',0+48,"Atentie")
			RETURN
		ENDIF
		
		*RETURN 
		
		Private lcText,lcFis,lnOpt
		
		
		If Thisform.grdStocuri.ReadOnly
			lcText=[\<Deblocare;]
			lcText=lcText+[\-;]
			lcText=lcText+[\Adauga Blanc;]
			lcText=lcText+[\Sterge]
		Else
			If Thisform.lmodificata
				Thisform.do_modifica()
			Endif
			lcText=[\<Revenire;]
			lcText=lcText+[\-;]
			lcText=lcText+[\<Adauga Blanc;]
			lcText=lcText+[\<Sterge]
		Endif
		lnOpt=xmenu(lcText)
		Do Case
		Case lnOpt=1
			Thisform.initializare()
		Case lnOpt=3
			Thisform.do_adauga()
		Case lnOpt=4
			Thisform.do_sterge()
		Endcase
	ENDPROC

	PROCEDURE calcul_sume
		SELECT crsStocuri
		
		WITH thisform 
			IF .optgrup.value=1
				CALCULATE sum(ROUND(pret*cants,gnPc)),sum(ROUND(pret*cant,gnPc)),sum(ROUND(pret*cante,gnPc)),sum(ROUND(pret*(cants+cant-cante),gnPc)) ;
					TO .vstoc_prec,.vstoc_in,.vstoc_out,.vstoc_final
					*.vstoc_final = .vstoc_prec + .vstoc_in - .vstoc_out
			ENDIF
			FOR i=1 TO 4 do
		
				lcRefresh1 = [.text]+ALLTRIM(STR(i))+[.refresh]
				&lcRefresh1				
		
			ENDFOR
		
		ENDWITH 
		
		
	ENDPROC

	PROCEDURE do_adauga
		Local lcdenumire, lccodmat, lcum , lcExplicatieC,lcCont,lcAcont,lcExplicatieA, lcnume_gest,lccgest
		LOCAL lnpret,lnpretd,lnpretv,lntvav,lnproc_tvav
		LOCAL lnid_articol, lnid_gestiune
		
		locauta = caut_responsabil()
		
		IF !EMPTY(locauta.id_responsabil)
			lcnumeresp = ALLTRIM(locauta.nume)
			lnidresp = locauta.id_responsabil
		ELSE 
			RETURN 	
		ENDIF 	
		
		lntg = thisform.ntipgest 
		IF EMPTY(lntg)
			aMESSAGEBOX('Tip gestiune incorect!',16,'Eroare')
			RETURN 
		ENDIF 	
		locauta = caut_articol(lntg)
		
		If !Empty(locauta.denumire)
			lcdenumire = ALLTRIM(locauta.denumire)
			lccodmat = ALLTRIM(locauta.codmat)
			lcum = ALLTRIM(locauta.um)	
			lnpret=0
			lnpretd=0
		*!*		lnpretv=locauta.pretv
		*!*		lntvav=locauta.tvav
		*!*		lnproc_tvav=locauta.proc_tvav
			lnid_articol=locauta.id_articol
			
		Else
			RETURN
		ENDIF
		
		
		Store "" To locauta
		
		
		locauta = caut_cont(lntg)
		If !Empty(locauta.cont)
			lcExplicatieC = ALLTRIM(locauta.explicatie)
			lccont = ALLTRIM(locauta.cont)
			lcAcont = ALLTRIM(locauta.acont)
		Else
			Return
		ENDIF
		
		*!*	modificare	18.02.2008
		*!*	Store "" To locauta
		
		*!*	locauta = caut_acont(lccont)
		
		*!*	If !Empty(locauta.acont)
		*!*		lcExplicatieA = ALLTRIM(locauta.explicatie)
		*!*		lcAcont = ALLTRIM(locauta.acont)
		*!*	Else
		*!*		If gnButon=2
		*!*			Return
		*!*		Else
		*!*		lcExplicatieA = ""
		*!*		lcAcont = ""
		*!*		Endif
		*!*	ENDIF
		*!*	modificare	18.02.2008	^
		
		Store "" To locauta
		
		locauta = caut_gestiune(lntg,gnidutil)
		
		If !Empty(locauta.cgest) OR !EMPTY(locauta.nume_gestiune)
			lcnume_gest = ALLTRIM(locauta.nume_gestiune)
			lccgest = ALLTRIM(locauta.cgest)
			lnid_gestiune=locauta.id_gestiune
		Else
			Return
		ENDIF
		
		
		
		Select crsStocuri
		Locate For id_stoc = 0  And acont=lcAcont And cont=lccont AND cgest=lccgest 
		If !Found()
			Append Blank
			REPLACE id_gestiune	WITH lnid_gestiune
			REPLACE id_articol 	WITH lnid_articol
			REPLACE codmat		WITH lccodmat 
			REPLACE denumire 	WITH lcdenumire
			REPLACE um 			WITH lcum
			REPLACE pret 		WITH 0
			REPLACE cants 		WITH 0
			REPLACE cant 		WITH 0
			REPLACE cante 		WITH 0
			Replace Cont 		With lccont
			Replace acont 		With lcacont
			REPLACE cgest		WITH lccgest
		*!*		REPLACE pretv 		WITH lnpretv
		*!*		REPLACE tvav 		WITH lntvav
		*!*		REPLACE proc_tvav 	WITH lnproc_tvav
			REPLACE pretd 		WITH 0
			REPLACE datain 		WITH DATE()
			REPLACE dataout 	WITH DATE()
			replace nresp		WITH lcnumeresp
			replace id_responsabil WITH lnidresp
			Thisform.lmodificata=.T.
		Endif
		Thisform.grdStocuri.SetFocus()
	ENDPROC

	PROCEDURE do_cauta
		LPARAMETERS tcFiltru
		
		LOCAL lcFiltru
		IF !EMPTY(tcFiltru)
			lcFiltru = [ and ] + tcFiltru
		ELSE
			lcFiltru = []
		ENDIF 
		
		
		*!*	IF THISFORM.ck_filtru_denumire.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_denumire.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_codmat.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_codmat.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_gestiune.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_gestiune.filtru_ora
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_serie.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_serie.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_grupegest.VALUE=1
		*!*		SET TEXTMERGE ON TO memvar lcFiltruTempG NOSHOW 
		*!*			\ and a.id_gestiune in ( 
		*!*			\ select ID_GESTIUNE
		*!*			\	from <<gcS>>.vgest_coresp_grupe_gestiuni c
		*!*			\	join (select id_grupe
		*!*			\       from <<gcS>>.gest_nom_grupe
		*!*			\       where sters = 0
		*!*		    \       start with <<SUBSTR(THISFORM.ck_filtru_grupegest.filtru_ora,5)>> 
		*!*			\       connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe )
		*!*		SET TEXTMERGE TO 
		
		*!*		lcFiltru=lcFiltru + lcFiltruTempG 
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_cont.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_cont.filtru
		*!*	ENDIF
		
		
		*!*	IF THISFORM.ck_filtru_acont.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_acont.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_respons.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_respons.filtru_ora
		*!*	ENDIF
		
		
		*!*	IF THISFORM.ck_filtru_datain.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_datain.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_dataout.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_dataout.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_pret.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_pret.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_datapif.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_datapif.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_filtru_stoc.VALUE=1
		*!*		lcFiltru=lcFiltru+THISFORM.ck_filtru_stoc.filtru
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_stoc_negativ.VALUE = 1
		*!*		lcFiltru = lcFiltru + [ AND a.cants+a.cant-a.cante<0]
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_cu_rulaj.VALUE = 1
		*!*		lcFiltru = lcFiltru + [ AND (a.cant!=0 or a.cante!=0)]
		*!*	ENDIF
		
		*!*	IF THISFORM.ck_fara_rulaj.VALUE = 1
		*!*		lcFiltru = lcFiltru + [ AND (a.cant=0 and a.cante=0)]
		*!*	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_filtru_gr.Value = 1
		*!*		lcFiltru = lcFiltru + THISFORM.ck_filtru_gr.filtru_ora
		*!*	ENDIF 
		
		*!*	IF thisform.ck_filtru_sbgr.Value=1
		*!*		lcFiltru = lcFiltru + THISFORM.ck_filtru_sbgr.filtru_ora
		*!*	ENDIF 
		
		*!*	IF THISFORM.optgrup.ENABLED = .T.
		*!*		DO CASE
		*!*			CASE THISFORM.optgrup.VALUE = 1
		*!*				lcFiltru = lcFiltru + [ AND c.nr_pag<>6]
		*!*			CASE THISFORM.optgrup.VALUE = 2
		*!*				lcFiltru = lcFiltru + [ AND c.nr_pag=6]
		*!*		ENDCASE
		*!*	ENDIF
		
		*!*	IF !EMPTY(lcFiltru)
		*!*		lcFiltru = THIS.cfiltruinitial + lcFiltru
		*!*	ELSE
		*!*		lcFiltru = THIS.cfiltruinitial
		*!*	ENDIF
		
		
		*!*	THIS.MOUSEPOINTER= 11
		*!*	THIS.LOCKSCREEN= .T.
		*!*	THIS.actualizeaza_grid1(lcFiltru)
		*!*	THIS.calcul_sume
		*!*	SELECT crsStocuri
		*!*	GO TOP
		*!*	IF RECCOUNT()=0
		*!*		aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		*!*	ELSE
		*!*		THISFORM.grdStocuri.SETFOCUS
		*!*	ENDIF
		*!*	THIS.LOCKSCREEN=.F.
		*!*	THIS.MOUSEPOINTER= 0
		
		If Thisform.optgrup.Enabled = .T.
			Do Case
			Case Thisform.optgrup.Value = 1
				lcFiltru = lcFiltru + [ AND a.nr_pag<>6]
			Case Thisform.optgrup.Value = 2
				lcFiltru = lcFiltru + [ AND a.nr_pag=6]
			Endcase
		Endif
		
		If !Empty(lcFiltru)
			lcFiltru = This.cfiltruinitial + lcFiltru
		Else
			lcFiltru = This.cfiltruinitial
		Endif
		
		&& filtru pretty
		IF LEN(THISFORM.filtru_pretty)>0
			filtrutext=THISFORM.filtru_pretty
			lcFiltru=lcFiltru+" and ("+ALLTRIM(filtrutext)+")"
		ENDIF
		
		IF THIS.filtru_pretty#"none"
			THISFORM.actualizeaza_grid1(lcFiltru)
			THIS.calcul_sume()	
			IF RECCOUNT('crsStocuri')=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			ENDIF
		ENDIF
		THISFORM.but_start_criterii1.SETFOCUS
		
	ENDPROC

	PROCEDURE do_excel
		lnOption = xmenu('Export \<neformatat;Export \<formatat (experimental)')
		If lnOption = 1
			Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
			lcAlias = This.grdStocuri.RecordSource
		
			If Reccount(lcAlias) > 0
		
				lcFiltru = Filter(lcAlias)
				If Empty(lcFiltru)
					lcFiltru = '.T.'
				Endif
		
				lcColumnList = ''
				lcHeaderList = ''
				lcSelect = ''
				llSelect = .T.
				lcType = 'CURSOR'
				lcFrom = lcAlias
				lcWhere = lcFiltru
				lcOrder = 'nresp,codmat,denumire'
				lcOutput = 'crsStoc'
		
				If Used(lcOutput)
					Use In (lcOutput)
				Endif
		
				get_schema_grid(This.grdStocuri,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
				&lcSelect
		
				If Used(lcOutput)
					Do export_xls With lcOutput In oproceduri_comune.prg
					Use In (lcOutput)
				Endif
		
			Else
				amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
			Endif
		Else
			lcAlias = This.grdStocuri.RecordSource
		
			If Reccount(lcAlias) > 0
				lcFile = Putfile('Salvati fisierul xml','stocuri_obiecte_inventar_folosinta_' + Alltrim(Str(m.gnAn)) + Padl(m.gnLuna,2,'0') + '.xml', 'XML')
				If Empty(lcFile)
					Return
				Endif
		
				loExcelXML = Newobject("ExcelXML","excelxml.vcx")
				TEXT TO lcProgresMethod
					lparameters plnPercent
					WAIT WINDOW 'Progres: ' + TRANSFORM(m.plnPercent) + '%' NOWAIT 
		
				ENDTEXT 
				This.WriteMethod('Progress','Wait window ')
				With loExcelXML
				
					.GridObject = This.grdStocuri
					.HasFilter = .T.
					.LockHeader = .T.
					.SheetName = "Stocuri obiecte inventar in folosinta"
					.OpenAfterSaving = .F.
		
					If .Save(m.lcFile)
						Try
							loExcel = Createobject("Excel.Application")
							loExcel.Visible = .T.
							loExcel.Workbooks.Open(m.lcFile)
						Catch To loEx
							amessagebox('Microsoft Excel nu este instalat! Lansati programul de foi de calcul si deschideti fisierul ' + m.lcFile,0+48,_Screen.Caption)
							open_default_app(m.lcFile)
						Endtry
					Else
						amessagebox("Eroare salvare fisier!", 48)
					Endif
				Endwith
			Else
				amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
			ENDIF && Reccount
		Endif
		
	ENDPROC

	PROCEDURE do_listare
		PRIVATE pcSubtitlu
		pcSubtitlu = THIS.filtru_pretty_ro_full
		
		
		X = XMENU("\<Listare selectie;Listare grupata pe \<articole")
		DO CASE
			CASE X = 1
				THIS.do_listare_selectie()
			CASE X = 2
				THIS.do_listare_articole()
		ENDCASE
		
	ENDPROC

	PROCEDURE do_listare_articole
		Local lcTabel
		lcTabel = Thisform.grdStocuri.RecordSource
		
		If Reccount(lcTabel)>0
			Private pcDataora, pcTitlu
			pcTitlu = "OBIECTE DE INVENTAR IN FOLOSINTA - GRUPARE PE ARTICOLE"
			pcDataora = get_ora(2)
			Select id_articol, codmat, denumire, um, Sum(cants+cant-cante) As cant, Pret, serie, lot ;
				FROM (lcTabel) ;
				GROUP By id_articol, codmat, denumire, serie, lot, um, Pret ;
				ORDER By codmat ;
				INTO Cursor cStocArt
		
		* SELECT * FROM cStocArt INTO TABLE c:\stocart.dbf
		
			Thisform.AlwaysOnTop = .F.
		
			Select  cStocArt
			*Keyboard '{CTRL+F10}'
			*Report Form rap_stoc_art To Printer Prompt Preview
			goExport.export2frx([cStocArt],[rap_stoc_art],.T., , , , , .T.)
		
			Thisform.AlwaysOnTop = .T.
		
			If Used('cStocArt')
				Use In cStocArt
			Endif
		Else
			amessagebox("Nu exista inregistrari pentru listare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_listare_borderou
		If Reccount('crsStocuri')>0
			Select Nvl(Cont,'    ') As Cont,Nvl(acont,'    ') As acont,;
				pret,cants,cant,cante From crsStocuri Into  Cursor crsStocuri_temp
		
			Select Distinct Cont,acont,;
				000000000000000000.0000 As Prec,000000000000000000.0000 As intrari,;
				000000000000000000.0000 As iesiri,000000000000000000.0000 As sold ;
				WHERE !Empty(Cont);
				FROM crsStocuri_temp Into Cursor crsConturi Readwrite Order By Cont,acont
		
			Select crsConturi
			Scan
				Scatter Name loCont
				Select crsStocuri_temp
				Calculate Sum(Round(cants*Pret,gnPC)), Sum(Round(cant*Pret,gnPC)),Sum(Round(cante*Pret,gnPC)) ;
					FOR Alltrim(Cont)=Alltrim(loCont.Cont) And Alltrim(acont)=Alltrim(loCont.acont) To ;
					loCont.Prec,loCont.intrari,loCont.iesiri;
		
				Select crsConturi
				Gather Name loCont
			Endscan
		
			Select crsConturi
			Replace All sold With Prec+intrari-iesiri
			lcTitlu = [Borderou de verificare valorica]
			pcTitlu = m.lcTitlu && ceretitlu_rap([Titlul raportului],lcTitlu)
			pcDataora = get_Ora(2)
		
		
			Thisform.AlwaysOnTop=.F.
			Select crsConturi
			*Report Form rap_stoc_borderou.frx To Printer Prompt Preview
			goExport.export2frx([crsConturi],[rap_stoc_borderou],.T., , , , , .T.)	
			Thisform.AlwaysOnTop=.T.
		
			Use In crsConturi
			Use In crsStocuri_temp
		Else
			amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_listare_selectie
		*!*	26.01.2011
		*!* marius.mutu
		*!* listare dupa coloana ordonata gridextras
		
		If Reccount('crsStocuri')>0
			Private pcTitlu,pcDataora
			Store "" To pcTitlu,pcDataora
			Local lcOrder, lcOrderColumn, loColumnSort, lcFilter, lcFiltru
			lcOrder = ""
			lcOrderColumn = ""
		
			*!*		If Thisform.ck_fara_rulaj.Value=1
			*!*			lcTitlu = [STOCURI FARA MISCARE IN ULTIMELE ]+Thisform.nzile+[ ZILE]
			*!*		Else
			lcTitlu = [STOCURI - GESTIUNI]
			*!*		Endif
		
			lcFilter = FILTER('crsStocuri')
			lcFiltru = IIF(!EMPTY(m.lcFilter), 'where ' + m.lcFilter, '')
			lcFiltru = STRTRAN(m.lcFiltru, 'crsstocuri.','a.',1,10,1)
			
			pcTitlu = m.lcTitlu && ceretitlu_rap([Titlul raportului],lcTitlu)
			pcDataora = get_Ora(2)
		
			pcGrupGest = [nresp]
			pcGrupCont = [EOF()]
			pcGrupAcont = [EOF()]
			pcHeaderGrup = [Responsabil ]
		
		
			*!*	26.01.2011
			*!*		loColumnSort = This.gridsort1.ocolumnreference
			*!*		If Type('loColumnSort') = 'O'
			*!*			lcOrderColumn = Upper(Alltrim(loColumnSort.ControlSource))
			*!*		Endif
			lcOrderColumn = ""
			lcColoanaOrdonare = []
			loColumnSort = Thisform.gridextra1.currentcolumn
			lcColoanaOrdonare = []
			If Type('loColumnSort') == 'O'
				lcOrderColumn = [1] + Iif(Thisform.gridextra1.Ascending,[ DESC],[])
				lcColoanaOrdonare = Strtran(Upper(Alltrim(loColumnSort.ControlSource)),[CRSSTOCURI.],[a.]) + [ as colord1,]
			Endif
			*!*	26.01.2011 ^
		
		
			If Type('loColumnSort') = 'O'
				*!*	modificare v 2.0.169
				*!*			lcOrderColumn = Upper(Alltrim(loColumnSort.ControlSource))
				lcOrderColumn = [1] + Iif(Upper(Alltrim(loColumnSort.Tag))=[DOWN],[ DESC],[])
				lcColoanaOrdonare = Strtran(Upper(Alltrim(loColumnSort.ControlSource)),[CRSSTOCURI.],[a.]) + [ as colord1,]
				*!*	modificare v 2.0.169 ^
			Endif
		
			If Empty(lcOrderColumn)
				lcOrder = "a.nresp,a.denumire,a.codmat"
			Else
				Do Case
					Case lcOrderColumn = 'CODMAT'
						lcOrder = "a.nresp,a.CODMAT,a.denumire"
					Case lcOrderColumn = 'DENUMIRE'
						lcOrder = "a.nresp,a.DENUMIRE,a.CODMAT"
					Otherwise
						lcOrder = "a.nresp," + lcOrderColumn
				Endcase
			Endif
			*!*	modificare v 2.0.169
			*!*		Select * From crsStocuri Into Cursor crs_rap Order By &lcOrder
			lcComanda = [Select ] + lcColoanaOrdonare + [a.* From crsStocuri a ] + m.lcFiltru + [ Into Cursor crs_rap Order By ] + lcOrder
			&lcComanda
			*!*	modificare v 2.0.169 ^
		
			*!*SELECT * from crsStocuri INTO CURSOR crs_rap ORDER BY nresp,denumire,codmat
			Thisform.AlwaysOnTop=.F.
			*Keyboard '{CTRL+F10}'
			*Report Format rap_stocachi_grup_obinv.FRX To Printer Prompt Noconsole Preview
			goExport.export2frx([crs_rap],[rap_stocachi_grup_obinv],.T., , , , , .T.)	
		
			Thisform.AlwaysOnTop=.T.
			Use In crs_rap
		Else
			amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_modifica
		LPARAMETERS tlIesire
		
		
		IF glLunaInchisa
			aMESSAGEBOX('Luna este inchisa!',0+48,"Atentie")
			RETURN
		ENDIF
		
		LOCAL lcFunctie,lcSql,lcMesaj,lcActiune,lcTitlu,llIesire,lcProc
		PRIVATE poRec
		
		llIesire=tlIesire
		IF EMPTY(llIesire)
			llIesire=.F.
		ENDIF
		SELECT crsStocuri
		SCATTER NAME poRec
		
		nrlin=RECNO()
		THISFORM.grdStocuri.SETALL('DynamicFontBold','IIF(RECNO()=nrlin,.T.,.F.)','Column')
		THISFORM.grdStocuri.REFRESH()
		lnluna=luna
		
		IF lnluna = 0
			lcMesaj=[Doriti sa adaugati aceasta inregistrare?]
			lcActiune=[adaugata]
			lcTitlu=[Adaugare]
		ELSE
			lcMesaj=[Doriti sa modificati aceasta inregistrare?]
			lcActiune=[modificata]
			lcTitlu=[Modificare]
		ENDIF
		
		
		IF aMESSAGEBOX(lcMesaj,4+32+256,lcTitlu)==6
			lcProc = IIF(lnluna = 0, [stocobinvinsproc], [stocobinvupdproc])
			lcSql = [begin pack_stoc.] + lcProc + [(?gcs, ?@.id_stoc, ?gnLuna, ?gnAn, ?.id_articol, ?.PRET,  ?.cants, ]
			lcSql = lcSql + [?.cant, ?.cante, ?.CONT, ?.acont, ?.pretd, ?.datain, ?.dataout,  ?.id_gestiune,?.id_responsabil,?.dns_ramas,?.dns_luni,?.datapif,?gnIdSucursala); end;]
			
		
			WITH poRec
				lnSucces = goExecutor.oExecute(lcSql)
			ENDWITH 
			IF lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
				RETURN
			ENDIF
			SELECT crsStocuri
			REPLACE id_stoc WITH poRec.id_stoc
			THISFORM.MOUSEPOINTER= 11
			THISFORM.LOCKSCREEN=.T.
			THIS.do_cauta() 
			&&thisform.actualizeaza_grid1()
			THISFORM.LOCKSCREEN=.F.
			THISFORM.MOUSEPOINTER= 0
			aMESSAGEBOX("Inregistrarea a fost "+lcActiune+"!",0+64,lcTitlu)
			THISFORM.coldvalue = THISFORM.cnewvalue
			SELECT crsStocuri
			LOCATE FOR id_stoc = poRec.id_stoc
		
		ELSE
			IF !llIesire
				THISFORM.MOUSEPOINTER= 11
				THISFORM.LOCKSCREEN=.T.
				this.do_cauta()
				&&THISFORM.actualizeaza_grid1()
				THISFORM.LOCKSCREEN=.F.
				THISFORM.MOUSEPOINTER= 0
			ENDIF
		ENDIF
		THISFORM.lmodificata=.F.
		THISFORM.grdStocuri.SETALL('DynamicFontBold','.F.','Column')
		THISFORM.grdStocuri.REFRESH()
		
	ENDPROC

	PROCEDURE do_reface
		*!*	17.12.2020
		*!*	marius.mutu
		*!*	am scos refacerea lunara - se pune 0 (accidental) pe stoc precedent daca daca nu stie ce face
		*!* probabil este nevoie de refacere lunara intr-o situatie de initializare
		
		If m.glLunaInchisa
			AMESSAGEBOX('Luna este inchisa! Nu se pot da refaceri!',0+64,_screen.Caption)
			Return
		Endif	
		
		LOCAL lcCont,x, lcSursa, lnLuna, lnAn, lcLunar
		lcCont = []
		lcSursa = [STOC_OBINV]
		lnLuna = gnLuna
		lnAn = gnAn
		
		x= xmenu('Refacere cu \<precedente')
		DO case
		*!*		CASE x = 1
		*!*			lcLunar = [0]
		*!*			*lcExec = [begin pack_refaceri.refac_stoc_OBINV(?gcS,?gnAn,?gnLuna,0); end;]
			CASE x = 1
				lcLunar = [1]
				*lcExec = [begin pack_refaceri.refac_stoc_OBINV(?gcS,?gnAn,?gnLuna,1); end;]
			OTHERWISE
				RETURN 
		ENDCASE 
		
		*!*	lnSucces = goExecutor.oExecute(lcExec)
		*!*	IF lnSucces < 0
		*!*		MESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
		*!*		RETURN
		*!*	ENDIF 
		lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
		IF lnSucces >0
			aMESSAGEBOX('Refacerea s-a terminat!',0+64,"Refacere stocuri")
			Thisform.actualizeaza_grid1()
		ENDIF 
	ENDPROC

	PROCEDURE do_sterge
		Local lcSql,lnRec
		PRIVATE poRec
		If aMessagebox("Doriti sa stergeti aceasta inregistrare?",4+32+256,"Stergere")==6
			Select crsStocuri  
			SCATTER NAME poRec
			lcSql =[BEGIN PACK_STOC.STOCDELPROC(?gcs, ?.id_stoc); END;]
			WITH poRec
				lnSucces = goExecutor.oExecute(lcSql)
			ENDWITH 	
			If lnSucces < 0
				aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
				Return
			ENDIF
			SELECT crsStocuri
			DELETE 
			
			aMessagebox("Inregistrarea a fost stearsa!",0+64,"Stergere")
		*!*		Thisform.MousePointer= 11
		*!*		Thisform.LockScreen=.T.
		*!*		Thisform.actualizeaza_grid1()
		*!*		Thisform.LockScreen=.F.
		*!*		Thisform.MousePointer=0
		*!*	 	Select crsStocuri  
		*!*		GO TOP 
			
		ENDIF
		Thisform.grdStocuri.Refresh 
		Thisform.grdStocuri.SetFocus()
		
	ENDPROC

	PROCEDURE do_verifica
		LOCAL contselect
		contselect= ''
		IF this.optgrup.Value = 3
			lcTitlu = [Atentie]
			lcImagine = [exclam.ico]
			lcTip = [AVERTIZARE]
			lcMesaj1 = [Alegeti <Gestiuni la pret de achizitie>]
			lcMesaj2 = [sau <Gestiuni la pret de vanzare>]
			omesaj = CREATEOBJECT([frm_mesaj],lcTitlu,lcImagine,lcTip,lcMesaj1,lcMesaj2)
			omesaj.show(1)
			return
		ENDIF
		
		
		
		SELECT DISTINCT CONT FROM crsStocuri INTO CURSOR cConturiTemp
		IF _TALLY = 1
			contselect=ALLTRIM(cConturiTemp.CONT)
		ELSE
			contselect=''
		ENDIF
		USE IN (SELECT('cConturiTemp'))
		
		
		*!*	If Thisform.ck_filtru_cont.Value=1
		*!*		contselect=Thisform.ck_filtru_cont.filtru
		*!*		contselect=STRTRAN(contselect,'AND','')
		*!*		contselect=STRTRAN(contselect,'(','')
		*!*		contselect=STRTRAN(contselect,')','')
		*!*		contselect=STRTRAN(contselect,'A.CONT','')
		*!*		contselect=STRTRAN(contselect,"'",'')
		*!*		contselect=STRTRAN(contselect,'%','')
		*!*		contselect=STRTRAN(contselect,'LIKE','')
		*!*		contselect=ALLTRIM(contselect)
		*!*	ELSE 
		*!*		contselect=''
		*!*	ENDIF 
		
		DO verific_stoc_cu_balanta WITH contselect,thisform.optgrup.value
		
		
		
	ENDPROC

	PROCEDURE grid_sort_bind
		*!*	*!* 26.01.2011
		*!*	marius.mutu
		*!*	se foloseste gridextras pentru ordonare grid in loc de gridsort
		*!*
		*!* 26.01.2011 ^
	ENDPROC

	PROCEDURE Init
		Lparameters tlInFolosinta
		DoDefault()
		*!* 26.01.2011
		this.gridextra1.setup()
		*!* 26.01.2011 ^
		*!*	If !tlInFolosinta
		*!*		With Thisform
		*!*			.ck_filtru_gr.Visible = .F.
		*!*			.ck_filtru_sbgr.Visible = .F.
		*!*			.ck_filtru_meserie.Visible = .F.
		*!*			.ck_filtru_formatie.Visible = .F.
		*!*			.ck_filtru_dataang.Visible  = .F.
		*!*			.ck_filtru_datalic.Visible = .F.
		*!*			.ck_filtru_stoc.Left = .ck_filtru_respons.Left
		*!*			.ck_stoc_negativ.Left = .ck_filtru_meserie.Left
		*!*			.ck_cu_rulaj.Left = .ck_filtru_dataang.Left
		*!*			.ck_fara_rulaj.Left = .ck_filtru_datalic.Left
		*!*			.ck_filtru_respons.Top = .ck_filtru_gr.Top
		*!*			.ck_filtru_respons.Left = .ck_filtru_gr.Left
		*!*			With .grdStocuri
		*!*				.RemoveObject("cMeserie")
		*!*				.RemoveObject("cFormatia")
		*!*				.RemoveObject("cDataAng")
		*!*				.RemoveObject("cDatalic")
		*!*				.RemoveObject("cDNF")
		*!*				.RemoveObject("cDataExpirare")
		*!*				.RemoveObject("cGrupa")
		*!*				.RemoveObject("cSubgrupa")
		*!*			Endwith
		*!*		Endwith
		*!*	Endif
	ENDPROC

	PROCEDURE initializare
		Thisform.grdStocuri.ReadOnly = !Thisform.grdStocuri.ReadOnly
		Thisform.but_start_criterii1.Enabled = !Thisform.but_start_criterii1.Enabled
		Thisform.but_reset_criterii1.Enabled = !Thisform.but_reset_criterii1.Enabled
		Thisform.but_reface1.Enabled = !Thisform.but_reface1.Enabled
		
		With Thisform.grdstocuri
			
			.cnr_crt.ReadOnly=.T.
			.ccodmat.ReadOnly=.T.
			.cdenumire.readonly=.T.
			.cum.ReadOnly=.T.
			.ccont.ReadOnly=.T.
			.cacont.ReadOnly=.T.
			.ccgest.ReadOnly=.T.
		*!*		.cpretvtva.ReadOnly=.T.
			.cstoc.ReadOnly=.T.
			.cresp.readonly=.t.
			
		Endwith
		thisform.grdStocuri.setfocus 
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		Local lbviz
		lbviz=This.bvizualizare
		*!*	am suprascris KeyPress ca sa nu se poata apela do_adauga prin combinatii de taste
		Do Case
		Case nKeyCode=13 And nShiftAltCtrl=2 && CTRL + M
			Nodefault
			If This.but_modifica1.Visible
				This.but_modifica1.Click()
			Endif
		Case nKeyCode=27 And nShiftAltCtrl=0
			Nodefault
			If aMessagebox("Sunteti sigur ca doriti sa inchideti fereastra?",4+32+256,"Confirmare")==6
				This.do_renunt()
			Endif
		Case nKeyCode=5 And nShiftAltCtrl=2 And lbviz=.F.
			Nodefault
			If Pemstatus(This,"inainte_de_do_excel",5)
				This.inainte_de_do_excel()
			Endif
		Case nKeyCode=6 And nShiftAltCtrl=2
			Nodefault
			This.do_termin()
		Case nKeyCode=16 And nShiftAltCtrl=2 And lbviz=.F.
			Nodefault
			If Pemstatus(This,"inainte_de_do_listare",5)
				This.inainte_de_do_listare()
			Endif
		*!* Criterii Selectie - Vasile Cristian 25.oct.2007
		Case nKeyCode = 17 And nShiftAltCtrl=2 && CTRL + Q
			Nodefault
			If Type('THIS.but_start_criterii1') = 'O'
				This.but_start_criterii1.Click()
			Endif
		
		Case nKeyCode = 20 And nShiftAltCtrl=2 && CTRL + T
			Nodefault
			If Type('THIS.but_reset_criterii1') = 'O'
				This.but_reset_criterii1.Click()
			Endif
		Endcase
	ENDPROC

	PROCEDURE 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 + ;
			"Serie articol\serie\T\none\" + crlf + ;
			"Grupa articol\grupa\T\id_grupa\nom_grupa_articol"+ crlf + ;
			"Subgrupa articol\subgrupa\T\id_subgrupa\nom_subgrupa_articol"+ crlf + ;
			"Gestiune\none\I\id_gestiune\nom_gestiune" + crlf + ;
			"Grupe gestiuni\|E|" + ;
				[a.id_gestiune in ( ] + ;
				[ select ID_GESTIUNE ] + ;
				[	from vgest_coresp_grupe_gestiuni c ] + ;
				[	join (select id_grupe ] + ;
				[       from gest_nom_grupe ] + ;
				[       where sters = 0 ] + ;
			    [       start with id_grupe = <<VALOARE>> ] + ;
				[      connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe )\I\none\nom_grupa_gestiune] + crlf + ;
			"Cont\cont\T\none\"+ crlf + ;
			"Cont analitic\acont\T\none\"+ crlf + ;
			"Data intrare\trunc(datain)\D\none\"+ crlf + ;
			"Data iesire\trunc(dataout)\D\none\"+ crlf + ;
			"Data Pif\trunc(datapif)\D\none\"+ crlf + ;
			"Pret achizitie\pret\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Responsabil\nresp\T\id_responsabil\nom_responsabil"+ crlf + ;
			"Marca resp.\marca\N\none\" + crlf + ;		
			"Meserie\meserie\T\id_meseria\nom_meserie"+ crlf + ;
			"Formatie\formatia\T\id_formatia\nom_formatie"+ crlf + ;		
			"Data angajare\trunc(dataang)\D\none\"+ crlf + ;
			"Data plecare\trunc(datalic)\D\none\"+ crlf + ;	
			"Stoc\cants+cant-cante\N|get_mask(12,gnPcant)\none\" + crlf + ;
			"Stoc negativ\nofiled\E\(cants+cant-cante<0)\" + crlf + ;
			"Cu rulaj\nofiled\E\(cant!=0 or cante!=0)\" + crlf + ;	
			"Fara rulaj\nofiled\E\(cant=0 and a.cante=0)\" + crlf + ;
			IIF(EMPTY(gcCondSucursala) and glEMama,"Sucursala\sucursala\C\none\",[])
		DODEFAULT()
		
	ENDPROC

	PROCEDURE grdStocuri.AfterRowColChange
		LPARAMETERS nColIndex
		Local lnluna
		With Thisform.grdStocuri
			Select crsStocuri  
			lnluna = luna	
			If Thisform.lmodificata
				Thisform.lmodificare_totaluri = .T.
				Thisform.calcul_sume()
				If lnluna = 0
					Thisform.lmodificare_totaluri = .F.
				Endif
				thisform.grdStocuri.Refresh
			Endif
			 
		Endwith
		 
	ENDPROC

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

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

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

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

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

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

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

	PROCEDURE grdStocuri.Cdatain.Text1.GotFocus
		
		Thisform.coldvalue=This.Value
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.Cdatain.Text1.InteractiveChange
		
		Thisform.cnewvalue=This.Value
	ENDPROC

	PROCEDURE grdStocuri.Cdataout.Text1.GotFocus
		Thisform.coldvalue=This.Value
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.Cdataout.Text1.InteractiveChange
		Thisform.cnewvalue=This.Value
	ENDPROC

	PROCEDURE grdStocuri.cdatapif.Text1.GotFocus
		Thisform.coldvalue=NVL(This.Value,{})
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.cdatapif.Text1.InteractiveChange
		
		Thisform.cnewvalue=This.Value
	ENDPROC

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

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

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

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

	PROCEDURE grdStocuri.Init
		*
	ENDPROC

	PROCEDURE Gridextra1.applyfilter
		DODEFAULT()
		THISform.calcul_sume()
	ENDPROC

	PROCEDURE Gridextra1.clearfilter
		DODEFAULT()
		THISform.calcul_sume()
	ENDPROC

	PROCEDURE optgrup.Valid
		LOCAL lcTraducere
		lcTraducere = ""
		DO CASE 
			CASE this.Value = 3
				pcListTipGest = [2,3,4,5,6]
			CASE this.Value = 2
				pcListTipGest = [6]
				lcTraducere = "Gestiuni la pret de vanzare"		
			CASE this.Value = 1
				pcListTipGest = [2,3,4,5]
				lcTraducere = "Gestiuni la pret de achizitie"
		ENDCASE 
		
		IF !PEMSTATUS(THIS,"cTraducere",5)
			THIS.ADDPROPERTY("cTraducere","")
		ENDIF
		
		
		THIS.cTraducere = lcTraducere
		
		
		thisform.do_cauta()
		thisform.but_start_criterii1.refreshstatus()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_stocuri_pretv 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_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cnr_crt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cnr_crt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccodmat.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccodmat.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cum.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cum.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccants.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccants.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccant.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccant.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccante.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccante.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cstoc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cstoc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cacont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cacont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ccgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretvtva.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cpretvtva.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ctvav.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Ctvav.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdatain.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdatain.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdataout.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Cdataout.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column19.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column19.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column20.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.Column20.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCantBax.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCantBax.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cUm2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cUm2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSerie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSerie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodmatF.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodmatF.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataExpirare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cDataExpirare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cLot.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cLot.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cPart_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cPart_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cNrord_rez.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cNrord_rez.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cfurn_princ.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cfurn_princ.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFurnizor.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cFurnizor.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodNC8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cCodNC8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGreutate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cGreutate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cTaraOrigine.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdStocuri.cTaraOrigine.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shp_total" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reface1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="LB_SIMPLU1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbl3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_start_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset_criterii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Text8" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Chk_fara_miscare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_shortcuts1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: butappend
		*m: calcul_sume
		*m: do_listare_articol
		*m: do_listare_borderou
		*m: do_listare_fisa_magazie
		*m: do_listare_selectie
		*m: initializare
		*p: cfiltruinitial
		*p: cnewvalue
		*p: coldvalue
		*p: data_f_misc
		*p: data_ref
		*p: lmodificare_totaluri
		*p: lmodificata
		*p: ngridheight
		*p: ntipgest
		*p: vstoc_final
		*p: vstoc_finalv
		*p: vstoc_final_tot
		*p: vstoc_in
		*p: vstoc_inv
		*p: vstoc_in_tot
		*p: vstoc_out
		*p: vstoc_outv
		*p: vstoc_out_tot
		*p: vstoc_prec
		*p: vstoc_precv
		*p: vstoc_prec_tot
	*</DefinedPropArrayMethod>

	*<PropValue>
		cbuton2 = but_listare1;but_listare2
		cgridsortlist = grdStocuri
		cnewvalue = .F.
		coldvalue = .F.
		data_f_misc = .F.
		data_ref = {}
		DoCreate = .T.
		FontName = "Arial Narrow"
		Height = 411
		lmodificare_totaluri = .F.
		lmodificata = .F.
		Name = "frm_stocuri_pretv"
		ngridheight = 0
		ntipgest = 0
		vstoc_final = 0
		vstoc_finalv = 0
		vstoc_final_tot = 0
		vstoc_in = 0
		vstoc_inv = 0
		vstoc_in_tot = 0
		vstoc_out = 0
		vstoc_outv = 0
		vstoc_out_tot = 0
		vstoc_prec = 0
		vstoc_precv = 0
		vstoc_prec_tot = 0
		Width = 770
		WindowState = 2
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 770
		_shape1.ZOrderSet = 0
		_shape2.Anchor = 8
		_shape2.Height = 28
		_shape2.Left = 559
		_shape2.Name = "_shape2"
		_shape2.Top = 1
		_shape2.Width = 208
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "STOCURI"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 31
		Lb_titlu_alb_b121.Top = 1
		Lb_titlu_alb_b121.ZOrderSet = 2
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 739
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 20
		BUT_TERMIN1.Tag = "MOVABLE,NOVERTICAL_MOVE"
		BUT_TERMIN1.ToolTipText = "Terminare"
		BUT_TERMIN1.Top = 2
		BUT_TERMIN1.Width = 30
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 9
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 60
	*</PropValue>

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

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 681, ;
		Name = "But_listare1", ;
		TabIndex = 21, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Borderou de verificare valorica", ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare2' AS but_listare WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 651, ;
		Name = "But_listare2", ;
		TabIndex = 22, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Listare selectie", ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare3' AS but_listare WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 711, ;
		Name = "But_listare3", ;
		TabIndex = 19, ;
		Tag = "MOVABLE,NOVERTICAL_MOVE", ;
		ToolTipText = "Fisa magazie", ;
		Top = 2, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reface1' AS but_reface WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 561, ;
		Name = "But_reface1", ;
		TabIndex = 25, ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'But_start_criterii1' AS but_start_criterii WITH ;
		Anchor = 9, ;
		Comment = "*:OnResize=RT", ;
		Left = 503, ;
		Name = "But_start_criterii1", ;
		Top = 2, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="ocriterii.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 8, ;
		Height = 27, ;
		Left = 592, ;
		Name = "But_verifica1", ;
		SpecialEffect = 1, ;
		TabIndex = 24, ;
		Top = 2, ;
		Width = 30, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Chk_fara_miscare' AS _checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Fara miscare", ;
		Height = 18, ;
		Left = 5, ;
		Name = "Chk_fara_miscare", ;
		TabIndex = 19, ;
		Top = 33, ;
		Width = 95, ;
		ZOrderSet = 52
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdStocuri' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 32, ;
		DeleteMark = .F., ;
		Height = 302, ;
		Left = 0, ;
		Name = "grdStocuri", ;
		Panel = 1, ;
		RecordSource = "crsStocuri", ;
		RowHeight = 19, ;
		TabIndex = 26, ;
		Top = 103, ;
		Width = 767, ;
		ZOrderSet = 9, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "nr_crt", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Cnr_crt", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 23, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "codmat", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Ccodmat", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 97, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "denumire", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Cdenumire", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 196, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "um", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Cum", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 39, ;
		Column5.ColumnOrder = 8, ;
		Column5.ControlSource = "cants", ;
		Column5.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Format = "r", ;
		Column5.InputMask = (get_mask(14,gnPCANT)), ;
		Column5.Name = "Ccants", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 70, ;
		Column6.ColumnOrder = 9, ;
		Column6.ControlSource = "cant", ;
		Column6.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Format = "r", ;
		Column6.InputMask = (get_mask(14,gnPCANT)), ;
		Column6.Name = "Ccant", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 64, ;
		Column7.ColumnOrder = 10, ;
		Column7.ControlSource = "cante", ;
		Column7.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Format = "r", ;
		Column7.InputMask = (get_mask(14,gnPCANT)), ;
		Column7.Name = "Ccante", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 48, ;
		Column8.ColumnOrder = 11, ;
		Column8.ControlSource = "cants+cant-cante", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Format = "r", ;
		Column8.InputMask = (get_mask(16,gnPCANT)), ;
		Column8.Name = "Cstoc", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 50, ;
		Column9.ColumnOrder = 12, ;
		Column9.ControlSource = "cont", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Ccont", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 36, ;
		Column10.ColumnOrder = 13, ;
		Column10.ControlSource = "acont", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Cacont", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 37, ;
		Column11.ColumnOrder = 14, ;
		Column11.ControlSource = "cgest", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Ccgest", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 40, ;
		Column12.ColumnOrder = 16, ;
		Column12.ControlSource = "pretv", ;
		Column12.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Format = "r", ;
		Column12.InputMask = (get_mask(16,gnPPretV)), ;
		Column12.Name = "Cpretv", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 75, ;
		Column13.ColumnOrder = 15, ;
		Column13.ControlSource = "pretv+tvav", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Format = "r", ;
		Column13.InputMask = (get_mask(16,gnPPretV)), ;
		Column13.Name = "Cpretvtva", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 95, ;
		Column14.ColumnOrder = 17, ;
		Column14.ControlSource = "tvav", ;
		Column14.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Format = "r", ;
		Column14.InputMask = (get_mask(16,gnPPretV)), ;
		Column14.Name = "Ctvav", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 62, ;
		Column15.ColumnOrder = 19, ;
		Column15.ControlSource = "datain", ;
		Column15.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "Cdatain", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 66, ;
		Column16.ColumnOrder = 20, ;
		Column16.ControlSource = "dataout", ;
		Column16.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "Cdataout", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 75, ;
		Column17.Alignment = 1, ;
		Column17.ColumnOrder = 18, ;
		Column17.ControlSource = "proc_tvav", ;
		Column17.DynamicBackColor = "iif(this.readonly,RGB(255,255,255),RGB(252,255,183))", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.InputMask = "99.99", ;
		Column17.Name = "Column19", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 41, ;
		Column18.ColumnOrder = 27, ;
		Column18.ControlSource = "id_articol", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "Column20", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 71, ;
		Column19.ColumnOrder = 6, ;
		Column19.ControlSource = "cant_bax", ;
		Column19.FontName = "Arial", ;
		Column19.FontSize = 10, ;
		Column19.Name = "cCantBax", ;
		Column19.Width = 54, ;
		Column20.ColumnOrder = 7, ;
		Column20.ControlSource = "um2", ;
		Column20.FontName = "Arial", ;
		Column20.FontSize = 10, ;
		Column20.Name = "cUm2", ;
		Column20.Width = 46, ;
		Column21.ColumnOrder = 4, ;
		Column21.ControlSource = "serie", ;
		Column21.FontName = "Arial", ;
		Column21.FontSize = 10, ;
		Column21.Name = "cSerie", ;
		Column21.Width = 85, ;
		Column22.ColumnOrder = 21, ;
		Column22.ControlSource = "codmatf", ;
		Column22.FontName = "Arial", ;
		Column22.FontSize = 10, ;
		Column22.Name = "cCodmatF", ;
		Column22.Width = 84, ;
		Column23.ColumnOrder = 23, ;
		Column23.ControlSource = "adata_expirare", ;
		Column23.FontName = "Arial", ;
		Column23.FontSize = 10, ;
		Column23.Name = "cDataExpirare", ;
		Column24.ColumnOrder = 22, ;
		Column24.ControlSource = "lot", ;
		Column24.FontName = "Arial", ;
		Column24.FontSize = 10, ;
		Column24.Name = "cLot", ;
		Column24.Width = 84, ;
		Column25.ColumnOrder = 26, ;
		Column25.ControlSource = "sucursala", ;
		Column25.FontName = "Arial", ;
		Column25.FontSize = 10, ;
		Column25.Name = "cSucursala", ;
		Column26.ColumnOrder = 24, ;
		Column26.ControlSource = "part_rez", ;
		Column26.FontName = "Arial", ;
		Column26.FontSize = 10, ;
		Column26.Name = "cPart_rez", ;
		Column27.ColumnOrder = 25, ;
		Column27.ControlSource = "nrord_rez", ;
		Column27.FontName = "Arial", ;
		Column27.FontSize = 10, ;
		Column27.Name = "cNrord_rez", ;
		Column28.ControlSource = "furn_princ", ;
		Column28.FontName = "Arial", ;
		Column28.FontSize = 10, ;
		Column28.Name = "cfurn_princ", ;
		Column28.Width = 116, ;
		Column29.ControlSource = "furnizor", ;
		Column29.FontName = "Arial", ;
		Column29.FontSize = 10, ;
		Column29.Name = "cFurnizor", ;
		Column29.ReadOnly = .T., ;
		Column29.Width = 127, ;
		Column30.ControlSource = "codnc8", ;
		Column30.Name = "cCodNC8", ;
		Column30.ReadOnly = .T., ;
		Column30.Width = 150, ;
		Column31.ControlSource = "greutate", ;
		Column31.Name = "cGreutate", ;
		Column31.ReadOnly = .T., ;
		Column32.ControlSource = "tara_origine", ;
		Column32.Name = "cTaraOrigine", ;
		Column32.ReadOnly = .T., ;
		Column32.Width = 134
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

	ADD OBJECT 'grdStocuri.cCodNC8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod NC8", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.Cdatain.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 'grdStocuri.Cdataout.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data ultimei iesiri", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'grdStocuri.cFurnizor.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 'grdStocuri.cGreutate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Greutate (Kg)", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

	ADD OBJECT 'grdStocuri.Cnr_crt.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, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.Column19.Text1' AS textbox WITH ;
		Alignment = 1, ;
		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 'grdStocuri.Column20.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id Articol", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.Column20.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 'grdStocuri.cPart_rez.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Part. rez.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

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

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

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

	ADD OBJECT 'grdStocuri.cTaraOrigine.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tara origine", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'grdStocuri.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 = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

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

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

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

	ADD OBJECT 'LB_SIMPLU1' AS lb_simplu WITH ;
		Caption = "Gestiuni la pret de vanzare", ;
		Left = 8, ;
		Name = "LB_SIMPLU1", ;
		TabIndex = 37, ;
		Top = 57, ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'lbl1' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Stoc Precedent", ;
		Height = 21, ;
		Left = 225, ;
		Name = "lbl1", ;
		TabIndex = 33, ;
		Top = 56, ;
		Visible = .T., ;
		Width = 137, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl2' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Intrari", ;
		Height = 21, ;
		Left = 365, ;
		Name = "lbl2", ;
		TabIndex = 34, ;
		Top = 56, ;
		Visible = .T., ;
		Width = 132, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl3' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Iesiri", ;
		Height = 21, ;
		Left = 498, ;
		Name = "lbl3", ;
		TabIndex = 36, ;
		Top = 56, ;
		Visible = .T., ;
		Width = 132, ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl4' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Val. Stoc Final", ;
		Height = 21, ;
		Left = 631, ;
		Name = "lbl4", ;
		TabIndex = 35, ;
		Top = 56, ;
		Visible = .T., ;
		Width = 132, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lbl6' AS _label WITH ;
		Anchor = 9, ;
		AutoSize = .F., ;
		BackColor = 219,219,219, ;
		BackStyle = 1, ;
		BorderStyle = 1, ;
		Caption = " Preturi de vanzare cu TVA", ;
		Height = 21, ;
		Left = 56, ;
		Name = "lbl6", ;
		TabIndex = 32, ;
		Top = 78, ;
		Visible = .T., ;
		Width = 166, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'shp_total' AS shape WITH ;
		Anchor = 10, ;
		BackColor = 239,239,239, ;
		BackStyle = 1, ;
		Height = 51, ;
		Left = 0, ;
		Name = "shp_total", ;
		SpecialEffect = 0, ;
		Top = 52, ;
		Width = 770, ;
		ZOrderSet = 10
		*< END OBJECT: BaseClass="shape" />

	ADD OBJECT 'Text5' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_precv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 225, ;
		Name = "Text5", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 27, ;
		Top = 78, ;
		Visible = .T., ;
		Width = 137, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text6' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_inv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 365, ;
		Name = "Text6", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 28, ;
		Top = 78, ;
		Visible = .T., ;
		Width = 132, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text7' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_outv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 498, ;
		Name = "Text7", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 29, ;
		Top = 78, ;
		Visible = .T., ;
		Width = 132, ;
		ZOrderSet = 23
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Text8' AS _textbox WITH ;
		Alignment = 1, ;
		Anchor = 9, ;
		BackStyle = 0, ;
		ControlSource = "thisform.vstoc_finalv", ;
		Format = "r", ;
		Height = 21, ;
		InputMask = (get_mask(14,gnPa)), ;
		Left = 631, ;
		Name = "Text8", ;
		ReadOnly = .T., ;
		SpecialEffect = 2, ;
		TabIndex = 30, ;
		Top = 78, ;
		Visible = .T., ;
		Width = 132, ;
		ZOrderSet = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS tcFiltru
		LOCAL lcFiltru
		IF EMPTY(tcFiltru)
			lcFiltru = poStocuri.ca_baza1.cfiltru
		ELSE
			lcFiltru = tcFiltru
		ENDIF 
		
		save_grid_tag(This.grdStocuri)
		poStocuri.ca_baza1.cfiltru=lcFiltru
		poStocuri.ca_baza1.afisare()
		restore_grid_tag(This.grdStocuri)
		this.grdStocuri.refresh
		
		
	ENDPROC

	PROCEDURE butappend
	ENDPROC

	PROCEDURE calcul_sume
		Select crsStocuri
		
		With Thisform
			Calculate Sum(Round((pretv+tvav)*cants,gnPc)),Sum(Round((pretv+tvav)*cant,gnPc)),;
				Sum(Round((pretv+tvav)*cante,gnPc)), Sum(Round((pretv+tvav)*(cants+cant-cante),gnPc));
				TO .vstoc_precv,.vstoc_inv,.vstoc_outv, .vstoc_finalv
			.text5.refresh()
			.text6.refresh()
			.text7.refresh()
			.text8.refresh()			
		Endwith
		
	ENDPROC

	PROCEDURE do_cauta
		Lparameters tcFiltru, tlForceSerch
		
		Local lcFiltru
		If !Empty(tcFiltru)
			lcFiltru = [ and ] + tcFiltru
		Else
			lcFiltru = []
		Endif
		
		
		If Thisform.chk_fara_miscare.Value = 1
			ldDataFM = This.data_f_misc
			lcFiltru = lcFiltru + [ AND (a.datain is null OR a.datain <= to_date('] + Dtos(ldDataFM)  +;
				[','YYYYMMDD'))] +;
				[ AND (a.dataout is null OR a.dataout <= to_date('] + Dtos(ldDataFM) +;
				[','YYYYMMDD'))]
		Endif
		
		
		If !Empty(lcFiltru)
			lcFiltru = This.cfiltruinitial + lcFiltru
		Else
			lcFiltru = This.cfiltruinitial
		Endif
		
		&& filtru pretty
		IF LEN(THISFORM.filtru_pretty)>0
			filtrutext=THISFORM.filtru_pretty
			lcFiltru=lcFiltru+" and ("+ALLTRIM(filtrutext)+")"
		ENDIF
		
		IF (THIS.filtru_pretty#"none" OR tlForceSerch)
			THISFORM.actualizeaza_grid1(lcFiltru)
			THIS.calcul_sume()
			IF RECCOUNT('crsStocuri')=0
				aMessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			ENDIF
		ENDIF
		THISFORM.but_start_criterii1.SETFOCUS
		
		
		
	ENDPROC

	PROCEDURE do_excel
		*!*	export_excel(this.grdStocuri,[STOCURI])
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		lcAlias = This.grdStocuri.RecordSource
		
		If Reccount(lcAlias)>0
			lcFiltru = Filter(lcAlias)
			If Empty(lcFiltru)
				lcFiltru = '.T.'
			Endif
		
			lcColumnList = ''
			lcHeaderList = ''
			lcSelect = ''
			llSelect = .T.
			lcType = 'CURSOR'
			lcFrom = lcAlias
			lcWhere = lcFiltru
			lcOrder = 'codmat,denumire'
			lcOutput = 'crsStoc'
		
			If Used(lcOutput)
				Use In (lcOutput)
			Endif
		
			get_schema_grid(This.grdStocuri,@lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
			&lcSelect
		
			If Used(lcOutput)
				Do export_xls With lcOutput In oproceduri_comune.prg
				Use In (lcOutput)
			Endif
		Else
			amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_listare
		PRIVATE pcSubtitlu
		pcSubtitlu = THIS.filtru_pretty_ro_full
		
		x=xmenu("\<Listare selectie;Listare cumulata pe \<articole\<Borderou valoric;\<Fisa magazie")
		DO CASE
			CASE x = 1
				THIS.do_listare_selectie()
			CASE X = 2
				THIS.do_listare_articol()		
			CASE x = 3
				THIS.do_listare_borderou()
			CASE x = 4
				THIS.do_listare_fisa_magazie()		
		ENDCASE 		
		
	ENDPROC

	PROCEDURE do_listare_articol
		* cumulez cantitatile pe articole, fara pret
		If Reccount('crsStocuri')>0
			Private pcTitlu,pcDataora
			Store "" To pcTitlu,pcDataora
			Local lcOrder, lcOrderColumn, loColumnSort, lcFilter, lcFiltru
			lcOrder = ""
			lcOrderColumn = ""
		
			lcFilter = Filter('crsStocuri')
			lcFiltru = Iif(!Empty(m.lcFilter), 'where ' + m.lcFilter, '')
			lcFiltru = Strtran(m.lcFiltru, 'crsstocuri.','a.',1,10,1)
		
			loColumnSort = Thisform.gridextra1.currentcolumn
			lcColoanaOrdonare = []
			If Type('loColumnSort') == 'O'
				lcOrderColumn = [1] + Iif(Thisform.gridextra1.Ascending,[ DESC],[])
				lcColoanaOrdonare = Strtran(Upper(Alltrim(loColumnSort.ControlSource)),[CRSSTOCURI.],[a.]) + [ as colord1,]
			Endif
		
		
			If Empty(lcOrderColumn)
				lcOrder = "a.nume_gestiune,a.denumire,a.codmat"
			Else
				Do Case
					Case lcOrderColumn = 'CODMAT'
						lcOrder = "a.nume_gestiune,a.CODMAT,a.denumire"
					Case lcOrderColumn = 'DENUMIRE'
						lcOrder = "a.nume_gestiune,a.DENUMIRE,a.CODMAT"
					Otherwise
						lcOrder = "a.nume_gestiune," + lcOrderColumn
				Endcase
			Endif
		
			lcComanda = [Select nume_gestiune, serie, lot, um, codmat, denumire, SUM(cants) as cants, SUM(cant) as cant, SUM(cante) as cante, SUM(cants+cant-cante) as stoc ] + ;
				[ From crsStocuri a ] + m.lcFiltru + ;
				[ group by nume_gestiune, serie, lot, um, codmat, denumire ] + ;
				[ Order By ] + lcOrder + ;
				[ Into Cursor crs_rap]
			&lcComanda
		
			pcTitlu = [STOCURI - ARTICOLE]
			Thisform.AlwaysOnTop=.F.
			goExport.export2frx([crs_rap],[rap_stoc_art_cant],.T., , , , , .T.)
		
			Thisform.AlwaysOnTop=.T.
			IF AMESSAGEBOX('Doriti sa salvati in format xls?',4+32,_Screen.Caption) = 6
				goExport.export2xls("crs_rap", "stoc_articole.xls")
			ENDIF 
			Use In (SELECT('crs_rap'))
		Else
			amessage("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_listare_borderou
		Thisform.AlwaysOnTop=.F.
		DO rap_compar_stoc_bal
		Thisform.AlwaysOnTop=.T.
		*!*	If Reccount('crsStocuri')>0
		*!*		Select Nvl(Cont,'    ') As Cont,Nvl(acont,'    ') As acont,;
		*!*			pretv+tvav As pretvtva,cants,cant,cante From crsStocuri Into  Cursor crsStocuri_temp
		
		*!*		Select Distinct Cont,acont,;
		*!*			000000000000000000.0000 As Prec,000000000000000000.0000 As intrari,;
		*!*			000000000000000000.0000 As iesiri,000000000000000000.0000 As sold ;
		*!*			WHERE !Empty(Cont);
		*!*			FROM crsStocuri_temp Into Cursor crsConturi Readwrite Order By Cont,acont
		
		*!*		Select crsConturi
		*!*		Scan
		*!*			Scatter Name loCont
		*!*			Select crsStocuri_temp
		*!*			Calculate Sum(Round(cants*pretvtva,gnPC)), Sum(Round(cant*pretvtva,gnPC)),Sum(Round(cante*pretvtva,gnPC)) ;
		*!*				FOR Alltrim(Cont)=Alltrim(loCont.Cont) And Alltrim(acont)=Alltrim(loCont.acont) To ;
		*!*				loCont.Prec,loCont.intrari,loCont.iesiri;
		
		*!*			Select crsConturi
		*!*			Gather Name loCont
		*!*		Endscan
		
		*!*		Select crsConturi
		*!*		Replace All sold With Prec+intrari-iesiri
		
		*!*		lcTitlu = [Borderou de verificare valorica]
		*!*		pcTitlu = ceretitlu_rap([Titlul raportului],lcTitlu)
		*!*		pcDataora = get_Ora(2)
		
		*!*		Select crsConturi
		*!*		Thisform.AlwaysOnTop=.F.
		*!*		Select crsConturi
		*!*		KEYBOARD '{CTRL+F10}'
		*!*		Report Form rap_stoc_borderou-2525.frx To Printer Prompt Preview
		*!*		Thisform.AlwaysOnTop=.T.
		
		*!*		Use In crsConturi
		*!*		Use In crsStocuri_temp
		*!*	Else
		*!*		amessagebox("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		*!*	Endif
	ENDPROC

	PROCEDURE do_listare_fisa_magazie
		If Reccount("crsstocuri")>0
			Private PcCodul,pcdenumire,pcondper
			Store '' To pcondper
			Local ldata1,ldata2,lcd1,lcd2
			Thisform.AlwaysOnTop=.F.
		
			Select crsstocuri
			PcCodul=Val(Alltrim(Str(id_articol)))
			pcdenumire=Upper(Alltrim(denumire))
			pnIdGestiune = id_gestiune
			pcNumeGestiune = Alltrim(nume_gestiune)
			pcSerie = ALLTRIM(serie)
		
			Do fisa_magazie_fifo With thisform.ntipgest,pnIdGestiune,pcNumeGestiune,PcCodul,pcSerie
		
			Thisform.AlwaysOnTop=.T.
		Else
			amessagebox("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_listare_selectie
		If Reccount('crsStocuri')>0
			Private pcTitlu,pcDataora
			Store "" To pcTitlu,pcDataora
			Local lcOrder, lcOrderColumn, loColumnSort
			lcOrder = ""
			lcOrderColumn = ""
		
			loColumnSort = This.gridsort1.ocolumnreference
			lcOrderColumn = ""
			lcColoanaOrdonare = []
			If Type('loColumnSort') = 'O'
				*!*	modificare v 2.0.169
				*!*	lcOrderColumn = Upper(Alltrim(loColumnSort.ControlSource))
				lcOrderColumn = [1] + IIF(UPPER(ALLTRIM(loColumnSort.Tag))=[DOWN],[ DESC],[])
				lcColoanaOrdonare = STRTRAN(UPPER(ALLTRIM(loColumnSort.ControlSource)),[CRSSTOCURI.],[a.]) + [ as colord1,]
				*!*	modificare v 2.0.169	^
			Endif
		
			If Empty(lcOrderColumn)
				lcOrder = "a.nume_gestiune,a.denumire,a.codmat"
			Else
				Do Case
				Case lcOrderColumn = 'CODMAT'
					lcOrder = "a.nume_gestiune,a.CODMAT,a.denumire"
				Case lcOrderColumn = 'DENUMIRE'
					lcOrder = "a.nume_gestiune,a.DENUMIRE,a.CODMAT"
				Otherwise
					lcOrder = "a.nume_gestiune," + lcOrderColumn
				Endcase
			Endif
			*!*	modificare v 2.0.169
			*!*	Select * From crsStocuri Into Cursor crs_rap Order By &lcOrder
			lcComanda = [Select ] + lcColoanaOrdonare + [a.* From crsStocuri a Into Cursor crs_rap Order By ] + lcOrder
			&lcComanda
			*!*	modificare v 2.0.169 ^
		
			If Thisform.chk_fara_miscare.Value = 1
		*!*			lcTitlu = [STOCURI FARA MISCARE IN ULTIMELE ]+Thisform.nzile+[ ZILE]
				lcTitlu = [STOCURI FARA MISCARE]
			Else
				lcTitlu = [STOCURI - GESTIUNI]
			Endif
		
			pcTitlu = m.lcTitlu && ceretitlu_rap([Titlul raportului],lcTitlu)
			pcDataora = get_Ora(2)
		
			Thisform.AlwaysOnTop=.F.
			Select crs_rap
			*KEYBOARD '{CTRL+F10}'	
			*Report Format rap_stoc_pretv.frx To Printer Prompt Noconsole Preview
			goExport.export2frx([crs_rap],[rap_stoc_pretv],.T., , , , , .T.)
			Thisform.AlwaysOnTop=.T.
			Use In crs_rap
		Else
			amessagebox("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_reface
		*!*	17.12.2020
		*!*	marius.mutu
		*!*	am scos refacerea lunara - se pune 0 (accidental) pe stoc precedent daca daca nu stie ce face
		*!* probabil este nevoie de refacere lunara intr-o situatie de initializare
		
		If m.glLunaInchisa
			AMESSAGEBOX('Luna este inchisa! Nu se pot da refaceri!',0+64,_screen.Caption)
			Return
		Endif
		
		Local lcCont, x, lcSursa, lnLuna, lnAn, lcLunar
		lcCont = []
		lcSursa = [STOC]
		lnLuna = gnLuna
		lnAn = gnAn
		
		x= xmenu('Refacere cu \<precedente')
		Do Case
				*!*	Case x = 1
				*!*		lcLunar = [0]
			Case x = 1
				lcLunar = [1]
			Otherwise
				Return
		Endcase
		
		lnSucces = refacere(lcSursa,lcLunar,lcCont,lnLuna,lnAn) && IN orefaceri.prg
		If lnSucces > 0
			aMESSAGEBOX("Refacerea s-a terminat!",0+64,"Refacere stocuri")
			Thisform.actualizeaza_grid1()
		Endif
		
		* do inainte WITH "BALANTA_parteneri",lcCont in oinainte_de.prg
		
	ENDPROC

	PROCEDURE do_verifica
		Local contselect
		contselect= ''
		
		*!*	modificare 18.02.2008
		SELECT DISTINCT CONT FROM crsStocuri INTO CURSOR cConturiTemp
		IF _TALLY = 1
			contselect=ALLTRIM(cConturiTemp.CONT)
		ELSE
			contselect=''
		ENDIF
		USE IN (SELECT('cConturiTemp'))
		
		*!*	If Thisform.ck_filtru_cont.Value=1
		*!*		contselect=Thisform.ck_filtru_cont.filtru
		*!*		contselect=Strtran(contselect,'AND','')
		*!*		contselect=Strtran(contselect,'(','')
		*!*		contselect=Strtran(contselect,')','')
		*!*		contselect=Strtran(contselect,'A.CONT','')
		*!*		contselect=Strtran(contselect,"'",'')
		*!*		contselect=Strtran(contselect,'%','')
		*!*		contselect=Strtran(contselect,'LIKE','')
		*!*		contselect=Alltrim(contselect)
		*!*	Else
		*!*		contselect=''
		*!*	Endif
		*!*	modificare 18.02.2008	^
		
		Do verific_stoc_cu_balanta With contselect,2	&&	2	=	gestiuni la pret de vanzare
	ENDPROC

	PROCEDURE initializare
	ENDPROC

	PROCEDURE But_listare1.Click
		thisform.do_listare_borderou
	ENDPROC

	PROCEDURE But_listare3.Click
		If Reccount("crsstocuri")>0
			Private PcCodul,pcdenumire,pcondper
			Store '' To pcondper
			Local ldata1,ldata2,lcd1,lcd2
			Thisform.AlwaysOnTop=.F.
		
			Select crsstocuri
			PcCodul=Val(Alltrim(Str(id_articol)))
			pcdenumire=Upper(Alltrim(denumire))
			pnIdGestiune = id_gestiune
			pcNumeGestiune = Alltrim(nume_gestiune)
			pcSerie = ALLTRIM(serie)
		
			Do fisa_magazie_fifo With thisform.ntipgest,pnIdGestiune,pcNumeGestiune,PcCodul,pcSerie
		
			Thisform.AlwaysOnTop=.T.
		Else
			amessagebox("Nu exista inregistrari pentru listare!",0+48,"Atentie")
		Endif
		
	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 + ;
			"Serie articol\serie\T\none\" + crlf + ;
			"Subgrupa articol\subgrupa\T\id_subgrupa\nom_subgrupa_articol"+ crlf + ;
			"Gestiune\none\I\id_gestiune\nom_gestiune" + crlf + ;
			"Grupe gestiuni\|E|" + ;
				[a.id_gestiune in ( ] + ;
				[ select ID_GESTIUNE ] + ;
				[	from vgest_coresp_grupe_gestiuni c ] + ;
				[	join (select id_grupe ] + ;
				[       from gest_nom_grupe ] + ;
				[       where sters = 0 ] + ;
			    [       start with id_grupe = <<VALOARE>> ] + ;
				[      connect by prior id_grupe = parent_id) g on c.id_grupe = g.id_grupe )\I\none\nom_grupa_gestiune] + crlf + ;
			"Cont\cont\T\none\"+ crlf + ;
			"Cont analitic\acont\T\none\"+ crlf + ;
			"Data intrare\trunc(datain)\D\none\"+ crlf + ;
			"Data iesire\trunc(dataout)\D\none\"+ crlf + ;
			"Pret achizitie\pret\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret vanzare\pretv\N|get_mask(12,gnPpret)\none\"+ crlf + ;
			"Pret valuta\pretd\N|get_mask(12,gnPPretval)\none\" + crlf + ;
			"Valuta\nume_val\T\ID_VALUTA\nom_valuta" + crlf + ;
			"Furnizor principal\furn_princ\T\id_part\nom_parteneri" + crlf + ;
			"Furnizor\furnizor\T\id_furnizor\nom_parteneri" + crlf + ;		
			"Lucrare rezervare\nrord_rez\T\ID_LUCRARE_REZ\nom_lucrare" + crlf + ;	
			"Partener rezervare\part_rez\T\id_part_rez\nom_parteneri" + crlf + ;	
			"Stoc\cants+cant-cante\N|get_mask(12,gnPcant)\none\" + crlf + ;
			"Stoc negativ\nofiled\E\(cants+cant-cante<0)\" + crlf + ;
			"Cu rulaj\nofiled\E\(cant!=0 or cante!=0)\" + crlf + ;	
			"Fara rulaj\nofiled\E\(cant=0 and a.cante=0)\" + crlf + ;	
			"Cota TVA\proc_tvav\N|get_mask(12,2)\none\" + crlf + ;
			IIF(EMPTY(gcCondSucursala) and glEMama,"Sucursala\sucursala\C\none\",[])
		
		DODEFAULT()
		
	ENDPROC

	PROCEDURE Chk_fara_miscare.InteractiveChange
		IF THIS.VALUE = 1
			THISFORM.data_f_misc = DATE(YEAR(DATE()),1,1)
			ldDataFM = THISFORM.data_f_misc
			loFaraMiscare = CREATEOBJECT("frm_fara_miscare")
			loFaraMiscare.SHOW()
			THISFORM.data_f_misc = ldDataFM
			IF !PEMSTATUS(THIS,"cTraducere",5)
				THIS.ADDPROPERTY("cTraducere","")
			ENDIF
		
		
			THIS.cTraducere = "Data intrare/iesire <= " + DTOC(ldDataFM)
		ELSE
			THIS.cTraducere = ""
		ENDIF
		
		THISFORM.do_cauta()
		THISFORM.but_start_criterii1.refreshstatus()
		
	ENDPROC

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

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

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

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

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

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

	PROCEDURE grdStocuri.Cdatain.Text1.GotFocus
		
		Thisform.coldvalue=This.Value
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.Cdatain.Text1.InteractiveChange
		
		Thisform.cnewvalue=This.Value
	ENDPROC

	PROCEDURE grdStocuri.Cdataout.Text1.GotFocus
		Thisform.coldvalue=This.Value
		Thisform.cnewvalue=Thisform.coldvalue
	ENDPROC

	PROCEDURE grdStocuri.Cdataout.Text1.InteractiveChange
		Thisform.cnewvalue=This.Value
	ENDPROC

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

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

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

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

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

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

	PROCEDURE grdStocuri.Init
		*
	ENDPROC

ENDDEFINE
