production report2
This commit is contained in:
parent
7342265753
commit
d2a393e765
|
|
@ -57,9 +57,9 @@ return [
|
||||||
'engine' => 'InnoDB',
|
'engine' => 'InnoDB',
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'port' => 3306,
|
'port' => 3306,
|
||||||
'database' => 'gok_bakja',
|
'database' => 'gok_bakja_from_server',
|
||||||
'username' => 'root',
|
'username' => 'root',
|
||||||
'password' => '',
|
'password' => 'bt110226',
|
||||||
'charset' => 'utf8mb4',
|
'charset' => 'utf8mb4',
|
||||||
'collation' => 'utf8mb4_unicode_ci',
|
'collation' => 'utf8mb4_unicode_ci',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
|
|
|
||||||
|
|
@ -250,6 +250,15 @@ items:
|
||||||
isHidden: '0'
|
isHidden: '0'
|
||||||
cssClass: ''
|
cssClass: ''
|
||||||
isExternal: '0'
|
isExternal: '0'
|
||||||
|
-
|
||||||
|
title: 'Hasabat 2'
|
||||||
|
type: cms-page
|
||||||
|
code: extrudorProduction
|
||||||
|
reference: production/daily-seperate
|
||||||
|
viewBag:
|
||||||
|
isHidden: '0'
|
||||||
|
cssClass: ''
|
||||||
|
isExternal: '0'
|
||||||
-
|
-
|
||||||
title: 'Aýlar Boýunça'
|
title: 'Aýlar Boýunça'
|
||||||
nesting: null
|
nesting: null
|
||||||
|
|
@ -344,9 +353,13 @@ items:
|
||||||
isExternal: '0'
|
isExternal: '0'
|
||||||
-
|
-
|
||||||
title: 'Rulon Halta Hasabaty'
|
title: 'Rulon Halta Hasabaty'
|
||||||
|
nesting: null
|
||||||
type: cms-page
|
type: cms-page
|
||||||
|
url: null
|
||||||
code: productionRulon
|
code: productionRulon
|
||||||
reference: machine/rulon-bags
|
reference: machine/rulon-bags
|
||||||
|
cmsPage: null
|
||||||
|
replace: null
|
||||||
viewBag:
|
viewBag:
|
||||||
isHidden: '0'
|
isHidden: '0'
|
||||||
cssClass: ''
|
cssClass: ''
|
||||||
|
|
@ -406,9 +419,13 @@ items:
|
||||||
isExternal: '0'
|
isExternal: '0'
|
||||||
-
|
-
|
||||||
title: 'Görnüş Hasabaty'
|
title: 'Görnüş Hasabaty'
|
||||||
|
nesting: null
|
||||||
type: cms-page
|
type: cms-page
|
||||||
|
url: null
|
||||||
code: sewerProduction
|
code: sewerProduction
|
||||||
reference: actions/bag-report
|
reference: actions/bag-report
|
||||||
|
cmsPage: null
|
||||||
|
replace: null
|
||||||
viewBag:
|
viewBag:
|
||||||
isHidden: '0'
|
isHidden: '0'
|
||||||
cssClass: ''
|
cssClass: ''
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,286 @@
|
||||||
|
title = "production/daily-seperate"
|
||||||
|
url = "/production/daily-seperate/:month/:year?"
|
||||||
|
layout = "platform_main"
|
||||||
|
is_hidden = 0
|
||||||
|
==
|
||||||
|
<?php
|
||||||
|
function onStart() {
|
||||||
|
$currentDate = Carbon\Carbon::now();
|
||||||
|
$this["month"] = $this->param("month");
|
||||||
|
$year = $this->param("year");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if($this["month"] == 'default'){
|
||||||
|
$this["month"] = $currentDate->month;
|
||||||
|
}
|
||||||
|
|
||||||
|
$reportDatas = [];
|
||||||
|
|
||||||
|
$productionDates = Romanah\Gokbakja\Models\production::select('date', 'excruiter_id')
|
||||||
|
->whereMonth('date', $this["month"])
|
||||||
|
->whereYear('date', $currentDate->year)
|
||||||
|
->with('excruiter')
|
||||||
|
->groupBy('date')
|
||||||
|
->groupBy('excruiter_id')
|
||||||
|
->orderBy('date', 'ASC')
|
||||||
|
->distinct()
|
||||||
|
->get();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for ($x = 0; $x < count($productionDates); $x++) {
|
||||||
|
|
||||||
|
$sumDiff = Romanah\Gokbakja\Models\ProductionCalculate::where('date', $productionDates[$x]->date)->where('excruiter_id', $productionDates[$x]->excruiter_id);
|
||||||
|
$sumDiff2 = Romanah\Gokbakja\Models\ProductionCalculate::where('date', $productionDates[$x]->date)->where('excruiter_id', $productionDates[$x]->excruiter_id);
|
||||||
|
|
||||||
|
$shift1 = $sumDiff->where('shift_id', 1)->sum('amount_calc');
|
||||||
|
$shift2 = $sumDiff2->where('shift_id', 2)->sum('amount_calc');
|
||||||
|
|
||||||
|
$reportDatas[$x]["date"] = $productionDates[$x]->date;
|
||||||
|
$reportDatas[$x]["shift1"] = $shift1;
|
||||||
|
$reportDatas[$x]["shift2"] = $shift2;
|
||||||
|
$reportDatas[$x]["extrudor"] = $productionDates[$x]->excruiter->name;
|
||||||
|
$reportDatas[$x]["all_shift_calc"] = ($shift1 + $shift2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$products_all = $sumDiff->with('product')->groupBy('product_id')->get();
|
||||||
|
|
||||||
|
for ($xx = 0; $xx < count($products_all); $xx++) {
|
||||||
|
$sumDiffq = Romanah\Gokbakja\Models\ProductionCalculate::whereDate('date', $productionDates[$x]->date)->where('shift_id', 1)->where('excruiter_id', $productionDates[$x]->excruiter_id);
|
||||||
|
|
||||||
|
$sumDiff2q = Romanah\Gokbakja\Models\ProductionCalculate::whereDate('date', $productionDates[$x]->date)->where('shift_id', 2)->where('excruiter_id', $productionDates[$x]->excruiter_id);
|
||||||
|
|
||||||
|
$products_amount1 = $sumDiffq->where('product_id', $products_all[$xx]->product_id)->sum('amount_calc');
|
||||||
|
$products_amount2 = $sumDiff2q->where('product_id', $products_all[$xx]->product_id)->sum('amount_calc');
|
||||||
|
|
||||||
|
$reportDatas[$x]["products_shift1"][$xx]["product_code"] = $products_all[$xx]->product->code;
|
||||||
|
$reportDatas[$x]["products_shift1"][$xx]["product_value"] = $products_amount1;
|
||||||
|
|
||||||
|
$reportDatas[$x]["products_shift2"][$xx]["product_code"] = $products_all[$xx]->product->code;
|
||||||
|
$reportDatas[$x]["products_shift2"][$xx]["product_value"] = $products_amount2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$reportDatas[$x]["count_change1"] = $sumDiff->where('shift_id', 1)->groupBy('product_id')->count();
|
||||||
|
$reportDatas[$x]["count_change2"] = $sumDiff2->where('shift_id', 2)->groupBy('product_id')->count();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this["reportDatas"] = $reportDatas;
|
||||||
|
|
||||||
|
//dd($reportDatas);
|
||||||
|
|
||||||
|
if($year){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$reportDatas = [];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
==
|
||||||
|
{% 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" />
|
||||||
|
{% endput %}
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<!-- start page title -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="page-title-box d-flex align-items-center justify-content-between">
|
||||||
|
<h4 class="mb-0">Aýlar Boýunça {{year}}</h4>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<!-- Left sidebar -->
|
||||||
|
<div class="email-leftbar card">
|
||||||
|
<div class="mail-list mt-4">
|
||||||
|
<a href="/production/daily-seperate/1" class="{{ month == 1 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Ýanwar</a>
|
||||||
|
<a href="/production/daily-seperate/2" class="{{ month == 2 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Fewral</a>
|
||||||
|
<a href="/production/daily-seperate/3" class="{{ month == 3 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Mart</a>
|
||||||
|
<a href="/production/daily-seperate/4" class="{{ month == 4 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Aprel</a>
|
||||||
|
<a href="/production/daily-seperate/5" class="{{ month == 5 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Maý</a>
|
||||||
|
<a href="/production/daily-seperate/6" class="{{ month == 6 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Iýun</a>
|
||||||
|
<a href="/production/daily-seperate/7" class="{{ month == 7 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Iýul</a>
|
||||||
|
<a href="/production/daily-seperate/8" class="{{ month == 8 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Awgust</a>
|
||||||
|
<a href="/production/daily-seperate/9" class="{{ month == 9 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Sentýabr</a>
|
||||||
|
<a href="/production/daily-seperate/10" class="{{ month == 10 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Oktýabr</a>
|
||||||
|
<a href="/production/daily-seperate/11" class="{{ month == 11 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Noýabr</a>
|
||||||
|
<a href="/production/daily-seperate/12" class="{{ month == 12 ? 'active' : '' }}"><i
|
||||||
|
class="mdi mdi-archive me-2 font-size-16"></i> Dekabr</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- End Left sidebar -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Right Sidebar -->
|
||||||
|
<div class="email-rightbar mb-3">
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<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>
|
||||||
|
<th style="width: 5%;">№</th>
|
||||||
|
<th>Senesi</th>
|
||||||
|
<th>Ekstrudor</th>
|
||||||
|
<th>Smen</th>
|
||||||
|
<th>Mukdary (kg)</th>
|
||||||
|
<th>HARYTLAR (kg)</th>
|
||||||
|
<th>Jemi</th>
|
||||||
|
<th>Üýtgedilen</th>
|
||||||
|
<!-- <th>Настройки</th> -->
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% set all_calculate = 0 %}
|
||||||
|
{% set all_changed = 0 %}
|
||||||
|
|
||||||
|
{% for key, report in reportDatas %}
|
||||||
|
|
||||||
|
{% set all_calculate = (all_calculate + report.all_shift_calc) %}
|
||||||
|
{% set all_changed = (all_changed + (report.count_change1 + report.count_change2)) %}
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td style="font-weight: bold;">{{key + 1}}</td>
|
||||||
|
<td><a href="#" style="font-weight: bold;">{{report.date|date('d.m.Y')}}</a></td>
|
||||||
|
<td>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12" style="padding-bottom: 10px;">
|
||||||
|
<font style="font-weight: {{report.extrudor == 'Lorex' ? 'bold' : 'regular'}};">
|
||||||
|
{{report.extrudor}}
|
||||||
|
</font>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12" style="padding-bottom: 10px;">
|
||||||
|
Gündiz (1)
|
||||||
|
</div>
|
||||||
|
<div class="col-12" style="border-top: 1px solid gray;padding-top: 10px;">
|
||||||
|
Gije (2)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="color: darkgreen;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12" style="padding-bottom: 10px;">
|
||||||
|
{{report.shift1|number_format}}
|
||||||
|
</div>
|
||||||
|
<div class="col-12" style="border-top: 1px solid gray;padding-top: 10px;">
|
||||||
|
{{report.shift2|number_format}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="color: darkred;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="row">
|
||||||
|
{% for product_report1 in report.products_shift1 %}
|
||||||
|
<div class="col" style="padding-bottom: 10px;">
|
||||||
|
<font style="font-weight: bold;">
|
||||||
|
{{product_report1.product_code}}:</font>
|
||||||
|
{{product_report1.product_value|number_format}}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12" style="border-top: 1px solid gray;">
|
||||||
|
<div class="row">
|
||||||
|
{% for product_report2 in report.products_shift2 %}
|
||||||
|
<div class="col" style="padding-bottom: 10px;">
|
||||||
|
<font style="font-weight: bold;">
|
||||||
|
{{product_report2.product_code}}:</font>
|
||||||
|
{{product_report2.product_value|number_format}}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td style="color: darkgreen;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12" style="padding-bottom: 10px;">
|
||||||
|
{{report.all_shift_calc|number_format}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td style="color: darkred;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12" style="padding-bottom: 10px;">
|
||||||
|
{{report.count_change1}}
|
||||||
|
</div>
|
||||||
|
<div class="col-12" style="border-top: 1px solid gray;">
|
||||||
|
{{report.count_change2}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4">HEMMESI: </th>
|
||||||
|
<th>{{all_calculate|number_format}} kg</th>
|
||||||
|
<th>HARYTLAR</th>
|
||||||
|
<th>{{all_calculate|number_format}} kg</th>
|
||||||
|
<th>{{all_changed}}</th>
|
||||||
|
<!-- <th>Настройки</th> -->
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> <!-- card -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End row -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% partial 'dataTableJs' %}
|
||||||
|
|
@ -123,7 +123,7 @@ function onStart(){
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
<th>Senesi</th>
|
<th>Senesi</th>
|
||||||
<th>Smen</th>
|
<th>Smen</th>
|
||||||
<th>Ekskruiter</th>
|
<th>Ekstrudor</th>
|
||||||
<th>Hemmesi</th>
|
<th>Hemmesi</th>
|
||||||
<th>HARYTLAR</th>
|
<th>HARYTLAR</th>
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
|
|
@ -142,7 +142,7 @@ function onStart(){
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
<th>Senesi</th>
|
<th>Senesi</th>
|
||||||
<th>Smen</th>
|
<th>Smen</th>
|
||||||
<th>Ekskruiter</th>
|
<th>Ekstrudor</th>
|
||||||
<th>Hemmesi</th>
|
<th>Hemmesi</th>
|
||||||
<th>HARYTLAR</th>
|
<th>HARYTLAR</th>
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue