This commit is contained in:
Shohrat 2023-11-22 00:52:16 +05:00
parent 8db5048b22
commit 55c834c170
24 changed files with 475 additions and 123 deletions

View File

@ -39,19 +39,21 @@ class MachineProduction extends ComponentBase
$data = post();
$machinProdId = $data["machineProdId"];
$productions = PivotSewer::where("machine_production_id", $machinProdId)->with(["sewer_production", "machin_production"])->get();
$productions = PivotSewer::whereHas("rulon_action", function($q) use($machinProdId){
$q->where('product_id', $machinProdId);
})->with(["sewer_production", "rulon_action.product"])->get();
$machineProductionData = ProductionMachineModel::where('id', $machinProdId)->first();
$allBagQty = 0;
$allSpent = 0;
$allLeft = 0;
// var_dump(count($productions));
//dd(count($productions));
if (count($productions) == 0) {
$html_data = '';
} {
if (count($productions) > 0){
$html_data = '<div class="modal-header">
<h5 class="modal-title" id="mySmallModalLabel">#Rulon' . $machinProdId . ' Agramy: ' . $productions[0]->machin_production->produced_weight . ' kg</h5>
<h5 class="modal-title" id="mySmallModalLabel">#Rulon' . $machinProdId . ' Agramy: ' . $machineProductionData->produced_weight . ' kg</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
@ -81,16 +83,16 @@ class MachineProduction extends ComponentBase
$allLeft += $productions[$x]->left_amount;
$html_data .= '<tr>
<td>' . ($x + 1) . '</td>
<td>#Rulon' . $productions[$x]->machine_production_id . '</td>
<td>#Dikiş' . $productions[$x]->sewer_production_id . '</td>
<td>' . ($productions[$x]->sewer_production->date == null ? "" : Carbon::parse($productions[$x]->sewer_production->date)->format('d.m.Y')) . '</td>
<td>' . ($productions[$x]->sewer_production->produced_bag_qty) . '</td>
<td>' . $productions[$x]->amount . ' kg</td>
<td>' . $productions[$x]->spent_amount . ' kg</td>
<td>' . $productions[$x]->left_amount . ' kg</td>
<td>' . $productions[$x]->status . '</td>
</tr>';
<td>' . ($x + 1) . '</td>
<td>#Rulon' . $productions[$x]->machine_production_id . '</td>
<td>#Dikiş' . $productions[$x]->sewer_production_id . '</td>
<td>' . ($productions[$x]->sewer_production->date == null ? "" : Carbon::parse($productions[$x]->sewer_production->date)->format('d.m.Y')) . '</td>
<td>' . ($productions[$x]->sewer_production->produced_bag_qty) . '</td>
<td>' . $productions[$x]->amount . ' kg</td>
<td>' . $productions[$x]->spent_amount . ' kg</td>
<td>' . $productions[$x]->left_amount . ' kg</td>
<td>' . $productions[$x]->status . '</td>
</tr>';
}
$html_data .= '<tr style="background: #a2a9ff !important;">
<td colspan="4" style="font-weight: 700;color: black;">JEMI</td>
@ -102,6 +104,15 @@ class MachineProduction extends ComponentBase
</tr>';
$html_data .= '</table></div>';
}else{
$html_data = '<div class="modal-header">
<h5 class="modal-title" id="mySmallModalLabel">Maglumat Yok</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<p></p>
</div>';
}
@ -180,8 +191,18 @@ class MachineProduction extends ComponentBase
</div>
<div class="col-md-12 mt-3">
<label style="color: black;">Öndürlen önüm (kg)</label>
<input type="number" name="produced_weight" class="form-control"
placeholder="Mukdar (kg)" value="'.$production->produced_weight.'" '.($production->user_id != $user->id ? 'disabled' : '') .'>
<input type="number" name="produced_weight" step="0.01" class="form-control"
placeholder="Mukdar (kg)" value="'.($production->produced_weight ?? "").'" '.($production->user_id != $user->id ? 'disabled' : '') .'>
</div>
<div class="col-md-12 mt-3">
<label style="color: black;">Öndürlen önüm (metr)</label>
<input type="number" name="produced_length" step="0.01" class="form-control"
placeholder="Mukdar (metr)" value="'.($production->produced_length ?? "").'" '.($production->user_id != $user->id ? 'disabled' : '') .'>
</div>
<div class="col-md-12 mt-3">
<label style="color: black;">Othod (kg)</label>
<input type="number" name="defective_weight" step="0.01" class="form-control"
placeholder="Othod (kg)" value="'.($production->defective_weight ?? "").'" '.($production->user_id != $user->id ? 'disabled' : '') .'>
</div>
<div class="col-md-12 mt-3">
<label style="color: black;">Bellik</label>
@ -266,7 +287,13 @@ class MachineProduction extends ComponentBase
<td>' . $machineProductions[$x]->bag_type->name . '</td>
<td>' . ($machineProductions[$x]->color->name ?? "") . '</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight, 2) . ' kg</span>
</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_length, 2) . ' m</span>
</td>
<td><span class="badge badge-soft-danger"
style="font-size: 14px;">' . number_format($machineProductions[$x]->defective_weight, 2) . ' kg</span>
</td>
<td>' . $machineProductions[$x]->employee_name . '</td>
<td>' . $machineProductions[$x]->mechanic_name . '</td>
@ -287,12 +314,10 @@ class MachineProduction extends ComponentBase
$data = post();
$machineProductions = ProductionMachineModel::select('id', 'is_finished', 'type_id', 'size_id', 'machine_id', 'produced_weight', 'employee_id', 'mechanic_id', 'note', 'date', 'color_id', 'building_name', 'employee_name', 'mechanic_name')
->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])
->orderBy('id', 'DESC');
$machineProductionsCalc = ProductionMachineModel::select('id', 'is_finished', 'type_id', 'size_id', 'machine_id', 'produced_weight', 'employee_id', 'mechanic_id', 'note', 'date', 'color_id', 'building_name', 'employee_name', 'mechanic_name')
->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])
$machineProductionsCalc = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])
->orderBy('id', 'DESC');
$start = Carbon::parse($data["start"])->format('Y-m-d');
@ -334,81 +359,35 @@ class MachineProduction extends ComponentBase
}
$machineProductionsFiltered = $machineProductions->withCount([
'pivot_sewer AS leftSum' => function ($query) {
$query->select(DB::raw("(amount - SUM(spent_amount)) as leftSum"))->where('status', 'complated');
}
])
->withCount([
'pivot_sewer AS spentSum' => function ($query) {
$query->select(DB::raw("(SUM(spent_amount)) as spentSum"))->where('status', 'complated');
}
])->get();
$finishedRulons = $machineProductionsCalc->where('is_finished', 1)->count();
$leftAllRulons = (count($machineProductionsFiltered) - $finishedRulons);
// $pivotSewersWorking = PivotSewer::select('id', 'status', 'machine_production_id')
// ->where('status', 'working')
// ->get()
// ->pluck('machine_production_id')
// ->toArray();
$machineProductionsSum = $machineProductions->sum("produced_weight");
$machineLeftProductionsSum = 0;
$allSpent = 0;
$machineProductionsFiltered = $machineProductions->get();
$machineProductionsSum = $machineProductionsCalc->sum("produced_weight");
$machineProductionsDefectiveSum = $machineProductionsCalc->sum("defective_weight");
$html_data = '';
for ($x = 0; $x < count($machineProductionsFiltered); $x++) {
if ($machineProductionsFiltered[$x]->date != null) {
$dateFormat = $machineProductionsFiltered[$x]->date->format("d.m.Y");
} else {
$dateFormat = "";
}
$spent = '<span class="badge badge-soft-warning"
style="font-size: 14px;">' . number_format($machineProductionsFiltered[$x]->spentSum, 2) . ' kg</span>';
$left = number_format(($machineProductionsFiltered[$x]->produced_weight - $machineProductionsFiltered[$x]->spentSum), 2);
if ($left == 0) {
$left = 'Gutardy';
}
$allSpent += $machineProductionsFiltered[$x]->spentSum;
$machineLeftProductionsSum += ($machineProductionsFiltered[$x]->produced_weight - $machineProductionsFiltered[$x]->spentSum);
$html_data .= '<tr>
<td style="font-weight: bold;">' . ($x + 1) . '</td>
<td style="font-weight: bold;"><a type="button" data-request="onModalSetMachineData"
data-request-data="machineProdId: ' . $machineProductionsFiltered[$x]->id . '"
data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg"> #Rulon' . $machineProductionsFiltered[$x]->id . '</a></td>
<td><a href="#" style="font-weight: bold;">' . $dateFormat . '</a></td>
data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg" style="color: darkblue;"> #Rulon' . ($machineProductionsFiltered[$x]->id) . '</a></td>
<td><a href="#">' . ($machineProductionsFiltered[$x]->date == null ? "" : Carbon::parse($machineProductionsFiltered[$x]->date)->format('d.m.Y')) . '</a></td>
<td><a href="#" style="font-weight: bold;">' . $machineProductionsFiltered[$x]->building_name . '</a></td>
<td>' . $machineProductionsFiltered[$x]->machine->name . '</td>
<td>' . $machineProductionsFiltered[$x]->bag_size->name . '</td>
<td>' . $machineProductionsFiltered[$x]->bag_type->name . '</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">' . number_format($machineProductionsFiltered[$x]->produced_weight) . ' kg</span>
</td>
<td>
' . $spent . '
</td>
<td>' . ($machineProductionsFiltered[$x]->color->name ?? "") . '</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">' . $left . '</span>
style="font-size: 14px;">' . number_format($machineProductionsFiltered[$x]->produced_weight, 2) . ' kg</span>
</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">' . number_format($machineProductionsFiltered[$x]->produced_length, 2) . ' m</span>
</td>
<td><span class="badge badge-soft-danger"
style="font-size: 14px;">' . number_format($machineProductionsFiltered[$x]->defective_weight, 2) . ' kg</span>
</td>
<td>' . $machineProductionsFiltered[$x]->employee_name . '</td>
<td>' . $machineProductionsFiltered[$x]->mechanic_name . '</td>
<td>' . $machineProductionsFiltered[$x]->note . '</td>
@ -419,20 +398,28 @@ class MachineProduction extends ComponentBase
return [
'#machine_report_datas' => $html_data,
'#all_amount' => '
<div class="col-md-6">
<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;">Öndürlen Rulon: ' . count($machineProductionsFiltered) .'</h5>
</div>
</div>
</div>
<div class="col-md-6">
<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> Öndürlen: ' . number_format($machineProductionsSum, 2) . ' kg</h5>
</div>
</div>
</div>
<div class="col-md-4">
<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> Othod: ' . number_format($machineProductionsDefectiveSum, 2) . ' kg</h5>
</div>
</div>
</div>',
];
} else {
@ -463,6 +450,8 @@ class MachineProduction extends ComponentBase
$updateProductionMachine->machine_id = (int) $data["machine_id"];
$updateProductionMachine->color_id = (int) $data["color_id"];
$updateProductionMachine->produced_weight = $data["produced_weight"];
$updateProductionMachine->produced_length = $data["produced_length"];
$updateProductionMachine->defective_weight = $data["defective_weight"];
$updateProductionMachine->note = $data["note"];
$updateProductionMachine->date = Carbon::parse($data["date"])->format('Y-m-d');
@ -511,6 +500,8 @@ class MachineProduction extends ComponentBase
$createProductionMachine->machine_id = $data["machine_id"];
$createProductionMachine->color_id = $data["color_id"];
$createProductionMachine->produced_weight = $data["produced_weight"];
$createProductionMachine->produced_length = $data["produced_length"];
$createProductionMachine->defective_weight = $data["defective_weight"];
$createProductionMachine->note = $data["note"];
$createProductionMachine->date = Carbon::parse($data["date"])->format('Y-m-d');
$createProductionMachine->user_id = $user->id;

View File

@ -43,7 +43,7 @@ class Sewer extends ComponentBase
aria-label="Close"></button>
</div>
<div class="modal-body">
<form data-request="onUpdateSewerItem" method="POST" data-request-flash>
<form data-request="onUpdateSewerItem" method="POST" data-request-flash data-request-confirm="BRAK halta sanyna seretdinizmi?">
<div class="row">
<div class="col-md-12 mt-3">
@ -86,17 +86,22 @@ class Sewer extends ComponentBase
</div>
</div>
<div class="col-md-12 mt-3">
<label class="form-label">Tikinçi</label>
<input type="text" name="employee" class="form-control" value="' . $sewerProd->employee->name . '" disabled>
</div>
<div class="col-md-12 mt-3">
<div>
<label class="form-label">Tikilen Halta</label>
<input type="number" name="produced_bag_qty" class="form-control"
placeholder="tikilen halta sany" value="' . $sewerProd->produced_bag_qty . '" ' . ($sewerProd->pivot_sewer[0]->status == 'complated' ? "disabled" : "") . '>
placeholder="tikilen halta sany" value="' . ($sewerProd->produced_bag_qty ?? 0) . '" ' . ($sewerProd->pivot_sewer[0]->status == 'complated' ? "disabled" : "") . '>
</div>
</div>
<div class="col-md-12 mt-3">
<div>
<label class="form-label">BRAK Halta sany</label>
<input type="number" name="defective_bag_qty" class="form-control"
placeholder="brak halta sany" value="' . ($sewerProd->defective_bag_qty ?? 0) . '" ' . ($sewerProd->pivot_sewer[0]->status == 'complated' ? "disabled" : "") . '>
</div>
</div>
@ -142,17 +147,22 @@ class Sewer extends ComponentBase
// $spentCalc = (float)((float) $pivotSewer->amount - (float) $data["left_amount"]);
$spentCalc = (float)((float) $data["produced_bag_qty"] * (float) $pivotSewer->bag_gram) / 1000;
$spentCalcDefective = (float)((float) $data["defective_bag_qty"] * (float) $pivotSewer->bag_gram) / 1000;
$leftCalc = (float)((float)$pivotSewer->amount - $spentCalc);
$sewer->produced_bag_qty = (float) $data["produced_bag_qty"];
$sewer->defective_bag_qty = (float) $data["defective_bag_qty"];
$sewer->width = (float) $data["width"];
$sewer->height = (float) $data["height"];
$sewer->date = Carbon::parse($data["date"])->format('Y-m-d');
$sewer->note = $data["note"];
$sewer->save();
$pivotSewer->left_amount = (float) $leftCalc;
$pivotSewer->spent_amount = (float) $spentCalc;
$pivotSewer->left_amount = (float) ((float)$leftCalc - (float)$spentCalcDefective);
$pivotSewer->spent_amount = (float) ((float)$spentCalc + (float)$spentCalcDefective);
$pivotSewer->spent_defective_amount = (float) $spentCalcDefective;
$pivotSewer->status = $data["status"];
$pivotSewer->save();
@ -165,7 +175,7 @@ class Sewer extends ComponentBase
$createResult->status_accountant = "new";
$createResult->status_director = "new";
$createResult->note = "#Dikiş" . $sewer->id . " galyndy";
$createResult->amount = $pivotSewer->left_amount;
$createResult->amount = (float) $pivotSewer->left_amount;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->save();
@ -247,6 +257,9 @@ class Sewer extends ComponentBase
</div>
<div>
<a type="button"
data-request="onDeleteSewerItem"
data-request-data="sewerId: '.$sewerDatas[$x]->id.'"
data-request-confirm="#Dikiş'.$sewerDatas[$x]->id.' pozmak isleýäňizmi?"
class="btn btn-danger waves-effect waves-light"
style="padding-top: 5px;padding-bottom: 5px;">
<i class="ri-close-line align-middle me-2"></i> Poz
@ -264,14 +277,15 @@ class Sewer extends ComponentBase
<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><a href="#" style="font-weight: bold;">' . ($sewerDatas[$x]->employee_id == 0 ? 'Tikinçi ýok' : $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]->produced_bag_qty ?? 0) . '</td>
<td>' . ($sewerDatas[$x]->defective_bag_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"
@ -446,6 +460,7 @@ class Sewer extends ComponentBase
$createSewer = new SewerModel();
$createSewer->employee_id = $data["employee_id"];
$createSewer->produced_bag_qty = 0;
$createSewer->defective_bag_qty = 0;
$createSewer->user_id = $user->id;
$createSewer->note = $data["note"] ?? '';
$createSewer->rulon_action_id = $data["rulon_action_id"];
@ -481,4 +496,35 @@ class Sewer extends ComponentBase
return Redirect::refresh();
}
}
public function onDeleteSewerItem()
{
$data = post();
$user = \Auth::user();
$sewer = SewerModel::where("id", $data["sewerId"])->with(['pivot_sewer', 'rulon_action.product'])->first();
if($sewer){
$stock = Stock::where("type", 'rulon')->first();
$createResult = new RulonAction();
$createResult->product_id = $sewer->rulon_action->product_id;
$createResult->type = 'inbox';
$createResult->amount = (float)$sewer->pivot_sewer[0]->spent_amount;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->note = "#Dikiş".$sewer->id." maglumat girizidi, soňundan pozulan";
$createResult->save();
}
$sewer->delete();
if ($sewer) {
Flash::success("Dikish Ustunlikli Pozuldy");
return Redirect::refresh();
} else {
Flash::error("Yalnyshlyk bar!!");
return Redirect::refresh();
}
}
}

