From e9205b25229a8f152192f8fb5cb0bde7af02c2b4 Mon Sep 17 00:00:00 2001 From: Shohrat Date: Sun, 24 Sep 2023 01:10:26 +0500 Subject: [PATCH] report settings --- .../gokbakja/components/Production.php | 36 +++++ ..._romanah_gokbakja_production_machine_2.php | 23 +++ ..._romanah_gokbakja_production_machine_3.php | 31 ++++ ..._romanah_gokbakja_production_machine_4.php | 23 +++ plugins/romanah/gokbakja/updates/version.yaml | 9 ++ themes/gokbakja/meta/menus/aside.yaml | 52 +++++- .../pages/all-production-machine-month.htm | 151 ++++++++++++++++++ themes/gokbakja/pages/all-productions.htm | 10 +- .../get-all-machine-production-month.htm | 137 ++++++++++++++++ themes/gokbakja/pages/get-mechanic.htm | 135 ++++++++++++++++ .../gokbakja/pages/get-production-machine.htm | 140 ++++++++++++++++ themes/gokbakja/pages/home.htm | 42 ++++- .../pages/machine-production-mechanic.htm | 150 +++++++++++++++++ themes/gokbakja/pages/machine.htm | 139 +++++++++++++--- themes/gokbakja/pages/product/actions.htm | 4 +- .../pages/report-production-machine.htm | 98 ++++++++++++ themes/gokbakja/partials/bell.htm | 8 +- .../partials/layout-settings-main.htm | 10 +- .../partials/reportMachine/row-machine.htm | 20 +++ 19 files changed, 1175 insertions(+), 43 deletions(-) create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_2.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_3.php create mode 100644 plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_4.php create mode 100644 themes/gokbakja/pages/all-production-machine-month.htm create mode 100644 themes/gokbakja/pages/get-all-machine-production-month.htm create mode 100644 themes/gokbakja/pages/get-mechanic.htm create mode 100644 themes/gokbakja/pages/get-production-machine.htm create mode 100644 themes/gokbakja/pages/machine-production-mechanic.htm create mode 100644 themes/gokbakja/pages/report-production-machine.htm create mode 100644 themes/gokbakja/partials/reportMachine/row-machine.htm diff --git a/plugins/romanah/gokbakja/components/Production.php b/plugins/romanah/gokbakja/components/Production.php index 2b2cb8d..0aa6ae0 100644 --- a/plugins/romanah/gokbakja/components/Production.php +++ b/plugins/romanah/gokbakja/components/Production.php @@ -5,6 +5,7 @@ namespace Romanah\Gokbakja\Components; use Cms\Classes\ComponentBase; use Romanah\Gokbakja\Models\Product as ProductModel; use Romanah\Gokbakja\Models\Production as ProductionModel; +use Romanah\Gokbakja\Models\ProductionMachine as ProductionMachineModel; use Romanah\Gokbakja\Models\PivotProduction as PivotProductionModel; use Redirect; use Flash; @@ -21,6 +22,41 @@ class Production extends ComponentBase ]; } + public function onCreateMachineProduction() + { + $user = \Auth::user(); + + $data = post(); + + $createProductionMachine = new ProductionMachineModel(); + + $createProductionMachine->type_id = $data["type_id"]; + $createProductionMachine->size_id = $data["size_id"]; + $createProductionMachine->machine_id = $data["machine_id"]; + $createProductionMachine->produced_weight = $data["produced_weight"]; + $createProductionMachine->note = $data["note"]; + $createProductionMachine->user_id = $user->id; + $createProductionMachine->save(); + + $productionMachine = ProductionMachineModel::where('id', $createProductionMachine->id)->with(['machine.employee', 'machine.mechanic', 'machine.building'])->first(); + // dd($productionMachine->machine->name); + if($productionMachine){ + $updateResult = ProductionMachineModel::where('id', $productionMachine->id) + ->update(array( + 'employee_id' => $productionMachine->machine->employee->id, + 'mechanic_id' => $productionMachine->machine->mechanic->id, + 'employee_name' => $productionMachine->machine->employee->name, + 'mechanic_name' => $productionMachine->machine->mechanic->name, + 'building_name' => $productionMachine->machine->building->name, + )); + } + + if ($createProductionMachine && $updateResult) { + Flash::success("Hasabat Ustunlikli Goşuldy"); + return Redirect::refresh(); + } + + } public function onCreateProduction() { diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_2.php new file mode 100644 index 0000000..b97b535 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_2.php @@ -0,0 +1,23 @@ +integer('user_id')->nullable(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('user_id'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_3.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_3.php new file mode 100644 index 0000000..953c60b --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_3.php @@ -0,0 +1,31 @@ +integer('type_id')->nullable()->change(); + $table->integer('size_id')->nullable()->change(); + $table->integer('machine_id')->nullable()->change(); + $table->integer('employee_id')->nullable()->change(); + $table->integer('mechanic_id')->nullable()->change(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->integer('type_id')->nullable(false)->change(); + $table->integer('size_id')->nullable(false)->change(); + $table->integer('machine_id')->nullable(false)->change(); + $table->integer('employee_id')->nullable(false)->change(); + $table->integer('mechanic_id')->nullable(false)->change(); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_4.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_4.php new file mode 100644 index 0000000..e1c3b37 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_4.php @@ -0,0 +1,23 @@ +string('building_name')->nullable(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('building_name'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/version.yaml b/plugins/romanah/gokbakja/updates/version.yaml index d7b1118..b69ad71 100644 --- a/plugins/romanah/gokbakja/updates/version.yaml +++ b/plugins/romanah/gokbakja/updates/version.yaml @@ -102,3 +102,12 @@ 1.0.35: - 'Updated table romanah_gokbakja_pivot_production' - builder_table_update_romanah_gokbakja_pivot_production_4.php +1.0.36: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_2.php +1.0.37: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_3.php +1.0.38: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_4.php diff --git a/themes/gokbakja/meta/menus/aside.yaml b/themes/gokbakja/meta/menus/aside.yaml index fd5a78e..fcbb726 100644 --- a/themes/gokbakja/meta/menus/aside.yaml +++ b/themes/gokbakja/meta/menus/aside.yaml @@ -67,9 +67,13 @@ items: isExternal: '0' - title: 'Çig mallar boýunça' + nesting: null type: url url: /w code: '' + reference: null + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: ri-stack-line @@ -77,9 +81,13 @@ items: items: - title: 'Täze Hasabat' + nesting: null type: cms-page + url: null code: '' reference: production + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' @@ -88,13 +96,13 @@ items: title: 'Aýlar Boýunça' type: cms-page code: '' - reference: all-production-month + reference: all-productions viewBag: isHidden: '0' cssClass: '' isExternal: '0' - - title: 'Ortaça Hasaplama' + title: 'Ýyl Boýunça' type: cms-page code: '' reference: report-production @@ -104,9 +112,13 @@ items: isExternal: '0' - title: 'Enjamlar Boýunça' + nesting: null type: url url: /ee code: '' + reference: null + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: 'ri-bar-chart-2-line ' @@ -114,27 +126,53 @@ items: items: - title: 'Täze Hasabat' + nesting: null type: cms-page + url: null code: '' reference: machine + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' isExternal: '0' - - title: 'Aylar boyunca' - type: url - url: /sss + title: 'Aýlar boýunca' + type: cms-page code: '' + reference: all-production-machine-month + viewBag: + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: 'Ýyl Boýunça' + type: cms-page + code: '' + reference: report-production-machine + viewBag: + isHidden: '0' + cssClass: '' + isExternal: '0' + - + title: 'Mehanikler boýunça' + type: cms-page + code: '' + reference: machine-production-mechanic viewBag: isHidden: '0' cssClass: '' isExternal: '0' - title: Tikinçiler + nesting: null type: url url: /tt code: '' + reference: null + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: 'ri-surround-sound-line ' @@ -142,9 +180,13 @@ items: items: - title: 'Taze hasabat' + nesting: null type: url url: /s code: '' + reference: null + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' diff --git a/themes/gokbakja/pages/all-production-machine-month.htm b/themes/gokbakja/pages/all-production-machine-month.htm new file mode 100644 index 0000000..7dbf16d --- /dev/null +++ b/themes/gokbakja/pages/all-production-machine-month.htm @@ -0,0 +1,151 @@ +title = "All production machine by month group" +url = "/all-production-machine-month/:month/:year?" +layout = "platform_main" +is_hidden = 0 +== +timezone('UTC +05:00'); + $this["month"] = $this->param("month"); + $year = $this->param("year"); + + + if($this["month"] == 'default'){ + $this["month"] = $currentDate->month; + } + + if($year){ + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->groupBy(DB::raw("DAY(created_at)"))->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) + ->whereYear('created_at', $year) + ->sum('produced_weight'); + }else{ + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->groupBy(DB::raw("DAY(created_at)"))->addSelect(DB::raw("*, SUM(produced_weight) as produced_weight"))->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) + ->whereYear('created_at', $currentDate->year) + ->sum('produced_weight'); + } +} +?> +== +{% put styles %} + + + +{% endput %} + +
+ + +
+
+
+

Aýlar Boýunça {{year}}

+ +
+
+
+ + +
+
+ + + + + + + + +
+
+ +
+ + +{% partial 'dataTableJs' %} \ No newline at end of file diff --git a/themes/gokbakja/pages/all-productions.htm b/themes/gokbakja/pages/all-productions.htm index e0f02eb..3acf103 100644 --- a/themes/gokbakja/pages/all-productions.htm +++ b/themes/gokbakja/pages/all-productions.htm @@ -6,7 +6,15 @@ is_hidden = 0 timezone('UTC +05:00'); + $this["month"] = $this->param("month"); + + if($this["month"] != "default"){ + $this["month"] = $this->param("month"); + }else{ + $this["month"] = $currentDate->format('m'); + } + $year = $this->param("year"); $this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->groupBy(DB::raw("DAY(created_at)"))->withCount(['pivot_production'])->get(); @@ -14,7 +22,7 @@ function onStart() { if($year){ $this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->groupBy(DB::raw("DAY(created_at)"))->with(['pivot_production'])->get(); }else{ - $this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->groupBy(DB::raw("DAY(created_at)"))->with(['pivot_production'])->get(); + $this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $currentDate->format('m'))->whereYear('created_at', $currentDate->year)->groupBy(DB::raw("DAY(created_at)"))->with(['pivot_production'])->get(); } } diff --git a/themes/gokbakja/pages/get-all-machine-production-month.htm b/themes/gokbakja/pages/get-all-machine-production-month.htm new file mode 100644 index 0000000..8e88fd2 --- /dev/null +++ b/themes/gokbakja/pages/get-all-machine-production-month.htm @@ -0,0 +1,137 @@ +title = "Get all machine production by month" +url = "/get-all-machine-production-month/:month/:year?" +layout = "platform_main" +is_hidden = 0 +== +timezone('UTC +05:00'); + $this["month"] = $this->param("month"); + $year = $this->param("year"); + + if($year){ + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) + ->whereYear('created_at', $year) + ->sum('produced_weight'); + }else{ + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) + ->whereYear('created_at', $currentDate->year) + ->sum('produced_weight'); + } + +} +?> +== +{% put styles %} + + + +{% endput %} + +
+ + +
+
+
+
+
+
+

