bankstatement file downloading option

This commit is contained in:
gayathri1990 2018-05-12 12:32:02 +05:30
parent 7cbafd5994
commit 1b9ae29251
7 changed files with 67 additions and 51 deletions

View File

@ -1103,6 +1103,8 @@ class cashbook extends BaseController
$status=PARTIALLY_RECEIVED; $status=PARTIALLY_RECEIVED;
} }
$invoicemaster= array('receivedstatus'=>$status); $invoicemaster= array('receivedstatus'=>$status);
print_r($invoicemaster);
//die();
$result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid); $result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid);
echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>"; echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>";

View File

@ -0,0 +1,7 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
ERROR - 2018-05-12 08:49:52 --> Severity: Notice --> Undefined variable: balancetoreceived C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 1038
ERROR - 2018-05-12 08:49:52 --> Severity: Notice --> Undefined variable: clearedblnce C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 1049
ERROR - 2018-05-12 08:49:52 --> Severity: Notice --> Undefined variable: balancetoreceived C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 1049
ERROR - 2018-05-12 08:49:53 --> Query error: Unknown column 'receivedstatus' in 'field list'
ERROR - 2018-05-12 08:49:54 --> Query error: Unknown column 'receivedstatus' in 'field list'

View File

@ -235,17 +235,19 @@ function bankstatement($fdate,$tdate,$fa,$aa){
} }
function bankinvoice($Customer,$fdate,$tdate) function bankinvoice($Customer,$fdate,$tdate)
{ {
// $status='ST065';
$this->db->distinct(); $this->db->distinct();
$this->db->select('iva.invoice_id,iva.invoice_total,iv.invoice_date_created,iv.invoice_number,iva.invoice_paid,ic.client_name,BI.balancetoreceived,BI.amountreceived'); $this->db->select('iva.invoice_id,iva.invoice_total,iv.invoice_date_created,iv.invoice_number,iva.invoice_paid,ic.client_name,BI.balancetoreceived,BI.amountreceived');
$this->db->from ('ip_invoice_amounts iva'); $this->db->from ('ip_invoice_amounts iva');
$this->db->join ('ip_invoices iv','iv.invoice_id = iva.invoice_id','left'); $this->db->join ('ip_invoices iv','iva.invoice_id = iv.invoice_id');
$this->db->join ('ip_clients ic','ic.client_id = iv.client_id','left'); $this->db->join ('ip_clients ic','iv.client_id = ic.client_id','left');
$this->db->join ('T_Bankinvoicereport BI','BI.invoiceno = iv.invoice_number','left'); $this->db->join ('T_Bankinvoicereport BI',' iv.invoice_number =BI.invoiceno','left');
$this->db->where_in('iv.invoice_status_id','2'); //$this->db->where('iva.receivedstatus !=','ST065');
$this->db->where('iva.receivedstatus !=','ST065'); $this->db->where('iv.invoice_status_id','2');
$this->db->where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); $this->db->where('iv.receivedstatus !=','ST065');
$this->db->or_where('ic.client_id',$Customer); $this->db->where('ic.client_id',$Customer);
$this->db->or_where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
$this->db->group_by('iva.invoice_id'); $this->db->group_by('iva.invoice_id');
//$this->db->where('inc.type','PAYMENT'); //$this->db->where('inc.type','PAYMENT');
@ -280,9 +282,10 @@ function receiptdata()
function debitpolist($bankid) function debitpolist($bankid)
{ {
$this->db->select('mid,Podate,PONO,Suppliername,Totalpoamount, $this->db->select('bp.mid,bp.Podate,bp.PONO,bp.Suppliername,bp.Totalpoamount,
Balancetopay,Amountpaid'); bp.Balancetopay,bp.Amountpaid,bu.FilePath');
$this->db->from ('T_Bankmappingpo'); $this->db->from ('T_Bankmappingpo bp');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
$this->db->where('mid',$bankid); $this->db->where('mid',$bankid);
//$this->db->group_by('PONO'); //$this->db->group_by('PONO');
$query = $this->db->get(); $query = $this->db->get();
@ -373,18 +376,6 @@ function debitpolist($bankid)
return $query->result(); return $query->result();
} }
// function mappingcash($SupplierName,$fdate,$tdate,$bankid)
// {
// $this->db->select('mid,btype,amount,boption,ie.total,ie.account_code,ie.date');
// $this->db->from ('T_Bankmappingcashbook bmc');
// $this->db->join ('t_income_expense ie','ie.bankid = bmc.mid','left');
// $this->db->where('mid',$bankid);
// $this->db->group_by('mid');
// $query = $this->db->get();
// return $query->result();
// }
function mappingcash($SupplierName,$fdate,$tdate,$bankid) function mappingcash($SupplierName,$fdate,$tdate,$bankid)
{ {
@ -398,8 +389,8 @@ function debitpolist($bankid)
return $query->result(); return $query->result();
} }
function newcashbook() function newcashbook()
{ {
$this->db->select('cdate,mid,btype,amount,boption,mappingamount,totalamount,amounttype,alreadycreditpaid'); $this->db->select('cdate,mid,btype,amount,boption,mappingamount,totalamount,amounttype,alreadycreditpaid');
$this->db->from ('T_Bankmappingcashbook'); $this->db->from ('T_Bankmappingcashbook');
//$this->db->where('mid',$bankid); //$this->db->where('mid',$bankid);
@ -408,10 +399,10 @@ function newcashbook()
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
} }
function debitlistpo($SupplierName,$fdate,$tdate,$pono) function debitlistpo($SupplierName,$fdate,$tdate,$pono)
{ {
$this->db->select('bmp.mid,bmp.PONO,bmp.Amountpaid,br.Narration'); $this->db->select('bmp.mid,bmp.PONO,bmp.Amountpaid,br.Narration');
$this->db->from ('T_Bankmappingpo as bmp'); $this->db->from ('T_Bankmappingpo as bmp');
$this->db->join('T_bankreport br','br.ID = bmp.mid'); $this->db->join('T_bankreport br','br.ID = bmp.mid');
@ -420,7 +411,7 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono)
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
} }
function creditlistinv($invno) function creditlistinv($invno)
{ {
@ -668,8 +659,9 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono)
} }
function invoiceamountstatus($invoicemaster,$invid) function invoiceamountstatus($invoicemaster,$invid)
{ {
$this->db->where('invoice_id',$invid); echo $invoicemaster;
$this->db->update('ip_invoice_amounts',$invoicemaster); $this->db->where('invoice_number',$invid);
$this->db->update('ip_invoices',$invoicemaster);
$r = $this->db->affected_rows(); $r = $this->db->affected_rows();
return $r; return $r;

View File

@ -739,9 +739,9 @@ $(document).ready(function() {
'colvis' 'colvis'
], ],
columns:[ // columns:[
{ id:"col1", width:2 } // { id:"col1", width:2 }
] // ]
} ); } );
} ); } );

