done mrir issue
This commit is contained in:
parent
0b5e5ed05a
commit
571c4b6930
@ -211,7 +211,7 @@ public function viewmMaterialDistributionList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Values To Stored in DB (for update operation) */
|
/* Values To Stored in DB (for update operation) */
|
||||||
function updated_db()
|
function updated_db()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->load->model('mrir_model');
|
$this->load->model('mrir_model');
|
||||||
@ -229,6 +229,11 @@ public function viewmMaterialDistributionList()
|
|||||||
$updatemaster = $this->mrir_model->update_mrirmaster($updatemastervalues,$mrir_no);
|
$updatemaster = $this->mrir_model->update_mrirmaster($updatemastervalues,$mrir_no);
|
||||||
$strStatus = '';
|
$strStatus = '';
|
||||||
//echo "outside for loop";
|
//echo "outside for loop";
|
||||||
|
$CheckEmpty=0;
|
||||||
|
$TotalRow=0;
|
||||||
|
for($m=1;$m<=$RowCount ; $m++){
|
||||||
|
$TotalRow=$TotalRow+$m;
|
||||||
|
}
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
{
|
{
|
||||||
$ActualQty=trim($this->input->post('ActualQuantityReceived'.$i));
|
$ActualQty=trim($this->input->post('ActualQuantityReceived'.$i));
|
||||||
@ -237,9 +242,11 @@ public function viewmMaterialDistributionList()
|
|||||||
$MaterialCode = trim($this->input->post('MaterialCode'.$i));
|
$MaterialCode = trim($this->input->post('MaterialCode'.$i));
|
||||||
$Lineitm = trim($this->input->post('Lineitm'.$i));
|
$Lineitm = trim($this->input->post('Lineitm'.$i));
|
||||||
|
|
||||||
|
|
||||||
//echo $acceptquantity;
|
//echo $acceptquantity;
|
||||||
if(strlen($acceptquantity)>0)
|
if($rejectquantity==0)
|
||||||
{
|
{
|
||||||
|
$CheckEmpty=$CheckEmpty+$i;
|
||||||
$strStatus = MRIR_APPROVED;
|
$strStatus = MRIR_APPROVED;
|
||||||
$avlQty = 0;
|
$avlQty = 0;
|
||||||
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
||||||
@ -255,7 +262,7 @@ public function viewmMaterialDistributionList()
|
|||||||
$this->mrir_model->UpdateStock($updatStock,trim($MaterialCode));
|
$this->mrir_model->UpdateStock($updatStock,trim($MaterialCode));
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif(strlen($acceptquantity)==0 && strlen($rejectquantity)>0)
|
elseif($rejectquantity!=0)
|
||||||
{
|
{
|
||||||
$strStatus = MRIR_REJECTED;
|
$strStatus = MRIR_REJECTED;
|
||||||
}
|
}
|
||||||
@ -263,8 +270,7 @@ public function viewmMaterialDistributionList()
|
|||||||
|
|
||||||
|
|
||||||
$remark=$this->input->post('Remark'.$i);
|
$remark=$this->input->post('Remark'.$i);
|
||||||
//echo $remark;
|
|
||||||
//die();
|
|
||||||
$updateby=$this->session->userdata('userId');
|
$updateby=$this->session->userdata('userId');
|
||||||
$date = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
|
$date = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
|
||||||
$updateon = $date->format('Y-m-d H:i:s');
|
$updateon = $date->format('Y-m-d H:i:s');
|
||||||
@ -287,7 +293,16 @@ public function viewmMaterialDistributionList()
|
|||||||
$this->mrir_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
$this->mrir_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->mrir_model->UpdatePOMaster($PONO,$updateby);
|
$PoMrirStatus='';
|
||||||
|
|
||||||
|
if($TotalRow==$CheckEmpty){
|
||||||
|
$PoMrirStatus = MRIR_APPROVED;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$PoMrirStatus = MRIR_REJECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->mrir_model->UpdatePOMaster($PONO,$PoMrirStatus,$updateby);
|
||||||
|
|
||||||
echo "successfully updated :".$mrir_no;
|
echo "successfully updated :".$mrir_no;
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ class inwardgateregister extends BaseController
|
|||||||
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
||||||
//echo ' ';
|
//echo ' ';
|
||||||
|
|
||||||
if(strlen($QuantityAsPerInvoice)>0)
|
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
|
||||||
{
|
{
|
||||||
$Remarks = $this->input->post('txtRemarks'.$i);
|
$Remarks = $this->input->post('txtRemarks'.$i);
|
||||||
$ItemStatus = '';
|
$ItemStatus = '';
|
||||||
|
|||||||
@ -301,22 +301,15 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdatePOMaster($PONO,$updatedBy)
|
function UpdatePOMaster($PONO,$PoMrirStatus,$updatedBy)
|
||||||
{
|
{
|
||||||
$this->db->select('*');
|
|
||||||
$this->db->from('T_PurchaseOrder_LineItem');
|
|
||||||
$this->db->where('PONO',$PONO);
|
|
||||||
$this->db->where('Status !=',MRIR_APPROVED);
|
|
||||||
|
|
||||||
$query = $this->db->get();
|
|
||||||
|
|
||||||
|
|
||||||
if ($query->num_rows == 0) {
|
|
||||||
$this->db->where('PONO', $PONO);
|
$this->db->where('PONO', $PONO);
|
||||||
$POStatus = array('status'=>MRIR_APPROVED,'UpdateBY'=>$updatedBy);
|
$POStatus = array('status'=>$PoMrirStatus,'UpdateBY'=>$updatedBy);
|
||||||
$this->db->update('T_PurchaseOrder_Master', $POStatus);
|
$this->db->update('T_PurchaseOrder_Master', $POStatus);
|
||||||
}
|
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -336,10 +336,16 @@ function Redirect()
|
|||||||
<script>
|
<script>
|
||||||
function validate()
|
function validate()
|
||||||
{
|
{
|
||||||
|
|
||||||
var rowcount = $("#RowCount").val();
|
var rowcount = $("#RowCount").val();
|
||||||
|
|
||||||
var Noval = 0;
|
var Noval = 0;
|
||||||
var isExceed = 0;
|
var isExceed = 0;
|
||||||
|
var CheckEmpty=0;
|
||||||
|
var TotalRow =0;
|
||||||
|
for(m=1;m<=rowcount ; m++){
|
||||||
|
TotalRow=TotalRow+m;
|
||||||
|
}
|
||||||
for(k=1;k<=rowcount ; k++)
|
for(k=1;k<=rowcount ; k++)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -355,8 +361,9 @@ function validate()
|
|||||||
|
|
||||||
var RejectedQuantity = parseFloat( $('#RejectQuantity'+k).val() == '' ? '0.00' : $('#RejectQuantity'+k).val());
|
var RejectedQuantity = parseFloat( $('#RejectQuantity'+k).val() == '' ? '0.00' : $('#RejectQuantity'+k).val());
|
||||||
|
|
||||||
if(AcceptQuantity != '0.00')
|
if($('#AcceptQuantity'+k).val() != '')
|
||||||
{
|
{
|
||||||
|
CheckEmpty=CheckEmpty+k;
|
||||||
|
|
||||||
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
||||||
{
|
{
|
||||||
@ -364,7 +371,14 @@ function validate()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Noval = 1;
|
Noval = 1;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if($('#AcceptQuantity'+k).val() == ''){
|
||||||
|
$('#AcceptQuantity'+k).focus();
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
else if(RejectedQuantity != 0)
|
else if(RejectedQuantity != 0)
|
||||||
{
|
{
|
||||||
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
if(ActualQty < (AcceptQuantity+RejectedQuantity))
|
||||||
@ -374,9 +388,14 @@ function validate()
|
|||||||
}
|
}
|
||||||
// Noval = 1;
|
// Noval = 1;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//alert(Noval);
|
//alert(Noval);
|
||||||
if (Noval == 0 )
|
if (TotalRow !=CheckEmpty)
|
||||||
{
|
{
|
||||||
|
|
||||||
alert('Accepted Quantity/ Rejected Quantity is Empty.Please Enter the value');
|
alert('Accepted Quantity/ Rejected Quantity is Empty.Please Enter the value');
|
||||||
@ -395,7 +414,7 @@ function validate()
|
|||||||
}
|
}
|
||||||
function setaccept(rowId)
|
function setaccept(rowId)
|
||||||
{
|
{
|
||||||
|
if($('#AcceptQuantity'+rowId).val()!=''){
|
||||||
var accept = parseFloat($('#AcceptQuantity'+rowId).val());
|
var accept = parseFloat($('#AcceptQuantity'+rowId).val());
|
||||||
var tr= document.getElementById(rowId);
|
var tr= document.getElementById(rowId);
|
||||||
var Actulqty = 0.0;
|
var Actulqty = 0.0;
|
||||||
@ -442,11 +461,20 @@ function setaccept(rowId)
|
|||||||
$('#status').val('<?php echo MRIR_REJECTED?>');
|
$('#status').val('<?php echo MRIR_REJECTED?>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#RejectQuantity'+rowId).val('') ;
|
||||||
|
$('#QuantityRejected'+rowId).val('') ;
|
||||||
|
$('#QuantityAccepted'+rowId).val('') ;
|
||||||
|
$('#AcceptQuantity'+rowId).val('') ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setreject(rowId)
|
function setreject(rowId)
|
||||||
{
|
{
|
||||||
|
|
||||||
var tr= document.getElementById(rowId);
|
var tr= document.getElementById(rowId);
|
||||||
var Actulqty = 0.0;
|
var Actulqty = 0.0;
|
||||||
|
|
||||||
@ -455,7 +483,7 @@ function setreject(rowId)
|
|||||||
|
|
||||||
Actulqty = parseFloat(cellval[6].innerHTML);
|
Actulqty = parseFloat(cellval[6].innerHTML);
|
||||||
var reject = parseFloat($('#RejectQuantity'+rowId).val());
|
var reject = parseFloat($('#RejectQuantity'+rowId).val());
|
||||||
if(reject > Actulqty )
|
if(reject > Actulqty)
|
||||||
{
|
{
|
||||||
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
|
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
|
||||||
$("#RejectQuantity"+rowId).focus();
|
$("#RejectQuantity"+rowId).focus();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user