igr file
This commit is contained in:
parent
b24a58b44b
commit
5c210411dc
@ -37,7 +37,7 @@ class inwardgateregister extends BaseController
|
|||||||
|
|
||||||
function viewIGRDetails()
|
function viewIGRDetails()
|
||||||
{
|
{
|
||||||
$this->load->model('inwardgateregister_model');
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details';
|
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register Details';
|
||||||
$data['IGR']= $this->inwardgateregister_model->igrListing();
|
$data['IGR']= $this->inwardgateregister_model->igrListing();
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ class inwardgateregister extends BaseController
|
|||||||
|
|
||||||
function addloadfile()
|
function addloadfile()
|
||||||
{
|
{
|
||||||
|
$upfiles = '';
|
||||||
$pono= $this->input->post('PONO');
|
$pono= $this->input->post('PONO');
|
||||||
|
|
||||||
$igr= $this->input->post('igr');
|
$igr= $this->input->post('igr');
|
||||||
@ -408,63 +408,63 @@ function edituploadfile()
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function addNewigr()
|
function addNewigr()
|
||||||
{
|
{
|
||||||
// echo "add";
|
// echo "add";
|
||||||
// die();
|
// die();
|
||||||
|
|
||||||
$PONO = $this->input->post('PONO');
|
$PONO = $this->input->post('PONO');
|
||||||
|
|
||||||
$DeliveryChellanOrInvoiceNo = $this->input->post('InvoiceNo');
|
$DeliveryChellanOrInvoiceNo = $this->input->post('InvoiceNo');
|
||||||
|
|
||||||
$DeliveryChellan = $this->input->post('InvoiceDate');
|
$DeliveryChellan = $this->input->post('InvoiceDate');
|
||||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||||
|
|
||||||
$Mat_Rcvd_Dt = $this->input->post('MaterialRcvdDate');
|
$Mat_Rcvd_Dt = $this->input->post('MaterialRcvdDate');
|
||||||
$MaterialRcvdDt = $this->getDateformat($Mat_Rcvd_Dt);
|
$MaterialRcvdDt = $this->getDateformat($Mat_Rcvd_Dt);
|
||||||
|
|
||||||
$VehicleNo = $this->input->post('VehicleNo');
|
$VehicleNo = $this->input->post('VehicleNo');
|
||||||
$CourierNo = $this->input->post('CourierNo');
|
$CourierNo = $this->input->post('CourierNo');
|
||||||
|
|
||||||
|
|
||||||
$CreatedBy = $this->session->userdata('userId');
|
$CreatedBy = $this->session->userdata('userId');
|
||||||
//$Remarks = $this->input->post('Remarks');
|
//$Remarks = $this->input->post('Remarks');
|
||||||
$RowCount = $this->input->post('txtRowCount');
|
$RowCount = $this->input->post('txtRowCount');
|
||||||
//echo $RowCount;
|
//echo $RowCount;
|
||||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||||
$createddt = $dt->format('Y-m-d H:i:s');
|
$createddt = $dt->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
$IGRStatus = IGR_CREATED;
|
$IGRStatus = IGR_CREATED;
|
||||||
$document = null;
|
$document = null;
|
||||||
|
|
||||||
// $fs = 0;
|
// $fs = 0;
|
||||||
// // if(!empty($_FILES['myfile']['name']))
|
// // if(!empty($_FILES['myfile']['name']))
|
||||||
// // {
|
// // {
|
||||||
// // //echo "FILE AVAILABLE";
|
// // //echo "FILE AVAILABLE";
|
||||||
// // $config['file_name'] = $_FILES['myfile']['name'];
|
// // $config['file_name'] = $_FILES['myfile']['name'];
|
||||||
// // $config['upload_path'] = 'uploads/Igrfiles/';
|
// // $config['upload_path'] = 'uploads/Igrfiles/';
|
||||||
// // $config['allowed_types'] = 'png|jpg|jpeg|pdf|docx';
|
// // $config['allowed_types'] = 'png|jpg|jpeg|pdf|docx';
|
||||||
// // $path = $config['upload_path'];
|
// // $path = $config['upload_path'];
|
||||||
// // $filename = $config['file_name'];
|
// // $filename = $config['file_name'];
|
||||||
// // $document = $path.$filename;
|
// // $document = $path.$filename;
|
||||||
// // //echo $document;
|
// // //echo $document;
|
||||||
// // $fs = $this->uploadFile();
|
// // $fs = $this->uploadFile();
|
||||||
// // $document = $path.$fs;
|
// // $document = $path.$fs;
|
||||||
// // //echo $document;die();
|
// // //echo $document;die();
|
||||||
// // }
|
// // }
|
||||||
|
|
||||||
// //echo $RowCount;
|
// //echo $RowCount;
|
||||||
|
|
||||||
$igr = array();
|
$igr = array();
|
||||||
|
|
||||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$MaterialRcvdDt,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
|
$igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$MaterialRcvdDt,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
|
||||||
//print_r($igr);die();
|
//print_r($igr);die();
|
||||||
|
|
||||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------JUN 11 change----------------------------------------------------*/
|
/*---------------------------------------JUN 11 change----------------------------------------------------*/
|
||||||
$IGRNO = '';
|
$IGRNO = '';
|
||||||
if(count($igrM)>0)
|
if(count($igrM)>0)
|
||||||
{
|
{
|
||||||
@ -555,136 +555,145 @@ $prefile =array();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$OGRStatus=IGR_CREATED;
|
$OGRStatus=IGR_CREATED;
|
||||||
$check_OGRPO= $this->inwardgateregister_model->update_OGR($PONO,$OGRStatus);
|
$check_OGRPO= $this->inwardgateregister_model->update_OGR($PONO,$OGRStatus);
|
||||||
|
|
||||||
|
|
||||||
$IGRNO = '';
|
$IGRNO = '';
|
||||||
if(count($igrM)>0)
|
if(count($igrM)>0)
|
||||||
{
|
{
|
||||||
foreach ($igrM as $key ) {
|
foreach ($igrM as $key ) {
|
||||||
$IGRNO=$key->IGRNO;
|
$IGRNO=$key->IGRNO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//echo $IGRNO;
|
//echo $IGRNO;
|
||||||
|
|
||||||
$IGRItemStatus = REQITEM_NEW;
|
$IGRItemStatus = REQITEM_NEW;
|
||||||
|
$TotalPendingQty = '';
|
||||||
|
|
||||||
for ($i = 1; $i <= $RowCount; $i++)
|
for ($i = 1; $i <= $RowCount; $i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
$MaterialCode = trim($this->input->post('MaterialCode'.$i));
|
$MaterialCode = trim($this->input->post('MaterialCode'.$i));
|
||||||
|
|
||||||
$QuantityAsPerInvoice = trim($this->input->post('txtQuantityAsPerInvoice'.$i));
|
$QuantityAsPerInvoice = trim($this->input->post('txtQuantityAsPerInvoice'.$i));
|
||||||
|
|
||||||
$OrderedQuantity = trim($this->input->post('OrderedQuantity'.$i));
|
$OrderedQuantity = trim($this->input->post('OrderedQuantity'.$i));
|
||||||
|
|
||||||
$ReceivedQty = trim($this->input->post('txtReceivedQuantity'.$i));
|
$ReceivedQty = trim($this->input->post('txtReceivedQuantity'.$i));
|
||||||
|
|
||||||
$PendingQty = $this->input->post('txtPendingQty'.$i);
|
$PendingQty = $this->input->post('txtPendingQty'.$i);
|
||||||
//echo $QuantityAsPerInvoice;
|
//echo $QuantityAsPerInvoice;
|
||||||
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
||||||
//echo ' ';
|
//echo ' ';
|
||||||
|
$TotalPendingQty = $TotalPendingQty + $PendingQty;
|
||||||
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
|
|
||||||
{
|
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
|
||||||
$Remarks = $this->input->post('txtRemarks'.$i);
|
{
|
||||||
$ItemStatus = '';
|
$Remarks = $this->input->post('txtRemarks'.$i);
|
||||||
//if($QuantityAsPerInvoice == $OrderedQuantity)
|
$ItemStatus = '';
|
||||||
|
//if($QuantityAsPerInvoice == $OrderedQuantity)
|
||||||
if($PendingQty == 0.00 )
|
|
||||||
|
if($PendingQty == 0.00 )
|
||||||
{
|
|
||||||
$ItemStatus = IGR_CREATED;
|
{
|
||||||
|
$ItemStatus = IGR_CREATED;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
|
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
$CreatedBy = $this->session->userdata('userId');
|
$CreatedBy = $this->session->userdata('userId');
|
||||||
|
|
||||||
|
|
||||||
$bankstatus = NO_PAIDIGR;
|
$bankstatus = NO_PAIDIGR;
|
||||||
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt,'BankStatus'=>$bankstatus);
|
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt,'BankStatus'=>$bankstatus);
|
||||||
|
|
||||||
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||||
|
|
||||||
$igrlineno ='';
|
$igrlineno ='';
|
||||||
|
|
||||||
if(!empty($igrD))
|
if(!empty($igrD))
|
||||||
{
|
{
|
||||||
foreach($igrD as $ig)
|
foreach($igrD as $ig)
|
||||||
{
|
{
|
||||||
$igrlineno = $ig->IGRItemNo;
|
$igrlineno = $ig->IGRItemNo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$itemvalue='';
|
$itemvalue='';
|
||||||
$SupplierId='';
|
$SupplierId='';
|
||||||
$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;
|
$itemvalue =$it->Rate;
|
||||||
$SupplierId =$it->SupplierID;
|
$SupplierId =$it->SupplierID;
|
||||||
}
|
}
|
||||||
|
|
||||||
$historydetails = array('MaterialCode'=>$MaterialCode,'Transaction_type'=>"Add",'Ref_Type'=>"IGR",'Ref_No'=>$igrlineno,'Quantity'=>$QuantityAsPerInvoice,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt,'SupplierID'=>$SupplierId,'ItemValue'=>$itemvalue);
|
$historydetails = array('MaterialCode'=>$MaterialCode,'Transaction_type'=>"Add",'Ref_Type'=>"IGR",'Ref_No'=>$igrlineno,'Quantity'=>$QuantityAsPerInvoice,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt,'SupplierID'=>$SupplierId,'ItemValue'=>$itemvalue);
|
||||||
|
|
||||||
|
|
||||||
$this->inwardgateregister_model->addmaterialhistory($historydetails);
|
$this->inwardgateregister_model->addmaterialhistory($historydetails);
|
||||||
|
|
||||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||||
$av_qty=0;
|
$av_qty=0;
|
||||||
if(!empty($get_pre_qty))
|
if(!empty($get_pre_qty))
|
||||||
{
|
{
|
||||||
foreach($get_pre_qty as $gt)
|
foreach($get_pre_qty as $gt)
|
||||||
{
|
{
|
||||||
$av_qty=$gt->Current_stock;
|
$av_qty=$gt->Current_stock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
$currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
||||||
|
|
||||||
|
|
||||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||||
|
|
||||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
$this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||||
|
|
||||||
|
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
|
||||||
|
|
||||||
|
$ReceivedQuantity = 0.00;
|
||||||
|
if(count($Recqty)>0)
|
||||||
|
{
|
||||||
|
foreach ($Recqty as $key ) {
|
||||||
|
$ReceivedQuantity=$key->ReceivedQuantity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
||||||
|
|
||||||
|
//echo '';
|
||||||
|
|
||||||
|
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'Status'=>$ItemStatus,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt );
|
||||||
|
|
||||||
|
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->inwardgateregister_model->UpdatePOMaster($PONO,$CreatedBy);
|
||||||
|
if($TotalPendingQty == 0.00){
|
||||||
|
|
||||||
|
$Newstatus = array('Status'=>IGR_CREATED);
|
||||||
|
|
||||||
|
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO,$Newstatus);
|
||||||
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
|
$this->inwardgateregister_model->pomasterupdatestatus($PONO,$Newstatus);
|
||||||
$ReceivedQuantity = 0.00;
|
}
|
||||||
if(count($Recqty)>0)
|
else{ /*echo 'error' ;*/ }
|
||||||
{
|
echo "<script>alert('Successfully Created IGR Number:$IGRNO'); window.location.href='viewIGRDetails';</script>";
|
||||||
foreach ($Recqty as $key ) {
|
|
||||||
$ReceivedQuantity=$key->ReceivedQuantity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
|
||||||
|
|
||||||
//echo '';
|
|
||||||
|
|
||||||
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'Status'=>$ItemStatus,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt );
|
|
||||||
|
|
||||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
$this->inwardgateregister_model->UpdatePOMaster($PONO,$CreatedBy);
|
|
||||||
echo "<script>alert('Successfully Created IGR Number:$IGRNO'); window.location.href='viewIGRDetails';</script>";
|
|
||||||
//echo 'Successfully Created IGR Number:'. $IGRNO;
|
//echo 'Successfully Created IGR Number:'. $IGRNO;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ViewIGR()
|
function ViewIGR()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -532,9 +532,13 @@ class report extends BaseController
|
|||||||
$PONO= substr($PO,5);
|
$PONO= substr($PO,5);
|
||||||
//echo $PONO; die;
|
//echo $PONO; die;
|
||||||
|
|
||||||
$data = $this->dahsboard_Model->getfiles($PONO);
|
$igrfile= $this->dahsboard_Model->getfiles($PONO);
|
||||||
|
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||||
|
$billfile = $this->dahsboard_Model->viewIGRFile1($PONO);
|
||||||
|
|
||||||
// print_r( $data);die;
|
$data = array_merge($igrfile,$billfile);
|
||||||
|
|
||||||
|
// print_r( $data);die;
|
||||||
|
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,24 @@ function getfiles($PONO)
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function viewIGRFile1($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.PONO',$PONO);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
$result = $query->result();
|
||||||
|
// print_r($result);die;
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function selectigrfiles()
|
function selectigrfiles()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -128,6 +128,27 @@ return $afftectedRows;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function viewIGRFile1($IGRNO)
|
||||||
|
{
|
||||||
|
$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->join('T_Inwardgateregister_fileupload igrf','igrm.IGRNO = igrf.IGRNO','left');
|
||||||
|
//$this->db->join('T_IGR_Details igrd','igrm.IGRNO = igrd.IGRNO','left');
|
||||||
|
|
||||||
|
$this->db->where('igrm.IGRNO',$IGRNO);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
$result = $query->result();
|
||||||
|
// print_r($result);die;
|
||||||
|
//print_r($this->db->last_query());
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getpurchaseorder()
|
function getpurchaseorder()
|
||||||
@ -804,5 +825,32 @@ function getPOmaterial($PONO)
|
|||||||
$r = $this->db->affected_rows();
|
$r = $this->db->affected_rows();
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
function getpolineqty($NewPO)
|
||||||
|
{
|
||||||
|
$this->db->select('sum(Quantity)as Qty,sum(ReceivedQuantity)as rec');
|
||||||
|
$this->db->from('T_PurchaseOrder_LineItem');
|
||||||
|
$this->db->where('PONO',$NewPO);
|
||||||
|
|
||||||
|
$query = $this->db->get();
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function POLineItemsupdatestatus($PONO,$Newstatus)
|
||||||
|
{
|
||||||
|
$this->db->where('PONO',$PONO);
|
||||||
|
$this->db->update('T_PurchaseOrder_LineItem',$Newstatus);
|
||||||
|
$update = $this->db->affected_rows();
|
||||||
|
return $update;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function pomasterupdatestatus($PONO,$Newstatus)
|
||||||
|
{
|
||||||
|
$this->db->where('PONO',$PONO);
|
||||||
|
$this->db->update('T_PurchaseOrder_Master',$Newstatus);
|
||||||
|
$update = $this->db->affected_rows();
|
||||||
|
return $update;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
}
|
}
|
||||||
.btn-success {
|
.btn-success {
|
||||||
background-color: #3c8dbc;
|
background-color: #3c8dbc;
|
||||||
border-color: #3c8dbc;
|
border-color: #3c8dbc;
|
||||||
@ -266,7 +266,10 @@
|
|||||||
if(!empty($rel['file'])){ ?>
|
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="files<?php echo $rel['pono'];?>">Download</button></a>
|
||||||
|
|
||||||
<?php } elseif(!empty(sizeof($rel['Infiles'])) !=0){?>
|
<?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>
|
||||||
|
<?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="files<?php echo $rel['pono'];?>">Download</button></a>
|
||||||
|
|
||||||
@ -339,26 +342,70 @@ $("#Fileshow").modal("show");
|
|||||||
success: function(data){
|
success: function(data){
|
||||||
//console.log((data));
|
//console.log((data));
|
||||||
|
|
||||||
|
// var trHTML = '';
|
||||||
|
// $.each($.parseJSON(data), function (i, item) {
|
||||||
var trHTML = '';
|
var trHTML = '';
|
||||||
$.each($.parseJSON(data), function (i, item) {
|
|
||||||
|
var trHTML = '';
|
||||||
|
var FilePath ='';
|
||||||
|
var Filename = '';
|
||||||
|
var PONO ='';
|
||||||
|
var BillNO ='';
|
||||||
|
$.each($.parseJSON(data), function (i, item) {
|
||||||
|
|
||||||
|
if(item.file == null)
|
||||||
|
{ if(item.Remarks ==null)
|
||||||
|
{
|
||||||
|
//alert()
|
||||||
|
PONO =item.PONO;
|
||||||
|
BillNO =item.BillNo;
|
||||||
|
Filename =item.FilePath;
|
||||||
|
FilePath = "<?php echo base_url()?>uploads/Igrfiles/"+item.FilePath;
|
||||||
|
}else{
|
||||||
|
Filename ="BillDetails";
|
||||||
|
PONO =item.PONO;
|
||||||
|
FilePath = item.FilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
Filename = item.file;
|
||||||
|
PONO =item.pono;
|
||||||
|
BillNO = '-';
|
||||||
|
|
||||||
|
FilePath =item.file;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
i=i+1;
|
// i=i+1;
|
||||||
trHTML += '<tr>' +
|
// trHTML += '<tr>' +
|
||||||
'<td align="right">' + i + '</td>' +
|
// '<td align="right">' + i + '</td>' +
|
||||||
|
|
||||||
'<td>' + item.BillNo+ '</td>' +
|
// '<td>' + item.BillNo+ '</td>' +
|
||||||
'<td>' + item.PONO+ '</td>' +
|
// '<td>' + item.PONO+ '</td>' +
|
||||||
|
|
||||||
'<td><a target="_blank" href = <?php echo base_url()?>uploads/Igrfiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
|
// '<td><a target="_blank" href = <?php echo base_url()?>uploads/Igrfiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
|
||||||
|
|
||||||
// '<td>' +item.FilePath+"<?php echo base_url().'uploads/BillFiles/'?>"> +'</td>'
|
// // '<td>' +item.FilePath+"<?php echo base_url().'uploads/BillFiles/'?>"> +'</td>'
|
||||||
|
|
||||||
'</tr>';
|
// '</tr>';
|
||||||
|
if(Filename != null)
|
||||||
|
{
|
||||||
|
i=i+1;
|
||||||
|
trHTML += '<tr id='+i+'>' +
|
||||||
|
'<td align="right">' + i + '</td>' +
|
||||||
|
'<td id="billno'+i+'">' + BillNO+ '</td>' +
|
||||||
|
'<td>' + PONO+ '</td>' +
|
||||||
|
|
||||||
|
'<td id="file'+i+'"><a target="_blank" href = '+FilePath+'>'+ Filename +'</a></td>' +
|
||||||
|
|
||||||
|
// '<td name="filepathname" id="filepathname" onclick="openbillmodel('+i+');"><i class="fa fa-pencil"></i></td>' +
|
||||||
|
'</tr>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -364,9 +364,9 @@ table.dataTable thead > tr > td.sorting {
|
|||||||
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
|
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="files<?php echo $rel->pono;?>">Download</button></a>
|
||||||
<?php }
|
<?php }
|
||||||
else if(!empty($rel->ifile )) { ?><!-- else if for igr file -->
|
else if(!empty($rel->ifile )) { ?><!-- else if for igr file -->
|
||||||
<a target="_blank" href="<?php echo base_url().''.$rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View">
|
<a target="_blank" class="yourlink" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View">
|
||||||
<button class="btn btn-info btn-sm">Download</button>
|
<button class="btn btn-info btn-sm IGRfile" id="files<?php echo $rel->pono;?>">Download</button>
|
||||||
</a>
|
</a>
|
||||||
<?php } else if (!empty($rel->Infiles)){ ?><!-- if for Inward po file -->
|
<?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="files<?php echo $rel->pono;?>">Download</button></a>
|
||||||
@ -566,6 +566,7 @@ $('.splpofile').click(function() {
|
|||||||
|
|
||||||
$('.IGRfile').click(function() {
|
$('.IGRfile').click(function() {
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
|
|
||||||
$("#Fileshow").modal("show");
|
$("#Fileshow").modal("show");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:{id:id},
|
data:{id:id},
|
||||||
@ -575,15 +576,59 @@ $('.IGRfile').click(function() {
|
|||||||
|
|
||||||
var trHTML = '';
|
var trHTML = '';
|
||||||
|
|
||||||
$.each($.parseJSON(data), function (i, item) {
|
var trHTML = '';
|
||||||
|
var FilePath ='';
|
||||||
|
var Filename = '';
|
||||||
|
var PONO ='';
|
||||||
|
var BillNO ='';
|
||||||
|
$.each($.parseJSON(data), function (i, item) {
|
||||||
|
|
||||||
|
if(item.file == null)
|
||||||
|
{ if(item.Remarks ==null)
|
||||||
|
{
|
||||||
|
//alert()
|
||||||
|
PONO =item.PONO;
|
||||||
|
BillNO =item.BillNo;
|
||||||
|
Filename =item.FilePath;
|
||||||
|
FilePath = "<?php echo base_url()?>uploads/Igrfiles/"+item.FilePath;
|
||||||
|
}else{
|
||||||
|
Filename ="BillDetails";
|
||||||
|
PONO =item.PONO;
|
||||||
|
FilePath = item.FilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
Filename = item.file;
|
||||||
|
PONO =item.pono;
|
||||||
|
BillNO = '-';
|
||||||
|
|
||||||
|
FilePath =item.file;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
i=i+1;
|
// i=i+1;
|
||||||
trHTML += '<tr>' +
|
// trHTML += '<tr>' +
|
||||||
'<td align="right">' + i + '</td>' +
|
// '<td align="right">' + i + '</td>' +
|
||||||
'<td>' + item.BillNo+ '</td>' +
|
// '<td>' + item.BillNo+ '</td>' +
|
||||||
'<td>' + item.PONO+ '</td>' +
|
// '<td>' + item.PONO+ '</td>' +
|
||||||
'<td><a target="_blank" href = <?php echo base_url()?>uploads/Igrfiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
|
// '<td><a target="_blank" href = <?php echo base_url()?>uploads/Igrfiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
|
||||||
'</tr>';
|
// '</tr>';
|
||||||
|
|
||||||
|
if(Filename != null)
|
||||||
|
{
|
||||||
|
i=i+1;
|
||||||
|
trHTML += '<tr id='+i+'>' +
|
||||||
|
'<td align="right">' + i + '</td>' +
|
||||||
|
'<td id="billno'+i+'">' + BillNO+ '</td>' +
|
||||||
|
'<td>' + PONO+ '</td>' +
|
||||||
|
|
||||||
|
'<td id="file'+i+'"><a target="_blank" href = '+FilePath+'>'+ Filename +'</a></td>' +
|
||||||
|
|
||||||
|
// '<td name="filepathname" id="filepathname" onclick="openbillmodel('+i+');"><i class="fa fa-pencil"></i></td>' +
|
||||||
|
'</tr>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user