You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
8.0 KiB
PHP

<?php
session_start();
if($_SESSION['validUser'] !== TRUE)
{
header("location: ./index.php");
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>:: Pengadaan Barang</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/css.css" />
<link rel="stylesheet" type="text/css" href="../css/jqModal.css" />
<link rel="stylesheet" type="text/css" href="../css/dialogcustom.css" />
<link rel="stylesheet" type="text/css" href="../css/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="../css/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="../css/superfish.css" media="screen ">
<script type="text/javascript" src="../js/superfish.js"></script>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jquery-ui.min.js"></script>
<script type="text/javascript" src="../js/jqModal.js"></script>
<script type="text/javascript" src="../js/jquery.form.js"></script>
<script type="text/javascript" src="../js/jquery.visibility.js"></script>
<script type="text/javascript" src="../js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="../js/shortcut.js"></script>
<script type="text/javascript" src="../js/barcoding.js"></script>
<script type="text/javascript" src="../js/returnew.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#pencarian2').dialog({
modal:true,
autoOpen: false,
width: 500,
height: 400,
overlay: {
opacity: 0.5,
background: "black"
},
buttons: {
"Cari": function() {
var postvars = {
no:$("#txtcari").val(),
tglawal:$("#startDate").val(),
tglakhir:$("#endDate").val(),
valid: 1
};
$.post('retur_cari_nota.php', postvars, function(data) {
var nota = eval('('+data+')');
var tabel = "<table width=100% border='0' style='background-color:#000; text-align:center;'>"
+ "<tr style='background-color:#000; color:#FFF; font-weight:bold;'><td width=5%>No.</td><td width=20%>No Faktur</td><td width=20%>Tgl Retur</td><td width=30%>Keterangan</td><td width=10%>NIK</td><td width=20%>Rp</td></tr>";
var chasil = 1;
for(i in nota) {
tabel += "<tr style='background-color:#FFF;'><td>"+chasil+"</td><td><a href=\"javascript:setNoFaktur('"+nota[i].id_retur+"','"+nota[i].no_nota+"','"+nota[i].tgl_retur+"','"+nota[i].keterangan+"','"+nota[i].nik+"','"+nota[i].total_retur+"','"+nota[i].kdsupp+"','"+nota[i].jml_item+"')\">"+nota[i].no_nota+"</a></td><td>"+nota[i].tgl_retur+"</td><td>"+nota[i].keterangan+"</td><td>"+nota[i].nik+"</td><td>"+nota[i].total_retur+"</td></tr>";
chasil++;
}
tabel += "</table>";
$("#hasil2").html(tabel);
});
},
"Tutup": function() {
$(this).dialog('close');
}
}
});
$('#carinota').click(function(){
$("#txtcari").val("");
$("#startDate").val("");
$("#endDate").val("");
$("#hasil2").html("");
$('#pencarian2').dialog('open');
return false;
});
});
function setNoFaktur(id, no, tgl, ket, nik, total, kdsupp, jitem)
{
$('#nonota').val(no);
$('#tanggal').val(tgl);
$('#ketretur').val(ket);
$('#nik').val(nik);
$('#totalretur').val(total);
$('#idretur').val(id);
$('#supp').val(kdsupp);
$('#jumlahretur').val(jitem);
// document.getElementById("tblreturdetil").style.visibility = "visible";
// document.forms["frmretur"].btnprint.style.visibility = "visible";
ambilBarang(id, 'print');
$("#detiltransfer").empty();
$('#pencarian2').dialog('close');
$('#btnprint').enabledBtn();
}
// function setNoFaktur(id, tgl, asal, tujuan, diskon, jml_item, total_retur, faktur_oper)
// {
// $('#tglretur').val(tgl);
// $('#idretur').val(id);
// $('#fakturoper').val(faktur_oper);
// $('#tokoasal').val(asal);
// $('#tokotujuan').val(tujuan);
// $('#diskon').val(diskon);
// $('#jumlahoper').val(jml_item);
// $('#totaloper').val(total_retur);
// $("#detilretur").empty();
// setNol();
// ambilBarang(id, 'print');
// $('#pencarian2').dialog('close');
// $('#btnprint').enabledBtn();
// }
</script>
</head>
<body>
<div id="content">
<div class="headermenu">
<p id="top">Cleopatra Minimarket</p>
</div>
<div class="c_content">
<?php include "./menu.php"; ?>
<div id="body_content">
<form action="" method="post" name="frmtransfer" id="frmtransfer">
<fieldset>
<legend class="flegend">Retur Pembelian - Print</legend>
<table width="100%" border="0" name="tblreturmaster">
<tr>
<td style="width:120px;">ID Retur</td>
<td>: <input type="text" name="idretur" id="idretur" value="" size="12" readonly="readonly"/>
<input type="button" id="carinota" value="cari" name="btncari"/>
</td>
<td style="width:120px;">Kode Supplier</td><td>: <input type="text" name="supp" id="supp" size="30" readonly="readonly"/></td>
</tr>
<tr>
<td style="width:120px;">Tanggal Retur</td><td>: <input type="text" name="tglretur" id="tanggal" size="12" readonly="readonly" value="<?php echo date('d-m-Y');?>"/>
</td>
<td style="width:120px;">NIK</td><td>: <input type="text" name="nik" value="<?php echo $_SESSION[nik]?>" id="nik" readonly="readonly" size="10" /></td>
</tr>
<tr>
<td style="width:120px;">No.Faktur Retur</td><td>: <input type="text" name="nonota" id="nonota" value="" readonly="readonly"/></td>
<td>Keterangan</td><td>: <input type="text" name="ketretur" id='ketretur' value="" size="30" readonly="readonly"/></td>
</tr>
<tr>
<td>Total Retur</td><td>: <input type="text" name="totalretur" id="totalretur" value="0" size="20" readonly="readonly"/></td>
</tr>
<tr>
<td>Jumlah Item Retur</td><td>: <input type="text" name="jumlahretur" id="jumlahretur" value="0" size="12" readonly="readonly"/></td>
</tr>
</table>
<br/>
<table id="tbltransferdetil" width="100%" border="0" cellpadding="3" style="visibility:hidden; font-size:1em; background-color:#000;">
<tr style='color:#FFFFFF;'>
<td width="12%" align="center">KODE BARANG</td>
<td width="12%" align="center">KODE ASLI</td>
<td width="20%" align="center">NAMA BARANG</td>
<td align="center" width="15%">HARGA SATUAN BELI</td>
<td align="center" width="8%">STOK KOMP</td>
<td align="center" width="8%">JML RETUR</td>
</tr>
</table>
<div id="detiltransfer"></div>
<br/>
<input type="button" value="Print" id="btnprint" name="btnprint" style="visibility:hidden;"/>
</fieldset>
</form>
</div>
</div>
<div class="footer">
<?php include ("../footer.php");?>
</div>
</div>
<!-- dialog -->
<div id="confirmDialog" title="Konfirmasi !">
<p id='confirmMsg'></p>
</div>
<div id="alert" title="Peringatan !">
<p id='alertmsg'></p>
</div>
<div id="pencarian2" title="Pencarian Retur Pembelian">
<table>
<tr>
<td>ID Retur</td><td>:</td><td><input type="text" name="" size="30" id="txtcari"/></td>
</tr>
<tr>
<td>Rentang Tanggal</td><td>:</td>
<td>
<input type="text" size="10" value="" id="startDate"/> s/d <input type="text" size="10" value="" id="endDate"/>
<script type="text/javascript">
function customRange(input) {
return {minDate: (input.id == "endDate" ? $("#startDate").datepicker("getDate") : null),
maxDate: (input.id == "startDate" ? $("#endDate").datepicker("getDate") : null)};
}
</script>
</td>
</tr>
</table>
<fieldset>
<legend>Hasil pencarian</legend>
<div id="hasil2"></div>
</fieldset>
</div>
<span id='idx' style='display:none;'>0</span>
<span id='barisSekarang' style='display:none;'>0</span>
<span id='jbaris' style='display:none;'>0</span>
<span id='banyakData' style='display:none;'>0</span>
</body>
</html>