Initial: flux text FoxBin2Prg (git urmareste .??2 in-arbore, binarele VFP git-ignored)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
28
Programe/Vechi/calcamort.prg
Normal file
28
Programe/Vechi/calcamort.prg
Normal file
@@ -0,0 +1,28 @@
|
||||
local cond,c,t,i,a,m.amortlun
|
||||
cond='month(datapif)=val(m.nl) and year(datapif)=val(m.an) and uzuraprec=0'
|
||||
sele mf
|
||||
scan
|
||||
do case
|
||||
case UPPER(left(tipamort,1))='L'&&LINIARA
|
||||
repl amortlun with IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,ROUND((valoare-AMORTprec)/(normat-UZURA+1),0)))
|
||||
repl amortan with amortlun*12
|
||||
case UPPER(left(tipamort,1))='A'&&ACCELERATA
|
||||
IF (P>0 AND P<=0.5) AND UZURA<=12
|
||||
repl amortlun with IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,ROUND(valoare*P/12,0)))
|
||||
ELSE
|
||||
repl amortlun with IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,ROUND((valoare*(1-p))/(normat-12),0)))
|
||||
ENDIF
|
||||
repl amortan with amortlun*12
|
||||
case UPPER(left(tipamort,1))='D'&&DEGRESIVA
|
||||
if mod(uzura,12)=1
|
||||
c=12*k/normat
|
||||
repl amortan with iif(uzura>normat,0,round((valoare-amortprec)*c,0))
|
||||
if amortan<12*valoare/normat
|
||||
repl amortan with iif(uzura>normat,0,(valoare-amortprec)/(normat/12-round(uzura/12,0)))
|
||||
endif
|
||||
endif
|
||||
|
||||
REPL AMORTLUN WITH IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,round(amortan/12,0)))
|
||||
ENDCASE
|
||||
repl amorttot with amortprec+amortlun
|
||||
endscan
|
||||
Reference in New Issue
Block a user