View File

@ -411,11 +411,13 @@ function GetPayment(i)
var date= document.getElementById ( "date"+i ).innerText; var date= document.getElementById ( "date"+i ).innerText;
var pono =document.getElementById ( "pono"+i ).innerText; var pono =document.getElementById ( "pono"+i ).innerText;
var poamount =document.getElementById ( "qw"+i ).innerText; var poamount =document.getElementById ( "qw"+i ).innerText;
var tta= $('#totala').val();
//alert(tta+'tta');
var tempid = "debited"+value; var tempid = "debited"+value;
//var credit=parseFloat(document.getElementById(tempid).innerText); //var credit=parseFloat(document.getElementById(tempid).innerText);
var t = '#invoicepaymet'+i; var t ="totala"+value;
var poamount1 =$(t).val(); var poamount1 =$(t).val();
alert(poamount1+'amt'); //alert(poamount1+'amt');
var ponovalue = pono+','+poamount; var ponovalue = pono+','+poamount;
temppo.push(ponovalue); temppo.push(ponovalue);
console.log(temppo); console.log(temppo);
@ -440,28 +442,28 @@ function GetPayment(i)
var RowCount= $('#Rowid').val(); var RowCount= $('#Rowid').val();
$('<input>').attr({ $('<input>').attr({
type:'text', type:'hidden',
name:'date1'+j, name:'date1'+j,
id:'date1'+j, id:'date1'+j,
value:date value:date
}).appendTo('#date1'); }).appendTo('#date1');
$('<input>').attr({ $('<input>').attr({
type:'text', type:'hidden',
name:'purchaseono'+j, name:'purchaseono'+j,
id:'purchaseono'+j, id:'purchaseono'+j,
value:pono value:pono
}).appendTo('#purchaseono'); }).appendTo('#purchaseono');
$('<input>').attr({ $('<input>').attr({
type:'text', type:'hidden',
name:'supname'+j, name:'supname'+j,
id:'supname'+j, id:'supname'+j,
value:supname value:supname
}).appendTo('#supname'); }).appendTo('#supname');
$('<input>').attr({ $('<input>').attr({
type:'text', type:'hidden',
name:'totala'+j, name:'totala'+j,
id:'totala'+j, id:'totala'+j,
value:invoicepayment value:invoicepayment
@ -469,7 +471,7 @@ function GetPayment(i)
$('<input>').attr({ $('<input>').attr({
type:'text', type:'hidden',
name:'ttamnt'+j, name:'ttamnt'+j,
id:'ttamnt'+j, id:'ttamnt'+j,
value:totalordervalue value:totalordervalue
@ -513,11 +515,9 @@ else
var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val()); var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
var Inid = document.getElementById ('pono'+i ).innerText var Inid = document.getElementById ('pono'+i ).innerText
var ponovalue = Inid+','+Payment; var ponovalue = Inid+','+Payment;
//alert(Inid+'else'); var a = temppo.indexOf(ponovalue);
//temppo.pull(Inid);
var a = temppo.indexOf(ponovalue);
//console.log(a); //console.log(a);
if(a!=-1) if(a!=-1)
{ {

View File

@ -635,6 +635,7 @@ function Save()
var bid=$('#bankid').val(); var bid=$('#bankid').val();
var date =$('#invoicedate1'+i).val(); var date =$('#invoicedate1'+i).val();
var invid =$('#invoiceid1'+i).val(); var invid =$('#invoiceid1'+i).val();
//alert(invid+'iid');
var customername=$('#customername1'+i).val(); var customername=$('#customername1'+i).val();
var invoiceamount=$('#invoiceamount1'+i).val(); var invoiceamount=$('#invoiceamount1'+i).val();
var amountreceived=$('#invoicerec'+i).val(); var amountreceived=$('#invoicerec'+i).val();

View File

@ -191,7 +191,7 @@ if(!empty($mapping))
<!--<th>Advance PO Amount<?php echo '('.$inrsymbol.')' ?></th>--> <!--<th>Advance PO Amount<?php echo '('.$inrsymbol.')' ?></th>-->
<th>Balance To Pay<?php echo '('.$inrsymbol.')' ?></th> <th>Balance To Pay<?php echo '('.$inrsymbol.')' ?></th>
<th>Amount Paid<?php echo '('.$inrsymbol.')' ?></th> <th>Amount Paid<?php echo '('.$inrsymbol.')' ?></th>
<th>File</th>
</tr> </tr>
@ -214,15 +214,29 @@ if(!empty($mapping))
<td align="left" id="date"><span><?php echo date_format(date_create($ap->Podate),'d-m-Y');?></span></td> <td align="left" id="date"><span><?php echo date_format(date_create($ap->Podate),'d-m-Y');?></span></td>
<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td> <td align="left" id="pono"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td>
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>--> <!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
<!--<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>"-->
<td align="left" id="sn"><span><?php echo $ap->Suppliername?></span></td> <td align="left" id="sn"><span><?php echo $ap->Suppliername?></span></td>
<td align="left" id="tov"><span><?php echo $ap->Totalpoamount?></span></td> <td align="left" id="tov"><span><?php echo $ap->Totalpoamount?></span></td>
<td align="left" id="aa"><span><?php echo $ap->Balancetopay?></span></td> <td align="left" id="aa"><span><?php echo $ap->Balancetopay?></span></td>
<td align="left" id="aa"><span><?php echo $ap->Amountpaid?></span></td> <td align="left" id="aa"><span><?php echo $ap->Amountpaid?></span></td>
<?php
if($ap->FilePath=='')
{
?>
<td>No File</td>
<?php
}
else
{
?>
<td> <a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $ap->FilePath ?>"><i class="fa fa-download" ></i></a></td>
<?php
}
?>