diff --git a/plugins/romanah/gokbakja/components/MachineProduction.php b/plugins/romanah/gokbakja/components/MachineProduction.php index 00dc683..0ef72b9 100644 --- a/plugins/romanah/gokbakja/components/MachineProduction.php +++ b/plugins/romanah/gokbakja/components/MachineProduction.php @@ -34,17 +34,19 @@ class MachineProduction extends ComponentBase $currentDateFormat = Carbon::now()->format('Y-m-d'); - $machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->orderBy('id', 'DESC')->whereDate('created_at', date($currentDateFormat))->get(); + $machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])->orderBy('id', 'DESC')->get(); $html_data = ''; for ($x = 0; $x < count($machineProductions); $x++) { // dd($machineProductions[0]->bag_size); $html_data .= '
JEMI IŞLENEN: ' . $dailyCalculated . ' kg
+' . $products[$i]->name . ' : ' . ($productCalcPercentage->amount_percentage ?? 0) . ' %
+| # | Smen | -Ekskruiter | Wagty | -Jemi | - '; - // for ($ii = 0; $ii < count($currentDateShifts[0]->pivot_production); $ii++) { - // $html_data4 .= '' . $currentDateShifts[0]->pivot_production[$ii]->product_name . ' | '; - // } +Jemi | '; + $html_data4 .= ' '; + $sumTimeDiffs = 0; + $productAllCalc = 0; + for ($i = 0; $i < count($shifts); $i++) { - for ($i = 0; $i < count($currentDateShifts); $i++) { - - $productionsCalc = ProductionModel::orderBy('id', 'DESC')->whereDate('created_at', date($currentDateFormat)); - - $calc = $productionsCalc->select(DB::raw('MAX(all_amount) - MIN(all_amount) AS amount_subtraction'), DB::raw('MAX(all_amount) AS max_amount'), DB::raw('MIN(all_amount) AS min_amount'), DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time')) - ->where('shift_id', $currentDateShifts[$i]->shift_id)->where('excruiter_id', $currentDateShifts[$i]->excruiter_id)->first(); + $productionsCalc = ProductionModel::orderBy('id', 'DESC'); + $calc = $productionsCalc->select(DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time')) + ->whereDate('date', date($currentDateFormat))->where('shift_id', $shifts[$i]->id)->first(); $diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time); - $hourCountShift = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut'; + $sumTimeDiffs += $diffMinutes; + + $timeCalc = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut'; + + $productCalc = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('shift_id', $shifts[$i]->id)->sum('amount_calc'); + + $productAllCalc += $productCalc; $html_data4 .= '||
|---|---|---|---|---|---|---|---|---|
| ' . ($i + 1) . ' | -' . $currentDateShifts[$i]->shift->desc . '(' . $currentDateShifts[$i]->shift->start . ' - ' . $currentDateShifts[$i]->shift->end . ') | -' . $currentDateShifts[$i]->excruiter->name . ' | -' . $hourCountShift . ' | -' . $calc->amount_subtraction . ' kg | '; - - - // for ($x = 0; $x < count($pivotShiftLasts); $x++) { - - // $calculatedPercentageShift = (float) ($pivotShiftLasts[$x]->amount_percentage / 100) * (float) $allAmountShift; - - // $html_data4 .= '' . ($calculatedPercentageShift) . ' kg | '; - // } - +' . $shifts[$i]->desc . '(' . $shifts[$i]->start . ' - ' . $shifts[$i]->end . ') | +'.$timeCalc.' | +' . $productCalc . ' kg | '; $html_data4 .= '
| JEMI | +'.$timeAllCalc.' | + +' . $productAllCalc . ' kg | '; + $html_data4 .= '||||||
= e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/romanah/gokbakja/controllers/bagcolor/index.htm b/plugins/romanah/gokbakja/controllers/bagcolor/index.htm new file mode 100644 index 0000000..ea43a36 --- /dev/null +++ b/plugins/romanah/gokbakja/controllers/bagcolor/index.htm @@ -0,0 +1 @@ += $this->listRender() ?> diff --git a/plugins/romanah/gokbakja/controllers/bagcolor/preview.htm b/plugins/romanah/gokbakja/controllers/bagcolor/preview.htm new file mode 100644 index 0000000..964fcaf --- /dev/null +++ b/plugins/romanah/gokbakja/controllers/bagcolor/preview.htm @@ -0,0 +1,22 @@ + ++ + = e(trans('backend::lang.form.return_to_list')) ?> + +
\ No newline at end of file diff --git a/plugins/romanah/gokbakja/controllers/bagcolor/update.htm b/plugins/romanah/gokbakja/controllers/bagcolor/update.htm new file mode 100644 index 0000000..4463917 --- /dev/null +++ b/plugins/romanah/gokbakja/controllers/bagcolor/update.htm @@ -0,0 +1,54 @@ + += e(trans('backend::lang.form.return_to_list')) ?>
+ \ No newline at end of file diff --git a/plugins/romanah/gokbakja/models/BagColor.php b/plugins/romanah/gokbakja/models/BagColor.php new file mode 100644 index 0000000..d3c484a --- /dev/null +++ b/plugins/romanah/gokbakja/models/BagColor.php @@ -0,0 +1,33 @@ + [ + 'Romanah\Gokbakja\Models\ProductionMachine', + 'key' => 'color_id' + ] + ]; + /** + * @var string The database table used by the model. + */ + public $table = 'romanah_gokbakja_bag_color'; + + /** + * @var array Validation rules + */ + public $rules = [ + ]; +} diff --git a/plugins/romanah/gokbakja/models/ProductionCalculate.php b/plugins/romanah/gokbakja/models/ProductionCalculate.php new file mode 100644 index 0000000..14b5358 --- /dev/null +++ b/plugins/romanah/gokbakja/models/ProductionCalculate.php @@ -0,0 +1,45 @@ + [ + 'Romanah\Gokbakja\Models\Production', + 'key' => 'production_id' + ], + 'product' => [ + 'Romanah\Gokbakja\Models\Product', + 'key' => 'product_id' + ], + 'excruiter' => [ + 'Romanah\Gokbakja\Models\Excruiter', + 'key' => 'excruiter_id' + ], + 'shift' => [ + 'Romanah\Gokbakja\Models\Shift', + 'key' => 'shift_id' + ] + ]; + + /** + * @var string The database table used by the model. + */ + public $table = 'romanah_gokbakja_production_calculate'; + + /** + * @var array Validation rules + */ + public $rules = [ + ]; +} diff --git a/plugins/romanah/gokbakja/models/ProductionMachine.php b/plugins/romanah/gokbakja/models/ProductionMachine.php index 64acaaa..32ed8ac 100644 --- a/plugins/romanah/gokbakja/models/ProductionMachine.php +++ b/plugins/romanah/gokbakja/models/ProductionMachine.php @@ -11,7 +11,7 @@ class ProductionMachine extends Model use \October\Rain\Database\Traits\SoftDelete; - protected $dates = ['deleted_at']; + protected $dates = ['deleted_at', 'date']; public $belongsTo = [ 'bag_type' => [ @@ -34,6 +34,10 @@ class ProductionMachine extends Model 'Romanah\Gokbakja\Models\Employee', 'key' => 'mechanic_id' ], + 'color' => [ + 'Romanah\Gokbakja\Models\BagColor', + 'key' => 'color_id' + ], ]; /** diff --git a/plugins/romanah/gokbakja/models/bagcolor/columns.yaml b/plugins/romanah/gokbakja/models/bagcolor/columns.yaml new file mode 100644 index 0000000..f246360 --- /dev/null +++ b/plugins/romanah/gokbakja/models/bagcolor/columns.yaml @@ -0,0 +1,14 @@ +columns: + id: + label: id + type: number + name: + label: 'Renk Ady' + type: text + searchable: true + sortable: true + note: + label: Bellik + type: text + searchable: true + sortable: true diff --git a/plugins/romanah/gokbakja/models/bagcolor/fields.yaml b/plugins/romanah/gokbakja/models/bagcolor/fields.yaml new file mode 100644 index 0000000..dadf6cc --- /dev/null +++ b/plugins/romanah/gokbakja/models/bagcolor/fields.yaml @@ -0,0 +1,10 @@ +fields: + name: + label: 'Rulon Renk Ady' + span: auto + type: text + note: + label: Bellik + span: auto + size: '' + type: textarea diff --git a/plugins/romanah/gokbakja/models/bagsize/columns.yaml b/plugins/romanah/gokbakja/models/bagsize/columns.yaml index 628d517..1acba74 100644 --- a/plugins/romanah/gokbakja/models/bagsize/columns.yaml +++ b/plugins/romanah/gokbakja/models/bagsize/columns.yaml @@ -3,10 +3,10 @@ columns: label: id type: number width: - label: width + label: 'Rulon Ini' type: text height: - label: height + label: 'Rulon Uzynlygy' type: text name: label: name diff --git a/plugins/romanah/gokbakja/models/bagsize/fields.yaml b/plugins/romanah/gokbakja/models/bagsize/fields.yaml index 384b085..d4e73ba 100644 --- a/plugins/romanah/gokbakja/models/bagsize/fields.yaml +++ b/plugins/romanah/gokbakja/models/bagsize/fields.yaml @@ -1,16 +1,12 @@ fields: width: - label: 'Halta Ini' + label: 'Rulon Ini' span: auto type: number height: - label: 'Halta uzynlygy' + label: 'Rulon uzynlygy m2' span: auto type: number - name: - label: Ady - span: auto - type: text note: label: Bellik span: auto diff --git a/plugins/romanah/gokbakja/models/bagtype/fields.yaml b/plugins/romanah/gokbakja/models/bagtype/fields.yaml index 416749b..e1b8398 100644 --- a/plugins/romanah/gokbakja/models/bagtype/fields.yaml +++ b/plugins/romanah/gokbakja/models/bagtype/fields.yaml @@ -1,6 +1,6 @@ fields: name: - label: 'Halta Görnüşiniň Ady' + label: 'Rulon Görnüşiniň Ady' span: auto type: text note: diff --git a/plugins/romanah/gokbakja/models/payment/columns.yaml b/plugins/romanah/gokbakja/models/payment/columns.yaml index 9b4eac4..f200c18 100644 --- a/plugins/romanah/gokbakja/models/payment/columns.yaml +++ b/plugins/romanah/gokbakja/models/payment/columns.yaml @@ -11,3 +11,6 @@ columns: note: label: note type: text + date: + label: Sene + type: datetime diff --git a/plugins/romanah/gokbakja/models/payment/fields.yaml b/plugins/romanah/gokbakja/models/payment/fields.yaml index 3d66f97..5ffff6e 100644 --- a/plugins/romanah/gokbakja/models/payment/fields.yaml +++ b/plugins/romanah/gokbakja/models/payment/fields.yaml @@ -13,3 +13,8 @@ fields: label: Note span: auto type: textarea + date: + label: Sene + span: auto + mode: date + type: datepicker diff --git a/plugins/romanah/gokbakja/models/productionmachine/fields.yaml b/plugins/romanah/gokbakja/models/productionmachine/fields.yaml index 4e9a3cf..879651c 100644 --- a/plugins/romanah/gokbakja/models/productionmachine/fields.yaml +++ b/plugins/romanah/gokbakja/models/productionmachine/fields.yaml @@ -45,3 +45,8 @@ fields: label: 'Mechanic name' span: auto type: text + date: + label: Sene + span: auto + mode: datetime + type: datepicker diff --git a/plugins/romanah/gokbakja/plugin.yaml b/plugins/romanah/gokbakja/plugin.yaml index fad2554..89b9163 100644 --- a/plugins/romanah/gokbakja/plugin.yaml +++ b/plugins/romanah/gokbakja/plugin.yaml @@ -56,22 +56,18 @@ navigation: url: romanah/gokbakja/production icon: icon-bookmark sideMenu: - side-menu-item: - label: report - url: romanah/gokbakja/pivotproduction - icon: icon-sitemap side-menu-item2: - label: 'Halta Görnüşleri' + label: 'Rulon Görnüşleri' url: romanah/gokbakja/bagtype icon: icon-bars side-menu-item3: - label: 'Halta ölçegleri' + label: 'Rulon ölçegleri' url: romanah/gokbakja/bagsize icon: icon-simplybuilt - side-menu-item4: - label: 'Production Machine' - url: romanah/gokbakja/prodctionmachine - icon: icon-sliders + side-menu-item: + label: 'Reňk Gornushleri' + url: romanah/gokbakja/bagcolor + icon: icon-sitemap side-menu-item5: label: Tikinçiler url: romanah/gokbakja/sewerproduction @@ -86,6 +82,6 @@ navigation: url: romanah/gokbakja/machine icon: icon-codepen side-menu-item2: - label: Eksruiterler + label: Ekstrudorlar url: romanah/gokbakja/excruiter icon: icon-steam diff --git a/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_bag_color.php b/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_bag_color.php new file mode 100644 index 0000000..02dc004 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_bag_color.php @@ -0,0 +1,26 @@ +engine = 'InnoDB'; + $table->increments('id')->unsigned(); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + $table->timestamp('deleted_at')->nullable(); + $table->string('name'); + $table->text('note')->nullable(); + }); + } + + public function down() + { + Schema::dropIfExists('romanah_gokbakja_bag_color'); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_production_calculate.php b/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_production_calculate.php new file mode 100644 index 0000000..b5e68e0 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_create_romanah_gokbakja_production_calculate.php @@ -0,0 +1,31 @@ +engine = 'InnoDB'; + $table->increments('id')->unsigned(); + $table->timestamp('created_at')->nullable(); + $table->timestamp('updated_at')->nullable(); + $table->timestamp('deleted_at')->nullable(); + $table->integer('production_id'); + $table->integer('product_id'); + $table->double('hour_calc', 10, 0); + $table->double('amount_calc', 10, 0); + $table->integer('excruiter_id'); + $table->date('date'); + $table->time('time'); + }); + } + + public function down() + { + Schema::dropIfExists('romanah_gokbakja_production_calculate'); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_machine_3.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_machine_3.php new file mode 100644 index 0000000..dbb7e8e --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_machine_3.php @@ -0,0 +1,23 @@ +date('date')->nullable(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_machine', function($table) + { + $table->dropColumn('date'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_machine_4.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_machine_4.php new file mode 100644 index 0000000..8b29c97 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_machine_4.php @@ -0,0 +1,23 @@ +dropColumn('date'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_machine', function($table) + { + $table->date('date')->nullable(); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_payment.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_payment.php new file mode 100644 index 0000000..66d5e23 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_payment.php @@ -0,0 +1,23 @@ +date('date')->nullable(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_payment', function($table) + { + $table->dropColumn('date'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate.php new file mode 100644 index 0000000..558d8fb --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate.php @@ -0,0 +1,23 @@ +integer('shift_id'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_calculate', function($table) + { + $table->dropColumn('shift_id'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_2.php new file mode 100644 index 0000000..d82e54a --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_2.php @@ -0,0 +1,23 @@ +dropColumn('hour_calc'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_calculate', function($table) + { + $table->double('hour_calc', 10, 0); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_3.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_3.php new file mode 100644 index 0000000..174607c --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_3.php @@ -0,0 +1,23 @@ +double('amount_percentage', 10, 0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_calculate', function($table) + { + $table->dropColumn('amount_percentage'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_4.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_4.php new file mode 100644 index 0000000..38f3c74 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_4.php @@ -0,0 +1,23 @@ +double('hour_calc', 10, 0); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_calculate', function($table) + { + $table->dropColumn('hour_calc'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_5.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_5.php new file mode 100644 index 0000000..9d5cda6 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_calculate_5.php @@ -0,0 +1,23 @@ +dropColumn('hour_calc'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_calculate', function($table) + { + $table->double('hour_calc', 10, 0); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_5.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_5.php new file mode 100644 index 0000000..acf06c7 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_5.php @@ -0,0 +1,23 @@ +date('date')->nullable(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('date'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_6.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_6.php new file mode 100644 index 0000000..7984b77 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_machine_6.php @@ -0,0 +1,23 @@ +integer('color_id'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production_machine', function($table) + { + $table->dropColumn('color_id'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/version.yaml b/plugins/romanah/gokbakja/updates/version.yaml index 76669ff..40494f3 100644 --- a/plugins/romanah/gokbakja/updates/version.yaml +++ b/plugins/romanah/gokbakja/updates/version.yaml @@ -201,3 +201,39 @@ 1.0.68: - 'Updated table romanah_gokbakja_order' - builder_table_update_romanah_gokbakja_order_6.php +1.0.69: + - 'Updated table romanah_gokbakja_machine' + - builder_table_update_romanah_gokbakja_machine_3.php +1.0.70: + - 'Updated table romanah_gokbakja_machine' + - builder_table_update_romanah_gokbakja_machine_4.php +1.0.71: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_5.php +1.0.72: + - 'Created table romanah_gokbakja_bag_color' + - builder_table_create_romanah_gokbakja_bag_color.php +1.0.73: + - 'Updated table romanah_gokbakja_production_machine' + - builder_table_update_romanah_gokbakja_production_machine_6.php +1.0.74: + - 'Updated table romanah_gokbakja_payment' + - builder_table_update_romanah_gokbakja_payment.php +1.0.75: + - 'Created table romanah_gokbakja_production_calculate' + - builder_table_create_romanah_gokbakja_production_calculate.php +1.0.76: + - 'Updated table romanah_gokbakja_production_calculate' + - builder_table_update_romanah_gokbakja_production_calculate.php +1.0.77: + - 'Updated table romanah_gokbakja_production_calculate' + - builder_table_update_romanah_gokbakja_production_calculate_2.php +1.0.78: + - 'Updated table romanah_gokbakja_production_calculate' + - builder_table_update_romanah_gokbakja_production_calculate_3.php +1.0.79: + - 'Updated table romanah_gokbakja_production_calculate' + - builder_table_update_romanah_gokbakja_production_calculate_4.php +1.0.80: + - 'Updated table romanah_gokbakja_production_calculate' + - builder_table_update_romanah_gokbakja_production_calculate_5.php diff --git a/themes/gokbakja/pages/machine/machine.htm b/themes/gokbakja/pages/machine/machine.htm index 318de20..433161b 100644 --- a/themes/gokbakja/pages/machine/machine.htm +++ b/themes/gokbakja/pages/machine/machine.htm @@ -44,8 +44,17 @@ detailsUrlParameter = "id" pageNumber = "{{ :page }}" [machineProduction] -== +[builderList builderList5] +modelClass = "Romanah\Gokbakja\Models\BagColor" +scope = "-" +scopeValue = "{{ :scope }}" +displayColumn = "id" +noRecordsMessage = "No records found" +detailsPage = "-" +detailsUrlParameter = "id" +pageNumber = "{{ :page }}" +== {% set records = builderList.records %} {% set displayColumn = builderList.displayColumn %} {% set noRecordsMessage = builderList.noRecordsMessage %} @@ -56,6 +65,7 @@ pageNumber = "{{ :page }}" {% set machines = builderList2.records %} {% set types = builderList4.records %} {% set sizes = builderList3.records %} +{% set colors = builderList5.records %} {% put styles %}Hasabat