Enjamlar boýunça + ({{production.created_at|date('d.m.Y')}})

+

Hasabat

+
+ +
+ + + + + + + + + + + + + + + + + + + + {% for key, machine in machineProductions %} + + + + + + + + + + + + {% endfor %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bina NoEnjam NoÖlçegiGörnüşiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
{{key + 1}}{{machine.building_name}}{{machine.machine.name}}{{machine.bag_size.name}}{{machine.bag_type.name}}{{machine.produced_weight|number_format}} kg{{machine.employee_name}}{{machine.mechanic_name}}{{machine.note}}
#JEMI + {{month_all_amount|number_format}} kg +
Bina NoEnjam NoÖlçegiGörnüşiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
+
+ + + +
+
+
+ +
+ +{% partial 'dataTableJs' %} diff --git a/themes/gokbakja/pages/get-mechanic.htm b/themes/gokbakja/pages/get-mechanic.htm new file mode 100644 index 0000000..d4d00b8 --- /dev/null +++ b/themes/gokbakja/pages/get-mechanic.htm @@ -0,0 +1,135 @@ +title = "Get Mechanic" +url = "/get-mechanic/:mechanicId/:month" +layout = "platform_main" +is_hidden = 0 +== +timezone('UTC +05:00'); + $this["currentYear"] = $currentDate->year; + $this["month"] = $this->param("month"); + + + $mechanicId = $this->param("mechanicId"); + $month = $this->param("month"); + + + $this["mechanicProductions"] = Romanah\Gokbakja\Models\ProductionMachine::where('mechanic_id', $mechanicId)->whereMonth('created_at', $month)->whereYear('created_at', $this["currentYear"])->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->get(); + + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $month) + ->whereYear('created_at', $this["currentYear"]) + ->sum('produced_weight'); + +} +?> +== +{% put styles %} + + + +{% endput %} + +
+ + +
+
+
+
+
+
+

