sewer attributes
This commit is contained in:
parent
c67d1f8001
commit
be031751e0
|
|
@ -376,17 +376,30 @@ class Sewer extends ComponentBase
|
|||
|
||||
$start = Carbon::parse($data["start"])->format('Y-m-d');
|
||||
$end = Carbon::parse($data["end"])->format('Y-m-d');;
|
||||
$employee = $data["employee_id"];
|
||||
$min = $data["min"];
|
||||
$max = $data["max"];
|
||||
|
||||
$status = $data["status"];
|
||||
$width = $data["width"];
|
||||
$height = $data["height"];
|
||||
$color_id = $data["color_id"];
|
||||
$bag_gram = $data["bag_gram"];
|
||||
|
||||
$shift_id = $data["shift_id"];
|
||||
$sewer_machine_id = $data["sewer_machine_id"];
|
||||
|
||||
|
||||
|
||||
if ($shift_id) {
|
||||
$sewerProductions->where("shift_id", $shift_id);
|
||||
}
|
||||
|
||||
if ($sewer_machine_id) {
|
||||
$sewerProductions->where("sewer_machine_id", $sewer_machine_id);
|
||||
}
|
||||
|
||||
if ($shift_id) {
|
||||
$sewerProductions->where("shift_id", $shift_id);
|
||||
}
|
||||
|
||||
if ($height) {
|
||||
$sewerProductions->where("height", $height);
|
||||
}
|
||||
|
|
@ -395,9 +408,6 @@ class Sewer extends ComponentBase
|
|||
$sewerProductions->where("width", $width);
|
||||
}
|
||||
|
||||
if ($employee) {
|
||||
$sewerProductions->where("employee_id", $employee);
|
||||
}
|
||||
|
||||
if ($status) {
|
||||
$sewerProductions->with("pivot_sewer")->whereHas('pivot_sewer', function ($query) use ($status) {
|
||||
|
|
@ -419,14 +429,6 @@ class Sewer extends ComponentBase
|
|||
|
||||
|
||||
|
||||
if ($min) {
|
||||
$sewerProductions->whereRaw('produced_bag_qty >' . ($min - 1));
|
||||
}
|
||||
|
||||
if ($max) {
|
||||
$sewerProductions->whereRaw('produced_bag_qty <' . ($max + 1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($start != $currentDateFormat) {
|
||||
|
|
@ -439,6 +441,7 @@ class Sewer extends ComponentBase
|
|||
|
||||
$sewerProductionsSumBagQty = $sewerProductions->sum("produced_bag_qty");
|
||||
$sewerProductionsSumDefectiveBagQty = $sewerProductions->sum("defective_bag_qty");
|
||||
$sewerProductionsSumDefectiveBagQtyRepair = $sewerProductions->sum("defective_repair_qty");
|
||||
|
||||
$sewerProductionsamount = PivotSewer::whereIn("sewer_production_id", $sewerIds)->sum("spent_amount");
|
||||
// dd($sewerProductionsamount->spentAmount);
|
||||
|
|
@ -457,54 +460,64 @@ class Sewer extends ComponentBase
|
|||
|
||||
$html_data .= '<tr>
|
||||
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
||||
<td>' . $dateTitle . '</td>
|
||||
<td style="font-weight: bold;"> #Dikiş' . $sewerDatas[$x]->id . '</td>
|
||||
<td><span class="badge badge-soft-primary"
|
||||
style="font-size: 14px;">ini: ' . ($sewerDatas[$x]->width ?? "") . '- boyy:' . ($sewerDatas[$x]->height ?? "") . ' </span>
|
||||
</td>
|
||||
<td> #Rulon' . $sewerDatas[$x]->pivot_sewer[0]->rulon_action->product_id . '- ' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->bag_size->width ?? "") . 'x' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->bag_size->height ?? "") . 'm2, ' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->bag_type->name ?? "") . ', ' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->color->name ?? "") . '
|
||||
</td>
|
||||
<td><a href="#" style="font-weight: bold;">' . $sewerDatas[$x]->employee->name . '</a></td>
|
||||
<td>' . $dateTitle . '</td>
|
||||
<td>' . (number_format($sewerDatas[$x]->pivot_sewer[0]->bag_gram ?? 0, 2)) . ' gr</td>
|
||||
<td><span class="badge badge-soft-success"
|
||||
style="font-size: 14px;">' . number_format($sewerDatas[$x]->pivot_sewer[0]->amount, 2) . ' kg</span>
|
||||
</td>
|
||||
<td>' . $sewerDatas[$x]->produced_bag_qty . '</td>
|
||||
<td>' . ($sewerDatas[$x]->defective_bag_qty ?? ''). '</td>
|
||||
<td><span class="badge badge-soft-primary"
|
||||
style="font-size: 14px;">ini: ' . ($sewerDatas[$x]->width ?? "") . '- boyy:' . ($sewerDatas[$x]->height ?? "") . ' </span>
|
||||
</td>
|
||||
|
||||
|
||||
<td><a href="#" style="font-weight: bold;">' . ($sewerDatas[$x]->sewer_machine->name ?? "") . '</a></td>
|
||||
|
||||
|
||||
<td>' . (number_format($sewerDatas[$x]->pivot_sewer[0]->bag_gram ?? 0, 2)) . ' gr</td>
|
||||
|
||||
<td style="color: darkgreen !important;">' . ($sewerDatas[$x]->produced_bag_qty ?? 0) . '</td>
|
||||
<td style="color: darkred !important;">' . ($sewerDatas[$x]->defective_bag_qty ?? 0) . '</td>
|
||||
<td style="color: darkred !important;">' . ($sewerDatas[$x]->defective_repair_qty ?? 0) . '</td>
|
||||
<td>' . number_format($sewerDatas[$x]->pivot_sewer[0]->spent_amount, 2) . ' kg</td>
|
||||
<td>' . number_format($sewerDatas[$x]->pivot_sewer[0]->left_amount, 2) . ' kg</td>
|
||||
<td><span class="badge badge-soft-warning"
|
||||
style="font-size: 14px;">' . $statusTitle . '</span></td>
|
||||
<td>' . $sewerDatas[$x]->note . '</td>
|
||||
|
||||
<td>' . $sewerDatas[$x]->note . ' turba: '.$sewerDatas[$x]->pipe_weight.'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
if ($sewerDatas) {
|
||||
return [
|
||||
'#sewer_report_datas' => $html_data,
|
||||
'#all_amount' => '<div class="col-md-3">
|
||||
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Tikinçiler Boýunça Umumy</h3>
|
||||
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
|
||||
</div>
|
||||
'#all_amount' => '
|
||||
<div class="col-md-3">
|
||||
<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> Jemi Dikilen Halta: ' . number_format($sewerProductionsSumBagQty) . ' sany</h5>
|
||||
<h5 class="text-white" style="text-transform: uppercase;margin-bottom: 0;"><i class="mdi mdi-bullseye-arrow me-3"></i> Dikilen Halta: ' . number_format($sewerProductionsSumBagQty) . ' sany</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card bg-danger 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> Jemi BRAK Halta: ' . number_format($sewerProductionsSumDefectiveBagQty) . ' sany</h5>
|
||||
<h5 class="text-white" style="text-transform: uppercase;margin-bottom: 0;"><i class="mdi mdi-bullseye-arrow me-3"></i> BRAK Halta: ' . number_format($sewerProductionsSumDefectiveBagQty) . ' sany</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card bg-warning 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> Sürülmedik Halta: ' . number_format($sewerProductionsSumDefectiveBagQtyRepair) . ' sany</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<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> Jemi Sarp Edilen Çig mal: ' . number_format($sewerProductionsamount, 2) . ' kg</h5>
|
||||
<h5 class="text-white" style="text-transform: uppercase;margin-bottom: 0;"><i class="mdi mdi-bullseye-arrow me-3"></i> Sarp Edilen Çig mal: ' . number_format($sewerProductionsamount, 2) . ' kg</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>',
|
||||
|
|
|
|||
|
|
@ -178,10 +178,10 @@ function onStart(){
|
|||
<td rowspan="2">No</td>
|
||||
<th rowspan="2">Senesi</th>
|
||||
<th rowspan="2">Önümçilik No</th>
|
||||
<th colspan="2">Berilen Rulon</th>
|
||||
<th colspan="3">Halta Maglumaty</th>
|
||||
<th colspan="3">Tikilen Halta</th>
|
||||
<th colspan="2" >Ulanylan Rulon</th>
|
||||
<th colspan="2" style="background: #ccd9e3;">Berilen Rulon</th>
|
||||
<th colspan="3" style="background: #c7e4fd;">Halta Maglumaty</th>
|
||||
<th colspan="3" style="background: bisque;">Tikilen Halta</th>
|
||||
<th colspan="2" style="background: #ffbbbb;">Ulanylan Rulon</th>
|
||||
<th rowspan="2">Status</th>
|
||||
<th rowspan="2">Bellik</th>
|
||||
<th rowspan="2">Sazlamalar</th>
|
||||
|
|
@ -216,16 +216,16 @@ function onStart(){
|
|||
<th style="width: 5%;">№</th>
|
||||
<th>Senesi</th>
|
||||
<th>Önümçilik No</th>
|
||||
<th>Rulon Görnüş</th>
|
||||
<th>Çig mal mukdary</th>
|
||||
<th>Halta Görnüş</th>
|
||||
<th>Stanok</th>
|
||||
<th>Gram</th>
|
||||
<th>Halta (arassa)</th>
|
||||
<th>BRAK Halta</th>
|
||||
<th>Sürülmedik</th>
|
||||
<th>Ulanylan</th>
|
||||
<th>Galyndy</th>
|
||||
<th style="background: #ccd9e3;">Rulon Görnüş</th>
|
||||
<th style="background: #ccd9e3;">Çig mal mukdary</th>
|
||||
<th style="background: #c7e4fd;">Halta Görnüş</th>
|
||||
<th style="background: #c7e4fd;">Stanok</th>
|
||||
<th style="background: #c7e4fd;">Gram</th>
|
||||
<th style="background: bisque;">Halta (arassa)</th>
|
||||
<th style="background: bisque;">BRAK Halta</th>
|
||||
<th style="background: bisque;">Sürülmedik</th>
|
||||
<th style="background: #ffbbbb;">Ulanylan</th>
|
||||
<th style="background: #ffbbbb;">Galyndy</th>
|
||||
<th>Status</th>
|
||||
<th>Bellik</th>
|
||||
<th>Sazlamalar</th>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ is_hidden = 0
|
|||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
$this["shifts"] = Romanah\Gokbakja\Models\Shift::get();
|
||||
$this["sewerMachines"] = Romanah\Gokbakja\Models\SewerMachine::get();
|
||||
|
||||
$this["sewers"] = Romanah\Gokbakja\Models\Employee::where("status", 1)->where("is_sewer", 1)->get();
|
||||
|
||||
|
|
@ -38,11 +40,21 @@ function onStart(){
|
|||
<div class="row">
|
||||
|
||||
<div class="col">
|
||||
<label class="form-label">Tikinçi Saýlaň</label>
|
||||
<select class="form-control select2" name="employee_id">
|
||||
<label class="form-label">Smen Saýlaň</label>
|
||||
<select class="form-control select2" name="shift_id">
|
||||
<option value="0">Saýla</option>
|
||||
{% for sewer in sewers %}
|
||||
<option value="{{sewer.id}}">{{sewer.name}}</option>
|
||||
{% for shift in shifts %}
|
||||
<option value="{{shift.id}}">{{shift.desc}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<label class="form-label">Stanok Saýlaň</label>
|
||||
<select class="form-control select2" name="sewer_machine_id">
|
||||
<option value="0">Saýla</option>
|
||||
{% for sewerMachine in sewerMachines %}
|
||||
<option value="{{sewerMachine.id}}">{{sewerMachine.name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -103,18 +115,8 @@ function onStart(){
|
|||
</div>
|
||||
<div class="col">
|
||||
<label class="form-label">Halta Gram</label>
|
||||
<input name="bag_gram" class="form-control" placeholder="Halta gramy">
|
||||
<input name="bag_gram" type="number" class="form-control" placeholder="Halta gramy">
|
||||
</div>
|
||||
<div class="col">
|
||||
<label class="form-label">Minimum San</label>
|
||||
<input name="min" class="form-control" placeholder="Minimum Halta San">
|
||||
</div>
|
||||
<div class="col">
|
||||
<label class="form-label">Maximum San</label>
|
||||
<input name="max" class="form-control" placeholder="Maximum Halta San">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col">
|
||||
|
|
@ -151,20 +153,33 @@ function onStart(){
|
|||
style="border-collapse: collapse; border-spacing: 0; width: 100%;" data-page-length='13'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Önümçilik No</th>
|
||||
<th>Halta Görnüş</th>
|
||||
<td rowspan="2">No</td>
|
||||
<th rowspan="2">Senesi</th>
|
||||
<th rowspan="2">Önümçilik No</th>
|
||||
<th colspan="2" style="background: #ccd9e3;">Berilen Rulon</th>
|
||||
<th colspan="3" style="background: #c7e4fd;">Halta Maglumaty</th>
|
||||
<th colspan="3" style="background: bisque;">Tikilen Halta</th>
|
||||
<th colspan="2" style="background: #ffbbbb;">Ulanylan Rulon</th>
|
||||
<th rowspan="2">Status</th>
|
||||
<th rowspan="2">Bellik</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
|
||||
<th>Rulon Görnüş</th>
|
||||
<th>Tikinçi</th>
|
||||
<th>Senesi</th>
|
||||
<th>Gram</th>
|
||||
<th>Çig mal mukdary</th>
|
||||
<th>Tikilen Halta</th>
|
||||
<th>Halta Görnüş</th>
|
||||
|
||||
<th>Stanok</th>
|
||||
<th>Gram</th>
|
||||
|
||||
<th>Halta (arassa)</th>
|
||||
<th>BRAK Halta</th>
|
||||
<th>Sürülmedik</th>
|
||||
<th>Ulanylan</th>
|
||||
<th>Galyndy</th>
|
||||
<th>Status</th>
|
||||
<th>Bellik</th>
|
||||
|
||||
|
||||
<!-- <th>Настройки</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -175,17 +190,18 @@ function onStart(){
|
|||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 5%;">№</th>
|
||||
<th>Önümçilik No</th>
|
||||
<th>Halta Görnüş</th>
|
||||
<th>Rulon Görnüş</th>
|
||||
<th>Tikinçi</th>
|
||||
<th>Senesi</th>
|
||||
<th>Gram</th>
|
||||
<th>Çig mal mukdary</th>
|
||||
<th>Tikilen Halta</th>
|
||||
<th>BRAK Halta</th>
|
||||
<th>Ulanylan</th>
|
||||
<th>Galyndy</th>
|
||||
<th>Önümçilik No</th>
|
||||
<th style="background: #ccd9e3;">Rulon Görnüş</th>
|
||||
<th style="background: #ccd9e3;">Çig mal mukdary</th>
|
||||
<th style="background: #c7e4fd;">Halta Görnüş</th>
|
||||
<th style="background: #c7e4fd;">Stanok</th>
|
||||
<th style="background: #c7e4fd;">Gram</th>
|
||||
<th style="background: bisque;">Halta (arassa)</th>
|
||||
<th style="background: bisque;">BRAK Halta</th>
|
||||
<th style="background: bisque;">Sürülmedik</th>
|
||||
<th style="background: #ffbbbb;">Ulanylan</th>
|
||||
<th style="background: #ffbbbb;">Galyndy</th>
|
||||
<th>Status</th>
|
||||
<th>Bellik</th>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue