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

*<MenuCode>
DEFINE MENU _msysmenu BAR
DEFINE PAD _000000001 OF _msysmenu PROMPT "\<Utile" COLOR SCHEME 3 ;
	NEGOTIATE LEFT, NONE ;
	KEY ALT+U, "ALT+U" ;
	MESSAGE 'Instrumente utile: calculator, calendar, bloc-notes; iesirea din program.'

ON PAD _000000001 OF _msysmenu ACTIVATE POPUP Utile

	*----------------------------------
	DEFINE POPUP Utile MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF Utile PROMPT "\<Calculator" ;
		MESSAGE 'Deschide un calculator.'
	ON SELECTION BAR 1 OF Utile DO BAR_1_OF_Utile_FB2P

	DEFINE BAR 2 OF Utile PROMPT "C\<alendar" ;
		MESSAGE 'Deschide un calendar.'
	ON SELECTION BAR 2 OF Utile DO BAR_2_OF_Utile_FB2P

	DEFINE BAR 3 OF Utile PROMPT "\<Notepad" ;
		MESSAGE 'Deschide un carnetel.'
	ON SELECTION BAR 3 OF Utile DO BAR_3_OF_Utile_FB2P

	DEFINE BAR 4 OF Utile PROMPT "\-"
	ON BAR 4 OF Utile ACTIVATE POPUP _s9r16veuj

		*----------------------------------
		DEFINE POPUP _s9r16veuj MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 5 OF Utile PROMPT "\<Reindexare"
	ON BAR 5 OF Utile ACTIVATE POPUP Reindexare

		*----------------------------------
		DEFINE POPUP Reindexare MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF Reindexare PROMPT "\<Fisiere locale si temporare"
		ON SELECTION BAR 1 OF Reindexare DO BAR_1_OF_Reindexare_FB2P

	DEFINE BAR 6 OF Utile PROMPT "\-"
	ON BAR 6 OF Utile ACTIVATE POPUP _0jl0xqwge

		*----------------------------------
		DEFINE POPUP _0jl0xqwge MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 7 OF Utile PROMPT "\<Iesire" ;
		KEY F2, "F2" ;
		MESSAGE 'Iesire din program.'
	ON SELECTION BAR 7 OF Utile DO BAR_7_OF_Utile_FB2P

DEFINE PAD _000000002 OF _msysmenu PROMPT "\<Editare" COLOR SCHEME 3 ;
	KEY ALT+E, "" ;
	MESSAGE 'Comenzi de editare.'

ON PAD _000000002 OF _msysmenu ACTIVATE POPUP Editare

	*----------------------------------
	DEFINE POPUP Editare MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR _med_undo OF Editare PROMPT "\<Anuleaza" ;
		KEY CTRL+Z, "Ctrl+Z" ;
		MESSAGE 'Anuleaza ultima comanda de editare.'

	DEFINE BAR _med_redo OF Editare PROMPT "\<Refa" ;
		KEY CTRL+R, "Ctrl+R" ;
		MESSAGE 'Repeta ultima comanda anulata.'

	DEFINE BAR _med_sp100 OF Editare PROMPT "\-"

	DEFINE BAR _med_cut OF Editare PROMPT "\<Taie si retine" ;
		KEY CTRL+X, "Ctrl+X" ;
		MESSAGE 'Copiaza in memorie textul selectat si apoi il sterge din ecran.'

	DEFINE BAR _med_copy OF Editare PROMPT "\<Copiaza" ;
		KEY CTRL+C, "Ctrl+C" ;
		MESSAGE 'Copiaza in memorie textul  selectat.'

	DEFINE BAR _med_paste OF Editare PROMPT "Re\<da" ;
		KEY CTRL+V, "Ctrl+V" ;
		MESSAGE 'Reda din memorie textul retinut cu comanda <Copiaza>.'

DEFINE PAD _000000003 OF _msysmenu PROMPT "I\<nitializare" COLOR SCHEME 3 ;
	SKIP FOR m.nivel>3

ON PAD _000000003 OF _msysmenu ACTIVATE POPUP Initializa

	*----------------------------------
	DEFINE POPUP Initializa MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF Initializa PROMPT "\<Intrare..."
	ON SELECTION BAR 1 OF Initializa DO BAR_1_OF_Initializa_FB2P

	DEFINE BAR 2 OF Initializa PROMPT "\-"
	ON BAR 2 OF Initializa ACTIVATE POPUP _0b30q4fat

		*----------------------------------
		DEFINE POPUP _0b30q4fat MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 3 OF Initializa PROMPT "Generare \<Gestiuni"
	ON SELECTION BAR 3 OF Initializa DO BAR_3_OF_Initializa_FB2P

	DEFINE BAR 4 OF Initializa PROMPT "\<Cursul valutar" ;
		SKIP FOR m.nivel>2
	ON SELECTION BAR 4 OF Initializa DO BAR_4_OF_Initializa_FB2P

	DEFINE BAR 5 OF Initializa PROMPT "\<Adaos comercial" ;
		SKIP FOR m.nivel>2
	ON SELECTION BAR 5 OF Initializa DO BAR_5_OF_Initializa_FB2P

DEFINE PAD _000000004 OF _msysmenu PROMPT "\<Introducere" COLOR SCHEME 3 ;
	SKIP FOR m.nivel>3

ON PAD _000000004 OF _msysmenu ACTIVATE POPUP _0bb0p33cb

	*----------------------------------
	DEFINE POPUP _0bb0p33cb MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF _0bb0p33cb PROMPT "\<NIR-uri"
	ON BAR 1 OF _0bb0p33cb ACTIVATE POPUP NIRuri

		*----------------------------------
		DEFINE POPUP NIRuri MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF NIRuri PROMPT "\<Fara discount"
		ON SELECTION BAR 1 OF NIRuri DO BAR_1_OF_NIRuri_FB2P

		DEFINE BAR 2 OF NIRuri PROMPT "\<Cu discount final"
		ON SELECTION BAR 2 OF NIRuri DO BAR_2_OF_NIRuri_FB2P

		DEFINE BAR 3 OF NIRuri PROMPT "Cu discount \<distribuit" ;
			SKIP FOR !CU_DISC_DISTRIB
		ON SELECTION BAR 3 OF NIRuri DO BAR_3_OF_NIRuri_FB2P

	DEFINE BAR 2 OF _0bb0p33cb PROMPT "\NIR-uri \<magazin"
	ON SELECTION BAR 2 OF _0bb0p33cb DO BAR_2_OF__0bb0p33cb_FB2P

	DEFINE BAR 3 OF _0bb0p33cb PROMPT "\-"
	ON BAR 3 OF _0bb0p33cb ACTIVATE POPUP _0bb0p3xx2

		*----------------------------------
		DEFINE POPUP _0bb0p3xx2 MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 4 OF _0bb0p33cb PROMPT "\<Import"
	ON BAR 4 OF _0bb0p33cb ACTIVATE POPUP Import

		*----------------------------------
		DEFINE POPUP Import MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF Import PROMPT "\<Marfa"
		ON SELECTION BAR 1 OF Import DO BAR_1_OF_Import_FB2P

		DEFINE BAR 2 OF Import PROMPT "M\<ateriale"
		ON SELECTION BAR 2 OF Import DO BAR_2_OF_Import_FB2P

	DEFINE BAR 5 OF _0bb0p33cb PROMPT "\-"
	ON BAR 5 OF _0bb0p33cb ACTIVATE POPUP _0ld0l3yie

		*----------------------------------
		DEFINE POPUP _0ld0l3yie MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 6 OF _0bb0p33cb PROMPT "\<Productie"
	ON BAR 6 OF _0bb0p33cb ACTIVATE POPUP Productie

		*----------------------------------
		DEFINE POPUP Productie MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF Productie PROMPT "\<Produse finite 345"
		ON SELECTION BAR 1 OF Productie DO BAR_1_OF_Productie_FB2P

		DEFINE BAR 2 OF Productie PROMPT "\<Semifabricate 347"
		ON SELECTION BAR 2 OF Productie DO BAR_2_OF_Productie_FB2P

	DEFINE BAR 7 OF _0bb0p33cb PROMPT "\-"
	ON BAR 7 OF _0bb0p33cb ACTIVATE POPUP _0ld0l6l2q

		*----------------------------------
		DEFINE POPUP _0ld0l6l2q MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 8 OF _0bb0p33cb PROMPT "\<Bonuri de regie"
	ON SELECTION BAR 8 OF _0bb0p33cb DO BAR_8_OF__0bb0p33cb_FB2P

	DEFINE BAR 9 OF _0bb0p33cb PROMPT "Bonuri \<marfa"
	ON SELECTION BAR 9 OF _0bb0p33cb DO BAR_9_OF__0bb0p33cb_FB2P

	DEFINE BAR 10 OF _0bb0p33cb PROMPT "\-"
	ON BAR 10 OF _0bb0p33cb ACTIVATE POPUP _0v00uw1vm

		*----------------------------------
		DEFINE POPUP _0v00uw1vm MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 11 OF _0bb0p33cb PROMPT "\<Scadere din gestiune (pierderi, lipsa inventar,...)"
	ON SELECTION BAR 11 OF _0bb0p33cb DO BAR_11_OF__0bb0p33cb_FB2P

	DEFINE BAR 12 OF _0bb0p33cb PROMPT "\-"
	ON BAR 12 OF _0bb0p33cb ACTIVATE POPUP _0bv0mcc22

		*----------------------------------
		DEFINE POPUP _0bv0mcc22 MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 13 OF _0bb0p33cb PROMPT "\<Transferuri"
	ON BAR 13 OF _0bb0p33cb ACTIVATE POPUP Transferur

		*----------------------------------
		DEFINE POPUP Transferur MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF Transferur PROMPT "\<Intre gestiuni"
		ON SELECTION BAR 1 OF Transferur DO BAR_1_OF_Transferur_FB2P

		DEFINE BAR 2 OF Transferur PROMPT "\<Gestiune -> Magazin"
		ON SELECTION BAR 2 OF Transferur DO BAR_2_OF_Transferur_FB2P

		DEFINE BAR 3 OF Transferur PROMPT "\<Magazin -> Gestiune"
		ON SELECTION BAR 3 OF Transferur DO BAR_3_OF_Transferur_FB2P

		DEFINE BAR 4 OF Transferur PROMPT "\-"
		ON SELECTION BAR 4 OF Transferur

		DEFINE BAR 5 OF Transferur PROMPT "\<Retur magazie"
		ON SELECTION BAR 5 OF Transferur DO BAR_5_OF_Transferur_FB2P

		DEFINE BAR 6 OF Transferur PROMPT "R\<etur de la comanda facturata"
		ON SELECTION BAR 6 OF Transferur DO BAR_6_OF_Transferur_FB2P

	DEFINE BAR 14 OF _0bb0p33cb PROMPT "\-"
	ON BAR 14 OF _0bb0p33cb ACTIVATE POPUP _0bv0mk4sm

		*----------------------------------
		DEFINE POPUP _0bv0mk4sm MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 15 OF _0bb0p33cb PROMPT "\<Vanzare marfa en-gros"
	ON SELECTION BAR 15 OF _0bb0p33cb DO BAR_15_OF__0bb0p33cb_FB2P

	DEFINE BAR 16 OF _0bb0p33cb PROMPT "Vanzare marfa din \<stoc (3711)"
	ON SELECTION BAR 16 OF _0bb0p33cb DO BAR_16_OF__0bb0p33cb_FB2P

	DEFINE BAR 17 OF _0bb0p33cb PROMPT "\<Factura de retur vanzare en-gros"
	ON SELECTION BAR 17 OF _0bb0p33cb DO BAR_17_OF__0bb0p33cb_FB2P

	DEFINE BAR 18 OF _0bb0p33cb PROMPT "\-"
	ON BAR 18 OF _0bb0p33cb ACTIVATE POPUP _0rg0nv95w

		*----------------------------------
		DEFINE POPUP _0rg0nv95w MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 19 OF _0bb0p33cb PROMPT "Vanzare din \<magazin (3712)"
	ON SELECTION BAR 19 OF _0bb0p33cb DO BAR_19_OF__0bb0p33cb_FB2P

	DEFINE BAR 20 OF _0bb0p33cb PROMPT "\<Factura de retur vanzare magazin"
	ON SELECTION BAR 20 OF _0bb0p33cb DO BAR_20_OF__0bb0p33cb_FB2P

