Compare commits

...

9 Commits

Author SHA1 Message Date
Sampanna Rimal
497f567cba balancesheet 2024-08-26 17:17:43 +05:45
Raju Shrestha
31e7f8de87 edit 2024-08-26 13:39:34 +05:45
Raju Shrestha
a5d29a202e Merge branch 'main' of http://bibgit.com/sampanna/BBnepal-Accounts 2024-08-26 13:37:02 +05:45
Raju Shrestha
4109787bc4 cash flow 2024-08-26 13:36:59 +05:45
Sampanna Rimal
b1c6bad445 profitloss 2024-08-26 13:08:50 +05:45
Raju Shrestha
15b3e542a3 edit balance sheet 2024-08-26 13:04:47 +05:45
Raju Shrestha
cd361f79aa edit profit and loss 2024-08-26 12:35:45 +05:45
Raju Shrestha
759b97e1f0 edit profti and loss 2024-08-26 12:29:38 +05:45
Raju Shrestha
161703be17 edit css 2024-08-25 18:37:52 +05:45
21 changed files with 1353 additions and 524 deletions

View File

@@ -5,7 +5,6 @@ function generateACCategoryCode($group_id)
$acgroup_code = $ci->db->where("acgroup_id=$group_id")->get("tbl_acgroups")->row()->acgroup_code; $acgroup_code = $ci->db->where("acgroup_id=$group_id")->get("tbl_acgroups")->row()->acgroup_code;
$lastACCategoryCode = $ci->db->select_max("accategory_code")->where("acgroup_id=$group_id")->get("tbl_accategories")->row()->accategory_code; $lastACCategoryCode = $ci->db->select_max("accategory_code")->where("acgroup_id=$group_id")->get("tbl_accategories")->row()->accategory_code;
$category_part = substr($lastACCategoryCode, 1); $category_part = substr($lastACCategoryCode, 1);
$category_part = (float)$category_part + 1; $category_part = (float)$category_part + 1;
//if($category_part<10)$category_part="00".$category_part; //if($category_part<10)$category_part="00".$category_part;
if ($category_part < 10) $category_part = "00" . $category_part; if ($category_part < 10) $category_part = "00" . $category_part;
@@ -18,7 +17,6 @@ function generateAccountCode($category_id)
$accategory_code = $ci->db->where("accategory_id=$category_id")->get("tbl_accategories")->row()->accategory_code; $accategory_code = $ci->db->where("accategory_id=$category_id")->get("tbl_accategories")->row()->accategory_code;
$lastAccountCode = $ci->db->select_max("account_code")->where("accategory_id=$category_id")->get("tbl_accounts")->row()->account_code; $lastAccountCode = $ci->db->select_max("account_code")->where("accategory_id=$category_id")->get("tbl_accounts")->row()->account_code;
$account_part = substr($lastAccountCode, 4); $account_part = substr($lastAccountCode, 4);
$account_part = (float)$account_part + 1; $account_part = (float)$account_part + 1;
//if($category_part<10)$category_part="00".$category_part; //if($category_part<10)$category_part="00".$category_part;
if ($account_part < 10) $account_part = "00" . $account_part; if ($account_part < 10) $account_part = "00" . $account_part;
@@ -54,13 +52,10 @@ function showAccountCategoriesSelector($fieldName, $fieldID, $condition = "1=1",
$html .= " required"; $html .= " required";
} }
$html .= ">"; $html .= ">";
$html .= "<option value='' " . (($selectedID == '') ? "SELECTED" : "") . ">Select Account Category</option>"; $html .= "<option value='' " . (($selectedID == '') ? "SELECTED" : "") . ">Select Account Category</option>";
foreach ($AccountCategories as $AccountCategory) { foreach ($AccountCategories as $AccountCategory) {
$html .= "<option value='$AccountCategory->accategory_id'" . (($selectedID == $AccountCategory->accategory_id) ? "selected" : "") . ">" . getFieldfromValue("tbl_acgroups", "acgroup_name", "acgroup_id", $AccountCategory->acgroup_id) . " >> $AccountCategory->accategory_name</option>"; $html .= "<option value='$AccountCategory->accategory_id'" . (($selectedID == $AccountCategory->accategory_id) ? "selected" : "") . ">" . getFieldfromValue("tbl_acgroups", "acgroup_name", "acgroup_id", $AccountCategory->acgroup_id) . " >> $AccountCategory->accategory_name</option>";
} }
$html .= "</select>"; $html .= "</select>";
echo $html; echo $html;
} }
@@ -68,7 +63,6 @@ function showAccountCategoriesByIds($AccountCategories = array())
{ {
// pre($AccountCategories); //die; // pre($AccountCategories); //die;
$ci = &get_instance(); $ci = &get_instance();
if ($AccountCategories) { if ($AccountCategories) {
$AccountCategories_a = $ci->db->where("status", 1); $AccountCategories_a = $ci->db->where("status", 1);
$AccountCategories_a = $AccountCategories_a->where_in("accategory_id", $AccountCategories); $AccountCategories_a = $AccountCategories_a->where_in("accategory_id", $AccountCategories);
@@ -80,22 +74,19 @@ function showAccountCategoriesByIds($AccountCategories = array())
echo implode(", ", $html); echo implode(", ", $html);
} }
} }
function linkVoucher($voucher_id) function linkVoucher($voucher_id)
{ {
if($voucher_id!=0) { if ($voucher_id != 0) {
$ci = &get_instance(); $ci = &get_instance();
$Voucher = $ci->db->where("voucher_id", $voucher_id)->get("tbl_vouchers")->row(); $Voucher = $ci->db->where("voucher_id", $voucher_id)->get("tbl_vouchers")->row();
$Name = $ci->db->where("vouchertype_id", $Voucher->voucher_type)->get("tbl_vouchertypes")->row()->voucher_type . " Voucher # " . $Voucher->voucher_no; $Name = $ci->db->where("vouchertype_id", $Voucher->voucher_type)->get("tbl_vouchertypes")->row()->voucher_type . " Voucher # " . $Voucher->voucher_no;
echo "<a class='link' target='_blank' href='" . site_url("accounts/vouchers/show_voucher/" . $voucher_id) . "'>$Name</a>"; echo "<a class='link' target='_blank' href='" . site_url("accounts/vouchers/show_voucher/" . $voucher_id) . "'>$Name</a>";
} else { } else {
echo ""; echo "";
} }
} }
function linkLedger($Account) function linkLedger($Account)
{ {
$ci = &get_instance(); $ci = &get_instance();
echo "<a class='link' target='_blank' href='" . site_url("accounts/ledger/partyledger?from_date=" . FYStart() . "&to_date=" . FYEnd() . "&account_id=" . $Account->account_id . "&show_ledger=true") . "'>$Account->account_name</a>"; echo "<a class='link' target='_blank' href='" . site_url("accounts/ledger/partyledger?from_date=" . FYStart() . "&to_date=" . FYEnd() . "&account_id=" . $Account->account_id . "&show_ledger=true") . "'>$Account->account_name</a>";
} }
@@ -143,15 +134,11 @@ function generateVoucherNo($vouchertype_id = "")
{ {
$ci = &get_instance(); $ci = &get_instance();
$voucherTypeCondition = ($vouchertype_id != "") ? " WHERE voucher_type = '$vouchertype_id'" : ""; $voucherTypeCondition = ($vouchertype_id != "") ? " WHERE voucher_type = '$vouchertype_id'" : "";
$query = $ci->db->query("SELECT MAX(voucher_no) AS voucher_no FROM tbl_vouchers" . $voucherTypeCondition); $query = $ci->db->query("SELECT MAX(voucher_no) AS voucher_no FROM tbl_vouchers" . $voucherTypeCondition);
$row = $query->row(); $row = $query->row();
$newVoucherNo = ($row->voucher_no !== null) ? $row->voucher_no + 1 : 1; $newVoucherNo = ($row->voucher_no !== null) ? $row->voucher_no + 1 : 1;
return $newVoucherNo; return $newVoucherNo;
} }
function countChildCategories($acgroup_id) function countChildCategories($acgroup_id)
{ {
$ci = &get_instance(); $ci = &get_instance();

View File

@@ -766,17 +766,16 @@ class bibaccounts
<tr> <tr>
<td class="group-name">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><?php echo $Account->account_name; ?></i></td> <td class="group-name">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><?php echo $Account->account_name; ?></i></td>
<?php if ($ReportOptions['showOB']) : ?> <?php if ($ReportOptions['showOB']) : ?>
<td class="group-total "><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->opening_balance : 0); ?></td> <td class="group-total"><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->opening_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->opening_balance : 0); ?></td> <td class="group-total "><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->opening_balance : 0); ?></td>
<?php endif; ?> <?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?> <?php if ($ReportOptions['showPeriod']) : ?>
<td class="group-total"><i><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->regular_balance : 0); ?></i></td>
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->regular_balance : 0); ?><?php //pre($Account); <td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->regular_balance : 0); ?><?php //pre($Account);
?></td> ?></td>
<?php endif; ?> <?php endif; ?>
<?php if ($ReportOptions['showClosing']) : ?> <?php if ($ReportOptions['showClosing']) : ?>
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->closing_balance : 0); ?></td> <td class="group-total col-2"><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->closing_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->closing_balance : 0); ?></td> <td class="group-total col-2"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->closing_balance : 0); ?></td>
<?php endif; ?> <?php endif; ?>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