View File

@ -16,7 +16,7 @@ class PivotSewer extends Model
public $belongsTo = [
'sewer_production' => [
'Romanah\Gokbakja\Models\SewerProduction',
'key' => 'sewer_production_id'
'key' => 'sewer_production_id',
],
'rulon_action' => [
'Romanah\Gokbakja\Models\RulonAction',

View File

@ -18,7 +18,7 @@ class SewerProduction extends Model
'Romanah\Gokbakja\Models\PivotSewer',
'key' => 'sewer_production_id',
'softDelete' => true
],
]
];
public $belongsTo = [

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaPivotSewer5 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->double('spent_defective_amount', 10, 0);
});
}
public function down()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->dropColumn('spent_defective_amount');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaPivotSewer6 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->dropColumn('spent_defective_amount');
});
}
public function down()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->double('spent_defective_amount', 10, 0);
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaPivotSewer7 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->double('spent_defective_amount', 10, 0)->default(0);
});
}
public function down()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->dropColumn('spent_defective_amount');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaPivotSewer8 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->dropColumn('spent_defective_amount');
});
}
public function down()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->double('spent_defective_amount', 10, 0)->default(0);
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaPivotSewer9 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->double('spent_defective_amount', 10, 0)->nullable()->default(0);
});
}
public function down()
{
Schema::table('romanah_gokbakja_pivot_sewer', function($table)
{
$table->dropColumn('spent_defective_amount');
});
}
}

