stock detail changes

This commit is contained in:
venbatechnologies@gmail.com 2018-07-04 19:54:21 +05:30
parent 581219bb7b
commit 8476974083
15 changed files with 422 additions and 81 deletions

View File

@ -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//

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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()

View File

@ -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)
{

View File

@ -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))
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
<input type="hidden" name="MRIRNO" id="MRIRNO " value="<?php echo $MRIRNO ?>" />
<input type="hidden" name="status" id="status" />
<input type="hidden" name="hideIGRLineItem" value="<?php echo $IGRlineitemNo ?>"/>
</div>
</div>

View File

@ -20,8 +20,8 @@
<!-- /.box-header -->
<div class="box-body">
<table id="dataTableHistoriek" class="table table-bordered table-hover editableTable" style="font-size:12px;">
<thead>
<tr style="background-color:#ddf">
<thead style="background-color:#ddf">
<tr>
<!-- <th>#</th> -->
<th>Id</th>
<th>Product Name</th>

View File

@ -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))
</div>
</div>
<? print_r($OGR_Data); ?>
<div class="col-md-9" style="padding: 0px;">
<div class="col-md-12" style="padding: 0px;">
<div class="col-md-3">

View File

@ -417,18 +417,17 @@ function validate()
var trHTML = '';
$.each(JSON.parse(data), function (i, item) {
if(item.PendingQty !=0){
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
'<td>' + item.MaterialName + '</td>' +
'<td name="UOM">' + item.UOM + '</td>' +
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
'<td name="ReceivedQuantity'+i+'" id="ReceivedQuantity'+i+'">'+ item.ReceivedQuantity +'</td>'+
'<td name="PendingQuantity'+i+'" id="PendingQuantity'+i+'">'+ item.PendingQty +'</td>'+
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" value="" onkeypress="return isNumberKey(event);"></td>' +
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form" onchange="SetRemarks('+i+')"> </td>' +
'</tr>';
$('#txtRowCount').val(i);
@ -479,7 +478,10 @@ $('<input>').attr({
$('#QuantityAsPerInvoice'+i).attr('readonly', 'true');
// $('#txtEditFreight').attr('readonly', 'true');
}
$("#IGRLink").show();
}else{
$("#IGRLink").hide();
}
});

View File

@ -20,8 +20,8 @@
<!-- /.box-header -->
<div class="box-body">
<table id="dataTableHistoriek" class="table table-bordered table-hover editableTable" style="font-size:12px;">
<thead>
<tr style="background-color:#ddf">
<thead style="background-color:#ddf">
<tr>
<!-- <th>#</th> -->
<th>Material Adjustment No</th>
<th>Material Code</th>

View File

@ -1,5 +1,6 @@
<?php
$IGRNO="";
$IGRlineitemNo="";
$PONO="";
$VehicleNo="";
$CourierNo="";
@ -21,7 +22,8 @@ if(!empty($IGRDetails))
foreach ($IGRDetails as $IGR)
{
$IGRNO = $IGR->IGRNO;
$IGRNO = $IGR->IGRNO;
$IGRlineitemNo=$IGR->IGRItemNo;
$PONO = $IGR->PONO;
$VehicleNo = $IGR->VehicleNo;
$CourierNo= $IGR->CourierNo;
@ -261,6 +263,7 @@ if(!empty($IGRDetails))
<div class="col-md-2 col-md-offset-10" align="right" style="padding: 0px;">
<a class="btn btn-primary" type="submit" onclick="savemrir()">Generate MRIR</a>
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
<input type="hidden" readonly name="hideIGRLineItem" value="<?php echo $IGRlineitemNo ?>"/>
</div>
</div>

View File

@ -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++)

View File

@ -341,6 +341,7 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
'<td>' + item.MaterialName + '</td>' +
'<td name="UOM">' + item.UOM + '</td>' +
@ -358,5 +359,4 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
});
});
</script>
</script>

View File

