g_sto/themes/gokbakja/pages/produced/rulonstock.htm

147 lines
6.1 KiB
HTML

title = "produced/rulon/stock"
url = "/produced/rulon/stock/:stockId"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$stockId = $this->param("stockId");
$this["actions"] = Romanah\Gokbakja\Models\RulonAction::select('romanah_gokbakja_rulon_action.*')
->with(['product' => function($q){
$q->with(['bag_type', 'bag_size', 'color']);
}])
->where("stock_id", $stockId)
//->where("status_accountant", "accept")
//->where("status_director", "accept")
->addSelect(DB::raw("SUM(amount) as quantity"))
->groupBy('romanah_gokbakja_rulon_action.product_id')
->orderBy('id', 'DESC')
->get();
$this["actionsSumWeight"] = Romanah\Gokbakja\Models\RulonAction::select('romanah_gokbakja_rulon_action.*')
->where("stock_id", $stockId)
//->where("status_accountant", "accept")
//->where("status_director", "accept")
->sum('amount');
$this["actionsSumCount"] = count($this["actions"]);
// dd($this["actions"]);
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;text-transform: capitalize;">
Öndürlen Rulonlar</h3>
<p class="card-title-desc" style="color: #6c6ff5;">sklad</p>
</div>
<div class="col-md-4">
<div class="card bg-info text-white-50">
<div class="card-body">
<h5 class="text-white" style="text-transform: uppercase;margin-bottom: 0;"><i
class="mdi mdi-bullseye-arrow me-3"></i> Rulon Sany: {{actionsSumCount}}</h5>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card bg-info text-white-50">
<div class="card-body">
<h5 class="text-white" style="text-transform: uppercase;margin-bottom: 0;"><i
class="mdi mdi-bullseye-arrow me-3"></i> Umumy agramy: {{actionsSumWeight}} kg</h5>
</div>
</div>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Haryt Kody</th>
<th>Haryt</th>
<th>Hereket</th>
<th>Mukdary (KG)</th>
<th>Brutto agramy (KG)</th>
<th>Sene</th>
<th>Sklad</th>
</tr>
</thead>
<tbody>
{% for key, record in actions %}
<tr>
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
<td><a href="/machine">#Rulon{{record.product_id}}</a></td>
<td><a style="font-weight: bold;color: #0005c5;">{{record.product.bag_type.name}}, Ölçegi: {{record.product.width}}, {{record.product.gram}} m2, {{record.product.layer}} gat, {{record.product.color.name}}</a></td>
<td style="text-align: center;">
<span class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}" style="font-size: 14px;">{{record.type}}</span></td>
<td style="color: #500101;font-weight: bold;">{{record.quantity|number_format(2)}} kg</td>
<td style="color: #500101;font-weight: bold;">{{record.product.brutto_kg|number_format(2)}} kg</td>
<td>{{record.created_at|date('d.m.Y')}}</td>
<td>{{record.stock.name}}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Haryt Kody</th>
<th>Haryt</th>
<th>Hereket</th>
<th>Mukdary (KG)</th>
<th>Brutto agramy (KG)</th>
<th>Sene</th>
<th>Sklad</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
{% put scripts %}
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}