View File

@@ -14,9 +14,9 @@
<table class="table table-bordered table-striped longdataTable"> <table class="table table-bordered table-striped longdataTable">
<thead> <thead>
<tr> <tr>
<th class="col-2">Type</th> <th class="col-1">Type</th>
<th>Category Name</th> <th>Category Name</th>
<td class="col-1">Action</th> <th class="col-1 text-center">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -26,7 +26,7 @@
break; break;
endforeach; ?> endforeach; ?>
<?php if ($TableRow->parent_category_id == 0) : ?> <?php if ($TableRow->parent_category_id == 0) : ?>
<tr> <tr class="text-center">
<td><?php echo $TableRow->AccountGroup->acgroup_name; ?></td> <td><?php echo $TableRow->AccountGroup->acgroup_name; ?></td>
<td><?php echo $TableRow->accategory_name; ?></td> <td><?php echo $TableRow->accategory_name; ?></td>
<td><a href="<?php echo site_url("master/accategories/edit_parents/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> </a> <td><a href="<?php echo site_url("master/accategories/edit_parents/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> </a>

View File

@@ -29,12 +29,12 @@ function displayCategoryTree($tree)
// print_r($category);die; // print_r($category);die;
echo '<tr>'; echo '<tr>';
echo '<td class="col-1">' . $category['accategory_id'] . '</td>'; echo '<td class="col-1">' . $category['accategory_id'] . '</td>';
echo '<td class="col-6">' echo '<td class="col-6">'
. ($category['parent_category_id'] == 0 . ($category['parent_category_id'] == 0
? "<b><a href='" . site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] . "'>" ? "<b><a href='" . site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] . "'>"
: "<a href='" . site_url("accounts/reports/balance_by_ledger") . "?group=" . $category['accategory_id'] . "'>") : "<a href='" . site_url("accounts/reports/balance_by_ledger") . "?group=" . $category['accategory_id'] . "'>")
. $category['accategory_name'] . $category['accategory_name']
. "</a>" . "</a>"
. ($category['parent_category_id'] == 0 ? "</b>" : "") . ($category['parent_category_id'] == 0 ? "</b>" : "")
. '</td>'; . '</td>';
echo '<td class="col-2">' . myCurrency($category['dr']) . '</td>'; echo '<td class="col-2">' . myCurrency($category['dr']) . '</td>';
@@ -55,7 +55,6 @@ function displayCategoryTree($tree)
.expandable { .expandable {
text-decoration: underline; text-decoration: underline;
} }
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content"> <div class="content">

View File

@@ -1,5 +1,5 @@
<?php <?php
$t="INSERT INTO tbl_acgroups (acgroup_id, acgroup_code, acgroup_name, posting_side, created_on, created_by, remarks, status, display_order) $t = "INSERT INTO tbl_acgroups (acgroup_id, acgroup_code, acgroup_name, posting_side, created_on, created_by, remarks, status, display_order)
SELECT 5, '5', 'Equity', 'CR', '2023-05-22', 'admin', '', 1, 2 SELECT 5, '5', 'Equity', 'CR', '2023-05-22', 'admin', '', 1, 2
WHERE NOT EXISTS ( WHERE NOT EXISTS (
SELECT 1 FROM tbl_acgroups WHERE acgroup_id = 5 SELECT 1 FROM tbl_acgroups WHERE acgroup_id = 5
@@ -12,16 +12,14 @@ $AssetsAccounts = $this->acc->getAccountsByGroup(1);
$LiabilitiesTotal = $this->acc->getAccountBalanceByGroup(2); $LiabilitiesTotal = $this->acc->getAccountBalanceByGroup(2);
$EquityTotal = $this->acc->getAccountBalanceByGroup(5); $EquityTotal = $this->acc->getAccountBalanceByGroup(5);
$AssetsTotal = $this->acc->getAccountBalanceByGroup(1, false); $AssetsTotal = $this->acc->getAccountBalanceByGroup(1, false);
$IncomeAccounts = $this->acc->getAccountsByGroup(3); $IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4); $ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3); $IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4); $ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal; $PL = $IncomesTotal - $ExpensesTotal;
$LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL; $LiabilitiesTotal = $LiabilitiesTotal + $EquityTotal + $PL;
?> ?>
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content"> <div class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
@@ -39,13 +37,11 @@ $LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL;
</thead> </thead>
<tbody> <tbody>
<tr class="bg-dark"> <tr class="bg-dark">
<th>Liabilities</th> <th>Liabilities</th>
<th class="col-2">Amount</th> <th class="col-2">Amount</th>
<th>Assets</th> <th>Assets</th>
<th class="col-2">Amount</th> <th class="col-2">Amount</th>
</tr> </tr>
<tr class="bg-light"> <tr class="bg-light">
<td colspan="2"> <td colspan="2">
<?php $this->acc->showTable($LiabilitiesAccounts); ?> <?php $this->acc->showTable($LiabilitiesAccounts); ?>
@@ -54,33 +50,22 @@ $LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL;
<td colspan="2"> <td colspan="2">
<?php $this->acc->showTable($AssetsAccounts, false); ?> <?php $this->acc->showTable($AssetsAccounts, false); ?>
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr class="bg-light"> <tr class="bg-light">
<th>Net Profit:</th> <th>Net Profit:</th>
<th><?php echo myCurrency($PL); ?></th> <th><?php echo myCurrency($PL); ?></th>
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
<tr class="bg-light"> <tr class="bg-light">
<th>Total Liabilities:</th> <th>Total Liabilities:</th>
<th><?php echo myCurrency($LiabilitiesTotal); ?></th> <th><?php echo myCurrency($LiabilitiesTotal); ?></th>
<th>Total Assets: </th> <th>Total Assets: </th>
<th><?php echo myCurrency($AssetsTotal); ?></th> <th><?php echo myCurrency($AssetsTotal); ?></th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</div> </div>
</div> </div>

View File

