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

*<MenuCode>
DEFINE POPUP Shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF Shortcut PROMPT "\<Vanzare en_detail"
ON SELECTION BAR 1 OF Shortcut DO BAR_1_OF_Shortcut_FB2P

DEFINE BAR 2 OF Shortcut PROMPT "\<Retur vanzare en-detail"
ON SELECTION BAR 2 OF Shortcut DO BAR_2_OF_Shortcut_FB2P

DEFINE BAR 3 OF Shortcut PROMPT "\<Pe lucrari in curs de executie"
ON SELECTION BAR 3 OF Shortcut DO BAR_3_OF_Shortcut_FB2P

DEFINE BAR 4 OF Shortcut PROMPT "\-"
ON BAR 4 OF Shortcut ACTIVATE POPUP _2fu0nwiv5

	*----------------------------------
	DEFINE POPUP _2fu0nwiv5 SHORTCUT RELATIVE
DEFINE BAR 5 OF Shortcut PROMPT "\<Factura retur marfa (valorica)"
ON SELECTION BAR 5 OF Shortcut DO BAR_5_OF_Shortcut_FB2P

DEFINE BAR 6 OF Shortcut PROMPT "\<Aviz retur marfa (valoric)"
ON SELECTION BAR 6 OF Shortcut DO BAR_6_OF_Shortcut_FB2P

DEFINE BAR 7 OF Shortcut PROMPT "\-"
ON BAR 7 OF Shortcut ACTIVATE POPUP _0zz0xwwtn

	*----------------------------------
	DEFINE POPUP _0zz0xwwtn SHORTCUT RELATIVE
DEFINE BAR 8 OF Shortcut PROMPT "\<Descarcare de gestiune"
ON BAR 8 OF Shortcut ACTIVATE POPUP Descarcare

	*----------------------------------
	DEFINE POPUP Descarcare SHORTCUT RELATIVE
	DEFINE BAR 1 OF Descarcare PROMPT "Metoda cu \<K - utilizand balante de parteneri"
	ON SELECTION BAR 1 OF Descarcare DO BAR_1_OF_Descarcare_FB2P

	DEFINE BAR 2 OF Descarcare PROMPT "Metoda cu K pentru marfa in \<custodie"
	ON SELECTION BAR 2 OF Descarcare DO BAR_2_OF_Descarcare_FB2P

	DEFINE BAR 3 OF Descarcare PROMPT "\Descarcare cantitativa (fara monetar)"
	ON SELECTION BAR 3 OF Descarcare DO BAR_3_OF_Descarcare_FB2P

	DEFINE BAR 4 OF Descarcare PROMPT "\<Descarcare marfa la pret de lista cu monetar"
	ON SELECTION BAR 4 OF Descarcare DO BAR_4_OF_Descarcare_FB2P

DEFINE BAR 9 OF Shortcut PROMPT "\<Monetar"
ON BAR 9 OF Shortcut ACTIVATE POPUP Monetar

	*----------------------------------
	DEFINE POPUP Monetar SHORTCUT RELATIVE
	DEFINE BAR 1 OF Monetar PROMPT "\Cu descarcare cantitativa de gestiune"
	ON SELECTION BAR 1 OF Monetar DO BAR_1_OF_Monetar_FB2P

	DEFINE BAR 2 OF Monetar PROMPT "\Cu descarcare valorica de gestiune"
	ON SELECTION BAR 2 OF Monetar DO BAR_2_OF_Monetar_FB2P

	DEFINE BAR 3 OF Monetar PROMPT "\<Fara descarcare de gestiune"
	ON SELECTION BAR 3 OF Monetar DO BAR_3_OF_Monetar_FB2P

DEFINE BAR 10 OF Shortcut PROMPT "\-"
ON BAR 10 OF Shortcut ACTIVATE POPUP _2e20ld90d

	*----------------------------------
	DEFINE POPUP _2e20ld90d SHORTCUT RELATIVE
DEFINE BAR 11 OF Shortcut PROMPT "\<Protocol cu TVA" ;
	MESSAGE 'x=401;623=401;635=4427'
ON SELECTION BAR 11 OF Shortcut DO BAR_11_OF_Shortcut_FB2P

