file
This commit is contained in:
parent
526a6acbb2
commit
8f0b886332
@ -14,50 +14,50 @@ class inwardgateregister extends BaseController
|
||||
/**
|
||||
* This is default constructor of the class
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('inwardgateregister_model');
|
||||
|
||||
$this->load->library('session');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
|
||||
$this->load->library('session');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
/**
|
||||
/**
|
||||
* This function used to load the first screen of the user
|
||||
*/
|
||||
public function index()
|
||||
public function index()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register';
|
||||
|
||||
$this->loadViews("viewinwardgateregister", $this->global,NULL , NULL);
|
||||
}
|
||||
|
||||
|
||||
function viewIGRDetails()
|
||||
{
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details';
|
||||
$data['IGR']= $this->inwardgateregister_model->igrListing();
|
||||
|
||||
|
||||
function viewIGRDetails()
|
||||
{
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details';
|
||||
$data['IGR']= $this->inwardgateregister_model->igrListing();
|
||||
|
||||
|
||||
$this->loadViews("viewIGRDetails",$this->global,$data,NULL);
|
||||
|
||||
$this->loadViews("viewIGRDetails",$this->global,$data,NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function addinwardgateregister()
|
||||
|
||||
}
|
||||
|
||||
function addinwardgateregister()
|
||||
{
|
||||
|
||||
$this->load->model('inwardgateregister_model');
|
||||
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->global['pageTitle'] = 'Siddharth : Add Inward Gate Register';
|
||||
|
||||
|
||||
$data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder();
|
||||
//print_r($data['PO_NO']);
|
||||
|
||||
$data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder();
|
||||
//print_r($data['PO_NO']);
|
||||
|
||||
|
||||
|
||||
$this->loadViews("inwardgateregister", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
@ -65,16 +65,16 @@ class inwardgateregister extends BaseController
|
||||
|
||||
function addoutwardgateregister()
|
||||
{
|
||||
|
||||
$this->load->model('inwardgateregister_model');
|
||||
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->global['pageTitle'] = 'Siddharth : Add Outward Gate Register';
|
||||
|
||||
$data['Customer'] = $this->inwardgateregister_model->getCustomer();
|
||||
$data['Supplier'] = $this->inwardgateregister_model->getSupplier();
|
||||
//$data['Invoice'] = $this->inwardgateregister_model->getInvoice();
|
||||
$data['Customer'] = $this->inwardgateregister_model->getCustomer();
|
||||
$data['Supplier'] = $this->inwardgateregister_model->getSupplier();
|
||||
//$data['Invoice'] = $this->inwardgateregister_model->getInvoice();
|
||||
$data['storedmaterialcode'] = $this->inwardgateregister_model->getstoredmaterialcode();
|
||||
|
||||
//print_r($data['PO_NO']);
|
||||
//print_r($data['PO_NO']);
|
||||
$this->loadViews("ogr", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
@ -82,13 +82,13 @@ class inwardgateregister extends BaseController
|
||||
|
||||
function ViewOgr()
|
||||
{
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->global['pageTitle'] = 'Siddharth : View Outward Gate Register';
|
||||
|
||||
$data['OGR_Data'] = $this->inwardgateregister_model->getOGRData();
|
||||
$data['OGR_Data'] = $this->inwardgateregister_model->getOGRData();
|
||||
|
||||
//print_r($data['OGR_Data']);
|
||||
|
||||
//print_r($data['OGR_Data']);
|
||||
|
||||
$this->loadViews("ogrlist", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
@ -96,121 +96,121 @@ class inwardgateregister extends BaseController
|
||||
|
||||
function EditOGR()
|
||||
{
|
||||
$OGRNO = $_GET['OGRNO'];
|
||||
$MRIRNO = $_GET['MRIRNO'];
|
||||
$OGRNO = $_GET['OGRNO'];
|
||||
$MRIRNO = $_GET['MRIRNO'];
|
||||
$this->global['pageTitle'] = 'Siddharth : View Outward Gate Register';
|
||||
$data['OGR_Data'] = $this->inwardgateregister_model->getOGRDataforedit($OGRNO);
|
||||
$data['OGR_line'] = $this->inwardgateregister_model->getOGRlineDataforedit($OGRNO,$MRIRNO);
|
||||
$this->loadViews("editogr", $this->global, $data, NULL);
|
||||
$data['OGR_line'] = $this->inwardgateregister_model->getOGRlineDataforedit($OGRNO,$MRIRNO);
|
||||
$this->loadViews("editogr", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
function GetInvoices()
|
||||
{
|
||||
|
||||
$CustomerId = $this->input->post('customerId');
|
||||
$CustomerId = $this->input->post('customerId');
|
||||
|
||||
$data = $this->inwardgateregister_model->getInvoice($CustomerId);
|
||||
echo json_encode($data);
|
||||
$data = $this->inwardgateregister_model->getInvoice($CustomerId);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
function GetPO()
|
||||
{
|
||||
$supplierId = $this->input->post('supplierId');
|
||||
$supplierId = $this->input->post('supplierId');
|
||||
|
||||
$data = $this->inwardgateregister_model->getPO($supplierId);
|
||||
echo json_encode($data);
|
||||
$data = $this->inwardgateregister_model->getPO($supplierId);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
function getPODetails()
|
||||
{
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
|
||||
echo json_encode($data);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
function getMRIRDetails()
|
||||
{
|
||||
$MRIRno = $this->input->post('mrirno');
|
||||
$PONO = $this->input->post('PONO');
|
||||
$materialcode = $this->input->post('materialcode');
|
||||
$data = $this->inwardgateregister_model->getPOMRIRDetails($MRIRno,$PONO,$materialcode);
|
||||
//$data['outqty'] = $this->inwardgateregister_model->gettotalout($PONO,$materialcode);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
$MRIRno = $this->input->post('mrirno');
|
||||
$PONO = $this->input->post('PONO');
|
||||
$materialcode = $this->input->post('materialcode');
|
||||
$data = $this->inwardgateregister_model->getPOMRIRDetails($MRIRno,$PONO,$materialcode);
|
||||
//$data['outqty'] = $this->inwardgateregister_model->gettotalout($PONO,$materialcode);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
|
||||
echo json_encode($data);
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function getMRIR()
|
||||
{
|
||||
$MRIRno = $this->input->post('MRIRNO');
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPOMRIRMaterial($MRIRno,$PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
$MRIRno = $this->input->post('MRIRNO');
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPOMRIRMaterial($MRIRno,$PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
|
||||
echo json_encode($data);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
function getPOmrir()
|
||||
{
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPOmrir($PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
echo json_encode($data);
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPOmrir($PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
function getPOmaterialDetails()
|
||||
{
|
||||
$PONO= $this->input->post('PONO');
|
||||
$materialcode= $this->input->post('materialcode');
|
||||
$data= $this->inwardgateregister_model->getPOmaterialDetails($PONO,$materialcode);
|
||||
echo json_encode($data);
|
||||
$PONO= $this->input->post('PONO');
|
||||
$materialcode= $this->input->post('materialcode');
|
||||
$data= $this->inwardgateregister_model->getPOmaterialDetails($PONO,$materialcode);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
function getPOmaterial()
|
||||
{
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPOmaterial($PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
$PONO = $this->input->post('PONO');
|
||||
$data = $this->inwardgateregister_model->getPOmaterial($PONO);
|
||||
//$data['poout'] = $this->inwardgateregister_model->getPODetails($PONO);
|
||||
|
||||
echo json_encode($data);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
function getDateformat($Val)
|
||||
{
|
||||
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
|
||||
// print_r($date);
|
||||
$retDate = $date->format('Y-m-d H:i:s');
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
function getDateformat($Val)
|
||||
{
|
||||
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
|
||||
// print_r($date);
|
||||
$retDate = $date->format('Y-m-d H:i:s');
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
function IGRITEM()
|
||||
{
|
||||
|
||||
|
||||
$PO = $this->input->post('id');
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PO,$CreatedBy);
|
||||
$data = $this->inwardgateregister_model->viewpurchaseorder($PO);
|
||||
|
||||
function IGRITEM()
|
||||
{
|
||||
|
||||
|
||||
$PO = $this->input->post('id');
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PO,$CreatedBy);
|
||||
$data = $this->inwardgateregister_model->viewpurchaseorder($PO);
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
|
||||
}
|
||||
// function edituploadfile
|
||||
// {
|
||||
|
||||
// //echo "INSIDE UPLOAFD";
|
||||
|
||||
// //$this->load->library('upload')
|
||||
// $pathinfo = pathinfo($_FILES['myfile']['name']);
|
||||
|
||||
|
||||
}
|
||||
// function edituploadfile
|
||||
// {
|
||||
|
||||
// //echo "INSIDE UPLOAFD";
|
||||
|
||||
// //$this->load->library('upload')
|
||||
// $pathinfo = pathinfo($_FILES['myfile']['name']);
|
||||
// $config['upload_path'] = 'uploads/Igrfiles/';
|
||||
// $config['allowed_types'] = 'png|jpg|jpeg|pdf|docx';
|
||||
// $config['file_name'] = $_FILES['myfile']['name'];
|
||||
@ -232,19 +232,19 @@ class inwardgateregister extends BaseController
|
||||
// {
|
||||
// $error = array('error' => $this->upload->display_errors());
|
||||
// $uploadfilename = '';
|
||||
// print_r($error);
|
||||
// return 0;
|
||||
// print_r($error);
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------inwardateregister multiple file upload service------jun 11----------------------------*/
|
||||
|
||||
function adfile()
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------inwardateregister multiple file upload service------jun 11----------------------------*/
|
||||
|
||||
function adfile()
|
||||
{
|
||||
$picture = '';
|
||||
if(!empty($_FILES['file']['name']))
|
||||
@ -260,7 +260,7 @@ class inwardgateregister extends BaseController
|
||||
|
||||
if($this->upload->do_upload('file'))
|
||||
{
|
||||
echo "uploadif";
|
||||
//echo "if conditioncheck file do_upload";
|
||||
$uploadData = $this->upload->data();
|
||||
$picture = $uploadData['file_name'];
|
||||
}
|
||||
@ -285,6 +285,8 @@ class inwardgateregister extends BaseController
|
||||
function addloadfile()
|
||||
{
|
||||
|
||||
//echo 'Add new file ';
|
||||
|
||||
$upfiles = '';
|
||||
$pono= $this->input->post('PONO');
|
||||
|
||||
@ -312,7 +314,7 @@ $fcount = 0;
|
||||
{
|
||||
//echo 'eqal';
|
||||
|
||||
//echo 'cm'.$fcount;
|
||||
// echo 'cm'.$fcount;
|
||||
$fcount ++;
|
||||
|
||||
//echo 'cp'.$fcount;
|
||||
@ -323,7 +325,7 @@ $fcount = 0;
|
||||
|
||||
if($fcount == 0)
|
||||
{
|
||||
//echo 'if'.$fcount;
|
||||
//echo 'if'.$fcount.'</br>';
|
||||
|
||||
if(!empty($new_file_name))
|
||||
{
|
||||
@ -336,6 +338,7 @@ $fcount = 0;
|
||||
//print_r($upfiles);
|
||||
}
|
||||
}
|
||||
//echo 'filename'.$upfiles;
|
||||
|
||||
if( $upfiles > 0){
|
||||
echo "file updated successfully!";
|
||||
@ -709,56 +712,58 @@ $prefile =array();
|
||||
//echo 'Successfully Created IGR Number:'. $IGRNO;
|
||||
}
|
||||
|
||||
function ViewIGR()
|
||||
function ViewIGR()
|
||||
{
|
||||
|
||||
$IGRNO= $this->input->post('id');
|
||||
//print_r($IGRNO);
|
||||
|
||||
$IGRNO= $this->input->post('id');
|
||||
//print_r($IGRNO);
|
||||
$data = $this->inwardgateregister_model->viewigr($IGRNO);
|
||||
// print_r( $data);
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
function ViewIGRfile()
|
||||
{
|
||||
// print_r( $data);
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
function ViewIGRfile()
|
||||
{
|
||||
$IGRNO= $this->input->post('id');
|
||||
$data = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||
$igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||
$billfile = $this->inwardgateregister_model->ViewIGRfile1($IGRNO);
|
||||
$data = array_merge($igrfile,$billfile);
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function UpdateIGR()
|
||||
function UpdateIGR()
|
||||
{
|
||||
|
||||
$IGRNo = $this->input->post('igr');
|
||||
|
||||
$DeliveryChellan = $this->input->post('invdate');
|
||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||
|
||||
$Mat_Rcvd_Dt = $this->input->post('mrc');
|
||||
$MaterialRcvdDt = $this->getDateformat($Mat_Rcvd_Dt);
|
||||
|
||||
$updateby = $this->session->userdata('userId');
|
||||
|
||||
$IGRNo = $this->input->post('igr');
|
||||
|
||||
$DeliveryChellan = $this->input->post('invdate');
|
||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||
|
||||
$Mat_Rcvd_Dt = $this->input->post('mrc');
|
||||
$MaterialRcvdDt = $this->getDateformat($Mat_Rcvd_Dt);
|
||||
|
||||
$updateby = $this->session->userdata('userId');
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$updatedon = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
|
||||
$igrarr = array('DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$MaterialRcvdDt,'UpdateBY'=>$updateby,'UpdatedOn'=>$updatedon);
|
||||
|
||||
$data = $this->inwardgateregister_model->updateigr($igrarr,$IGRNo);
|
||||
|
||||
if($data > 0){
|
||||
echo "Updated Succefully!";
|
||||
}
|
||||
else{
|
||||
echo "Not Updated!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$updatedon = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
|
||||
$igrarr = array('DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$MaterialRcvdDt,'UpdateBY'=>$updateby,'UpdatedOn'=>$updatedon);
|
||||
|
||||
$data = $this->inwardgateregister_model->updateigr($igrarr,$IGRNo);
|
||||
|
||||
if($data > 0){
|
||||
echo "Updated Succefully!";
|
||||
}
|
||||
else{
|
||||
echo "Not Updated!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function pageNotFound()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
|
||||
@ -771,161 +776,161 @@ $prefile =array();
|
||||
|
||||
function AddOgr()
|
||||
{
|
||||
//echo "string";
|
||||
$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)
|
||||
{
|
||||
//echo "string";
|
||||
$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 ='ST063';
|
||||
$ogrmaster = array('OgrType'=>$Otype,'CreatedDate'=>$Date,'Driver'=>$driver
|
||||
,'PONO_INV'=>$invoice,'VehicleNo'=>$vehicle,'Status'=>$Status);
|
||||
,'PONO_INV'=>$invoice,'VehicleNo'=>$vehicle,'Status'=>$Status);
|
||||
$addogrmaster= $this->inwardgateregister_model->AddOGR($ogrmaster);
|
||||
$OGRNO = '';
|
||||
|
||||
if(count($addogrmaster)>0)
|
||||
{
|
||||
foreach($addogrmaster as $add)
|
||||
{
|
||||
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');
|
||||
$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);
|
||||
$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;
|
||||
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');
|
||||
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);
|
||||
,'PONO_INV'=>$pono,'VehicleNo'=>$vehicle,'MRIRNO'=>$MRIRNO);
|
||||
|
||||
$addogrmaster= $this->inwardgateregister_model->AddOGR($ogrmaster);
|
||||
|
||||
|
||||
$OGRNO = '';
|
||||
|
||||
if(count($addogrmaster)>0)
|
||||
{
|
||||
foreach($addogrmaster as $add)
|
||||
{
|
||||
if(count($addogrmaster)>0)
|
||||
{
|
||||
foreach($addogrmaster as $add)
|
||||
{
|
||||
|
||||
$OGRNO = $add->OGRNO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for($i=1;$i<=$row;$i++)
|
||||
{
|
||||
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);
|
||||
|
||||
$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 !='')
|
||||
{
|
||||
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;
|
||||
if(count($polqty)>0)
|
||||
{
|
||||
foreach ($polqty as $key )
|
||||
{
|
||||
$ReceivedQuantity=$key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
|
||||
$totalReceivedqty = $ReceivedQuantity - $Outwardtotal;
|
||||
$POMStatus=OGR_CREATED;
|
||||
|
||||
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'OGR_Status'=>$POMStatus);
|
||||
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'OGR_Status'=>$POMStatus);
|
||||
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$pono,$MaterialCode);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$pono,$MaterialCode);
|
||||
|
||||
if($pendingoutward == 0)
|
||||
{
|
||||
$Status = OGR_COMPLETE;
|
||||
$Status = OGR_COMPLETE;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$Status = OGR_PARTIAL_COMPLETE;
|
||||
$Status = OGR_PARTIAL_COMPLETE;
|
||||
}
|
||||
|
||||
|
||||
$Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$MaterialCode,'OutwardQty'=>$Outwardtotal,'Status'=>$Status,'balance_Qty'=>$balance_Qty);
|
||||
$addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline);
|
||||
$Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$MaterialCode,'OutwardQty'=>$Outwardtotal,'Status'=>$Status,'balance_Qty'=>$balance_Qty);
|
||||
$addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline);
|
||||
|
||||
//print_r($addOgrline);
|
||||
//print_r($addOgrline);
|
||||
|
||||
$ogrlineno='';
|
||||
$itemvalue='';
|
||||
$SupplierId='';
|
||||
$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');
|
||||
$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();
|
||||
if(count($addogrmaster)>0)
|
||||
{
|
||||
$ogrlinearray= $this->inwardgateregister_model->getlastogrline();
|
||||
|
||||
foreach($ogrlinearray as $og)
|
||||
{
|
||||
foreach($ogrlinearray as $og)
|
||||
{
|
||||
$ogrlineno = $og->OGRItemNO;
|
||||
}
|
||||
}
|
||||
|
||||
$polineitemvalue = $this->inwardgateregister_model->getitemvalue($pono,$MaterialCode);
|
||||
$polineitemvalue = $this->inwardgateregister_model->getitemvalue($pono,$MaterialCode);
|
||||
|
||||
foreach($polineitemvalue as $it)
|
||||
{
|
||||
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->addmaterialhistory($historydetails);
|
||||
|
||||
|
||||
|
||||
@ -951,7 +956,7 @@ $prefile =array();
|
||||
|
||||
|
||||
|
||||
$this->inwardgateregister_model->UpdateOGRMasterOGRStatus($OGRNO);
|
||||
$this->inwardgateregister_model->UpdateOGRMasterOGRStatus($OGRNO);
|
||||
|
||||
$this->inwardgateregister_model->UpdateMRIRMasterOGRStatus($MRIRNO,$OGRNO);
|
||||
|
||||
@ -960,10 +965,10 @@ $prefile =array();
|
||||
$premrirout=0;
|
||||
if(!empty($mrirout))
|
||||
{
|
||||
foreach($mrirout as $mr)
|
||||
{
|
||||
foreach($mrirout as $mr)
|
||||
{
|
||||
$premrirout= $mr->Ogr_Out_Qty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$totmrirout= $premrirout+$Outwardtotal;
|
||||
@ -980,24 +985,24 @@ $prefile =array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if((count($addogrmaster)>0)&&(count($addOgrline)>0))
|
||||
{
|
||||
echo "Saved Successfully OGR No is OGR".$OGRNO;
|
||||
if((count($addogrmaster)>0)&&(count($addOgrline)>0))
|
||||
{
|
||||
echo "Saved Successfully OGR No is OGR".$OGRNO;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if($type ==3)
|
||||
{
|
||||
$Otype='SERVICE';
|
||||
$Status ='ST063';
|
||||
$ogrmaster = array('OgrType'=>$Otype,'CreatedDate'=>$Date,'Driver'=>$driver,'VehicleNo'=>$vehicle,'Status'=>$Status);
|
||||
else if($type ==3)
|
||||
{
|
||||
$Otype='SERVICE';
|
||||
$Status ='ST063';
|
||||
$ogrmaster = array('OgrType'=>$Otype,'CreatedDate'=>$Date,'Driver'=>$driver,'VehicleNo'=>$vehicle,'Status'=>$Status);
|
||||
|
||||
$addogrmaster= $this->inwardgateregister_model->AddOGR($ogrmaster);
|
||||
|
||||
@ -1008,36 +1013,36 @@ $prefile =array();
|
||||
|
||||
//echo count($addogrmaster);
|
||||
|
||||
if(count($addogrmaster)>0)
|
||||
{
|
||||
foreach($addogrmaster as $add)
|
||||
{
|
||||
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');
|
||||
$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);
|
||||
$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);
|
||||
//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;
|
||||
if((count($addogrmaster)>0)&&(count($addOgrline>0)))
|
||||
{
|
||||
echo "Saved Successfully OGR No is OGR".$OGRNO;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -527,22 +527,25 @@ class report extends BaseController
|
||||
function Viewnormaligrfiles()
|
||||
{
|
||||
|
||||
$PO= $this->input->post('id');
|
||||
$igr= $this->input->post('id');
|
||||
$PONO= $this->input->post('id1');
|
||||
|
||||
$PONO= substr($PO,5);
|
||||
|
||||
// $PONO= substr($PO,5);
|
||||
//echo $PONO; die;
|
||||
|
||||
$igrfile= $this->dahsboard_Model->getfiles($PONO);
|
||||
$igrfile= $this->dahsboard_Model->getfiles($igr,$PONO);
|
||||
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||
$billfile = $this->dahsboard_Model->viewIGRFile1($PONO);
|
||||
$billfile = $this->dahsboard_Model->viewIGRFile1($igr,$PONO);
|
||||
|
||||
$data = array_merge($igrfile,$billfile);
|
||||
$data = array_merge($igrfile,$billfile);
|
||||
|
||||
// print_r( $data);die;
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
|
||||
public function ipurchase()
|
||||
{
|
||||
|
||||
|
||||
@ -34,11 +34,12 @@ function getfile($PONO)
|
||||
$result = $query->result_array();
|
||||
return $result;
|
||||
}
|
||||
function getfiles($PONO)
|
||||
function getfiles($igr,$PONO)
|
||||
{
|
||||
//$this->db->distinct();
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_Inwardgateregister_fileupload');
|
||||
$this->db->where('IGRNO',$igr);
|
||||
$this->db->where('PONO',$PONO);
|
||||
|
||||
|
||||
@ -49,11 +50,12 @@ function getfiles($PONO)
|
||||
}
|
||||
|
||||
|
||||
function viewIGRFile1($PONO)
|
||||
function viewIGRFile1($igr,$PONO)
|
||||
{
|
||||
$this->db->distinct();
|
||||
$this->db->select('igrm.file,igrm.PONO as pono'); //BillNo,IGRNO,FilePath,PONO
|
||||
$this->db->from('T_IGR_Master igrm');
|
||||
$this->db->where('igrm.IGRNO',$igr);
|
||||
$this->db->where('igrm.PONO',$PONO);
|
||||
|
||||
$query = $this->db->get();
|
||||
@ -1789,7 +1791,7 @@ if ($cname!= ''){
|
||||
$tempArray['total'] = $value->total;
|
||||
$tempArray['created_date'] = $value->created_date;
|
||||
$tempArray['file'] = $value->file;
|
||||
$tempArray['ifile'] = $value->created_date;
|
||||
$tempArray['ifile'] = $value->ifile;
|
||||
$tempArray['igrn'] =$value->igrn;
|
||||
|
||||
$sqli ="select FilePath as Infiles from T_Inwardgateregister_fileupload where PONO =? and IGRNO =? ";
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.dataTables_paginate {
|
||||
}
|
||||
.dataTables_paginate {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
@ -260,18 +260,19 @@
|
||||
?></span></td>
|
||||
|
||||
|
||||
|
||||
<!-- $record->IGRNO.'-'.$record->PONO -->
|
||||
|
||||
<td style="text-align:center"><span>
|
||||
<?php
|
||||
if(!empty($rel['file'])){ ?>
|
||||
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="files<?php echo $rel['pono'];?>">Download</button></a>
|
||||
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="<?php echo $rel['igrn'].'-'.$rel['pono'];?>">Download</button></a>
|
||||
|
||||
<?php } elseif(!empty($rel['ifile'])){?>
|
||||
|
||||
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel['pono'];?>">Download</button></a>
|
||||
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel['igrn'].'-'.$rel['pono'];?>">Download</button></a>
|
||||
<?php } elseif(!empty(sizeof($rel['Infiles'])) !=0){?>
|
||||
|
||||
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel['pono'];?>">Download</button></a>
|
||||
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel['igrn'].'-'.$rel['pono'];?>">Download</button></a>
|
||||
|
||||
<?php }else{
|
||||
echo "N/A";
|
||||
@ -333,9 +334,16 @@
|
||||
|
||||
$('.IGRfile').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
//alert(id);
|
||||
|
||||
var igr = id.substring(0, 9);
|
||||
//alert(igr);
|
||||
var po = id.substring(10, 33);
|
||||
//alert(po);
|
||||
|
||||
$("#Fileshow").modal("show");
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
data:{id:igr,id1:po},
|
||||
type:"POST",
|
||||
//dataType: 'json',
|
||||
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
|
||||
@ -364,12 +372,14 @@ $("#Fileshow").modal("show");
|
||||
}else{
|
||||
Filename ="BillDetails";
|
||||
PONO =item.PONO;
|
||||
BillNO =item.BillNo;
|
||||
FilePath = item.FilePath;
|
||||
}
|
||||
|
||||
}else{
|
||||
Filename = item.file;
|
||||
PONO =item.pono;
|
||||
|
||||
BillNO = '-';
|
||||
|
||||
FilePath =item.file;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
$("#client_name").select2();
|
||||
$("#item_name").select2();
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||
@ -19,7 +19,7 @@
|
||||
.dataTables_paginate {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
text-align: right;
|
||||
}
|
||||
div.dt-buttons {
|
||||
position: relative;
|
||||
@ -307,6 +307,7 @@ table.dataTable thead > tr > td.sorting {
|
||||
$tot_tot = 0;
|
||||
if(!empty($purchase)){
|
||||
foreach($purchase as $key => $rel)
|
||||
//print_r($rel);
|
||||
{
|
||||
?>
|
||||
<tr id="lastvalue">
|
||||
@ -362,14 +363,14 @@ table.dataTable thead > tr > td.sorting {
|
||||
<td id="download<?php echo $key?>" style="text-align:center"><span>
|
||||
<?php
|
||||
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
|
||||
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="files<?php echo $rel->pono;?>">Download</button></a>
|
||||
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="<?php echo $rel->igrn.'-'.$rel->pono;?>">Download</button></a>
|
||||
<?php }
|
||||
else if(!empty($rel->ifile )) { ?><!-- else if for igr file -->
|
||||
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View">
|
||||
<button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel->pono;?>">Download</button>
|
||||
<button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel->igrn.'-'.$rel->pono;?>">Download</button>
|
||||
</a>
|
||||
<?php } else if (!empty($rel->Infiles)){ ?><!-- if for Inward po file -->
|
||||
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel->pono;?>">Download</button></a>
|
||||
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm IGRfile" id="<?php echo $rel->igrn.'-'.$rel->pono;?>">Download</button></a>
|
||||
<?php } else { echo 'N/A'; } ?><!-- both inwardpo file and Igr file empty means -->
|
||||
|
||||
|
||||
@ -535,6 +536,7 @@ $(document).ready(function() {
|
||||
/** On click for Displaying File MOdal***/
|
||||
$('.splpofile').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
|
||||
$("#Fileshow").modal("show");
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
@ -567,9 +569,14 @@ $('.splpofile').click(function() {
|
||||
$('.IGRfile').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
|
||||
var igr = id.substring(0, 9);
|
||||
//alert(igr);
|
||||
var po = id.substring(10, 33);
|
||||
|
||||
$("#Fileshow").modal("show");
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
|
||||
data:{id:igr,id1:po},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>report/Viewnormaligrfiles",
|
||||
success: function(data){
|
||||
@ -594,6 +601,7 @@ $('.IGRfile').click(function() {
|
||||
}else{
|
||||
Filename ="BillDetails";
|
||||
PONO =item.PONO;
|
||||
BillNO =item.BillNo;
|
||||
FilePath = item.FilePath;
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
.modal-content
|
||||
.modal-content
|
||||
{
|
||||
width:800px ! important;
|
||||
}
|
||||
@ -394,6 +394,7 @@
|
||||
else
|
||||
{
|
||||
alert('Sorry Your File is Large To 2MB');
|
||||
|
||||
$('#billimag').val('');
|
||||
}
|
||||
}
|
||||
@ -498,6 +499,7 @@ $("#hiddenPONO").val(po);
|
||||
}else{
|
||||
Filename ="BillDetails";
|
||||
PONO =item.PONO;
|
||||
BillNO =item.BillNo;
|
||||
FilePath = item.FilePath;
|
||||
}
|
||||
|
||||
@ -672,6 +674,8 @@ counter++;
|
||||
if(bil_count>=6){
|
||||
|
||||
alert("You have to upload five files only");//this allows only 5 files;
|
||||
$('#addmorebutton').hide();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -697,7 +701,7 @@ counter++;
|
||||
// '<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstant+'" onclick="removeRow(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
|
||||
'<div class="col-md-2">'+
|
||||
'<label><br><br></label>'+
|
||||
'<button class="btn btn-primary add add_this" id="addbtn" onclick="addRow()">ADD</button></div>'+
|
||||
'<button class="btn btn-primary" type ="button" id="addbtn" onclick="addRow()">ADD</button></div>'+
|
||||
'</div>'+
|
||||
|
||||
'</div>';
|
||||
@ -788,7 +792,7 @@ counter++;
|
||||
success:function(data) {
|
||||
if(data){
|
||||
alert(data);
|
||||
|
||||
window.location.reload();
|
||||
$('.content').loader('hide');
|
||||
// $('#spl').find('td').eq(5).text(filename[2]);
|
||||
$('#billModel').modal('hide');
|
||||
@ -798,4 +802,3 @@ counter++;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user