bankst and bankrp mulfile popmodal

This commit is contained in:
venbatechnologies 2018-07-20 14:52:59 +05:30
parent b4bd0a9227
commit 23aaebcbf3
6 changed files with 313 additions and 53 deletions

View File

@ -233,7 +233,7 @@ $route['Bankingstatement']= "cashbook/bankdata";
$route['Debitstatement']= "cashbook/bankdebitdata"; $route['Debitstatement']= "cashbook/bankdebitdata";
$route['Cashstatement']= "cashbook/cashreceipt"; $route['Cashstatement']= "cashbook/cashreceipt";
$route['BankingFile']= "cashbook/bankfileupload"; $route['BankingFile']= "cashbook/bankfileupload";
$route['Filelist']="cashbook/filelist"; //$route['Filelist']="cashbook/filelist";
//$route['Bankingrecord']= "cashbook/bankdata"; //$route['Bankingrecord']= "cashbook/bankdata";
$route['Bankamountpaid']= "cashbook/amountpaid"; $route['Bankamountpaid']= "cashbook/amountpaid";
$route['Bankamountreceived']= "cashbook/amountreceived"; $route['Bankamountreceived']= "cashbook/amountreceived";

View File

@ -1008,13 +1008,36 @@ class cashbook extends BaseController
$this->loadViews("bankinvoice", $this->global,$data,NULL); $this->loadViews("bankinvoice", $this->global,$data,NULL);
} }
public function filelist() // public function filelist()
{ // {
$pono= $this->input->post('pono'); // $pono= $this->input->post('pono');
$data = $this->cashbook_model->debitimage($pono); // $data = $this->cashbook_model->debitimage($pono);
// echo json_encode($data);
// }
/*this function used to array merge files view*/
function IGRFilelist()
{
$igrno= $this->input->post('igrno');
$igrsingle = $this->cashbook_model->igrmastersingle($igrno);
$igrmultiple =$this->cashbook_model->igrmastermultiple($igrno);
$data = array_merge($igrsingle,$igrmultiple);
echo json_encode($data); echo json_encode($data);
}
}
/*end*/
public function filelist()
{
$igrno= $this->input->post('igrno');
$data = $this->cashbook_model->debitimage($igrno);
echo json_encode($data);
}
public function mappingpo() public function mappingpo()
{ {

View File

@ -428,15 +428,53 @@ function receiptdata()
return $query->result(); return $query->result();
} }
function igrmastersingle($igrno){
$this->db->select('IGRNO,file,PONO as pono');
$this->db->from('T_IGR_Master');
$this->db->where('IGRNO',$igrno);
$query = $this->db->get();
return $query->result();
}
function igrmastermultiple($igrno){
$this->db->select('BillNo,IGRNO,FilePath,PONO');
$this->db->from('T_Inwardgateregister_fileupload');
$this->db->where('IGRNO',$igrno);
$query = $this->db->get();
return $query->result();
}
// function debitpolist($bankid)
// {
// $this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit,
// bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath');
// $this->db->from ('T_Bankmappingpo bp');
// $this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left');
// $this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
// $this->db->join ('T_bankreport br','br.ID=bp.mid');
// $this->db->where('bp.IsActive',1);
// $this->db->where('bp.mid',$bankid);
// // $this->db->where('igrde.BankStatus !=','ST072');
// $this->db->group_by('bp.id');
// $query = $this->db->get();
// return $query->result();
// }
function debitpolist($bankid) function debitpolist($bankid)
{ {
$this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit, $this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit,
bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath'); bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath,inward.FilePath as Fpath');
$this->db->from ('T_Bankmappingpo bp'); $this->db->from ('T_Bankmappingpo bp');
$this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left'); $this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left'); $this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left');
$this->db->join ('T_bankreport br','br.ID=bp.mid'); $this->db->join ('T_bankreport br','br.ID=bp.mid');
$this->db->where('bp.IsActive',1); $this->db->where('bp.IsActive',1);
$this->db->where('bp.mid',$bankid); $this->db->where('bp.mid',$bankid);
// $this->db->where('igrde.BankStatus !=','ST072'); // $this->db->where('igrde.BankStatus !=','ST072');
@ -448,29 +486,69 @@ function debitpolist($bankid)
//function for image //function for image
function debitimage($pono) // function debitimage($pono)
// {
// $this->db->select('bp.PONO,bp.mid,bu.FilePath,bu.BillNo,bu.IGRNO');
// $this->db->from ('T_Bankmappingpo bp');
// $this->db->join ('T_PurchaseOrder_BillUpload bu','bp.PONO = bu.PONO','left');
// $this->db->where('bp.PONO',$pono);
// $this->db->group_by('bu.BillNo');
// $query = $this->db->get();
// return $query->result();
// }
function debitimage($igrno)
{ {
$this->db->select('bp.PONO,bp.mid,bu.FilePath,bu.BillNo,bu.IGRNO'); $this->db->select('*');
$this->db->from ('T_Bankmappingpo bp'); $this->db->from ('T_PurchaseOrder_BillUpload');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bp.PONO = bu.PONO','left'); $this->db->where('IGRNO',$igrno);
$this->db->where('bp.PONO',$pono); $query = $this->db->get();
$this->db->group_by('bu.BillNo'); $result = $query->result();
$query = $this->db->get(); return $result;
return $query->result();
} }
// function debitpolistfilter($SupplierName,$fdate,$tdate)
// {
// $this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount,
// bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo');
// $this->db->from ('T_Bankmappingpo bm');
// $this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO');
// //$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO');
// $this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername');
// $this->db->join ('T_bankreport br','br.ID=bm.mid');
// $this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
// if($fdate!='' && $tdate!='')
// {
// $this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
// }
// if($SupplierName!='')
// {
// $this->db->where('sd.SupplierID',$SupplierName);
// }
// $this->db->where('bm.IsActive',1);
// $this->db->group_by('bm.id');
// $query = $this->db->get();
// return $query->result();
// }
function debitpolistfilter($SupplierName,$fdate,$tdate) function debitpolistfilter($SupplierName,$fdate,$tdate)
{ {
$this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount, $this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount,
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo'); bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,inward.FilePath as Fpath');
$this->db->from ('T_Bankmappingpo bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO'); $this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO');
//$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO'); //$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO');
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername'); $this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername');
$this->db->join ('T_bankreport br','br.ID=bm.mid'); $this->db->join ('T_bankreport br','br.ID=bm.mid');
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left'); $this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
if($fdate!='' && $tdate!='') if($fdate!='' && $tdate!='')
{ {
@ -487,7 +565,7 @@ function debitpolist($bankid)
return $query->result(); return $query->result();
} }
function creditinvoicelist($bankid) function creditinvoicelist($bankid)
{ {
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid, $this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,

View File

@ -183,7 +183,8 @@ if(!empty($amountpaid))
if(!empty($bankdebit)){ if(!empty($bankdebit)){
foreach($bankdebit as $ap) foreach($bankdebit as $ap)
{ {
// $id=$ap->id; // $id=$ap->id;
//print_r($ap);
?> ?>
<tr> <tr>
@ -203,18 +204,32 @@ if(!empty($amountpaid))
<td align="left" id="btp<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td> <td align="left" id="btp<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td>
<td align="left" id="ap<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td> <td align="left" id="ap<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td>
<?php <?php
if($ap->file=='') if($ap->file !='')
{
?>
<td>N/A</td>
<?php
}
else
{ {
?> ?>
<td> <a target="_blank" href="<?php echo base_url().''.$ap->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm">Download</button></a> </td>
<?php
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
<?php
} }
else if($ap->Fpath !='')
{
?>
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
<?php
} else
{ ?>
<td>N/A</td>
<?php }
if($ap->FilePath=='') if($ap->FilePath=='')
{ {
@ -297,11 +312,7 @@ var bankingclear=$('#bankingbalclear'+i).val();
var clearedbalance=$('#clearbal'+i).val(); var clearedbalance=$('#clearbal'+i).val();
$.ajax( $.ajax({
{
data:{mappingid:mappingid,Totalpoamount:totalamount,paidamount:paidamount,balancetopay:balancetopay,IGRItemNo:Igritemno,bankid:bankid,balancetobankingclear:bankingclear,clearbalance:clearedbalance}, data:{mappingid:mappingid,Totalpoamount:totalamount,paidamount:paidamount,balancetopay:balancetopay,IGRItemNo:Igritemno,bankid:bankid,balancetobankingclear:bankingclear,clearbalance:clearedbalance},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>DeletePo", url:"<?php echo base_url() ?>DeletePo",
@ -322,14 +333,14 @@ $.ajax(
} }
function pono(i) function pono(i)
{ {
var pono=$('#pono'+i).text(); var igrno=$('#igrno'+i).text();
$("#Fileshow").modal('show'); $("#Fileshow").modal('show');
$.ajax( $.ajax(
{ {
data:{pono:pono}, data:{igrno:igrno},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>Filelist", url:"<?php echo base_url() ?>cashbook/filelist",
success:function(data) success:function(data)
{ {
@ -419,8 +430,80 @@ $( function() {
} }
} ); } );
function igrno(i)
{
var igrno=$('#igrno'+i).text();
$("#Fileshow").modal('show');
$.ajax(
{
data:{igrno:igrno},
type:"POST",
url:"<?php echo base_url() ?>cashbook/IGRFilelist",
success:function(data)
{
var trHTML = '';
var FilePath ='';
var Filename = '';
var PONO ='';
var BillNO ='';
i=0;
$.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;
BillNO =item.BillNo;
FilePath = item.FilePath;
}
}else{
Filename = item.file;
PONO =item.pono;
BillNO = '-';
FilePath =item.file;
}
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>';
}
});
$("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
}
</script> </script>

View File

@ -270,7 +270,7 @@ if(!empty($mapping))
if(!empty($mapping)){ if(!empty($mapping)){
foreach($mapping as $ap) foreach($mapping as $ap)
{ {
// print_r($mapping );die(); //print_r($ap);
?> ?>
<tr> <tr>
@ -289,28 +289,32 @@ if(!empty($mapping))
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td> <td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td>
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td> <td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td>
<?php <?php
if($ap->file=='') if($ap->file !='')
{ {
?> ?>
<td>No File</td>
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
<?php <?php
} }
else else if($ap->Fpath !='')
{ {
?> ?>
<td> <a target="_blank" href="<?php echo base_url().''.$ap->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm">Download</button></a> </td> <td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrno(<?php echo $i ?>)"></i></a> </td>
<?php <?php
} } else
{ ?>
<td>N/A</td>
?>
<?php
<?php }
if($ap->FilePath=='') if($ap->FilePath=='')
{ {
?> ?>
@ -324,7 +328,7 @@ if(!empty($mapping))
?> ?>
<td> <td>
<a data-toggle="tooltip" ><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> - Click here to Delete details" onclick="pono(<?php echo $i ?>)"></i>&nbsp;&nbsp;&nbsp;</a> <a data-toggle="tooltip" ><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> - Attachment Available for Download/view" onclick="pono(<?php echo $i ?>)"></i>&nbsp;&nbsp;&nbsp;</a>
</td> </td>
<!--<td> <button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal">Download</button></td>--> <!--<td> <button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal">Download</button></td>-->
@ -480,14 +484,15 @@ if(!empty($mapping))
function pono(i) function pono(i)
{ {
var pono=$('#pono'+i).text(); var igrno=$('#igrno'+i).text();
//alert(igrno);
$("#Fileshow").modal('show'); $("#Fileshow").modal('show');
$.ajax( $.ajax(
{ {
data:{pono:pono}, data:{igrno:igrno},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>Filelist", url:"<?php echo base_url() ?>cashbook/filelist",
success:function(data) success:function(data)
{ {
@ -538,8 +543,79 @@ function pono(i)
] ]
} ); } );
} ); } );
</script>
function igrno(i)
{
var igrno=$('#igrno'+i).text();
$("#Fileshow").modal('show');
$.ajax(
{
data:{igrno:igrno},
type:"POST",
url:"<?php echo base_url() ?>cashbook/IGRFilelist",
success:function(data)
{
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;
BillNO =item.BillNo;
FilePath = item.FilePath;
}
}else{
Filename = item.file;
PONO =item.pono;
BillNO = '-';
FilePath =item.file;
}
i=0;
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>';
}
});
$("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
}
</script>

File diff suppressed because one or more lines are too long