@@ -12,7 +12,6 @@ $BIBAccounts = new BIBAccounts();
.group-name { .group-name {
width: 40%; width: 40%;
font-weight: 600px;
} }
.group-total { .group-total {
@@ -84,6 +83,30 @@ $BIBAccounts = new BIBAccounts();
box-shadow: inset 0 0 0 transparent; box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
} }
.table1 {
border: 0px !important;
padding: 0;
margin: 10 !important;
width: 100%;
vertical-align: middle;
}
.table-responsive {
overflow-x: auto;
}
.card-body {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 1px;
padding: 0;
}
table {
border: 1px solid #ddd;
border-collapse: collapse;
}
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
@@ -111,11 +134,7 @@ $BIBAccounts = new BIBAccounts();
</div> </div>
</div> </div>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<!-- <div class="form-check">
<input class="form-check-input" type="checkbox">
<label class="form-check-label">Select
All</label>
</div> -->
<div class="form-check"> <div class="form-check">
<!-- <input type="hidden" name="showOB" value="not"> --> <!-- <input type="hidden" name="showOB" value="not"> -->
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>> <input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
@@ -144,14 +163,7 @@ $BIBAccounts = new BIBAccounts();
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52"> <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
Export Export
</button> </button>
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle
Collapse</button> -->
<!-- <div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item">Export</a>
<a href="#" class="dropdown-item">Pdf</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">View calendar</a>
</div> -->
</div> </div>
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
@@ -168,58 +180,7 @@ $BIBAccounts = new BIBAccounts();
</div> </div>
<!-- /.card-tools --> <!-- /.card-tools -->
</div> </div>
<!-- <div class="card-body">
<form method="post" action="" id="FilterForm">
<div class="row align-items-end">
<div class="col-2">
<div class="form-group">
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate"><?php myLang("Ending Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showOB"><?php myLang("Opening"); ?></label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "" : "CHECKED"; ?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showClosing"><?php myLang("Closing"); ?></label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "" : "CHECKED"; ?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showPeriod"><?php myLang("Period"); ?></label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button type="submit" class="btn btn-success mr-2">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div> -->
</div> </div>
</div><!-- /.container-fluid --> </div><!-- /.container-fluid -->
</section> </section>
@@ -230,32 +191,34 @@ $BIBAccounts = new BIBAccounts();
<!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button> --> <!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button> -->
<div class="card card-primary card-outline"> <div class="card card-primary card-outline">
<div class="card-body p-0"> <div class="card-body pl-2 ">
<div class="row">
<?php <?php
// echo $_POST['showClosing']; // echo $_POST['showClosing'];
$ReportOptions = array( $ReportOptions = array(
'showZeroBalances' => false, 'showZeroBalances' => false,
'showOB' => false, 'showOB' => false,
'showClosing' => true, 'showClosing' => true,
'showPeriod' => false, 'showPeriod' => false,
); );
?> ?>
<table class="table table-bordered"> <?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
<thead> <?php $Side1Total = 0; ?>
<tr> <div class="col-6 p-0 m-0 gy-0">
<td class="group-name"><b>Particulars</b></td> <div class="table-responsive">
<td class="group-total text-right pr-2 "><b>Amount</b></td> <table class="table mb-0 pb-0">
<td class="group-name"><b>Particulars</b></td> <thead>
<td class="group-total text-right pr-2"><b>Amount</b></td> <tr>
</tr> <th class="group-name pl-1">Particulars</th>
</thead> <th class="group-total text-center col-1">Amount</th>
<tbody> </tr>
<tr> </thead>
<td colspan="2" class="p-0"> <tbody>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?> <?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
<?php $Side1Total = 0; ?> <?php $Side1Total = 0; ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable"> <?php
<?php
// Initialize variables for column totals // Initialize variables for column totals
$incomes_totalOpeningDr = 0; $incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0; $incomes_totalOpeningCr = 0;
@@ -282,9 +245,8 @@ $BIBAccounts = new BIBAccounts();
$Side1Total += $group->closing_balance; $Side1Total += $group->closing_balance;
?> ?>
<?php endforeach; ?> <?php endforeach; ?>
</table> <?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php <?php
// Initialize variables for column totals // Initialize variables for column totals
$incomes_totalOpeningDr = 0; $incomes_totalOpeningDr = 0;
@@ -312,11 +274,25 @@ $BIBAccounts = new BIBAccounts();
$Side1Total += $group->closing_balance; $Side1Total += $group->closing_balance;
?> ?>
<?php endforeach; ?> <?php endforeach; ?>
</table>
</td>
<td colspan="2" class="p-0"> </tbody>
</table>
</div>
</div>
<div class="col-6 p-0 m-0">
<div class="table-responsive">
<table class="table mt-0 pt-0">
<thead>
<tr>
<th class="group-name pl-1">Particulars</th>
<th class="group-total text-center col-1">Amount</th>
</tr>
</thead>
<tbody>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?> <?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php <?php
// Initialize variables for column totals // Initialize variables for column totals
$totalOpeningDr = 0; $totalOpeningDr = 0;
@@ -329,7 +305,7 @@ $BIBAccounts = new BIBAccounts();
<?php foreach ($AccountGroups as $group) : ?> <?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>"> <tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td> <td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
<td class="group-total text-right pr-2"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td> <td class="group-total text-right "><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
</tr> </tr>
<tr> <tr>
<td colspan="7" class="group-details p-0"> <td colspan="7" class="group-details p-0">
@@ -349,33 +325,85 @@ $BIBAccounts = new BIBAccounts();
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0; $totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?> ?>
<?php endforeach; ?> <?php endforeach; ?>
</table>
</td>
</tr> </tbody>
<?php
</table>
</div>
</div>
<?php
// pre($BIBAccounts->getAccountGroupsWithBalances(4)); // pre($BIBAccounts->getAccountGroupsWithBalances(4));
$TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance; $TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
$TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance; $TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
$PL = $TotalIncomes - $TotalExpenses; $PL = $TotalIncomes - $TotalExpenses;
$Side1Total += $PL; $Side1Total += $PL;
?> ?>
<div class="col-6 p-0 m-0 gy-0">
<table class="table">
<tr> <tr>
<td colspan="2" class="p-0"> <td><b> Profit/Loss</b></td>
<table class="table table-bordered">
<tr>
<td>Total Profit/Loss</td>
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td> <td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="p-0"> <td colspan="2" class="p-0">
<table class="table table-bordered"> <table class="table">
<tr> <tr>
<th>Total Amount</th> <th class="pl-1">Total Amount</th>
<th class="cr closing-cr">
<?php echo myCurrency($Side1Total); ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="col-6 p-0 m-0 gy-0">
<table class="table">
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<tr>
<td colspan="2" class="p-0">
<table class="table">
<tr>
<th class="pl-1">Total Amount</th>
<th class="dr closing-dr">
<?php echo myCurrency($totalClosingDr); ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- <div class="col-12 p-0">
<table class="table">
<?php
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
// $TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
// $TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
// $PL = $TotalIncomes - $TotalExpenses;
// $Side1Total += $PL;
?>
<tr>
<td>Total Profit/Loss</td>
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
</tr>
<tr>
<td colspan="2" class="p-0">
<table class="table">
<tr>
<th class="pl-1">Total Amount</th>
<th class="cr closing-cr"> <th class="cr closing-cr">
<?php echo myCurrency($Side1Total); ?> <?php echo myCurrency($Side1Total); ?>
</th> </th>
@@ -383,9 +411,9 @@ $BIBAccounts = new BIBAccounts();
</table> </table>
</td> </td>
<td colspan="2" class="p-0"> <td colspan="2" class="p-0">
<table class="table table-bordered"> <table class="table">
<tr> <tr>
<th>Total Amount</th> <th class="pl-1">Total Amount</th>
<th class="dr closing-dr"> <th class="dr closing-dr">
<?php echo myCurrency($totalClosingDr); ?> <?php echo myCurrency($totalClosingDr); ?>
</th> </th>
@@ -393,92 +421,96 @@ $BIBAccounts = new BIBAccounts();
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
<?php //pre($BIBAccounts->getAccountGroupsWithBalances($acgroup_id = null)); </div> -->
?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <?php
</div> function footerfunctions()
<?php {
function footerfunctions() ?>
{ <script>
?> $(document).ready(function() {
<script> // Prevent the dropdown from closing when clicking inside
$(document).ready(function() { $('.dropdown-menu').on('click', function(event) {
// Prevent the dropdown from closing when clicking inside event.stopPropagation();
$('.dropdown-menu').on('click', function(event) { });
event.stopPropagation(); });
}); </script>
}); <script>
</script> $(document).ready(function() {
<script> document.getElementById("toggleShowAll").click();
$(document).ready(function() { });
document.getElementById("toggleShowAll").click(); document.getElementById("toggleShowAll").addEventListener("click", function(e) {
}); e.preventDefault();
document.getElementById("toggleShowAll").addEventListener("click", function(e) { var nestedRows = document.getElementsByClassName("collapse");
e.preventDefault(); for (var i = 0; i < nestedRows.length; i++) {
var nestedRows = document.getElementsByClassName("collapse"); if (nestedRows[i].classList.contains("show")) {
for (var i = 0; i < nestedRows.length; i++) { nestedRows[i].classList.remove("show");
if (nestedRows[i].classList.contains("show")) { } else {
nestedRows[i].classList.remove("show"); nestedRows[i].classList.add("show");
} else { }
nestedRows[i].classList.add("show"); }
} });
} var exportButton = document.getElementById("exportButton");
}); exportButton.addEventListener("click", function() {
var exportButton = document.getElementById("exportButton"); exportTableToCSV("table.csv");
exportButton.addEventListener("click", function() { });
exportTableToCSV("table.csv");
});
function exportTableToCSV(filename) { function exportTableToCSV(filename) {
var csv = []; var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)"); var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
var row = []; var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)"); var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden // Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse"); var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show")); var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) { if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
} }
for (var j = 0; j < cols.length; j++) { </script>
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value <script>
row.push(cellValue); $("#fromDate").nepaliDatePicker({
} dateFormat: "%y-%m-%d",
csv.push(row.join(",")); closeOnDateSelect: true,
} minDate: $('#fromDate').data('start'),
// Create a CSV file maxDate: $('#fromDate').data('end'),
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n"); });
var encodedUri = encodeURI(csvContent); </script>
var link = document.createElement("a"); <script>
link.setAttribute("href", encodedUri); $("#toDate").nepaliDatePicker({
link.setAttribute("download", filename); dateFormat: "%y-%m-%d",
document.body.appendChild(link); closeOnDateSelect: true,
link.click(); minDate: $('#toDate').data('start'),
maxDate: $('#toDate').data('end'),
});
</script>
<?php
} }
</script>
<script>
$("#fromDate").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#fromDate').data('start'),
maxDate: $('#fromDate').data('end'),
});
</script>
<script>
$("#toDate").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#toDate').data('start'),
maxDate: $('#toDate').data('end'),
});
</script>
<?php
}