Enjamlar boýunça + ({{month}}.{{currentYear}})

+

Hasabat

+
+ +
+ + + + + + + + + + + + + + + + + + + + {% for key, machine in mechanicProductions %} + + + + + + + + + + + + {% endfor %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bina NoEnjam NoÖlçegiGörnüşiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
{{key + 1}}{{machine.building_name}}{{machine.machine.name}}{{machine.bag_size.name}}{{machine.bag_type.name}}{{machine.produced_weight|number_format}} kg{{machine.employee_name}}{{machine.mechanic_name}}{{machine.note}}
#JEMI + {{month_all_amount|number_format}} kg +
Bina NoEnjam NoÖlçegiGörnüşiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
+
+ + + +
+
+
+ +
+ +{% partial 'dataTableJs' %} \ No newline at end of file diff --git a/themes/gokbakja/pages/get-production-machine.htm b/themes/gokbakja/pages/get-production-machine.htm new file mode 100644 index 0000000..23a0f68 --- /dev/null +++ b/themes/gokbakja/pages/get-production-machine.htm @@ -0,0 +1,140 @@ +title = "Get production machine" +url = "/get-production-machine/:id" +layout = "platform_main" +is_hidden = 0 +== +timezone('UTC +05:00'); + $this["currentYear"] = $currentDate->year; + + $productionId = $this->param("id"); + + $this["production"] = Romanah\Gokbakja\Models\ProductionMachine::where('id', $productionId)->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->first(); + + + $productionD = $this["production"]->created_at->format('d'); + $productionM = $this["production"]->created_at->format('m'); + $productionY = $this["production"]->created_at->format('Y'); + + $this["productionM"] = $this["production"]->created_at->format('m'); + + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereDay('created_at', $productionD)->whereMonth('created_at', $productionM)->whereYear('created_at', $productionY)->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereDay('created_at', $productionD) + ->whereMonth('created_at', $productionM) + ->whereYear('created_at', $productionY) + ->sum('produced_weight'); + +} +?> +== +{% put styles %} + + + +{% endput %} + +
+ + +
+
+
+
+
+
+

