*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="cheltuieli1.mnx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*<MenuType>4</MenuType>
*<MenuLocation>REPLACE</MenuLocation>

*<MenuCode>
DEFINE POPUP Cheltuieli SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR "71010" OF Cheltuieli PROMPT "Materii prime 601" ;
	MESSAGE '601 :301 '
ON SELECTION BAR 71010 OF Cheltuieli DO BAR_"71010"_OF_Cheltuieli_FB2P

DEFINE BAR "71020" OF Cheltuieli PROMPT "Materiale auxiliare 6021" ;
	MESSAGE '6021:3021'
ON SELECTION BAR 71020 OF Cheltuieli DO BAR_"71020"_OF_Cheltuieli_FB2P

DEFINE BAR "71030" OF Cheltuieli PROMPT "Combustibili 6022" ;
	MESSAGE '6022:3022'
ON SELECTION BAR 71030 OF Cheltuieli DO BAR_"71030"_OF_Cheltuieli_FB2P

DEFINE BAR "71040" OF Cheltuieli PROMPT "Materiale pt. ambalat 6023" ;
	MESSAGE '6023:3023'
ON SELECTION BAR 71040 OF Cheltuieli DO BAR_"71040"_OF_Cheltuieli_FB2P

DEFINE BAR "71050" OF Cheltuieli PROMPT "Piese de schimb 6024" ;
	MESSAGE '6024:3024'
ON SELECTION BAR 71050 OF Cheltuieli DO BAR_"71050"_OF_Cheltuieli_FB2P

DEFINE BAR "71090" OF Cheltuieli PROMPT "Alte materiale 6028" ;
	MESSAGE '6028:3028'
ON SELECTION BAR 71090 OF Cheltuieli DO BAR_"71090"_OF_Cheltuieli_FB2P

DEFINE BAR 7 OF Cheltuieli PROMPT "\-"
ON BAR 7 OF Cheltuieli ACTIVATE POPUP _1170vp6f7

	*----------------------------------
	DEFINE POPUP _1170vp6f7 SHORTCUT RELATIVE
DEFINE BAR 8 OF Cheltuieli PROMPT "Obiecte de inventar 603" ;
	MESSAGE '603 :303 '
ON SELECTION BAR 8 OF Cheltuieli DO BAR_8_OF_Cheltuieli_FB2P

DEFINE BAR 9 OF Cheltuieli PROMPT "\-"
ON BAR 9 OF Cheltuieli ACTIVATE POPUP _1170vp6f8

	*----------------------------------
	DEFINE POPUP _1170vp6f8 SHORTCUT RELATIVE
DEFINE BAR 10 OF Cheltuieli PROMPT "\<Marfuri"
ON SELECTION BAR 10 OF Cheltuieli DO BAR_10_OF_Cheltuieli_FB2P
ACTIVATE POPUP Cheltuieli

*</MenuCode>

*<Procedures>
PROCEDURE BAR_"71010"_OF_Cheltuieli_FB2P
	*!*	DO BONARE WITH '601  ','301  ','CHELTMAT'
	lans(10287)
ENDPROC && BAR_"71010"_OF_Cheltuieli_FB2P

PROCEDURE BAR_"71020"_OF_Cheltuieli_FB2P
	*DO BONARE WITH '6021 ','3021 ','CHELTMAT'
	lans(10288)
ENDPROC && BAR_"71020"_OF_Cheltuieli_FB2P

PROCEDURE BAR_"71030"_OF_Cheltuieli_FB2P
	lans(10289)
	*DO BONARE WITH '6022 ','3022 ','CHELTMAT'
ENDPROC && BAR_"71030"_OF_Cheltuieli_FB2P

PROCEDURE BAR_"71040"_OF_Cheltuieli_FB2P
	lans(10290)
	*DO BONARE WITH '6023 ','3023 ','CHELTMAT'
ENDPROC && BAR_"71040"_OF_Cheltuieli_FB2P

PROCEDURE BAR_"71050"_OF_Cheltuieli_FB2P
	lans(10291)
	*DO BONARE WITH '6024 ','3024 ','CHELTMAT'
ENDPROC && BAR_"71050"_OF_Cheltuieli_FB2P

PROCEDURE BAR_"71090"_OF_Cheltuieli_FB2P
	lans(10292)
	*DO BONARE WITH '6028 ','3028 ','CHELTMAT'
