PARAMETERS toXmf

IF TYPE('toXmf') # 'O'
	RETURN .f.
ENDIF 

lnLunaCrt = VAL(M.NL)
lnAnCrt = VAL(M.AN)
lnUzura = toXmf.uzura
IF toXmf.cota # 0 AND toXmf.codop <> 12 && conservare
&& toXmf.codop <> 12 conditie necesara  pt ca, deocamdata la calculul amortizarii tine cont de uzura si nu doar de cota
	lnUzPrec = toXmf.uzuraprec
	lnLunaPif=MONTH(toXmf.DATAPIF)
	lnAnPif=YEAR(toXmf.DATAPIF)
	UZ=IIF(lnAnCrt < lnAnPif, 0, 12*(lnAnCrt-lnAnPif)+lnLunaCrt-lnLunaPif)   &&  12*(an crt - an pif) + luna crt - luna pif
		
	if UZ=0 and lnUzPrec#0
		UZ=1
	ENDIF
	lnUzura = UZ+lnUzPrec
ENDIF 
RETURN lnUzura