This commit is contained in:
Raju Shrestha 2024-08-08 19:07:57 +05:45
parent e47ff3321d
commit b06ce0569a
3 changed files with 25 additions and 91 deletions

View File

@ -8,9 +8,7 @@ $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,
td, td,
@ -18,64 +16,51 @@ $PL = $IncomesTotal - $ExpensesTotal;
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
} }
.group-name { .group-name {
width: 40%; width: 40%;
} }
.group-total { .group-total {
width: 10%; width: 10%;
} }
.table-gray { .table-gray {
background-color: #eee; background-color: #eee;
} }
.table td, .table td,
.table th { .table th {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
} }
.bg-darker { .bg-darker {
background-color: #ddd; background-color: #ddd;
} }
td .table { td .table {
border: 0px !important; border: 0px !important;
margin-bottom: 0rem; margin-bottom: 0rem;
} }
table td:first-child { table td:first-child {
padding-left: 5px; padding-left: 5px;
} }
.table-bordered.vertical-borders td, .table-bordered.vertical-borders td,
.table-bordered.vertical-borders th { .table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6; border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6; border-right: 1px solid #dee2e6;
} }
.table-bordered.vertical-borders thead th { .table-bordered.vertical-borders thead th {
padding: 0.25rem; padding: 0.25rem;
border-top: none; border-top: none;
border-bottom: 2px solid #dee2e6; border-bottom: 2px solid #dee2e6;
} }
.table-bordered.vertical-borders tfoot th { .table-bordered.vertical-borders tfoot th {
padding: 0.25rem; padding: 0.25rem;
border-top: 2px solid #dee2e6; border-top: 2px solid #dee2e6;
border-bottom: none; border-bottom: none;
} }
.currency { .currency {
font-weight: normal !important; font-weight: normal !important;
} }
.underline { .underline {
text-decoration: underline; text-decoration: underline;
} }
.form-control { .form-control {
display: block; display: block;
width: 100%; width: 100%;
@ -93,38 +78,27 @@ $PL = $IncomesTotal - $ExpensesTotal;
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;
} }
</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">Cash Flow<?php //echo $pageTitle; <h3 class="card-title mt-1">Cash Flow<?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">
Filters Filters
</button> </button>
<div class="dropdown-menu" role="menu"> <div class="dropdown-menu" role="menu">
<div class="form-group p-2 pb-0"> <div class="form-group p-2 pb-0">
<div class="col"> <div class="col">
<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" 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"> <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>
<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" 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"> <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">
@ -132,7 +106,6 @@ $PL = $IncomesTotal - $ExpensesTotal;
</div> </div>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox"> <input class="form-check-input" type="checkbox">
<label class="form-check-label">Select <label class="form-check-label">Select
All</label> All</label>
@ -165,8 +138,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>
@ -175,9 +146,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() {
@ -233,9 +202,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";
@ -245,31 +212,24 @@ $PL = $IncomesTotal - $ExpensesTotal;
document.getElementById("FilterForm").submit(); document.getElementById("FilterForm").submit();
} }
</script> </script>
</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> -->
<div class="card card-primary card-outline"> <div class="card card-primary card-outline">
<!-- <div class="card-header"> <!-- <div class="card-header">
<h4 class="card-title">Cash Flow</h4> <h4 class="card-title">Cash Flow</h4>
</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-head-fixed table-bordered g-0">
<thead> <thead>
<tr> <tr>
<th class="" width="35%"><?php myLang("Cash inflow"); ?></th> <th class="" width="30%"><?php myLang("Cash inflow"); ?></th>
<th class="text-right" width="15%"></th> <th class="text-right" width="10%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th> <th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th>
<th class="" width="35%"><?php echo myLang("Cash outflow"); ?></th> <th class="pl-2" width="30%"><?php echo myLang("Cash outflow"); ?></th>
<th class="text-right" width="15%"></th> <th class="text-right" width="10%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th> <th class="text-right pr-3" width="15%"><?php myLang("Amount"); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -278,32 +238,27 @@ $PL = $IncomesTotal - $ExpensesTotal;
<table class="table g-0"> <table class="table g-0">
<?php $total1 = 0; <?php $total1 = 0;
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?> foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?> <?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
<!-- <tr> <!-- <tr>
<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") : ?>
<tr> <tr>
<td class="" width="70%"><b><?php echo $Incomes['category']; ?></b></td> <td class="pr-2" width="70%"><b><?php echo $Incomes['category']; ?></b></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td> <td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="15%"></td> <td width="15%"></td>
</tr> </tr>
<?php else : ?> <?php else : ?>
<?php $total1 += $Incomes['amount']; ?> <?php $total1 += $Incomes['amount']; ?>
<tr> <tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td> <td class="pr-2" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td>
<td width="15%"></td> <td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td> <td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php }; ?> <?php }; ?>
</table> </table>
</td> </td>
<td colspan=3 class="p-0"> <td colspan=3 class="p-0">
@ -315,32 +270,22 @@ $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") : ?>
<tr> <tr>
<td class="" width="70%"><b><?php echo $Expenses['category']; ?></b></td> <td class="" width="70%"><b><?php echo $Expenses['category']; ?></b></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td> <td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td> <td width="15%"></td>
</tr> </tr>
<?php else : ?> <?php else : ?>
<?php $total += $Expenses['amount']; ?> <?php $total += $Expenses['amount']; ?>
<tr> <tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td> <td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td>
<td width="15%"></td> <td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td> <td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php }; ?> <?php }; ?>
</table> </table>
</td> </td>
</tr> </tr>
@ -348,8 +293,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
<tr> <tr>
<th>Total</th> <th>Total</th>
<td></td> <td></td>
<td class="text-right"><?php echo myCurrency($total1); ?></td> <td class="text-right pr-2"><?php echo myCurrency($total1); ?></td>
<th>Total</th> <th>Total</th>
<td></td> <td></td>
<td class="text-right"><?php echo myCurrency($total); ?></td> <td class="text-right"><?php echo myCurrency($total); ?></td>
@ -358,10 +302,9 @@ $PL = $IncomesTotal - $ExpensesTotal;
<th></th> <th></th>
<td></td> <td></td>
<td class="text-right"></td> <td class="text-right"></td>
<th>Net Inflow</th> <th>Net Inflow</th>
<td></td> <td></td>
<td class="text-right"><?php echo myCurrency($total1 - $total); ?></td> <td class="text-right pr-2"><?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) : ?>
@ -369,38 +312,29 @@ $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><?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"><?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); ?>
<?php foreach ($Cash->accounts as $account) : ?> <?php foreach ($Cash->accounts as $account) : ?>
<tr> <tr>
<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><?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"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<?php //pre($IncomesExpenses); <?php //pre($IncomesExpenses);
?> ?>
</div> </div>
</div> </div>
</div><!-- /.container-fluid --> </div><!-- /.container-fluid -->
</section> </section>
<?php function footerFunctions() <?php function footerFunctions()
{ ?> { ?>
<script> <script>

View File

@ -12,12 +12,12 @@
<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 width="3%" class="text-center"><?php myLang('S.N'); ?></th>
<th><?php myLang('Date'); ?></th> <th width="10%" class="col-1"><?php myLang('Date'); ?></th>
<th><?php myLang('Purchase Transaction'); ?></th> <th class="table-col col-9"><?php myLang('Purchase Transaction'); ?></th>
<th><?php myLang('Amount'); ?></th> <th width="8%"class="col-2"><?php myLang('Amount'); ?></th>
<td><b>Action</b></th> <td class="col-1 text-center"><b>Action</b></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -29,7 +29,7 @@
<td><?php echo $TableRow->purchase_date; ?></td> <td><?php echo $TableRow->purchase_date; ?></td>
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></td> <td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></td>
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td> <td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?> <td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
<?php showDeleteButton($id); ?> <?php showDeleteButton($id); ?>
</td> </td>
</tr> </tr>

View File

@ -12,24 +12,24 @@
<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=" col-1 text-center"><?php myLang('Sales Voucher #'); ?></th>
<th width="10%"><?php myLang('Date'); ?></th> <th class="col-1"><?php myLang('Date'); ?></th>
<th><?php myLang('Transaction'); ?></th> <th><?php myLang('Transaction'); ?></th>
<th class="table-col col-1"><?php myLang('Amount'); ?></th> <th class="table-col col-1 text-center"><?php myLang('Amount'); ?></th>
<th class="table-col col-1"><?php myLang('Action'); ?></th> <th class="text-center col-1"><?php myLang('Action'); ?></th>
</tr> </tr>
</thead> </thead>
<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><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?> <td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?>
</td> </td>
<td><?php echo myCurrency($TableRow->totalsales); ?></td> <td><?php echo myCurrency($TableRow->totalsales); ?></td>
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?> <td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
<?php showDeleteButton($TableRow->sales_id); ?> <?php showDeleteButton($TableRow->sales_id); ?>
</td> </td>
</tr> </tr>