changes for bbnepal
This commit is contained in:
@ -0,0 +1,70 @@
|
||||
<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")->where("created_on >= '$fiscalStart'")->where("created_on >= '$fiscalEnd'");
|
||||
$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 id='myTable' class='table table-bordered table-striped longdataTable'>";
|
||||
$html .= "<thead>";
|
||||
$html .= "<tr><th class='text-center' width='25'>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'>Balance</th><th class='text-center col-1'>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-1'>" . (myCurrency($balance)) . "</td><td class=' 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>";
|
||||
endforeach;
|
||||
$html .= "</tbody><tfoot>";
|
||||
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . (($BalanceTotal > 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . (($BalanceTotal < 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</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\">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class=\"modal-body\" id=\"details_container\">
|
||||
Ledger Details Goes Here
|
||||
</div>
|
||||
<!--<div class=\"modal-footer\">
|
||||
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>
|
||||
<button type=\"button\" class=\"btn btn-success\" data-dismiss=\"modal\">Print</button>
|
||||
</div>-->
|
||||
</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>
|
@ -16,6 +16,7 @@
|
||||
<div class="col"><?php createButton("show_ledger", "Show Ledger", "show_ledger", "Submit", "btn btn-primary"); ?></div>
|
||||
</div>
|
||||
</form>
|
||||
<button id="openModal" class="btn btn-primary">Open Modal</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
|
@ -9,4 +9,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
<!-- Navbar -->
|
||||
|
||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light ">
|
||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light hidden-navbar ">
|
||||
|
||||
<!-- Left navbar links -->
|
||||
|
||||
|
@ -137,11 +137,14 @@
|
||||
<td class="text-center"><?php echo $a; ?></td>
|
||||
<td><?php echo $TableRow->title; ?></td>
|
||||
<td><?php echo $TableRow->item_code; ?></td>
|
||||
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td>
|
||||
<td><?php echo number_format((int)getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id),2); ?></td>
|
||||
|
||||
|
||||
<td><?php echo getFieldfromValue("tbl_itemcategories", "title", "itemcategory_id", $TableRow->itemcategories_id); ?></td>
|
||||
<td class="text-right"><?php echo $TableRow->Stock->qty; ?></td>
|
||||
<td class="text-right"><?php echo $TableRow->Stock->rate; ?></td>
|
||||
<td class="text-right"><?php echo $TableRow->Stock->amount; ?></td>
|
||||
<td class="text-right"><?php echo number_format((int)$TableRow->Stock->qty,2); ?></td>
|
||||
|
||||
<td class="text-right"><?php echo number_format((int)$TableRow->Stock->rate,2); ?></td>
|
||||
<td class="text-right"><?php echo number_format((int)$TableRow->Stock->amount,2); ?></td>
|
||||
<td class="text-center">
|
||||
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
||||
<?php showDeleteButton($id); ?>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="col">
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5>
|
||||
<!-- <h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5> -->
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php $TableData = $this->db->query("select * from tbl_purchases where status=1")->result(); ?>
|
||||
@ -21,13 +21,13 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $a = 0;
|
||||
<?php $a = 0; $n=0;
|
||||
foreach ($PurchaseRecords as $TableRow) : $a++;
|
||||
$id = $TableRow->purchase_id; ?>
|
||||
<tr>
|
||||
<td><?php echo $TableRow->purchase_ref; ?></td>
|
||||
<td><?php echo ++$n; ?></td>
|
||||
<td><?php echo $TableRow->purchase_date; ?></td>
|
||||
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></td>
|
||||
<td><?php echo ($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name) ?? ""; ?></td>
|
||||
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
|
||||
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
|
||||
<?php showDeleteButton($id); ?>
|
||||
|
@ -24,7 +24,7 @@
|
||||
<tr>
|
||||
<td class="text-center"><?php echo $TableRow->sales_id; ?></td>
|
||||
<td><?php echo $TableRow->sales_date; ?></td>
|
||||
<td><b><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></b>
|
||||
<td><b><?php echo (($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name) ?? ""); ?></b>
|
||||
<div class="row ml-2 mr-2" style="border-bottom: 1px solid;">
|
||||
<span class="col item_name"><?php echo myLang("Particulars") ?></span>
|
||||
<span class="col item_qty"><?php echo myLang("Qty") ?></span>
|
||||
|
@ -12,17 +12,22 @@
|
||||
<table class="table table-bordered table-striped dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class=" col-1 text-center"><?php myLang('ID'); ?></th>
|
||||
<th class=" col-1 text-center"><?php myLang('Sales Voucher #'); ?></th>
|
||||
<th class=" col-1 text-center"><?php myLang('Item'); ?></th>
|
||||
<th class="col-1"><?php myLang('Date'); ?></th>
|
||||
<th><?php myLang('Transaction'); ?></th>
|
||||
<th class="table-col col-1 text-center"><?php myLang('Amount'); ?></th>
|
||||
<th class="text-center" width="5%"> <?php myLang('Action'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($SalesRecords as $TableRow) : ?>
|
||||
<tbody>
|
||||
<?php $n=0 ; ?>
|
||||
<?php foreach ($SalesRecords as $key=>$TableRow) : ?>
|
||||
<tr>
|
||||
<td class="text-center"><?php echo ++$n; ?></td>
|
||||
<td class="text-center"><?php echo $TableRow->sales_id; ?></td>
|
||||
<td class="text-center"><?php echo ($TableRow->Details[$key]->Item->title) ?? ""; ?></td>
|
||||
<td><?php echo $TableRow->sales_date; ?></td>
|
||||
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user