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.
72 lines
3.0 KiB
PHP
72 lines
3.0 KiB
PHP
<?php
|
|
include "../func_lib.php";
|
|
|
|
session_start();
|
|
if($_SESSION['validUser'] !== TRUE)
|
|
{
|
|
header("location: ./index.php");
|
|
exit();
|
|
}
|
|
echo "<style type='text/css'>";
|
|
echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}";
|
|
echo "table.tbl {width:750px;border-width:0 0 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}";
|
|
echo "table.tbl,table.tbl td {border-color:#000;border-style:solid;}";
|
|
echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}";
|
|
echo "body {font-size:9pt;}";
|
|
echo "div.luar{text-align:left;margin-left:150px;}";
|
|
echo ".header{font-weight:bold;text-align:center;}";
|
|
echo ".isi{text-align:left;}";
|
|
echo "</style>";
|
|
|
|
$startDate = decTgl($_POST['startDate']);
|
|
$endDate = decTgl($_POST['endDate']);
|
|
|
|
|
|
if(bukaKoneksi()){
|
|
global $conn;
|
|
$query = "select r.`tgl_retur`, r.`no_nota`, r.`kd_supplier`,s.nama_supplier, d.jum, d.tot, k.nama, r.`keterangan`
|
|
from m_retur_beli r,supplier s,karyawan k,
|
|
(select id_retur,sum(jumlah) jum,sum(jumlah*harga_satuan) tot from d_retur_beli group by id_retur) d
|
|
where tgl_retur between '$startDate' and '$endDate'
|
|
and r.kd_supplier = s.kd_supplier
|
|
and r.id_retur = d.id_retur
|
|
and r.nik = k.nik
|
|
and r.validasi = '1'";
|
|
if($stmt = mysqli_prepare($conn,$query)){
|
|
mysqli_stmt_execute($stmt);
|
|
mysqli_stmt_store_result($stmt);
|
|
$cek = mysqli_stmt_num_rows($stmt);
|
|
if($cek > 0){
|
|
mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdsup,$nama,$jum,$tot,$kary,$als);
|
|
$ttJumlah = array();
|
|
$ttJumlah['jml'] = 0;
|
|
$ttJumlah['rp'] = 0;
|
|
|
|
print("<center><div id=\"divprint\" >");
|
|
print("<h2>Laporan Rekap Retur Pembelian</h2><br/><br/>");
|
|
print("<div class=\"luar\">TOKO ".$_SESSION['namatoko']."<br/>");
|
|
print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."<br/>");
|
|
print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."</div><br/><br/>");
|
|
print("<table border=\"1\" class=\"tbl\">");
|
|
print("<tr class=\"header\"><td>Tanggal</td><td>No.Nota</td><td>Kode Supp.</td><td>Nama Supp.</td><td>Jumlah Brg.</td><td>Total</td><td>Assko</td><td>Alasan</td></tr>");
|
|
|
|
while(mysqli_stmt_fetch($stmt)){
|
|
$ttJumlah['jml'] += $jum;
|
|
$ttJumlah['rp'] += $tot;
|
|
print("<tr class=\"isi\"><td>".encTgl($tgl)."</td><td>.$nota</td><td>.$kdsup</td><td>$nama</td><td align=\"center\">$jum</td><td align=\"right\">".number_format($tot,0,',','.')."</td><td>$kary</td><td>$als</td></tr>");
|
|
}
|
|
|
|
print("</table><br/>");
|
|
print("<div class=\"luar\"><table border=\"0\">");
|
|
|
|
print("<tr><td>Total Jumlah Retur</td><td> : ".number_format($ttJumlah['jml'],0,',','.')."</td></tr>");
|
|
print("<tr><td>Total Rp Retur</td><td> : ".number_format($ttJumlah['rp'],0,',','.')."</td></tr>");
|
|
|
|
print("</table></div></div></center>");
|
|
}else{
|
|
echo "Tidak ada data retur untuk tanggal tersebut!";
|
|
}
|
|
}
|
|
}
|
|
?>
|