mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Applied formatting rules for by #989 changed files
This commit is contained in:
parent
f68e96a235
commit
6adac0588a
@ -1,41 +1,51 @@
|
||||
ALTER TABLE stock_log ADD COLUMN
|
||||
user_id INTEGER NOT NULL DEFAULT 1;
|
||||
ALTER TABLE stock_log
|
||||
ADD user_id INTEGER NOT NULL DEFAULT 1;
|
||||
|
||||
CREATE VIEW uihelper_stock_journal
|
||||
AS
|
||||
SELECT stock_log.id,
|
||||
stock_log.row_created_timestamp,
|
||||
stock_log.correlation_id,
|
||||
stock_log.undone,
|
||||
stock_log.undone_timestamp,
|
||||
stock_log.row_created_timestamp,
|
||||
stock_log.transaction_type,
|
||||
stock_log.spoiled,
|
||||
stock_log.amount,
|
||||
stock_log.location_id,
|
||||
l.name AS location_name,
|
||||
p.name AS product_name,
|
||||
qu.name AS qu_name,
|
||||
qu.name_plural AS qu_name_plural,
|
||||
u.display_name AS user_display_name
|
||||
|
||||
FROM stock_log
|
||||
JOIN users_dto u on stock_log.user_id = u.id
|
||||
JOIN products p on stock_log.product_id = p.id
|
||||
JOIN locations l on p.location_id = l.id
|
||||
JOIN quantity_units qu ON p.qu_id_stock = qu.id;
|
||||
|
||||
SELECT
|
||||
sl.id,
|
||||
sl.row_created_timestamp,
|
||||
sl.correlation_id,
|
||||
sl.undone,
|
||||
sl.undone_timestamp,
|
||||
sl.row_created_timestamp,
|
||||
sl.transaction_type,
|
||||
sl.spoiled,
|
||||
sl.amount,
|
||||
sl.location_id,
|
||||
l.name AS location_name,
|
||||
p.name AS product_name,
|
||||
qu.name AS qu_name,
|
||||
qu.name_plural AS qu_name_plural,
|
||||
u.display_name AS user_display_name
|
||||
FROM stock_log sl
|
||||
JOIN users_dto u
|
||||
ON sl.user_id = u.id
|
||||
JOIN products p
|
||||
ON sl.product_id = p.id
|
||||
JOIN locations l
|
||||
ON p.location_id = l.id
|
||||
JOIN quantity_units qu
|
||||
ON p.qu_id_stock = qu.id;
|
||||
|
||||
CREATE VIEW uihelper_stock_journal_summary
|
||||
AS
|
||||
SELECT user_id AS id, -- dummy, LessQL needs an id column
|
||||
user_id, u.display_name AS user_display_name, p.name AS product_name, product_id, transaction_type,
|
||||
qu.name AS qu_name,
|
||||
qu.name_plural AS qu_name_plural,
|
||||
SUM(amount) AS amount
|
||||
FROM stock_log
|
||||
JOIN users_dto u on stock_log.user_id = u.id
|
||||
JOIN products p on stock_log.product_id = p.id
|
||||
JOIN quantity_units qu ON p.qu_id_stock = qu.id
|
||||
SELECT
|
||||
user_id AS id, -- Dummy, LessQL needs an id column
|
||||
user_id, u.display_name AS user_display_name,
|
||||
p.name AS product_name,
|
||||
product_id,
|
||||
transaction_type,
|
||||
qu.name AS qu_name,
|
||||
qu.name_plural AS qu_name_plural,
|
||||
SUM(amount) AS amount
|
||||
FROM stock_log sl
|
||||
JOIN users_dto u
|
||||
on sl.user_id = u.id
|
||||
JOIN products p
|
||||
ON sl.product_id = p.id
|
||||
JOIN quantity_units qu
|
||||
ON p.qu_id_stock = qu.id
|
||||
WHERE undone = 0
|
||||
GROUP BY user_id, product_id,transaction_type;
|
||||
GROUP BY user_id, product_id, transaction_type;
|
||||
|
@ -5,43 +5,43 @@
|
||||
@section('viewJsName', 'stockjournalsummary')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<table id="journal-summary-table"
|
||||
class="table table-sm table-striped dt-responsive">
|
||||
<thead>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<table id="journal-summary-table"
|
||||
class="table table-sm table-striped dt-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ $__t('Product') }}</th>
|
||||
<th>{{ $__t('Booking type') }}</th>
|
||||
<th>{{ $__t('User') }}</th>
|
||||
<th>{{ $__t('Amount') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="d-none">
|
||||
</thead>
|
||||
<tbody class="d-none">
|
||||
@foreach($entries as $journalEntry)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $journalEntry->product_name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $__t($journalEntry->transaction_type) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $journalEntry->user_display_name }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="locale-number locale-number-quantity-amount">{{ $journalEntry->amount }}</span> {{ $__n($journalEntry->amount, $journalEntry->qu_name, $journalEntry->qu_name_plural) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ $journalEntry->product_name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $__t($journalEntry->transaction_type) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $journalEntry->user_display_name }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="locale-number locale-number-quantity-amount">{{ $journalEntry->amount }}</span> {{ $__n($journalEntry->amount, $journalEntry->qu_name, $journalEntry->qu_name_plural) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
Loading…
x
Reference in New Issue
Block a user