$row[17] = number_format($billingItem->tarifaSobreExcedente, 6, ',', '.'); $row[18] = number_format($billingItem->fixo, 2, ',', '.'); $row[19] = number_format($billingItem->variavel, 2, ',', '.'); $row[20] = number_format($billingItem->acrescimoDesconto, 2, ',', '.'); $row[21] = number_format($receitaTotal, 2, ',', '.'); $row[22] = $parcelaAtual; $row[23] = $salesPersonName; InsereLinhaPlanilha($currentRow, $startColumn, $row); $grandTotal += $receitaTotal; // Soma a receita total do equipamento ( fixo mais variável ) } $currentRow++; $total = array('Total da Receita: ' . number_format($grandTotal, 2, ',', '.'), '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); InsereLinhaPlanilha($currentRow, $startColumn, $total, '80BB80FF', 45, PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $activeSheet->mergeCells(GetNameFromNumber($colNum + 0) . $currentRow . ':' . GetNameFromNumber($colNum + sizeof($headers) - 1) . $currentRow); } $objPhpExcel = new PHPExcel(); $activeSheet = $objPhpExcel->getActiveSheet(); $activeSheet->setTitle('Relatório de Faturamento'); ClearBackground('A1:AF999'); $activeSheet->setCellValue('B2', 'Relatório de Faturamento'); $styleArray = array('font' => array('bold' => true, 'size' => 25)); $activeSheet->getStyle('B2:C2')->applyFromArray($styleArray); unset($styleArray); $calendar = new Calendar(); $activeSheet->setCellValue('B4', 'Mês: ' . $calendar->GetMonthName($billingMonth) . ' ' . 'Ano: ' . $billingYear); BuildReportTable('B', '6'); $objWriter = PHPExcel_IOFactory::createWriter($objPhpExcel, "Excel5"); $objWriter->save('php://output'); // Fecha a conexão com o banco de dados $dataConnector->CloseConnection();
} // Cria os objetos de mapeamento objeto-relacional $billingDAO = new BillingDAO($dataConnector->mysqlConnection); $billingDAO->showErrors = 1; $mailingDAO = new MailingDAO($dataConnector->mysqlConnection); $mailingDAO->showErrors = 1; $contractDAO = new ContractDAO($dataConnector->mysqlConnection); $contractDAO->showErrors = 1; // Traz os faturamentos de acordo com o mês e ano de referência $mesFaturamento = ConfigDAO::GetConfigurationParam($dataConnector->mysqlConnection, "mesFaturamento"); $anoFaturamento = ConfigDAO::GetConfigurationParam($dataConnector->mysqlConnection, "anoFaturamento"); $billingArray = $billingDAO->RetrieveRecordArray("mesReferencia = '" . $mesFaturamento . "' AND anoReferencia = '" . $anoFaturamento . "'"); ?> <h1>Síntese de Faturamento (<?php $calendar = new Calendar(); echo $calendar->GetMonthName($mesFaturamento) . ' de ' . $anoFaturamento; ?> )</h1><br/> <h1><?php echo str_pad('_', 64, '_', STR_PAD_LEFT); ?> </h1> <div style="clear:both;"> <br/><br/> </div> <script type="text/javascript" > function OpenBillingReport(target) { var billingId = target.attr("rel"); var reportUrl = "Frontend/faturamento/imprimir.php";
<?php if (isset($sendToPrinter)) { echo 'window.print();'; } ?> }); </script> <div style="width:99%;height:99%; margin-top:12px; margin-left:auto; margin-right:auto; border:1px solid black;" id="pageBorder" > <div style="width:96%; margin-top:12px; margin-left:auto; margin-right:auto; border:1px solid black;" > <img src="http://www.datacount.com.br/Datacount/images/logo.png" alt="Datacopy Trade" style="width:150px; height:50px; margin-top:10px; margin-left: 10px; margin-right: 10px; float:left;" /> <div style="height:50px; margin-top:10px; margin-left: 50px; float:left;"> <h3 style="border:0; margin:0;" >RELATÓRIO DE MÃO DE OBRA</h3><br/> <h3 style="border:0; margin:0;" >Mês: <?php $calendar = new Calendar(); echo $calendar->GetMonthName($month); ?> Ano: <?php echo $year; ?> </h3> </div> <div style="clear:both;"><br/><br/></div> <hr/> <div style="clear:both;"><br/></div> <table> <tr bgcolor="YELLOW" style="height:30px;" ><td>Cliente</td><td>Nº Série Fabricante</td><td>Modelo</td><td>Fabricante</td><td>Número do Chamado</td><td>Tempo de Atendimento</td><td>Tempo Total Area Técnica</td><td>Valor Despesa (R$)</td></tr> <?php foreach ($laborExpenseArray as $laborExpense) { $serviceCall = $serviceCallDAO->RetrieveRecord($laborExpense->numeroChamado); $cliente = $laborExpense->nomeCliente;
} $currentRow++; $row = array(); $row[0] = $equipmentModelStats->model; $row[1] = $manufacturerName; $row[2] = $equipmentModelStats->equipmentCount; $row[3] = number_format($equipmentModelStats->revenue, 2, ',', '.'); InsereLinhaPlanilha($currentRow, $startColumn, $row); $equipCount = $equipCount + $equipmentModelStats->equipmentCount; $somaReceita = $somaReceita + $equipmentModelStats->revenue; } } $subTotal = array('', '', $equipCount, number_format($somaReceita, 2, ',', '.')); $currentRow++; InsereLinhaPlanilha($currentRow, $startColumn, $subTotal, '80AAFFFF', 20, PHPExcel_Style_Alignment::HORIZONTAL_CENTER); } $objPhpExcel = new PHPExcel(); $activeSheet = $objPhpExcel->getActiveSheet(); $activeSheet->setTitle('Relação entre custos e receitas'); ClearBackground('A1:AK1999'); $activeSheet->setCellValue('B2', 'Relação entre custos e receitas'); $styleArray = array('font' => array('bold' => true, 'size' => 25)); $activeSheet->getStyle('B2:C2')->applyFromArray($styleArray); unset($styleArray); $calendar = new Calendar(); $activeSheet->setCellValue('B4', 'Mês: ' . $calendar->GetMonthName($mesFaturamento) . ' ' . 'Ano: ' . $anoFaturamento); BuildReportTable('B', '6'); $objWriter = PHPExcel_IOFactory::createWriter($objPhpExcel, "Excel5"); $objWriter->save('php://output'); // Fecha a conexão com o banco de dados $dataConnector->CloseConnection();
<?php if (isset($sendToPrinter)) { echo 'window.print();'; } ?> }); </script> <div style="width:99%;height:99%; margin-top:12px; margin-left:auto; margin-right:auto; border:1px solid black;" id="pageBorder" > <div style="width:96%; margin-top:12px; margin-left:auto; margin-right:auto; border:1px solid black;" > <img src="http://www.datacount.com.br/Datacount/images/logo.png" alt="Datacopy Trade" style="width:150px; height:50px; margin-top:10px; margin-left: 10px; margin-right: 10px; float:left;" /> <div style="height:50px; margin-top:10px; margin-left: 50px; float:left;"> <h3 style="border:0; margin:0;" >RELATÓRIO DE FATURAMENTO</h3><br/> <h3 style="border:0; margin:0;" >Mês: <?php $calendar = new Calendar(); echo $calendar->GetMonthName($billingMonth); ?> Ano: <?php echo $billingYear; ?> </h3> </div> <div style="clear:both;"><br/><br/></div> <hr/> <div style="clear:both;"><br/></div> <table> <tr bgcolor="YELLOW" style="height:30px;" ><td>Cliente</td><td>Descrição Equipamento</td><td>Série Fabricante</td><td>Nosso Núm. Série</td><td>Medidor</td><td>Data Leitura</td><td>Medição Final</td><td>Medição Inicial</td><td>Consumo (com Acresc/Desc)</td><td>Franquia</td><td>Excedente</td><td>Tarifa sobre exced.</td><td>Fixo (R$)</td><td>Variável (R$)</td><td>Total (com Acresc/Desc)</td><td>Vendedor</td></tr> <?php $grandTotal = 0; foreach ($billingItemArray as $billingItem) { $equipment = $equipmentDAO->RetrieveRecord($billingItem->codigoCartaoEquipamento);
<label class="left">Parcela Atual<br/> <input type="text" name="parcelaAtual" size="10" value="<?php echo $contract->parcelaAtual; ?> " /> </label> <label class="left">Mês de Referência<br/> <input type="hidden" name="mesReferencia" value="<?php echo $contract->mesReferencia; ?> " /> <input type="text" readonly="readonly" size="20" value="<?php $calendar = new Calendar(); echo $calendar->GetMonthName($contract->mesReferencia); ?> " /> </label> <label class="left">Ano de Referência<br/> <input type="text" name="anoReferencia" readonly="readonly" size="20" value="<?php echo $contract->anoReferencia; ?> " /> </label> <label class="left">Quant. Parcelas<br/> <input type="text" name="quantidadeParcelas" size="10" value="<?php echo $contract->quantidadeParcelas; ?>