DEFINE BAR 12 OF Shortcut PROMPT "Protocol" ;
	MESSAGE 'x=401;623=401;378=x; 4428=x '
ON SELECTION BAR 12 OF Shortcut DO BAR_12_OF_Shortcut_FB2P
ACTIVATE POPUP Shortcut

*</MenuCode>

*<Procedures>
PROCEDURE BAR_1_OF_Shortcut_FB2P
	initializeaza_vanzare_din_stoc(64)
	
ENDPROC && BAR_1_OF_Shortcut_FB2P

PROCEDURE BAR_2_OF_Shortcut_FB2P
	initializeaza_vanzare_din_stoc(65)
ENDPROC && BAR_2_OF_Shortcut_FB2P

PROCEDURE BAR_3_OF_Shortcut_FB2P
	lans(93)
ENDPROC && BAR_3_OF_Shortcut_FB2P

PROCEDURE BAR_5_OF_Shortcut_FB2P
	initializeaza_vanzare_din_stoc(239)
ENDPROC && BAR_5_OF_Shortcut_FB2P

PROCEDURE BAR_6_OF_Shortcut_FB2P
	initializeaza_vanzare_din_stoc(238)
ENDPROC && BAR_6_OF_Shortcut_FB2P

PROCEDURE BAR_1_OF_Descarcare_FB2P
	DO inchidere_k IN inchidere_k.prg
	
	*!*	LOCAL A411,A371,A378,S371,S378,K,V,B
	*!*	STORE 0 TO S371,S378,K,V,B
	
	*!*	DO REF_GESTIUNI
	
	*!*	m.SCD=''
	*!*	m.SCC=''
	
	*!*	semafor=.t.
	*!*	lans(66)
	
	*!*	semafor=.f.
	
	*!*	IF buton=2
	*!*		DO STERGE
	*!*		RETURN
	*!*	ENDIF
	
	*!*	SELECT NUMEGEST
	*!*	SET FILTER TO 
	*!*	M.GEST=GEST
	*!*	LOCAL ULIT
	*!*	ulit=SUBSTR(contg,4,1)
	*!*	A411='411'+ULIT
	*!*	A371='371'+ULIT
	*!*	A378='378'+ULIT
	
	*!*	SELECT GESTIUNI
	*!*	SEEK M.GEST
	*!*	IF !FOUND()
	*!*	DO MESAJ WITH 'Eroare: generare gestiuni!',''
	*!*	RETURN
	*!*	ENDIF
	*!*	M.SUMA=CRED
	*!*	k=procent_k
	*!*	IF k=0
	*!*	DO mesaj WITH 'Modificati procentul k','in gestiuni'
	*!*	RETURN
	*!*	ENDIF
	
	
	
	*!*	DO CODARE
	*!*	m.totftvam=ROUND(M.SUMA/1.19,0)
	*!*	m.tvam=M.SUMA-M.totftvam
	*!*	m.TOTCTVA=M.SUMA
	*!*	m.NEIMPOZAB=0
	*!*	m.PERECHE=0
	
	*!*		V=M.TOTCTVA
	*!*		LOCAL A,B,c,d,E,F,G,H
	*!*	A=ROUND(V*K,0)
	*!*	B=V-A-M.TVAM
	
	*!*		DO MESAJ WITH 'Coeficientul K= '+ALLT(STR(K,10,6)),''
	*!*	DO CONTABILIZEAZA WITH '607 ',A371,B,clasaact
	*!*	DO CONTABILIZEAZA WITH A378,A371,A,clasaact
	*!*	DO CONTABILIZEAZA WITH '4428',A371,M.tvam,clasaact
	
	*!*	DO STERGE
	
ENDPROC && BAR_1_OF_Descarcare_FB2P

PROCEDURE BAR_2_OF_Descarcare_FB2P
	DO inchidere_k_custodie IN inchidere_k.prg
ENDPROC && BAR_2_OF_Descarcare_FB2P

PROCEDURE BAR_3_OF_Descarcare_FB2P
	lans(84)
ENDPROC && BAR_3_OF_Descarcare_FB2P

PROCEDURE BAR_4_OF_Descarcare_FB2P
	lans(95)