DEFINE PAD _000000005 OF _msysmenu PROMPT "\<Vizualizare" COLOR SCHEME 3

ON PAD _000000005 OF _msysmenu ACTIVATE POPUP _0bb0p33cc

	*----------------------------------
	DEFINE POPUP _0bb0p33cc MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF _0bb0p33cc PROMPT "Extras din Registrul \<Jurnal"
	ON SELECTION BAR 1 OF _0bb0p33cc DO BAR_1_OF__0bb0p33cc_FB2P

	DEFINE BAR 2 OF _0bb0p33cc PROMPT "\-"
	ON BAR 2 OF _0bb0p33cc ACTIVATE POPUP _0bi0s8och

		*----------------------------------
		DEFINE POPUP _0bi0s8och MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 3 OF _0bb0p33cc PROMPT "\<Stocuri"
	ON SELECTION BAR 3 OF _0bb0p33cc DO BAR_3_OF__0bb0p33cc_FB2P

	DEFINE BAR 4 OF _0bb0p33cc PROMPT "\<Rulaje"
	ON BAR 4 OF _0bb0p33cc ACTIVATE POPUP _0bb0p96cz

		*----------------------------------
		DEFINE POPUP _0bb0p96cz MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF _0bb0p96cz PROMPT "\<In luna curenta"
		ON SELECTION BAR 1 OF _0bb0p96cz DO BAR_1_OF__0bb0p96cz_FB2P

		DEFINE BAR 2 OF _0bb0p96cz PROMPT "\<Total rulaje"
		ON SELECTION BAR 2 OF _0bb0p96cz DO BAR_2_OF__0bb0p96cz_FB2P

	DEFINE BAR 5 OF _0bb0p33cc PROMPT "\-"
	ON BAR 5 OF _0bb0p33cc ACTIVATE POPUP _0bb0p853v

		*----------------------------------
		DEFINE POPUP _0bb0p853v MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 6 OF _0bb0p33cc PROMPT "\<Furnizori"
	ON SELECTION BAR 6 OF _0bb0p33cc DO BAR_6_OF__0bb0p33cc_FB2P

	DEFINE BAR 7 OF _0bb0p33cc PROMPT "\-"
	ON BAR 7 OF _0bb0p33cc ACTIVATE POPUP _0bb0p853w

		*----------------------------------
		DEFINE POPUP _0bb0p853w MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 8 OF _0bb0p33cc PROMPT "\<Gestiuni"
	ON SELECTION BAR 8 OF _0bb0p33cc DO BAR_8_OF__0bb0p33cc_FB2P

	DEFINE BAR 9 OF _0bb0p33cc PROMPT "\<Lucrari"
	ON SELECTION BAR 9 OF _0bb0p33cc DO BAR_9_OF__0bb0p33cc_FB2P

DEFINE PAD _000000006 OF _msysmenu PROMPT "\<Listare" COLOR SCHEME 3

ON PAD _000000006 OF _msysmenu ACTIVATE POPUP _0bb0p33cd

	*----------------------------------
	DEFINE POPUP _0bb0p33cd MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF _0bb0p33cd PROMPT "\<NIR-uri"
	ON BAR 1 OF _0bb0p33cd ACTIVATE POPUP _0bb0pc0q9

		*----------------------------------
		DEFINE POPUP _0bb0pc0q9 MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF _0bb0pc0q9 PROMPT "\<NIR dupa numar in luna curenta"
		ON SELECTION BAR 1 OF _0bb0pc0q9 DO BAR_1_OF__0bb0pc0q9_FB2P

		DEFINE BAR 2 OF _0bb0pc0q9 PROMPT "\<NIR magazin dupa numar" ;
			SKIP FOR NIR_STANDARD
		ON SELECTION BAR 2 OF _0bb0pc0q9 DO BAR_2_OF__0bb0pc0q9_FB2P

		DEFINE BAR 3 OF _0bb0pc0q9 PROMPT "\-"
		ON BAR 3 OF _0bb0pc0q9 ACTIVATE POPUP _0d60vggv5

			*----------------------------------
			DEFINE POPUP _0d60vggv5 MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 4 OF _0bb0pc0q9 PROMPT "\<Nota de modificare NIR" ;
			SKIP FOR NIR_STANDARD
		ON SELECTION BAR 4 OF _0bb0pc0q9 DO BAR_4_OF__0bb0pc0q9_FB2P

	DEFINE BAR 2 OF _0bb0p33cd PROMPT "\-"
	ON BAR 2 OF _0bb0p33cd ACTIVATE POPUP _0bb0pgu04

		*----------------------------------
		DEFINE POPUP _0bb0pgu04 MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 3 OF _0bb0p33cd PROMPT "\<Bonuri"
	ON BAR 3 OF _0bb0p33cd ACTIVATE POPUP Bonuri

		*----------------------------------
		DEFINE POPUP Bonuri MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF Bonuri PROMPT "\<Dupa numar"
		ON SELECTION BAR 1 OF Bonuri DO BAR_1_OF_Bonuri_FB2P

		DEFINE BAR 2 OF Bonuri PROMPT "Dupa \<comanda"
		ON SELECTION BAR 2 OF Bonuri DO BAR_2_OF_Bonuri_FB2P

	DEFINE BAR 4 OF _0bb0p33cd PROMPT "\-"
	ON BAR 4 OF _0bb0p33cd ACTIVATE POPUP _0c612qr2m

		*----------------------------------
		DEFINE POPUP _0c612qr2m MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 5 OF _0bb0p33cd PROMPT "\<Stocuri"
	ON BAR 5 OF _0bb0p33cd ACTIVATE POPUP _0c6142tq6

		*----------------------------------
		DEFINE POPUP _0c6142tq6 MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF _0c6142tq6 PROMPT "\<Marfa Magazin"
		ON SELECTION BAR 1 OF _0c6142tq6 DO BAR_1_OF__0c6142tq6_FB2P

		DEFINE BAR 2 OF _0c6142tq6 PROMPT "\-"
		ON BAR 2 OF _0c6142tq6 ACTIVATE POPUP _0dg15g50m

			*----------------------------------
			DEFINE POPUP _0dg15g50m MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 3 OF _0c6142tq6 PROMPT "\<Pe Gestiuni"
		ON BAR 3 OF _0c6142tq6 ACTIVATE POPUP PeGestiuni

			*----------------------------------
			DEFINE POPUP PeGestiuni MARGIN RELATIVE SHADOW COLOR SCHEME 4
			DEFINE BAR 1 OF PeGestiuni PROMPT "\<In ordine alfabetica"
			ON SELECTION BAR 1 OF PeGestiuni DO BAR_1_OF_PeGestiuni_FB2P

			DEFINE BAR 2 OF PeGestiuni PROMPT "\<Dupa cod material"
			ON SELECTION BAR 2 OF PeGestiuni DO BAR_2_OF_PeGestiuni_FB2P

	DEFINE BAR 6 OF _0bb0p33cd PROMPT "\-"
	ON BAR 6 OF _0bb0p33cd ACTIVATE POPUP _0c6142ugf

		*----------------------------------
		DEFINE POPUP _0c6142ugf MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 7 OF _0bb0p33cd PROMPT "\<Transferuri"
	ON BAR 7 OF _0bb0p33cd ACTIVATE POPUP NewItem

		*----------------------------------
		DEFINE POPUP NewItem MARGIN RELATIVE SHADOW COLOR SCHEME 4
		DEFINE BAR 1 OF NewItem PROMPT "\<Intre gestiuni"
		ON SELECTION BAR 1 OF NewItem DO BAR_1_OF_NewItem_FB2P

		DEFINE BAR 2 OF NewItem PROMPT "\<Gestiune -> Magazin"
		ON SELECTION BAR 2 OF NewItem DO BAR_2_OF_NewItem_FB2P

		DEFINE BAR 3 OF NewItem PROMPT "\<Magazin -> Gestiune"
		ON SELECTION BAR 3 OF NewItem DO BAR_3_OF_NewItem_FB2P

		DEFINE BAR 4 OF NewItem PROMPT "\<Retur magazie"
		ON SELECTION BAR 4 OF NewItem DO BAR_4_OF_NewItem_FB2P

	DEFINE BAR 8 OF _0bb0p33cd PROMPT "\-"
	ON BAR 8 OF _0bb0p33cd ACTIVATE POPUP _0bv16lxb6

		*----------------------------------
		DEFINE POPUP _0bv16lxb6 MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 9 OF _0bb0p33cd PROMPT "\<Factura de vanzare marfa din stoc (3711)"
	ON SELECTION BAR 9 OF _0bb0p33cd DO BAR_9_OF__0bb0p33cd_FB2P

	DEFINE BAR 10 OF _0bb0p33cd PROMPT "\<Factura de vanzare magazin (3712)"
	ON SELECTION BAR 10 OF _0bb0p33cd DO BAR_10_OF__0bb0p33cd_FB2P

DEFINE PAD _000000007 OF _msysmenu PROMPT "A\<jutor" COLOR SCHEME 3 ;
	KEY ALT+J, "ALT+J" ;
	MESSAGE 'Instructiuni de utilizare, informatii despre acest program.'

ON PAD _000000007 OF _msysmenu ACTIVATE POPUP Ajutor

	*----------------------------------
	DEFINE POPUP Ajutor MARGIN RELATIVE SHADOW COLOR SCHEME 4
	DEFINE BAR 1 OF Ajutor PROMPT "\<Despre program..." ;
		MESSAGE 'Informatii despre program'
	ON SELECTION BAR 1 OF Ajutor DO BAR_1_OF_Ajutor_FB2P

*</MenuCode>

*<Procedures>
PROCEDURE BAR_1_OF_Utile_FB2P
	do case
		case file('C:\WINDOWS\CALC.EXE')
			run /N C:\WINDOWS\CALC.EXE
		case file('C:\WINDOWS\SYSTEM32\CALC.EXE')
			run /N C:\WINDOWS\SYSTEM32\CALC.EXE
		case file('C:\WINnt\system32\CALC.EXE')
			run /N C:\WINnt\system32\CALC.EXE
		otherwise
			do mesajatent with 'Aplicatia "Calculator" nu este instalata','pe acest sistem!'
	endcase
ENDPROC && BAR_1_OF_Utile_FB2P

PROCEDURE BAR_2_OF_Utile_FB2P
	od=createo('diary')
	od.show(1)
ENDPROC && BAR_2_OF_Utile_FB2P

PROCEDURE BAR_3_OF_Utile_FB2P
	do case
		case file('C:\WINDOWS\NOTEPAD.EXE')
			run /N C:\WINDOWS\NOTEPAD.EXE
		case file('C:\WINnt\system32\NOTEPAD.EXE')
			run /N C:\WINnt\system32\NOTEPAD.EXE
		otherwise
			do mesajatent with 'Aplicatia "NOTEPAD" nu este instalata','pe acest sistem!'
	endcase
			
ENDPROC && BAR_3_OF_Utile_FB2P

PROCEDURE BAR_1_OF_Reindexare_FB2P
	do reindexaretempo in reindexare.prg
ENDPROC && BAR_1_OF_Reindexare_FB2P

PROCEDURE BAR_7_OF_Utile_FB2P
	ies=.t.
	
	DO IESIRE
	
	*RELEASE OBJECTS_________________________-
	*ostart.release
	*OSETVIZ.RELEASE
	*OSETTULBAR.RELEASE
	*OSETINSTRUM.RELEASE
	
ENDPROC && BAR_7_OF_Utile_FB2P

PROCEDURE BAR_1_OF_Initializa_FB2P
	do form start00
ENDPROC && BAR_1_OF_Initializa_FB2P

PROCEDURE BAR_3_OF_Initializa_FB2P
	oge=create('afgest')
	oge.show(1)
ENDPROC && BAR_3_OF_Initializa_FB2P

PROCEDURE BAR_4_OF_Initializa_FB2P
	o=crea('cursval')
	o.show(1)
ENDPROC && BAR_4_OF_Initializa_FB2P

PROCEDURE BAR_5_OF_Initializa_FB2P
	orp=create('parola')
	orp.show(1)
	
	if buton=3
	
	o=crea('adaoscom')
	o.show(1)
	
	endif
ENDPROC && BAR_5_OF_Initializa_FB2P

PROCEDURE BAR_1_OF_NIRuri_FB2P
	alegnir=0
	osetgest.tbrprim.buton1.click
ENDPROC && BAR_1_OF_NIRuri_FB2P

PROCEDURE BAR_2_OF_NIRuri_FB2P
	alegnir=1
	osetgest.tbrprim.buton1.click
ENDPROC && BAR_2_OF_NIRuri_FB2P

PROCEDURE BAR_3_OF_NIRuri_FB2P
	alegnir=2
	osetgest.tbrprim.buton1.click
ENDPROC && BAR_3_OF_NIRuri_FB2P

PROCEDURE BAR_2_OF__0bb0p33cb_FB2P
	nirmagazin=.t.
	osetgest.tbrprim.buton1.click
	nirmagazin=.f.
ENDPROC && BAR_2_OF__0bb0p33cb_FB2P

PROCEDURE BAR_1_OF_Import_FB2P
	do importmarfa in procmeniu.prg
ENDPROC && BAR_1_OF_Import_FB2P

PROCEDURE BAR_2_OF_Import_FB2P
	do importmat in procmeniu.prg
ENDPROC && BAR_2_OF_Import_FB2P

PROCEDURE BAR_1_OF_Productie_FB2P
	DO INTRODPROD WITH '345 '
ENDPROC && BAR_1_OF_Productie_FB2P

PROCEDURE BAR_2_OF_Productie_FB2P
	DO INTRODPROD WITH '347 '
ENDPROC && BAR_2_OF_Productie_FB2P

PROCEDURE BAR_8_OF__0bb0p33cb_FB2P
	m.scd='6024'
	o=crea('selcontmic')
	O.COMBO1.ROWSOURCE='601 ,6021,6022,6023,6024,6028'
	o.show(1)
	
	DO CASE
	CASE M.SCD='601 '
	M.SCC='301 '
	CASE M.SCD='6021'
	M.SCC='3021'
	CASE M.SCD='6022'
	M.SCC='3022'
	CASE M.SCD='6024'
	M.SCC='3024'
	CASE M.SCD='6028'
	M.SCC='3028'
	CASE M.SCD='6023'
	M.SCC='3023'
	ENDCASE
	
	DO BONARE WITH M.SCD,M.SCC,'CHELTMAT'
ENDPROC && BAR_8_OF__0bb0p33cb_FB2P

PROCEDURE BAR_9_OF__0bb0p33cb_FB2P
	osetgest.tbrprim.buton2.click
ENDPROC && BAR_9_OF__0bb0p33cb_FB2P

PROCEDURE BAR_11_OF__0bb0p33cb_FB2P
	sele bal
	ose=crea('selcont')
	ose.caption='Selectati contul debitor'
	ose.show(1)
	m.scd=cn
	
	sele bal
	ose=crea('selcont')
	ose.caption='Selectati contul creditor'
	ose.show(1)
	m.scc=cn
	
	
	DO BONARE WITH M.SCD,M.SCC,'CHELTMAT'
ENDPROC && BAR_11_OF__0bb0p33cb_FB2P

PROCEDURE BAR_1_OF_Transferur_FB2P
	SELE CALENDAR
	LOCA FOR NL=M.NL AND AN=M.AN
	M.CTVA=CTVAM
	M.FDOC='NOTA TRANSFER'
	
	buton=1
	OACT=CREATEOBJ('ACTTRANSFERg')
	OACT.SHOW(1)
	
	IF BUTON=2
		DO STERGE
		RETURN
	ENDIF
	
	M.NNIR=M.NRACT
	DO CODARE
	
	SELE IESIRI
	ZAP
	do cursul
	buton=1
	*do form bonmarfa1
	OBM=CREA('BONTRANSFERgg')
	OBM.SHOW(1)
	
	IF BUTON=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	
	sele numegest
	**scd din m.numegest
	loca for numegest=m.numegest
	m.scd1=contg
	**scd din m.nume_4
	loca for numegest=m.nume_4
	m.scd2=contg
	
	
	DO CONTABILIZEAZA WITH m.scd2,m.scd1,M.TOTFTVA-M.TOTADAOS,CLASAACT
	
	DO IESTOCURIMAGAZII 
	&&IESIRE DIN GESTIUNEA M.NUMEGEST
	DO IERULAJMAGAZII
	
	buton=2
	DO DANU WITH 'Doriti sa listati NOTA DE TRANSFER?'
	if buton=1
	SELE RUL
	SET FILTER TO cod=m.cod and !empty(cante)
	REPORT FORMAT NIRTRANSFER.FRX TO PRINTER PROMPT PREVIEW
	endif
	
	&&INTRARE IN GESTIUNEA M.NUME_4
	SELE NUMEGEST
	LOCA FOR ALLT(NUMEGEST)=ALLT(M.NUME_4)
	SCAT FIEL GEST MEMV
	
	SELE INTRARI
	ZAP
	SELE IESIRI
	SCAN
		SCAT FIEL EXCEPT GEST MEMV
		M.CANT=M.CANTE
		M.SCD=m.scd2
		SELE INTRARI
		APPE BLAN
		GATH MEMV
		SELE IESIRI
	ENDSCAN
	
	
	DO INRULAJMAGAZII
	DO INSTOCURIMAGAZII 
	
	DO STERGE
	RETURN
	
	
	
ENDPROC && BAR_1_OF_Transferur_FB2P

