edit profti and loss

This commit is contained in:
Raju Shrestha 2024-08-26 12:29:38 +05:45
parent 161703be17
commit 759b97e1f0
9 changed files with 575 additions and 134 deletions

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

@ -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,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">
<div class="content"> <div class="content">
@ -178,8 +202,9 @@ $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">
<div class="row">
<?php <?php
// echo $_POST['showClosing']; // echo $_POST['showClosing'];
$ReportOptions = array( $ReportOptions = array(
@ -190,20 +215,17 @@ $BIBAccounts = new BIBAccounts();
); );
// die; // die;
?> ?>
<table class="table table-bordered"> <div class="col-6 p-0">
<div class="table-responsive">
<table class="table ">
<thead> <thead>
<tr> <tr>
<th class="group-name" width="85%">Particulars</th> <th class="group-name pl-1">Particulars</th>
<th class="group-total text-center" width="10%">Amount</th> <th class="group-total text-center col-1">Amount</th>
<th class="group-name" width="85%">Particulars</th>
<th class="group-total text-center" width="15%">Amount</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<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;
@ -214,35 +236,52 @@ $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; ?>">
<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> <tr>
<td colspan="7" class="group-details p-0" width="85%"> <td colspan="2" class="p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class=""> <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> </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; ?> <?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th class="pl-1">Total Loss</th>
<th class="text-right pr-1"></th>
</tr>
<tr>
<th class="p-1">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>
</tfoot>
</table> </table>
</td> </div>
<td colspan="2" class="p-0"> </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;
@ -253,14 +292,8 @@ $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; ?>">
<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> <tr>
<td colspan="7" class="group-details p-0"> <td colspan="2" class="p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class=""> <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()); ?>
@ -278,73 +311,40 @@ $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>
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?> <?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">
<tr>
<th>Total Profit</th>
<th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th> <th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th>
</tr> </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; ?> <?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>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"> <th class="dr closing-dr">
<?php if ($PL > 0) : ?> <?php if ($PL > 0) : ?>
<?php echo myCurrency($totalClosingDr + abs($PL)); ?> <?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>
</td>
</tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<?php <?php

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,9 +211,9 @@ $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>
@ -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

@ -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

@ -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

@ -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

@ -139,3 +139,6 @@ table.dataTable>thead>tr>th:not(.sorting_disabled), table.dataTable>thead>tr>td:
vertical-align: middle; vertical-align: middle;
} }
.text-right{
padding-right: 10px;
}

Binary file not shown.