View File

@ -0,0 +1,25 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaProductionMachine12 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_production_machine', function($table)
{
$table->double('defective_weight', 10, 0)->nullable();
$table->double('produced_length', 10, 0)->nullable();
});
}
public function down()
{
Schema::table('romanah_gokbakja_production_machine', function($table)
{
$table->dropColumn('defective_weight');
$table->dropColumn('produced_length');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaRulonAction extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_rulon_action', function($table)
{
$table->double('amount_length', 10, 0)->nullable();
});
}
public function down()
{
Schema::table('romanah_gokbakja_rulon_action', function($table)
{
$table->dropColumn('amount_length');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaRulonAction2 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_rulon_action', function($table)
{
$table->dropColumn('amount_length');
});
}
public function down()
{
Schema::table('romanah_gokbakja_rulon_action', function($table)
{
$table->double('amount_length', 10, 0)->nullable();
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaSewerProduction9 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_sewer_production', function($table)
{
$table->double('defective_bag_qty', 10, 0)->nullable();
});
}
public function down()
{
Schema::table('romanah_gokbakja_sewer_production', function($table)
{
$table->dropColumn('defective_bag_qty');
});
}
}

View File

@ -360,3 +360,30 @@
1.0.121:
- 'Updated table romanah_gokbakja_order'
- builder_table_update_romanah_gokbakja_order_8.php
1.0.122:
- 'Updated table romanah_gokbakja_production_machine'
- builder_table_update_romanah_gokbakja_production_machine_12.php
1.0.123:
- 'Updated table romanah_gokbakja_sewer_production'
- builder_table_update_romanah_gokbakja_sewer_production_9.php
1.0.124:
- 'Updated table romanah_gokbakja_pivot_sewer'
- builder_table_update_romanah_gokbakja_pivot_sewer_5.php
1.0.125:
- 'Updated table romanah_gokbakja_pivot_sewer'
- builder_table_update_romanah_gokbakja_pivot_sewer_6.php
1.0.126:
- 'Updated table romanah_gokbakja_pivot_sewer'
- builder_table_update_romanah_gokbakja_pivot_sewer_7.php
1.0.127:
- 'Updated table romanah_gokbakja_pivot_sewer'
- builder_table_update_romanah_gokbakja_pivot_sewer_8.php
1.0.128:
- 'Updated table romanah_gokbakja_pivot_sewer'
- builder_table_update_romanah_gokbakja_pivot_sewer_9.php
1.0.129:
- 'Updated table romanah_gokbakja_rulon_action'
- builder_table_update_romanah_gokbakja_rulon_action.php
1.0.130:
- 'Updated table romanah_gokbakja_rulon_action'
- builder_table_update_romanah_gokbakja_rulon_action_2.php

View File

@ -28,6 +28,7 @@ function onStart(){
$this["crudSewerProduction"] = false;
$this["crudOrders"] = false;
$this["rawActions"] = false;
$this["journal"] = false;
$filteredData = array_where($acceptPermissions, function ($permission) {
return $permission['code'] == 'acceptDirector';
@ -61,6 +62,10 @@ function onStart(){
return $permission8['code'] == 'rawActionsCrud';
});
$filteredData9 = array_where($acceptPermissions, function ($permission9) {
return $permission9['code'] == 'journal';
});
if($filteredData){
$this["isDirector"] = true;
@ -94,6 +99,10 @@ function onStart(){
$this["rawActions"] = true;
}
if($filteredData9){
$this["journal"] = true;
}
}
}
?>

View File

@ -134,9 +134,17 @@ pageNumber = "{{ :page }}"
</select>
</div>
<div class="col">
<input type="number" name="produced_weight" class="form-control"
<input type="number" name="produced_weight" step="0.01" class="form-control"
placeholder="Mukdar (kg)">
</div>
<div class="col">
<input type="number" name="produced_length" step="0.01" class="form-control"
placeholder="Uzynlygy (metr)">
</div>
<div class="col">
<input type="number" name="defective_weight" step="0.01" class="form-control"
placeholder="Othod (kg)">
</div>
<div class="col">
<input type="text" name="note" class="form-control" placeholder="Bellik">
</div>
@ -188,6 +196,8 @@ pageNumber = "{{ :page }}"
<th>Rulon Görnüşi</th>
<th>Rulon Reňki</th>
<th>Önen Önüm (kg)</th>
<th>Önen Önüm (metr)</th>
<th>Othod (kg)</th>
<th>Ady Familiýasy</th>
<th>Mehanik</th>
<th>Bellik</th>
@ -209,6 +219,8 @@ pageNumber = "{{ :page }}"
<th>Rulon Görnüşi</th>
<th>Rulon Reňki</th>
<th>Önen Önüm (kg)</th>
<th>Önen Önüm (metr)</th>
<th>Othod (kg)</th>
<th>Ady Familiýasy</th>
<th>Mehanik</th>
<th>Bellik</th>

View File

@ -54,6 +54,8 @@ function onStart(){
<th style="width: 5%;"></th>
<th>Aýlar</th>
<th>Öndürlen Önüm</th>
<th>Öndürlen Önüm metr</th>
<th>Othod (kg)</th>
<!-- <th>Настройки</th> -->
</tr>
@ -79,8 +81,10 @@ function onStart(){
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Senesi</th>
<th>Hemmesi</th>
<th>Aýlar</th>
<th>Öndürlen Önüm</th>
<th>Öndürlen Önüm metr</th>
<th>Othod (kg)</th>
</tr>
</tfoot>

View File

@ -179,15 +179,16 @@ function onStart(){
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Kody</th>
<th>Sene</th>
<th>Önümçilik Kody</th>
<th>Öndürlen Sene</th>
<th>Bina No</th>
<th>Enjam No</th>
<th>Ölçegi</th>
<th>Görnüşi</th>
<th>Rulon Ölçegi</th>
<th>Rulon Görnüşi</th>
<th>Rulon Reňki</th>
<th>Önen Önüm (kg)</th>
<th>Ulanylan Önüm (kg)</th>
<th>Galan Önüm (kg)</th>
<th>Önen Önüm (metr)</th>
<th>Othod (kg)</th>
<th>Ady Familiýasy</th>
<th>Mehanik</th>
<th>Bellik</th>
@ -201,15 +202,16 @@ function onStart(){
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Kody</th>
<th>Sene</th>
<th>Önümçilik Kody</th>
<th>Öndürlen Sene</th>
<th>Bina No</th>
<th>Enjam No</th>
<th>Ölçegi</th>
<th>Görnüşi</th>
<th>Rulon Ölçegi</th>
<th>Rulon Görnüşi</th>
<th>Rulon Reňki</th>
<th>Önen Önüm (kg)</th>
<th>Ulanylan Önüm (kg)</th>
<th>Galan Önüm (kg)</th>
<th>Önen Önüm (metr)</th>
<th>Othod (kg)</th>
<th>Ady Familiýasy</th>
<th>Mehanik</th>
<th>Bellik</th>

View File

@ -16,6 +16,14 @@ function onStart(){
->groupBy('romanah_gokbakja_bag_actions.product_id')
->orderBy('id', 'DESC')
->get();
$this["actionsQtyCount"] = Romanah\Gokbakja\Models\BagAction::select('romanah_gokbakja_bag_actions.*')
->where("stock_id", $stockId)
->where("status_accountant", "accept")
->where("status_director", "accept")
->sum('amount');
// dd($this["actions"]);
}
?>
@ -45,7 +53,14 @@ function onStart(){
Dikilen Haltalar</h3>
<p class="card-title-desc" style="color: #6c6ff5;">sklad</p>
</div>
<div class="col-md-6">
<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 halta sany: {{actionsQtyCount}}</h5>
</div>
</div>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"

View File

@ -18,6 +18,16 @@ function onStart(){
->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"]);
}
?>
@ -42,12 +52,27 @@ function onStart(){
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<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"

View File

@ -19,8 +19,6 @@ function onStart(){
$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')
@ -171,6 +169,7 @@ function onStart(){
<th>Gram</th>
<th>Çig mal mukdary</th>
<th>Tikilen Halta</th>
<th>BRAK Halta</th>
<th>Ulanylan</th>
<th>Galyndy</th>
<th>Status</th>
@ -195,6 +194,7 @@ function onStart(){
<th>Gram</th>
<th>Çig mal mukdary</th>
<th>Tikilen Halta</th>
<th>BRAK Halta</th>
<th>Ulanylan</th>
<th>Galyndy</th>
<th>Status</th>

View File

@ -4,16 +4,16 @@
function onStart()
{
$link = $this->page["url"];
$this["journal"] = Romanah\Gokbakja\Models\Journal::where("is_read", 0)->count();
$this["journalCount"] = Romanah\Gokbakja\Models\Journal::where("is_read", 0)->count();
}
?>
==
<a href="/journal" class="dropdown d-inline-block">
<button type="button" class="btn header-item noti-icon waves-effect">
<i class="ri-notification-3-line"></i>
{% if journal > 0 %}
{% if journalCount > 0 %}
<span class="noti-dot"></span>
{% endif %}
</button>
</a>
</a>

View File

@ -56,7 +56,9 @@
</button>
</div>
{% partial 'bell' %}
{% if journal %}
{% partial 'bell' %}
{% endif %}
<div class="dropdown d-inline-block user-dropdown">
<button type="button" class="btn header-item waves-effect" id="page-header-user-dropdown"

View File

@ -9,6 +9,14 @@ function onStart (){
->whereYear('created_at', $year)
->sum('produced_weight');
$this["all_amount_length"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $no)
->whereYear('created_at', $year)
->sum('produced_length');
$this["all_amount_defective"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $no)
->whereYear('created_at', $year)
->sum('defective_weight');
}
?>
==
@ -16,5 +24,7 @@ function onStart (){
<td style="font-weight: bold;width: 5%;">{{no}}</td>
<td><a href="/get-all-machine-production-month/{{no}}" style="font-weight: bold;color: #0005c5;"> {{title}} </a></td>
<td><a href="/get-all-machine-production-month/{{no}}" style="font-weight: bold;"> {{all_amount|number_format}} kg</a></td>
<td><a href="/get-all-machine-production-month/{{no}}" style="font-weight: bold;"> {{all_amount_length|number_format}} metr</a></td>
<td><a href="/get-all-machine-production-month/{{no}}" style="font-weight: bold;"> {{all_amount_defective|number_format}} kg</a></td>
</tr>