PROCEDURE BAR_2_OF_Transferur_FB2P
	Sele CALENDAR
	Loca For NL=M.NL And AN=M.AN
	m.CTVA=CTVAM
	m.FDOC='NOTA TRANSFER'
	
	buton=1
	OACT=Createobj('ACTTRANSFER')
	OACT.Show(1)
	
	If buton=2
		Do STERGE
		Return
	Endif
	
	m.NNIR=M.NRACT
	Do CODARE
	
	Sele IESIRI
	Zap
	Do cursul
	buton=1
	*do form bonmarfa1
	OBM=Crea('BONTRANSFERGM')
	OBM.Show(1)
	
	If buton=2
		Do STERGE
		Return
	Endif
	*******************************************
	m.TOTTVA=Round(M.TOTFTVA*(M.CTVA-1),0)
	Do CONTABILIZEAZA With C371ENDETAIL,C371ENGROS,M.TOTFTVA-m.totadaos,CLASAACT
	*M.EXPLICATIA='ADAOS COMERCIAL'
	Do CONTABILIZEAZA With C371ENDETAIL,C378ENDETAIL,M.totadaos,CLASAACT
	m.EXPLICATIA='TVA '+Allt(Str((M.CTVA-1)*100))+'%'
	Do CONTABILIZEAZA With C371ENDETAIL,'4428',M.TOTTVA,CLASAACT
	
	
	Do IESTOCURIMAGAZII
	&&IESIRE DIN GESTIUNEA M.NUMEGEST
	Do IERULAJMAGAZII
	
	*!*	buton=2
	*!*	DO DANU WITH 'Doriti sa listati NOTA DE TRANSFER?'
	*!*	if buton=1
	*!*	SELE RUL
	*!*	SET FILTER TO cod=m.cod and !empty(cante)
	*!*	REPORT FORMAT NIRTRANSFER.FRX TO PRINTER PROMPT PREVIEW
	*!*	endif
	
	&&INTRARE IN GESTIUNEA M.NUME_4
	Sele NUMEGEST
	Loca For Allt(NUMEGEST)=Allt(M.NUME_4)
	Scat Fiel GEST Memv
	
	Sele INTRARI
	Zap
	Sele IESIRI
	Scan
		Scat Fiel Except GEST Memv
		m.CANT=M.CANTE
		m.SCD=C371ENDETAIL
		Sele INTRARI
		Appe Blan
		Gath Memv
		Sele IESIRI
	Endscan
	
	
	Do INRULAJMAGAZII
	Do INSTOCURIMAGAZII
	
	buton=2
	Do DANU With 'Doriti sa listati NOTA DE TRANSFER?'
	If buton=1
		Sele RUL
	*!*	SET FILTER TO cod=m.cod and !empty(cante)
	***
		Select * From RUL Where COD=M.COD Into Table &LOC\&NFSCURT\TEMPO\ARUL
		Use In RUL
		Use In ARUL
		Use &LOC\&NFSCURT\TEMPO\ARUL In 0 Alias RUL
	***
		Select RUL
		Set Filter To !Empty(CANTE)
		Report Format NIRTRANSFER.FRX To Printer Prompt Preview
		Do TOTV
	Endif
	
	Do STERGE
	Return
	
	
	
ENDPROC && BAR_2_OF_Transferur_FB2P

PROCEDURE BAR_3_OF_Transferur_FB2P
	Local TR
	
	
	Sele CALENDAR
	Loca For NL=M.NL And AN=M.AN
	m.CTVA=CTVAM
	m.FDOC='NOTA TRANSFER'
	
	buton=1
	OACT=Createobj('ACTTRANSFER')
	OACT.LABEL7.Caption='GESTIUNEA DESTINATIE' &&M.NUMEGEST; SURSA=M.NUME_4
	OACT.Show(1)
	
	If buton=2
		Do STERGE
		Return
	Endif
	
	TR=M.NUMEGEST
	m.NUMEGEST=M.NUME_4
	m.NUME_4=TR
	
	m.NNIR=M.NRACT
	Do CODARE
	
	Sele IESIRI
	Zap
	Do cursul
	buton=1
	*do form bonmarfa1
	OBM=Crea('BONTRANSFERMG')
	*OBM.LABELNUME.CAPTION='TRANSFER MAGAZIN - GESTIUNE'
	OBM.Show(1)
	
	If buton=2
		Do STERGE
		Return
	Endif
	*******************************************
	m.TOTTVA=Round(M.TOTFTVA*(M.CTVA-1),0)
	Do CONTABILIZEAZA With C371ENGROS,C371ENDETAIL,M.TOTFTVA-m.totadaos,CLASAACT
	*M.EXPLICATIA='ADAOS COMERCIAL'
	Do CONTABILIZEAZA With C378ENDETAIL,C371ENDETAIL,M.totadaos,CLASAACT
	m.EXPLICATIA='TVA '+Allt(Str((M.CTVA-1)*100))+'%'
	Do CONTABILIZEAZA With '4428',C371ENDETAIL,M.TOTTVA,CLASAACT
	
	
	Do IESTOCURIMAGAZII
	&&IESIRE DIN GESTIUNEA M.NUMEGEST
	Do IERULAJMAGAZII
	
	*!*	buton=2
	*!*	DO DANU WITH 'Doriti sa listati NOTA DE TRANSFER?'
	*!*	if buton=1
	*!*	*!*	SELE RUL
	*!*	*!*	SET FILTER TO cod=m.cod and !empty(cante)
	*!*	*!*	REPORT FORMAT NIRTRANSFER.FRX TO PRINTER PROMPT PREVIEW
	*!*	SELECT * FROM RUL WHERE COD=M.COD INTO TABLE &LOC\&NFSCURT\TEMPO\ARUL
	*!*	USE IN RUL
	*!*	USE IN ARUL
	*!*	USE &LOC\&NFSCURT\TEMPO\ARUL IN 0 ALIAS RUL
	*!*	SELECT RUL
	*!*	SET FILTER TO !empty(cante)
	*!*	REPORT FORMAT NIRTRANSFER.FRX TO PRINTER PROMPT PREVIEW
	*!*	endif
	*!*	DO TOTV
	*!*	endif
	
	&&INTRARE IN GESTIUNEA M.NUME_4
	Sele NUMEGEST
	Loca For Allt(NUMEGEST)=Allt(M.NUME_4)
	Scat Fiel GEST Memv
	
	Sele INTRARI
	Zap
	Sele IESIRI
	Scan
		Scat Fiel Except GEST Memv
		m.CANT=M.CANTE
		m.SCD=C371ENGROS
		Sele INTRARI
		Appe Blan
		Gath Memv
		Sele IESIRI
	Endscan
	
	
	Do INRULAJMAGAZII
	Do INSTOCURIMAGAZII
	
	
	buton=2
	Do DANU With 'Doriti sa listati NOTA DE TRANSFER?'
	If buton=1
	*!*	SELE RUL
	*!*	SET FILTER TO cod=m.cod and !empty(cante)
	*!*	REPORT FORMAT NIRTRANSFER.FRX TO PRINTER PROMPT PREVIEW
		Select * From RUL Where COD=M.COD Into Table &LOC\&NFSCURT\TEMPO\ARUL
		Use In RUL
		Use In ARUL
		Use &LOC\&NFSCURT\TEMPO\ARUL In 0 Alias RUL
		Select RUL
		Set Filter To !Empty(CANTE)
		Report Format NIRTRANSFER.FRX To Printer Prompt Preview
		Do TOTV
	
	Endif
	
	
	Do STERGE
	Return
	
	
	
ENDPROC && BAR_3_OF_Transferur_FB2P

PROCEDURE BAR_5_OF_Transferur_FB2P
	PUBLIC CODSALV,DATAIREGS,DATAACTS
	SELE CALENDAR
	LOCA FOR NL=M.NL AND AN=M.AN
	M.CTVA=CTVAM
	M.FDOC='RETUR MAGAZIE'
	
	buton=1
	OACT=CREATEOBJ('ACTBONMARFA')
	WITH OACT
	.LABEL7.ENABLED=.F.
	.TEXT7.ENABLED=.F.
	.IMAGE4.VISIBLE=.F.
	.LABEL4.CAPTION='NUMARUL DOCUMENTULUI'
	.TEXT4.TABSTOP=.T.
	.TEXT4.READONLY=.F.
	ENDWITH
	OACT.SHOW(1)
	
	IF BUTON=2
		DO STERGE
		RETURN
	ENDIF
	
	M.NNIR=M.NRACT
	DO CODARE
	CODSALV=M.COD
	DATAIREGS=M.DATAIREG
	DATAACTS=M.DATAACT
	
	SELE IESIRI
	ZAP
	do cursul
	buton=1
	OBM=CREA('RETUR')
	OBM.SHOW(1)
	
	IF BUTON=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	STORE '' TO M.NUME,M.NUME_2,M.EXPLICATIA
	M.COD=CODSALV
	M.DATAIREG=DATAIREGS
	M.DATAACT=DATAACTS
	M.TOTTVA=ROUND(M.TOTFTVA*(M.CTVA-1),0)
	DO CONTABILIZEAZA WITH '607 ',C371ENGROS,-M.TOTFTVA+m.totadaos,CLASAACT
	DO CONTABILIZEAZA WITH C378ENGROS,C371ENGROS,-M.TOTadaos,CLASAACT
	DO CONTABILIZEAZA WITH C371ENGROS,C378ENGROS,-M.TOTadaos,CLASAACT
	DO CONTABILIZEAZA WITH '332 ','711 ',-M.TOTFTVA,CLASAACT
	*DO CONTABILIZEAZA WITH '332 ','711 ',-M.TOTFTVA+m.totadaos,CLASAACT
	
	buton=2
	DO DANU WITH 'Doriti sa listati NOTA DE RETUR?'
	if buton=1
	*SELE RUL
	*SET FILTER TO cod=m.cod and !empty(cante)
	SELE IESIRI
	REPL ALL NNIR WITH M.NRACT
	REPL ALL COD WITH CODSALV
	REPORT FORMAT RETUR.FRX TO PRINTER PROMPT PREVIEW
	endif
	
	
	SELE INTRARI
	ZAP
	SELE IESIRI
	SCAN
		SCAT MEMV
		M.CANT=M.CANTE
		SELE INTRARI
		APPE BLAN
		GATH MEMV
		SELE IESIRI
	ENDSCAN
	
	
	*DO INRULAJMAGAZII
	DO IERULAJE
	DO INSTOCURIMAGAZII 
	
	DO STERGE
	SELE LUCRARI
	SET FILTER TO
	RETURN
	
	
	
ENDPROC && BAR_5_OF_Transferur_FB2P

