Esempio n. 1
0
}
function getstokminusreturjual($nofaktur, $kode)
{
    $query = "SELECT sum(jumlah) as jumlahretur FROM pos_penjualanreturdetail where nofaktur='{$nofaktur}' and kodebarang='{$kode}'";
    $hasil = mysql_query($query);
    $data = mysql_fetch_array($hasil);
    $jumlahretur = $data['jumlahretur'];
    $query2 = "SELECT * FROM pos_penjualandetail where nofaktur='{$nofaktur}' and kodebarang='{$kode}'";
    $hasil2 = mysql_query($query2);
    $data2 = mysql_fetch_array($hasil2);
    $jumlah = $data2['jumlah'];
    $jumlahbaru = $jumlah - $jumlahretur;
    return $jumlahbaru;
Esempio n. 2
0
<td>Stok Akhir</td>
</tr>';
$no =1;
/****************************/
$st2 = mysql_query ("SELECT * FROM pos_alur_stok where transaksi like'Stok Awal'");	

while($datast2 = mysql_fetch_array($st2)){
$idsa = $datast2['id'];
$tglsa = $datast2['tgl'];
$transaksi = $datast2['transaksi'];
$kodebarangsa = $datast2['kodebarang'];
$jumlahsa = $datast2['jumlah'];
$getnamabarangsa = getnamabarang($kodebarangsa);
$getjenisbarang = getjenisbarang($kodebarangsa);
$getidjenisbarang=getidjenisbarang($kodebarangsa);
$getstokbarang=getstokbarang($kodebarangsa);
if($kodejenis!=''){
if($getidjenisbarang==$kodejenis){
echo '
<tr class="border">
<td class="text-center">'.$no.'</td>
<td>'.tanggalindo($datast2['tgl']).'</td>
<td>'.$datast2['transaksi'].'</td>
<td>'.$datast2['kode'].'</td>
<td>'.$kodebarangsa.'</td>
<td>'.$getnamabarangsa.'</td>
<td>'.$datast2['jumlah'].'</td>
<td>'.$getstokbarang.'</td>
</tr>';
}}else{
echo '
Esempio n. 3
0
 exit;
 if ($bayar == '0' and $termin == '0') {
     $error .= "Error:  Termin harus diisi karena termasuk Piutang <br />";
 }
 if (!$_SESSION["kodecustomer"]) {
     $error .= "Error:  Kode Customer harus ada <br />";
 }
 if (!$_SESSION["product_id"]) {
     $error .= "Error:  Kode Barang harus ada <br />";
 }
 if ($koneksi_db->sql_numrows($koneksi_db->sql_query("SELECT nofaktur FROM pos_penjualan WHERE nofaktur='{$nofaktur}'")) > 0) {
     $error .= "Error: Nomor Faktur " . $nofaktur . " sudah terdaftar<br />";
 }
 foreach ($_SESSION["product_id"] as $cart_itm) {
     $kode = $cart_itm["kode"];
     $jumlah = $cart_itm["jumlah"];
     $stokbarang = getstokbarang($kode);
     if ($stokbarang < $jumlah) {
         $error .= "Error:  Stok Barang Tidak Mencukupi<br />";
     }
 }
 if ($error) {
     $admin .= '<div class="error">' . $error . '</div>';
 } else {
     if ($bayar == '0') {
         $carabayar = 'Piutang';
         $tgltermin = tgltermin($tgl, $termin);
         $hasil = mysql_query("INSERT INTO `pos_penjualan` VALUES ('','{$nofaktur}','{$nopo}','{$tgl}','{$kodecustomer}','{$carabayar}','{$total}','{$discount}','{$netto}','0','{$netto}','{$termin}','{$tgltermin}','{$user}')");
     } else {
         $hasil = mysql_query("INSERT INTO `pos_penjualan` VALUES ('','{$nofaktur}','{$nopo}','{$tgl}','{$kodecustomer}','{$carabayar}','{$total}','{$discount}','{$netto}','{$bayar}','0','0','','{$user}')");
     }
     $idpenjualan = mysql_insert_id();
Esempio n. 5
0
		<th><b>Discount</b></</th>
<th><b>SubDiscount</b></</th>
<th><b>Subtotal</b></</th>
		<th><b>Aksi</b></</th>
	</tr>';
foreach ($_SESSION["product_id"] as $cart_itm)
        {
		
$nilaidiscount=cekdiscount($cart_itm["subdiscount"],$cart_itm["harga"]);
$admin .= '	
	<tr>
			<td>'.$no.'</td>
		<td>'.getjenjang($cart_itm["jenjang"]).'</td>
			<td>'.$cart_itm["kode"].'</td>
		<td>'.getnamabarang($cart_itm["kode"]).'</td>
		<td>'.getstokbarang($cart_itm["kode"]).'</td>
		<td>'.$cart_itm["harga"].'</td>
		<td><input align="right" type="text" name="jumlahjual" value="'.$cart_itm["jumlah"].'"class="form-control"></td>
		<td><input align="right" type="text" name="subdiscount" value="'.$cart_itm["subdiscount"].'"class="form-control"></td>
	<td>'.$nilaidiscount.'</td>
		<td>'.$cart_itm["subtotal"].'</td>
		<td>
		
		<input type="hidden" name="kode" value="'.$cart_itm["kode"].'">
		<input type="submit" value="EDIT" name="editjumlah"class="btn btn-warning" >
		<input type="submit" value="HAPUS" name="hapusbarang"class="btn btn-danger"></td>
	</tr>';
	$total +=$cart_itm["subtotal"];
	$no++;
		}
$_SESSION['totaljual']=$total;
Esempio n. 6
0
<?php