Enjamlar boýunça + ({{production.created_at|date('d.m.Y')}})

+

Hasabat

+
+ +
+ + + + + + + + + + + + + + + + + + + + {% for key, machine in machineProductions %} + + + + + + + + + + + + {% endfor %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bina NoEnjam NoÖlçegiGörnüşiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
{{key + 1}}{{machine.building_name}}{{machine.machine.name}}{{machine.bag_size.name}}{{machine.bag_type.name}}{{machine.produced_weight|number_format}} kg{{machine.employee_name}}{{machine.mechanic_name}}{{machine.note}}
#JEMI + {{month_all_amount|number_format}} kg +
Bina NoEnjam NoÖlçegiGörnüşiÖnen Önüm (kg)Ady FamiliýasyMehanikBellik
+
+ + + +
+
+
+ +
+ +{% partial 'dataTableJs' %} diff --git a/themes/gokbakja/pages/home.htm b/themes/gokbakja/pages/home.htm index adf73cc..33f9886 100644 --- a/themes/gokbakja/pages/home.htm +++ b/themes/gokbakja/pages/home.htm @@ -1,14 +1,40 @@ title = "Home" -url = "/:year" +url = "/:year?" layout = "platform_main" is_hidden = 0 == timezone('UTC +05:00'); + $year = $this->param("year"); - $this["year"] = $this->param("year"); - + + if($year){ + $year = $this->param("year"); + $this["year"] = $this->param("year"); + }else{ + $year = $currentDate->year; + $this["year"] = $currentDate->year; + } + + + + $this["production1"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 1)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + + $this["production2"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 2)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production3"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 3)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production4"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 4)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production5"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 5)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production6"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 6)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production7"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 7)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production8"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 8)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production9"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 9)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production10"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 10)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production11"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 11)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + $this["production12"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', 12)->whereYear('created_at', $year)->avg('all_amount') ?? 0; + + + } ?> == @@ -73,11 +99,11 @@ function onStart(){ curve: "straight" }, series: [{ - name: "Öndürilen Önüm ", - data: ['{{ordersAccept1}}', '{{ordersAccept2}}', '{{ordersAccept3}}', '{{ordersAccept4}}', '{{ordersAccept5}}', '{{ordersAccept6}}', '{{ordersAccept7}}', '{{ordersAccept8}}', '{{ordersAccept9}}', '{{ordersAccept10}}', '{{ordersAccept11}}', '{{ordersAccept12}}'] + name: "Ortaça Öndürilen Önüm ", + data: ['{{production1}}', '{{production2}}', '{{production3}}', '{{production4}}', '{{production5}}', '{{production6}}', '{{production7}}', '{{production8}}', '{{production9}}', '{{production10}}', '{{production11}}', '{{production12}}'] }, { name: "Brak Önüm ", - data: ['{{ordersCancel1}}', '{{ordersCancel2}}', '{{ordersCancel3}}', '{{ordersCancel4}}', '{{ordersCancel5}}', '{{ordersCancel6}}', '{{ordersCancel7}}', '{{ordersCancel8}}', '{{ordersCancel9}}', '{{ordersCancel10}}', '{{ordersCancel11}}', '{{ordersCancel12}}'] + data: ['{{production1}}', '{{production2}}', '{{production3}}', '{{production4}}', '{{production5}}', '{{production6}}', '{{production7}}', '{{production8}}', '12312', '{{production10}}', '{{production11}}', '{{production12}}'] }], title: { text: "Hasabat", @@ -95,7 +121,7 @@ function onStart(){ size: 6 }, xaxis: { - categories: ['Yanwar', 'Fewral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Awgust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'], + categories: ['Ýanwar', 'Fewral', 'Mart', 'Aprel', 'Maý', 'Iýun', 'Iýul', 'Awgust', 'Sentýabr', 'Oktýabr', 'Noýabr', 'Dekabr'], title: { text: "Aýlar" } diff --git a/themes/gokbakja/pages/machine-production-mechanic.htm b/themes/gokbakja/pages/machine-production-mechanic.htm new file mode 100644 index 0000000..b579981 --- /dev/null +++ b/themes/gokbakja/pages/machine-production-mechanic.htm @@ -0,0 +1,150 @@ +title = "Machine production by mechanic" +url = "/machine-production-mechanic/:month" +layout = "platform_main" +is_hidden = 0 +== +timezone('UTC +05:00'); + $this["month"] = $this->param("month"); + $year = $this->param("year"); + + + if($this["month"] == 'default'){ + $this["month"] = $currentDate->month; + } + + if($year){ + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->groupBy("mechanic_id")->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) + ->whereYear('created_at', $year) + ->sum('produced_weight'); + }else{ + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->groupBy("mechanic_id")->addSelect(DB::raw("*, SUM(produced_weight) as produced_weight"))->get(); + + $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) + ->whereYear('created_at', $currentDate->year) + ->sum('produced_weight'); + } +} +?> +== +{% put styles %} + + + +{% endput %} + +
+ + +
+
+
+

