diff --git a/application/config/constants.php b/application/config/constants.php
index df3105cf..d68872a2 100644
--- a/application/config/constants.php
+++ b/application/config/constants.php
@@ -121,11 +121,10 @@ define('STORE_ONHOLD', 'ST038');
define('STORE_REJECT', 'ST039');
/* OGR status */
define('OGR_PARTIAL_COMPLETE', 'ST064');
-define('OGR_COMPLETE', 'ST057');
+define('OGR_COMPLETE', 'ST063');
define('ST044', 'ST044');
define('PO', 'PO');
-define('ST063', 'ST063');
-define('OGR_CREATED', 'ST059');
+define('OGR_CREATED', 'ST065');
define('OGR_NOT_CREATED', 'ST069');
//pomaster status update//
diff --git a/application/config/database.php b/application/config/database.php
index 3ed04101..4d0866a2 100644
--- a/application/config/database.php
+++ b/application/config/database.php
@@ -69,22 +69,22 @@ $db['default']['stricton'] = FALSE;
// DB_DATABASE=resicoin_invoices
// DB_DATABASE=resicoin_invoicetest #kasiram9_InvoiceTest
-$db['invoicedb']['hostname'] = 'resicoindustries.com';
-$db['invoicedb']['username'] = 'resicoin_invoice';
-$db['invoicedb']['password'] = 'resicoin_invoice';
-//$db['invoicedb']['database'] = 'resicoin_invoicetest';
-$db['invoicedb']['database'] = 'resicoin_invoices';
-$db['invoicedb']['dbdriver'] = 'mysqli';
-$db['invoicedb']['dbprefix'] = '';
-$db['invoicedb']['pconnect'] = TRUE;
-$db['invoicedb']['db_debug'] = FALSE;
-$db['invoicedb']['cache_on'] = FALSE;
-$db['invoicedb']['cachedir'] = '';
-$db['invoicedb']['char_set'] = 'utf8';
-$db['invoicedb']['dbcollat'] = 'utf8_general_ci';
-$db['invoicedb']['swap_pre'] = '';
-$db['invoicedb']['autoinit'] = TRUE;
-$db['invoicedb']['stricton'] = FALSE;
+// $db['invoicedb']['hostname'] = 'resicoindustries.com';
+// $db['invoicedb']['username'] = 'resicoin_invoice';
+// $db['invoicedb']['password'] = 'resicoin_invoice';
+// //$db['invoicedb']['database'] = 'resicoin_invoicetest';
+// $db['invoicedb']['database'] = 'resicoin_invoices';
+// $db['invoicedb']['dbdriver'] = 'mysqli';
+// $db['invoicedb']['dbprefix'] = '';
+// $db['invoicedb']['pconnect'] = TRUE;
+// $db['invoicedb']['db_debug'] = FALSE;
+// $db['invoicedb']['cache_on'] = FALSE;
+// $db['invoicedb']['cachedir'] = '';
+// $db['invoicedb']['char_set'] = 'utf8';
+// $db['invoicedb']['dbcollat'] = 'utf8_general_ci';
+// $db['invoicedb']['swap_pre'] = '';
+// $db['invoicedb']['autoinit'] = TRUE;
+// $db['invoicedb']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */
\ No newline at end of file
diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php
index 727872a9..690ddaff 100644
--- a/application/controllers/MRIRcontroller.php
+++ b/application/controllers/MRIRcontroller.php
@@ -19,7 +19,8 @@ class MRIRcontroller extends BaseController
public function __construct()
{
parent::__construct();
- $this->load->model('purchaseorder_model');
+ $this->load->model('purchaseorder_model');
+ $this->load->model('inwardgateregister_model');
$this->load->model('mrir_model');
$this->load->library('session');
$this->load->library('form_validation');
@@ -187,6 +188,7 @@ class MRIRcontroller extends BaseController
$RowCount = $this->input->post('RowCount');
$igrno = $this->input->post('IGRNO');
+ $igrlineitemno = $this->input->post('hideIGRLineItem');//igrltineitemno
$PONO = $this->input->post('PONO');
$CreatedBy = $this->session->userdata('userId');
@@ -199,9 +201,14 @@ class MRIRcontroller extends BaseController
$mrirmastervalues = array('MRIRStatus'=>MRIR_CREATED,'IGRNO'=>$igrno,'PONO'=>$PONO,'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt);
$mrirmaster = $this->mrir_model->master_mrir($mrirmastervalues);
- $IGRDetails = array('IGRStatus'=>MRIR_CREATED,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt);
+
+ $IGRMaster = array('IGRStatus'=>MRIR_CREATED,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt);
- $this->mrir_model->UpdateIGRStatus($IGRDetails,$igrno);
+ $this->mrir_model->UpdateIGRStatus($IGRMaster,$igrno);
+
+ $IGRDetails = array('IGRItemStatus'=>MRIR_CREATED,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt);
+
+ $this->mrir_model->UpdateIGRLineItemStatus($IGRDetails, $igrlineitemno);
$MRIRNO = '';
@@ -247,6 +254,7 @@ class MRIRcontroller extends BaseController
$mrir_no = $this->input->post('MRIRNO');
$RowCount = $this->input->post('RowCount');
+ $igrlineitemno = $this->input->post('hideIGRLineItem');
$Status = $this->input->post('status');
$UPdateby=$this->session->userdata('userId');
$date = new DateTime('now',new DateTimeZone('Asia/Kolkata'));
@@ -317,7 +325,8 @@ class MRIRcontroller extends BaseController
$this->mrir_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
}
- $PoMrirStatus='';
+ $OGRStatus=OGR_NOT_CREATED;
+ $PoMrirStatus='';
if($ISRejected==1){
$PoMrirStatus = MRIR_APPROVED;
@@ -325,7 +334,7 @@ class MRIRcontroller extends BaseController
else{
$PoMrirStatus = MRIR_REJECTED;
}
- $updatemastervalues = array('MRIRStatus'=>$PoMrirStatus,'UpdateBY'=>$UPdateby,'UpdatedOn'=>$UPdateon);
+ $updatemastervalues = array('MRIRStatus'=>$PoMrirStatus,'UpdateBY'=>$UPdateby,'UpdatedOn'=>$UPdateon,'OGRstatus'=>$OGRStatus);
$updatemaster = $this->mrir_model->update_mrirmaster($updatemastervalues,$mrir_no);
diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php
index 1555ad54..5606b952 100755
--- a/application/controllers/batchcard.php
+++ b/application/controllers/batchcard.php
@@ -228,13 +228,17 @@ class batchcard extends BaseController
function Final_Product_Save()
{
+ // echo "from batchcard controller";
+ // die();
$final_product = $this->input->post('DEPTFN');
$final_qty = $this->input->post('Quantity');
$product_date = $this->input->post('Date');
//$pdt = $product_date->format('Y-m-d');
$pdt = date("Y-m-d", strtotime($product_date));
$product_value = $this->input->post('values');
- $createdby = $this->session->userdata('userId');
+ $createdby = $this->session->userdata('userId');
+ //echo $createdby;
+
$final_master =array('MaterialCode'=>$final_product,'Quantity'=>$final_qty,'Price'=>$product_value,'CreatedBy'=>$createdby,'ProductDate'=>$pdt,'ProductType'=>'Inward');
@@ -275,16 +279,17 @@ class batchcard extends BaseController
$rawmaterial = $this->input->post('rawmaterialcode'.$i);
$rawsupplier =$this->input->post('rawSupplierID'.$i);
$rawqty = $this->input->post('rawQty'.$i);
- $rawvalue = $this->input->post('rawprice'.$i);
+ $rawvalue = $this->input->post('rawprice'.$i);
+
$rawarray =array('FPId'=>$final_product_id,'MaterialCode'=>$rawmaterial,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'Price'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
- $rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
-
+ $rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
$this->batchcard_model->save_rawmaterialto_materialHistory($rawmaterialhistory);
- //print_r($rawarray);
+ // print_r($rawarray);
+ // print_r($rawmaterialhistory);
$this->batchcard_model->save_finalraw($rawarray);
}
@@ -299,7 +304,7 @@ class batchcard extends BaseController
$conarray =array('FPId'=>$final_product_id,'MaterialCode'=>$conmaterial,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'Price'=>$convalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
- $consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
+ $consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
$this->batchcard_model->save_rawmaterialto_materialHistory($consuhistory);
@@ -316,7 +321,7 @@ class batchcard extends BaseController
$packarray =array('FPId'=>$final_product_id,'MaterialCode'=>$packmaterial,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'Price'=>$packvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
- $packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
+ $packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
$this->batchcard_model->save_rawmaterialto_materialHistory($packmathistory);
@@ -339,7 +344,7 @@ class batchcard extends BaseController
$this->batchcard_model->save_finalcoproduct($coparray);
- $copfinal_history = array('RefID'=>$final_product_id,'ProductCode'=>$copmaterial,'Quantity'=>$copqty,'Price'=>$copvalue,'Transactiondate'=>$createddt,'TransactionType'=>'Inward');
+ $copfinal_history = array('RefID'=>$final_product_id,'ProductCode'=>$copmaterial,'Quantity'=>$copqty,'Price'=>$copvalue,'Transactiondate'=>$createddt,'TransactionType'=>'Inward');
$final_cophistory_save= $this->batchcard_model->SaveFinalHistory($copfinal_history);
}
@@ -413,7 +418,7 @@ class batchcard extends BaseController
- $rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
+ $rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
$checkrawid=$this->batchcard_model->GetRawid($rawilneno);
@@ -461,7 +466,7 @@ class batchcard extends BaseController
$conarray =array('FPId'=>$FPID,'MaterialCode'=>$conmaterial,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'Price'=>$convalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
- $consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
+ $consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
$checkconsuid=$this->batchcard_model->Getconsuid($consuline);
@@ -503,7 +508,7 @@ class batchcard extends BaseController
$packarray =array('FPId'=>$FPID,'MaterialCode'=>$packmaterial,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'Price'=>$packvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
//print_r($packarray);
- $packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
+ $packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
$checkpackid=$this->batchcard_model->Getpackid($packlineId);
diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php
index 7bba62d5..31a50735 100644
--- a/application/controllers/inwardgateregister.php
+++ b/application/controllers/inwardgateregister.php
@@ -333,11 +333,22 @@ class inwardgateregister extends BaseController
$PONO = $this->input->post('PONO');
$materialcode = $this->input->post('materialcode');
$data = $this->inwardgateregister_model->getPOMRIRDetails($MRIRno,$PONO,$materialcode);
-
+
echo json_encode($data);
}
+
+ function getMRIR()
+ {
+ $MRIRno = $this->input->post('MRIRNO');
+ $PONO = $this->input->post('PONO');
+ $data = $this->inwardgateregister_model->getPOMRIRMaterial($MRIRno,$PONO);
+
+
+ echo json_encode($data);
+ }
+
function ViewOgr()
{
$this->load->model('inwardgateregister_model');
@@ -358,7 +369,258 @@ class inwardgateregister extends BaseController
$this->loadViews("editogr", $this->global, $data, NULL);
}
- /**
+
+ function AddOgr()
+ {
+
+ $type=$this->input->post('type');
+ $Supplier = $this->input->post('sup');
+ $Date = $this->input->post('Date');
+ $vehicle =$this->input->post('Vehicle');
+ $driver = $this->input->post('drive');
+
+ if($type == 1)
+ {
+ $invoice =$this->input->post('invno');
+ $Otype='Invoice';
+ $Status ='OGR_COMPLETE';
+ $ogrmaster = array('OgrType'=>$Otype,'CreatedDate'=>$Date,'Driver'=>$driver
+ ,'PONO_INV'=>$invoice,'VehicleNo'=>$vehicle,'Status'=>$Status);
+ $addogrmaster= $this->inwardgateregister_model->AddOGR($ogrmaster);
+ $OGRNO = '';
+
+ if(count($addogrmaster)>0)
+ {
+ foreach($addogrmaster as $add)
+ {
+
+ $OGRNO = $add->OGRNO;
+ }
+ }
+
+
+ $itemcode =$this->input->post('itemcode');
+ $Description = $this->input->post('Description');
+ $invoutwardqty = $this->input->post('invoutwardqty');
+
+ $Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$itemcode,'OutwardQty'=>$invoutwardqty,'Status'=>$Status);
+ $addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline);
+
+
+ if((count($addogrmaster)>0)&&(count($addOgrline>0)))
+ {
+ echo "Saved Successfully OGR No is OGR".$OGRNO;
+
+ }
+
+
+ }
+
+ else if($type == 2)
+ {
+
+
+ $pono =$this->input->post('pono');
+ $MRIRNO = $this->input->post('mrirno');
+
+ $Otype='PO';
+
+
+ $row= $this->input->post('rowcount');
+ $ogrmaster = array('OgrType'=>$Otype,'CreatedDate'=>$Date,'Driver'=>$driver
+ ,'PONO_INV'=>$pono,'VehicleNo'=>$vehicle,'MRIRNO'=>$MRIRNO);
+
+ $addogrmaster= $this->inwardgateregister_model->AddOGR($ogrmaster);
+
+
+ $OGRNO = '';
+
+ if(count($addogrmaster)>0)
+ {
+ foreach($addogrmaster as $add)
+ {
+
+ $OGRNO = $add->OGRNO;
+ }
+ }
+
+
+ for($i=1;$i<=$row;$i++)
+ {
+
+
+ $MaterialCode = $this->input->post('materialcode'.$i);
+ $OutwardQty = $this->input->post('outward'.$i);
+ $rejqty = $this->input->post('RejectedQty'.$i);
+ $pendingoutward = $this->input->post('pendingoutward'.$i);
+ $balance_Qty= $rejqty-$OutwardQty;
+ //$balance_Qty = $this->input->post('pendingoutward'.$i);
+ $Outwardtotal = $OutwardQty;
+ $allowed= $this->input->post('allowed'.$i);
+
+ if($MaterialCode != '' && $OutwardQty !='')
+ {
+
+ $polqty= $this->inwardgateregister_model->getPOLineItemReceivedQty($pono,$MaterialCode);
+ $ReceivedQuantity = 0.00;
+ if(count($polqty)>0)
+ {
+ foreach ($polqty as $key )
+ {
+ $ReceivedQuantity=$key->ReceivedQuantity;
+ }
+ }
+
+ $totalReceivedqty = $ReceivedQuantity - $Outwardtotal;
+ $POMStatus=OGR_CREATED;
+
+ $POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'OGR_Status'=>$POMStatus);
+
+ $this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$pono,$MaterialCode);
+
+ if($pendingoutward == 0)
+ {
+ $Status = OGR_COMPLETE;
+ }
+
+ else
+ {
+ $Status = OGR_PARTIAL_COMPLETE;
+ }
+
+
+ $Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$MaterialCode,'OutwardQty'=>$Outwardtotal,'Status'=>$Status,'balance_Qty'=>$balance_Qty);
+ $addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline);
+
+ //print_r($addOgrline);
+
+ $ogrlineno='';
+ $itemvalue='';
+ $SupplierId='';
+
+ $CreatedBy = $this->session->userdata('userId');
+ $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
+ $createddt = $dt->format('Y-m-d H:i:s');
+
+ if(count($addogrmaster)>0)
+ {
+ $ogrlinearray= $this->inwardgateregister_model->getlastogrline();
+
+ foreach($ogrlinearray as $og)
+ {
+ $ogrlineno = $og->OGRItemNO;
+ }
+
+ $polineitemvalue = $this->inwardgateregister_model->getitemvalue($pono,$MaterialCode);
+
+ foreach($polineitemvalue as $it)
+ {
+ $itemvalue =$it->Rate;
+ $SupplierId =$it->SupplierID;
+ }
+
+
+ }
+
+
+ $historydetails = array('MaterialCode'=>$MaterialCode,'Transaction_type'=>"Reduce",'Ref_Type'=>"OGR",'Ref_No'=>$ogrlineno,'Quantity'=>$Outwardtotal,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt,'ItemValue'=>$itemvalue,'SupplierID'=>$SupplierId);
+
+
+ $this->inwardgateregister_model->addmaterialhistory($historydetails);
+
+
+
+ $this->inwardgateregister_model->UpdateOGRMasterOGRStatus($OGRNO);
+
+ $this->inwardgateregister_model->UpdateMRIRMasterOGRStatus($MRIRNO,$OGRNO);
+
+
+ $mrirout= $this->inwardgateregister_model->GetMRIROutQty($MRIRNO,$MaterialCode);
+ $premrirout=0;
+ if(!empty($mrirout))
+ {
+ foreach($mrirout as $mr)
+ {
+ $premrirout= $mr->Ogr_Out_Qty;
+ }
+ }
+
+ $totmrirout= $premrirout+$Outwardtotal;
+ $mrirarray=array('Ogr_Out_Qty'=>$totmrirout);
+
+ $this->inwardgateregister_model->UpdateMRIROUTQty($mrirarray,$MRIRNO,$MaterialCode);
+
+
+ $POMasterStatus=array('Status'=>PO_RELEASED);
+
+ $this->inwardgateregister_model->UpdatePOMasterOGRStatus($pono,$POMasterStatus);
+
+
+ }
+
+
+ }
+
+
+
+ if((count($addogrmaster)>0)&&(count($addOgrline)>0))
+ {
+ echo "Saved Successfully OGR No is OGR".$OGRNO;
+
+ }
+
+ }
+
+
+ else if($type ==3)
+ {
+ $Otype='SERVICE';
+ $Status ='OGR_COMPLETE';
+ $ogrmaster = array('OgrType'=>$Otype,'CreatedDate'=>$Date,'Driver'=>$driver,'VehicleNo'=>$vehicle,'Status'=>$Status);
+
+ $addogrmaster= $this->inwardgateregister_model->AddOGR($ogrmaster);
+
+
+ //print_r($addogrmaster);
+
+ $OGRNO = '';
+
+ //echo count($addogrmaster);
+
+ if(count($addogrmaster)>0)
+ {
+ foreach($addogrmaster as $add)
+ {
+
+ $OGRNO = $add->OGRNO;
+ }
+ }
+
+ $material= $this->input->post('material');
+ $name= $this->input->post('name');
+ $pooutward= $this->input->post('pooutward');
+ $destination= $this->input->post('destination');
+ $Remarks= $this->input->post('Remark');
+
+ $Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$material,'OutwardQty'=>$pooutward,'Destination'=>$destination,'Status'=>$Status,'SupplierID'=>$name,'Remark'=>$Remarks);
+
+ //print_r($Ogrline);
+ //die();
+
+ $addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline);
+
+ if((count($addogrmaster)>0)&&(count($addOgrline>0)))
+ {
+ echo "Saved Successfully OGR No is OGR".$OGRNO;
+
+ }
+
+
+ }
+
+ }
+
+ /**
* To load pagenotfound view
*/
function pageNotFound()
diff --git a/application/models/mrir_model.php b/application/models/mrir_model.php
index aa79a4d3..3d5ecbe6 100644
--- a/application/models/mrir_model.php
+++ b/application/models/mrir_model.php
@@ -32,7 +32,8 @@ class mrir_model extends CI_Model
$this->db->join('T_IGR_Details igrdetail','igrdetail.IGRNO = igr.IGRNO');
$this->db->join('T_PurchaseOrder_LineItem POL','igr.PONO = POL.PONO and POL.MaterialCode=igrdetail.MaterialCode');
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrdetail.MaterialCode');
- $this->db->where('igr.IGRStatus !=',MRIR_CREATED);
+ // $this->db->where('igr.IGRStatus !=',MRIR_CREATED);//old status updated on igr master
+ $this->db->where('igrdetail.IGRItemStatus !=',MRIR_CREATED);
$this->db->where('PO.IsQualityChkReqired',1);
$this->db->order_by("CreatedDate","desc");
$query = $this->db->get();
@@ -49,7 +50,7 @@ class mrir_model extends CI_Model
function get_IGR($IgrNo,$IgrItemno)
{
$this->db->distinct();
- $this->db->select('IGRM.DeliveryChellanDate,IGRM.CreatedDate,IGRM.IGRNO,IGRM.VehicleNo,IGRM.DeliveryChellanOrInvoiceNo,IGRM.CourierNo,IGRM.PONO,IGRD.MaterialCode,IGRD.QuantityAsPerInvoice,POMR.ServiceDescription,POMR.PODate,POMR.DeliveryDate,POMR.CreatedBy,SUPP.SupplierName,SUPP.Address,MM.UOM,MM.MaterialName,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName');
+ $this->db->select('IGRM.DeliveryChellanDate,IGRM.CreatedDate,IGRM.IGRNO,IGRM.VehicleNo,IGRM.DeliveryChellanOrInvoiceNo,IGRM.CourierNo,IGRM.PONO,IGRD.MaterialCode,IGRD.QuantityAsPerInvoice,POMR.ServiceDescription,POMR.PODate,POMR.DeliveryDate,POMR.CreatedBy,SUPP.SupplierName,SUPP.Address,MM.UOM,MM.MaterialName,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName,IGRD.IGRItemNo');
$this->db->from('T_IGR_Master IGRM');
$this->db->join('T_PurchaseOrder_Master POMR ','IGRM.PONO=POMR.PONO');
$this->db->join('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
@@ -173,7 +174,7 @@ class mrir_model extends CI_Model
function edit_mrir($MrirNo)
{
$this->db->distinct();
- $this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.Createdon as MRIRCreatedon,TMD.MRIRItemNo,TMD.ActualQuantityReceived,TMD.QuantityAccepted,TMD.QuantityRejected,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,IGRM.CreatedDate as IGRCreated,IGRD.QuantityAsPerInvoice,SUPP.SupplierName,SUPP.Address,POMR.PODate,POMR.DeliveryDate,POMR.ServiceDescription,TMD.MaterialCode,MM.MaterialName,MM.UOM,Line.Quantity,Line.ReceivedQuantity,ED.FirstName as PORasiedbyName,ED1.FirstName as MRIRRasiedbyName, ED2.FirstName as IGRRasiedbyName,TMM.MRIRStatus,Line.CostCenterCode,COST.CostCenterName,TMD.Remarks');
+ $this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.Createdon as MRIRCreatedon,TMD.MRIRItemNo,TMD.ActualQuantityReceived,TMD.QuantityAccepted,TMD.QuantityRejected,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,IGRM.CreatedDate as IGRCreated,IGRD.QuantityAsPerInvoice,SUPP.SupplierName,SUPP.Address,POMR.PODate,POMR.DeliveryDate,POMR.ServiceDescription,TMD.MaterialCode,MM.MaterialName,MM.UOM,Line.Quantity,Line.ReceivedQuantity,ED.FirstName as PORasiedbyName,ED1.FirstName as MRIRRasiedbyName, ED2.FirstName as IGRRasiedbyName,TMM.MRIRStatus,Line.CostCenterCode,COST.CostCenterName,TMD.Remarks,IGRD.IGRItemNo');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO = TMD.MRIRNO');//to get IGRNO,PONO,MRIRNO,mrirdate,
$this->db->join ('T_IGR_Master IGRM', 'IGRM.IGRNO = TMM.IGRNO');//to get actualquantity,deliverydate,Invoicedate,vechileno,courierno,igrdate,
@@ -302,14 +303,22 @@ class mrir_model extends CI_Model
}
- function UpdateIGRStatus($IGRDetails,$IGRNO)
+ function UpdateIGRStatus($IGRMaster,$IGRNO)
{
- $this->db->where('IGRNO', $IGRNO);
- $this->db->update('T_IGR_Master', $IGRDetails);
-
- return TRUE;
- }
-
+ $this->db->where('IGRNO', $IGRNO);
+ $this->db->update('T_IGR_Master', $IGRMaster);
+
+ return TRUE;
+ }
+
+ function UpdateIGRLineItemStatus($IGRDetails,$igrlineitemno)
+ {
+ $this->db->where('IGRItemNo', $igrlineitemno);
+ $this->db->update('T_IGR_Details', $IGRDetails);
+
+ return TRUE;
+ }
+
function getItemQuantityFromStock($MaterialCode)
{
diff --git a/application/views/Editmaterialinspectionreport.php b/application/views/Editmaterialinspectionreport.php
index 46157c7c..4bbbc278 100644
--- a/application/views/Editmaterialinspectionreport.php
+++ b/application/views/Editmaterialinspectionreport.php
@@ -3,6 +3,7 @@ $MRIRNO="";
$mrirdate="";
$MRIRRasiedbyName="";
$IGRNO="";
+$IGRlineitemNo="";
$igrdate="";
$IGRRasiedbyName="";
$PONO="";
@@ -28,7 +29,8 @@ if(!empty($MRIRDetails))
$mrir_date = strtotime( $MRIRDate );
$mrirdate = date( 'd-m-Y', $mrir_date );
$MRIRRasiedbyName=$MRIR->MRIRRasiedbyName;
- $IGRNO = $MRIR->IGRNO;
+ $IGRNO = $MRIR->IGRNO;
+ $IGRlineitemNo = $MRIR->IGRItemNo;
$IGRDate = $MRIR->IGRCreated;
$igr_date = strtotime( $IGRDate );
$igrdate = date( 'd-m-Y', $igr_date );
@@ -311,6 +313,7 @@ if(!empty($MRIRDetails))
+
diff --git a/application/views/FinalProductlisting.php b/application/views/FinalProductlisting.php
index 7b75e38c..ecbd7c2e 100644
--- a/application/views/FinalProductlisting.php
+++ b/application/views/FinalProductlisting.php
@@ -20,8 +20,8 @@
-
-
+
+
| Id |
Product Name |
diff --git a/application/views/editogr.php b/application/views/editogr.php
index 9039e06c..5ea5c4e8 100644
--- a/application/views/editogr.php
+++ b/application/views/editogr.php
@@ -45,7 +45,6 @@ if(!empty($OGR_Data))
$driver=$dt->Driver;
$PONO=$dt->PONO_INV;
$MaterialCode=$dt->MaterialCode;
- $MaterialName=$dt->Material_Name;
//$name=$dt->;
$outqty=$dt->OutwardQty;
$mrirno= $dt->MRIRNO;
@@ -209,6 +208,7 @@ if(!empty($OGR_Data))
+ print_r($OGR_Data); ?>
diff --git a/application/views/inwardgateregister.php b/application/views/inwardgateregister.php
index 482b4720..612b4e29 100644
--- a/application/views/inwardgateregister.php
+++ b/application/views/inwardgateregister.php
@@ -417,18 +417,17 @@ function validate()
var trHTML = '';
$.each(JSON.parse(data), function (i, item) {
-
+ if(item.PendingQty !=0){
i=i+1;
trHTML += '
' +
'| ' + i + ' | ' +
'' + item.MaterialCode + ' | ' +
'' + item.MaterialName + ' | ' +
'' + item.UOM + ' | ' +
- '' + item.Quantity + ' | ' +
+ '' + item.Quantity + ' | ' +
''+ item.ReceivedQuantity +' | '+
''+ item.PendingQty +' | '+
' | ' +
-
' | ' +
'
';
$('#txtRowCount').val(i);
@@ -479,7 +478,10 @@ $('
').attr({
$('#QuantityAsPerInvoice'+i).attr('readonly', 'true');
// $('#txtEditFreight').attr('readonly', 'true');
}
-
+ $("#IGRLink").show();
+ }else{
+ $("#IGRLink").hide();
+ }
});
diff --git a/application/views/materialadjustmentlist.php b/application/views/materialadjustmentlist.php
index d112b31b..2f2c594a 100644
--- a/application/views/materialadjustmentlist.php
+++ b/application/views/materialadjustmentlist.php
@@ -20,8 +20,8 @@
-
-
+
+
| Material Adjustment No |
Material Code |
diff --git a/application/views/materialinspectionreport.php b/application/views/materialinspectionreport.php
index 77cff766..db3c3663 100644
--- a/application/views/materialinspectionreport.php
+++ b/application/views/materialinspectionreport.php
@@ -1,5 +1,6 @@
IGRNO;
+ $IGRNO = $IGR->IGRNO;
+ $IGRlineitemNo=$IGR->IGRItemNo;
$PONO = $IGR->PONO;
$VehicleNo = $IGR->VehicleNo;
$CourierNo= $IGR->CourierNo;
@@ -261,6 +263,7 @@ if(!empty($IGRDetails))
diff --git a/application/views/ogr.php b/application/views/ogr.php
index 4c7c9f4d..2eb13bea 100644
--- a/application/views/ogr.php
+++ b/application/views/ogr.php
@@ -794,7 +794,6 @@ $("#mrirno").change(function()
var mrirno = $('#mrirno').val();
$('#poappend').empty();
var row= $('#rowcount').val();
- //alert(row);
if(row !="")
{
for(var j=1;j<=row;j++)
@@ -847,7 +846,9 @@ $("#mrirno").change(function()
$("#pono").change(function()
{
+ alert('onchange function entered');
var PONO=$('#pono').val();
+ alert(PONO);
$('#poappend').empty();
var row= $('#rowcount').val();
@@ -930,8 +931,8 @@ function addHidden(theForm, key, value)
var che =0;
var materialcode=$('#materialcode').val();
var mrirno = $('#mrirno').val();
- //alert(mrirno)
var PONO=$('#pono').val();
+ alert(mrirno+''+materialcode+''+PONO);
var x = document.getElementById("potable").rows.length;
for(var i=1;i<=x;i++)
diff --git a/application/views/viewIGRDetails.php b/application/views/viewIGRDetails.php
index 37837833..6125ed75 100644
--- a/application/views/viewIGRDetails.php
+++ b/application/views/viewIGRDetails.php
@@ -341,6 +341,7 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
i=i+1;
trHTML += '
' +
+ '| ' + i + ' | ' +
'' + item.MaterialCode + ' | ' +
'' + item.MaterialName + ' | ' +
'' + item.UOM + ' | ' +
@@ -358,5 +359,4 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
});
});
-
-
+
\ No newline at end of file
diff --git a/application/views/viewinwardgateregister.php b/application/views/viewinwardgateregister.php
index 743ffe9f..9a9881bd 100644
--- a/application/views/viewinwardgateregister.php
+++ b/application/views/viewinwardgateregister.php
@@ -1,4 +1,28 @@
-