View File

@@ -0,0 +1,405 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
<div class="card-tools">
<form method="post" action="" id="FilterForm">
<!-- button with a dropdown -->
<div class="btn-group">
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
Filters
</button>
<div class="dropdown-menu" role="menu">
<div class="form-group p-2 pb-0">
<div class="col">
<div class="form-group">
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
<div class="form-group">
<label for="toDate"><?php myLang("Ending Period"); ?></label>
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="dropdown-divider"></div>
<!-- <div class="form-check">
<input class="form-check-input" type="checkbox">
<label class="form-check-label">Select
All</label>
</div> -->
<div class="form-check">
<!-- <input type="hidden" name="showOB" value="not"> -->
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
<!-- <input class="form-check-input" type="checkbox"> -->
<label class="form-check-label" for="showOB">Opening</label>
</div>
<div class="form-check">
<!-- <input class="form-check-input" type="checkbox"> -->
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
<label class="form-check-label" for="showClosing">Closing</label>
</div>
<div class="form-check">
<!-- <input class="form-check-input" type="checkbox" checked> -->
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
<label class="form-check-label" for="showPeriod">Period</label>
</div>
</div>
<div class="dropdown-divider"></div>
<div class="form-group p-2 pb-0 text-right">
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
</div>
</div>
</div>
<div class="btn-group">
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
Export
</button>
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle
Collapse</button> -->
<!-- <div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item">Export</a>
<a href="#" class="dropdown-item">Pdf</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">View calendar</a>
</div> -->
</div>
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
document.getElementById("showOB").checked = <?php echo "false"; ?>;
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
document.getElementById("FilterForm").submit();
}
</script>
</div>
<!-- /.card-tools -->
</div>
<!-- <div class="card-body">
<form method="post" action="" id="FilterForm">
<div class="row align-items-end">
<div class="col-2">
<div class="form-group">
<label for="fromDate"><?php //myLang("Starting Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php //echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate"><?php //myLang("Ending Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php //echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showOB"><?php// myLang("Opening"); ?></label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "" : "CHECKED"; ?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showClosing"><?php //myLang("Closing"); ?></label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "" : "CHECKED"; ?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showPeriod"><?php //myLang("Period"); ?></label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button type="submit" class="btn btn-success mr-2">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div> -->
</div>
</div><!-- /.container-fluid -->
</section>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button> -->
<div class="card card-primary card-outline">
<div class="card-body p-0">
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => false,
'showOB' => false,
'showClosing' => true,
'showPeriod' => false,
);
?>
<table class="table table-bordered">
<thead>
<tr>
<td class="group-name "><b>Liabilities</b></td>
<td class="group-total text-right pr-2 "><b>Amount</b></td>
<td class="group-name"><b>Assets</b></td>
<td class="group-total text-right pr-2"><b>Amount</b></td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
<?php $Side1Total = 0; ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td><b><?php echo $group->acgroup_name; ?></b></td>
<td width="20%"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$Side1Total += $group->closing_balance;
?>
<?php endforeach; ?>
</table>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$Side1Total += $group->closing_balance;
?>
<?php endforeach; ?>
</table>
</td>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
<td class="group-total text-right pr-2"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
$TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
$TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
$PL = $TotalIncomes - $TotalExpenses;
$Side1Total += $PL;
?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<td>Total Profit/Loss</td>
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
</td>
</tr>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Amount</th>
<th class="cr closing-cr">
<?php echo myCurrency($Side1Total); ?>
</th>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Amount</th>
<th class="dr closing-dr">
<?php echo myCurrency($totalClosingDr); ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
<?php //pre($BIBAccounts->getAccountGroupsWithBalances($acgroup_id = null));
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
// Prevent the dropdown from closing when clicking inside
$('.dropdown-menu').on('click', function(event) {
event.stopPropagation();
});
});
</script>
<script>
$(document).ready(function() {
document.getElementById("toggleShowAll").click();
});
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
e.preventDefault();
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<script>
$("#fromDate").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#fromDate').data('start'),
maxDate: $('#fromDate').data('end'),
});
</script>
<script>
$("#toDate").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#toDate').data('start'),
maxDate: $('#toDate').data('end'),
});
</script>
<?php
}

View File

