ledgerstatement
This commit is contained in:
parent
6bee895a9c
commit
588715f350
@ -237,7 +237,8 @@ $route['BankingFile']= "cashbook/bankfileupload";
|
||||
$route['MappingPo']="cashbook/mappingpo";
|
||||
//$route['Filelist']="cashbook/filelist";
|
||||
//$route['Bankingrecord']= "cashbook/bankdata";
|
||||
|
||||
$route['Bankledgersupplier']="cashbook/supplierledger";
|
||||
$route['Bankledgercustomer']="cashbook/customerledger";
|
||||
$route['Bankamountpaid']= "cashbook/amountpaidsupplier";
|
||||
$route['Bankamountunpaid']= "cashbook/amountunpaid";
|
||||
//$route['Bankamountreceived']= "cashbook/amountreceived";
|
||||
|
||||
@ -1675,7 +1675,71 @@ class cashbook extends BaseController
|
||||
|
||||
// }
|
||||
|
||||
|
||||
function supplierledger()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Amount Payment Details';
|
||||
//$suppliername= $_GET['sid'];
|
||||
if ($this->input->post('btn_submit'))
|
||||
{
|
||||
$ab=$this->input->post('financialyear');
|
||||
$fa=substr($ab,0,-5);
|
||||
$aa=substr($ab,5,5);
|
||||
$m=$this->input->post('month');
|
||||
$fdate = $this->input->post('from_date');
|
||||
$tdate = $this->input->post('to_date');
|
||||
$supplierID= $this->input->post('supplier');
|
||||
$data['supplierid']=$supplierID;
|
||||
$suppliername= $this->input->post('SupplierName');
|
||||
$data['suppliername']=$suppliername;
|
||||
$data['fa']=$fa;
|
||||
$data['aa']=$aa;
|
||||
$data['m']=$m;
|
||||
$data['fdate']=$fdate;
|
||||
$data['tdate']=$tdate;
|
||||
$data['suppliername']= $suppliername;
|
||||
$data['supplierledger'] = $this->cashbook_model->supplierledger($suppliername,$fdate,$tdate,$fa,$aa,$m);
|
||||
$data['openingbalancesupplier'] = $this->cashbook_model->openingbalancesupplier($customer,$fdate,$tdate,$fa,$aa,$m);
|
||||
//print_r($data['supplierledger']);
|
||||
}
|
||||
|
||||
$data['finyear']=$this->cashbook_model->report_amountpaid();
|
||||
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||
$this->loadViews("banksupplierledger", $this->global,$data, NULL);
|
||||
|
||||
}
|
||||
function customerledger()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : Bank Report - Amount Payment Details';
|
||||
//$suppliername= $_GET['sid'];
|
||||
if ($this->input->post('btn_submit'))
|
||||
{
|
||||
$ab=$this->input->post('financialyear');
|
||||
$fa=substr($ab,0,-5);
|
||||
$aa=substr($ab,5,5);
|
||||
$m=$this->input->post('month');
|
||||
$fdate = $this->input->post('from_date');
|
||||
$tdate = $this->input->post('to_date');
|
||||
$supplierID= $this->input->post('supplier');
|
||||
$data['supplierid']=$supplierID;
|
||||
$customer = $this->input->post('Customer');
|
||||
$data['suppliername']=$suppliername;
|
||||
$data['fa']=$fa;
|
||||
$data['aa']=$aa;
|
||||
$data['m']=$m;
|
||||
$data['fdate']=$fdate;
|
||||
$data['tdate']=$tdate;
|
||||
$data['customername']= $Customer;
|
||||
$data['customerledger'] = $this->cashbook_model->customerledger($customer,$fdate,$tdate,$fa,$aa,$m);
|
||||
$data['openingbalance'] = $this->cashbook_model->openingbalance($customer,$fdate,$tdate,$fa,$aa,$m);
|
||||
|
||||
}
|
||||
|
||||
$data['finyear']=$this->cashbook_model->report_amountpaid();
|
||||
$data['getcustomer'] = $this->cashbook_model->getcustomer();
|
||||
$this->loadViews("bankcustomerledger", $this->global,$data, NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function amountunpaid()
|
||||
|
||||
@ -611,6 +611,189 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
||||
|
||||
|
||||
}
|
||||
function supplierledger($suppliername,$fdate,$tdate,$fa,$aa,$m)
|
||||
{
|
||||
|
||||
|
||||
$sql="select date,igrn,ID,narration,sid,supplier_name,amountpaid,
|
||||
sum(total) as total
|
||||
from ledgersupplier
|
||||
where ID != 'null' and Status != 'ST030'";
|
||||
|
||||
|
||||
|
||||
if ($suppliername!= ''){
|
||||
|
||||
$sql.="and sid = '".$suppliername."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (date >= '".$fa."-04-01' and date <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(date) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$sql.="and date(date) >= '".$fromd."'
|
||||
and date(date) <= '".$tod."'";
|
||||
|
||||
|
||||
}
|
||||
|
||||
$sql.="group by igrn";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
|
||||
}
|
||||
function customerledger($customer,$fdate,$tdate,$fa,$aa,$m)
|
||||
{
|
||||
|
||||
|
||||
$sql="select date,id,amount,invoice_number,invoice_status_id,customername,customerid,payment,id
|
||||
from ledgercustomer
|
||||
where invoice_number != 'null' ";
|
||||
|
||||
|
||||
|
||||
if ($customer!= ''){
|
||||
|
||||
$sql.="and customerid = '".$customer."'";
|
||||
|
||||
}
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (date >= '".$fa."-04-01' and date <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(date) = '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$sql.="and date(date) >= '".$fromd."'
|
||||
and date(date) <= '".$tod."'";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
|
||||
}
|
||||
function openingbalance($customer,$fdate,$tdate,$fa,$aa,$m)
|
||||
{
|
||||
|
||||
$sql="select date as date,sum(payment) as payment
|
||||
from ledgercustomer
|
||||
where invoice_number != 'null' ";
|
||||
|
||||
|
||||
if ($customer!= ''){
|
||||
|
||||
$sql.="and customerid = '".$customer."'";
|
||||
|
||||
}
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (date >= '".$fa."-04-01' and date <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(date) >= '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime('01-04-2018'));
|
||||
|
||||
$sql.="and date(date) >= '".$tod."'
|
||||
and date(date) <= '".$fromd."'";
|
||||
//$sql.="and date('2018-04-01') <= '".$fromd."'";
|
||||
|
||||
|
||||
}
|
||||
$query = $this->db->query($sql);
|
||||
// print_r($this->db->last_query());
|
||||
// die();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
function openingbalancesupplier($customer,$fdate,$tdate,$fa,$aa,$m)
|
||||
{
|
||||
|
||||
$sql="select date as date,sum(amountpaid) as amountpaid
|
||||
from ledgersupplier
|
||||
where ID != 'null' ";
|
||||
|
||||
|
||||
if ($customer!= ''){
|
||||
|
||||
$sql.="and customerid = '".$customer."'";
|
||||
|
||||
}
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (date >= '".$fa."-04-01' and date <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(date) >= '".$m."'";
|
||||
|
||||
}
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime('01-04-2018'));
|
||||
|
||||
$sql.="and date(date) >= '".$tod."'
|
||||
and date(date) <= '".$fromd."'";
|
||||
//$sql.="and date('2018-04-01') <= '".$fromd."'";
|
||||
|
||||
|
||||
}
|
||||
$query = $this->db->query($sql);
|
||||
// print_r($this->db->last_query());
|
||||
// die();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
function receivedamount($Customer,$fdate,$tdate)
|
||||
{
|
||||
// $status='ST065';
|
||||
|
||||
484
application/views/bankcustomerledger.php
Normal file
484
application/views/bankcustomerledger.php
Normal file
@ -0,0 +1,484 @@
|
||||
|
||||
|
||||
<?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;
|
||||
if(!empty($customerledger)){
|
||||
foreach($customerledger as $cl)
|
||||
{
|
||||
$total=$cl->amount;
|
||||
$payments=$cl->payment;
|
||||
$amountreceived=$cl->amountreceived;
|
||||
$Balance=$total-$amountreceived;
|
||||
$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>
|
||||
|
||||
|
||||
448
application/views/banksupplierledger.php
Normal file
448
application/views/banksupplierledger.php
Normal file
@ -0,0 +1,448 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
//echo $suppliername;
|
||||
foreach($openingbalancesupplier as $balance)
|
||||
{
|
||||
$openbalance=$balance->amountpaid;
|
||||
}
|
||||
foreach($financialyear as $item)
|
||||
|
||||
{
|
||||
$finyear = $item->financial_year;
|
||||
|
||||
} ?>
|
||||
|
||||
|
||||
<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="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;">Supplier 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($supplierledger as $sl)
|
||||
{
|
||||
$suppliername=$sl->supplier_name;
|
||||
}
|
||||
?>
|
||||
<center><h4 style="color:#3c8dbc"><span><?php echo $suppliername;?></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="SupplierName" name="SupplierName">
|
||||
<option value="">Select Supplier</option>
|
||||
<?php foreach($getsupplier as $gs):
|
||||
{?>
|
||||
<option value="<?php echo $gs->SupplierID;?>"><?php echo $gs->SupplierName ;?></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_paid=0;
|
||||
$total_po=0;
|
||||
$balance_due=0;
|
||||
|
||||
if(!empty($supplierledger)){
|
||||
foreach($supplierledger as $sls)
|
||||
{
|
||||
$totalpo=$sls->total;
|
||||
$total_po=$total_po+$totalpo;
|
||||
$amountpaid=$sls->amountpaid;
|
||||
$amount_paid= $amount_paid+$amountpaid;
|
||||
$balance_due=$total_po-$amount_paid;
|
||||
}
|
||||
$i++;
|
||||
?>
|
||||
<p style="color:green" "font-size:22px";><strong>Opening Balnce</strong> : <?php echo $openbalance ?>(₹)</p>
|
||||
<p style="color:green";><strong>Purchased Amount </strong>: <?php echo $total_po ?>(₹)</p>
|
||||
<p style="color:green";><strong>Amount Paid </strong> : <?php echo $amount_paid?>(₹)</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>Supplier Name</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_amountpaid=0;
|
||||
$tot_balance=0;
|
||||
$i=1;
|
||||
$ti=0.00;
|
||||
$tvt=0.00;
|
||||
if(!empty($supplierledger)){
|
||||
foreach($supplierledger as $sl)
|
||||
{
|
||||
$total=$sl->total;
|
||||
$payments=$sl->amountpaid;
|
||||
$Balance=$total-$payments;
|
||||
$Bankdate=$sl->bankdate;
|
||||
$narration=$sl->narration
|
||||
// $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($sl->date),'d-m-Y'); ?></span></td>
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $sl->supplier_name?></span></td>
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $sl->narration?></span></td>
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $sl->ID?></span></td>
|
||||
<?php
|
||||
if(!empty($narration))
|
||||
{
|
||||
$total=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$total=$sl->total;
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
<?php
|
||||
if(!empty($payments))
|
||||
{
|
||||
$Balance=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$Balance=$total-$payments;
|
||||
}
|
||||
?>
|
||||
<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> </td>
|
||||
<td> </td>
|
||||
|
||||
<td class="amount"><strong>
|
||||
<?php echo $tot_amount; ?>
|
||||
</strong></td>
|
||||
<td class="amount"><strong>
|
||||
<?php echo $tot_balance;?>
|
||||
</strong></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>
|
||||
$(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: 'Supplier Ledger',
|
||||
exportOptions: {
|
||||
columns: ':visible'
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
} );
|
||||
$( 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;
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user