diff --git a/plugins/romanah/gokbakja/components/Action.php b/plugins/romanah/gokbakja/components/Action.php index bc8aa3a..840e3e7 100644 --- a/plugins/romanah/gokbakja/components/Action.php +++ b/plugins/romanah/gokbakja/components/Action.php @@ -32,6 +32,11 @@ class Action extends ComponentBase $createResult = new ActionModel(); $createResult->product_id = $data["product_id"]; $createResult->type = 'inbox'; + $createResult->status_accountant = "new"; + $createResult->status_director = "new"; + $createResult->transport_no = $data["transport_no"]; + $createResult->driver = $data["driver"]; + $createResult->note = $data["note"]; $createResult->amount = $data["quantity"]; $createResult->stock_id = $data["stock_id"]; $createResult->user_id = $user->id; @@ -89,6 +94,9 @@ class Action extends ComponentBase 'product_id' => $data["product_id"], 'amount' => $data["quantity"], 'stock_id' => $data["stock_id"], + 'note' => $data["note"], + 'transport_no' => $data["transport_no"], + 'driver' => $data["driver"], 'user_id' => $user->id, )); // $createResult = DollorModel::create([]); diff --git a/plugins/romanah/gokbakja/components/Production.php b/plugins/romanah/gokbakja/components/Production.php new file mode 100644 index 0000000..274f45e --- /dev/null +++ b/plugins/romanah/gokbakja/components/Production.php @@ -0,0 +1,77 @@ + 'Production', + 'description' => 'productions settings' + ]; + } + + + public function onCreateProduction() + { + $user = \Auth::user(); + + $data = post(); + + } + + public function onUpdateProduction() + { + $user = \Auth::user(); + $data = post(); + + $updateResult = ActionModel::where('id', $data["id"]) + ->update(array( + 'product_id' => $data["product_id"], + 'amount' => $data["quantity"], + 'stock_id' => $data["stock_id"], + 'note' => $data["note"], + 'transport_no' => $data["transport_no"], + 'driver' => $data["driver"], + 'user_id' => $user->id, + )); + // $createResult = DollorModel::create([]); + + // dd($data); + if ($updateResult) { + Flash::success("Action Ustunlikli Uytgedildi"); + return Redirect::refresh(); + } + } + + + public function onGetProduction() + { + $id = post('id'); + return ActionModel::where('id', $id)->first(); + } + + // public function onDeleteProduction() + // { + // $id = post('id'); + + // $item = ActionModel::Find($id); + // $item->delete(); + + // if ($item) { + // Flash::success("Action Ustunlikli Pozuldy"); + // return Redirect::refresh(); + // } + // } + + +} diff --git a/plugins/romanah/gokbakja/models/Product.php b/plugins/romanah/gokbakja/models/Product.php index 4375f6a..1632dff 100644 --- a/plugins/romanah/gokbakja/models/Product.php +++ b/plugins/romanah/gokbakja/models/Product.php @@ -22,6 +22,11 @@ class Product extends Model ] ]; + public function scopeGetReport($query) + { + return $query->where('report', 'simple'); + } + /** * @var array Validation rules */ diff --git a/plugins/romanah/gokbakja/models/Production.php b/plugins/romanah/gokbakja/models/Production.php index a34ba7a..c39afce 100644 --- a/plugins/romanah/gokbakja/models/Production.php +++ b/plugins/romanah/gokbakja/models/Production.php @@ -13,21 +13,15 @@ class Production extends Model protected $dates = ['deleted_at']; - // public $belongsToMany = [ - // 'pivot_production' => [ - // 'Romanah\Gokbakja\Models\PivotProduction', - // 'table' => 'romanah_gokbakja_pivot_production', - // 'key' => 'production_id' - // // 'order' => 'name' - // ] - // ]; - public $hasMany = [ 'pivot_production' => [ 'Romanah\Gokbakja\Models\PivotProduction', 'key' => 'production_id' ] ]; + + + /** * @var string The database table used by the model. */ diff --git a/plugins/romanah/gokbakja/models/pivotproduction/fields.yaml b/plugins/romanah/gokbakja/models/pivotproduction/fields.yaml index 67e4d85..21b3c1d 100644 --- a/plugins/romanah/gokbakja/models/pivotproduction/fields.yaml +++ b/plugins/romanah/gokbakja/models/pivotproduction/fields.yaml @@ -1,5 +1,5 @@ fields: - amount: + amount_percentage: label: Amount span: auto type: number @@ -23,3 +23,8 @@ fields: descriptionFrom: description span: auto type: relation + date_time: + label: 'Wagty we senesi' + mode: datetime + span: auto + type: datepicker diff --git a/plugins/romanah/gokbakja/models/product/columns.yaml b/plugins/romanah/gokbakja/models/product/columns.yaml index 953389f..37b1282 100644 --- a/plugins/romanah/gokbakja/models/product/columns.yaml +++ b/plugins/romanah/gokbakja/models/product/columns.yaml @@ -17,3 +17,6 @@ columns: type: text searchable: true sortable: true + report: + label: Hasabat + type: text diff --git a/plugins/romanah/gokbakja/models/product/fields.yaml b/plugins/romanah/gokbakja/models/product/fields.yaml index cdfb861..297fd6f 100644 --- a/plugins/romanah/gokbakja/models/product/fields.yaml +++ b/plugins/romanah/gokbakja/models/product/fields.yaml @@ -12,3 +12,11 @@ fields: label: Note span: auto type: textarea + report: + label: 'Hasabat Görnüş' + options: + simple: 'Çig mal' + not: 'Hasabatda Ýok' + span: auto + default: simple + type: balloon-selector diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_action_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_action_2.php new file mode 100644 index 0000000..accfed2 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_action_2.php @@ -0,0 +1,25 @@ +string('status_accountant', 191)->nullable(false)->default('new')->change(); + $table->string('status_director', 191)->nullable(false)->default('new')->change(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_action', function($table) + { + $table->string('status_accountant', 191)->nullable()->default(null)->change(); + $table->string('status_director', 191)->nullable()->default(null)->change(); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production.php new file mode 100644 index 0000000..f008ba4 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production.php @@ -0,0 +1,23 @@ +time('time'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_pivot_production', function($table) + { + $table->dropColumn('time'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production_2.php new file mode 100644 index 0000000..1fffdf1 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production_2.php @@ -0,0 +1,25 @@ +dateTime('date_time')->nullable(); + $table->dropColumn('time'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_pivot_production', function($table) + { + $table->dropColumn('date_time'); + $table->time('time'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production_3.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production_3.php new file mode 100644 index 0000000..8b7b14e --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_pivot_production_3.php @@ -0,0 +1,25 @@ +decimal('amout', 10, 0)->nullable(); + $table->renameColumn('amount', 'amount_percentage'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_pivot_production', function($table) + { + $table->dropColumn('amout'); + $table->renameColumn('amount_percentage', 'amount'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_product.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_product.php new file mode 100644 index 0000000..fa9e7ba --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_product.php @@ -0,0 +1,23 @@ +string('report')->nullable(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_product', function($table) + { + $table->dropColumn('report'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_product_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_product_2.php new file mode 100644 index 0000000..66f83d1 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_product_2.php @@ -0,0 +1,23 @@ +string('report', 191)->default('simple')->change(); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_product', function($table) + { + $table->string('report', 191)->default(null)->change(); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production.php new file mode 100644 index 0000000..260883d --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production.php @@ -0,0 +1,23 @@ +integer('update_count')->default(10); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production', function($table) + { + $table->dropColumn('update_count'); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_2.php b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_2.php new file mode 100644 index 0000000..20e1d86 --- /dev/null +++ b/plugins/romanah/gokbakja/updates/builder_table_update_romanah_gokbakja_production_2.php @@ -0,0 +1,23 @@ +dropColumn('update_count'); + }); + } + + public function down() + { + Schema::table('romanah_gokbakja_production', function($table) + { + $table->integer('update_count')->default(10); + }); + } +} diff --git a/plugins/romanah/gokbakja/updates/version.yaml b/plugins/romanah/gokbakja/updates/version.yaml index 67d48a2..b9c3949 100644 --- a/plugins/romanah/gokbakja/updates/version.yaml +++ b/plugins/romanah/gokbakja/updates/version.yaml @@ -69,3 +69,27 @@ 1.0.24: - 'Updated table romanah_gokbakja_production_machine' - builder_table_update_romanah_gokbakja_production_machine.php +1.0.25: + - 'Updated table romanah_gokbakja_action' + - builder_table_update_romanah_gokbakja_action_2.php +1.0.26: + - 'Updated table romanah_gokbakja_product' + - builder_table_update_romanah_gokbakja_product.php +1.0.27: + - 'Updated table romanah_gokbakja_product' + - builder_table_update_romanah_gokbakja_product_2.php +1.0.28: + - 'Updated table romanah_gokbakja_pivot_production' + - builder_table_update_romanah_gokbakja_pivot_production.php +1.0.29: + - 'Updated table romanah_gokbakja_pivot_production' + - builder_table_update_romanah_gokbakja_pivot_production_2.php +1.0.30: + - 'Updated table romanah_gokbakja_production' + - builder_table_update_romanah_gokbakja_production.php +1.0.31: + - 'Updated table romanah_gokbakja_production' + - builder_table_update_romanah_gokbakja_production_2.php +1.0.32: + - 'Updated table romanah_gokbakja_pivot_production' + - builder_table_update_romanah_gokbakja_pivot_production_3.php diff --git a/themes/gokbakja/meta/menus/aside.yaml b/themes/gokbakja/meta/menus/aside.yaml index 03a575e..bf63eb4 100644 --- a/themes/gokbakja/meta/menus/aside.yaml +++ b/themes/gokbakja/meta/menus/aside.yaml @@ -14,18 +14,26 @@ items: isExternal: '0' - title: Skladlar + nesting: null type: cms-page + url: null code: '' reference: stocks + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: ri-store-2-line isExternal: '0' - title: 'Sklad Hereketleri' + nesting: null type: url url: '#a' code: '' + reference: null + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: ri-arrow-up-down-line @@ -33,18 +41,26 @@ items: items: - title: Hereketler + nesting: null type: cms-page + url: null code: '' reference: product/actions + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' isExternal: '0' - title: 'Täze Haryt Sal' + nesting: null type: url url: /product/actions/inbox code: '' + reference: null + cmsPage: null + replace: null viewBag: isHidden: '0' cssClass: '' @@ -65,13 +81,9 @@ items: items: - title: 'Çig Mal Sarp Ediş' - nesting: null - type: url - url: /ss + type: cms-page code: '' - reference: null - cmsPage: null - replace: null + reference: production viewBag: isHidden: '0' cssClass: '' diff --git a/themes/gokbakja/pages/product/actions.htm b/themes/gokbakja/pages/product/actions.htm index c5d29d5..3dc643d 100644 --- a/themes/gokbakja/pages/product/actions.htm +++ b/themes/gokbakja/pages/product/actions.htm @@ -51,9 +51,12 @@ function onStart(){ ?> == {% put styles %} - - - + + + @@ -66,139 +69,170 @@ function onStart(){ {% set stocks = builderList2.records %}
{{type}}
-{{type}}
+| № | -Haryt | -Görnüşi | -Mukdary | -Senesi | -Sklad | -Sazlamalar | -
|---|
| № | +Haryt | +Görnüşi | +Mukdary (KG) | +Senesi | +Sklad | +Bellik | +Sazlamalar | +
|---|---|---|---|---|---|---|---|
| {{key + 1}} | -{{record.product.name}} | -- {{record.type}} | -{{record.amount}} | -{{record.created_at|date('d.m.Y')}} | -{{record.stock.name}} | -+ | |
| {{key + 1}} | +{{record.product.name}} | ++ {{record.type}} + | +{{record.amount|number_format}} kg | +{{record.created_at|date('d.m.Y')}} | +{{record.stock.name}} | +{{record.note}} | +- | -
| № | -Haryt | -Görnüşi | -Mukdary | -Senesi | -Sklad | -Sazlamalar | -