<?php
include "../../inc/inc.koneksi.php";

$kode	 		=$_POST[kode];
$nobank 		=$_POST[nobank];
$kodesp  		=$_POST[kodesp];
$jmlunit			=$_POST[jmlunit];
$jumlah  		=$_POST[jumlah];
$setor			=$_POST[setor];
$bulat			=$_POST[bulat];

$sql	= mysql_query("SELECT * FROM interface");
$r 	= mysql_fetch_assoc($sql);

$persed		= $r[persed];
$slsbulat		= $r[sls_bulat];
$labapb  		= $r[laba_pb];
$labarugi		= $r[laba_rugi];
$kodelpg		= $r[kode_lpg];

mysql_query("UPDATE stock SET jml_stok=jml_stok-$jmlunit WHERE kode_st='$kodelpg'");

mysql_query("UPDATE akun_bb SET mutasi_db=mutasi_db-$jumlah WHERE noakun='$persed'");
mysql_query("UPDATE akun_bb SET mutasi_db=mutasi_db-$bulat WHERE noakun='$slsbulat'");
mysql_query("UPDATE akun_bb SET mutasi_kd=mutasi_kd-$setor WHERE noakun='$nobank'");
mysql_query("UPDATE akun_bb SET mutasi_db=mutasi_db-$bulat WHERE noakun='$labapb'");
mysql_query("UPDATE akun_bb SET mutasi_kd=mutasi_kd-$bulat WHERE noakun='$labarugi'");

mysql_query("DELETE FROM rekap_mbr WHERE kode_tr='$kode'");
mysql_query("DELETE FROM rekapjur WHERE kode_tr='$kode'");
mysql_query("UPDATE tebus_do SET batal='BATAL' WHERE kode_tb='$kode'");
?>