PROCEDURE BAR_6_OF_Transferur_FB2P
	*!*	PUBLIC CODSALV,DATAIREGS,DATAACTS
	*!*	SELE CALENDAR
	*!*	LOCA FOR NL=M.NL AND AN=M.AN
	*!*	M.CTVA=CTVAM
	*!*	M.FDOC='RETUR C.FACT'
	
	*!*	buton=1
	*!*	OACT=CREATEOBJ('ACTBONMARFAF')
	*!*	WITH OACT
	*!*	.LABEL7.ENABLED=.F.
	*!*	.TEXT7.ENABLED=.F.
	*!*	.IMAGE4.VISIBLE=.F.
	*!*	.LABEL4.CAPTION='NUMARUL DOCUMENTULUI'
	*!*	.TEXT4.TABSTOP=.T.
	*!*	.TEXT4.READONLY=.F.
	*!*	.LABEL5.CAPTION='C-DA INITIALA'
	*!*	ENDWITH
	*!*	OACT.SHOW(1)
	
	*!*	IF BUTON=2
	*!*		DO STERGE
	*!*		RETURN
	*!*	ENDIF
	
	*!*	M.NNIR=M.NRACT
	*!*	DO CODARE
	*!*	CODSALV=M.COD
	*!*	DATAIREGS=M.DATAIREG
	*!*	DATAACTS=M.DATAACT
	
	*!*	SELE IESIRI
	*!*	ZAP
	*!*	do cursul
	*!*	buton=1
	*!*	OBM=CREA('RETUR')
	*!*	OBM.LABELNUME.CAPTION='RETUR DIN COMANDA FACTURATA'
	*!*	OBM.SHOW(1)
	
	*!*	IF BUTON=2
	*!*		DO STERGE
	*!*		RETURN
	*!*	ENDIF
	*!*	*******************************************
	*!*	LOCAL CVECHE
	*!*	CVECHE=M.NRORD
	*!*		OLIT=CREATEOBJECT("CAUTLITERE")
	*!*		WITH OLIT
	*!*			.CAPTION="COMANDA FINALA"
	*!*			.text1.controlsource="m.NRORD"
	*!*		endwith
	*!*		olit.show(1)
	*!*	SELE IESIRI
	*!*	REPL ALL NRORD WITH M.NRORD
	
	
	*!*	STORE '' TO M.NUME,M.NUME_2,M.EXPLICATIA
	*!*	M.EXPLICATIA='C.INIT.'+ALLT(STR(CVECHE))+'-C.FIN.'+ALLT(STR(M.NRORD))
	*!*	M.COD=CODSALV
	*!*	M.DATAIREG=DATAIREGS
	*!*	M.DATAACT=DATAACTS
	*!*	M.TOTTVA=ROUND(M.TOTFTVA*(M.CTVA-1),0)
	*!*	DO CONTABILIZEAZA WITH '607 ',C371ENGROS,-M.TOTFTVA+m.totadaos,CLASAACT
	*!*	DO CONTABILIZEAZA WITH C378ENGROS,C371ENGROS,-M.TOTadaos,CLASAACT
	*!*	DO CONTABILIZEAZA WITH C371ENGROS,C378ENGROS,-M.TOTadaos,CLASAACT
	*!*	DO CONTABILIZEAZA WITH '332 ','711 ',-M.TOTFTVA,CLASAACT
	*!*	*DO CONTABILIZEAZA WITH '332 ','711 ',-M.TOTFTVA+m.totadaos,CLASAACT
	
	*!*	buton=2
	*!*	DO DANU WITH 'Doriti sa listati NOTA DE RETUR?'
	*!*	if buton=1
	*!*	*SELE RUL
	*!*	*SET FILTER TO cod=m.cod and !empty(cante)
	*!*	SELE IESIRI
	*!*	REPL ALL NNIR WITH M.NRACT
	*!*	REPL ALL COD WITH CODSALV
	*!*	REPORT FORMAT RETUR.FRX TO PRINTER PROMPT PREVIEW
	*!*	endif
	
	
	*!*	SELE INTRARI
	*!*	ZAP
	*!*	SELE IESIRI
	*!*	SCAN
	*!*		SCAT MEMV
	*!*		M.CANT=M.CANTE
	*!*		SELE INTRARI
	*!*		APPE BLAN
	*!*		GATH MEMV
	*!*		SELE IESIRI
	*!*	ENDSCAN
	
	
	*!*	*DO INRULAJMAGAZII
	*!*	DO IERULAJE
	*!*	DO INSTOCURIMAGAZII 
	
	*!*	DO STERGE
	*!*	SELE LUCRARI
	*!*	SET FILTER TO
	*!*	RETURN
	
	
	
	PUBLIC CODSALV,DATAIREGS,DATAACTS
	SELE CALENDAR
	LOCA FOR NL=M.NL AND AN=M.AN
	M.CTVA=CTVAM
	M.FDOC='RETUR C.FACT'
	
	buton=1
	OACT=CREATEOBJ('ACTBONMARFAF')
	WITH OACT
	.LABEL7.ENABLED=.F.
	.TEXT7.ENABLED=.F.
	.IMAGE4.VISIBLE=.F.
	.LABEL4.CAPTION='NUMARUL DOCUMENTULUI'
	.TEXT4.TABSTOP=.T.
	.TEXT4.READONLY=.F.
	.LABEL5.CAPTION='C-DA INITIALA'
	ENDWITH
	OACT.SHOW(1)
	
	IF BUTON=2
		DO STERGE
		RETURN
	ENDIF
	
	M.NNIR=M.NRACT
	DO CODARE
	CODSALV=M.COD
	DATAIREGS=M.DATAIREG
	DATAACTS=M.DATAACT
	m.nrord=allt(m.nrord)
	
	wait wind 'Se selecteaza materialele bonate la comanda '+allt(m.nrord)+'. Asteptati...' nowait
	
	sele * from rul where m.nrord$nrord into table &loc\&nfscurt\tempo\ret.dbf
	use in rul
	use in ret
	use &loc\&nfscurt\tempo\ret.dbf in 0 alias rul
	
	
	wait clear
	SELE IESIRI
	ZAP
	do cursul
	buton=1
	OBM=CREA('RETUR')
	OBM.LABELNUME.CAPTION='RETUR DIN COMANDA FACTURATA'
	OBM.SHOW(1)
	
	use in rul
	do des with 'rul'
	IF BUTON=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	LOCAL CVECHE
	CVECHE=M.NRORD
		OLIT=CREATEOBJECT("CAUTLITERE")
		WITH OLIT
			.CAPTION="COMANDA FINALA"
			.text1.controlsource="m.NRORD"
		endwith
		olit.show(1)
		
	SELE IESIRI
	REPL ALL NRORD WITH M.NRORD
	
	
	STORE '' TO M.NUME,M.NUME_2,M.EXPLICATIA
	M.EXPLICATIA='C.INIT.'+ALLT(CVECHE)+'-C.FIN.'+ALLT(M.NRORD)
	M.COD=CODSALV
	M.DATAIREG=DATAIREGS
	M.DATAACT=DATAACTS
	M.TOTTVA=ROUND(M.TOTFTVA*(M.CTVA-1),0)
	DO CONTABILIZEAZA WITH '607 ',C371ENGROS,-M.TOTFTVA+m.totadaos,CLASAACT
	DO CONTABILIZEAZA WITH C378ENGROS,C371ENGROS,-M.TOTadaos,CLASAACT
	DO CONTABILIZEAZA WITH C371ENGROS,C378ENGROS,-M.TOTadaos,CLASAACT
	DO CONTABILIZEAZA WITH '332 ','711 ',-M.TOTFTVA,CLASAACT
	*DO CONTABILIZEAZA WITH '332 ','711 ',-M.TOTFTVA+m.totadaos,CLASAACT
	
	buton=2
	DO DANU WITH 'Doriti sa listati NOTA DE RETUR?'
	if buton=1
	*SELE RUL
	*SET FILTER TO cod=m.cod and !empty(cante)
	SELE IESIRI
	REPL ALL NNIR WITH M.NRACT
	REPL ALL COD WITH CODSALV
	REPORT FORMAT RETUR.FRX TO PRINTER PROMPT PREVIEW
	endif
	
	
	SELE INTRARI
	ZAP
	SELE IESIRI
	SCAN
		SCAT MEMV
		M.CANT=M.CANTE
		SELE INTRARI
		APPE BLAN
		GATH MEMV
		SELE IESIRI
	ENDSCAN
	
	
	*DO INRULAJMAGAZII
	DO IERULAJE
	DO INSTOCURIMAGAZII 
	
	DO STERGE
	SELE LUCRARI
	SET FILTER TO
	RETURN
	
	
	
ENDPROC && BAR_6_OF_Transferur_FB2P

PROCEDURE BAR_15_OF__0bb0p33cb_FB2P
	SELE calendar
	LOCA for nl=m.nl and an=m.an
	m.ctva=ctvam
	
	SELE FIRMA
	LOCA FOR NFSCURT=FSCURT
	SCAT MEMV
	FCOD_FISCAL=M.COD_FISCAL
	
	
	m.FDOC='FACTURA'
	m.NRACT=M.NRBON
	Buton=1
	OACT=CREATEOBJ('ACTGEN03RESP')
	OACT.SHOW(1)
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	
	DO CODARE
	m.nnir=m.NRACT
	SELE IESIRI
	ZAP
	DO cursul
	Buton=1
	*do form bonmarfa1
	OB=CREA('BONvanz1')
	OB.SHOW(1)
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	LOCAL NG
	NG=M.EXPLICATIA
	m.TOTTVAV=ROUND(M.TOTFTVA*(M.ctva-1),0)
	DO CONTABILIZEAZA WITH '411 ','707 ',M.TOTFTVA,CLASAACT
	m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	DO CONTABILIZEAZA WITH '411 ','4427',M.TOTTVAV,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH '607 ',C371ENGROS,M.TOTFTVA-M.TOTADAOS,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH C378ENGROS,C371ENGROS,M.TOTADAOS,CLASAACT
	*M.EXPLICATIA='TVA '+ALLT(STR((M.CTVA-1)*100))+'%'
	*DO CONTABILIZEAZA WITH '4428',C371ENGROS,M.TOTTVAV,CLASAACT
	DO CONTABILIZEAZA WITH C371ENGROS,C378ENGROS,M.TOTADAOS,CLASAACT
	
	
	SELE CLIENTI
	LOCA FOR ALLT(NUME)=ALLT(M.NUME)
	IF found()
		SCAT FIEL COD_FISCAL MEMV
		IF flock()
			REPL PRODUCTIE WITH PRODUCTIE+M.TOTFTVA
		ENDIF
		UNLOCK
	ENDIF
	
	m.TOTFTVAM=M.TOTFTVA
	m.TVAM=M.TOTTVAV
	m.TOTCTVA=M.TOTFTVAM+M.TVAM
	m.NEIMPOZAB=0
	DO ADVANZ
	
	DO IESTOCURIMAGAZII
	DO IERULAJMAGAZII
	
	Buton=2
	DO DANU WITH 'Doriti sa listati FACTURA?'
	IF Buton=1
		DO form datefact
		SELE RUL
		SET FILTER TO COD=M.COD AND CANTE#0
		REPORT FORM FACT TO PRINTER PROMPT PREVIEW
	ENDIF
	
	
	
	
	
	
	DO STERGE
	RETURN
