Period Init Amortization End ';
switch($metodo){
case 'L':
// Amortización lineal
$_amortizacion_anual=($inicio-$fin)/$years;
for($i=0;$i<$years;$i++){
$result.='P.'.($i+1).' '.number_format(($inicio-($i*$_amortizacion_anual)),2,'.',',').' '.number_format($_amortizacion_anual,2,'.',',').' '.number_format(($inicio-(($i+1)*$_amortizacion_anual)),2,'.',',').' ';
}
break;
case 'C':
$total=0;
for($i=0;$i<$years;$i++){
$total=$total+($i+1);
}
$pre=$inicio;
for($i=0;$i<$years;$i++){
$amortizacion=($inicio-$fin)*(($i+1)/$total);
$result.='P.'.($i+1).' '.number_format($pre,2,'.',',').' '.number_format($amortizacion,2,'.',',').' '.number_format(($pre-$amortizacion),2,'.',',').' ';
$pre=($pre-$amortizacion);
}
break;
case 'D':
$total=0;
for($i=0;$i<$years;$i++){
$total=$total+($i+1);
}
$pre=$inicio;
for($i=$years;$i>0;$i--){
$amortizacion=($inicio-$fin)*(($i)/$total);
$result.='P.'.($years-$i+1).' '.number_format($pre,2,'.',',').' '.number_format($amortizacion,2,'.',',').' '.number_format(($pre-$amortizacion),2,'.',',').' ';
$pre=($pre-$amortizacion);
}
break;
case 'T':
$tanto_fijo=1-pow(($fin/$inicio),(1/$years));
$pre=$inicio;
for($i=0;$i<$years;$i++){
$amortizacion=$tanto_fijo*(pow(1-$tanto_fijo,($i)))*$inicio;
$result.='P.'.($i+1).' '.number_format($pre,2,'.',',').' '.number_format($amortizacion,2,'.',',').' '.number_format(($pre-$amortizacion),2,'.',',').' ';
$pre=($pre-$amortizacion);
}
break;
}
$result.='';]]>
Moonsoft Software Solutions www.moonsoft.es
THIS IS A CALCULATOR EXAMPLE BY MOONSOFT
Amortization refers to expensing the acquisition cost minus the residual value of intangible assets (often intellectual property such as patents and trademarks or copyrights) in a systematic manner over their estimated useful economic lives so as to reflect their consumption, expiration, obsolescence or other decline in value as a result of use or the passage of time.
]]>Init Value | ##inicio## | End Value | ##fin## | |
Method | ##metodo## | Years | ##years## |
Amortization results
##result##
]]>