ItemNo change for material code change

This commit is contained in:
gandhimathi Bharathirajan 2017-09-28 12:23:20 +05:30
parent a1c510b258
commit 0293bf3e03

View File

@ -360,7 +360,8 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
$this->db->trans_start();
$this->db->insert('T_Requestion_Master', $Requistion);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
$this->db->trans_complete();
if($insert_id>0)
{
$subQuery = 'select max(ReqNo) as ReqNo from T_Requestion_Master';
@ -409,16 +410,29 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
* This function is used to add the Line item details to the Database
* @return array $result : This is result of the query
*/
function addRequistionDetails($Requistion)
function addRequistionDetails($Requistion,$RegNo='')
{
$this->db->trans_start();
$this->db->insert('T_Requestion_Details', $Requistion);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
// print_r($this->db->last_query());
return $insert_id;
$subQuery = 'select max(ItemNo) as ItemNo from T_Requestion_Details where ReqNo=?';
$query = $this->db->query($subQuery,array($RegNo));
return $query->result_array();
}
function getItemNumber($ReqNo,$MaterialCode)
{
$subQuery = 'select ItemNo from T_Requestion_Details where ReqNo=? and MaterialCode=?';
$query = $this->db->query($subQuery,array($ReqNo,$MaterialCode));
return $query->result_array();
}
/**
* This function is used to delete the Line item from details into Database
* @return array $result : This is result of the query