ENDPROC && BAR_15_OF__0bb0p33cb_FB2P

PROCEDURE BAR_16_OF__0bb0p33cb_FB2P
	do meniu51040_3711
ENDPROC && BAR_16_OF__0bb0p33cb_FB2P

PROCEDURE BAR_17_OF__0bb0p33cb_FB2P
	SELE calendar
	LOCA for nl=m.nl and an=m.an
	m.ctva=ctvam
	
	SELE FIRMA
	LOCA FOR NFSCURT=FSCURT
	SCAT MEMV
	FCOD_FISCAL=M.COD_FISCAL
	
	
	m.FDOC='FACTURA'
	m.NRACT=M.NRBON
	Buton=1
	OACT=CREATEOBJ('ACTGEN03RESP')
	OACT.SHOW(1)
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	
	
	SELE IESIRI
	ZAP
	DO cursul
	Buton=1
	*do form bonmarfa1
	local m.datafact,codfact
	m.datafact={}
	m.nract1=0
	codfact=0
	*!*	Ointre=CREATEOBJECT("CAUTintre")
	*!*		WITH Ointre
	*!*			.CAPTION="Nr.fact.din care se returneaza piese"
	*!*			.label1.caption="Nr.fact.:"
	*!*			.label2.visible=.f.
	*!*			.text1.controlsource="m.nract1"
	*!*			.text2.visible=.f.
	*!*		endwith
	*!*		ointre.show(1)
	*!*		
	
	*!*	sele actan
	*!*	loca for nract=m.nract1 and nume=m.nume
	*!*	if !found()
	*!*	do mesaj with 'Fact. '+allt(str(m.nract1))+' nu a fost introdusa.'
	*!*	return
	*!*	else
	*!*	codfact=cod
	*!*	ENDIF
	
	USE IN STOC
	SELECT RUL
	SET FILTER TO 
	sele *,0 as cants from rul where CANT=0 into cursor stoc 
	
	OB=CREA('BONvanzr')
	OB.LABELNUME.CAPTION='FACTURA DE RETUR EN GROS'
	OB.LABEL1.CAPTION='IESIRI DE MARFA'
	OB.LABEL21.CAPTION='FACTURA DE RETUR'
	OB.SHOW(1)
	use in stoc
	do des with 'stoc'
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	DO CODARE
	m.nnir=m.NRACT
	LOCAL NG
	NG=M.EXPLICATIA
	m.TOTTVAV=ROUND(M.TOTFTVA*(M.ctva-1),0)
	DO CONTABILIZEAZA WITH '411 ','707 ',M.TOTFTVA,CLASAACT
	m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	DO CONTABILIZEAZA WITH '411 ','4427',M.TOTTVAV,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH '607 ',C371ENGROS,M.TOTFTVA-M.TOTADAOS,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH C378ENGROS,C371ENGROS,M.TOTADAOS,CLASAACT
	DO CONTABILIZEAZA WITH C371ENGROS,C378ENGROS,M.TOTADAOS,CLASAACT
	*m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	*DO CONTABILIZEAZA WITH '4428',C371ENGROS,M.TOTTVAV,CLASAACT
	
	SELE CLIENTI
	LOCA FOR ALLT(NUME)=ALLT(M.NUME)
	IF found()
		SCAT FIEL COD_FISCAL MEMV
		IF flock()
			REPL PRODUCTIE WITH PRODUCTIE+M.TOTFTVA
		ENDIF
		UNLOCK
	ENDIF
	
	m.TOTFTVAM=M.TOTFTVA
	m.TVAM=M.TOTTVAV
	m.TOTCTVA=M.TOTFTVAM+M.TVAM
	m.NEIMPOZAB=0
	DO ADVANZ
	sele iesiri
	repl all cod with m.cod
	DO IESTOCURIMAGAZII
	DO IERULAJMAGAZII
	
	Buton=2
	DO DANU WITH 'Doriti sa listati FACTURA?'
	IF Buton=1
		DO form datefact
		SELE RUL
		SET FILTER TO COD=M.COD AND CANTE#0
		REPORT FORM FACT TO PRINTER PROMPT PREVIEW
	ENDIF
	
	
	
	DO STERGE
	
	RETURN
ENDPROC && BAR_17_OF__0bb0p33cb_FB2P

PROCEDURE BAR_19_OF__0bb0p33cb_FB2P
	SELE calendar
	LOCA for nl=m.nl and an=m.an
	m.ctva=ctvam
	
	SELE FIRMA
	LOCA FOR NFSCURT=FSCURT
	SCAT MEMV
	FCOD_FISCAL=M.COD_FISCAL
	
	
	m.FDOC='FACTURA'
	m.NRACT=M.NRBON
	Buton=1
	OACT=CREATEOBJ('ACTGEN03RESP')
	OACT.SHOW(1)
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	
	DO CODARE
	m.nnir=m.NRACT
	SELE IESIRI
	ZAP
	DO cursul
	Buton=1
	*do form bonmarfa1
	OB=CREA('BONvanz')
	OB.SHOW(1)
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	LOCAL NG
	NG=M.EXPLICATIA
	m.TOTTVAV=ROUND(M.TOTFTVA*(M.ctva-1),0)
	DO CONTABILIZEAZA WITH '411 ','707 ',M.TOTFTVA,CLASAACT
	m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	DO CONTABILIZEAZA WITH '411 ','4427',M.TOTTVAV,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH '607 ',C371ENDETAIL,M.TOTFTVA-M.TOTADAOS,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH C378ENDETAIL,C371ENDETAIL,M.TOTADAOS,CLASAACT
	m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	DO CONTABILIZEAZA WITH '4428',C371ENDETAIL,M.TOTTVAV,CLASAACT
	
	SELE CLIENTI
	*LOCA FOR ALLT(NUME)=ALLT(M.NUME)
	*IF found()
		SCAT FIEL COD_FISCAL MEMV
		IF flock()
			REPL PRODUCTIE WITH PRODUCTIE+M.TOTFTVA
		ENDIF
		UNLOCK
	*ENDIF
	
	m.TOTFTVAM=M.TOTFTVA
	m.TVAM=M.TOTTVAV
	m.TOTCTVA=M.TOTFTVAM+M.TVAM
	m.NEIMPOZAB=0
	DO ADVANZ
	
	DO IESTOCURIMAGAZII
	DO IERULAJMAGAZII
	
	Buton=2
	DO DANU WITH 'Doriti sa listati FACTURA?'
	IF Buton=1
		DO form datefact
		SELE RUL
		SELECT * FROM RUL WHERE COD=M.COD INTO TABLE &LOC\&NFSCURT\TEMPO\ARUL 
		USE IN RUL
		USE IN ARUL
		USE &LOC\&NFSCURT\TEMPO\ARUL IN 0 ALIAS RUL
		***
		SELECT RUL
		SET FILTER TO !empty(cante)
		*SET FILTER TO COD=M.COD AND CANTE#0
		REPORT FORM FACT TO PRINTER PROMPT PREVIEW
		DO TOTV
	ENDIF
	
	
	
	
	
	
	DO STERGE
	RETURN
ENDPROC && BAR_19_OF__0bb0p33cb_FB2P

PROCEDURE BAR_20_OF__0bb0p33cb_FB2P
	SELE calendar
	LOCA for nl=m.nl and an=m.an
	m.ctva=ctvam
	
	SELE FIRMA
	LOCA FOR NFSCURT=FSCURT
	SCAT MEMV
	FCOD_FISCAL=M.COD_FISCAL
	
	
	m.FDOC='FACTURA'
	m.NRACT=M.NRBON
	Buton=1
	OACT=CREATEOBJ('ACTGEN03RESP')
	OACT.SHOW(1)
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	
	
	SELE IESIRI
	ZAP
	DO cursul
	Buton=1
	*do form bonmarfa1
	local m.datafact,codfact
	m.datafact={}
	m.nract1=0
	codfact=0
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Nr.fact.din care se returneaza piese"
			.label1.caption="Nr.fact.:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
	*!*		Ointre=CREATEOBJECT("CAUTintre")
	*!*		WITH Ointre
	*!*			.CAPTION="Data fact.din care se returneaza piese"
	*!*			.label1.caption="Data.fact.:"
	*!*			.label2.visible=.f.
	*!*			.text1.controlsource="m.datafact"
	*!*			.text2.visible=.f.
	*!*		endwith
	*!*		ointre.show(1)
		
	
	sele actan
	loca for nract=m.nract1 and nume=m.nume
	if !found()
	do mesaj with 'Fact. '+allt(str(m.nract1))+' nu a fost introdusa.'
	return
	else
	codfact=cod
	*wait wind str(codfact)
	endif
	USE IN STOC
	sele *,0 as cants from rul where cod=codfact into cursor stoc 
	
	OB=CREA('BONvanzr')
	OB.SHOW(1)
	use in stoc
	do des with 'stoc'
	
	IF Buton=2
		DO STERGE
		RETURN
	ENDIF
	*******************************************
	DO CODARE
	m.nnir=m.NRACT
	LOCAL NG
	NG=M.EXPLICATIA
	m.TOTTVAV=ROUND(M.TOTFTVA*(M.ctva-1),0)
	DO CONTABILIZEAZA WITH '411 ','707 ',M.TOTFTVA,CLASAACT
	m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	DO CONTABILIZEAZA WITH '411 ','4427',M.TOTTVAV,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH '607 ',C371ENDETAIL,M.TOTFTVA-M.TOTADAOS,CLASAACT
	m.EXPLICATIA=NG
	DO CONTABILIZEAZA WITH C378ENDETAIL,C371ENDETAIL,M.TOTADAOS,CLASAACT
	m.EXPLICATIA='TVA '+ALLT(STR((M.ctva-1)*100))+'%'
	DO CONTABILIZEAZA WITH '4428',C371ENDETAIL,M.TOTTVAV,CLASAACT
	
	SELE CLIENTI
	LOCA FOR ALLT(NUME)=ALLT(M.NUME)
	IF found()
		SCAT FIEL COD_FISCAL MEMV
		IF flock()
			REPL PRODUCTIE WITH PRODUCTIE+M.TOTFTVA
		ENDIF
		UNLOCK
	ENDIF
	
	m.TOTFTVAM=M.TOTFTVA
	m.TVAM=M.TOTTVAV
	m.TOTCTVA=M.TOTFTVAM+M.TVAM
	m.NEIMPOZAB=0
	DO ADVANZ
	sele iesiri
	repl all cod with m.cod
	DO IESTOCURIMAGAZII
	DO IERULAJMAGAZII
	
	Buton=2
	DO DANU WITH 'Doriti sa listati FACTURA?'
	IF Buton=1
		DO form datefact
		SELE RUL
		SET FILTER TO COD=M.COD AND CANTE#0
		REPORT FORM FACT TO PRINTER PROMPT PREVIEW
	ENDIF
	
	
	
	
	
	
	DO STERGE
	RETURN
