merged uptodate : ps

This commit is contained in:
VE10-Sanjeev 2023-06-16 15:05:58 +05:30
parent 9ac51ff47c
commit 2b0af09121
4 changed files with 59 additions and 56 deletions

View File

@ -351,6 +351,7 @@ class requisitionform extends BaseController
*/ */
function addNewRequistion() function addNewRequistion()
{ {
// print_r($this->input->post());die();
log_message('error'," add new Requisition Fns Called"); log_message('error'," add new Requisition Fns Called");
$this->form_validation->set_rules('RequestType','RequestType','trim|required'); $this->form_validation->set_rules('RequestType','RequestType','trim|required');
@ -370,6 +371,7 @@ class requisitionform extends BaseController
$RequestedbyDept = $this->session->userdata ( 'DEPCode' ); $RequestedbyDept = $this->session->userdata ( 'DEPCode' );
$CostCenter = $this->input->post('CostCenter'); $CostCenter = $this->input->post('CostCenter');
$CreateBy = $this->session->userdata ( 'userId' ); $CreateBy = $this->session->userdata ( 'userId' );
$UpdatedBy = $this->session->userdata ( 'userId' );
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s'); $createddt = $dt->format('Y-m-d H:i:s');
@ -383,7 +385,8 @@ class requisitionform extends BaseController
$noOfService = 1; $noOfService = 1;
$IsExists = $this->requistion_model->RequistionIsExists($Requestedby); $IsExists = $this->requistion_model->RequistionIsExists($Requestedby);
// print_r($IsExists); // print_r($IsExists);die();
// return true;
if(count( $IsExists) == 0) if(count( $IsExists) == 0)
{ {
@ -435,7 +438,7 @@ class requisitionform extends BaseController
$Quantity = $this->input->post('Quantity'.$i); $Quantity = $this->input->post('Quantity'.$i);
$OtherD = $this->input->post('otherD'.$i); $OtherD = $this->input->post('otherD'.$i);
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD); $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD,'UpdatedBy'=>$UpdatedBy);
$this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber); $this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber);
} }

View File

@ -52,7 +52,7 @@ class requistion_model extends CI_Model
/* $subQuery ='select distinct Req.ReqNo, Req.MaterialCode,Mat.MaterialName,Mat.UOM, Req.Quantity, /* $subQuery ='select distinct Req.ReqNo, Req.MaterialCode,Mat.MaterialName,Mat.UOM, Req.Quantity,
ifnull(Po.Quantity,0) as POQTY,sta.StatusName ifnull(Po.Quantity,0) as POQTY,sta.StatusName
from T_Requestion_Details Req join T_MaterialMaster Mat on from T_Requestion_Details Req join T_MaterialMaster Mat on
Req.MaterialCode = Mat.MaterialCode Req.MaterialCode = Mat.MaterialCode
left join T_PurchaseOrder_LineItem Po on Po.ReqNo = Req.ReqNo left join T_PurchaseOrder_LineItem Po on Po.ReqNo = Req.ReqNo
@ -395,7 +395,6 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
} }
} }
}
/** /**
* This function is used to check the Request is in Draft status * This function is used to check the Request is in Draft status
* @return array $result : This is result of the query * @return array $result : This is result of the query
@ -407,10 +406,11 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
$this->db->where('Status ',REQ_DRAFT ); $this->db->where('Status ',REQ_DRAFT );
$this->db->where('Requestedby ',$ReqBy ); $this->db->where('Requestedby ',$ReqBy );
$query = $this->db->get(); $query = $this->db->get();
//print_r($this->db->last_query());die();
if ($query->num_rows > 0) { if ($query->num_rows > 0) {
//echo $result->num_rows;
return $query->result_array(); return $query->result_array();
}else{
return array();
} }
} }
/** /**

View File

@ -461,7 +461,7 @@ if(!empty($ReqPOType))
foreach($LineItem as $record) foreach($LineItem as $record)
{ {
$index = $index + 1; $index = $index + 1;
$materialdesc=$record->MaterialDescription; $materialdesc=isset($record->MaterialDescription) ? $record->MaterialDescription :"";
//echo $materialdesc; //echo $materialdesc;
?> ?>
<tr id="<?php echo $index ; ?>"> <tr id="<?php echo $index ; ?>">
@ -481,7 +481,7 @@ if(!empty($ReqPOType))
<td align="left"><?php echo $record->Quantity ; ?></td> <td align="left"><?php echo $record->Quantity ; ?></td>
<td align="left"><?php echo $record->POQTY ; ?></td> <td align="left"><?php echo $record->POQTY ; ?></td>
<td align="left"><?php echo $record->StatusName ;?></td> <td align="left"><?php echo $record->StatusName ;?></td>
<input type="hidden" name="<?php echo 'materialdesc'.$index ?>" id="<?php echo 'materialdesc'.$index ?>" value="<?php echo $record->MaterialDescription ; ?>" /> <input type="hidden" name="<?php echo 'materialdesc'.$index ?>" id="<?php echo 'materialdesc'.$index ?>" value="<?php echo isset($record->MaterialDescription) ? $record->MaterialDescription : '' ; ?>" />
<td> <td>
<a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#EditItem' data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode ; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $record->MaterialCode ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> <a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#EditItem' data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode ; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $record->MaterialCode ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>

View File

@ -304,7 +304,7 @@ function saveToDatabase(editableObj,column,ReqId,Index) {
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); alert(data);
location.reload(); location.reload(true);
} }
else else
{ {