g_sto/themes/gokbakja/pages/machine/rulon-bags.htm

303 lines
13 KiB
HTML
Raw Normal View History

2023-12-15 21:52:51 +00:00
title = "machine/rulon-bags"
url = "/machine/rulon-bags/:filter"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$filter = $this->param('filter');
2023-12-17 12:43:47 +00:00
$this["rulons"] = Romanah\Gokbakja\Models\BagAction::select('romanah_gokbakja_bag_actions.*')
->with(['product.rulon_action.product.bag_type', 'product.rulon_action.product.color', 'product.pivot_sewer', 'product.pivot_sewer_lst'])
->whereHas('product', function($q){
$q->where('is_sewed', 1);
})
->groupBy('romanah_gokbakja_bag_actions.product_id')
->orderBy('id', 'DESC')
->get();
2023-12-18 20:54:55 +00:00
if($filter == 'filter'){
$start = Carbon\Carbon::parse(post("start"))->format('Y-m-d');
$end = Carbon\Carbon::parse(post("end"))->format('Y-m-d');
$this["rulons"] = Romanah\Gokbakja\Models\BagAction::select('romanah_gokbakja_bag_actions.*')
->with(['product.rulon_action.product.bag_type', 'product.rulon_action.product.color', 'product.pivot_sewer', 'product.pivot_sewer_lst', 'product.rulon_action.product'])
->whereHas('product', function($q){
$q->where('is_sewed', 1);
})
->whereHas('product.rulon_action.product', function($qq) use ($start, $end){
$qq->whereBetween('date', [$start, $end]);
})
->orderBy('id', 'DESC')
->groupBy('romanah_gokbakja_bag_actions.product_id')
->get();
}
2023-12-17 12:43:47 +00:00
//dd($this["rulons"]);
2023-12-15 21:52:51 +00:00
}
?>
==
{% set records = builderList.records %}
{% set displayColumn = builderList.displayColumn %}
{% set noRecordsMessage = builderList.noRecordsMessage %}
{% set detailsPage = builderList.detailsPage %}
{% set detailsKeyColumn = builderList.detailsKeyColumn %}
{% set detailsUrlParameter = builderList.detailsUrlParameter %}
{% set machines = builderList2.records %}
{% set types = builderList4.records %}
{% set sizes = builderList3.records %}
{% 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">
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
2023-12-18 20:54:55 +00:00
<form action="/machine/rulon-bags/filter" method="POST">
2023-12-15 21:52:51 +00:00
<div class="row">
<div class="col">
<div>
<label class="form-label">Seneleri Saýlaň</label>
<div class="input-daterange input-group" id="datepicker6"
data-date-format="d.m.yyyy" data-date-autoclose="true" data-provide="datepicker"
data-date-container='#datepicker6'>
<input type="text" class="form-control" name="start"
placeholder="Başlanýan sene" />
<input type="text" class="form-control" name="end"
placeholder="Gutarýan sene" />
</div>
</div>
</div>
<div class="col">
<button type="submit" class="btn btn-primary waves-effect waves-light"
style="margin-top: 30px;width: 100%;">Hasabat</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row" id="all_amount">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Rulon Halta</h3>
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;" data-page-length='13'>
<thead>
<tr>
2023-12-17 12:43:47 +00:00
<th colspan="7" style="background: #ccd9e3;">Gelen Rulon</th>
2023-12-15 21:52:51 +00:00
<th colspan="3" style="background: #c7e4fd;">Öndürlen Halta</th>
2023-12-17 12:43:47 +00:00
<th colspan="3" style="background: bisque;">Halta Sany</th>
2023-12-15 21:52:51 +00:00
<th colspan="2" style="background: #ffbbbb;">Jemi Öndürlen Halta</th>
<th>Turba agramy</th>
<th>Rulon Galyndysy</th>
<th rowspan="2">Brak %</th>
</tr>
<tr>
<th>NO</th>
<th>Sene</th>
<th>Stanok No</th>
<th>Reňki</th>
<th>Ini</th>
<th>Gram m2</th>
<th>Rulanyň agramy (kg)</th>
<th>Gramy</th>
<th>Ini</th>
<th>Boýy</th>
<th>Öndürlen Halta (arassa)</th>
<th>Öndürlen Halta (brak)</th>
<th>Sürülmedik</th>
<th>Sany</th>
<th>kg</th>
<th>kg</th>
<th>kg</th>
<!-- <th>Настройки</th> -->
</tr>
</thead>
<tbody>
2023-12-18 20:54:55 +00:00
{% set allCalc = 0 %}
{% set allCalcDefective = 0 %}
{% set allCalcDefectiveRep = 0 %}
{% set allCalcAmount = 0 %}
{% set allCalcKg = 0 %}
{% set pipeAllCalc = 0 %}
{% set allLeft = 0 %}
{% set allBrakPerc = 0 %}
2023-12-15 21:52:51 +00:00
2023-12-17 12:43:47 +00:00
{% for key, report in rulons %}
{% set sumOfBags = (report.amount + report.product.defective_bag_qty + report.product.defective_repair_qty) %}
{% set gramInkg = (report.product.bag_gram / 1000) %}
{% set allInKg = (sumOfBags * gramInkg) %}
2023-12-20 21:11:28 +00:00
{% set percentDefective = ((report.product.defective_bag_qty * 100) / sumOfBags) %}
2023-12-15 21:52:51 +00:00
2023-12-18 20:54:55 +00:00
{% set allCalc = (allCalc + report.amount) %}
{% set allCalcDefective = (allCalcDefective + report.product.defective_bag_qty) %}
{% set allCalcDefectiveRep = (allCalcDefectiveRep + report.product.defective_repair_qty) %}
{% set allCalcAmount = (allCalcAmount + sumOfBags) %}
{% set allCalcKg = (allCalcKg + allInKg) %}
{% set pipeAllCalc = (pipeAllCalc + report.product.pipe_weight) %}
{% set allLeft = (allLeft + report.product.pivot_sewer_lst.left_amount) %}
{% set allBrakPerc = (allBrakPerc + percentDefective) %}
2023-12-15 21:52:51 +00:00
<tr>
2023-12-17 12:43:47 +00:00
<td style="font-weight: bold;">{{key+1}}</td>
2023-12-18 20:54:55 +00:00
<td><a href="#" style="font-weight: bold;">{{report.product.rulon_action.product.date|date('d.m.Y')}}</a></td>
2023-12-17 12:43:47 +00:00
<td>{{report.product.rulon_action.product.machine.name}}</td>
<td>{{report.product.rulon_action.product.color.name}}</td>
<td>{{report.product.rulon_action.product.width}}</td>
<td>{{report.product.rulon_action.product.gram}}</td>
2023-12-20 21:11:28 +00:00
<td>{{report.product.rulon_action.product.brutto_kg}}</td>
2023-12-17 12:43:47 +00:00
<td>{{gramInkg}}</td>
<td>{{report.product.width}}</td>
<td>{{report.product.height}}</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">{{report.amount}}</span></td>
<td><span class="badge badge-soft-danger"
style="font-size: 14px;">{{report.product.defective_bag_qty}}</span></td>
<td><span class="badge badge-soft-warning"
style="font-size: 14px;">{{report.product.defective_repair_qty}}</span></td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">{{sumOfBags}}</span></td>
<td>{{allInKg}}</td>
<td>{{report.product.pipe_weight}}</td>
<td>{{report.product.pivot_sewer_lst.left_amount}}</td>
<td style="color: darkred;">{{percentDefective|number_format(2)}} %</td>
2023-12-15 21:52:51 +00:00
</tr>
{% endfor %}
</tbody>
2023-12-18 20:54:55 +00:00
<tfoot>
<tr>
<th colspan="10">JEMI</th>
<th>{{allCalc|number_format(2)}}</th>
<th>{{allCalcDefective|number_format(2)}}</th>
<th>{{allCalcDefectiveRep|number_format(2)}}</th>
<th>{{allCalcAmount|number_format(2)}}</th>
<th>{{allCalcKg|number_format(2)}}</th>
<th>{{pipeAllCalc|number_format(2)}}</th>
<th>{{allLeft|number_format(2)}}</th>
<th>{{allBrakPerc|number_format(2)}}</th>
</tr>
</tfoot>
</table>
<!-- <table class="table table-bordered dt-responsive nowrap">
2023-12-15 21:52:51 +00:00
<tfoot>
<tr>
2023-12-17 12:43:47 +00:00
<th>NO</th>
2023-12-15 21:52:51 +00:00
<th>Sene</th>
<th>Stanok No</th>
<th>Reňki</th>
<th>Ini</th>
<th>Gram m2</th>
2023-12-17 12:43:47 +00:00
<th>Rulanyň agramy (kg)</th>
2023-12-15 21:52:51 +00:00
<th>Gramy</th>
<th>Ini</th>
<th>Boýy</th>
<th>Öndürlen Halta (arassa)</th>
<th>Öndürlen Halta (brak)</th>
<th>Sürülmedik</th>
<th>Sany</th>
<th>kg</th>
2023-12-17 12:43:47 +00:00
<th>Turba Agramy</th>
<th>Rulon Galyndysy</th>
2023-12-15 21:52:51 +00:00
<th>Brak %</th>
</tr>
</tfoot>
2023-12-18 20:54:55 +00:00
</table> -->
2023-12-15 21:52:51 +00:00
</div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog"
aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" style="max-width: 1211px;">
<div class="modal-content" id="modal-form">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% partial 'dataTableJs' %}
{% put scripts %}
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
2023-12-20 21:11:28 +00:00
{% endput %}