@@ -90,6 +90,36 @@ $PL = $IncomesTotal - $ExpensesTotal;
box-shadow: inset 0 0 0 transparent; box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
} }
.table1 {
border: 0px !important;
padding: 0;
margin: 10 !important;
width: 100%;
vertical-align: middle;
}
.table-responsive {
overflow-x: auto;
}
.card-body {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 1px;
padding: 0;
}
table {
border: 1px solid #ddd;
border-collapse: collapse;
}
.card-body.p-0 .table tbody>tr>td:last-of-type, .card-body.p-0 .table tbody>tr>th:last-of-type, .card-body.p-0 .table tfoot>tr>td:last-of-type, .card-body.p-0 .table tfoot>tr>th:last-of-type, .card-body.p-0 .table thead>tr>td:last-of-type, .card-body.p-0 .table thead>tr>th:last-of-type {
padding-right:0!important;
}
.text-bold{
font-weight: 900;
}
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
@@ -159,7 +189,6 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> --> </div> -->
</div> </div>
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
<!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> --> <!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> -->
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> --> <!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
</form> </form>
@@ -236,15 +265,19 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> --> </div> -->
<div class="card-body table-responsive p-0"> <div class="card-body table-responsive p-0">
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?> <?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
<table class="table table-head-fixed table-bordered g-0">
<table class="table table-bordered p-0 ">
<thead> <thead>
<tr> <tr>
<th class="" width="30%"><?php myLang("Cash inflow"); ?></th> <th class="" width="30%"><?php myLang("Cash inflow"); ?></th>
<th class="text-right" width="10%"></th> <th class="text-right" width="10%"></th>
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th> <th class="text-right pr-1" width="10%"><?php myLang("Amount"); ?></th>
<th class="pl-2" width="30%"><?php echo myLang("Cash outflow"); ?></th> <th class="pl-2" width="30%"><?php echo myLang("Cash outflow"); ?></th>
<th class="text-right" width="10%"></th> <th class="text-right" width="10%"></th>
<th class="text-right pr-3" width="15%"><?php myLang("Amount"); ?></th> <th class="text-right pr-1" width="10%"><?php myLang("Amount"); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -263,25 +296,24 @@ $PL = $IncomesTotal - $ExpensesTotal;
</tr> --> </tr> -->
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?> <?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
<tr class="parent-row" class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $index; ?>"> <tr class="parent-row" class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $index; ?>">
<td class="pr-2" width="70%"><b><?php echo $Incomes['category']; ?></b></td> <td class="" width="60%"><b><?php echo $Incomes['category']; ?></b></td>
<td width="15%"></td> <td width="20%"></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td> <td class="text-right " width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr> </tr>
<?php else : ?> <?php else : ?>
<?php $total1 += $Incomes['amount']; ?> <?php $total1 += $Incomes['amount']; ?>
<tr class="collapse" data-target="#group_<?php echo $index; ?>"> <tr class="collapse" data-target="#group_<?php echo $index; ?>">
<td class="pr-2" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td> <td class="" width="60%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td> <td class="text-right " width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="15%"></td> <td width="20%"></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php $counter = $index ?> <?php $counter = $index ?>
<?php }; ?> <?php }; ?>
</table> </table>
</td> </td>
<td colspan=3 class="p-0"> <td colspan=3 class="p-0">
<table class="table g-0"> <table class="table p-0">
<?php $total = 0; <?php $total = 0;
foreach ($IncomesExpenses['Expenses'] as $Expenses) { foreach ($IncomesExpenses['Expenses'] as $Expenses) {
if ($Expenses['account'] == "GROUP TOTAL") : ?> if ($Expenses['account'] == "GROUP TOTAL") : ?>
@@ -292,17 +324,16 @@ $PL = $IncomesTotal - $ExpensesTotal;
</tr> --> </tr> -->
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?> <?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
<tr data-toggle="collapse" data-target="#group_<?php echo $counter; ?>"> <tr data-toggle="collapse" data-target="#group_<?php echo $counter; ?>">
<td class="" width="70%"><b><?php echo $Expenses['category']; ?></b></td> <td class="" width="60%"><b><?php echo $Expenses['category']; ?></b></td>
<td width="15%"></td> <td width="20%"></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td> <td class="text-right " width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr> </tr>
<?php else : ?> <?php else : ?>
<?php $total += $Expenses['amount']; ?> <?php $total += $Expenses['amount']; ?>
<tr class="collapse" data-target="#group_<?php echo $counter; ?>"> <tr class="collapse" data-target="#group_<?php echo $counter; ?>">
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td> <td class="" width="60%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td> <td class="text-right" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td> <td width="20%"></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php }; ?> <?php }; ?>
@@ -311,20 +342,20 @@ $PL = $IncomesTotal - $ExpensesTotal;
</tr> </tr>
</tbody> </tbody>
<tr> <tr>
<th>Total</th> <th class="p-1">Total</th>
<td></td> <td></td>
<td class="text-right pr-2"><?php echo myCurrency($total1); ?></td> <td class="text-right text-bold"><?php echo myCurrency($total1); ?></td>
<th>Total</th> <th class="p-1">Total</th>
<td></td> <td></td>
<td class="text-right"><?php echo myCurrency($total); ?></td> <td class="text-right text-bold"><?php echo myCurrency($total); ?></td>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
<td></td> <td></td>
<td class="text-right"></td> <td class="text-right"></td>
<th>Net Inflow</th> <th class="pl-1">Net Inflow</th>
<td></td> <td></td>
<td class="text-right pr-2"><?php echo myCurrency($total1 - $total); ?></td> <td class="text-right text-bold"><?php echo myCurrency($total1 - $total); ?></td>
</tr> </tr>
<?php $Bank = $BIBAccounts->getAccountCategoriesWithBalances(null, 2); ?> <?php $Bank = $BIBAccounts->getAccountCategoriesWithBalances(null, 2); ?>
<?php foreach ($Bank->accounts as $account) : ?> <?php foreach ($Bank->accounts as $account) : ?>
@@ -332,9 +363,9 @@ $PL = $IncomesTotal - $ExpensesTotal;
<th></th> <th></th>
<td></td> <td></td>
<td class="text-right"></td> <td class="text-right"></td>
<th><?php echo $account->account_name; ?></th> <th class="pl-1"><?php echo $account->account_name; ?></th>
<td></td> <td></td>
<td class="text-right"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td> <td class="text-right text-bold"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
<?php $Cash = $BIBAccounts->getAccountCategoriesWithBalances(null, 3); ?> <?php $Cash = $BIBAccounts->getAccountCategoriesWithBalances(null, 3); ?>
@@ -343,9 +374,9 @@ $PL = $IncomesTotal - $ExpensesTotal;
<th></th> <th></th>
<td></td> <td></td>
<td class="text-right"></td> <td class="text-right"></td>
<th><?php echo $account->account_name; ?></th> <th class="pl-1"><?php echo $account->account_name; ?></th>
<td></td> <td></td>
<td class="text-right"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td> <td class="text-right text-bold"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>

View File

@@ -1,70 +1,58 @@
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content"> <div class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="card card-primary card-outline"> <div class="card card-primary card-outline">
<div class="card-header bg-primary disabled color-palette"> <div class="card-header bg-primary disabled color-palette">
<h3 class="card-title m-0"><?php echo $pageTitle; ?></h3> <h3 class="card-title m-0"><?php echo $pageTitle; ?></h3>
</div> </div>
<div class="card-body"> <div class="card-body">
<form method="GET" action="#"> <form method="GET" action="#">
<div class="row"> <div class="row">
<div class="col"><?php createNepaliDateInput("from_date", "", "from_date", isset($fromDate_Nepali) ? $fromDate_Nepali : firstDayOfNepaliMonth()); ?></div> <div class="col"><?php createNepaliDateInput("from_date", "", "from_date", isset($fromDate_Nepali) ? $fromDate_Nepali : firstDayOfNepaliMonth()); ?></div>
<div class="col"><?php createNepaliDateInput("to_date", "", "to_date", isset($toDate_Nepali) ? $toDate_Nepali : ''); ?></div> <div class="col"><?php createNepaliDateInput("to_date", "", "to_date", isset($toDate_Nepali) ? $toDate_Nepali : ''); ?></div>
<div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : 1, $CSSclass = ""); ?> </div> <div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : 1, $CSSclass = ""); ?> </div>
<div class="col"><?php createButton("show_ledger", "Show Ledger", "show_ledger","Submit", "btn btn-primary"); ?></div> <div class="col"><?php createButton("show_ledger", "Show Ledger", "show_ledger", "Submit", "btn btn-primary"); ?></div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<div id="dataTable_Commands"> <div id="dataTable_Commands">
</div>
</div> <?php
<?php if (!isset($account_id)) {
if(!isset($account_id)){ $account_id = 1;
$account_id = 1; }
} ?>
?> <?php if (isset($account_id) && $account_id != "") {
$fromDate = NepaliToEnglishDate(isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth());
<?php if (isset($account_id) && $account_id != "") { $toDate = isset($_GET['to_date']) ? $_GET['to_date'] : Today();
$fromDate = NepaliToEnglishDate(isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth()); $this->myaccounts->showLedger($account_id, $fromDate, $toDate, $fiscalStart, $fiscalEnd);
$toDate = isset($_GET['to_date']) ? $_GET['to_date'] : Today(); } ?>
$this->myaccounts->showLedger($account_id, $fromDate, $toDate, $fiscalStart, $fiscalEnd); <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 fade" id="ledgerdetails_box" tabindex="-1" role="dialog" aria-labelledby="ledgerdetails_box" aria-hidden="true"> <div class="modal-content">
<div class="modal-dialog modal-xl" role="document"> <div class="modal-header">
<div class="modal-content"> <h5 class="modal-title" id="exampleModalLabel">Ledger Details</h5>
<div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<h5 class="modal-title" id="exampleModalLabel">Ledger Details</h5> <span aria-hidden="true">&times;</span>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> </button>
<span aria-hidden="true">&times;</span> </div>
</button> <div class="modal-body" id="details_container">
</div> Ledger Details Goes Here
<div class="modal-body" id="details_container"> </div>
Ledger Details Goes Here <div class="modal-footer">
</div> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<div class="modal-footer"> <button type="button" class="btn btn-success" data-dismiss="modal">Print</button>
<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> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,430 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Include jQuery UI -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency {
font-weight: normal !important;
}
.underline {
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.75rem;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="card card-primary card-outline ">
<div class="card-header">
<h2 class="card-title mt-1"><?php echo $pageTitle; ?> <?php //myLang("Report");
?></h2>
<div class="card-tools">
<form method="post" action="" id="FilterForm">
<!-- button with a dropdown -->
<div class="btn-group">
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
Filters
</button>
<div class="dropdown-menu" role="menu">
<div class="form-group p-2 pb-0">
<div class="col">
<div class="form-group">
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
<div class="form-group">
<label for="toDate"><?php myLang("Ending Period"); ?></label>
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="dropdown-divider"></div>
<!-- <div class="form-check">
<input class="form-check-input" type="checkbox">
<label class="form-check-label">Select
All</label>
</div> -->
<div class="form-check">
<!-- <input type="hidden" name="showOB" value="not"> -->
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
<!-- <input class="form-check-input" type="checkbox"> -->
<label class="form-check-label" for="showOB">Opening</label>
</div>
<div class="form-check">
<!-- <input class="form-check-input" type="checkbox"> -->
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
<label class="form-check-label" for="showClosing">Closing</label>
</div>
<div class="form-check">
<!-- <input class="form-check-input" type="checkbox" checked> -->
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
<label class="form-check-label" for="showPeriod">Period</label>
</div>
</div>
<div class="dropdown-divider"></div>
<div class="form-group p-2 pb-0 text-right">
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
</div>
</div>
</div>
<div class="btn-group">
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
Export
</button>
<!-- <div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item">Export</a>
<a href="#" class="dropdown-item">Pdf</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">View calendar</a>
</div> -->
</div>
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
document.getElementById("showOB").checked = <?php echo "false"; ?>;
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
</div>
</div>
</div>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
<div class="card card-primary card-outline ">
<div class="card-body p-0">
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => false,
'showOB' => false,
'showClosing' => true,
'showPeriod' => false,
);
// die;
?>
<table class="table table-bordered">
<thead>
<tr>
<th class="group-name" width="85%">Particulars</th>
<th class="group-total text-center" width="10%">Amount</th>
<th class="group-name" width="85%">Particulars</th>
<th class="group-total text-center" width="15%">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(3); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><b><?php //echo $group->acgroup_name;
?></b></td>
<td class="group-total text-right"><?php //echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0);
?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0" width="85%">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$incomes_totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$incomes_totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$incomes_totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$incomes_totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name" width="85%"> <?php //echo $group->acgroup_name;
?></td>
<td class="group-total" width="15%"><?php //echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0);
?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</i>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
<?php if ($incomes_totalClosingCr > $totalClosingDr) : ?>
<tr>
<td colspan="2" width="15%">
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Profit</th>
<th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th>
</tr>
</table>
</td>
</tr>
<?php else : ?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Loss</th>
<th class="cr closing-cr"><?php echo myCurrency(abs($PL)); ?></th>
</tr>
</table>
</td>
<td colspan="2">
</td>
</tr>
<?php endif; ?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Incomes</th>
<th class="cr closing-cr">
<?php if ($PL > 0) : ?>
<?php echo myCurrency($incomes_totalClosingCr); ?>
<?php else : ?>
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
<?php endif; ?>
</th>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Expenses</th>
<th class="dr closing-dr">
<?php if ($PL > 0) : ?>
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
<?php else : ?>
<?php echo myCurrency($totalClosingDr); ?>
<?php endif; ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
// Prevent the dropdown from closing when clicking inside
$('.dropdown-menu').on('click', function(event) {
event.stopPropagation();
});
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Trigger click event on page load
document.getElementById("toggleShowAll").click();
});
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
e.preventDefault();
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<script>
$("#fromDate").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#fromDate').data('start'),
maxDate: $('#fromDate').data('end'),
});
</script>
<script>
$("#toDate").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#toDate').data('start'),
maxDate: $('#toDate').data('end'),
});
</script>
<?php
}
?>

