PHP code example of librecodecoop / impostos
1. Go to this page and download the library: Download librecodecoop/impostos library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
librecodecoop / impostos example snippets
$bruto = 5000;
$ano = 2024;
$mes = 1;
$dependentes = 0;
$inss = (new INSS($ano))->calcula($bruto);
$IRPF = new IRPF($ano, $mes);
$base = $IRPF->calculaBase($bruto, $inss, $dependentes);
$paraReter = $IRPF->calcula($base, $dependentes);
$tipoDeducaoAtual = $IRPF->getTipoDeducao();
echo "INSS: R$ $inss\n";
echo "Base de cálculo IRPF: R$ $base\n";
echo "Tipo de dedução atual: $tipoDeducaoAtual\n";
echo "Será retido o valor de: R$ $paraReter\n";