salesvspurchase and final accounts pages change

This commit is contained in:
Sampanna Rimal
2024-08-05 13:13:06 +05:45
parent c16163bf01
commit d164f3139d
18 changed files with 743 additions and 412 deletions

View File

@ -9,57 +9,70 @@ $BIBAccounts = new BIBAccounts();
<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,
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
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;
}
.currency {
font-weight: normal !important;
}
.underline {
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
@ -80,88 +93,106 @@ $BIBAccounts = new BIBAccounts();
<div class="content-wrapper">
<div class="content">
<div class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card card-primary card-outline ">
<div class="card-header">
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
<div class="card-header">
<h2 class="card-title"><?php echo $pageTitle; ?> <?php myLang("Report"); ?></h2>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-plus"></i>
</button>
</div>
<!-- /.card-tools -->
</div>
<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 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 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 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="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">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">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">Period</label>
</div>
</div>
<div class="dropdown-divider"></div>
<button type="submit" class="btn btn-primary mr-2 text-center">Search Now</button>
</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 class="btn-group">
<button type="submit" class="btn btn-danger 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>
<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 = "<?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>
<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() {
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 mr-2" 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-body p-0">
<?php
@ -179,7 +210,7 @@ $BIBAccounts = new BIBAccounts();
<thead>
<tr>
<th class="group-name" width="85%">Particulars</th>
<th class="group-total text-center" width="10%" >Amount</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>
@ -205,16 +236,18 @@ $BIBAccounts = new BIBAccounts();
?>
<?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-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>
<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="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
@ -234,7 +267,7 @@ $BIBAccounts = new BIBAccounts();
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
@ -246,14 +279,16 @@ $BIBAccounts = new BIBAccounts();
?>
<?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>
<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="collapse">
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</i>
</div>
</td>
@ -291,7 +326,7 @@ $BIBAccounts = new BIBAccounts();
</tr>
<?php else : ?>
<tr>
<td colspan="2" class="p-0">
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Loss</th>
@ -306,7 +341,7 @@ $BIBAccounts = new BIBAccounts();
</tr>
<?php endif; ?>
<tr>
<td colspan="2" class="p-0">
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Incomes</th>
@ -327,12 +362,12 @@ $BIBAccounts = new BIBAccounts();
<tr>
<th>Total Expenses</th>
<th class="dr closing-dr">
<?php if ($PL > 0) : ?>
<?php if ($PL > 0) : ?>
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
<?php else : ?>
<?php echo myCurrency($totalClosingDr); ?>
<?php endif; ?>
</th>
</tr>
@ -360,9 +395,6 @@ function footerfunctions()
{
?>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Trigger click event on page load
document.getElementById("toggleShowAll").click();