<?php
include('config.php');
include('code.php');


if(isset($_GET['id']))
$id=$_GET['id'];
if(isset($_GET['date']))
$date=$_GET['date'];
if(isset($_GET['bcode']))
$bcode=$_GET['bcode'];
if(isset($_GET['code']))
$code=$_GET['code'];
if(isset($_GET['ticket']))
$ticket=$_GET['ticket'];
if(isset($_GET['qnt']))
$qnt=$_GET['qnt'];
if(isset($_GET['time']))
$time=$_GET['time'];
 $pqnt= getProductQnt($bcode,$code,$link);
 $fqnt=$pqnt + $qnt;


$sql =$link->query("delete from invoice where id='$id' and date='$date' and ticket='$ticket' and time='$time'");
$sqls =$link->query("delete from cashbook where date='$date' and transcode='$ticket' and time='$time'");
$sq=$link->query("update items set quantity='$fqnt' where BranchCode='$bcode' and code='$code'");

			echo "<script>location='reverse_transaction.php'</script>";


?>