changes for bbnepal

This commit is contained in:
2024-10-07 11:41:27 +05:45
parent e3c8a3b5fe
commit 967642f2be
12 changed files with 151 additions and 25 deletions

View File

@ -129,7 +129,8 @@ class myaccounts
{
$CI = &get_instance();
$Account = $CI->db->query("select * from tbl_accounts where account_id='$account_id'")->row();
$Account->Balance = $this->getBalance($account_id);
// $Account->Balance = $this->getBalance($account_id);
// echo"<pre>";print_r($Account); die();
return $Account;
}
function getBalance($account_id)
@ -179,7 +180,6 @@ class myaccounts
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
}
//$q=$CI->db->get_compiled_select();
//print($q);
?>
<div class="row mb-3">
<?php if ($accategory_id == "") : ?>
@ -684,7 +684,7 @@ class myaccounts
<div class="card-header">
<h5 class="m-0">Leger for Account : <?php echo $Account->account_name; ?>
<!-- <a href="<?php echo site_url("accounts/ledger/print/" . $Account->account_id . "/?" . $_SERVER['QUERY_STRING']); ?>" class="btn btn-success btn-sm float-right">Print</a> -->
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
<button type="submit" id="downloadCsv1" class="btn btn-warning btn-sm ">
Export csv
</button>
</h5>
@ -694,7 +694,7 @@ class myaccounts
<h5 class="text-center">Ledger Details for <?php echo $Account->account_name; ?> </h5>
<?php $TableData = $Transactions; ?>
<?php $TotalCols = 7; ?>
<table id='myTable' class="table table-bordered table-head-fixed text-nowrap table-striped ">
<table id='myTable1' class="table table-bordered table-head-fixed text-nowrap table-striped ">
<thead>
<tr>
<th class="col-1"><?php myLang("Date"); ?></th>
@ -769,13 +769,43 @@ class myaccounts
</tfoot>
</table>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="myModalLabel">Modal Title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="modal-body">
<!-- Content loaded via AJAX will go here -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- pdf document -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
<script>
document.getElementById('downloadCsv').addEventListener('click', function() {
const table = document.getElementById('myTable');
$(document).ready(function() {
$('.open-modal').click(function(e) {
e.preventDefault(); // Prevent the default link behavior
const url = $(this).attr('href'); // Get the URL from the link
$('#modal-body').load(url, function() {
$('#myModal').modal('show'); // Show the modal after loading content
});
});
});
</script>
<script>
document.getElementById('downloadCsv1').addEventListener('click', function() {
const table = document.getElementById('myTable1');
const rows = Array.from(table.rows);
const data = [];