ENDPROC && BAR_20_OF__0bb0p33cb_FB2P

PROCEDURE BAR_1_OF__0bb0p33cc_FB2P
	osetviz.tbrprim.buton1.click
ENDPROC && BAR_1_OF__0bb0p33cc_FB2P

PROCEDURE BAR_3_OF__0bb0p33cc_FB2P
	osetgest.tbrprim.buton5.click
ENDPROC && BAR_3_OF__0bb0p33cc_FB2P

PROCEDURE BAR_1_OF__0bb0p96cz_FB2P
	osetgest.tbrprim.buton6.click
ENDPROC && BAR_1_OF__0bb0p96cz_FB2P

PROCEDURE BAR_2_OF__0bb0p96cz_FB2P
	
	sele rul
	set relation off into actan
	SET ORDER TO TAG Cod OF &calefirma\datean\actan.cdx IN Actan
	sele rul
	SET RELATION TO cod INTO Actan ADDITIVE
	SELE RUL
	SET FILTER TO
	SELE ACTAN
	SET FILTER TO
	SELE RULL
	SET FILTER TO
	*select DISTINCT rul.denumire,rul.pret,rul.um,rul.cant,rul.cante,rul.scd,rul.gest,actan.dataact,actan.nract,rul.cod,rul.tva;
	*	from rul,actan;
	*	where rul.cod=actan.cod;
	*	into cursor rullactanfact
	sele 0
	use &datean\rul again alias rullactanfact	
	do form afrul
	use in rullactanfact
ENDPROC && BAR_2_OF__0bb0p96cz_FB2P

PROCEDURE BAR_6_OF__0bb0p33cc_FB2P
	osetviz.tbrprim.butonfurn.click
ENDPROC && BAR_6_OF__0bb0p33cc_FB2P

PROCEDURE BAR_8_OF__0bb0p33cc_FB2P
	oge=create('afgest')
	oge.show(1)
ENDPROC && BAR_8_OF__0bb0p33cc_FB2P

PROCEDURE BAR_9_OF__0bb0p33cc_FB2P
	oluc=create('aflucrari')
	oluc.show(1)
ENDPROC && BAR_9_OF__0bb0p33cc_FB2P

PROCEDURE BAR_1_OF__0bb0pc0q9_FB2P
	*osetgest.tbrprim.buton3.click
	
	public m.nract1,m.nract2
	store 0 to m.nract1,m.nract2,M.SUM1,M.SUM2
	
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul NIR-ului"
			.label1.caption="Numarul NIR-ului:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
		
	*wait wind str(m.nract1)
	m.nnir=allt(str(m.nract1))
	*wait wind m.nnir
	
	sele rull
	set filter to
	go top
	loca for val(nnir)=val(m.nnir) and cant#0 and cante=0
	if !found()
	do mesaj with 'Nu a fost inregistrat nici un NIR','in luna curenta, cu numarul '+m.nnir
	return
	else
	sele rull
	scat fiel cod memv
	*wait wind str(m.cod)
	sele actan
	set filter to
	loca for cod=m.cod 
	if found()
	scat memv
	*wait wind 'act'+m.nnir
	endif
	loca for cod=m.cod and scc='767 '
	if found()
	do tva
	sele actan
	m.sum1=suma
	m.sum2=m.sum1*(m.ctva-1)
	else
	store 0 to m.sum1,m.sum2
	endif
	
	
	M.T='NIRURI'
	select distinct rull.denumire,rull.um,rull.cant,rull.cante,rull.pret,rull.gest,rull.nnir,rull.codmat,;
	act.nume,act.fdoc,act.nract,act.dataireg,act.dataact,RULL.pretv,rull.tva;
	from act,rull;
	where act.cod=rull.cod and rull.cod=m.cod and val(rull.nnir)=val(m.nnir) AND RULL.CANTE=0 and rull.cant#0;
	into table &LOC\&NFSCURT\tempo\ra 
	sele ra
	index on nnir+str(gest) tag ngest of &LOC\&NFSCURT\tempo\ra 
	sele ra
	set order to tag ngest
	
	SELE Ra
	*brow
	IF !NIR_STANDARD
	REPORT FORMAT NIRMATD.FRX TO PRINTER PROMPT NOCONSOLE PREVIEW 
	ELSE
	REPORT FORMAT NIRTOT.FRX TO PRINTER PROMPT NOCONSOLE PREVIEW 
	ENDIF
	
	sele ra 
	use
	endif
ENDPROC && BAR_1_OF__0bb0pc0q9_FB2P

PROCEDURE BAR_2_OF__0bb0pc0q9_FB2P
	public m.nract1,m.nract2
	store 0 to m.nract1,m.nract2,M.SUM1,M.SUM2
	
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul NIR-ului"
			.label1.caption="Nr.initial:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
	
	sele rull
	loca for val(nnir)=m.nract1
	if !found()
	do mesaj with 'Nu a fost inregistrat nici un NIR','in luna curenta, cu numarul '+allt(str(m.nract1))
	return
	endif
	
	
	
	sele actan
	set order to tag cod
	sele rul 
	set rela off into actan
	set relation to cod INTO Actan ADDITIVE
	sele rul 
	set filter to CANT#0 AND CANTE=0 and val(nnir)=m.nract1
	set order to tag dataact
	report form nirmarfnir to printer prompt preview
	
	set rela off into actan
ENDPROC && BAR_2_OF__0bb0pc0q9_FB2P

PROCEDURE BAR_4_OF__0bb0pc0q9_FB2P
	public m.nr
	m.nr=''
	OLIT=CREATEOBJECT("CAUTLITERE")
		WITH OLIT
			.CAPTION="Numarul notei:"
			.text1.controlsource="m.nr"
		endwith
		olit.show(1)
	
	sele rul
	loca for upper(allt(nnir))=upper(allt(m.nr))
	if !found()
	do mesaj with 'Nu a fost inregistrata nici o Nota','in luna curenta, cu numarul '+allt(m.nr)
	return
	else
	sele rul
	scat fiel cod,gest,nnir memv
	sele numegest
	loca for gest=m.gest
	scat fiel numegest memv
	sele rul
	set filter to cod=m.cod
	m.nract=m.nnir
	m.nnir='________________'
	report form nirmod to printer prompt preview
	sele rul
	set filter to 
	endif
ENDPROC && BAR_4_OF__0bb0pc0q9_FB2P

PROCEDURE BAR_1_OF_Bonuri_FB2P
	*osetgest.tbrprim.buton4.click
	PUBLIC M.T
	public m.nract1,m.nract2
	store 0 to m.nract1,m.nract2
	
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul bonului"
			.label1.caption="Nr.initial:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
		
	sele rull
	loca for val(rull.nnir)=m.nract1
	if !found()
	do mesaj with 'Nu a fost inregistrat nici un bon','cu numarul '+allt(str(m.nract1))
	return
	else
	M.T='BONURI'
	
	select DISTINCT rull.denumire,rull.um,rull.cante,rull.pretV,rull.gest,rull.nnir,rull.codmat,RULL.NRORD,RULL.PRET,;
	act.dataact,ACT.NUME_2 AS RESPONS,rull.scd,rull.cant;
	from act,rull;
	where act.cod=rull.cod and val(rull.nnir)=m.nract1 AND rull.CANTE # 0 AND RULL.CANT=0;
	into table &loc\&nfscurt\tempo\ra
	
	SELE Ra
	*SET FILTER TO (val(nnir)>=m.nract1) and (val(nnir)<=m.nract2) AND CANTE # 0
	INDEX ON str(GEST,2)+NNIR TO &LOC\&NFSCURT\tempo\ra
	IF !BON_ACHI
	REPORT FORMAT BONLI.FRX TO PRINTER PROMPT PREVIEW
	ELSE
	REPORT FORMAT BONCONS.FRX TO PRINTER PROMPT PREVIEW
	ENDIF
	endif
	use in ra
	
ENDPROC && BAR_1_OF_Bonuri_FB2P

PROCEDURE BAR_2_OF_Bonuri_FB2P
	PUBLIC M.T
	public m.nract1,m.nract2
	store 0 to m.nract1,m.nract2
	
	OLIT=CREATEOBJECT("CAUTLITERE")
		WITH OLIT
			.CAPTION="Numarul comenzii"
			.text1.controlsource="m.nrord"
		endwith
		olit.show(1)
		
	sele rull
	loca for UPPER(LEFT(nrord,LEN(M.nrord)))==M.nrord
	if !found()
	do mesaj with 'Nu exista nici un bon','la aceasta comanda.'	
	return
	endif
	
	M.T='BONURI'
	
	select DISTINCT rull.nrord,rull.denumire,rull.um,rull.cant,rull.cante,rull.pret,rull.gest,rull.nnir,rull.codmat,;
	act.dataireg,ACT.NUME_2 AS RESPONS,RULL.PRETV,rull.scd;
	from act,rull;
	where act.cod=rull.cod AND UPPER(LEFT(RULL.nrord,LEN(M.nrord)))==M.nrord AND RULL.CANTE # 0 AND RULL.CANT=0;
	into cursor ra
	
	SELE Ra
	*SET FILTER TO UPPER(LEFT(nrord,LEN(M.nrord)))==M.nrord AND CANTE # 0 AND CANT=0
	INDEX ON str(GEST,2)+NNIR TO &LOC\&NFSCURT\tempo\FFF
	*REPORT FORMAT bonlucrare.FRX TO PRINTER PROMPT PREVIEW
	
	IF !BON_ACHI
	REPORT FORMAT BONLI.FRX TO PRINTER PROMPT PREVIEW
	ELSE
	REPORT FORMAT BONCONS.FRX TO PRINTER PROMPT PREVIEW
	ENDIF
