$dados->valor_royalties = (double) $dados->valor_royalties + (double) $num_royalties;
     $dados->valor_propaganda = (double) $dados->valor_propaganda + (double) $num_propaganda;
     $dados->faturamento = (double) $dados->faturamento + (double) $num_fat;
     $num_royalties = number_format($num_royalties, 2, ".", "");
     $num_propaganda = number_format($num_propaganda, 2, ".", "");
     $num_fat = number_format($num_fat, 2, ".", "");
     #dados
     $worksheet->write($linha, 0, $dia, $stylecenter);
     $worksheet->write($linha, 1, $num_fat, $stylereal);
     $worksheet->write($linha, 2, $num_royalties, $stylereal);
     $worksheet->write($linha, 3, $num_propaganda, $stylereal);
     $worksheet->write($linha, 4, '', $stylebg);
     $dia++;
 }
 if ($imposto != 0 and $imposto != '') {
     $despesa = $relatorioDAO->despesasServicoRoyalties($emp->id_empresa, $ano_mes);
     $dados->despesa = $despesa->total;
 } else {
     $despesa->total = 0;
 }
 #apuração dos royalties
 $t_sub_pagar = (double) ((double) $t_num_fat - (double) ((double) $t_num_fat / 100 * (double) $imposto)) - (double) $despesa->total;
 $t_pagar = (double) ((double) $t_sub_pagar / 100) * (double) $royalties;
 #valor por semestre
 $semestre = 0;
 $semestre_ext = '';
 $semestre_fixo = '';
 $semestre_4m = 0;
 if ($emp->sem1 != '0.00' and (double) $t_num_fat <= (double) '50000.00') {
     $data_sem1 = date("Y-m-d", mktime(0, 0, 0, $ano_mes_exp[1] - 6, 15, $ano_mes_exp[0]));
     $data_sem2 = date("Y-m-d", mktime(0, 0, 0, $ano_mes_exp[1] - 12, 15, $ano_mes_exp[0]));