diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php
index 70d30d22..fc92b3fd 100644
--- a/application/controllers/inwardgateregister.php
+++ b/application/controllers/inwardgateregister.php
@@ -78,28 +78,12 @@ class inwardgateregister extends BaseController
$PO = $this->input->post('id');
$CreatedBy = $this->session->userdata('userId');
- $ordqty ='';
- $recqty ='';
-
- $qty = $this->inwardgateregister_model->getpolineqty($PO);
-
- $ordqty = $qty[0]->Qty;
- $recqty = $qty[0]->rec;
-
- if($ordqty == $recqty)
- {
- $Newstatus = array('Status'=>IGR_CREATED);
- $this->inwardgateregister_model-> POLineItemsupdatestatus($PO,$Newstatus);
- $Newstat = array('Status'=>IGR_CREATED);
- $this->inwardgateregister_model->pomasterupdatestatus($PO,$Newstat);
- }
-
$this->inwardgateregister_model->UpdatePOMaster($PO,$CreatedBy);
$data = $this->inwardgateregister_model->viewpurchaseorder($PO);
echo json_encode($data);
}
-
+
/**
* To upload IGR files
*/
@@ -138,8 +122,7 @@ class inwardgateregister extends BaseController
*/
function addNewigr()
{
-
-
+
$PONO = $this->input->post('PONO');
$DeliveryChellanOrInvoiceNo = $this->input->post('InvoiceNo');
@@ -185,12 +168,13 @@ class inwardgateregister extends BaseController
$igr = array();
$igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$MaterialRcvdDt,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'file'=>$document);
-
+ //print_r($igr);
+ //echo"** IGR master **";
$igrM = $this->inwardgateregister_model->addigrM($igr);
-
- $OGRStatus=IGR_CREATED;
- $check_OGRPO= $this->inwardgateregister_model->update_OGR($PONO,$OGRStatus);
+ //$IGRNO = 'IGRNO0008';
+ $OGRStatus=IGR_CREATED;
+ $check_OGRPO= $this->inwardgateregister_model->update_OGR($PONO,$OGRStatus);
$IGRNO = '';
if(count($igrM)>0)
@@ -202,6 +186,7 @@ class inwardgateregister extends BaseController
$IGRItemStatus = REQITEM_NEW;
+ $TotalPendingQty = '';
for ($i = 1; $i <= $RowCount; $i++)
@@ -211,7 +196,11 @@ class inwardgateregister extends BaseController
$OrderedQuantity = trim($this->input->post('OrderedQuantity'.$i));
$ReceivedQty = trim($this->input->post('txtReceivedQuantity'.$i));
$PendingQty = $this->input->post('txtPendingQty'.$i);
-
+
+ //echo $PendingQty;
+ $TotalPendingQty = $TotalPendingQty + $PendingQty;
+ //echo $TotalPendingQty;
+
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
{
$Remarks = $this->input->post('txtRemarks'.$i);
@@ -244,7 +233,7 @@ class inwardgateregister extends BaseController
$itemvalue='';
$SupplierId='';
- $polineitemvalue = $this->inwardgateregister_model->getitemvalue($PONO,$MaterialCode);
+ $polineitemvalue = $this->inwardgateregister_model->getitemvalue($PONO,$MaterialCode);
foreach($polineitemvalue as $it)
{
@@ -273,10 +262,21 @@ class inwardgateregister extends BaseController
}
- }
- $this->inwardgateregister_model->UpdatePOMaster($PONO,$CreatedBy);
+ }
+
+ $this->inwardgateregister_model->UpdatePOMaster($PONO,$CreatedBy);
+
+ if($TotalPendingQty == 0.00){
+
+ $Newstatus = array('Status'=>IGR_CREATED);
+
+ $this->inwardgateregister_model->POLineItemsupdatestatus($PONO,$Newstatus);
+ $this->inwardgateregister_model->pomasterupdatestatus($PONO,$Newstatus);
+ }
+ else{ /*echo 'error' ;*/ }
+
- echo "";
+ echo "";
}
/**
diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php
index a3c8ff61..974ee139 100755
--- a/application/models/purchaseorder_model.php
+++ b/application/models/purchaseorder_model.php
@@ -955,24 +955,27 @@ function GetServicePurchaseOrderDetailsforPdf($PONO = '')
// This Method to get the Revenue PO Child Details for Edit the Item
function GetRevenuePurchaseOrderDetails($PONO = '')
-{
+ {
+
+ $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
+ Mat.UOM,Quantity,Per,ServiceMaterialDescription,ReceivedQuantity,Rate,
+ Req.Status,(Quantity *Rate) as BasicValue ,
+ (( AfterSGST + AfterCGST + AfterIGST )) as Taxamount ,TotalValue,Tax.*,
+ Req.CostCenterCode,Dept.DepartmentName
+ FROM T_PurchaseOrder_LineItem LineItem
+ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
+ join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
+ join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
+ left join T_Employee_Details emp on Req.Requestedby = emp.EmpID
+ join T_DepartmentDetails Dept on Req.RequestedDept = Dept.DEPCode
+ where LineItem.PONO =?';
-$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Per,ServiceMaterialDescription,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , (( AfterSGST + AfterCGST +
- AfterIGST )) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
- FROM T_PurchaseOrder_LineItem LineItem
- join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
- join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
- join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
- left join T_Employee_Details emp on Req.Requestedby = emp.EmpID
- join T_DepartmentDetails Dept on Req.RequestedDept = Dept.DEPCode
- where LineItem.PONO =?';
-
-$query = $this->db->query($subQuery,array($PONO));
-
-return $query->result();
-
-
-}
+ $query = $this->db->query($subQuery,array($PONO));
+
+ return $query->result();
+
+
+ }
// This Method to get the Revenue PO Child Details for Edit the Item
function GetRevenuePurchaseOrderDetailsForPDF($PONO = '')
diff --git a/application/views/AmendPOlist.php b/application/views/AmendPOlist.php
index 2eff24c5..ba849b1c 100644
--- a/application/views/AmendPOlist.php
+++ b/application/views/AmendPOlist.php
@@ -1,5 +1,4 @@
-
-
+
diff --git a/application/views/Report_purchase_inward.php b/application/views/Report_purchase_inward.php
index 961a5436..cf580e88 100755
--- a/application/views/Report_purchase_inward.php
+++ b/application/views/Report_purchase_inward.php
@@ -30,6 +30,8 @@
background-color: #5d0411;
border-color: #5d0411;
}
+ .btn-sm {background-color: #5d0411 !important;
+ border: 2px solid #5d0411 !important;}
th, td { white-space: nowrap; }
.dataTable > thead > tr > th[class*="sort"]:after{
content: "" !important;
diff --git a/application/views/addstorerequisitionslip.php b/application/views/addstorerequisitionslip.php
index caeb5f03..981f25e2 100644
--- a/application/views/addstorerequisitionslip.php
+++ b/application/views/addstorerequisitionslip.php
@@ -1467,7 +1467,7 @@ function validate()
$(function () {
- $('#Items').DataTable({
+ $('#mytable').DataTable({
"paging": false,
diff --git a/application/views/approvalstorerequisitionslip.php b/application/views/approvalstorerequisitionslip.php
index 1d83193a..7cf09614 100644
--- a/application/views/approvalstorerequisitionslip.php
+++ b/application/views/approvalstorerequisitionslip.php
@@ -8,7 +8,7 @@
diff --git a/application/views/configlisting.php b/application/views/configlisting.php
index 9c4ba38e..388d3d87 100644
--- a/application/views/configlisting.php
+++ b/application/views/configlisting.php
@@ -1,13 +1,13 @@
-
+
+
+
-
-
+
+