
<?php include("../../include/dbconnect.php"); 



if($cnf=='Yes')
{


	$query= "delete from ledger where compcode ='$compcode' and branch_code = '$branch' and date ='$date'  ";
	mysqli_query($conn,$query) or die(mysqli_error());

	$query= "insert into ledger(acctcode,date,narration,dbamt,cramt,type,invno,compcode,branch_code,trans_id,account_year) select acctcode,date,narration,dbamt,cramt,type,invno,compcode,branch_code,trans_id,account_year from templedger  ";
	mysqli_query($conn,$query) or die(mysqli_error());
	
	$query= "truncate table templedger";
	mysqli_query($conn,$query) or die(mysqli_error());
}

?>
<meta http-equiv="refresh" content="0 url=editview.php?compcode=<?=$compcode?>&branch=<?=$branch?>&status=NEW">

*/
?>