Aýlar Boýunça {{year}}

+ +
+
+
+ + +
+
+ + + + + + + + +
+
+ +
+ + +{% partial 'dataTableJs' %} diff --git a/themes/gokbakja/pages/machine.htm b/themes/gokbakja/pages/machine.htm index 5d4e9b5..d0edc04 100644 --- a/themes/gokbakja/pages/machine.htm +++ b/themes/gokbakja/pages/machine.htm @@ -3,10 +3,50 @@ url = "/machine" layout = "platform_main" is_hidden = 0 +[builderList] +modelClass = "Romanah\Gokbakja\Models\Building" +scope = "-" +scopeValue = "{{ :scope }}" +displayColumn = "id" +noRecordsMessage = "No records found" +detailsPage = "-" +detailsUrlParameter = "id" +pageNumber = "{{ :page }}" + +[builderList builderList2] +modelClass = "Romanah\Gokbakja\Models\Machine" +scope = "-" +scopeValue = "{{ :scope }}" +displayColumn = "id" +noRecordsMessage = "No records found" +detailsPage = "-" +detailsUrlParameter = "id" +pageNumber = "{{ :page }}" + +[builderList builderList3] +modelClass = "Romanah\Gokbakja\Models\BagSize" +scope = "-" +scopeValue = "{{ :scope }}" +displayColumn = "id" +noRecordsMessage = "No records found" +detailsPage = "-" +detailsUrlParameter = "id" +pageNumber = "{{ :page }}" + +[builderList builderList4] +modelClass = "Romanah\Gokbakja\Models\BagType" +scope = "-" +scopeValue = "{{ :scope }}" +displayColumn = "id" +noRecordsMessage = "No records found" +detailsPage = "-" +detailsUrlParameter = "id" +pageNumber = "{{ :page }}" + +[production] == timezone('UTC +05:00'); $currentDateFormat = Carbon\Carbon::now()->format('Y-m-d'); @@ -15,9 +55,8 @@ is_hidden = 0 $this["currentMonth"] = $currentDate->format('m'); $this["currentYear"] = $currentDate->format('Y'); - $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::with(['bag_type', 'bag_size', 'machine', 'employee', 'mechanic'])->whereDate('created_at', date($currentDateFormat))->get(); + $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->whereDate('created_at', date($currentDateFormat))->get(); } - ?> == {% set records = builderList.records %} @@ -27,6 +66,9 @@ is_hidden = 0 {% set detailsKeyColumn = builderList.detailsKeyColumn %} {% set detailsUrlParameter = builderList.detailsUrlParameter %} +{% set machines = builderList2.records %} +{% set types = builderList3.records %} +{% set sizes = builderList4.records %} {% put styles %} + + {% endput %}
@@ -45,24 +89,77 @@ is_hidden = 0
-