View File

@@ -88,6 +88,33 @@ $BIBAccounts = new BIBAccounts();
box-shadow: inset 0 0 0 transparent; box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
} }
.table1 {
border: 0px !important;
padding: 0;
margin: 10 !important;
width: 100%;
vertical-align: middle;
}
.table-responsive {
overflow-x: auto;
}
.card-body {
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 1px;
padding: 0;
}
table {
border: 1px solid #ddd;
border-collapse: collapse;
}
.text-bold{
font-weight: 900;
}
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content"> <div class="content">
@@ -178,33 +205,31 @@ $BIBAccounts = new BIBAccounts();
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> --> <!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
<div class="card card-primary card-outline "> <div class="card card-primary card-outline">
<div class="card-body p-0"> <div class="card-body pl-2 pr-2">
<?php <div class="row">
// echo $_POST['showClosing']; <?php
$ReportOptions = array( // echo $_POST['showClosing'];
'showZeroBalances' => false, $ReportOptions = array(
'showOB' => false, 'showZeroBalances' => false,
'showClosing' => true, 'showOB' => false,
'showPeriod' => false, 'showClosing' => true,
); 'showPeriod' => false,
// die; );
?> // die;
<table class="table table-bordered"> ?>
<thead> <div class="col-6 p-0">
<tr> <div class="table-responsive">
<th class="group-name" width="85%">Particulars</th> <table class="table ">
<th class="group-total text-center" width="10%">Amount</th> <thead>
<th class="group-name" width="85%">Particulars</th> <tr>
<th class="group-total text-center" width="15%">Amount</th> <th class="group-name pl-1">Particulars</th>
</tr> <th class="group-total text-center col-1">Amount</th>
</thead> </tr>
<tbody> </thead>
<tr> <tbody>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(3); ?> <?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(3); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable"> <?php
<?php
// Initialize variables for column totals // Initialize variables for column totals
$incomes_totalOpeningDr = 0; $incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0; $incomes_totalOpeningCr = 0;
@@ -214,21 +239,16 @@ $BIBAccounts = new BIBAccounts();
$incomes_totalClosingCr = 0; $incomes_totalClosingCr = 0;
?> ?>
<?php foreach ($AccountGroups as $group) : ?> <?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>"> <tr>
<td class="group-name"><b><?php //echo $group->acgroup_name; <td colspan="2" class="p-0">
?></b></td> <div id="group_<?php echo $group->acgroup_id; ?>" class="">
<td class="group-total text-right"><?php //echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0);
?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0" width="85%">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?> <?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div> </div>
</td> </td>
</tr>
<?php </tr>
<?php
// Update column totals // Update column totals
$incomes_totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0; $incomes_totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$incomes_totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0; $incomes_totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
@@ -236,14 +256,42 @@ $BIBAccounts = new BIBAccounts();
$incomes_totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0; $incomes_totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0; $incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0; $incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?> ?>
<?php endforeach; ?>
</table> <?php endforeach; ?>
</td>
<td colspan="2" class="p-0">
</tbody>
<tfoot>
<?php $PL = $incomes_totalClosingCr - $incomes_totalClosingDr; ?>
<tr>
<th class="p-1">Total Incomes</th>
<th class="cr closing-cr text-bold">
<?php if ($PL > 0) : ?>
<?php echo myCurrency($incomes_totalClosingCr); ?>
<?php else : ?>
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
<?php endif; ?>
</th>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="col-6 p-0">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th class="group-name pl-1">Particulars</th>
<th class="group-total text-center col-1">Amount</th>
</tr>
</thead>
<tbody>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?> <?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable"> <?php
<?php
// Initialize variables for column totals // Initialize variables for column totals
$totalOpeningDr = 0; $totalOpeningDr = 0;
$totalOpeningCr = 0; $totalOpeningCr = 0;
@@ -253,22 +301,16 @@ $BIBAccounts = new BIBAccounts();
$totalClosingCr = 0; $totalClosingCr = 0;
?> ?>
<?php foreach ($AccountGroups as $group) : ?> <?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>"> <tr>
<td class="group-name" width="85%"> <?php //echo $group->acgroup_name; <td colspan="2" class="p-0">
?></td> <div id="group_<?php echo $group->acgroup_id; ?>" class="">
<td class="group-total" width="15%"><?php //echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0);
?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?> <i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?> <?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</i> </i>
</div> </div>
</td> </td>
</tr> </tr>
<?php <?php
// Update column totals // Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0; $totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0; $totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
@@ -278,70 +320,37 @@ $BIBAccounts = new BIBAccounts();
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0; $totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?> ?>
<?php endforeach; ?> <?php endforeach; ?>
</table> <?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
</td>
</tr>
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
<?php if ($incomes_totalClosingCr > $totalClosingDr) : ?> <?php if ($incomes_totalClosingCr > $totalClosingDr) : ?>
<tr> <tr>
<td colspan="2" width="15%"> <!-- <th></th>
</td> <th></th> -->
<td colspan="2" class="p-0"> <th class="pl-1">Total Profit</th>
<table class="table table-bordered"> <th class="cr closing-cr text-right text-bold"><?php echo myCurrency($PL); ?></th>
<tr>
<th>Total Profit</th>
<th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th>
</tr>
</table>
</td>
</tr>
<?php else : ?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Loss</th>
<th class="cr closing-cr"><?php echo myCurrency(abs($PL)); ?></th>
</tr>
</table>
</td>
<td colspan="2">
</td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<tr> </tbody>
<td colspan="2" class="p-0"> <tfoot>
<table class="table table-bordered"> <th class="pl-1">Total Expenses</th>
<tr> <th class="dr closing-dr text-bold">
<th>Total Incomes</th>
<th class="cr closing-cr">
<?php if ($PL > 0) : ?> <?php if ($PL > 0) : ?>
<?php echo myCurrency($incomes_totalClosingCr); ?> <?php echo myCurrency($totalClosingDr + abs($PL)); ?>
<?php else : ?>
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
<?php endif; ?>
</th>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Expenses</th>
<th class="dr closing-dr">
<?php if ($PL > 0) : ?>
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
<?php else : ?> <?php else : ?>
<?php echo myCurrency($totalClosingDr); ?> <?php echo myCurrency($totalClosingDr); ?>
<?php endif; ?> <?php endif; ?>
</th> </th>
</tr> </tfoot>
</table> </table>
</td> </div>
</tr> </div>
</table> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -8,7 +8,6 @@ $ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3); $IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4); $ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal; $PL = $IncomesTotal - $ExpensesTotal;
?> ?>
<style> <style>
table, table,
@@ -97,24 +96,15 @@ $PL = $IncomesTotal - $ExpensesTotal;
; ;
} }
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="card card-primary card-outline "> <div class="card card-primary card-outline ">
<div class="card-header"> <div class="card-header">
<h3 class="card-title mt-1">Receipts And Payments <?php //echo $pageTitle; <h3 class="card-title mt-1">Receipts And Payments <?php //echo $pageTitle;
?> </h3> ?> </h3>
<div class="card-tools"> <div class="card-tools">
<form method="post" action="" id="FilterForm"> <form method="post" action="" id="FilterForm">
<!-- button with a dropdown --> <!-- button with a dropdown -->
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52"> <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
@@ -166,8 +156,6 @@ $PL = $IncomesTotal - $ExpensesTotal;
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52"> <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
Export Export
</button> </button>
<!-- <div class="dropdown-menu" role="menu"> <!-- <div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item">Export</a> <a href="#" class="dropdown-item">Export</a>
<a href="#" class="dropdown-item">Pdf</a> <a href="#" class="dropdown-item">Pdf</a>
@@ -176,9 +164,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> --> </div> -->
</div> </div>
<!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> --> <!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> -->
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
</form> </form>
<script> <script>
function resetForm() { function resetForm() {
@@ -192,39 +178,36 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> </div>
<!-- /.card-tools --> <!-- /.card-tools -->
</div> </div>
<!-- <div class="card-body"> <!-- <div class="card-body">
<form method="post" action="" id="FilterForm"> <form method="post" action="" id="FilterForm">
<div class="row align-items-end"> <div class="row align-items-end">
<div class="col-2"> <div class="col-2">
<div class="form-group"> <div class="form-group">
<label for="fromDate"><?php myLang("Starting Period"); ?></label> <label for="fromDate"><?php //myLang("Starting Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period"> <input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php //echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div> </div>
</div> </div>
<div class="col-2"> <div class="col-2">
<div class="form-group"> <div class="form-group">
<label for="toDate"><?php myLang("Ending Period"); ?></label> <label for="toDate"><?php //myLang("Ending Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period"> <input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php //echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div> </div>
</div> </div>
<div class="col-1 text-center"> <div class="col-1 text-center">
<div class="form-group"> <div class="form-group">
<label for="showOB"><?php myLang("Opening"); ?></label> <label for="showOB"><?php //myLang("Opening"); ?></label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : "CHECKED"; ?>> <input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : "CHECKED"; ?>>
</div> </div>
</div> </div>
<div class="col-1 text-center"> <div class="col-1 text-center">
<div class="form-group"> <div class="form-group">
<label for="showClosing"><?php myLang("Closing"); ?></label> <label for="showClosing"><?php //myLang("Closing"); ?></label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : "CHECKED"; ?>> <input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : "CHECKED"; ?>>
</div> </div>
</div> </div>
<div class="col-1 text-center"> <div class="col-1 text-center">
<div class="form-group"> <div class="form-group">
<label for="showPeriod"><?php myLang("Period"); ?></label> <label for="showPeriod"><?php //myLang("Period"); ?></label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>> <input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
</div> </div>
</div> </div>
@@ -237,9 +220,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> </div>
</div> </div>
</div> </div>
</form> </form>
<script> <script>
function resetForm() { function resetForm() {
document.getElementById("fromDate").value = "2078-4-1"; document.getElementById("fromDate").value = "2078-4-1";
@@ -249,23 +230,20 @@ $PL = $IncomesTotal - $ExpensesTotal;
document.getElementById("FilterForm").submit(); document.getElementById("FilterForm").submit();
} }
</script> </script>
</div> --> </div> -->
</div> </div>
<div class="card"> <div class="card">
<div class="card card-primary card-outline"> <div class="card card-primary card-outline">
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?> <?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
<table class="table table-head-fixed table-bordered g-0" id="TrialBalanceTable"> <table class="table table-head-fixed table-bordered g-0" id="TrialBalanceTable">
<thead> <thead>
<tr> <tr>
<th class="" width="35%"><?php myLang("Receipts"); ?></th> <th class="" width="30%"><?php myLang("Receipts"); ?></th>
<th class="text-right" width="15%"></th> <th class="text-right" width="10%"></th>
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th> <th class="text-right pr-2" width="10%"><?php myLang("Amount"); ?></th>
<th class="" width="35%"><?php echo myLang("Payments"); ?></th> <th class="" width="30%"><?php echo myLang("Payments"); ?></th>
<th class="text-right" width="15%"></th> <th class="text-right" width="10%"></th>
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th> <th class="text-right pr-2" width="10%"><?php myLang("Amount"); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -281,32 +259,26 @@ $PL = $IncomesTotal - $ExpensesTotal;
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td> <td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
<td width="15%"></td> <td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td> <td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
</tr--> </tr-->
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?> <?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
<?php $index++; ?> <?php $index++; ?>
<tr class="parent-row" class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $index; ?>"> <tr class="parent-row" class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $index; ?>">
<td class="" width="70%"><b><?php echo $Incomes['category']; ?></b></td> <td class="" width="60%"><b><?php echo $Incomes['category']; ?></b></td>
<td width="15%"></td> <td width="20%"></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td> <td class="text-right pr-2" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr> </tr>
<?php else : ?> <?php else : ?>
<?php $total1 += $Incomes['amount']; ?> <?php $total1 += $Incomes['amount']; ?>
<tr class="collapse" data-target="#group_<?php echo $index; ?>"> <tr class="collapse" data-target="#group_<?php echo $index; ?>">
<td class="pr-2" width="70%"> <td class="pr-2" width="60%">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?>
</td> </td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td> <td class="text-right pr-2" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="20%"></td>
<td width="15%"></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php $counter = $index ?> <?php $counter = $index ?>
<?php }; ?> <?php }; ?>
</table> </table>
</td> </td>
<td colspan=3 class="p-0"> <td colspan=3 class="p-0">
@@ -318,36 +290,26 @@ $PL = $IncomesTotal - $ExpensesTotal;
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td> <td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
<td width="15%"></td> <td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td> <td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
</tr--> </tr-->
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?> <?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
<?php $counter++; ?> <?php $counter++; ?>
<tr data-toggle="collapse" data-target="#group_<?php echo $counter; ?>"> <tr data-toggle="collapse" data-target="#group_<?php echo $counter; ?>">
<td class="pr-2" width="70%"><b><?php echo $Expenses['category']; ?></b></td> <td class="pr-2" width="60%"><b><?php echo $Expenses['category']; ?></b></td>
<td width="15%"></td> <td width="20%"></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td> <td class="text-right pr-2" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr> </tr>
<?php else : ?> <?php else : ?>
<?php $total += $Expenses['amount']; ?> <?php $total += $Expenses['amount']; ?>
<tr class="collapse" data-target="#group_<?php echo $counter; ?>"> <tr class="collapse" data-target="#group_<?php echo $counter; ?>">
<td class="" width="70%"> <td class="" width="60%">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php echo $Expenses['account']; ?> <?php echo $Expenses['account']; ?>
</td> </td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td> <td class="text-right pr-2" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td> <td width="20%"></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php }; ?> <?php }; ?>
</table> </table>
</td> </td>
</tr> </tr>
@@ -370,9 +332,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
<th></th> <th></th>
<td class="pr-2"><?php echo myCurrency($balance_fi); ?></td> <td class="pr-2"><?php echo myCurrency($balance_fi); ?></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<tr> <tr>
<th class="pl-2">Total</th> <th class="pl-2">Total</th>
<th></th> <th></th>
@@ -382,19 +342,11 @@ $PL = $IncomesTotal - $ExpensesTotal;
<td class="pr-2"><?php echo myCurrency($total); ?></td> <td class="pr-2"><?php echo myCurrency($total); ?></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div><!-- /.container-fluid --> </div><!-- /.container-fluid -->
</section> </section>
<?php function footerFunctions() <?php function footerFunctions()
{ ?> { ?>
<script> <script>

View File

@@ -21,6 +21,7 @@ $BIBAccounts = new BIBAccounts();
.group-total { .group-total {
width: 10%; width: 10%;
} }
.table-gray { .table-gray {
@@ -31,8 +32,10 @@ $BIBAccounts = new BIBAccounts();
.table th { .table th {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
} }
.table t
.bg-darker { .bg-darker {
background-color: #ddd; background-color: #ddd;
} }
@@ -71,6 +74,9 @@ $BIBAccounts = new BIBAccounts();
.underline { .underline {
text-decoration: underline; text-decoration: underline;
} }
.text-right{
padding-right: 5px;
}
.form-control { .form-control {
display: block; display: block;
@@ -88,6 +94,9 @@ $BIBAccounts = new BIBAccounts();
box-shadow: inset 0 0 0 transparent; box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
} }
.bg-gray tr th {
vertical-align: middle;
}
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content"> <div class="content">
@@ -202,16 +211,16 @@ $BIBAccounts = new BIBAccounts();
<table class="table table-bordered vertical-borders" id="TrialBalanceTable"> <table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<thead class="bg-gray"> <thead class="bg-gray">
<tr> <tr>
<th rowspan="2">Particulars</th> <th rowspan="2 class="">Particulars</th>
<?php if ($ReportOptions['showOB']) : ?> <?php if ($ReportOptions['showOB']) : ?>
<th colspan="2" class="text-center">Opening</th> <th colspan=" 2" class="text-center">Opening</th>
<?php endif; ?> <?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?> <?php if ($ReportOptions['showPeriod']) : ?>
<th colspan="2" class="text-center">Current Period</th> <th colspan="2" class="text-center">Current Period</th>
<?php endif; ?> <?php endif; ?>
<?php if ($ReportOptions['showClosing']) : ?> <?php if ($ReportOptions['showClosing']) : ?>
<th colspan="2" class="text-center">Closing</th> <th colspan="2" class="text-center">Closing</th>
<?php endif; ?> <?php endif; ?>
</tr> </tr>
<tr> <tr>
@@ -245,7 +254,7 @@ $BIBAccounts = new BIBAccounts();
<?php if ($ReportOptions['showOB']) : ?> <?php if ($ReportOptions['showOB']) : ?>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->opening_balance : 0); <td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->opening_balance : 0);
?></td> ?></td>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "CR") ? $group->opening_balance : 0); <td class="group-total "><?php // echo myCurrency(($group->posting_side == "CR") ? $group->opening_balance : 0);
?></td> ?></td>
<?php endif; ?> <?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?> <?php if ($ReportOptions['showPeriod']) : ?>

