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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_grdrow1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.Column9.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nidgestiune
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 482
		Name = "frm_atenterori"
		nidgestiune = 0
		Width = 797
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 876
		_shape2.Left = 744
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "Atentionari / Erori"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 764
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_grdrow1' AS _grdrow WITH ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 276, ;
		Left = 12, ;
		Name = "_grdrow1", ;
		Panel = 1, ;
		RecordSource = "crsAtentionari ", ;
		Top = 48, ;
		Width = 768, ;
		Column1.ControlSource = "mesaj", ;
		Column1.Name = "Column1", ;
		Column1.Width = 539, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "iif(afara,'Eroare','Atentionare')", ;
		Column2.Name = "Column2", ;
		Column3.ColumnOrder = 2, ;
		Column3.ControlSource = "nrord", ;
		Column3.Name = "Column3", ;
		Column3.Width = 120
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_grdrow1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Mesaj", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow1.Column2.Header1' AS header WITH ;
		Caption = "", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow1.Column3.Header1' AS header WITH ;
		Caption = "Lucrare", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2' AS _grdrow WITH ;
		ColumnCount = 8, ;
		DeleteMark = .F., ;
		Height = 136, ;
		Left = 12, ;
		Name = "_grdrow2", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordSource = "v_stoc", ;
		Top = 336, ;
		Width = 768, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "denumire", ;
		Column1.Name = "Column2", ;
		Column1.ReadOnly = .F., ;
		Column1.Width = 191, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "codmat", ;
		Column2.Name = "Column3", ;
		Column2.ReadOnly = .F., ;
		Column2.Width = 132, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "stoc", ;
		Column3.Name = "Column4", ;
		Column3.ReadOnly = .F., ;
		Column3.Width = 98, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "pret", ;
		Column4.Name = "Column5", ;
		Column4.ReadOnly = .F., ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = "nume_gestiune", ;
		Column5.Name = "Column6", ;
		Column5.ReadOnly = .F., ;
		Column5.Width = 141, ;
		Column6.ColumnOrder = 7, ;
		Column6.ControlSource = "cgest", ;
		Column6.Name = "Column7", ;
		Column6.ReadOnly = .F., ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "id_articol", ;
		Column7.Name = "Column8", ;
		Column7.ReadOnly = .F., ;
		Column8.ColumnOrder = 1, ;
		Column8.ControlSource = "ales", ;
		Column8.CurrentControl = "Check1", ;
		Column8.Name = "Column9", ;
		Column8.ReadOnly = .F., ;
		Column8.Sparse = .F., ;
		Column8.Width = 48
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_grdrow2.Column2.Header1' AS header WITH ;
		Caption = "Denumire", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column3.Header1' AS header WITH ;
		Caption = "Codmat", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column4.Header1' AS header WITH ;
		Caption = "Stoc", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column5.Header1' AS header WITH ;
		Caption = "Pret", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column6.Header1' AS header WITH ;
		Caption = "Gestiune", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column7.Header1' AS header WITH ;
		Caption = "Cgest", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column8.Header1' AS header WITH ;
		Caption = "Id articol", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdrow2.Column9.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		ControlSource = "ales", ;
		Height = 17, ;
		Left = 11, ;
		Name = "Check1", ;
		Top = 47, ;
		Value = 0, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_grdrow2.Column9.Header1' AS header WITH ;
		Caption = "Ales", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 729, ;
		Name = "But_renunt1", ;
		Top = 1
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
	
	PROCEDURE Activate
		DODEFAULT()
		this._grdrow1.AfterRowColChange
		
	ENDPROC

	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru,lnid_coloana
		
		SELECT v_stoc
		
		
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poStoc.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._grdrow2)
		poStoc.ca_baza1.cfiltru=lcFiltru
		poStoc.ca_baza1.afisare()
		
		
		restore_grid_tag(thisform._grdrow2)
		*!*	IF RECCOUNT('v_mecanici')>0
		IF crsAtentionari.rezolvat
			SELECT v_stoc
			REPLACE ales WITH 1 FOR ALLTRIM(codmat) = ALLTRIM(crsAtentionari.codmat) AND pret = crsAtentionari.pret
		ENDIF 
		this._grdrow2.AutoFit 
		*!*	this._grdrow2.ReadOnly = .f.
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		SELECT crsAtentionari
			LOCATE FOR afara = .f. AND rezolvat = .f.
			IF FOUND()
				aMESSAGEBOX('Rezolvati atentionarile!',0+16,_screen.Caption )
			RETURN .f.
		ENDIF 
	ENDPROC

	PROCEDURE _grdrow1.AfterRowColChange
		LPARAMETERS nColIndex
		*!*	save_grid_tag(thisform._grdrow2)
		
		*!*	lcSql = [select a.cants+a.cant-a.cante as stoc,a.*  from vstoc a where a.an = ?gnAn and a.luna = ?gnluna and a.codmat = ']+ALLTRIM(crsAtentionari.codmat)+[' ]
		*!*			lcCursor = [v_stoc]
		
		*!*			lnSucces = goExecutor.oExecute(lcSql,lcCursor)
		*!*			goExecutor.oReset()
		*!*			IF lnSucces < 0
		*!*				aMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
		*!*				RETURN
		*!*			ENDIF
		*!*			thisform._grdrow2.RecordSource = 'v_stoc'
		*!*	restore_grid_tag(thisform._grdrow2)
		*!*	thisform._grdrow2.AutoFit 
		IF afara = .f.
		
			lcFiltru = [ a.an = ?gnAn and a.luna = ?gnluna and a.codmat = ']+ALLTRIM(crsAtentionari.codmat)+[' and a.id_gestiune = ]+ALLTRIM(STR(thisform.nidgestiune ))
		ELSE 
			lcFiltru = [ 1=2 ]
		ENDIF 
		Thisform.actualizeaza_grid1(lcFiltru)
		
		
	ENDPROC

	PROCEDURE _grdrow2.Column9.Check1.Click
		LOCAL lnid_Articol  
		lnid_Articol  = v_stoc.id_articol
		lnPret = v_stoc.pret
		IF this.Value = 1
			SELECT v_stoc
			REPLACE ALL ales WITH 0 FOR !(id_articol = lnid_Articol  AND pret = lnPret)
			LOCATE FOR id_articol = lnid_Articol   AND pret = lnPret
			SELECT crsBonTOT
			REPLACE ALL id_articol WITH lnid_Articol,pret WITH lnPret FOR ALLTRIM(codmat) = ALLTRIM(v_stoc.codmat) AND id_lucrare = crsAtentionari.id_lucrare AND time = crsAtentionari.time
			SELECT crsAtentionari
			REPLACE rezolvat WITH .t.,pret WITH lnPret 
			ELSE 
			SELECT v_stoc
		ENDIF 
	ENDPROC