@ -1,4 +1,28 @@
<style>
<!-- <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> -->
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
font-size: 15px;
position: relative;
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
.modal
{
padding-right:25% ! important;
@ -18,7 +42,7 @@
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear() ;
var SIAStartYear = year - 2015;
var SIAStartYear = year - 2007;
var mindt = year-70;
var maxdt = year-15;
@ -35,7 +59,8 @@
<div class="box">
<div class=" container-fluid">
<div class="box-header">
<CENTER><h3 class="box-title"><?php echo $pageTitle; ?></h3></CENTER>
<!-- <CENTER><h3 class="box-title">Resico Industries - View Inward Gate Register</h3></CENTER> -->
<CENTER><h3 class="box-title"><?php echo $pageTitle; ?></h3></CENTER>
</div>
<div class="row">
<div class="col-md-12">
@ -49,6 +74,8 @@
<th>Supplier Name</th>
<th>Invoice No</th>
<th>Date of Invoice</th>
<th>Material Name</th>
<th>Advice Quantity</th>
<th>Vechicle No</th>
<th>Courier No</th>
<th>Action</th>
@ -67,18 +94,23 @@
?>
<tr id="<?php echo $index ?>" >
<td style="text-align: center;"><?php echo $index?></td>
<!-- <td><a data-toggle="modal" data-target="#Igrshow" data-id="<%=index%>" data-userid="<?php echo $record->IGRNO?>" > <u><?php echo $record->IGRNO ?></u></a></td> this is igrno flow old flow -->
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $record->IGRNO.",".$record->IGRItemNo ?>" > <u><?php echo $record->IGRNO ?></u></a></td>
<td><?php echo $record->PONO ?></a></td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td align="right"><?php
$date = new DateTime($record->DeliveryChellanDate);
echo $date->format('d-m-Y'); ?></td>
echo $date->format('d-m-Y'); ?></td>
<td><?php echo $record->MaterialName ?></td>
<td><span data-toggle="tooltip" title="Quantity as per Received"><?php echo $record->QuantityAsPerInvoice ?></span></td>
<!--<td><span data-toggle="tooltip" title="Quantity as per Received"><?php echo $record->QuantityAsPerInvoice."/".$record->Quantity ?></span></td>-->
<td><?php echo $record->VehicleNo ?></td>
<td><?php echo $record->CourierNo ?></td>
<td>
<!-- <a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO; ?>"><button style="font-size:12px" id="generated" name="generated">Generate MRIR <i class="fa fa-file-text"></i></button></a> -->
<a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO.'&IGRitemno='.$record->IGRItemNo; ?>"><button style="font-size:12px" id="generated" name="generated">Generate MRIR <i class="fa fa-file-text"></i></button></a>
<!-- <a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO; ?>"><button style="font-size:12px" id="generated" name="generated">Generate MRIR <i class="fa fa-file-text"></i></button></a> -->
<a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO.'&IGRitemno='.$record->IGRItemNo; ?>"><button style="font-size:12px" id="generated" name="generated">Generate MRIR <i class="fa fa-file-text"></i></button></a>
<!-- <a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO.'&IGRitemno='.$record->IGRItemNo; ?>"><i class="fa fa-file-text" data-toggle="tooltip" target="_blank" title="Click here to generate MRIR"></i></a> -->
</td>
</tr>
<?php
@ -101,7 +133,7 @@
<!-- Modal content-->
<form>
<div class="modal-content" style="width:800px;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Inward Gate Register Details</h4></center> <!-- IGR number should display here-->
</div>
@ -163,8 +195,8 @@
echo form_input($data);
?>
</div>
<div class="col-md-4">
<label>Supplier Name</label>
<div class="col-md-4">
<label>Supplier Name</label>
<?php
$data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'Supplier', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
echo form_input($data);
@ -183,17 +215,17 @@
<div class="col-md-4">
<label>Delivery Challan / Invoice Date </label>
<?php
$data = array('name' => 'DeliveryChallan/InvoiceDate','value' => set_value('DeliveryChallan/InvoiceDate'),'id'=>'Invoice_Date', 'class' => 'form-control', 'required=>"true"');
$data = array('name' => 'DeliveryChallan/InvoiceDate','value' => set_value('DeliveryChallan/InvoiceDate'),'id'=>'Invoice_Date', 'class' => 'form-control', 'required=>"true"');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<label>Material Received Date </label>
<label>Material Received Date </label>
<?php
$data = array('name' => 'MaterialRcvdDate','value' => set_value('MaterialRcvdDate'),'id'=>'MaterialRcvdDate', 'class' => 'form-control');
echo form_input($data);
?>
</div>
</div>
</div>
@ -215,7 +247,7 @@
</table>
<div class="modal-footer">
<a class="btn btn-primary" id="update" value="Update">Update</a>
<a class="btn btn-primary" id="update" value="Update">Update</a>
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
@ -223,13 +255,31 @@
</div>
</div>
</section>
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script>
<!-- script for table , It works under the datatable plugin-->
// $(function () {
// $('#Inwardgateregistertable').DataTable({
// "paging": true,
// "lengthChange": true,
// "searching": true,
// "ordering": true,
// "info": true,
// "autoWidth": true
// });
//});
$(document).ready(function() {
$(document).ready(function() {
// buttons: [ {name: 'copy', extend: 'copy', exportOptions: {columns: ':gt(0)', orthogonal: 'export'}} ]
table = $('#Inwardgateregistertable').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
@ -254,7 +304,7 @@ $(document).ready(function() {
} );
} );
</script>
</script>
<script>
$("#Igrshow").on("shown.bs.modal", function(e) {
//var igr = $(e.relatedTarget).data('userid');
@ -318,8 +368,6 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
}
});
});
$('#update').click(function(){
//alert('updated function entered');
$('#content').loader('show');