View File

@@ -95,12 +95,12 @@
<table class="table table-bordered table-striped longdataTable"> <table class="table table-bordered table-striped longdataTable">
<thead> <thead>
<tr> <tr>
<th>Fiscal Year </th> <th class="col-2">Fiscal Year </th>
<th> Code</th> <th class="col-4"> Code</th>
<th>From</th> <th>From</th>
<th>To</th> <th>To</th>
<!-- <th>Created By</th> --> <!-- <th>Created By</th> -->
<th class="col-2 text-center">Action</th> <th class="col-1 text-center">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -100,7 +100,7 @@
<?php foreach ($TableRow as $cols) : $id = $cols; <?php foreach ($TableRow as $cols) : $id = $cols;
break; break;
endforeach; ?><tr> endforeach; ?><tr>
<td><?php echo $a; ?></td> <td class="text-center"><?php echo $a; ?></td>
<td><?php echo $TableRow->title; ?></td> <td><?php echo $TableRow->title; ?></td>
<!-- <td><?php //echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td> --> <!-- <td><?php //echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td> -->
<td><?php echo $TableRow->description; ?></td> <td><?php echo $TableRow->description; ?></td>

View File

@@ -12,7 +12,7 @@
<table class="table table-bordered table-striped dataTable"> <table class="table table-bordered table-striped dataTable">
<thead> <thead>
<tr> <tr>
<th><?php myLang('S.N'); ?></th> <th class="text-center"><?php myLang('S.N'); ?></th>
<th><?php myLang('Date'); ?></th> <th><?php myLang('Date'); ?></th>
<th><?php myLang('Purchase Transaction'); ?></th> <th><?php myLang('Purchase Transaction'); ?></th>
<th class="text-center"><?php myLang('Amount'); ?></th> <th class="text-center"><?php myLang('Amount'); ?></th>