ENDDEFINE

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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_grdbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1.Column3.Text1" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Height = 262
		Name = "frm_lucrari_sume"
		Width = 624
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 636
		_shape2.Left = 552
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		Lb_titlu_alb_b121.Caption = "."
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 594
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Left = 565
		But_renunt1.Name = "But_renunt1"
		But_renunt1.Top = 1
	*</PropValue>

	ADD OBJECT '_grdbase1' AS _grdbase WITH ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 200, ;
		Left = 12, ;
		Name = "_grdbase1", ;
		Panel = 1, ;
		ReadOnly = .F., ;
		RecordSource = "crsIesiritot", ;
		Top = 48, ;
		Width = 600, ;
		Column1.ControlSource = "nrord", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .F., ;
		Column1.Width = 393, ;
		Column2.ControlSource = "suma_imp", ;
		Column2.InputMask = (get_mask(12,gnPc)), ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .F., ;
		Column3.ControlSource = "suma", ;
		Column3.InputMask = (get_mask(12,gnPc)), ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .F., ;
		Column3.Width = 97
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_grdbase1.Column1.Header1' AS header WITH ;
		Caption = "Lucrare", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdbase1.Column2.Header1' AS header WITH ;
		Caption = "Suma import", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT '_grdbase1.Column3.Header1' AS header WITH ;
		Caption = "Suma modificata", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

ENDDEFINE