ENDPROC && BAR_"71090"_OF_Cheltuieli_FB2P

PROCEDURE BAR_8_OF_Cheltuieli_FB2P
	lans(10293)
	*!*	DO BONARE303 WITH '603 ','303 ','CHELTMAT'
	
	*!*	*____________________________________________________________
	*!*	PROCEDURE bonare303
	*!*	PARAMETERS m.SCD1,m.SCC1,CLASAACT
	*!*	*_______________DO CHELTMAT.SPR
	*!*	oc=createobj(CLASAACT)
	*!*	oc.show(1)
	*!*	*
	*!*	IF BUTON=2
	*!*		DO STERGE
	*!*		RETURN
	*!*	ENDIF
	*!*	DO CODARE
	*!*	m.NNIR=M.NRACT
	*!*	m.SCD=subs(M.SCC1,1,4)
	
	*!*	ob=createobj('BON')
	*!*	ob.show(1)
	*!*	*do form bon1
	*!*	*
	*!*	SELE STOC
	*!*	SET filter to
	*!*	m.SCD=M.SCD1
	*!*	IF BUTON=2
	*!*		DO STERGE
	*!*		RETURN
	*!*	ENDIF
	
	*!*	SELECT iesiri
	*!*	GO top
	*!*	m.scc1=scd
	*!*	DO CONTABILIZEAZA WITH m.SCD1,m.SCC1,M.TOTVALOARE,CLASAACT
	*!*	SELE LUCRARI
	*!*	*LOCATE FOR nume_2=M.nume
	*!*	IF !EMPTY(M.NRORD)
	*!*		LOCATE FOR NRORD=M.NRORD
	*!*		IF FOUND()
	*!*			IF flock()
	*!*				REPLACE LUCRARI.MATERIALE WITH LUCRARI.MATERIALE+M.TOTVALOARE
	*!*			ENDIF
	*!*			UNLOCK
	*!*		ELSE
	*!*			SELE LUCRARI
	*!*			IF flock()
	*!*				APPE BLAN
	*!*				GATH MEMV
	*!*			ENDIF
	*!*			UNLOCK
	*!*		ENDIF
	*!*	ENDIF
	
	*!*	SELE RESPONS
	*!*	*LOCATE FOR nume_2=M.nume_2
	*!*	LOCA FOR NUME_2=M.NRESP
	*!*	IF flock()
	*!*		REPLACE RESPONS.MATERIALE WITH RESPONS.MATERIALE+m.TOTVALOARE
	*!*	ENDIF
	*!*	UNLOCK
	*!*	SELE STOC
	*!*	m.SCD=subs(m.SCC1,1,4)
	*!*	DO IESTOCURIMAGAZII
	*!*	m.NNIR=M.NRACT
	*!*	DO IERULAJMAGAZII
	
	*!*	SET SAFETY OFF
	*!*	SELECT intrari
	*!*	ZAP
	
	*!*	SELECT iesiri
	*!*	SCAN
	*!*	SCATTER FIELDS denumire, codmat, cante,pret,gest memv
	*!*	SELECT intrari
	*!*	APPEND BLANK
	*!*	m.cant=m.cante
	*!*	GATHER FIELDS denumire, codmat, pret,gest,cant memv
	*!*	SELECT iesiri
	*!*	endscan
	
	*!*	SELECT intrari
	*!*	REPLACE ALL scd WITH '8039'
	
	*!*	DO inrulajmagazii
	*!*	DO instocurimagazii
	
	
	
	*!*	DO STERGE
	*!*	RETURN
	*!*	*********************************
ENDPROC && BAR_8_OF_Cheltuieli_FB2P

PROCEDURE BAR_10_OF_Cheltuieli_FB2P
	LOCAL lnRaspuns
	lnRaspuns = 6
	
	DO WHILE lnRaspuns = 6
		 lans(10581)
		if buton = 2
			return
		ENDIF
		DO introducere_compacta WITH 'achi_mat','','',.F.,.F.,'Cheltuieli cu marfa','',10581
		IF buton=1
			lnRaspuns = AMESSAGEBOX('Doriti sa continuati cu operatii de acest fel?',4+32)
		ELSE
			lnRaspuns = 7	
		ENDIF 
	ENDDO 
ENDPROC && BAR_10_OF_Cheltuieli_FB2P

*</Procedures>
