Parameters tParametri
*!*	obiecte globale
Private poLog, goLog, oTool, oHelp, goExecutor, goConn, goMyXMLHTTP, goCalendar, goExport, goUtilizator, goFundal, goFirma, goApp
Store "" To poLog, goLog, oTool, oHelp, goExecutor, goConn, goMyXMLHTTP, goCalendar, goExport, goUtilizator, goFundal, goFirma

*!*	Private gcLocalePath, goLocale
*!*	STORE "" TO gcLocalePath, goLocale

*!*	variabile globale
Public CRLF,CR,LF,Tab
Public gcNumeProgram, NUMEPROGRAM, MENIUPROGRAM, FUNDALPROGRAM
Public pcNl, pcAn, gcAcces, gcAppPath, gcAppName, gcUtilizatoriPath, gcDirMare, DIRGEN, gcTempPath, ;
	glParametri, gcHost, gcUsername, gcPassword, gcUserNameApp, gcPasswordApp, gnIdUtil, gnIdProgram, ;
	gnAn, gnLuna, gcS, gnIdFirma, gcGeneralIniFile, gcSecurityFile, gnHandle, gnButon, BUTON, gcFirma, gcBasePath, gcComunPath, ;
	gnTipGest, gcGestPermis, glFontCharSet, gcReportPreviewer, gcReportPreviewerPath, gcLocale, gcSettingsFile
Public gcAntet,gcCopyRight, pcTitlu
gcAntet = ''
pcTitlu = ''
gcCopyRight = '© ROA Romfast SRL'
Public glUltimaLuna, glPrimaLuna, glLunaBuna, glLuna_neplatita, glLunaInchisa
Public glQuit, pl_verificat
Public gnewcryptfll, gnewcryptxml, gTransferTotal
Private gnId_Prg_Owner
gnId_Prg_Owner = 0
*!*	altele
Declare nror[65000]
Declare RTVA[22,2]
Public luna_inchisa, luna_neplatita, PRIMADATA, m.ctva, m.ctvam, m.ctvai, antet, m.nivel
Public OStart,OSETVIZ,OSETTULBAR,OSETINSTRUM,orm,OTEXT,OJUR,osetgest,tlbr_INSTR,tlbr_VIZ,oprinc
Public pcapsocsub,pcapsocvar

_screen.Icon = 'D:\ROA\ROAACNPRO\GRAFICE\ROAACNPRO.ICO'


