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">
|
||||
|
||||
@@ -13,8 +13,8 @@ ob_start();
|
||||
echo \Html::input( [
|
||||
'label' => 'Data',
|
||||
'name' => 'date',
|
||||
'value' => $date,
|
||||
'class' => 'date require',
|
||||
'value' => $date ? $date : date( 'Y-m-d' ),
|
||||
'class' => 'datetime require',
|
||||
'inline' => true
|
||||
] );
|
||||
echo \Html::input( [
|
||||
@@ -100,7 +100,6 @@ echo $grid -> draw();
|
||||
});
|
||||
|
||||
tags_data.initialize();
|
||||
console.log( tags_data );
|
||||
|
||||
$( '#tags' ).tagsinput({
|
||||
typeaheadjs: {
|
||||
|
||||
@@ -14,22 +14,17 @@
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
|
||||
<script type="text/javascript" src="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="/libraries/framework/vendor/plugins/moment/moment.js"></script>
|
||||
<script type="text/javascript" src="/libraries/framework/vendor/plugins/moment/pl.js"></script>
|
||||
<script type="text/javascript" src="/libraries/framework/vendor/plugins/datepicker/js/bootstrap-datetimepicker.js"></script>
|
||||
<script type="text/javascript" src="/libraries/framework/vendor/plugins/daterange/daterangepicker.js"></script>
|
||||
<script type="text/javascript" src="/libraries/datepicker/js/datepicker.min.js"></script>
|
||||
<script type="text/javascript" src="/libraries/datepicker/js/i18n/datepicker.pl.js"></script>
|
||||
<script type="text/javascript" src="/libraries/daterange/daterangepicker.js"></script>
|
||||
<script type="text/javascript" src="/libraries/jquery-confirm/jquery-confirm.min.js"></script>
|
||||
<script type="text/javascript" src="/libraries/select2/js/select2.full.min.js"></script>
|
||||
<script type="text/javascript" src="/libraries/jquery.contextMenu/context-menu.js"></script>
|
||||
<script type="text/javascript" src="/libraries/functions.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.structure.min.css">
|
||||
<link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.theme.min.css">
|
||||
<link rel="stylesheet" href="/libraries/framework/vendor/plugins/datepicker/css/bootstrap-datetimepicker.css">
|
||||
<link rel="Stylesheet" type="text/css" href="/libraries/framework/skin/default_skin/css/theme.css">
|
||||
<link rel="stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/datepicker/css/bootstrap-datetimepicker.css">
|
||||
<link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/daterange/daterangepicker.css">
|
||||
<link rel="stylesheet" type="text/css" href="/libraries/datepicker/css/datepicker.min.css">
|
||||
<link rel="Stylesheet" type="text/css" href="/libraries/daterange/daterangepicker.css">
|
||||
<link rel="stylesheet" type="text/css" href="/libraries/jquery-confirm/jquery-confirm.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/libraries/select2/css/select2.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/libraries/select2/css/select2-bootstrap-5-theme.min.css">
|
||||
|
||||
Reference in New Issue
Block a user