381 lines
10 KiB
PHP
Executable File
381 lines
10 KiB
PHP
Executable File
<?php
|
|
|
|
|
|
if (!empty($debitmapping)) {
|
|
}
|
|
|
|
|
|
foreach ($financialyear as $item) {
|
|
$finyear = $item->financial_year;
|
|
} ?>
|
|
|
|
|
|
<!-- <link rel="stylesheet." href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> -->
|
|
<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="content-wrapper">
|
|
<section class="content">
|
|
<div class="row">
|
|
|
|
<!-- Left col -->
|
|
<div class="col-md-12">
|
|
<!-- TABLE: LATEST ORDERS -->
|
|
<div class="box box-info">
|
|
<div class="box box-info" id="content">
|
|
|
|
<?php
|
|
if (!empty($mappingiv)) {
|
|
foreach ($mappingiv as $ap) {
|
|
$bankid = $ap->bankid;
|
|
}
|
|
}
|
|
if (!empty($mappingcashbook)) {
|
|
foreach ($mappingcashbook as $mc) {
|
|
$bankid = $mc->bankid;
|
|
}
|
|
}
|
|
|
|
|
|
if (!empty($paidcbook)) {
|
|
|
|
foreach ($paidcbook as $pc) {
|
|
$pcamount = $pc->total;
|
|
}
|
|
}
|
|
|
|
if (!empty($clearbalance)) {
|
|
|
|
|
|
$bankclear = $clearbalance;
|
|
}
|
|
if (!empty($balancetoclear)) {
|
|
|
|
|
|
$bankbaltoclear = $balancetoclear;
|
|
}
|
|
|
|
|
|
if (!empty($invoiceramount)) {
|
|
foreach ($invoiceramount as $ia) {
|
|
$inamount = $ia->amountreceived;
|
|
}
|
|
}
|
|
|
|
|
|
$totalamount = $pcamount + $inamount;
|
|
//echo $totalamount;
|
|
?>
|
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
|
<center>
|
|
<h3 class="box-title">
|
|
<p style="color: #00d976;"><b>Bank Credit Amount Paid Report</b></p>
|
|
</h3>
|
|
</center>
|
|
<br>
|
|
<br>
|
|
|
|
|
|
<div class="box-body">
|
|
<table class="table table-bordered table-hover" style="table-layout:auto;">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Payment ID</th>
|
|
<th>Payment Mode</th>
|
|
<th>Payment Amount (₹)</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><?php echo $bankid ?></td>
|
|
<td>Bank</td>
|
|
<td><?php echo $bankclear ?></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
<br>
|
|
<br>
|
|
|
|
</form>
|
|
|
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
|
<thead>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th>INVOICE NO</th>
|
|
<th>Customer Name</th>
|
|
<th>Total Amount (₹)</th>
|
|
<th>Received Amount</th>
|
|
<th>Balance To Received</th>
|
|
|
|
<th>Action</th>
|
|
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$i = 1;
|
|
$ti = 0.00;
|
|
$tvt = 0.00;
|
|
$preBalance = 0;
|
|
$preINV = '';
|
|
|
|
if (!empty($mappingiv)) {
|
|
foreach ($mappingiv as $ap) {
|
|
?>
|
|
<tr>
|
|
|
|
|
|
<input type="hidden" name="mappingid" id="mappingid<?php echo $i ?>" value="<?php echo $ap->ID ?>" />
|
|
<input type="hidden" name="credit" id="credit<?php echo $i ?>" value="<?php echo $ap->Credit ?>" />
|
|
<input type="hidden" name="bankingbalclear" id="bankingbalclear<?php echo $i ?>" value="<?php echo $bankbaltoclear; ?>" />
|
|
<input type="hidden" name="bankingclear" id="bankingclear<?php echo $i ?>" value="<?php echo $bankclear; ?>" />
|
|
<input type="hidden" name="bankingid" id="bankingid<?php echo $i ?>" value="<?php echo $ap->bankid; ?>" />
|
|
<td align="left" id="tov<?php echo $i ?>"><span><?php echo format_date($ap->indate, 0, 'd-m-Y'); ?></span></td>
|
|
<td align="left" id="invno<?php echo $i ?>"><?php echo $ap->invoiceno ?></span></td>
|
|
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->customername ?></span></td>
|
|
<td align="left" id="totinvoiceamount<?php echo $i ?>"><span><?php echo $ap->totinvoiceamount ?></span></td>
|
|
<td align="left" id="amountreceived<?php echo $i ?>"><span><?php echo $ap->amountreceived ?></span></td>
|
|
|
|
<!--<td align="left" id="balancetoreceived<?php echo $i ?>"><span><?php echo $ap->totinvoiceamount - $ap->amountreceived ?></span></td>-->
|
|
|
|
<td align="left" id="balancetoreceived<?php echo $i ?>">
|
|
<span>
|
|
<?php
|
|
if ($preINV == $ap->invoiceno) {
|
|
if ($preBalance == 0) {
|
|
$balance = $ap->totinvoiceamount - $ap->amountreceived;
|
|
echo $balance;
|
|
} else {
|
|
|
|
$balance = $preBalance - $ap->amountreceived;
|
|
echo $balance;
|
|
}
|
|
} else {
|
|
|
|
if ($preINV != $ap->invoiceno) {
|
|
// $preBalance =0 ;
|
|
$balance = $ap->totinvoiceamount - $ap->amountreceived;
|
|
echo $balance;
|
|
// echo $ap->invoiceno;
|
|
// echo 'elseif';
|
|
// echo $preINV;
|
|
|
|
} else {
|
|
$balance = $ap->totinvoiceamount - $preBalance;
|
|
echo $balance;
|
|
echo 'elseelse';
|
|
}
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
</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(<?php echo $i ?>)"></i> </a>
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
<?php
|
|
$i++;
|
|
$preINV = $ap->invoiceno;
|
|
$preBalance = $balance;
|
|
}
|
|
}
|
|
?>
|
|
</tbody>
|
|
|
|
</table>
|
|
<center>
|
|
<h3 class="box-title">
|
|
<p style="color: #00d976;"><b>Cashbook Reports</b></p>
|
|
</h3>
|
|
</center>
|
|
<br>
|
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Date</th>
|
|
<th>Account Name</th>
|
|
<th>Bankid</th>
|
|
<th>Amount Type</th>
|
|
<th>Total Amount (₹)</th>
|
|
<!--<th>Advance PO Amount (₹)</th>-->
|
|
<th>Option (₹)</th>
|
|
<th>Action</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$i = 1;
|
|
$ti = 0.00;
|
|
$tvt = 0.00;
|
|
if (!empty($mappingcashbook)) {
|
|
|
|
foreach ($mappingcashbook as $mc) {
|
|
?>
|
|
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
<td align="left" id="date"><span><?php echo $mc->date ?></span></td>
|
|
<td align="left" id="date"><span><?php echo $mc->name ?></span></td>
|
|
<!--<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/receipt?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="bankid"><span><?php echo $mc->bankid ?></span></td>
|
|
<td align="left" id="tov"><span><?php echo $mc->amounttype ?></span></td>
|
|
<td align="left" id="aa"><span><?php echo $mc->total ?></span></td>
|
|
<td align="left" id="aa"><span><?php echo $mc->cashtype ?></span></td>
|
|
<td>
|
|
<a data-toggle="tooltip" href="<?php echo base_url() . 'Deleteinvoiceurl?bankid=' . $mc->bankid; ?>&id=<?php echo $mc->id ?>&amount=<?php echo $mc->total ?>&balancetoclear=<?php echo $balancetoclear ?>&clearbalance=<?php echo $bankclear ?>&accountname=<?php echo $mc->name ?>&amounttype=<?php echo $mc->amounttype ?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i> </a>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<?php
|
|
$i++;
|
|
}
|
|
}
|
|
?>
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- /.box -->
|
|
|
|
<!-- /.col -->
|
|
</section>
|
|
</div>
|
|
|
|
|
|
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
|
|
<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 invoice(i) {
|
|
|
|
$('#loader').show();
|
|
var totinvoiceamount = $('#totinvoiceamount' + i).text();
|
|
|
|
var balancetoreceived = $('#balancetoreceived' + i).text();
|
|
var invoiceno = $('#invno' + i).text();
|
|
//alert(invoiceno);
|
|
var bankid = $('#bankingid' + i).val();
|
|
var amountreceived = $('#amountreceived' + i).text();
|
|
|
|
var bankingclear = $('#bankingclear' + i).val();
|
|
var mappingid = $('#mappingid' + i).val();
|
|
var credit = $('#credit' + i).val();
|
|
var bankingbalclear = $('#bankingbalclear' + i).val();
|
|
|
|
|
|
$.ajax(
|
|
|
|
{
|
|
data: {
|
|
credit: credit,
|
|
mappingid: mappingid,
|
|
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) {
|
|
$('#loader').hide();
|
|
|
|
if (data) {
|
|
|
|
window.location.href = "Bankingstatement";
|
|
//location.reload();
|
|
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
$(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: $('h3').text(),
|
|
title: 'cashbook Overall Report',
|
|
exportOptions: {
|
|
columns: ':visible'
|
|
|
|
}
|
|
},
|
|
|
|
'colvis'
|
|
]
|
|
});
|
|
});
|
|
</script>
|