This commit is contained in:
Raju Shrestha
2024-08-25 18:37:52 +05:45
parent 78670b1b95
commit 161703be17
11 changed files with 100 additions and 263 deletions

View File

@ -8,7 +8,6 @@ $ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<style>
table,
@ -97,24 +96,15 @@ $PL = $IncomesTotal - $ExpensesTotal;
;
}
</style>
<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">Receipts And Payments <?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">
@ -166,8 +156,6 @@ $PL = $IncomesTotal - $ExpensesTotal;
<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>
@ -176,9 +164,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> -->
</div>
<!-- <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>
</form>
<script>
function resetForm() {
@ -192,39 +178,36 @@ $PL = $IncomesTotal - $ExpensesTotal;
</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">
<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">
<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>
<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"; ?>>
</div>
</div>
<div class="col-1 text-center">
<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"; ?>>
</div>
</div>
<div class="col-1 text-center">
<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"; ?>>
</div>
</div>
@ -237,9 +220,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div>
</div>
</div>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "2078-4-1";
@ -249,23 +230,20 @@ $PL = $IncomesTotal - $ExpensesTotal;
document.getElementById("FilterForm").submit();
}
</script>
</div> -->
</div>
<div class="card">
<div class="card card-primary card-outline">
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
<table class="table table-head-fixed table-bordered g-0" id="TrialBalanceTable">
<thead>
<tr>
<th class="" width="35%"><?php myLang("Receipts"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th>
<th class="" width="35%"><?php echo myLang("Payments"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th>
<th class="" width="30%"><?php myLang("Receipts"); ?></th>
<th class="text-right" width="10%"></th>
<th class="text-right pr-2" width="10%"><?php myLang("Amount"); ?></th>
<th class="" width="30%"><?php echo myLang("Payments"); ?></th>
<th class="text-right" width="10%"></th>
<th class="text-right pr-2" width="10%"><?php myLang("Amount"); ?></th>
</tr>
</thead>
<tbody>
@ -281,32 +259,26 @@ $PL = $IncomesTotal - $ExpensesTotal;
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
</tr-->
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
<?php $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 width="15%"></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td class="" width="60%"><b><?php echo $Incomes['category']; ?></b></td>
<td width="20%"></td>
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr>
<?php else : ?>
<?php $total1 += $Incomes['amount']; ?>
<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 class="pr-2" 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 width="15%"></td>
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="20%"></td>
</tr>
<?php endif; ?>
<?php $counter = $index ?>
<?php }; ?>
</table>
</td>
<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 width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
</tr-->
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
<?php $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 width="15%"></td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td class="pr-2" width="60%"><b><?php echo $Expenses['category']; ?></b></td>
<td width="20%"></td>
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr>
<?php else : ?>
<?php $total += $Expenses['amount']; ?>
<tr class="collapse" data-target="#group_<?php echo $counter; ?>">
<td class="" width="70%">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php echo $Expenses['account']; ?>
<td class="" width="60%">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php echo $Expenses['account']; ?>
</td>
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td>
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="20%"></td>
</tr>
<?php endif; ?>
<?php }; ?>
</table>
</td>
</tr>
@ -370,9 +332,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
<th></th>
<td class="pr-2"><?php echo myCurrency($balance_fi); ?></td>
</tr>
<?php endif; ?>
<tr>
<th class="pl-2">Total</th>
<th></th>
@ -382,19 +342,11 @@ $PL = $IncomesTotal - $ExpensesTotal;
<td class="pr-2"><?php echo myCurrency($total); ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<?php function footerFunctions()
{ ?>
<script>