bank statement bankreport
This commit is contained in:
parent
a850432bd2
commit
3f69e01cdf
@ -240,6 +240,7 @@ $route['Payment']= "cashbook/cashpayment";
|
||||
$route['Invoice']= "cashbook/bankinvoice";
|
||||
$route['Bankcash']= "cashbook/cashbanking";
|
||||
$route['DeleteInvoice']="cashbook/deletemappingiv";
|
||||
$route['DeletePo']="cashbook/Deletemappingporeport";
|
||||
$route['MappingInvoice']="cashbook/mappinginvoice";
|
||||
$route['qualityreportlist'] = "quality/reportList";
|
||||
$route['qualityreportlistinward'] = "quality/reportListInward";
|
||||
|
||||
@ -939,7 +939,7 @@ class cashbook extends BaseController
|
||||
{
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Cashbook Listing';
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Settlements';
|
||||
$SupplierName = $this->input->post('SupplierName');
|
||||
$fdate = $this->input->post('from_date');
|
||||
@ -1298,6 +1298,44 @@ class cashbook extends BaseController
|
||||
$this->loadViews("bankcashnew", $this->global,$data,NULL);
|
||||
|
||||
}
|
||||
public function Deletemappingporeport()
|
||||
{
|
||||
$totalamount =$this->input->post('Totalpoamount');
|
||||
|
||||
$Amount = $this->input->post('paidamount');
|
||||
|
||||
$igrno = $this->input->post('igrno');
|
||||
$Bankid = $this->input->post('bankid');
|
||||
$balancetoclear=$this->input->post('balancetobankingclear');
|
||||
$clearedbalance=$this->input->post('clearbalance');
|
||||
$updateamount=$clearedbalance-$Amount;
|
||||
$updatebalancetoclear=$Amount+$balancetoclear;
|
||||
$data['$bankmappingamount'] = $this->cashbook_model->gettotalbankmappingpo($igrno);
|
||||
$amountpaid=$data['$bankmappingamount'][0]->Amountpaid;
|
||||
//$data['$totallineitemamount']=$this->cashbook_model->gettotallineitem($igrno);
|
||||
|
||||
if($amountpaid==$totalamount)
|
||||
{
|
||||
$BankStatus=NO_PAIDIGR;
|
||||
}
|
||||
else
|
||||
{
|
||||
$BankStatus=PARTIALLY_PAIDIGR;
|
||||
}
|
||||
|
||||
$result= $this->cashbook_model->IgrDetailsStatusUpdate($igrno,$BankStatus);
|
||||
$result1= $this->cashbook_model->deletemapping($Bankid,$updateamount,$updatebalancetoclear);
|
||||
//for update mapping amount in t_bankmappingpo table//
|
||||
$balancetopay=$this->input->post('balancetopay');
|
||||
$totalbalancetopay=$Amount+$balancetopay;
|
||||
//$updateamount=0;
|
||||
$IsActive=0;
|
||||
$result2= $this->cashbook_model->deleteBankmappingpo($igrno,$Bankid,$IsActive);
|
||||
//for update mapping amount inT_Bankporeport table//
|
||||
//die();
|
||||
$result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updateamount,$Bankid);
|
||||
$this->loadViews("bankstatement", $this->global,$data, NULL);
|
||||
}
|
||||
public function Deletemappingpo()
|
||||
{
|
||||
$totalamount = $_GET['Totalpoamount'];
|
||||
@ -1353,7 +1391,7 @@ class cashbook extends BaseController
|
||||
$updateclearbalance=$bankingclear-$amountreceived;
|
||||
$bankstatement=array('cbalancetocleared'=>$updatebalancetoclear,'cclearbalance'=>$updateclearbalance);
|
||||
$result1= $this->cashbook_model->updatebankreportiv($bankid,$bankstatement);
|
||||
print_r($result1);
|
||||
//print_r($result1);
|
||||
//die();
|
||||
$IsActive=0;
|
||||
$result2= $this->cashbook_model->deletemappinginvoice($bankid,$invoiceno,$IsActive);
|
||||
|
||||
@ -387,6 +387,7 @@ function debitpolist($bankid)
|
||||
$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO','left');
|
||||
|
||||
//$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
|
||||
$this->db->where('IsActive',1);
|
||||
$this->db->where('mid',$bankid);
|
||||
$this->db->where('igrde.BankStatus !=','ST072');
|
||||
//$this->db->group_by('PONO');
|
||||
@ -398,9 +399,12 @@ function debitpolist($bankid)
|
||||
function debitpolistfilter($SupplierName,$fdate,$tdate)
|
||||
{
|
||||
$this->db->select('bm.mid,bm.Podate,bm.PONO,bm.Suppliername,bm.Totalpoamount,
|
||||
bm.Balancetopay,bm.Amountpaid');
|
||||
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,igrde.IGRItemNo,br.Clearbalance,br.Balancetocleared');
|
||||
$this->db->from ('T_Bankmappingpo bm');
|
||||
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername','left');
|
||||
$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO','left');
|
||||
$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO','left');
|
||||
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername','left');
|
||||
$this->db->join ('T_bankreport br','br.ID=bm.mid');
|
||||
if($fdate!='' && $tdate!='')
|
||||
{
|
||||
$this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
@ -409,6 +413,7 @@ function debitpolist($bankid)
|
||||
{
|
||||
$this->db->where('sd.SupplierID',$SupplierName);
|
||||
}
|
||||
|
||||
// $this->db->where('mid',$bankid);
|
||||
$this->db->group_by('PONO');
|
||||
$query = $this->db->get();
|
||||
@ -430,10 +435,12 @@ function debitpolist($bankid)
|
||||
}
|
||||
function creditinvoicelistfilter($Customer,$fdate,$tdate)
|
||||
{
|
||||
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,
|
||||
bm.balancetoreceived,bm.amountreceived');
|
||||
$this->db->select('bm.ID,bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,
|
||||
bm.balancetoreceived,bm.amountreceived,br.cclearbalance,br.cbalancetocleared');
|
||||
$this->db->from ('T_Bankmappingiv bm');
|
||||
$this->db->where('bm.IsActive',1);
|
||||
$this->db->join ('ip_clients ic','ic.client_name = bm.customername','left');
|
||||
$this->db->join('T_bankreport br','br.ID = bm.bankid');
|
||||
if($fdate!='' && $tdate!='')
|
||||
{
|
||||
$this->db->where('bm.indate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
@ -443,6 +450,7 @@ function debitpolist($bankid)
|
||||
$this->db->where('ic.client_id',$Customer);
|
||||
}
|
||||
//$this->db->group_by('invoiceno');
|
||||
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
@ -461,15 +469,16 @@ function debitpolist($bankid)
|
||||
}
|
||||
//for cashbook edit screen and update bankreport//
|
||||
function poamonut($bankid)
|
||||
{
|
||||
$this->db->select('sum(Amountpaid)as amountpaid');
|
||||
{
|
||||
$this->db->select('sum(Amountpaid)as amountpaid');
|
||||
$this->db->from ('T_Bankmappingpo');
|
||||
$this->db->where('mid',$bankid);
|
||||
$this->db->where('IsActive',1);
|
||||
//$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
}
|
||||
function cashbookamount($bankid)
|
||||
{
|
||||
$this->db->select('sum(total)as total');
|
||||
@ -523,7 +532,8 @@ function debitpolist($bankid)
|
||||
$this->db->select('bmp.bankid,bmp.invoiceno,bmp.amountreceived,br.Narration');
|
||||
$this->db->from ('T_Bankmappingiv as bmp');
|
||||
$this->db->join('T_bankreport br','br.ID = bmp.bankid');
|
||||
$this->db->where('invoiceno',$invno);
|
||||
$this->db->where('invoiceno',$invno);
|
||||
$this->db->where('bmp.IsActive',1);
|
||||
//$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
@ -58,6 +58,7 @@ if(!empty($amountpaid))
|
||||
<div class="col-md-12">
|
||||
<!-- TABLE: LATEST ORDERS -->
|
||||
<div class="box box-info">
|
||||
<div class="box box-info" id="content">
|
||||
<!--<div class="box-header with-border">-->
|
||||
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
||||
<!--</div>-->
|
||||
@ -129,11 +130,14 @@ if(!empty($amountpaid))
|
||||
|
||||
<th>Date</th>
|
||||
<th>PONO</th>
|
||||
<th>IGR NO</th>
|
||||
<th>IGRItemNo</th>
|
||||
<th>Supplier Name</th>
|
||||
<th>Total PO Amount (₹)</th>
|
||||
<!--<th>Advance PO Amount (₹)</th>-->
|
||||
<th>Balance To Pay (₹)</th>
|
||||
<th>Amount Paid (₹)</th>
|
||||
<th>Action</th>
|
||||
|
||||
|
||||
|
||||
@ -152,21 +156,22 @@ if(!empty($amountpaid))
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="bankingbalclear" id="bankingbalclear" value="<?php echo $ap->Balancetocleared; ?>"/>
|
||||
<input type="hidden" name="clearbal" id="clearbal" value="<?php echo $ap->Clearbalance; ?>"/>
|
||||
<input type="hidden" name="bankingid" id="bankingid" value="<?php echo $ap->mid; ?>"/>
|
||||
|
||||
<!-- <td align="left" id="date"><span><?php echo $ap->Podate?></span></td> -->
|
||||
|
||||
<td align="right"><?php $dt = new DateTime($ap->Podate);
|
||||
$Podate = $dt->format('d-m-Y'); echo $Podate ?> </td>
|
||||
|
||||
<td align="left" id="date"><span><?php echo $ap->Podate?></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"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
|
||||
|
||||
<td align="left" id="igrno"><span><?php echo $ap->IGRNO?></span></td>
|
||||
<td align="left" id="igritemno"><span><?php echo $ap->IGRItemNo?></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="aa"><span><?php echo $ap->Balancetopay?></span></td>
|
||||
<td align="left" id="aa"><span><?php echo $ap->Amountpaid?></span></td>
|
||||
|
||||
<td align="left" id="tpoa"><span><?php echo $ap->Totalpoamount?></span></td>
|
||||
<td align="left" id="btp"><span><?php echo $ap->Balancetopay?></span></td>
|
||||
<td align="left" id="ap"><span><?php echo $ap->Amountpaid?></span></td>
|
||||
<td>
|
||||
<a data-toggle="tooltip" ><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="podelete()"></i> </a>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
@ -186,7 +191,9 @@ if(!empty($amountpaid))
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div></section></div>
|
||||
</div>
|
||||
</div>
|
||||
</section></div>
|
||||
|
||||
|
||||
|
||||
@ -199,17 +206,52 @@ if(!empty($amountpaid))
|
||||
<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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
function podelete()
|
||||
{
|
||||
|
||||
$('#content').loader('show');
|
||||
|
||||
var totalamount=$('#tpoa').text();
|
||||
|
||||
var paidamount=$('#ap').text();//amount
|
||||
|
||||
var balancetopay=$('#btp').text();
|
||||
|
||||
var Igritemno=$('#igritemno').text();
|
||||
|
||||
var bankid=$('#bankingid').val();
|
||||
|
||||
var bankingclear=$('#bankingbalclear').val();
|
||||
|
||||
var clearedbalance=$('#clearbal').val();
|
||||
|
||||
$.ajax(
|
||||
|
||||
|
||||
|
||||
{
|
||||
data:{Totalpoamount:totalamount,paidamount:paidamount,balancetopay:balancetopay,IGRItemNo:Igritemno,bankid:bankid,balancetobankingclear:bankingclear,clearbalance:clearedbalance},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>DeletePo",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
if(data)
|
||||
{
|
||||
|
||||
|
||||
window.location.href ="Bankingstatement";
|
||||
//location.reload();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
table = $('#req').DataTable( {
|
||||
"aaSorting": [[ 0, "desc" ]],
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
|
||||
@ -57,6 +57,7 @@ foreach($financialyear as $item)
|
||||
<div class="col-md-12">
|
||||
<!-- TABLE: LATEST ORDERS -->
|
||||
<div class="box box-info">
|
||||
<div class="box box-info" id="content">
|
||||
<!--<div class="box-header with-border">-->
|
||||
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
||||
<!--</div>-->
|
||||
@ -123,7 +124,7 @@ foreach($financialyear as $item)
|
||||
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>ID</th>
|
||||
<th>Date</th>
|
||||
<th>INVOICENO</th>
|
||||
<th>Supplier Name</th>
|
||||
@ -131,6 +132,7 @@ foreach($financialyear as $item)
|
||||
<!--<th>Advance PO Amount (₹)</th>-->
|
||||
<th>Balance To Received (₹)</th>
|
||||
<th>Amount Received (₹)</th>
|
||||
<th>Action</th>
|
||||
|
||||
|
||||
|
||||
@ -149,17 +151,21 @@ foreach($financialyear as $item)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="bankid" id="bankid" value="<?php echo $ap->bankid ?>"/>
|
||||
<input type="hidden" name="ccbalance" id="ccbalance" value="<?php echo $ap->cclearbalance?>"/>
|
||||
<input type="hidden" name="btc" id="btc" value="<?php echo $ap->cbalancetocleared?>"/>
|
||||
<td align="left" id="Mid"><span><?php echo $ap->ID?></span></td>
|
||||
<td align="left" id="date"><span><?php echo $ap->indate?></span></td>
|
||||
<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/mappingcredit?sid=<?php echo $ap->invoiceno;?>"><span><?php echo $ap->invoiceno?></span></a></td>
|
||||
<td align="left" id="invno"><a href="<?= base_url() ?>cashbook/mappingcredit?sid=<?php echo $ap->invoiceno;?>"><span><?php echo $ap->invoiceno?></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" id="sn"><span><?php echo $ap->customername?></span></td>
|
||||
<td align="left" id="tov"><span><?php echo $ap->totinvoiceamount?></span></td>
|
||||
<td align="left" id="aa"><span><?php echo $ap->balancetoreceived?></span></td>
|
||||
<td align="left" id="aa"><span><?php echo $ap->amountreceived?></span></td>
|
||||
|
||||
<td align="left" id="totinvoiceamount"><span><?php echo $ap->totinvoiceamount?></span></td>
|
||||
<td align="left" id="balancetoreceived"><span><?php echo $ap->balancetoreceived?></span></td>
|
||||
<td align="left" id="amountreceived"><span><?php echo $ap->amountreceived?></span></td>
|
||||
<td>
|
||||
<a data-toggle="tooltip" ><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="invoice()"></i> </a>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
@ -214,7 +220,7 @@ foreach($financialyear as $item)
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
@ -234,18 +240,44 @@ foreach($financialyear as $item)
|
||||
<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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
|
||||
<script>
|
||||
function invoice()
|
||||
{
|
||||
|
||||
$('#content').loader('show');
|
||||
var totinvoiceamount=$('#totinvoiceamount').text();
|
||||
var balancetoreceived=$('#balancetoreceived').text();
|
||||
var invoiceno=$('#invno').text();
|
||||
var amountreceived=$('#amountreceived').text();
|
||||
var bankid=$('#bankid').val();
|
||||
|
||||
var bankingclear=$('#ccbalance').val();
|
||||
var bankingbalclear=$('#btc').val();
|
||||
|
||||
$.ajax(
|
||||
|
||||
{
|
||||
data:{invoiceno:invoiceno,bankid:bankid,amountreceived:amountreceived,bankingclear:bankingclear,bankingbalclear:bankingbalclear,totinvoiceamount:totinvoiceamount,balancetoreceived:balancetoreceived},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>DeleteInvoice",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
if(data)
|
||||
{
|
||||
|
||||
|
||||
window.location.href ="Bankingstatement";
|
||||
//location.reload();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
table = $('#req').DataTable( {
|
||||
"aaSorting": [[ 0, "desc" ]],
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
|
||||
table = $('#req').DataTable( {
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
|
||||
@ -49,6 +49,7 @@ foreach($financialyear as $item)
|
||||
<div class="col-md-12" >
|
||||
<!-- TABLE: LATEST ORDERS -->
|
||||
<div class="box box-info">
|
||||
<div class="box box-info" id="content">
|
||||
|
||||
<?php
|
||||
if(!empty($mappingiv)){
|
||||
@ -258,6 +259,7 @@ foreach($financialyear as $item)
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user