ENDPROC && BAR_4_OF_Descarcare_FB2P

PROCEDURE BAR_1_OF_Monetar_FB2P
	
	LANS(69)
	
ENDPROC && BAR_1_OF_Monetar_FB2P

PROCEDURE BAR_2_OF_Monetar_FB2P
	
	*!*	LOCAL A411,A371,A378,S371,S378,K,V,B
	*!*	STORE 0 TO S371,S378,K,V,B
	
	*!*	lans(68)
	*!*	iF buton=2
	*!*		DO STERGE
	*!*		RETURN
	*!*	ENDIF
	
	*!*	SELECT NUMEGEST
	*!*	SET FILTER TO 
	*!*	M.GEST=GEST
	*!*	LOCAL ULIT
	*!*	ULIT=SUBSTR(CONTG,4,1)
	*!*	A411='411'+ULIT
	*!*	A371='371'+ULIT
	*!*	A378='378'+ULIT
	
	*!*	SELECT GESTIUNI
	*!*	SEEK M.GEST
	*!*	IF !FOUND()
	*!*	DO MESAJ WITH 'Eroare: generare gestiuni!',''
	*!*	RETURN
	*!*	ENDIF
	*!*	k=procent_k
	*!*	IF k=0
	*!*	DO mesaj WITH 'Modificati procentul k','in gestiuni'
	*!*	RETURN
	*!*	ENDIF
	
	
	
	*!*	DO CODARE
	
	*!*	*m.totftvam=ROUND(M.SUMA/1.19,0)
	*!*	m.totftvam=m.totftva
	*!*	*m.tvam=M.SUMA-M.totftvam
	*!*	m.tvam=m.tottva
	*!*	*m.TOTCTVA=M.SUMA
	*!*	m.NEIMPOZAB=0
	*!*	DO CONTABILIZEAZA WITH A411,'707 ',M.TOTFTVAM,CLASAACT
	*!*	DO CONTABILIZEAZA WITH A411,'4427',M.TVAM,CLASAACT
	*!*	M.PERECHE=M.NRACT
	*!*	DO CONTABILIZEAZA WITH '5311',A411,M.TOTCTVA,CLASAACT
	*!*	m.PERECHE=0
	
	*!*		V=M.TOTCTVA
	*!*		LOCAL A,B,c,d,E,F,G,H
	*!*	A=ROUND(V*K,0)
	*!*	B=V-A-M.TVAM
	
	
	*!*		DO MESAJ WITH 'Coeficientul K= '+ALLT(STR(K,10,6)),''
	*!*	DO CONTABILIZEAZA WITH '607 ',A371,B,clasaact
	*!*	DO CONTABILIZEAZA WITH A378,A371,A,clasaact
	*!*	DO CONTABILIZEAZA WITH '4428',A371,M.tvam,clasaact
	
	*!*	M.SUMA=M.TOTCTVA
	*!*	*** in casa e prost face gath memv si nu are m.scd si m.scc
	*!*	m.scd='5311'
	*!*	m.scc=A411
	*!*	do inCASA
	*!*	DO ADVANZ
	
	*!*	SELE CLIENTI
	*!*	if flock()
	*!*	REPLACE CLIENTI.incasat WITH CLIENTI.incasat+m.TOTCTVA
	*!*	REPLACE CLIENTI.PRODUCTIE WITH CLIENTI.PRODUCTIE++m.TOTCTVA
	*!*	endif
	*!*	unlock
	
	*!*	DO STERGE
	
	
ENDPROC && BAR_2_OF_Monetar_FB2P

PROCEDURE BAR_3_OF_Monetar_FB2P
	lans(67)
ENDPROC && BAR_3_OF_Monetar_FB2P

PROCEDURE BAR_11_OF_Shortcut_FB2P
	*!*	lans(233)
	initializeaza_vanzare_din_stoc(233)
ENDPROC && BAR_11_OF_Shortcut_FB2P

PROCEDURE BAR_12_OF_Shortcut_FB2P
	*lans(232)
	initializeaza_vanzare_din_stoc(270)
ENDPROC && BAR_12_OF_Shortcut_FB2P

*</Procedures>
