From 6967f9b66e7b64389ce13ebd8eb406aa942a8f93 Mon Sep 17 00:00:00 2001 From: Shohrat Date: Sat, 21 Oct 2023 02:54:07 +0500 Subject: [PATCH] sewer insert --- .../gokbakja/components/MachineProduction.php | 69 +++- .../gokbakja/components/Production.php | 2 +- plugins/romanah/gokbakja/components/Sewer.php | 307 ++++++++++++++---- .../romanah/gokbakja/models/PivotSewer.php | 37 +++ .../gokbakja/models/ProductionMachine.php | 11 + .../gokbakja/models/SewerProduction.php | 11 + ...le_create_romanah_gokbakja_pivot_sewer.php | 28 ++ ...le_update_romanah_gokbakja_pivot_sewer.php | 25 ++ ..._update_romanah_gokbakja_pivot_sewer_2.php | 23 ++ ...romanah_gokbakja_production_machine_10.php | 23 ++ ..._romanah_gokbakja_production_machine_7.php | 23 ++ ..._romanah_gokbakja_production_machine_8.php | 23 ++ ..._romanah_gokbakja_production_machine_9.php | 23 ++ ...date_romanah_gokbakja_sewer_production.php | 23 ++ ...te_romanah_gokbakja_sewer_production_2.php | 27 ++ ...te_romanah_gokbakja_sewer_production_3.php | 23 ++ ...te_romanah_gokbakja_sewer_production_4.php | 23 ++ plugins/romanah/gokbakja/updates/version.yaml | 33 ++ themes/gokbakja/meta/menus/aside.yaml | 13 + themes/gokbakja/pages/machine/machine.htm | 2 + themes/gokbakja/pages/machine/report.htm | 30 +- themes/gokbakja/pages/machine/rulon.htm | 224 +++++++++++++ themes/gokbakja/pages/sewer/new.htm | 87 ++++- 23 files changed, 993 insertions(+), 97 deletions(-) create mode 100644 plugins/romanah/gokbakja/models/PivotSewer.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_pivot_sewer.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer_2.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_10.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_7.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_8.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_9.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_2.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_3.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_4.php create mode 100644 themes/gokbakja/pages/machine/rulon.htm diff --git a/plugins/romanah/gokbakja/components/MachineProduction.php b/plugins/romanah/gokbakja/components/MachineProduction.php index 0ef72b9..4b49717 100644 --- a/plugins/romanah/gokbakja/components/MachineProduction.php +++ b/plugins/romanah/gokbakja/components/MachineProduction.php @@ -41,6 +41,7 @@ class MachineProduction extends ComponentBase // dd($machineProductions[0]->bag_size); $html_data .= ' ' . ($x + 1) . ' + #' . ($machineProductions[$x]->id) . ' ' . ($machineProductions[$x]->date == null ? "" : Carbon::parse($machineProductions[$x]->date)->format('d.m.Y')) . ' ' . $machineProductions[$x]->building_name . ' ' . $machineProductions[$x]->machine->name . ' @@ -68,7 +69,9 @@ class MachineProduction extends ComponentBase $data = post(); - $machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])->orderBy('id', 'DESC'); + $machineProductions = ProductionMachineModel::select('id', 'type_id', 'size_id', 'machine_id', 'produced_weight', 'employee_id', 'mechanic_id', 'note', 'date', 'color_id', 'left_weight', 'building_name', 'employee_name', 'mechanic_name') + ->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color']) + ->orderBy('id', 'DESC'); $start = Carbon::parse($data["start"])->format('Y-m-d'); $end = Carbon::parse($data["end"])->format('Y-m-d'); @@ -98,22 +101,43 @@ class MachineProduction extends ComponentBase $machineProductions->whereBetween('date', [$start, $end]); } - $machineProductionsFiltered = $machineProductions->get(); + $machineProductionsFiltered = $machineProductions->selectRaw('produced_weight - left_weight as spent')->get(); $machineProductionsSum = $machineProductions->sum("produced_weight"); + $machineLeftProductionsSum = $machineProductions->sum("left_weight"); + $allSpent = $machineProductionsSum - $machineLeftProductionsSum; $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 = '' . number_format($machineProductionsFiltered[$x]->spent) . ' kg'; + + $html_data .= ' ' . ($x + 1) . ' - ' . $machineProductionsFiltered[$x]->created_at->format("d.m.Y") . ' + ' . $dateFormat . ' ' . $machineProductionsFiltered[$x]->building_name . ' ' . $machineProductionsFiltered[$x]->machine->name . ' ' . $machineProductionsFiltered[$x]->bag_size->name . ' ' . $machineProductionsFiltered[$x]->bag_type->name . ' - ' . number_format($machineProductionsFiltered[$x]->produced_weight) . ' kg + + '.$spent.' + + ' . number_format($machineProductionsFiltered[$x]->left_weight) . ' kg + + ' . $machineProductionsFiltered[$x]->employee_name . ' ' . $machineProductionsFiltered[$x]->mechanic_name . ' ' . $machineProductionsFiltered[$x]->note . ' @@ -123,10 +147,38 @@ class MachineProduction extends ComponentBase if ($machineProductionsFiltered) { return [ '#machine_report_datas' => $html_data, - '#all_amount' => '
-
-
Jemi Öndürlen Önüm: '.number_format($machineProductionsSum).' kg
+ '#all_amount' => ' +
+
+
+
Rulon: '.count($machineProductionsFiltered).'
+
+
+
+
+
+
+
Öndürlen: '.number_format($machineProductionsSum).' kg
+
+
+
+
+
+
+
Sklatda: '.number_format($machineLeftProductionsSum).' kg
+ +
+
+
+
+
+
+
Ulanylan: '.number_format($allSpent).' kg
+
', ]; @@ -159,6 +211,7 @@ class MachineProduction extends ComponentBase $createProductionMachine->note = $data["note"]; $createProductionMachine->date = Carbon::parse($data["date"])->format('Y-m-d'); $createProductionMachine->user_id = $user->id; + $createProductionMachine->left_weight = $data["produced_weight"]; $createProductionMachine->save(); $productionMachine = ProductionMachineModel::where('id', $createProductionMachine->id)->with(['machine.employee', 'machine.mechanic', 'machine.building'])->first(); diff --git a/plugins/romanah/gokbakja/components/Production.php b/plugins/romanah/gokbakja/components/Production.php index 46dc97e..533bcf2 100644 --- a/plugins/romanah/gokbakja/components/Production.php +++ b/plugins/romanah/gokbakja/components/Production.php @@ -100,7 +100,7 @@ class Production extends ComponentBase // dd($productionsFiltered[0]->shift->desc); $html_data .= ' ' . ($x + 1) . ' - ' . $productionsFiltered[$x]->created_at->format("d.m.Y | H:i") . ' + ' . $productionsFiltered[$x]->date->format("d.m.Y | H:i") . ' ' . $productionsFiltered[$x]->shift->desc . ' sewers = $this->loadSewers(); // } + public function onModalSetSewer() + { + + $data = post(); + + $sewerProd = SewerModel::where("id", $data["sewerId"])->with("employee", "pivot_sewer")->first(); + + $html_data = ' + '; + + return [ + '#modal-form' => $html_data, + ]; + } + + public function onUpdateSewerItem() + { + $currentDate = Carbon::now()->timezone('UTC +05:00'); + + $currentDateFormat = $currentDate->format('Y-m-d'); + + $data = post(); + + $sewer = SewerModel::where("id", $data["sewer_id"])->first(); + $pivotSewer = PivotSewer::where("sewer_production_id", $data["sewer_id"])->first(); + + $spentCalc = (float)((float) $pivotSewer->amount - (float) $data["left_amount"]); + + $sewer->produced_bag_qty = (float) $data["produced_bag_qty"]; + $sewer->width = (float) $data["width"]; + $sewer->height = (float) $data["height"]; + $sewer->note = $data["note"]; + $sewer->save(); + + $pivotSewer->left_amount = (float) $data["left_amount"]; + $pivotSewer->spent_amount = (float) $spentCalc; + $pivotSewer->status = $data["status"]; + $pivotSewer->save(); + + if($data["left_amount"] == 0){ + $machinProduction = ProductionMachine::where("id", $pivotSewer->machine_production_id)->first(); + $machinProduction->is_finished = true; + $machinProduction->save(); + } + + if ($sewer) { + + Flash::success("Maglumatlar Ustunlikli Üýtgedildi"); + return Redirect::refresh(); + } else { + return Flash::error("Yalnyshlyk bar!!"); + return Redirect::refresh(); + } + } + + public function onRender() + { $html_data = ''; - $sewerDatas = SewerModel::with("employee")->orderBy('id', 'DESC')->get(); - + $sewerDatas = SewerModel::with(["employee", "machin_production.bag_size", "machin_production.bag_type", "machin_production.color", "pivot_sewer"])->orderBy('id', 'DESC')->get(); + // dd($sewerDatas); for ($x = 0; $x < count($sewerDatas); $x++) { + $statusTitle = ''; + if($sewerDatas[$x]->pivot_sewer[0]->status == "working"){ + $statusTitle = "Işlenilýär"; + }else{ + $statusTitle = "Tamamlandy"; + } + $html_data .= ' - '.($x+1).' - '.$sewerDatas[$x]->employee->name.' - '.$sewerDatas[$x]->created_at->format('d.m.Y').' - '.$sewerDatas[$x]->amount.' kg + ' . ($x + 1) . ' + #' . $sewerDatas[$x]->id . ' + ini: ' . ($sewerDatas[$x]->width ?? "") . '- boyy:'. ($sewerDatas[$x]->height ?? "") .' + + #'.$sewerDatas[$x]->machin_production->id.'- ' . ($sewerDatas[$x]->machin_production->bag_size->width ?? "") . 'x' .($sewerDatas[$x]->machin_production->bag_size->height ?? "").'m2, '.($sewerDatas[$x]->machin_production->bag_type->name ?? "") .', '.($sewerDatas[$x]->machin_production->color->name ?? "").' + + ' . $sewerDatas[$x]->employee->name . ' + ' . $sewerDatas[$x]->created_at->format('d.m.Y') . ' + ' . number_format($sewerDatas[$x]->pivot_sewer[0]->amount, 2) . ' kg + + ' . $sewerDatas[$x]->produced_bag_qty . ' + ' . number_format($sewerDatas[$x]->pivot_sewer[0]->spent_amount, 2) . ' kg + ' . number_format($sewerDatas[$x]->pivot_sewer[0]->left_amount, 2) . ' kg + ' . $statusTitle . ' + ' . $sewerDatas[$x]->note . ' + + - '.$sewerDatas[$x]->produced_bag_qty.' - '.$sewerDatas[$x]->note.' '; } @@ -77,19 +246,19 @@ class Sewer extends ComponentBase $sewerProductions->where("employee_id", $employee); } - if ($min){ - $sewerProductions->whereRaw('produced_bag_qty >'.$min); + if ($min) { + $sewerProductions->whereRaw('produced_bag_qty >' . $min); } - if ($max){ - $sewerProductions->whereRaw('produced_bag_qty <'.$max); + if ($max) { + $sewerProductions->whereRaw('produced_bag_qty <' . $max); } - if ($amount){ - $sewerProductions->whereRaw('amount <='.$amount); + if ($amount) { + $sewerProductions->whereRaw('amount <=' . $amount); } - if ($start != $currentDateFormat){ + if ($start != $currentDateFormat) { $sewerProductions->whereBetween('created_at', [$start, $end]); } @@ -97,48 +266,46 @@ class Sewer extends ComponentBase $sewerProductionsSumBagQty = $sewerProductions->sum("produced_bag_qty"); $sewerProductionsamount = $sewerProductions->sum("amount"); - $html_data = ''; + $html_data = ''; - for ($x = 0; $x < count($sewerProductionsFiltered); $x++) { - $html_data .= ' - '.($x+1).' - '.$sewerProductionsFiltered[$x]->employee->name.' - '.$sewerProductionsFiltered[$x]->created_at->format('d.m.Y').' + for ($x = 0; $x < count($sewerProductionsFiltered); $x++) { + $html_data .= ' + ' . ($x + 1) . ' + ' . $sewerProductionsFiltered[$x]->employee->name . ' + ' . $sewerProductionsFiltered[$x]->created_at->format('d.m.Y') . ' '.$sewerProductionsFiltered[$x]->amount.' kg + style="font-size: 14px;">' . $sewerProductionsFiltered[$x]->amount . ' kg - '.$sewerProductionsFiltered[$x]->produced_bag_qty.' - '.$sewerProductionsFiltered[$x]->note.' + ' . $sewerProductionsFiltered[$x]->produced_bag_qty . ' + ' . $sewerProductionsFiltered[$x]->note . ' '; - } + } - if ($sewerProductionsFiltered) { - return [ - '#sewer_report_datas' => $html_data, - '#all_amount' => '
+ if ($sewerProductionsFiltered) { + return [ + '#sewer_report_datas' => $html_data, + '#all_amount' => '

Tikinçiler Boýunça Umumy

Hasabat

-
Jemi Dikilen Halta: '.number_format($sewerProductionsSumBagQty).' sany
+
Jemi Dikilen Halta: ' . number_format($sewerProductionsSumBagQty) . ' sany
-
Jemi Sarp Edilen Çig mal: '.number_format($sewerProductionsamount).' kg
+
Jemi Sarp Edilen Çig mal: ' . number_format($sewerProductionsamount) . ' kg
', - ]; - } else { - Flash::error("Yalnyshlyk bar!!"); - } - - + ]; + } else { + Flash::error("Yalnyshlyk bar!!"); + } } public function onCreateSewerProduction() @@ -149,43 +316,47 @@ class Sewer extends ComponentBase $data = post(); + $machineProduction = ProductionMachine::where("id", $data["machine_production_id"])->first(); + + $machineProductionSpent = PivotSewer::where("machine_production_id", $data["machine_production_id"])->sum('spent_amount'); + + $leftAmount = 0; + if($machineProduction->produced_weight > $machineProductionSpent){ + $calcLeft = ((float) $machineProduction->produced_weight - (float) $machineProductionSpent); + + $leftAmount = $calcLeft; + }elseif($machineProduction->produced_weight == $machineProductionSpent){ + $leftAmount = 0; + }else{ + $leftAmount = 0; + } + + // dd($leftAmount); + $createSewer = new SewerModel(); $createSewer->employee_id = $data["employee_id"]; - $createSewer->amount = $data["amount"]; - $createSewer->produced_bag_qty = $data["produced_bag_qty"]; - $createSewer->note = $data["note"]; + $createSewer->produced_bag_qty = 0; + $createSewer->note = $data["note"] ?? ''; + $createSewer->machine_production_id = $data["machine_production_id"]; + $createSewer->width = (float) $data["width"]; + $createSewer->height = (float) $data["height"]; $createSewer->save(); + $createPivotSewer = new PivotSewer(); + $createPivotSewer->machine_production_id = $createSewer->machine_production_id; + $createPivotSewer->sewer_production_id = $createSewer->id; + $createPivotSewer->left_amount = 0; + $createPivotSewer->amount = $leftAmount; + $createPivotSewer->save(); - $html_data = ''; - $sewerDatas = SewerModel::with("employee")->orderBy('id', 'DESC')->get(); + if ($createSewer && $createPivotSewer) { - for ($x = 0; $x < count($sewerDatas); $x++) { - $html_data .= ' - '.($x+1).' - '.$sewerDatas[$x]->employee->name.' - '.$sewerDatas[$x]->created_at->format('d.m.Y').' - '.$sewerDatas[$x]->amount.' kg - - '.$sewerDatas[$x]->produced_bag_qty.' - '.$sewerDatas[$x]->note.' - '; - } - - if($createSewer){ - - Flash::success("Hasabat Ustunlikli Goşuldy"); - return [ - '#sewer_datas' => $html_data, - ]; - }else{ + Flash::success("Maglumatlar Ustunlikli Goshuldy"); + return Redirect::refresh(); + } else { return Flash::error("Yalnyshlyk bar!!"); + return Redirect::refresh(); } - - } - - } diff --git a/plugins/romanah/gokbakja/models/PivotSewer.php b/plugins/romanah/gokbakja/models/PivotSewer.php new file mode 100644 index 0000000..6bbc311 --- /dev/null +++ b/plugins/romanah/gokbakja/models/PivotSewer.php @@ -0,0 +1,37 @@ + [ + 'Romanah\Gokbakja\Models\SewerProduction', + 'key' => 'sewer_production_id' + ], + 'machin_production' => [ + 'Romanah\Gokbakja\Models\ProductionMachine', + 'key' => 'machine_production_id' + ], + ]; + + /** + * @var string The database table used by the model. + */ + public $table = 'romanah_gokbakja_pivot_sewer'; + + /** + * @var array Validation rules + */ + public $rules = [ + ]; +} diff --git a/plugins/romanah/gokbakja/models/ProductionMachine.php b/plugins/romanah/gokbakja/models/ProductionMachine.php index 32ed8ac..a49fdf3 100644 --- a/plugins/romanah/gokbakja/models/ProductionMachine.php +++ b/plugins/romanah/gokbakja/models/ProductionMachine.php @@ -13,6 +13,17 @@ class ProductionMachine extends Model protected $dates = ['deleted_at', 'date']; + public $hasMany = [ + 'sewer_productions' => [ + 'Romanah\Gokbakja\Models\SewerProduction', + 'key' => 'machine_production_id' + ], + 'pivot_sewer' => [ + 'Romanah\Gokbakja\Models\PivotSewer', + 'key' => 'machine_production_id' + ], + ]; + public $belongsTo = [ 'bag_type' => [ 'Romanah\Gokbakja\Models\BagType', diff --git a/plugins/romanah/gokbakja/models/SewerProduction.php b/plugins/romanah/gokbakja/models/SewerProduction.php index a0f705e..04f8165 100644 --- a/plugins/romanah/gokbakja/models/SewerProduction.php +++ b/plugins/romanah/gokbakja/models/SewerProduction.php @@ -13,11 +13,22 @@ class SewerProduction extends Model protected $dates = ['deleted_at']; + public $hasMany = [ + 'pivot_sewer' => [ + 'Romanah\Gokbakja\Models\PivotSewer', + 'key' => 'sewer_production_id' + ], + ]; + public $belongsTo = [ 'employee' => [ 'Romanah\Gokbakja\Models\Employee', 'key' => 'employee_id' ], + 'machin_production' => [ + 'Romanah\Gokbakja\Models\ProductionMachine', + 'key' => 'machine_production_id' + ], ]; /** diff --git a/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_pivot_sewer.php b/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_pivot_sewer.php new file mode 100644 index 0000000..07b6f35 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_pivot_sewer.php @@ -0,0 +1,28 @@ +engine = 'InnoDB'; + $table->increments('id')->unsigned(); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + $table->timestamp('deleted_at')->nullable(); + $table->integer('sewer_production_id'); + $table->integer('machine_production_id'); + $table->string('status')->default('working'); + $table->string('note')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('romanah_gokbakja_pivot_sewer'); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer.php new file mode 100644 index 0000000..556cace --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer.php @@ -0,0 +1,25 @@ +double('left_amount', 10, 0)->default(0); + $table->double('amount', 10, 0)->default(0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_pivot_sewer', function($table) + { + $table->dropColumn('left_amount'); + $table->dropColumn('amount'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer_2.php new file mode 100644 index 0000000..012702f --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_sewer_2.php @@ -0,0 +1,23 @@ +double('spent_amount', 10, 0)->default(0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_pivot_sewer', function($table) + { + $table->dropColumn('spent_amount'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_10.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_10.php new file mode 100644 index 0000000..c78b951 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_10.php @@ -0,0 +1,23 @@ +boolean('is_finished')->default(0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('is_finished'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_7.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_7.php new file mode 100644 index 0000000..dace8d4 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_7.php @@ -0,0 +1,23 @@ +double('left_weight', 10, 0)->default(0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('left_weight'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_8.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_8.php new file mode 100644 index 0000000..b5a9c18 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_8.php @@ -0,0 +1,23 @@ +dropColumn('left_weight'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->double('left_weight', 10, 0)->default(0); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_9.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_9.php new file mode 100644 index 0000000..3244b60 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_9.php @@ -0,0 +1,23 @@ +double('left_weight', 10, 0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('left_weight'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production.php new file mode 100644 index 0000000..d0c45f6 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production.php @@ -0,0 +1,23 @@ +integer('machine_production_id'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_sewer_production', function($table) + { + $table->dropColumn('machine_production_id'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_2.php new file mode 100644 index 0000000..f36cf87 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_2.php @@ -0,0 +1,27 @@ +double('left_amount', 10, 0); + $table->double('width', 10, 0); + $table->double('height', 10, 0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_sewer_production', function($table) + { + $table->dropColumn('left_amount'); + $table->dropColumn('width'); + $table->dropColumn('height'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_3.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_3.php new file mode 100644 index 0000000..e186914 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_3.php @@ -0,0 +1,23 @@ +dropColumn('left_amount'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_sewer_production', function($table) + { + $table->double('left_amount', 10, 0); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_4.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_4.php new file mode 100644 index 0000000..03b0ec3 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_sewer_production_4.php @@ -0,0 +1,23 @@ +dropColumn('amount'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_sewer_production', function($table) + { + $table->double('amount', 10, 0); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/version.yaml b/plugins/romanah/gokbakja/updates/version.yaml index 6047a62..23ed58b 100644 --- a/plugins/romanah/gokbakja/updates/version.yaml +++ b/plugins/romanah/gokbakja/updates/version.yaml @@ -240,3 +240,36 @@ 1.0.81: - 'Updated table romanah_gokbakja_production_calculate' - builder_table_update_romanah_gokbakja_production_calculate_6.php +1.0.82: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_7.php +1.0.83: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_8.php +1.0.84: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_9.php +1.0.85: + - 'Updated table romanah_gokbakja_sewer_production' + - builder_table_update_romanah_gokbakja_sewer_production.php +1.0.86: + - 'Updated table romanah_gokbakja_sewer_production' + - builder_table_update_romanah_gokbakja_sewer_production_2.php +1.0.87: + - 'Created table romanah_gokbakja_pivot_sewer' + - builder_table_create_romanah_gokbakja_pivot_sewer.php +1.0.88: + - 'Updated table romanah_gokbakja_sewer_production' + - builder_table_update_romanah_gokbakja_sewer_production_3.php +1.0.89: + - 'Updated table romanah_gokbakja_pivot_sewer' + - builder_table_update_romanah_gokbakja_pivot_sewer.php +1.0.90: + - 'Updated table romanah_gokbakja_sewer_production' + - builder_table_update_romanah_gokbakja_sewer_production_4.php +1.0.91: + - 'Updated table romanah_gokbakja_pivot_sewer' + - builder_table_update_romanah_gokbakja_pivot_sewer_2.php +1.0.92: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_10.php diff --git a/themes/gokbakja/meta/menus/aside.yaml b/themes/gokbakja/meta/menus/aside.yaml index a0c11b1..9c91d93 100644 --- a/themes/gokbakja/meta/menus/aside.yaml +++ b/themes/gokbakja/meta/menus/aside.yaml @@ -171,6 +171,15 @@ items: isHidden: '0' cssClass: '' isExternal: '0' + - + title: 'Rulonlar Sklady' + type: cms-page + code: '' + reference: machine/rulon + viewBag: + isHidden: '1' + cssClass: '' + isExternal: '0' - title: Hasabat nesting: null @@ -305,9 +314,13 @@ items: isExternal: '0' - title: Tölegler + nesting: null type: cms-page + url: null code: '' reference: orders/payment-report + cmsPage: null + replace: null viewBag: isHidden: '1' cssClass: '' diff --git a/themes/gokbakja/pages/machine/machine.htm b/themes/gokbakja/pages/machine/machine.htm index 433161b..aab8952 100644 --- a/themes/gokbakja/pages/machine/machine.htm +++ b/themes/gokbakja/pages/machine/machine.htm @@ -173,6 +173,7 @@ pageNumber = "{{ :page }}" № + Önümçilik Kody Öndürlen Sene Bina No Enjam No @@ -192,6 +193,7 @@ pageNumber = "{{ :page }}" № + Önümçilik Kody Öndürlen Sene Bina No Enjam No diff --git a/themes/gokbakja/pages/machine/report.htm b/themes/gokbakja/pages/machine/report.htm index ce6e5ff..de13a37 100644 --- a/themes/gokbakja/pages/machine/report.htm +++ b/themes/gokbakja/pages/machine/report.htm @@ -82,6 +82,16 @@ function onStart(){
+ +
+ + +
@@ -96,15 +106,6 @@ function onStart(){
-
- - -
+ + {% for machine in machines %} + + {% endfor %} + +
+
+
+ + +
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+ +
+ + +
+
+
+ + +
+
+
+
+
+
+

Rulonlar boýunça

+

Hasabat

+ +
+ + +
+

{{m_productions}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AdyRulon ÖlçegiRulon GörnüşiRulon ReňkiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
Öndürlen SeneBina NoEnjam NoRulon ÖlçegiRulon GörnüşiRulon ReňkiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
+
+ + + +
+
+
+ + + +{% put scripts %} + + + +{% endput %} + +{% partial 'dataTableJs' %} diff --git a/themes/gokbakja/pages/sewer/new.htm b/themes/gokbakja/pages/sewer/new.htm index d2fbcae..1736e42 100644 --- a/themes/gokbakja/pages/sewer/new.htm +++ b/themes/gokbakja/pages/sewer/new.htm @@ -8,6 +8,26 @@ is_hidden = 0 where("is_sewer", 1)->get(); + + $pivotSewersWorking = Romanah\Gokbakja\Models\PivotSewer::select('id', 'status', 'machine_production_id') + ->where('status', 'working') + ->get() + ->pluck('machine_production_id') + ->toArray(); + + + //dd($pivotSewersWorking); + + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color']) + ->whereNotIn('id', $pivotSewersWorking) + ->where('is_finished', '!=', 1) + ->withCount([ + 'pivot_sewer AS leftSum' => function ($query) { + $query->select(DB::raw("(amount - SUM(spent_amount)) as leftSum"))->where('status', 'complated'); + } + ]) + ->orderBy('id', 'DESC') + ->get(); } ?> == @@ -24,6 +44,7 @@ function onStart(){
+
@@ -31,7 +52,7 @@ function onStart(){
-
+
+ +
+ + +
- + - + +
+
+ +
+
+ + +
@@ -56,12 +107,12 @@ function onStart(){ placeholder="tikilen halta sany">
+
- +
@@ -97,17 +148,25 @@ function onStart(){
+ + + + + + + + @@ -119,18 +178,34 @@ function onStart(){ + + + + + + +
Önümçilik NoHalta GörnüşRulon Görnüş Tikinçi Senesi Çig mal mukdary Tikilen HaltaUlanylanGalyndyStatus BellikSazlamalar
Önümçilik NoHalta GörnüşRulon Görnüş Tikinçi Senesi Çig mal mukdary Tikilen HaltaUlanylanGalyndyStatus BellikSazlamalar
+ +