ENDPROC && BAR_2_OF_Bonuri_FB2P

PROCEDURE BAR_1_OF__0c6142tq6_FB2P
	PUBLIC M.T
	SET SAFETY OFF
	do caut_alf with "NUMEGEST","NUMEGEST","NUMELE GESTIUNII","M.NUMEGEST"
	SELE NUMEGEST
	SCAN
		IF NUMEGEST==M.NUMEGEST
			SCATTER MEMVAR
			EXIT
		ENDIF
	ENDSCAN
	
	sele stoc
	set filter to gest=m.gest
	set order to tag denumire
	SET DECIMALS TO 5
	report form stocdenpv to printer prompt preview
	
	sele stoc
	set filter to
ENDPROC && BAR_1_OF__0c6142tq6_FB2P

PROCEDURE BAR_1_OF_PeGestiuni_FB2P
	do caut_alf with "NUMEGEST","NUMEGEST","NUMELE GESTIUNII","M.NUMEGEST"
	SELE NUMEGEST
	SCAN
		IF NUMEGEST==M.NUMEGEST
			SCATTER MEMVAR
			EXIT
		ENDIF
	ENDSCAN
	***DO NCONT.SPR
	*SELE BAL
	*OSELCONT=CREATEOBJECT("SELCONT")
	*OSELCONT.SHOW(1)
	
	SELE stoc
	SET ORDER TO TAG denumire
	SET FILTER TO GEST=M.GEST 
	*AND SCD=subs(CN,1,4)
	REPORT FORMAT stocDEN.FRX TO PRINTER PROMPT NOCONSOLE PREVIEW
	* WINDOW WPRINT
ENDPROC && BAR_1_OF_PeGestiuni_FB2P

PROCEDURE BAR_2_OF_PeGestiuni_FB2P
	do caut_alf with "NUMEGEST","NUMEGEST","NUMELE GESTIUNII","M.NUMEGEST"
	SELE NUMEGEST
	SCAN
		IF NUMEGEST==M.NUMEGEST
			SCATTER MEMVAR
			EXIT
		ENDIF
	ENDSCAN
	***DO NCONT.SPR
	*SELE BAL
	*OSELCONT=CREATEOBJECT("SELCONT")
	*OSELCONT.SHOW(1)
	
	SELE stoc
	SET ORDER TO TAG CODMAT
	SET FILTER TO GEST=M.GEST 
	*AND SCD=subs(CN,1,4)
	REPORT FORMAT stocden.FRX TO PRINTER PROMPT NOCONSOLE PREVIEW
	* WINDOW WPRINT
ENDPROC && BAR_2_OF_PeGestiuni_FB2P

PROCEDURE BAR_1_OF_NewItem_FB2P
	store 0 to m.nract1
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul notei de transfer"
			.label1.caption="Nr. nota:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
	
	sele act
	loca for nract=m.nract1 
	if found()
	scat memv
	
	m.numegest=m.explicatia
	SELE RUL
	loca for cod=m.cod
	if !found()
	DO MESAJ WITH 'Nu exista aceasta nota de transfer',''
	return
	else
	SET FILTER TO cod=m.cod and !empty(cante)
	report form nirtransfer to printer prompt preview
	endif
	ELSE
	DO MESAJ WITH 'Nu exista aceasta nota de transfer',''
	endif
	sele act
	set filter to
ENDPROC && BAR_1_OF_NewItem_FB2P

PROCEDURE BAR_2_OF_NewItem_FB2P
	Store 0 To m.nract1
	Ointre=Createobject("CAUTintre")
	With Ointre
		.Caption="Numarul notei de transfer"
		.label1.Caption="Nr. nota:"
		.label2.Visible=.F.
		.text1.ControlSource="m.nract1"
		.text2.Visible=.F.
	Endwith
	Ointre.Show(1)
	
	Sele act
	Loca For nract=m.nract1 And scd='3712' And scc='3711'
	If Found()
		Scat Memv
	
		m.numegest=m.explicatia
	*!*	SELE RUL
	*!*	SET FILTER TO cod=m.cod and !empty(cante)
	*!*	report form nirtransfer to printer prompt preview
	*!*	ELSE
	*!*	DO MESAJ WITH 'Nu exista aceasta nota de transfer',''
	*!*	endif
	
	
		Select * From RUL Where COD=M.COD Into Table &LOC\&NFSCURT\TEMPO\ARUL
		Use In RUL
		Use In ARUL
		Use &LOC\&NFSCURT\TEMPO\ARUL In 0 Alias RUL
	***
		Select RUL
		Set Filter To !Empty(cante)
		Report Format NIRTRANSFER.FRX To Printer Prompt Preview
	*Endif
	Do TOTV
	
	Else
		Do MESAJ With 'Nu exista aceasta nota de transfer',''
	Endif
	
	sele act
	set filter to
ENDPROC && BAR_2_OF_NewItem_FB2P

PROCEDURE BAR_3_OF_NewItem_FB2P
	store 0 to m.nract1
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul notei de transfer"
			.label1.caption="Nr. nota:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
	
	sele act
	loca for nract=m.nract1 and scd='3711' and scc='3712'
	if found()
	scat memv
	
	m.numegest=m.explicatia
	*!*	SELE RUL
	*!*	SET FILTER TO cod=m.cod and !empty(cante)
	*!*	report form nirtransfer to printer prompt preview
	SELECT * FROM RUL WHERE COD=M.COD INTO TABLE &LOC\&NFSCURT\TEMPO\ARUL 
	USE IN RUL
	USE IN ARUL
	USE &LOC\&NFSCURT\TEMPO\ARUL IN 0 ALIAS RUL
	***
	SELECT RUL
	SET FILTER TO !empty(cante)
	REPORT FORMAT NIRTRANSFER.FRX TO PRINTER PROMPT PREVIEW
	*endif
	DO TOTV
	
	ELSE
	DO MESAJ WITH 'Nu exista aceasta nota de transfer',''
	endif
	sele act
	set filter to
ENDPROC && BAR_3_OF_NewItem_FB2P

PROCEDURE BAR_4_OF_NewItem_FB2P
	store 0 to m.nract1
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul notei de retur"
			.label1.caption="Nr. nota:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
	
	sele act
	loca for nract=m.nract1 
	if found()
	scat memv
	
	m.numegest=m.explicatia
	SELE RUL
	*SET FILTER TO cod=m.cod 
	sele rul.* from rul where cod=m.cod into table &dirgen\&nfscurt\tempo\ra
	sele ra
	repl all cante with -cante
	REPORT FORMAT RETUR.FRX TO PRINTER PROMPT PREVIEW
	else
	do mesaj with 'Nu a fost emisa nota cu nr.'+allt(str(m.nract1)),'in aceasta luna.'
	endif
	sele rul
	set filter to
ENDPROC && BAR_4_OF_NewItem_FB2P

PROCEDURE BAR_9_OF__0bb0p33cd_FB2P
	
	
	STORE 0 to m.nract1
	SELE calendar
	LOCA for nl=m.nl and an=m.an
	m.ctva=ctvam
	
	SELE FIRMA
	LOCA FOR NFSCURT=FSCURT
	SCAT MEMV
	FCOD_FISCAL=M.COD_FISCAL
	
	
	Ointre=CREATEOBJECT("CAUTintre")
	WITH Ointre
		.CAPTION="Numarul Documentului"
		.label1.caption="Nr. factura:"
		.label2.visible=.f.
		.text1.controlsource="m.nract1"
		.text2.visible=.f.
	ENDWITH
	Ointre.show(1)
	
	SELE act
	LOCA for nract=m.nract1
	IF found()
		SCAT memv
		SELE clienti
		LOCA for nume=m.nume
		IF found()
			SCAT fiel COD_FISCAL memv
		ELSE
			m.COD_FISCAL=''
		ENDIF
		SELE RUL
		SET FILTER TO cod=M.cod AND CANTE#0 and left(scd,3)='371'
		REPORT FORM FACTvanz TO PRINTER PROMPT PREVIEW
	ELSE
		DO mesaj with 'Factura '+allt(str(m.nract))+' nu este','inregistrata in aceasta luna!'
	ENDIF
ENDPROC && BAR_9_OF__0bb0p33cd_FB2P

PROCEDURE BAR_10_OF__0bb0p33cd_FB2P
	
	public m.delegat,m.bi,m.nrinmat
	store '' to m.delegat,m.bi,m.nrinmat
	store 0 to m.nract1
	sele calendar
	loca for nl=m.nl and an=m.an
	m.ctva=ctvam
	
	SELE FIRMA
	LOCA FOR NFSCURT=FSCURT
	SCAT MEMV
	FCOD_FISCAL=M.COD_FISCAL
	
	
	Ointre=CREATEOBJECT("CAUTintre")
		WITH Ointre
			.CAPTION="Numarul Documentului"
			.label1.caption="Nr. factura:"
			.label2.visible=.f.
			.text1.controlsource="m.nract1"
			.text2.visible=.f.
		endwith
		ointre.show(1)
	
	sele act
	loca for nract=m.nract1
	if found()
	scat memv
	sele clienti
	loca for nume=m.nume
	if found()
	scat fiel cod_fiscal memv
	else
	m.cod_fiscal=''
	endif
	SELE RUL
	SET FILTER TO COD=M.COD AND CANTE#0
	REPORT FORM FACT TO PRINTER PROMPT PREVIEW
	else
	do mesaj with 'Factura '+allt(str(m.nract))+' nu este','inregistrata in aceasta luna!'
	endif
ENDPROC && BAR_10_OF__0bb0p33cd_FB2P

PROCEDURE BAR_1_OF_Ajutor_FB2P
	OD=CREATEO('DESPRE')
	OD.SHOW(1)
ENDPROC && BAR_1_OF_Ajutor_FB2P

*</Procedures>
