| Server IP : 20.75.53.88 / Your IP : 216.73.217.72 [ Web Server : Apache System : Linux VMRALP-3 4.4.0-256-generic #290~14.04.1-Ubuntu SMP Thu Jun 20 09:24:50 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29+esm15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Domains : 3 Domains MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/merenda/vicosa21/modulos/remessa/ |
Upload File : |
<?php
/**
* Criado por PhpStorm.
* Projeto: SGAE.
* Arquivo: remessaavulsa_edt.php.
* Usuário: RalpAlves
* Data: 19/07/2015
* Hora: 16:10
*/
session_start();
$prefeitura = $_SESSION['prefeitura'];
$cod_id = $_GET['cod_id'];
// $rs_remi = mysql_query("SELECT * FROM v_lista_remessa_avulsa_item WHERE pro_produto<>'-0' and pro_produto<>'-999' GROUP by pro_id order by pro_produto");
$rs_remi = mysql_query("SELECT * FROM v_lista_prod ORDER BY pro_produto");
//$rs_prd = mysql_query("SELECT * FROM v_lista_produtos_licitados WHERE qtd_entradanf OR qtd_implantacao OR qtedevol IS NOT NULL order by pro_produto");
$rs_und = mysql_query("SELECT * FROM unidade WHERE und_ativo='1'");
?>
<body>
<head>
<title> | Saldo</title>
<script>
function cont() {
var conteudo = document.getElementById('print').innerHTML;
tela_impressao = window.open('Saldo de produtos');
tela_impressao.document.write(conteudo);
tela_impressao.window.print();
tela_impressao.window.close();
}
</script>
</head>
<!--FORMULARIO-->
<body style="margin-top: 55px;"/>
<div id='print' class='container'>
<div class="container panel panel-primary">
<div class="panel-body">
<!-- <p style="font-size:17px;">--><?php //echo $prefeitura ?><!--</p>-->
<SPAN style="font-size:18px;">Saldo de Produtos</SPAN>
<a href="modulos/remessa/remessa_saldo_pdf.php?cod_id=<? echo $cod_id ?>"
target='_blank'> <i class="glyphicon glyphicon-print text-print navbar-right" title="Imprimir saldo"></i>
</a>
</div>
</div>
<!--ITENS DA REMESSA-->
<div class="container">
<div class="row">
<div class="panel panel-body panel-primary">
<table class='tabe1 table table-striped table-hover dt-responsive' cellspacing='0' width='100%' border='0'>
<thead>
<tr>
<!-- <th>ID</th>-->
<th style="text-align: left; font-size: 12px;" width="55%">Produto</th>
<th style="text-align: left; font-size: 12px;" width="2%">Unidade</th>
<th style="font-size: 12px;" class='direita'>Entradas</th>
<th style="font-size: 12px;" class='direita'>Saídas</th>
<th style="font-size: 12px;" class='direita'>Perca</th>
<th style="font-size: 12px;" class='direita'>Doação</th>
<th style="font-size: 12px;" class='direita'>Saldo</th>
<th style="font-size: 12px;" class='direita'>Unit.</th>
<th style="font-size: 12px;" class='direita'>R$</th>
</tr>
</thead>
<tbody>
<?php
$totalgeral = 0;
while ($row_rsResult = mysql_fetch_array($rs_remi)) {
$id_ite = $row_rsResult['rai_id'];
$id_rem = $rs_rmav['ra_id'];
$cod_pd = $row_rsResult['pro_id'];
//GERA O SALDO DOS PRODUTOS
$rs_entra = mysql_query("SELECT * FROM v_lista_saldo_entradas where pro_id=$cod_pd");
$entra = mysql_fetch_array($rs_entra);
$rs_perca = mysql_query("SELECT * FROM v_saldo_percas where imi_codprod=$cod_pd");
$s_per = mysql_fetch_array($rs_perca);
$rs_doacao = mysql_query("SELECT * FROM v_saldo_doacao where id_produto=$cod_pd");
$s_doa = mysql_fetch_array($rs_doacao);
$toent = $entra['qtd_entra_implam'] + $entra['qtd_entra_nf'];
$saida = ($entra['qtd_sai_rem_car'] + $entra['qtd_sai_rem_avu'] + $s_per['quantidade']);
$tosal = ($entra['qtd_entra_implam'] + $entra['qtd_entra_nf']) - ($entra['qtd_sai_rem_car'] + $entra['qtd_sai_rem_avu'] + $s_per['quantidade'] + $s_doa['qtd_doacao']);
$toval = ($row_rsResult['aei_pro_vrunit'] * $entra['qtd_entra_nf']);
echo "<tr>";
// echo "<td>" . $row_rsResult['rai_id'] . "</td>";
echo "<td style='font-size: 15px;font-weight: bold;'>" . utf8_encode($row_rsResult['pro_produto']) . '-' . $row_rsResult['pro_id'] . "</td>";
echo "<td style='font-size: 15px;'>" . $row_rsResult['und_desc'] . "</td>";
echo "<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($toent, 2, ',', '.') . "</td>";
echo "<td style='color: #920826; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($saida, 2, ',', '.') . "</td>";
echo "<td style='color: #d00a36; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($s_per['quantidade'], 2, ',', '.') . "</td>";
echo "<td style='color: #d00a36; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($s_doa['qtd_doacao'], 2, ',', '.') . "</td>";
if ($tosal > 0) {
echo "<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($tosal, 2, ',', '.') . "</td>";
} else {
echo "<td class='danger' style='color: red; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($tosal, 2, ',', '.') . "</td>";
}
if ($tosal > 0) {
echo "<td class='primary' style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($row_rsResult['aei_pro_vrunit'], 2, ',', '.') . "</td>";
} else {
echo "<td class='primary' style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . '0,00' . "</td>";
}
if ($tosal > 0) {
echo "<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . number_format($toval, 2, ',', '.') . "</td>";
} else {
echo "<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'>" . '0,00' . "</td>";
}
if ($tosal > 0) {
$totalgeral += $toval;
}
}
?>
</tbody>
<tfoot>
<td style='color: darkgreen; font-weight: bold; text-align: right; font-size: 15px;'> <?php echo 'Total Geral R$ ' . number_format($totalgeral, 2, ',', '.') ?> </td>
;
</tfoot>
</table>
</div>
</div>
</div>
</div>
</body>