mrir multiple po list fix

This commit is contained in:
venbatechnologies@gmail.com 2017-09-06 13:09:16 +05:30
parent efe5e4ded4
commit 3bd77f1bb3
3 changed files with 38 additions and 1 deletions

View File

@ -2563,9 +2563,21 @@ function addadvancerequest()
$createddt = $dt->format('Y-m-d H:i:s');
$CreateBy = $this->session->userdata ( 'userId' );
$isExists = $this->purchaseorder_model->PONOExists($PONO);
if(count($isExists)==0)
{
$advance=array('PONO'=>$PONO,'AdvancePercentage'=>$AdvancePercentage,'AdvanceAmount'=>$AdvanceAmount,'Remarks'=>$Remarks,'CreatedBy'=>$CreateBy ,'CreatedDt'=>$createddt);
$this->purchaseorder_model->addadvanceRequest($advance);
}
else
{
$advance=array('AdvancePercentage'=>$AdvancePercentage,'AdvanceAmount'=>$AdvanceAmount,'Remarks'=>$Remarks);
$this->purchaseorder_model->updateadvanceRequest($advance,$PONO);
}
if($advance > 0)

View File

@ -568,6 +568,31 @@ function GetPOType($ReqNo)
}
function PONOExists($PONO)
{
$this->db->select('PONO');
$this->db->from('T_PurchaseOrder_AdvanceRequest');
$this->db->where('PONO ',$PONO);
$query = $this->db->get();
if ($query->num_rows > 0) {
return $query->result_array();
}
}
function updateadvanceRequest($advance,$PONO)
{
$this->db->where('PONO', $PONO);
$this->db->update('T_PurchaseOrder_AdvanceRequest',$advance);
$insert_id = $this->db->affected_rows();
return $insert_id;
}
/**

View File

@ -274,7 +274,7 @@ var PONUM=$('#PurchaseOrderNumber').val();
document.getElementById("labeltotal").innerHTML ='Total Order Value In '+currency;
document.getElementById("labeladv").innerHTML ='Advance Amount In '+currency;
advanceamountCalculation();
// advanceamountCalculation();
}
});