View File

@@ -184,7 +184,7 @@
<?php $a = 0; <?php $a = 0;
foreach ($StockItems as $Stock) : $a++; ?> foreach ($StockItems as $Stock) : $a++; ?>
<tr> <tr>
<td><?php echo $a; ?></td> <td class="text-center"><?php echo $a; ?></td>
<td><?php echo $Stock->Item->title; ?></td> <td><?php echo $Stock->Item->title; ?></td>
<td><?php echo $Stock->Summary->Unit->title; ?></td> <td><?php echo $Stock->Summary->Unit->title; ?></td>
<td class="text-right"><?php echo $oqty = $Stock->Summary->Opening->qty; ?></td> <td class="text-right"><?php echo $oqty = $Stock->Summary->Opening->qty; ?></td>

View File

@@ -12,7 +12,7 @@
<table class="table table-bordered table-striped dataTable"> <table class="table table-bordered table-striped dataTable">
<thead> <thead>
<tr> <tr>
<th class="table-col col-1"><?php myLang('Sales Voucher #'); ?></th> <th class="table-col col-1 text-center"><?php myLang('Sales Voucher #'); ?></th>
<th width="10%"><?php myLang('Date'); ?></th> <th width="10%"><?php myLang('Date'); ?></th>
<th><?php myLang('Transaction'); ?></th> <th><?php myLang('Transaction'); ?></th>
<th class="table-col col-1 text-center"><?php myLang('Amount'); ?></th> <th class="table-col col-1 text-center"><?php myLang('Amount'); ?></th>
@@ -22,7 +22,7 @@
<tbody> <tbody>
<?php foreach ($SalesRecords as $TableRow) : ?> <?php foreach ($SalesRecords as $TableRow) : ?>
<tr> <tr>
<td><?php echo $TableRow->sales_id; ?></td> <td class="text-center"><?php echo $TableRow->sales_id; ?></td>
<td><?php echo $TableRow->sales_date; ?></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;"> <div class="row ml-2 mr-2" style="border-bottom: 1px solid;">

View File

@@ -202,7 +202,7 @@
$CTotal = 0; $CTotal = 0;
foreach ($StockRecords as $index => $TableRow) : ?> foreach ($StockRecords as $index => $TableRow) : ?>
<tr> <tr>
<td><?php echo $index + 1; ?></td> <td class="text-center"><?php echo $index + 1; ?></td>
<td><?php echo ($TableRow->Item) ? $TableRow->Item->title : "N/A"; ?></td> <td><?php echo ($TableRow->Item) ? $TableRow->Item->title : "N/A"; ?></td>
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->Item->units_id); ?></td> <td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->Item->units_id); ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Opening->qty; ?></td> <td class="text-right"><?php echo $TableRow->Summary->Opening->qty; ?></td>

View File

@@ -123,9 +123,9 @@ margin-bottom: .5rem;
.select2-container--default .select2-selection--single .select2-selection__arrow b { .select2-container--default .select2-selection--single .select2-selection__arrow b {
margin-top: 0 !important; margin-top: 0 !important;
} }
.card-body.p-0 .table tbody>tr>td:last-of-type, .card-body.p-0 .table tbody>tr>th:last-of-type, .card-body.p-0 .table tfoot>tr>td:last-of-type, .card-body.p-0 .table tfoot>tr>th:last-of-type, .card-body.p-0 .table thead>tr>td:last-of-type, .card-body.p-0 .table thead>tr>th:last-of-type { /* .card-body.p-0 .table tbody>tr>td:last-of-type, .card-body.p-0 .table tbody>tr>th:last-of-type, .card-body.p-0 .table tfoot>tr>td:last-of-type, .card-body.p-0 .table tfoot>tr>th:last-of-type, .card-body.p-0 .table thead>tr>td:last-of-type, .card-body.p-0 .table thead>tr>th:last-of-type {
padding-right: 0!important; padding-right: 0px!important;
} } */
.form-group textarea.form-control { .form-group textarea.form-control {
height: 50px !important; height: 50px !important;
} }
@@ -138,4 +138,7 @@ margin-bottom: .5rem;
table.dataTable>thead>tr>th:not(.sorting_disabled), table.dataTable>thead>tr>td:not(.sorting_disabled) { table.dataTable>thead>tr>th:not(.sorting_disabled), table.dataTable>thead>tr>td:not(.sorting_disabled) {
vertical-align: middle; vertical-align: middle;
}
.text-right{
padding-right: 10px;
} }

Binary file not shown.