Applied formatting rules for by #989 changed files

This commit is contained in:
Bernd Bestel 2020-09-06 13:31:54 +02:00
parent f68e96a235
commit 6adac0588a
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 73 additions and 63 deletions

View File

@ -1,41 +1,51 @@
ALTER TABLE stock_log ADD COLUMN ALTER TABLE stock_log
user_id INTEGER NOT NULL DEFAULT 1; ADD user_id INTEGER NOT NULL DEFAULT 1;
CREATE VIEW uihelper_stock_journal CREATE VIEW uihelper_stock_journal
AS AS
SELECT stock_log.id, SELECT
stock_log.row_created_timestamp, sl.id,
stock_log.correlation_id, sl.row_created_timestamp,
stock_log.undone, sl.correlation_id,
stock_log.undone_timestamp, sl.undone,
stock_log.row_created_timestamp, sl.undone_timestamp,
stock_log.transaction_type, sl.row_created_timestamp,
stock_log.spoiled, sl.transaction_type,
stock_log.amount, sl.spoiled,
stock_log.location_id, sl.amount,
l.name AS location_name, sl.location_id,
p.name AS product_name, l.name AS location_name,
qu.name AS qu_name, p.name AS product_name,
qu.name_plural AS qu_name_plural, qu.name AS qu_name,
u.display_name AS user_display_name qu.name_plural AS qu_name_plural,
u.display_name AS user_display_name
FROM stock_log FROM stock_log sl
JOIN users_dto u on stock_log.user_id = u.id JOIN users_dto u
JOIN products p on stock_log.product_id = p.id ON sl.user_id = u.id
JOIN locations l on p.location_id = l.id JOIN products p
JOIN quantity_units qu ON p.qu_id_stock = qu.id; 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 CREATE VIEW uihelper_stock_journal_summary
AS AS
SELECT user_id AS id, -- dummy, LessQL needs an id column SELECT
user_id, u.display_name AS user_display_name, p.name AS product_name, product_id, transaction_type, user_id AS id, -- Dummy, LessQL needs an id column
qu.name AS qu_name, user_id, u.display_name AS user_display_name,
qu.name_plural AS qu_name_plural, p.name AS product_name,
SUM(amount) AS amount product_id,
FROM stock_log transaction_type,
JOIN users_dto u on stock_log.user_id = u.id qu.name AS qu_name,
JOIN products p on stock_log.product_id = p.id qu.name_plural AS qu_name_plural,
JOIN quantity_units qu ON p.qu_id_stock = qu.id 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 WHERE undone = 0
GROUP BY user_id, product_id,transaction_type; GROUP BY user_id, product_id, transaction_type;

View File

@ -5,43 +5,43 @@
@section('viewJsName', 'stockjournalsummary') @section('viewJsName', 'stockjournalsummary')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h2 class="title">@yield('title')</h2> <h2 class="title">@yield('title')</h2>
</div>
</div> </div>
<hr> </div>
<div class="row"> <hr>
<div class="col"> <div class="row">
<table id="journal-summary-table" <div class="col">
class="table table-sm table-striped dt-responsive"> <table id="journal-summary-table"
<thead> class="table table-sm table-striped dt-responsive">
<thead>
<tr> <tr>
<th>{{ $__t('Product') }}</th> <th>{{ $__t('Product') }}</th>
<th>{{ $__t('Booking type') }}</th> <th>{{ $__t('Booking type') }}</th>
<th>{{ $__t('User') }}</th> <th>{{ $__t('User') }}</th>
<th>{{ $__t('Amount') }}</th> <th>{{ $__t('Amount') }}</th>
</tr> </tr>
</thead> </thead>
<tbody class="d-none"> <tbody class="d-none">
@foreach($entries as $journalEntry) @foreach($entries as $journalEntry)
<tr> <tr>
<td> <td>
{{ $journalEntry->product_name }} {{ $journalEntry->product_name }}
</td> </td>
<td> <td>
{{ $__t($journalEntry->transaction_type) }} {{ $__t($journalEntry->transaction_type) }}
</td> </td>
<td> <td>
{{ $journalEntry->user_display_name }} {{ $journalEntry->user_display_name }}
</td> </td>
<td> <td>
<span class="locale-number locale-number-quantity-amount">{{ $journalEntry->amount }}</span> {{ $__n($journalEntry->amount, $journalEntry->qu_name, $journalEntry->qu_name_plural) }} <span class="locale-number locale-number-quantity-amount">{{ $journalEntry->amount }}</span> {{ $__n($journalEntry->amount, $journalEntry->qu_name, $journalEntry->qu_name_plural) }}
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div>
@stop @stop