Untitled

mail@pastecode.io avatar
unknown
php
10 days ago
2.4 kB
3
Indexable
Never
<?php

<?php

    $data_inicial = explode(' ', $info->invoice_start_date);//Data inicial leitura
    $data_final   = explode(' ', $info->invoice_end_date);//data final leitura

    $boleto_concessionaria = $info->invoice_barcode_number_line;
    $valor_concessionaria  = $info->billing_total_rs;
    $vencimento            = $info->invoice_due_date;//vencimento baseado na concessionaria

    $referencia = $info->emission_date;



    //Variaveis LIGHT

    $injetada_tusd 			= $info->energy_compensated_invoice_fp_kwh * $info->tariff_energy_injected_fp_ouc_mpt_tusd;
    $injetada_te   			= $info->energy_compensated_invoice_fp_kwh * $info->tariff_energy_injected_fp_ouc_mpt_te;
    $energia_fornecida_tusd = $info->energy_consumption_fp_tusd_kwh * $info->tariff_energy_consumption_fp_tusd;
    $energia_fornecida_te 	= $info->energy_consumption_fp_te_kwh * $info->tariff_energy_injected_fp_ouc_mpt_te;

    $tarifa 				= $info->tariff_energy_consumption_fp;

    $consumida = $info->energy_consumption_fp_te_kwh;
    $injetada = $info->energy_compensated_invoice_fp_kwh;



    //Variáveis CEMIG
    $t1 			= vp($info->tariff_energy_consumption_fp_te);
    $t2 			= vp($info->tariff_energy_consumption_fp_tusd);
    $t3 			= vp($info->tariff_energy_consumption_fp);
    $tarifa_com_imp = number_format(max( $t1 + $t2, $t3 ), 4, '.', '');

    $comp   		= vp($info->energy_compensated_invoice_fp_kwh);
    $cons   		= vp($info->energy_consumption_fp_te_kwh);
    $desc 			= $desconto_uc;

    $energia_scee 	= vp($info->energy_compensated_invoice_fp_kwh) * vp($info->tariff_energy_consumption_fp_te_wo_icms);
    $energia_scee   = number_format(vp($energia_scee), 4, '.', '');

    $energia_comp 	= vp($info->energy_compensated_invoice_fp_kwh) * vp($info->tariff_energy_injected_fp_exempt);
    $energia_comp 	= number_format("-$energia_comp", 2, '.', '');

    $sem_sunrent  	= number_format($tarifa_com_imp * $comp, 2, ',', '');

    $imposto 		= number_format($energia_scee + $energia_comp, 2, '.', '');


    $com_sunrent    = vp($sem_sunrent) * ( 1 - $desc / 100);
    $com_sunrent    = number_format($com_sunrent, 2, ',', '');
    


    $economia 		= vp($sem_sunrent) - vp($com_sunrent);
    $economia 		= number_format($economia, 2, ',', '');

    $consumida = $info->energy_compensated_invoice_fp_kwh;
    $injetada = $info->energy_compensated_invoice_fp_kwh;





?>
Leave a Comment