Function verificare_luna_inchisa
Parameters tcMesaj
lcMesaj=tcMesaj+",deoarece luna este inchisa!"
If glLunaInchisa
	aMessagebox(lcMesaj,0+48,"Luna inchisa")
	Return .F.
Endif
Return .T.
Endfunc	&&	verificare_luna_inchisa
*************************************************************************************************************
Function get_prima_zi
PARAMETERS tnAn, tnLuna

LOCAL lnAn, lnLuna
STORE 0 TO lnAn, lnLuna

IF EMPTY(tnAn) OR TYPE('tnAn') # 'N'
	lnAn = gnAn
ELSE 
	lnAn = tnAn
ENDIF 

IF EMPTY(tnLuna) OR TYPE('tnLuna') # 'N'
	lnLuna = gnLuna
ELSE 
	lnLuna = tnLuna
ENDIF 

Return Date(lnAn,lnLuna,1)
Endfunc &&	get_prima_zi
*************************************************************************************************************
Function get_ultima_zi
PARAMETERS tnAn, tnLuna

LOCAL lnAn, lnLuna
STORE 0 TO lnAn, lnLuna

IF EMPTY(tnAn) OR TYPE('tnAn') # 'N'
	lnAn = gnAn
ELSE 
	lnAn = tnAn
ENDIF 

IF EMPTY(tnLuna) OR TYPE('tnLuna') # 'N'
	lnLuna = gnLuna
ELSE 
	lnLuna = tnLuna
ENDIF 

Return Gomonth(Date(lnAn,lnLuna,1),1)-1

Endfunc &&	get_ultima_zi
*************************************************************************************************************