Update grid column width in finance manager and modify date input handling in operation edit template
This commit is contained in:
@@ -87,165 +87,161 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-middle">
|
||||
<div class="row">
|
||||
<div class="col-12 flex">
|
||||
<div class="input-group finance-calendar" style="width: 240px;">
|
||||
<input type="text" name="date" class="form-control date-range" value="<?= $this->date_from . ' - ' . $this->date_to; ?>" />
|
||||
</div>
|
||||
<select class="form-control finance-group" name="group_id">
|
||||
<? foreach ($this->groups as $group) : ?>
|
||||
<option value="<?= $group['id']; ?>" <? if ($this->group_id == $group['id']) : ?>selected="selected"
|
||||
<? endif; ?>><?= $group['name']; ?>
|
||||
</option>
|
||||
<? endforeach; ?>
|
||||
</select>
|
||||
<div class="flex">
|
||||
<div class="input-group finance-calendar" style="width: 240px;">
|
||||
<input type="text" name="date" class="form-control date-range" value="<?= $this->date_from . ' - ' . $this->date_to; ?>" />
|
||||
</div>
|
||||
<select class="form-control finance-group" name="group_id">
|
||||
<? foreach ($this->groups as $group) : ?>
|
||||
<option value="<?= $group['id']; ?>" <? if ($this->group_id == $group['id']) : ?>selected="selected"
|
||||
<? endif; ?>><?= $group['name']; ?>
|
||||
</option>
|
||||
<? endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row categories">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm" style="background: #FFF;">
|
||||
<thead>
|
||||
<tr class="dark">
|
||||
<th>Kategoria <a href="/finances/category_edit/" class="btn btn-success btn-xs btn-add-category" title="dodaj kategorię"><i class="fa fa-plus"></i></a></th>
|
||||
<th class="text-right" style="width: 100px;">Koszty</th>
|
||||
<th class="text-right" style="width: 50px;">Ilość</th>
|
||||
<th class="text-right" style="width: 100px;">Przychód</th>
|
||||
<th class="text-right" style="width: 50px;">Ilość</th>
|
||||
<th class="text-right" style="width: 100px">Dochód</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if (is_array($this->categories)) : foreach ($this->categories as $category) : ?>
|
||||
<? unset($summary_costs);
|
||||
unset($summary_income); ?>
|
||||
<tr>
|
||||
<th colspan="6" class="category-name">
|
||||
<div class="manage-menu">
|
||||
<span class="context-menu" data-container-id="category-<?= $category['id'];?>-menu"></span>
|
||||
<div class="context-menu-container" id="category-<?= $category['id'];?>-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/finances/category_edit/parent-id=<?= $category['id']; ?>" title="dodaj podkategorię">
|
||||
Dodaj podkategorię
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="category-delete" category_id="<?= $category['id']; ?>" title="usuń kategorię">
|
||||
Usuń kategorię
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="categories">
|
||||
<table class="table table-sm" style="background: #FFF;">
|
||||
<thead>
|
||||
<tr class="dark">
|
||||
<th>Kategoria <a href="/finances/category_edit/" class="btn btn-success btn-xs btn-add-category" title="dodaj kategorię"><i class="fa fa-plus"></i></a></th>
|
||||
<th class="text-right" style="width: 100px;">Koszty</th>
|
||||
<th class="text-right" style="width: 50px;">Ilość</th>
|
||||
<th class="text-right" style="width: 100px;">Przychód</th>
|
||||
<th class="text-right" style="width: 50px;">Ilość</th>
|
||||
<th class="text-right" style="width: 100px">Dochód</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if (is_array($this->categories)) : foreach ($this->categories as $category) : ?>
|
||||
<? unset($summary_costs);
|
||||
unset($summary_income); ?>
|
||||
<tr>
|
||||
<th colspan="6" class="category-name">
|
||||
<div class="manage-menu">
|
||||
<span class="context-menu" data-container-id="category-<?= $category['id'];?>-menu"></span>
|
||||
<div class="context-menu-container" id="category-<?= $category['id'];?>-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/finances/category_edit/parent-id=<?= $category['id']; ?>" title="dodaj podkategorię">
|
||||
Dodaj podkategorię
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="category-delete" category_id="<?= $category['id']; ?>" title="usuń kategorię">
|
||||
Usuń kategorię
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$(document).ready(function(){
|
||||
console.log('test');
|
||||
var tableContextMenu = new ContextMenu("category-<?= $category['id'];?>-menu", menuItemClickListener);
|
||||
});
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$(document).ready(function(){
|
||||
console.log('test');
|
||||
var tableContextMenu = new ContextMenu("category-<?= $category['id'];?>-menu", menuItemClickListener);
|
||||
});
|
||||
</script>
|
||||
<?= $category['name']; ?>
|
||||
</th>
|
||||
</tr>
|
||||
<? if (is_array($category['subcategories'])) : foreach ($category['subcategories'] as $subcategory) : ?>
|
||||
<tr>
|
||||
<td class="pl15 category-name">
|
||||
<div class="manage-menu">
|
||||
<span class="context-menu" data-container-id="category-<?= $subcategory['id'];?>-menu"></span>
|
||||
<div class="context-menu-container" id="category-<?= $subcategory['id'];?>-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/finances/category_edit/id=<?= $subcategory['id']; ?>" title="edytuj podkategorię">
|
||||
Edytuj podkategorię
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/finances/operation_edit/category-id=<?= $subcategory['id']; ?>" title="dodaj operację">
|
||||
Dodaj operację
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/finances/operations_list/category-id=<?= $subcategory['id']; ?>" title="pokaż listę operacji">
|
||||
Pokaż listę operacji
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="category-delete" category_id="<?= $subcategory['id']; ?>" title="usuń kategorię">
|
||||
Usuń kategorię
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
});
|
||||
</script>
|
||||
<?= $category['name']; ?>
|
||||
</th>
|
||||
</tr>
|
||||
<? if (is_array($category['subcategories'])) : foreach ($category['subcategories'] as $subcategory) : ?>
|
||||
<tr>
|
||||
<td class="pl15 category-name">
|
||||
<div class="manage-menu">
|
||||
<span class="context-menu" data-container-id="category-<?= $subcategory['id'];?>-menu"></span>
|
||||
<div class="context-menu-container" id="category-<?= $subcategory['id'];?>-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/finances/category_edit/id=<?= $subcategory['id']; ?>" title="edytuj podkategorię">
|
||||
Edytuj podkategorię
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/finances/operation_edit/category-id=<?= $subcategory['id']; ?>" title="dodaj operację">
|
||||
Dodaj operację
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/finances/operations_list/category-id=<?= $subcategory['id']; ?>" title="pokaż listę operacji">
|
||||
Pokaż listę operacji
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="category-delete" category_id="<?= $subcategory['id']; ?>" title="usuń kategorię">
|
||||
Usuń kategorię
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$(document).ready(function(){
|
||||
var tableContextMenu = new ContextMenu("category-<?= $subcategory['id'];?>-menu", menuItemClickListener);
|
||||
});
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$(document).ready(function(){
|
||||
var tableContextMenu = new ContextMenu("category-<?= $subcategory['id'];?>-menu", menuItemClickListener);
|
||||
});
|
||||
</script>
|
||||
<?= $subcategory['name']; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= \S::number_display( $subcategory['costs'] ); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= $subcategory['costs_count'] * (-1); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= \S::number_display( $subcategory['income'] ); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= $subcategory['income_count']; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span><?= \S::number_display( $subcategory['income'] + $subcategory['costs'] );?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
$summary_costs += $subcategory['costs'];
|
||||
$summary_income += $subcategory['income'];
|
||||
$total_costs += $subcategory['costs'];
|
||||
$total_income += $subcategory['income'];
|
||||
?>
|
||||
<? endforeach;
|
||||
endif; ?>
|
||||
<tr>
|
||||
<th class="text-right">
|
||||
Razem:
|
||||
</th>
|
||||
<th class="text-right">
|
||||
<?= \S::number_display($summary_costs); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<?= \S::number_display($summary_income); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<span class="<? if ( $summary_income + $summary_costs > 0 ):?>text-success<? elseif ( $summary_income + $summary_costs < 0 ):?>text-danger<? endif;?>"><?= \S::number_display( $summary_income + $summary_costs );?></span>
|
||||
</th>
|
||||
</tr>
|
||||
<? endforeach;
|
||||
endif; ?>
|
||||
<tr>
|
||||
<th class="text-right">
|
||||
Razem:
|
||||
</th>
|
||||
<th class="text-right">
|
||||
<?= \S::number_display($total_costs); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<?= \S::number_display($total_income); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<span class="<? if ( $total_income + $total_costs > 0 ):?>text-success<? elseif ( $total_income + $total_costs < 0 ):?>text-danger<? endif;?>"><?= \S::number_display( $total_income + $total_costs );?></span>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
});
|
||||
</script>
|
||||
<?= $subcategory['name']; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= \S::number_display( $subcategory['costs'] ); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= $subcategory['costs_count'] * (-1); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= \S::number_display( $subcategory['income'] ); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?= $subcategory['income_count']; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span><?= \S::number_display( $subcategory['income'] + $subcategory['costs'] );?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
$summary_costs += $subcategory['costs'];
|
||||
$summary_income += $subcategory['income'];
|
||||
$total_costs += $subcategory['costs'];
|
||||
$total_income += $subcategory['income'];
|
||||
?>
|
||||
<? endforeach;
|
||||
endif; ?>
|
||||
<tr>
|
||||
<th class="text-right">
|
||||
Razem:
|
||||
</th>
|
||||
<th class="text-right">
|
||||
<?= \S::number_display($summary_costs); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<?= \S::number_display($summary_income); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<span class="<? if ( $summary_income + $summary_costs > 0 ):?>text-success<? elseif ( $summary_income + $summary_costs < 0 ):?>text-danger<? endif;?>"><?= \S::number_display( $summary_income + $summary_costs );?></span>
|
||||
</th>
|
||||
</tr>
|
||||
<? endforeach;
|
||||
endif; ?>
|
||||
<tr>
|
||||
<th class="text-right">
|
||||
Razem:
|
||||
</th>
|
||||
<th class="text-right">
|
||||
<?= \S::number_display($total_costs); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<?= \S::number_display($total_income); ?>
|
||||
</th>
|
||||
<th class="text-right" colspan="2">
|
||||
<span class="<? if ( $total_income + $total_costs > 0 ):?>text-success<? elseif ( $total_income + $total_costs < 0 ):?>text-danger<? endif;?>"><?= \S::number_display( $total_income + $total_costs );?></span>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-right">
|
||||
|
||||
Reference in New Issue
Block a user