Enjamlar boýunça ({{currentDate|date('d.m.Y | H:i')}})

+

Enjamlar boýunça + ({{currentDate|date('d.m.Y | H:i')}})

Hasabat

-

{{machineProductions}}

+ +
+ + + + + + + + + + + + + + + + + + +
Täze maglumat + + + + + + + + + + + +
+
+ + + + - - @@ -72,14 +169,15 @@ is_hidden = 0 {% for key, machine in machineProductions %} - - - - - - - - + + + + + + + + {% endfor %} @@ -89,11 +187,11 @@ is_hidden = 0 + + - - @@ -108,4 +206,9 @@ is_hidden = 0 +{% put scripts %} + + +{% endput %} + {% partial 'dataTableJs' %} diff --git a/themes/gokbakja/pages/product/actions.htm b/themes/gokbakja/pages/product/actions.htm index 3dc643d..d8f5486 100644 --- a/themes/gokbakja/pages/product/actions.htm +++ b/themes/gokbakja/pages/product/actions.htm @@ -122,7 +122,7 @@ function onStart(){ class="btn btn-warning waves-effect waves-light" data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom" aria-controls="offcanvasBottom" style="padding-top: 5px;padding-bottom: 5px;"> - Обновить + Täzele
@@ -130,7 +130,7 @@ function onStart(){ data-request-data="id:{{record.id}}" data-request="onDeleteAction" class="btn btn-danger waves-effect waves-light" style="padding-top: 5px;padding-bottom: 5px;"> - Удалить + Poz
diff --git a/themes/gokbakja/pages/report-production-machine.htm b/themes/gokbakja/pages/report-production-machine.htm new file mode 100644 index 0000000..6110ff4 --- /dev/null +++ b/themes/gokbakja/pages/report-production-machine.htm @@ -0,0 +1,98 @@ +title = "Report Production Machine" +url = "/report-production-machine/:year?" +layout = "platform_main" +is_hidden = 0 +== +timezone('UTC +05:00'); + + $this["year"] = $this->param("year"); + + if(!$this["year"]){ + $this["year"] = $currentDate->year; + } + + +} +?> +== +{% put styles %} + + + +{% endput %} + + +
+
+
+
+
+
+
+

Enjamlar boýunça ({{year}} ýyl)

+

Hasabat

+
+ +
+ + +
Bina No Enjam NoÖlçegiGörnüşi Önen Önüm (kg) Ady Familiýasy MehanikÖlçegiGörnüşi Bellik
{{key + 1}}{{machine.building.name}}{{machine.name}}onen onum{{machine.employee.name}}{{machine.mechanic.name}}{{machine.building_name}}{{machine.machine.name}}{{machine.bag_size.name}}{{machine.bag_type.name}}{{machine.produced_weight|number_format}} kg{{machine.employee_name}}{{machine.mechanic_name}}{{machine.note}}
Bina No Enjam NoÖlçegiGörnüşi Önen Önüm (kg) Ady Familiýasy MehanikÖlçegiGörnüşi Bellik
+ + + + + + + + + + + + + {% partial 'reportMachine/row-machine' title="Ýanwar" no=1 %} + {% partial 'reportMachine/row-machine' title="Fewral" no=2 %} + {% partial 'reportMachine/row-machine' title="Mart" no=3 %} + {% partial 'reportMachine/row-machine' title="Aprel" no=4 %} + {% partial 'reportMachine/row-machine' title="Maý" no=5 %} + {% partial 'reportMachine/row-machine' title="Iýun" no=6 %} + {% partial 'reportMachine/row-machine' title="Iýul" no=7 %} + {% partial 'reportMachine/row-machine' title="Awgust" no=8 %} + {% partial 'reportMachine/row-machine' title="Sentýabr" no=9 %} + {% partial 'reportMachine/row-machine' title="Oktýabr" no=10 %} + {% partial 'reportMachine/row-machine' title="Noýabr" no=11 %} + {% partial 'reportMachine/row-machine' title="Dekabr" no=12 %} + + + + + + + + + + + +
AýlarÖndürlen Önüm
SenesiHemmesi
+
+ + + +
+ + + + + +{% partial 'dataTableJs' %} diff --git a/themes/gokbakja/partials/bell.htm b/themes/gokbakja/partials/bell.htm index 5e843f0..a35910c 100644 --- a/themes/gokbakja/partials/bell.htm +++ b/themes/gokbakja/partials/bell.htm @@ -2,16 +2,16 @@ == page["url"]; } ?> == - + - \ No newline at end of file + diff --git a/themes/gokbakja/partials/layout-settings-main.htm b/themes/gokbakja/partials/layout-settings-main.htm index 274df66..10e3c61 100644 --- a/themes/gokbakja/partials/layout-settings-main.htm +++ b/themes/gokbakja/partials/layout-settings-main.htm @@ -32,23 +32,23 @@ -