gcAppPath = UPPER(Addbs(Justpath(Sys(16,0))))
gcAppPath = STRTRAN(m.gcAppPath, 'PROGRAME\', '')
gcComunPath = gcAppPath + 'COMUN\CLASE;' + ;
	gcAppPath + 'COMUN\FERESTRE;' + ;	
	gcAppPath + 'COMUN\PROGRAME;' + ;
	gcAppPath + 'COMUN\GRAFICE;' + ;
	gcAppPath + 'COMUN\RAPOARTE;' + ;
    gcAppPath + 'COMUN\UTILE\CALENDAR;' + ;	
    gcAppPath + 'COMUN\UTILE\CTL32;' + ;	
	gcAppPath + 'COMUN\UTILE\HPDF;' + ;		
	gcAppPath + 'COMUN\UTILE\HPDF\REPORTOUTPUT;' + ;			
	gcAppPath + 'COMUN\UTILE\WEB;' + ;
	gcAppPath + 'COMUN\UTILE\NFJSON;' + ;	
	gcAppPath + 'COMUN\UTILE\NFXML;' + ;		
	gcAppPath + 'COMUN\UTILE\EXCEL;' + ;
	gcAppPath + 'COMUN\UTILE\GridExtras	;' + ;
	Addbs(Substr(gcAppPath,1,Rat([\],gcAppPath,2)))+[COMUNROA\]

Set Default To (m.gcAppPath)

SET PATH to (m.gcComunPath) ADDITIVE 
Set Procedure To roa.prg Additive
Private goApp

On Shutdown do onShutDown

goApp = Createobject("oApp")
If goApp.initializeaza(tParametri,[ROAACNPRO])
	goApp.lanseazaAplicatie()
	
	* STATUSBAR APLICATIE
	If Not Pemstatus(_Screen,"StatusBar", 5) Then
		_Screen.Newobject("StatusBar","ctl32_statusbar", "ctl32_statusbar.vcx", null, 3)
	*	_Screen.Newobject("StatusBar","ctl32_statusbar", "ctl32_statusbar_fals.vcx", null, 3)	&& inlocuieste cu ctl_32_statusbar_fals.vcx daca sunt probleme
	ENDIF
	IF TYPE('goFundal') = 'O'
		IF NOT PEMSTATUS(goFundal, "oStatusBar", 5) then
			ADDPROPERTY(goFundal, "oStatusBar", Null)
		ENDIF 
		goFundal.oStatusBar = _Screen.StatusBar
		goFundal.oStatusBar.ctlIcon="roastartmic.ico"
		goFundal.oStatusBar.ctlMessage = _Screen.Caption
		* formularul fundal.scx trebuie sa aiba o metoda StatusBarClick
		BindEvent(goFundal.oStatusBar, [ctlClick], goFundal, [StatusBarClick]) && Thisform.oStatusBar.newtooltip()
	ENDIF 	
Endif

READ EVENTS

*Release goApp



Define Class oApp As RoaApp

	Procedure initializeazaAlteCai
	Endproc

	Procedure initializeazaAlteClassLib
		SET CLASSLIB TO ofacturare_comun.vcx ADDITIVE 
		SET CLASSLIB TO onom_curs.vcx ADDITIVE 
		SET CLASSLIB TO oacnpro.vcx ADDITIVE 
		SET CLASSLIB TO comun.vcx ADDITIVE 
		SET CLASSLIB TO serii_numere.vcx ADDITIVE 
		SET CLASSLIB TO onom_articole.vcx ADDITIVE 
		SET CLASSLIB TO overificari.vcx ADDITIVE 
	Endproc

	Procedure initializeazaAlteProceduri
		SET PROCEDURE TO proceduri_acnpro.prg ADDITIVE 
		SET PROCEDURE TO proceduri_acnpro_rapoarte.prg ADDITIVE 
		SET PROCEDURE TO ofacturare.prg ADDITIVE 
		SET PROCEDURE TO ofacturare_comun ADDITIVE 
		SET PROCEDURE TO oserii_numere ADDITIVE 
		SET PROCEDURE TO oproceduri_curs ADDITIVE
		SET PROCEDURE TO odocumente.prg ADDITIVE 
		SET PROCEDURE TO email.prg ADDITIVE 
		SET PROCEDURE TO oproceduri_rapoarte_fact.prg ADDITIVE 
		SET PROCEDURE TO matxtab.prg ADDITIVE 
		SET PROCEDURE TO nfxmlread.prg ADDITIVE 
		SET PROCEDURE TO nfjsonread.prg ADDITIVE 
		SET PROCEDURE TO xmlefactura.prg ADDITIVE 		
	Endproc

	Procedure initializeazaAlteVariabileGlobale
	Endproc

	Procedure initializeazaAlteObiecteGlobale
	Endproc

ENDDEFINE

*!*	Function Shutdown
*!*	If Type("goApp")=="O" And Not Isnull(goApp)
*!*		Return goApp.OnShutDown()
*!*	Endif
*!*	Cleanup()
*!*	Quit
*!*	Endfunc


*-- Occurs when the user attempts to exit Visual FoxPro.
Procedure onShutDown
	IF AMESSAGEBOX('Doriti sa iesiti din program?',4+32, goApp.cNumeProgram) = 6
		On Shutdown
		On Error
		Clear Events
		If _vfp.StartMode <> 0
			Quit
		Endif
	Endif
ENDPROC && onShutDown