160 lines
7.8 KiB
PHP
160 lines
7.8 KiB
PHP
|
<?php
|
||
|
$this->load->library("BIBAccounts");
|
||
|
$BIBAccounts = new BIBAccounts();
|
||
|
?>
|
||
|
<?php
|
||
|
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
|
||
|
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
|
||
|
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
||
|
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
||
|
$PL = $IncomesTotal - $ExpensesTotal;
|
||
|
|
||
|
?>
|
||
|
<div class="content-wrapper">
|
||
|
|
||
|
<section class="content">
|
||
|
<div class="container-fluid">
|
||
|
<div class="card card-primary ">
|
||
|
<div class="card-header">
|
||
|
<h4 class="card-title">Report Options</h4>
|
||
|
</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">Starting
|
||
|
Period</label>
|
||
|
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="2078-4-1" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-2">
|
||
|
<div class="form-group">
|
||
|
<label for="toDate">Ending
|
||
|
Period</label>
|
||
|
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="2079-3-32" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class=" text-center">
|
||
|
<div class="form-group">
|
||
|
<label for="showOB">Opening</label>
|
||
|
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class=" text-center">
|
||
|
<div class="form-group">
|
||
|
<label for="showClosing">Closing</label>
|
||
|
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class=" text-center">
|
||
|
<div class="form-group">
|
||
|
<label for="showPeriod">Period</label>
|
||
|
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="col">
|
||
|
<div class="form-group d-flex justify-content-end">
|
||
|
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle
|
||
|
Collapse</button>
|
||
|
<button type="submit" class="btn btn-primary mr-2">Filter</button>
|
||
|
<button class="btn btn-success expand-all mr-2" id="exportButton">Export</button>
|
||
|
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<small>Currently Filter Option by period are
|
||
|
not available</small>
|
||
|
</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 class="card">
|
||
|
<div class="card-header">
|
||
|
<h4 class="card-title">Incomes and Expenses</h4>
|
||
|
</div>
|
||
|
<div class="card-body table-responsive p-0">
|
||
|
<?php $IncomesExpenses = $BIBAccounts->getIncomeAndExpenditure();
|
||
|
|
||
|
|
||
|
|
||
|
?>
|
||
|
<table class="table table-head-fixed table-bordered g-0">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="" width="40%">Incomes</th>
|
||
|
<th class="text-right" width="10%">Amount</th>
|
||
|
<th class="" width="40%">Expenses</th>
|
||
|
<th class="text-right" width="10%">Amount</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td colspan=2 class="p-0">
|
||
|
<table class="table g-0">
|
||
|
<?php $total = 0;
|
||
|
foreach ($IncomesExpenses['Incomes'] as $Incomes) {
|
||
|
$total += $Incomes['amount']; ?>
|
||
|
<tr>
|
||
|
<td class="" width="80%"><?php echo $Incomes['account']; ?></td>
|
||
|
<td class="text-right" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<?php }; ?>
|
||
|
<tr>
|
||
|
<th>Total</th>
|
||
|
<td class="text-right"><?php echo myCurrency($total); ?></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td colspan=2 class="p-0">
|
||
|
<table class="table g-0">
|
||
|
<?php $total = 0;
|
||
|
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
|
||
|
$total += $Expenses['amount']; ?>
|
||
|
<tr>
|
||
|
<td class="" width="80%"><?php echo $Expenses['account']; ?></td>
|
||
|
<td class="text-right" width="20%"><?php echo $Expenses['amount']; ?></td>
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<?php }; ?>
|
||
|
<tr>
|
||
|
<th>Total</th>
|
||
|
<td class="text-right"><?php echo myCurrency($total); ?></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
|
||
|
|
||
|
|
||
|
</table>
|
||
|
<?php pre($IncomesExpenses); ?>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</div><!-- /.container-fluid -->
|
||
|
</section>
|