<?php
 
include 'dbconfig.php';

$idno= $_POST['idno']; 
$qty= $_POST['qty'];
$discount= $_POST['discount'];
$qtyret= $_POST['qtyret'];

 

//$qty=1;
 
 
// Create connection
 
$conn = mysqli_connect($servername, $username, $password, $dbname);
 
// Check connection
 
if (!$conn) {
 
    die("Connection failed: " . mysqli_connect_error());
 
}

//echo $item_code;

/*GET ITEM_DESC */

$query = "update Trans1sub set qtyreturn='$qtyret' where idno=".$idno;
 

 
$response = mysqli_query($conn, $query) or die('Error query:  '.$query);
 
$lid = mysqli_insert_id($conn);
 
$result["errormsg"]=$notrans;
 
$result["lid"]="$lid";
 
if ($response == 1){
 
    echo json_encode($result);
 
}
 
else{
 
    $result["errormsg"]="Fail";
 
    echo json_encode($result);
 
}
 
?>
