Bank customer and supplier ledger total values add
This commit is contained in:
parent
14755cdc51
commit
4028a77998
35112
application/logs/log-2019-01-14.php
Normal file
35112
application/logs/log-2019-01-14.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -662,10 +662,10 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
|||||||
function customerledger($customer,$fdate,$tdate,$fa,$aa,$m)
|
function customerledger($customer,$fdate,$tdate,$fa,$aa,$m)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$sql="select date,id,amount,invoice_number,invoice_status_id,customername,customerid,payment,id
|
$sql="select date,id,amount,invoice_number,invoice_status_id,customername,customerid,payment
|
||||||
from ledgercustomer
|
from ledgercustomer
|
||||||
where invoice_number != 'null' ";
|
where invoice_number != '' ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -702,7 +702,7 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$sql.="order by invoice_number";
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
return $query->result();
|
return $query->result();
|
||||||
|
|
||||||
@ -710,7 +710,13 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
|||||||
}
|
}
|
||||||
function openingbalance($customer,$fdate,$tdate,$fa,$aa,$m)
|
function openingbalance($customer,$fdate,$tdate,$fa,$aa,$m)
|
||||||
{
|
{
|
||||||
|
// echo $customer;
|
||||||
|
//echo $fdate;
|
||||||
|
//echo $tdate;
|
||||||
|
// echo $fa;
|
||||||
|
// echo $aa;
|
||||||
|
// echo $m;
|
||||||
|
// die();
|
||||||
$sql="select date as date,sum(payment) as payment
|
$sql="select date as date,sum(payment) as payment
|
||||||
from ledgercustomer
|
from ledgercustomer
|
||||||
where invoice_number != 'null' ";
|
where invoice_number != 'null' ";
|
||||||
@ -754,6 +760,7 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
|||||||
function openingbalancesupplier($customer,$fdate,$tdate,$fa,$aa,$m)
|
function openingbalancesupplier($customer,$fdate,$tdate,$fa,$aa,$m)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$sql="select date as date,sum(amountpaid) as amountpaid
|
$sql="select date as date,sum(amountpaid) as amountpaid
|
||||||
from ledgersupplier
|
from ledgersupplier
|
||||||
where ID != 'null' ";
|
where ID != 'null' ";
|
||||||
|
|||||||
2182
application/models/cashbook_model1.php
Normal file
2182
application/models/cashbook_model1.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -64,37 +64,7 @@ p {
|
|||||||
<!-- TABLE: LATEST ORDERS -->
|
<!-- TABLE: LATEST ORDERS -->
|
||||||
<div class="box box-info">
|
<div class="box box-info">
|
||||||
<div id="content" > </div>
|
<div id="content" > </div>
|
||||||
<div class="modal fade" id="Fileshow" role="dialog">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<!-- Modal. content-->
|
|
||||||
<form>
|
|
||||||
|
|
||||||
<div class="modal-content" style="width:800px;">
|
|
||||||
<!-- Table to show the line item of po -->
|
|
||||||
|
|
||||||
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
|
|
||||||
<thead style="background-color:#ddf">
|
|
||||||
<tr>
|
|
||||||
<th>SNo</th>
|
|
||||||
<th>BillNO</th>
|
|
||||||
<th>PONO</th>
|
|
||||||
<th>FileName</th>
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="tbleAppend1">
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--<div class="box-header with-border">-->
|
<!--<div class="box-header with-border">-->
|
||||||
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
||||||
<!--</div>-->
|
<!--</div>-->
|
||||||
@ -137,10 +107,10 @@ p {
|
|||||||
<?php
|
<?php
|
||||||
foreach($customerledger as $cl)
|
foreach($customerledger as $cl)
|
||||||
{
|
{
|
||||||
$clientname=$cl->client_name;
|
$customername=$cl->customername;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<center><h4 style="color:#3c8dbc"><span><?php echo $clientname;?></span></h4></center>
|
<center><h4 style="color:#3c8dbc"><span><?php echo $customername;?></span></h4></center>
|
||||||
<p><?php echo $tot_amount; ?></p>
|
<p><?php echo $tot_amount; ?></p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 col-xs-6">
|
<div class="col-md-6 col-xs-6">
|
||||||
@ -149,7 +119,7 @@ p {
|
|||||||
<input type="hidden" class="form-control required" id="suppliername" name="suppliername" value="<?php echo $suppliername;?>" ></textarea>
|
<input type="hidden" class="form-control required" id="suppliername" name="suppliername" value="<?php echo $suppliername;?>" ></textarea>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
@ -167,7 +137,8 @@ p {
|
|||||||
|
|
||||||
foreach($finyear as $item):
|
foreach($finyear as $item):
|
||||||
|
|
||||||
{?>
|
{
|
||||||
|
?>
|
||||||
|
|
||||||
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
||||||
|
|
||||||
@ -226,10 +197,10 @@ p {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-2" >
|
<div class="col-md-2" >
|
||||||
<label for="customer">
|
<label for="customer">
|
||||||
<?php echo 'Supplier'; ?>
|
<?php echo 'Customer'; ?>
|
||||||
</label>
|
</label>
|
||||||
<select class="form-control" id="Customer" name="Customer">
|
<select class="form-control" id="Customer" name="Customer">
|
||||||
<option value="">Select Supplier</option>
|
<option value="">Select Customer</option>
|
||||||
<?php foreach($getcustomer as $gc):
|
<?php foreach($getcustomer as $gc):
|
||||||
{?>
|
{?>
|
||||||
<option value="<?php echo $gc->client_id;?>"><?php echo $gc->client_name ;?></option>
|
<option value="<?php echo $gc->client_id;?>"><?php echo $gc->client_name ;?></option>
|
||||||
@ -286,35 +257,56 @@ p {
|
|||||||
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
|
|
||||||
<th>Transactions</th>
|
<th>Transactions</th>
|
||||||
<th>Document No</th>
|
<th>Document No</th><!--invoive_no ,bank_id -->
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
<th>Payments(₹)</th>
|
<th>Payments(₹)</th>
|
||||||
<th>Balance (₹)</th>
|
<th>Balance (₹)</th>
|
||||||
<!--<th>Print</th>-->
|
<!--<th>Print</th>-->
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>OpeningBalance</td>
|
||||||
|
<td></td><!--invoive_no ,bank_id -->
|
||||||
|
<td><?php echo $openbalance?></td>
|
||||||
|
<td></td>
|
||||||
|
<td><?php echo $openbalance?></td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
<?php
|
||||||
|
//$Balance=0.00;
|
||||||
$tot_amountreceived=0;
|
$tot_amountreceived=0;
|
||||||
$tot_amount=0;
|
$tot_amount=0;
|
||||||
|
|
||||||
$i=1;
|
$i=1;
|
||||||
$ti=0.00;
|
$ti=0.00;
|
||||||
$tvt=0.00;
|
$tvt=0.00;
|
||||||
|
$Balance=0.00;
|
||||||
|
|
||||||
|
|
||||||
if(!empty($customerledger)){
|
if(!empty($customerledger)){
|
||||||
foreach($customerledger as $cl)
|
foreach($customerledger as $cl)
|
||||||
{
|
{
|
||||||
|
|
||||||
$total=$cl->amount;
|
$total=$cl->amount;
|
||||||
|
|
||||||
|
|
||||||
$payments=$cl->payment;
|
$payments=$cl->payment;
|
||||||
$amountreceived=$cl->amountreceived;
|
$amountreceived=$cl->amountreceived;
|
||||||
$Balance=$total-$amountreceived;
|
|
||||||
|
//$Balance=($Balance+$total)-($payments);
|
||||||
|
|
||||||
|
|
||||||
$invoice_status_idcheck=$cl->invoice_status_id;
|
$invoice_status_idcheck=$cl->invoice_status_id;
|
||||||
|
|
||||||
|
|
||||||
|
//$runningtotal=$balance+$payments;
|
||||||
// $id=$ap->id;
|
// $id=$ap->id;
|
||||||
//print_r($ap);
|
//print_r($ap);
|
||||||
?>
|
?>
|
||||||
@ -350,13 +342,20 @@ p {
|
|||||||
|
|
||||||
|
|
||||||
<td align="left" id="btp<?php echo $i ?>"><span><?php $tot_amountreceived=$tot_amountreceived+round($payments)?> <?php echo round($payments,2);?></span></td>
|
<td align="left" id="btp<?php echo $i ?>"><span><?php $tot_amountreceived=$tot_amountreceived+round($payments)?> <?php echo round($payments,2);?></span></td>
|
||||||
<td align="left" id="ap<?php echo $i ?>"><span><?php $tot_balance=$tot_balance+round($Balance)?> <?php echo round($Balance,2)?></span></td>
|
<?php if($i==1){
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<td align="left" id="ap<?php echo $i ?>"><span><?php $Balance=($openbalance+$Balance+$total)-($payments);?> <?php echo round($Balance,2)?></span></td>
|
||||||
|
|
||||||
<!--<td>
|
<?php } else {
|
||||||
<a data-toggle="tooltip" ><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="podelete(<?php echo $i ?>)"></i> </a>
|
|
||||||
</td> -->
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<td align="left" id="ap<?php echo $i ?>"><span><?php $Balance=($Balance+$total)-($payments) ?> <?php echo round($Balance,2)?></span></td>
|
||||||
|
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -367,6 +366,7 @@ p {
|
|||||||
<?php
|
<?php
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
//$i++;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -453,28 +453,28 @@ $( function() {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$(document).ready(function() {
|
// $(document).ready(function() {
|
||||||
table = $('#req').DataTable( {
|
// table = $('#req').DataTable( {
|
||||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
// "dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
// "<'row'<'col-md-6'><'col-md-6'>>" +
|
||||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
// "<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||||
buttons: [
|
// buttons: [
|
||||||
|
|
||||||
{
|
// {
|
||||||
extend: 'excelHtml5',
|
// extend: 'excelHtml5',
|
||||||
footer: 'true',
|
// footer: 'true',
|
||||||
messageTop: $('h4').text(),
|
// messageTop: $('h4').text(),
|
||||||
title: 'Customer Ledger',
|
// title: 'Customer Ledger',
|
||||||
exportOptions: {
|
// exportOptions: {
|
||||||
columns: ':visible'
|
// columns: ':visible'
|
||||||
|
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
|
|
||||||
'colvis'
|
// 'colvis'
|
||||||
]
|
// ]
|
||||||
} );
|
// } );
|
||||||
} );
|
// } );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
485
application/views/bankcustomerledger1.php
Normal file
485
application/views/bankcustomerledger1.php
Normal file
@ -0,0 +1,485 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
//echo $suppliername;
|
||||||
|
foreach($openingbalance as $balance)
|
||||||
|
{
|
||||||
|
$openbalance=$balance->payment;
|
||||||
|
}
|
||||||
|
foreach($financialyear as $item)
|
||||||
|
|
||||||
|
{
|
||||||
|
$finyear = $item->financial_year;
|
||||||
|
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
p {
|
||||||
|
font-family: verdana;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||||
|
<style>
|
||||||
|
.dataTables_filter input {padding: 4px;}
|
||||||
|
|
||||||
|
.dataTables_filter {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.dataTables_paginate {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
div.dt-buttons {
|
||||||
|
position: relative;
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div id="container"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>-->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<section class ="content">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<!-- Left col -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<!-- TABLE: LATEST ORDERS -->
|
||||||
|
<div class="box box-info">
|
||||||
|
<div id="content" > </div>
|
||||||
|
<div class="modal fade" id="Fileshow" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<!-- Modal. content-->
|
||||||
|
<form>
|
||||||
|
|
||||||
|
<div class="modal-content" style="width:800px;">
|
||||||
|
<!-- Table to show the line item of po -->
|
||||||
|
|
||||||
|
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
|
||||||
|
<thead style="background-color:#ddf">
|
||||||
|
<tr>
|
||||||
|
<th>SNo</th>
|
||||||
|
<th>BillNO</th>
|
||||||
|
<th>PONO</th>
|
||||||
|
<th>FileName</th>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tbleAppend1">
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--<div class="box-header with-border">-->
|
||||||
|
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!-- /.box-header -->
|
||||||
|
|
||||||
|
|
||||||
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||||
|
|
||||||
|
<center><h3 class="box-title"><p style="color:#3c8dbc; font-size: 18px;">Customer Ledger
|
||||||
|
<?php if(!empty($fa)){
|
||||||
|
echo $fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<?php if(!empty($fa)){
|
||||||
|
echo '-';
|
||||||
|
echo $aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<?php if(!empty($m))
|
||||||
|
{
|
||||||
|
echo '/';
|
||||||
|
echo $m;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php if(!empty($fdate))
|
||||||
|
{
|
||||||
|
echo '/';
|
||||||
|
echo $fdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
?><?php if(!empty($tdate)){
|
||||||
|
echo '/';
|
||||||
|
echo $tdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</p></h3></center>
|
||||||
|
<?php
|
||||||
|
foreach($customerledger as $cl)
|
||||||
|
{
|
||||||
|
$clientname=$cl->client_name;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<center><h4 style="color:#3c8dbc"><span><?php echo $clientname;?></span></h4></center>
|
||||||
|
<p><?php echo $tot_amount; ?></p>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-xs-6">
|
||||||
|
|
||||||
|
<input type="hidden" class="form-control required" id="supplier" name="supplier" value="<?php echo $supplierid;?>" ></textarea>
|
||||||
|
<input type="hidden" class="form-control required" id="suppliername" name="suppliername" value="<?php echo $suppliername;?>" ></textarea>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="box-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="to_date">
|
||||||
|
<?php echo 'Year'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<select class="form-control" id="financialyear" name="financialyear">
|
||||||
|
<option value="">Select Year</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
foreach($finyear as $item):
|
||||||
|
|
||||||
|
{?>
|
||||||
|
|
||||||
|
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
||||||
|
|
||||||
|
|
||||||
|
<?php } endforeach; ?>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="to_date">
|
||||||
|
<?php echo 'Month'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<select class="form-control" id="month" name="month">
|
||||||
|
<option value="">Select Month</option>
|
||||||
|
<option value="January">January</option>
|
||||||
|
<option value="February">February</option>
|
||||||
|
<option value="March">March</option>
|
||||||
|
<option value="April">April</option>
|
||||||
|
<option value="May">May</option>
|
||||||
|
<option value="June">June</option>
|
||||||
|
<option value="July">July</option>
|
||||||
|
<option value="August">August</option>
|
||||||
|
<option value="September">September</option>
|
||||||
|
<option value="October">October</option>
|
||||||
|
<option value="November">November</option>
|
||||||
|
<option value="December">December</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="from_date">
|
||||||
|
<?php echo 'From Date'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input name="from_date" id="max-date" class="form-control datepicker">
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="to_date">
|
||||||
|
<?php echo 'To Date'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input name="to_date" id="min-date" class="form-control datepicker">
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2" >
|
||||||
|
<label for="customer">
|
||||||
|
<?php echo 'Supplier'; ?>
|
||||||
|
</label>
|
||||||
|
<select class="form-control" id="Customer" name="Customer">
|
||||||
|
<option value="">Select Supplier</option>
|
||||||
|
<?php foreach($getcustomer as $gc):
|
||||||
|
{?>
|
||||||
|
<option value="<?php echo $gc->client_id;?>"><?php echo $gc->client_name ;?></option>
|
||||||
|
<?php } endforeach; ?>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2" style="margin-top:24px;">
|
||||||
|
<input type="submit" class="btn btn-success" name="btn_submit"
|
||||||
|
value="View CusLedger">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$i=1;
|
||||||
|
$amount_receive=0;
|
||||||
|
$total_invoice=0;
|
||||||
|
$balance_due=0;
|
||||||
|
|
||||||
|
if(!empty($customerledger)){
|
||||||
|
foreach($customerledger as $cls)
|
||||||
|
{
|
||||||
|
$totalinvoice=$cls->amount;
|
||||||
|
$total_invoice=$total_invoice+$totalinvoice;
|
||||||
|
$amountreceived=$cls->payment;
|
||||||
|
$amount_receive= $amount_receive+$amountreceived;
|
||||||
|
$balance_due=$total_invoice-$amount_receive;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
?>
|
||||||
|
<p style="color:green" "font-size:22px";><strong>Opening Balance</strong> : <?php echo $openbalance ?>(₹)</p>
|
||||||
|
<p style="color:green";><strong>Invoiced Amount </strong>: <?php echo $total_invoice ?>(₹)</p>
|
||||||
|
<p style="color:green";><strong>Amount Paid </strong> : <?php echo $amount_receive?>(₹)</p>
|
||||||
|
<!--<p style="color:green";><strong>Balance Due </strong> : <?php echo $balance_due?>(₹)</p>-->
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>Date</th>
|
||||||
|
|
||||||
|
<th>Transactions</th>
|
||||||
|
<th>Document No</th>
|
||||||
|
<th>Amount</th>
|
||||||
|
<th>Payments(₹)</th>
|
||||||
|
<th>Balance (₹)</th>
|
||||||
|
<!--<th>Print</th>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$tot_amountreceived=0;
|
||||||
|
$tot_amount=0;
|
||||||
|
$i=1;
|
||||||
|
$ti=0.00;
|
||||||
|
$tvt=0.00;
|
||||||
|
$Balance =0.00;
|
||||||
|
if(!empty($customerledger)){
|
||||||
|
foreach($customerledger as $cl)
|
||||||
|
{
|
||||||
|
$total=$cl->amount;
|
||||||
|
$payments=$cl->payment;
|
||||||
|
$amountreceived=$cl->amountreceived;
|
||||||
|
$Balance=$Balance+$total)-($payments);
|
||||||
|
$invoice_status_idcheck=$cl->invoice_status_id;
|
||||||
|
// $id=$ap->id;
|
||||||
|
//print_r($ap);
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
|
||||||
|
<input type="hidden" name="mapid" id="mapid<?php echo $i ?>" value="<?php echo $ap->id; ?>"/>
|
||||||
|
<input type="hidden" name="bankingbalclear" id="bankingbalclear<?php echo $i ?>" value="<?php echo $ap->Balancetocleared; ?>"/>
|
||||||
|
<input type="hidden" name="clearbal" id="clearbal<?php echo $i ?>" value="<?php echo $ap->Clearbalance; ?>"/>
|
||||||
|
<input type="hidden" name="bankingid" id="bankingid<?php echo $i ?>" value="<?php echo $ap->mid; ?>"/>
|
||||||
|
|
||||||
|
|
||||||
|
<td align="left" id="bankdate<?php echo $i ?>"><span><?php echo date_format(date_create($cl->date),'d-m-Y'); ?></span></td>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if($invoice_status_idcheck==2)
|
||||||
|
{
|
||||||
|
$invoice_status_id='Invoice';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$invoice_status_id=$cl->invoice_status_id;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $invoice_status_id?></span></td>
|
||||||
|
|
||||||
|
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $cl->id?></span></td>
|
||||||
|
|
||||||
|
<td align="left" id="tpoa<?php echo $i ?>"><span><?php $tot_amount=$tot_amount+round($total)?> <?php echo $total;?></span></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td align="left" id="btp<?php echo $i ?>"><span><?php $tot_amountreceived=$tot_amountreceived+round($payments)?> <?php echo round($payments,2);?></span></td>
|
||||||
|
<td align="left" id="ap<?php echo $i ?>"><span><?php $tot_balance=$tot_balance+round($Balance)?> <?php echo round($Balance,2)?></span></td>
|
||||||
|
|
||||||
|
<!--<td>
|
||||||
|
<a data-toggle="tooltip" ><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="podelete(<?php echo $i ?>)"></i> </a>
|
||||||
|
</td> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;"><strong>Balance Due</strong></td>
|
||||||
|
<!--<td> </td>-->
|
||||||
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="amount"><strong>
|
||||||
|
<?php echo $tot_amount;?>
|
||||||
|
</strong></td>
|
||||||
|
<td class="amount"><strong>
|
||||||
|
<?php echo $tot_amountreceived; ?>
|
||||||
|
</strong></td>
|
||||||
|
<td> </td>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
||||||
|
<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>
|
||||||
|
$( function() {
|
||||||
|
//var dateFormat = "mm/dd/yy",
|
||||||
|
from = $( "#min-date" )
|
||||||
|
.datepicker({
|
||||||
|
dateFormat: "dd-mm-yy",
|
||||||
|
defaultDate: "+0d",
|
||||||
|
changeMonth: true,
|
||||||
|
//numberOfMonths: 1
|
||||||
|
|
||||||
|
})
|
||||||
|
.on( "change", function() {
|
||||||
|
to.datepicker("option", "minDate", getDate( this ));
|
||||||
|
}),
|
||||||
|
to = $( "#max-date" ).datepicker({
|
||||||
|
dateFormat: "dd-mm-yy",
|
||||||
|
defaultDate: "+0d",
|
||||||
|
changeMonth: true,
|
||||||
|
//numberOfMonths: 1
|
||||||
|
|
||||||
|
})
|
||||||
|
.on( "change", function() {
|
||||||
|
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||||
|
});
|
||||||
|
|
||||||
|
function getDate( element ) {
|
||||||
|
var date;
|
||||||
|
|
||||||
|
try {
|
||||||
|
date = $.datepicker.parseDate( dateFormat, element.value );
|
||||||
|
|
||||||
|
} catch( error ) {
|
||||||
|
date = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
// $(document).ready(function() {
|
||||||
|
// 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>>",
|
||||||
|
// buttons: [
|
||||||
|
|
||||||
|
// {
|
||||||
|
// extend: 'excelHtml5',
|
||||||
|
// footer: 'true',
|
||||||
|
// messageTop: $('h4').text(),
|
||||||
|
// title: 'Customer Ledger',
|
||||||
|
// exportOptions: {
|
||||||
|
// columns: ':visible'
|
||||||
|
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
// 'colvis'
|
||||||
|
// ]
|
||||||
|
// } );
|
||||||
|
// } );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -263,18 +263,35 @@ foreach($openingbalancesupplier as $balance)
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>OpeningBalance</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td><?php echo $openbalance ?></td>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$tot_amountpaid=0;
|
$tot_amountpaid=0;
|
||||||
$tot_balance=0;
|
$tot_balance=0;
|
||||||
$i=1;
|
$i=1;
|
||||||
$ti=0.00;
|
$ti=0.00;
|
||||||
$tvt=0.00;
|
$tvt=0.00;
|
||||||
|
$Balance=0.00;
|
||||||
if(!empty($supplierledger)){
|
if(!empty($supplierledger)){
|
||||||
foreach($supplierledger as $sl)
|
foreach($supplierledger as $sl)
|
||||||
{
|
{
|
||||||
$total=$sl->total;
|
$total=$sl->total;
|
||||||
$payments=$sl->amountpaid;
|
$payments=$sl->amountpaid;
|
||||||
$Balance=$total-$payments;
|
//$Balance=$total-$payments;
|
||||||
$Bankdate=$sl->bankdate;
|
$Bankdate=$sl->bankdate;
|
||||||
$narration=$sl->narration
|
$narration=$sl->narration
|
||||||
// $id=$ap->id;
|
// $id=$ap->id;
|
||||||
@ -305,16 +322,20 @@ foreach($openingbalancesupplier as $balance)
|
|||||||
<td align="left" id="tpoa<?php echo $i ?>"><span><?php echo $total;?></span></td>
|
<td align="left" id="tpoa<?php echo $i ?>"><span><?php echo $total;?></span></td>
|
||||||
<td align="left" id="btp<?php echo $i ?>"><span><?php $tot_amount=$tot_amount+round($sl->amountpaid)?> <?php echo round($payments,2);?></span></td>
|
<td align="left" id="btp<?php echo $i ?>"><span><?php $tot_amount=$tot_amount+round($sl->amountpaid)?> <?php echo round($payments,2);?></span></td>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($payments))
|
// if(!empty($payments))
|
||||||
{
|
// {
|
||||||
$Balance=0;
|
// $Balance=0;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
$Balance=$total-$payments;
|
// $Balance=$total-$payments;
|
||||||
}
|
// }
|
||||||
|
if($i==1){
|
||||||
?>
|
?>
|
||||||
<td align="left" id="ap<?php echo $i ?>"><span><?php $tot_balance=$tot_balance+round($Balance)?> <?php echo round($Balance,2)?></span></td>
|
<td align="left" id="ap<?php echo $i ?>"><span><?php $Balance=($openbalance+$total+$Balance) -($payments)?> <?php echo round($Balance,2)?></span></td>
|
||||||
|
<?php } else {?>
|
||||||
|
<td align="left" id="ap<?php echo $i ?>"><span><?php $Balance=($Balance+$total)-($payments)?> <?php echo round($Balance,2)?></span></td>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
<!--<td>
|
<!--<td>
|
||||||
<a data-toggle="tooltip" ><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="podelete(<?php echo $i ?>)"></i> </a>
|
<a data-toggle="tooltip" ><i class="fa fa-print" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="podelete(<?php echo $i ?>)"></i> </a>
|
||||||
@ -341,13 +362,15 @@ foreach($openingbalancesupplier as $balance)
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
|
||||||
|
</strong></td>
|
||||||
|
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
|
||||||
<td class="amount"><strong>
|
<td class="amount"><strong>
|
||||||
<?php echo $tot_amount; ?>
|
<?php echo $tot_amount; ?>
|
||||||
</strong></td>
|
|
||||||
<td class="amount"><strong>
|
<td class="amount"><strong>
|
||||||
<?php echo $tot_balance;?>
|
<?php echo $Balance;?>
|
||||||
</strong></td>
|
</strong></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@ -378,28 +401,28 @@ foreach($openingbalancesupplier as $balance)
|
|||||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
// $(document).ready(function() {
|
||||||
table = $('#req').DataTable( {
|
// table = $('#req').DataTable( {
|
||||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
// "dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
// "<'row'<'col-md-6'><'col-md-6'>>" +
|
||||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
// "<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||||
buttons: [
|
// buttons: [
|
||||||
|
|
||||||
{
|
// {
|
||||||
extend: 'excelHtml5',
|
// extend: 'excelHtml5',
|
||||||
footer: 'true',
|
// footer: 'true',
|
||||||
messageTop: $('h4').text(),
|
// messageTop: $('h4').text(),
|
||||||
title: 'Supplier Ledger',
|
// title: 'Supplier Ledger',
|
||||||
exportOptions: {
|
// exportOptions: {
|
||||||
columns: ':visible'
|
// columns: ':visible'
|
||||||
|
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
|
|
||||||
'colvis'
|
// 'colvis'
|
||||||
]
|
// ]
|
||||||
} );
|
// } );
|
||||||
} );
|
// } );
|
||||||
$( function() {
|
$( function() {
|
||||||
//var dateFormat = "mm/dd/yy",
|
//var dateFormat = "mm/dd/yy",
|
||||||
from = $( "#min-date" )
|
from = $( "#min-date" )
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user