BBnepal-Accounts/account/application/views/accounts/ledger_cashbook.php

91 lines
6.0 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="card card-primary card-outline ">
<div class="card-header bg-primary disabled color-palette">
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="dataTable_wrapper">
<?php //$this->myaccounts->getAllAccountsTable(3);
?>
<?php
$accategory_id = 3;
$CI = &get_instance();
// $CI->db->where("status", 1)->where("(accategory_id = 2 OR accategory_id = 3)");
$CI->db->where("status", 1)->where("accategory_id = 3");
$CI->db->order_by("account_name ASC");
$Accounts = $CI->db->get("tbl_accounts")->result();
foreach ($Accounts as $Account) {
$Account->Group = $CI->db->query("select * from tbl_acgroups where acgroup_id=(select acgroup_id from tbl_accategories where accategory_id = $Account->accategory_id)")->row();
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
}
?>
<div class="row mb-3">
<!-- <div id="dataTable_commands" class="col text-right"></div> -->
</div>
<?php
$html = "";
$html .= "<table class='table table-bordered table-striped longdataTable'>";
$html .= "<thead>";
$html .= "<tr><th class='text-center'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Action</th></tr>";
$html .= "</thead><tbody>";
$sn = 0;
$BalanceTotal = 0;
foreach ($Accounts as $Account) : $sn++;
$balance = getBalance($Account->account_id);
$BalanceTotal += $balance;
// pre($Account);
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-2 text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
2024-07-10 12:43:19 +00:00
endforeach;
$html .= "</tbody><tfoot>";
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th><th></th></tr>";
$html .= "</tfoot></table>\n";
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-xl\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"exampleModalLabel\">Ledger Details</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=\"details_container\">
Ledger Details Goes Here
</div>
2024-07-12 12:12:29 +00:00
<!--<div class=\"modal-footer\">
2024-07-10 12:43:19 +00:00
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>
<button type=\"button\" class=\"btn btn-success\" data-dismiss=\"modal\">Print</button>
2024-07-12 12:12:29 +00:00
</div>-->
2024-07-10 12:43:19 +00:00
</div>
</div>
</div>";
$html .= '<script>function showLedger(id) {$.ajax({url: \'';
$html .= site_url("accounts/reports/ajax/getledgersummary/");
$html .= '\' + id,success: function(data) {$(\'#ledgerdetails_box #details_container\').html(data);$(\'#ledgerdetails_box\').modal(\'show\');}});}</script>';
echo $html;
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php function footerFunctions()
{
?>
<?php
}
?>