| 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/itapipoca18/modulos/almoxarifado/ |
Upload File : |
<?php
/**
* Criado por PhpStorm.
* Projeto: SGAE.
* Arquivo: entrada_edt.php.
* Usuário: RalpAlves
* Data: 25/09/2015
* Hora: 12:40
*/
$_SESSION['txt_usuario'];
$id_usu_ent = $_SESSION['idusu'];
$direito = $_SESSION['admin'];
$cod_id = $_GET['cod_id'];
$rsResult = mysql_query("SELECT * FROM v_lista_entrada where ent_id=$cod_id");
$row = mysql_fetch_array($rsResult);
$rsItens = mysql_query("SELECT * FROM v_lista_entrada_itens where aei_ent_id=$cod_id");
$ioc = mysql_fetch_array($rsResult);
?>
<head xmlns="http://www.w3.org/1999/html">
<script type="text/javascript">
$(document).ready(function () {
$('#tabela').DataTable({
"pagingType": "full_numbers", "lengthMenu": [[8, 25, 50, -1], [8, 25, 50, "Todos"]], stateSave: true, "oLanguage": {
"sProcessing": "Processando. Aguarde...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "NENHUM REGISTRO ENCONTRADO!",
"sInfo": "Mostrando _START_ até _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando 0 até 0 de 0 registros",
"sInfoFiltered": "(de _MAX_ registros no total)",
"sInfoPostFix": "",
"sSearch": "<em class='fa fa-search' title='pesquisar'></em>",
"sUrl": "",
"oPaginate": {
"sFirst": "<em class='fa fa-angle-double-left' title='primeiro registro'>",
"sPrevious": "<em class='fa fa-arrow-circle-left' title='registro anterior'></em>",
"sNext": "<em class='fa fa-arrow-circle-right' title='próximo registro'></em>",
"sLast": "<em class='fa fa-angle-double-right ' title='último registro'>"
}
}
});
});
</script>
<script type="text/javascript">
function excluir_registro(e) {
if (!confirm('Deseja realmente excluir este registro?')) {
if (window.event)
window.event.returnValue = false; else
e.preventDefault();
}
}
</script>
<script type="text/javascript" language="javascript">
function ins_lote(codCon) {
var Qtd = document.getElementById('vlote' + codCon).value;
$.ajax({
type: "GET", url: './modulos/almoxarifado/entrada_insnf.php?var=inslote&qtd=' + Qtd + '&codcon=' + codCon, dataType: "html", success: function (resultado) {
$('#LicCont').html(resultado);
//alert(resultado)
}
});
}
</script>
<script type="text/javascript" language="javascript">
function ins_vali(codDat) {
var Dat = document.getElementById('vvali' + codDat).value;
$.ajax({
type: "GET", url: './modulos/almoxarifado/entrada_insnf.php?var=insvali&dat=' + Dat + '&codcon=' + codDat, dataType: "html", success: function (resultado) {
$('#LicDat').html(resultado);
//alert(resultado)
}
});
}
</script>
<script type="text/javascript" language="javascript">
function atu_nf(codDat) {
$.ajax({
type: "GET", url: './modulos/almoxarifado/entrada_insnf.php?var=atunf&codcon=' + codDat, dataType: "html", success: function (resultado) {
$('#Licnf').html(resultado);
//location.reload ();
//alert (resultado)
}
});
}
</script>
<script>
function cont() {
var conteudo = document.getElementById('print').innerHTML;
tela_impressao = window.open('about:blank');
tela_impressao.document.write(conteudo);
tela_impressao.window.print();
tela_impressao.window.close();
}
</script>
</head>
<div id="print" class="container">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<button type="submit" id="#sign-up" name="bt_novo" class="btn botao_esquerda" onClick="location.href='?page=almoxarifado/entrada'">
<i class="fa fa-arrow-left" title="voltar"></i></button>
<span style="font-size:20px;"> Entradas - NF nº </span><b><?php echo $row['ent_nf'] ?></b>
<a href="#anda" onclick="Mudarestado('edt_nf')" class="link" title="editar numero da nota fiscal"><i class='fa fa-pencil text-green_grid'></i></a>
<a href="modulos/almoxarifado/rel_entrada_ficha.php?id=<?=$cod_id?>" target='_blank'>
<i class="glyphicon glyphicon-print text-print navbar-right" title="gerar PDF"></i>
</a>
</h3>
</div>
<div class="row">
<div class=" col-md-12 col-lg-12 col-xs-12">
<table class="table table-user-information">
<tbody>
<div class="panel-body" id='edt_nf' style="display: none;">
<form id="form2" name="form2" OnSubmit="showCarga()" id="frm_editar_nf" method="post" action="?page=./almoxarifado/entrada_crud&var_acao=editar_nf">
<input type="hidden" name="id_nf" value="<?php echo $row['ent_id'] ?>">
<input type="hidden" name="ent_nf" value="<?php echo $row['ent_nf'] ?>">
<div class="col-md-3 col-xs-12 col-lg-3">
<label>Editar número da nota fiscal</label>
<input type="text" name="ent_nf" required class="form-control" value="<?php echo $row['ent_nf'] ?>" maxlength="10">
</div>
<div class='col-xs-6 col-sm-2 com-md-2 col-lg-2'>
<lable for='bt_novo'> </lable>
<br>
<button type="submit" name="bt_novo" class="btn">Salvar</button>
</div>
</form>
</div>
<tr>
<td id="id_num"><b>ID:</b></td>
<?php echo "<td>" . $row['ent_id'] . "</td>" ?>
<td><b>Nº contrato:</b></td>
<?php echo "<td>" . $row['cpl_numproc_lic'] . "</td>" ?>
</tr>
<tr>
<td><b>Programa:</b></td>
<?php echo "<td>" . $row['prg_programa'] . "</td>" ?>
<td><b>Nº Ordem compra:</b></td>
<?php echo "<td>" . $row['odc_numordcomp'] . "</td>" ?>
</tr>
<tr>
<td><b>Fornecedor:</b></td>
<?php echo "<td>" . utf8_encode($row['pes_pessoa']) . "</td>" ?>
<td><b>Emissao:</b></td>
<?php echo "<td>" . utf8_encode($row['ent_nfdtemissao']) . "</td>" ?>
</tr>
<tr>
<td><b>Data:</b></td>
<?php echo "<td>" . utf8_encode($row['ent_data']) . "</td>" ?>
<td><b>Valor</b></td>
<?php echo "<td>" . number_format($row['total'], 2, ',', '.') . "</td>" ?>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="lista">
<div id="itens" class='panel panel-body panel-primary'>
<form id='frm_pesq' method='post'>
<div class="centro panel-body"><i class='fa fa-refresh' onclick="carrega()" style="cursor: hand;"></i></div>
<table class='tabe1 table table-striped table-hover dt-responsive' cellspacing='0' width='100%' border='0'>
<thead>
<tr>
<th>ID</th>
<th>Produto</th>
<th>Und.</th>
<th>Programa</th>
<th>Quant.</th>
<th>Vlr. Unt.</th>
<th>Total</th>
<th>Lote</th>
<th>Validade</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$numorc = $row['odc_numordcomp'];
$status = $row['ent_situ_ent'];
while ($rowi = mysql_fetch_array($rsItens)) {
$cod_id = $rowi['aei_id'];
$id_nf = $row['ent_id'];
$cod_nf = $rowi['aei_ent_id'];
$nf = $row['ent_nf'];
echo "<tr>";
echo "<td>" . $rowi['aei_id'] . "</td>";
echo "<td>" . $rowi['aei_pro_id'] . '-' . utf8_encode($rowi['pro_produto']) . "</td>";
echo "<td>" . $rowi['und_desc'] . "</td>";
echo "<td>" . $rowi['prg_programa'] . "</td>";
echo "<td>" . number_format($rowi['aei_pro_qtd'], 2, ',', '.') . "</td>";
echo "<td>" . number_format($rowi['aei_pro_vrunit'], 2, ',', '.') . "</td>";
echo "<td>" . number_format($rowi['total'], 2, ',', '.') . "</td>";
$total_nf += $rowi['total'];//somar totais da nota
if ($status=='1') {
echo "<td width='70px'>" . $rowi['aei_lote'] . "</td>";
} else {
$xlote = $rowi['aei_lote'];
echo "<td width='70px'>
<input type='text' value='$xlote' onblur='ins_lote($cod_id)' required name='txt_lote' id='vlote" . $cod_id . "' autofocus
class='form-control input-sm'>
</td>";
}
if ($status=='1') {
echo "<td width='75px'>" . $rowi['aei_dtvalidade'] . "</td>";
} else {
$xvali = $rowi['aei_dtvalidade'];
echo "<td width='75px'>
<input type='text' value='$xvali' onblur='ins_vali($cod_id)' required onKeyup='formataData(this,event);'
name='txt_validade'
id='vvali" . $cod_id . "' class='form-control input-sm'>
</td>";
}
if ($direito=='1') {
echo "<td><a class='janela50' href='index2.php?page=almoxarifado/entrada_item_edt&cod_id=$cod_id&cod_nf=$cod_nf&nf=$nf'> <em class='fa fa-pencil text-green_grid'
title='Editar registro'/></a></td>";
echo "<td><a href='?page=almoxarifado/entrada_crud&cod_id=$cod_id&cod_nf=$cod_nf&var_acao=excluir_item'> <em class='fa fa-trash text-red'
title='Excluir registro' onclick='excluir_registro(event);'/></a></td>";
} else {
echo "<td><a href='#'> <img src='img/not.png' width='16' title='sem permissão para excluir o registro'/></a></td>";
}
echo "</tr>";
}
if ($status==trim('0')) {
echo "
<div class='container centro logo'>
<button type='submit' name='bt_refresh' class='btn-primary' onclick='atu_nf($id_nf);location.reload ();'>
<i class='fa fa-check' title='salvar'></i> <b style='color: #000000;'>Lançar Nota Fiscal</b> </button>
</div>";
} else {
$xnf = $row['ent_nf'];
echo "
<div class='centro'>
<a style='color: #000000;' href='#' onclick='cont();'> Nota fiscal nº <b>$xnf</b> lançada.</a>
</div>";
}
?>
</tbody>
</table>
<?php
if (number_format($row['total'], 2, ',', '.')===(number_format($total_nf, 2, ',', '.'))) {
echo "<div>Total da entrada: R$ <b>" . number_format($total_nf, 2, ',', '.') . "</b></div>";
} else {
echo "<div style='color: red;'>Total da entrada: R$ <b>" . number_format($total_nf, 2, ',', '.') . "</b></div>";
}
?>
</form>
</div>
</div>
</div>
<script>
function carrega() {
location.reload();
}
</script>