action settings

This commit is contained in:
Shohrat 2023-11-07 02:06:48 +05:00
parent c5c62ad35b
commit 0dfe1f6801
27 changed files with 1857 additions and 143 deletions

View File

@ -8,6 +8,8 @@ class Plugin extends PluginBase
{
return [
'Romanah\Gokbakja\Components\Action' => 'action',
'Romanah\Gokbakja\Components\RulonAction' => 'rulonAction',
'Romanah\Gokbakja\Components\BagAction' => 'bagAction',
'Romanah\Gokbakja\Components\Production' => 'production',
'Romanah\Gokbakja\Components\MachineProduction' => 'machineProduction',
'Romanah\Gokbakja\Components\Sewer' => 'sewer',

View File

@ -0,0 +1,234 @@
<?php
namespace Romanah\Gokbakja\Components;
use Cms\Classes\ComponentBase;
use Romanah\Gokbakja\Models\BagAction as ActionModel;
use Redirect;
use Flash;
use Romanah\Gokbakja\Models\SewerProduction;
class BagAction extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'BagAction',
'description' => 'BagAction settings'
];
}
public function onCreateAction()
{
$user = \Auth::user();
$data = post();
$actionType = $data["type"];
$stock = Stock::where("type", 'bag')->first();
if ($actionType == 'inbox') {
$productionMachine = SewerProduction::where("id", $data["itemId"])->first();
$createResult = new ActionModel();
$createResult->product_id = $data["itemId"];
$createResult->type = 'inbox';
$createResult->status_accountant = "new";
$createResult->status_director = "new";
$createResult->note = "";
$createResult->amount = $productionMachine->produced_bag_qty;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->save();
// $createResult = DollorModel::create([]);
// dd($data);
if ($createResult) {
Flash::success("Rulon Action Inbox Ustunlikli Goshuldy");
return Redirect::refresh();
}
} elseif ($actionType == 'outbox') {
$qty = ActionModel::where("product_id", $data["product_id"])
->where("stock_id", $stock->id)
->where("status_accountant", "accept")
->where("status_director", "accept")
->sum("produced_bag_qty");
// $productOutbox = ActionModel::where("product_id", $data["product_id"])
// ->where("stock_id", $data["stock_id"])
// ->where("type", "outbox")
// ->sum("quantity");
// $productQuantity = $productInbox - $productOutbox;
// dump($productQuantity);
if ($qty >= $data["quantity"]) {
$createResult = new ActionModel();
$createResult->product_id = $data["product_id"];
$createResult->type = 'outbox';
$createResult->amount = -$data["quantity"];
$createResult->stock_id = $data["stock_id"];
$createResult->user_id = $user->id;
$createResult->save();
// $createResult = DollorModel::create([]);
// dd($data);
if ($createResult) {
Flash::success("Harytlar sklatdan ustunlikli chykaryldy");
return Redirect::refresh();
}
} else {
Flash::error("Bu mukdarda haryt ýok");
return Redirect::refresh();
}
}
}
public function onUpdateAction()
{
$user = \Auth::user();
$data = post();
$updateResult = ActionModel::where('id', $data["id"])
->update(array(
'note' => $data["note"],
'user_id' => $user->id,
));
// $createResult = DollorModel::create([]);
// dd($data);
if ($updateResult) {
Flash::success("Action Ustunlikli Uytgedildi");
return Redirect::refresh();
}
}
public function onGetAction()
{
$id = post('id');
return ActionModel::where('id', $id)->first();
}
public function onDeleteAction()
{
$id = post('id');
$item = ActionModel::Find($id);
$item->delete();
if ($item) {
Flash::success("Action Ustunlikli Pozuldy");
return Redirect::refresh();
}
}
// public function onDeleteSellerAction()
// {
// $id = post('id');
// $item = SellerActionModel::Find($id);
// $item->delete();
// if ($item) {
// Flash::success("Action Ustunlikli Pozuldy");
// return Redirect::refresh();
// }
// }
// public function onGetSellerAction()
// {
// $id = post('id');
// return SellerActionModel::where('id', $id)->first();
// }
// public function onCreateSellerAction()
// {
// $user = \Auth::user();
// $data = post();
// $qty = ActionModel::where("product_id", $data["product_id"])
// ->where("stock_id", $data["stock_id"])
// ->sum("quantity");
// if ($qty >= $data["quantity"]) {
// $createResult = new ActionModel();
// $createResult->product_id = $data["product_id"];
// $createResult->type = 'outbox';
// $createResult->quantity = -$data["quantity"];
// $createResult->stock_id = $data["stock_id"];
// $createResult->user_id = $user->id;
// $createResult->save();
// $createSellerResult = new SellerActionModel();
// $createSellerResult->seller_id = $data["seller_id"];
// $createSellerResult->product_id = $data["product_id"];
// $createSellerResult->quantity = $data["quantity"];
// $createSellerResult->stock_id = $data["stock_id"];
// $createSellerResult->user_id = $user->id;
// $createSellerResult->save();
// // $createResult = DollorModel::create([]);
// // dd($data);
// if ($createResult && $createSellerResult) {
// Flash::success("Action Outbox Ustunlikli Goshuldy");
// return Redirect::refresh();
// }
// } else {
// Flash::error("Данного товара нет в наличии");
// return Redirect::refresh();
// }
// }
// public function onUpdateSellerAction()
// {
// $user = \Auth::user();
// $data = post();
// $qty = ActionModel::where("product_id", $data["product_id"])
// ->where("stock_id", $data["stock_id"])
// ->sum("quantity");
// if ($qty >= $data["quantity"]) {
// $updateResult = SellerActionModel::where('id', $data["id"])
// ->update(array(
// 'product_id' => $data["product_id"],
// 'quantity' => $data["quantity"],
// 'stock_id' => $data["stock_id"],
// 'user_id' => $user->id,
// ));
// // $createResult = DollorModel::create([]);
// // dd($data);
// if ($updateResult) {
// Flash::success("Action Ustunlikli Uytgedildi");
// return Redirect::refresh();
// }
// } else {
// Flash::error("Данного товара нет в наличии");
// return Redirect::refresh();
// }
// }
}

View File

@ -19,6 +19,7 @@ use Romanah\Gokbakja\Models\BagType;
use Romanah\Gokbakja\Models\Journal;
use Romanah\Gokbakja\Models\Machine;
use Romanah\Gokbakja\Models\PivotSewer;
use Romanah\Gokbakja\Models\RulonAction;
class MachineProduction extends ComponentBase
{
@ -230,12 +231,25 @@ class MachineProduction extends ComponentBase
$html_data = '';
for ($x = 0; $x < count($machineProductions); $x++) {
$inStock = RulonAction::where("product_id", $machineProductions[$x]->id)->count();
$editBtn = '';
if($machineProductions[$x]->user_id != $user->id){
$editBtn = '<a href="#" style="font-weight: bold;color: darkred;"> Size degişli däl </a>';
}else{
$editBtn = '<a href="#" data-request="onSetFormUpdate" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg" data-request-data="machineProdId: ' . $machineProductions[$x]->id . '" style="font-weight: bold;color: darkred;"> ÜÝTGET </a>';
if(!$inStock){
$editBtn = '<button data-request="onSetFormUpdate" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg" data-request-data="machineProdId: ' . $machineProductions[$x]->id . '" type="button" class="btn btn-warning waves-light waves-effect"><i class="fa fa-pen"></i></button>
<button data-request="onCreateAction" data-request-data="type: '.((string) "'inbox'") .', itemId: '.$machineProductions[$x]->id.'" data-request-confirm="Bu harydy sklada salmak iskleýäňizmi?" type="button" class="btn btn-success waves-light waves-effect"><i class="fa ri-upload-line"></i></button>
';
}else{
$editBtn = '<a href="#" style="font-weight: bold;color: darkgreen;"> Sklada salyndy </a>';
}
}
// dd($machineProductions[0]->bag_size);
$html_data .= '<tr>

View File

@ -0,0 +1,229 @@
<?php
namespace Romanah\Gokbakja\Components;
use Cms\Classes\ComponentBase;
use Romanah\Gokbakja\Models\RulonAction as ActionModel;
use Redirect;
use Flash;
use Romanah\Gokbakja\Models\ProductionMachine;
use Romanah\Gokbakja\Models\Stock;
class RulonAction extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'RulonAction',
'description' => 'RulonAction settings'
];
}
public function onCreateAction()
{
$user = \Auth::user();
$data = post();
$actionType = $data["type"];
$stock = Stock::where("type", 'rulon')->first();
if ($actionType == 'inbox') {
$productionMachine = ProductionMachine::where("id", $data["itemId"])->first();
$createResult = new ActionModel();
$createResult->product_id = $data["itemId"];
$createResult->type = 'inbox';
$createResult->status_accountant = "new";
$createResult->status_director = "new";
$createResult->note = "";
$createResult->amount = $productionMachine->produced_weight;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->save();
// $createResult = DollorModel::create([]);
// dd($data);
if ($createResult) {
Flash::success("Rulon Action Inbox Ustunlikli Goshuldy");
return Redirect::refresh();
}
} elseif ($actionType == 'outbox') {
$qty = ActionModel::where("product_id", $data["product_id"])
->where("stock_id", $stock->id)
->where("status_accountant", "accept")
->where("status_director", "accept")
->sum("produced_weight");
if ($qty >= $data["quantity"]) {
$createResult = new ActionModel();
$createResult->product_id = $data["product_id"];
$createResult->type = 'outbox';
$createResult->amount = -$data["quantity"];
$createResult->stock_id = $data["stock_id"];
$createResult->user_id = $user->id;
$createResult->save();
// $createResult = DollorModel::create([]);
// dd($data);
if ($createResult) {
Flash::success("Harytlar sklatdan ustunlikli chykaryldy");
return Redirect::refresh();
}
} else {
Flash::error("Bu mukdarda haryt ýok");
return Redirect::refresh();
}
}
}
public function onUpdateAction()
{
$user = \Auth::user();
$data = post();
$stock = Stock::where("type", 'rulon')->first();
$updateResult = ActionModel::where('id', $data["id"])
->update(array(
'note' => $data["note"],
'user_id' => $user->id,
));
// $createResult = DollorModel::create([]);
// dd($data);
if ($updateResult) {
Flash::success("Action Ustunlikli Uytgedildi");
return Redirect::refresh();
}
}
public function onGetAction()
{
$id = post('id');
return ActionModel::where('id', $id)->first();
}
public function onDeleteAction()
{
$id = post('id');
$item = ActionModel::Find($id);
$item->delete();
if ($item) {
Flash::success("Action Ustunlikli Pozuldy");
return Redirect::refresh();
}
}
// public function onDeleteSellerAction()
// {
// $id = post('id');
// $item = SellerActionModel::Find($id);
// $item->delete();
// if ($item) {
// Flash::success("Action Ustunlikli Pozuldy");
// return Redirect::refresh();
// }
// }
// public function onGetSellerAction()
// {
// $id = post('id');
// return SellerActionModel::where('id', $id)->first();
// }
// public function onCreateSellerAction()
// {
// $user = \Auth::user();
// $data = post();
// $qty = ActionModel::where("product_id", $data["product_id"])
// ->where("stock_id", $data["stock_id"])
// ->sum("quantity");
// if ($qty >= $data["quantity"]) {
// $createResult = new ActionModel();
// $createResult->product_id = $data["product_id"];
// $createResult->type = 'outbox';
// $createResult->quantity = -$data["quantity"];
// $createResult->stock_id = $data["stock_id"];
// $createResult->user_id = $user->id;
// $createResult->save();
// $createSellerResult = new SellerActionModel();
// $createSellerResult->seller_id = $data["seller_id"];
// $createSellerResult->product_id = $data["product_id"];
// $createSellerResult->quantity = $data["quantity"];
// $createSellerResult->stock_id = $data["stock_id"];
// $createSellerResult->user_id = $user->id;
// $createSellerResult->save();
// // $createResult = DollorModel::create([]);
// // dd($data);
// if ($createResult && $createSellerResult) {
// Flash::success("Action Outbox Ustunlikli Goshuldy");
// return Redirect::refresh();
// }
// } else {
// Flash::error("Данного товара нет в наличии");
// return Redirect::refresh();
// }
// }
// public function onUpdateSellerAction()
// {
// $user = \Auth::user();
// $data = post();
// $qty = ActionModel::where("product_id", $data["product_id"])
// ->where("stock_id", $data["stock_id"])
// ->sum("quantity");
// if ($qty >= $data["quantity"]) {
// $updateResult = SellerActionModel::where('id', $data["id"])
// ->update(array(
// 'product_id' => $data["product_id"],
// 'quantity' => $data["quantity"],
// 'stock_id' => $data["stock_id"],
// 'user_id' => $user->id,
// ));
// // $createResult = DollorModel::create([]);
// // dd($data);
// if ($updateResult) {
// Flash::success("Action Ustunlikli Uytgedildi");
// return Redirect::refresh();
// }
// } else {
// Flash::error("Данного товара нет в наличии");
// return Redirect::refresh();
// }
// }
}

View File

@ -10,8 +10,11 @@ use Redirect;
use Carbon\Carbon;
use Flash;
use DB;
use Romanah\Gokbakja\Models\BagAction;
use Romanah\Gokbakja\Models\ProductionMachine;
use Romanah\Gokbakja\Models\PivotSewer;
use Romanah\Gokbakja\Models\RulonAction;
use Romanah\Gokbakja\Models\Stock;
class Sewer extends ComponentBase
{
@ -122,64 +125,74 @@ class Sewer extends ComponentBase
public function onUpdateSewerItem()
{
$currentDate = Carbon::now()->timezone('UTC +05:00');
$user = \Auth::user();
$currentDateFormat = $currentDate->format('Y-m-d');
$stock = Stock::where("type", 'rulon')->first();
$stockBag = Stock::where("type", 'bag')->first();
$data = post();
if ($data["produced_bag_qty"] == 0) {
Flash::error("Tikilen halta sanyny girizin");
return Redirect::refresh();
}elseif(!$data["produced_bag_qty"] && $data["status"] == "working"){
$sewer = SewerModel::where("id", $data["sewer_id"])->first();
$pivotSewer = PivotSewer::where("sewer_production_id", $data["sewer_id"])->first();
$pivotSewer->status = $data["status"];
$pivotSewer->save();
if ($sewer && $pivotSewer) {
Flash::success("Maglumatlar Ustunlikli Üýtgedildi");
return Redirect::refresh();
} else {
Flash::error("Yalnyshlyk bar!!");
return Redirect::refresh();
}
} else {
if ($data["status"] == "complated") {
$sewer = SewerModel::where("id", $data["sewer_id"])->first();
$pivotSewer = PivotSewer::where("sewer_production_id", $data["sewer_id"])->first();
$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"]);
$spentCalc = (float)((float) $data["produced_bag_qty"] * (float) $pivotSewer->bag_gram) / 1000;
$leftCalc = (float)((float)$pivotSewer->amount - $spentCalc);
// $spentCalc = (float)((float) $pivotSewer->amount - (float) $data["left_amount"]);
$spentCalc = (float)((float) $data["produced_bag_qty"] * (float) $pivotSewer->bag_gram) / 1000;
$leftCalc = (float)((float)$pivotSewer->amount - $spentCalc);
$sewer->produced_bag_qty = (float) $data["produced_bag_qty"];
$sewer->width = (float) $data["width"];
$sewer->height = (float) $data["height"];
$sewer->date = Carbon::parse($data["date"])->format('Y-m-d');
$sewer->note = $data["note"];
$sewer->save();
$sewer->produced_bag_qty = (float) $data["produced_bag_qty"];
$sewer->width = (float) $data["width"];
$sewer->height = (float) $data["height"];
$sewer->date = Carbon::parse($data["date"])->format('Y-m-d');
$sewer->note = $data["note"];
$sewer->save();
$pivotSewer->left_amount = (float) $leftCalc;
$pivotSewer->spent_amount = (float) $spentCalc;
$pivotSewer->status = $data["status"];
$pivotSewer->save();
$pivotSewer->left_amount = (float) $leftCalc;
$pivotSewer->spent_amount = (float) $spentCalc;
$pivotSewer->status = $data["status"];
$pivotSewer->save();
if ($leftCalc == 0 && $data["status"] == "complated") {
$machinProduction = ProductionMachine::where("id", $pivotSewer->machine_production_id)->first();
$machinProduction->is_finished = true;
$machinProduction->save();
}elseif($data["status"] != "complated"){
Flash::error("Status tamamlamaly!");
return Redirect::refresh();
}
$currentRulonAction = RulonAction::where("id", $pivotSewer->rulon_action_id)->first();
if ($sewer && $pivotSewer) {
Flash::success("Maglumatlar Ustunlikli Üýtgedildi");
return Redirect::refresh();
} else {
Flash::error("Yalnyshlyk bar!!");
$createResult = new RulonAction();
$createResult->product_id = $currentRulonAction->product_id;
$createResult->type = 'inbox';
$createResult->status_accountant = "new";
$createResult->status_director = "new";
$createResult->note = "#Dikiş" . $sewer->id . " galyndy";
$createResult->amount = $pivotSewer->left_amount;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->save();
$createResultBag = new BagAction();
$createResultBag->product_id = $sewer->id;
$createResultBag->type = 'inbox';
$createResultBag->status_accountant = "new";
$createResultBag->status_director = "new";
$createResultBag->note = "#Dikiş" . $sewer->id . " #Rulon".$currentRulonAction->product_id;
$createResultBag->amount = $sewer->produced_bag_qty;
$createResultBag->stock_id = $stockBag->id;
$createResultBag->user_id = $user->id;
$createResultBag->save();
if ($sewer && $pivotSewer && $createResult && $createResultBag) {
Flash::success("Maglumatlar Ustunlikli Üýtgedildi");
return Redirect::refresh();
} else {
Flash::error("Yalnyshlyk bar!!");
return Redirect::refresh();
}
}else{
Flash::error("Statusy Tamlaň");
return Redirect::refresh();
}
}
@ -190,13 +203,26 @@ class Sewer extends ComponentBase
$user = \Auth::user();
$html_data = '';
$sewerDatas = SewerModel::with(["employee", "machin_production.bag_size", "machin_production.bag_type", "machin_production.color", "pivot_sewer"])->orderBy('id', 'DESC')->get();
$sewerDatas = SewerModel::with(["employee"])->with(["pivot_sewer" => function ($q) {
$q->with(["rulon_action.product.bag_type", "rulon_action.product.bag_size", "rulon_action.product.color"]);
}])->orderBy('id', 'DESC')->get();
// dd($sewerDatas);
for ($x = 0; $x < count($sewerDatas); $x++) {
$dateTitle = ($sewerDatas[$x]->date == null ? "" : Carbon::parse($sewerDatas[$x]->date)->format('d.m.Y'));
$statusTitle = '';
if ($sewerDatas[$x]->pivot_sewer[0]->status == "working") {
$statusTitle = "Işlenilýär";
} else {
$statusTitle = "Tamamlandy";
}
$editBtn = '';
if($sewerDatas[$x]->user_id != $user->id){
if ($sewerDatas[$x]->user_id != $user->id) {
$editBtn = '<div style="display: flex;justify-content: center;">
<div style="margin-right: 10px;">
<a type="button"
@ -206,7 +232,7 @@ class Sewer extends ComponentBase
</a>
</div>
</div>';
}else{
} else {
$editBtn = '<div style="display: flex;justify-content: center;">
<div style="margin-right: 10px;">
<a type="button" data-request="onModalSetSewer"
@ -227,27 +253,19 @@ class Sewer extends ComponentBase
</div>';
}
$statusTitle = '';
if ($sewerDatas[$x]->pivot_sewer[0]->status == "working") {
$statusTitle = "Işlenilýär";
} else {
$statusTitle = "Tamamlandy";
}
$dateTitle = ($sewerDatas[$x]->date == null ? "" : Carbon::parse($sewerDatas[$x]->date)->format('d.m.Y'));
$html_data .= '<tr>
<td style="font-weight: bold;">' . ($x + 1) . '</td>
<td style="font-weight: bold;"> #Dikiş' . $sewerDatas[$x]->id . '</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">ini: ' . ($sewerDatas[$x]->width ?? "") . '- boyy:' . ($sewerDatas[$x]->height ?? "") . ' </span>
</td>
<td> #' . $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 ?? "") . '
<td> #Rulon' . $sewerDatas[$x]->pivot_sewer[0]->rulon_action->product_id . '- ' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->bag_size->width ?? "") . 'x' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->bag_size->height ?? "") . 'm2, ' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->bag_type->name ?? "") . ', ' . ($sewerDatas[$x]->pivot_sewer[0]->rulon_action->product->color->name ?? "") . '
</td>
<td><a href="#" style="font-weight: bold;">' . $sewerDatas[$x]->employee->name . '</a></td>
<td>' . $dateTitle . '</td>
<td>' . (number_format($sewerDatas[$x]->pivot_sewer[0]->bag_gram ?? 0, 2)) . ' gr</td>
<td>' . $dateTitle . '</td>
<td>' . (number_format($sewerDatas[$x]->pivot_sewer[0]->bag_gram ?? 0, 2)) . ' gr</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">' . number_format($sewerDatas[$x]->pivot_sewer[0]->amount, 2) . ' kg</span>
</td>
@ -256,9 +274,10 @@ class Sewer extends ComponentBase
<td>' . number_format($sewerDatas[$x]->pivot_sewer[0]->left_amount, 2) . ' kg</td>
<td><span class="badge badge-soft-warning"
style="font-size: 14px;">' . $statusTitle . '</span></td>
<td>' . $sewerDatas[$x]->note . '</td>
<td>
'. $editBtn .'
' . $editBtn . '
</td>
</tr>';
}
@ -303,19 +322,19 @@ class Sewer extends ComponentBase
}
if ($status) {
$sewerProductions->with("pivot_sewer")->whereHas('pivot_sewer', function ($query) use($status) {
$sewerProductions->with("pivot_sewer")->whereHas('pivot_sewer', function ($query) use ($status) {
$query->where('status', $status);
});
}
if ($bag_gram) {
$sewerProductions->with("pivot_sewer")->whereHas('pivot_sewer', function ($query) use($bag_gram) {
$sewerProductions->with("pivot_sewer")->whereHas('pivot_sewer', function ($query) use ($bag_gram) {
$query->where('bag_gram', $bag_gram);
});
}
if ($color_id) {
$sewerProductions->with("machin_production")->whereHas('machin_production', function ($query) use($color_id) {
$sewerProductions->with("machin_production")->whereHas('machin_production', function ($query) use ($color_id) {
$query->where('color_id', $color_id);
});
}
@ -343,7 +362,7 @@ class Sewer extends ComponentBase
$sewerProductionsSumBagQty = $sewerProductions->sum("produced_bag_qty");
$sewerProductionsamount = PivotSewer::whereIn("sewer_production_id", $sewerIds)->sum("spent_amount");
// dd($sewerProductionsamount->spentAmount);
// dd($sewerProductionsamount->spentAmount);
$html_data = '';
for ($x = 0; $x < count($sewerDatas); $x++) {
@ -417,22 +436,9 @@ 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;
}
$currentRulonAction = RulonAction::where("id", $data["rulon_action_id"])->first();
$rulonAmountSum = $currentRulonAction->amount;
$stock = Stock::where("type", 'rulon')->first();
// dd($leftAmount);
$createSewer = new SewerModel();
@ -440,27 +446,36 @@ class Sewer extends ComponentBase
$createSewer->produced_bag_qty = 0;
$createSewer->user_id = $user->id;
$createSewer->note = $data["note"] ?? '';
$createSewer->machine_production_id = $data["machine_production_id"];
$createSewer->rulon_action_id = $data["rulon_action_id"];
$createSewer->width = (float) $data["width"];
$createSewer->height = (float) $data["height"];
$createSewer->date = Carbon::parse($data["date"])->format('Y-m-d');
$createSewer->save();
$createPivotSewer = new PivotSewer();
$createPivotSewer->machine_production_id = $createSewer->machine_production_id;
$createPivotSewer->rulon_action_id = $createSewer->rulon_action_id;
$createPivotSewer->sewer_production_id = $createSewer->id;
$createPivotSewer->left_amount = 0;
$createPivotSewer->bag_gram = (float) $data["bag_gram"];
$createPivotSewer->amount = $leftAmount;
$createPivotSewer->amount = $rulonAmountSum;
$createPivotSewer->save();
$createResult = new RulonAction();
$createResult->product_id = $currentRulonAction->product_id;
$createResult->type = 'outbox';
$createResult->amount = -$rulonAmountSum;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->note = "#Dikiş".$createSewer->id." üçin çykaryldy";
$createResult->save();
if ($createSewer && $createPivotSewer) {
if ($createSewer && $createPivotSewer && $createResult) {
Flash::success("Maglumatlar Ustunlikli Goshuldy");
return Redirect::refresh();
} else {
return Flash::error("Yalnyshlyk bar!!");
Flash::error("Yalnyshlyk bar!!");
return Redirect::refresh();
}
}

View File

@ -0,0 +1,41 @@
<?php namespace Romanah\Gokbakja\Models;
use Model;
/**
* Model
*/
class BagAction extends Model
{
use \October\Rain\Database\Traits\Validation;
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
public $belongsTo = [
'product' => [
'Romanah\Gokbakja\Models\Product',
'key'=>'product_id'
],
'stock' => [
'Romanah\Gokbakja\Models\Stock',
'key'=>'stock_id'
],
'user' => [
'RainLab\User\Models\User',
'key'=>'user_id'
],
];
/**
* @var string The database table used by the model.
*/
public $table = 'romanah_gokbakja_bag_actions';
/**
* @var array Validation rules
*/
public $rules = [
];
}

View File

@ -18,9 +18,9 @@ class PivotSewer extends Model
'Romanah\Gokbakja\Models\SewerProduction',
'key' => 'sewer_production_id'
],
'machin_production' => [
'Romanah\Gokbakja\Models\ProductionMachine',
'key' => 'machine_production_id'
'rulon_action' => [
'Romanah\Gokbakja\Models\RulonAction',
'key' => 'rulon_action_id'
],
];

View File

@ -0,0 +1,41 @@
<?php namespace Romanah\Gokbakja\Models;
use Model;
/**
* Model
*/
class RulonAction extends Model
{
use \October\Rain\Database\Traits\Validation;
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
public $belongsTo = [
'product' => [
'Romanah\Gokbakja\Models\ProductionMachine',
'key'=>'product_id'
],
'stock' => [
'Romanah\Gokbakja\Models\Stock',
'key'=>'stock_id'
],
'user' => [
'RainLab\User\Models\User',
'key'=>'user_id'
],
];
/**
* @var string The database table used by the model.
*/
public $table = 'romanah_gokbakja_rulon_action';
/**
* @var array Validation rules
*/
public $rules = [
];
}

View File

@ -11,7 +11,8 @@ fields:
label: 'Sklad Görnüşi'
options:
raw: 'Çig mal'
produced: 'Önen önüm'
rulon: Rulon
bag: Halta
span: auto
default: raw
type: balloon-selector

View File

@ -0,0 +1,32 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateRomanahGokbakjaBagActions extends Migration
{
public function up()
{
Schema::create('romanah_gokbakja_bag_actions', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->string('type');
$table->integer('product_id');
$table->integer('stock_id');
$table->integer('user_id');
$table->string('status_accountant')->default('new');
$table->string('status_director')->default('new');
$table->double('amount', 10, 0);
$table->text('note');
});
}
public function down()
{
Schema::dropIfExists('romanah_gokbakja_bag_actions');
}
}

View File

@ -0,0 +1,32 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateRomanahGokbakjaRulonAction extends Migration
{
public function up()
{
Schema::create('romanah_gokbakja_rulon_action', function($table)
{
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->string('type');
$table->integer('product_id');
$table->integer('stock_id');
$table->integer('user_id');
$table->string('status_accountant')->default('new');
$table->string('status_director')->default('new');
$table->double('amount', 10, 0);
$table->text('note');
});
}
public function down()
{
Schema::dropIfExists('romanah_gokbakja_rulon_action');
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaAction3 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_action', function($table)
{
$table->string('product_type')->default('raw_material');
});
}
public function down()
{
Schema::table('romanah_gokbakja_action', function($table)
{
$table->dropColumn('product_type');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaAction4 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_action', function($table)
{
$table->dropColumn('product_type');
});
}
public function down()
{
Schema::table('romanah_gokbakja_action', function($table)
{
$table->string('product_type', 191)->default('raw_material');
});
}
}

View File

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

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaSewerProduction7 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_sewer_production', function($table)
{
$table->renameColumn('machine_production_id', 'sewer_production_id');
});
}
public function down()
{
Schema::table('romanah_gokbakja_sewer_production', function($table)
{
$table->renameColumn('sewer_production_id', 'machine_production_id');
});
}
}

View File

@ -0,0 +1,23 @@
<?php namespace Romanah\Gokbakja\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateRomanahGokbakjaSewerProduction8 extends Migration
{
public function up()
{
Schema::table('romanah_gokbakja_sewer_production', function($table)
{
$table->renameColumn('sewer_production_id', 'rulon_action_id');
});
}
public function down()
{
Schema::table('romanah_gokbakja_sewer_production', function($table)
{
$table->renameColumn('rulon_action_id', 'sewer_production_id');
});
}
}

View File

@ -330,3 +330,24 @@
1.0.111:
- 'Updated table romanah_gokbakja_load_transport'
- builder_table_update_romanah_gokbakja_load_transport.php
1.0.112:
- 'Updated table romanah_gokbakja_action'
- builder_table_update_romanah_gokbakja_action_3.php
1.0.113:
- 'Updated table romanah_gokbakja_action'
- builder_table_update_romanah_gokbakja_action_4.php
1.0.114:
- 'Created table romanah_gokbakja_bag_actions'
- builder_table_create_romanah_gokbakja_bag_actions.php
1.0.115:
- 'Created table romanah_gokbakja_rulon_action'
- builder_table_create_romanah_gokbakja_rulon_action.php
1.0.116:
- 'Updated table romanah_gokbakja_pivot_sewer'
- builder_table_update_romanah_gokbakja_pivot_sewer_4.php
1.0.117:
- 'Updated table romanah_gokbakja_sewer_production'
- builder_table_update_romanah_gokbakja_sewer_production_7.php
1.0.118:
- 'Updated table romanah_gokbakja_sewer_production'
- builder_table_update_romanah_gokbakja_sewer_production_8.php

View File

@ -14,15 +14,52 @@ items:
isExternal: '0'
-
title: 'Taýyn Önüm Sklady'
type: url
url: /
type: cms-page
code: ''
reference: stock/production
viewBag:
isHidden: '0'
cssClass: ri-dashboard-line
isExternal: '0'
-
title: 'Taýyn Önüm Hereketler'
title: 'Halta Sklad Hereketleri'
type: url
url: /afdf
code: ''
viewBag:
isHidden: '0'
cssClass: ri-shopping-bag-line
isExternal: '0'
items:
-
title: 'Halta Hereketleri'
type: cms-page
code: ''
reference: actions/bag
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Giriş Hereketleri'
type: url
url: /actions/bag/inbox
code: ''
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Çykyş Hereketleri'
type: url
url: /actions/bag/outbox
code: ''
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Rulon Sklad Hereketleri'
type: url
url: /dsadasd
code: ''
@ -32,18 +69,27 @@ items:
isExternal: '0'
items:
-
title: 'Rulon Herkedi'
title: 'Rulon Herketleri'
type: cms-page
code: ''
reference: actions/rulon
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Giriş Hereketleri'
type: url
url: /adgh
url: /actions/rulon/inbox
code: ''
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Haltalar Herkedi'
title: 'Çykyş Hereketleri'
type: url
url: /jg
url: /actions/rulon/outbox
code: ''
viewBag:
isHidden: '0'
@ -51,18 +97,26 @@ items:
isExternal: '0'
-
title: 'Çig Mal Skladlar'
nesting: null
type: cms-page
url: null
code: ''
reference: stock/stocks
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ri-store-2-line
isExternal: '0'
-
title: 'Çig Mal Hereketleri'
nesting: null
type: url
url: '#a'
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ri-arrow-up-down-line
@ -70,39 +124,27 @@ items:
items:
-
title: Hereketler
nesting: null
type: cms-page
url: null
type: url
url: /product/actions
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: ''
isExternal: '0'
-
title: 'Haryt Çykarmak'
nesting: null
type: url
url: /product/actions/outbox
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
isHidden: '0'
cssClass: ''

View File

@ -0,0 +1,246 @@
title = "actions/bag"
url = "/actions/bag/:type?"
layout = "platform_main"
is_hidden = 0
[bagAction]
==
<?php
function onStart(){
$type = $this->param("type");
$this["type"] = $this->param("type");
//$this["products"] = '';
//dump($catId);
$this["stocksq"] = Romanah\Gokbakja\Models\Stock::orderBy("id", "desc")->where("type", 'bag')->get();
if($type){
$this["actions"] = Romanah\Gokbakja\Models\BagAction::orderBy("id", "desc")
->with(['stock'])
->where("type", $type)
->get();
}else{
$this["actions"] = Romanah\Gokbakja\Models\BagAction::orderBy("id", "desc")
->with(['stock'])
->get();
}
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
{% endput %}
{% set products = builderList.records %}
{% set stocks = builderList2.records %}
<div class="row">
<div class="col-12">
<div class="alert alert-info" role="alert">
Direktor bilen Bugalter tassyklamadyk bolsa sklat-da hasaba goşulmaz.
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Halta Sklad Hereketleri</h3>
<p class="card-title-desc" style="color: #6c6ff5;">{{type}}</p>
</div>
<div class="col-md-6" style="text-align: right;">
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Görnüşi</th>
<th>Mukdary (sany)</th>
<th>Senesi</th>
<th>Sklad</th>
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
</tr>
</thead>
<tbody>
{% for key, record in actions %}
<tr>
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
<td style="text-align: center;">
<span
class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}"
style="font-size: 14px;">{% if record.type == 'inbox' %} GIRIŞ {% else %} ÇYKYŞ {% endif %}</span>
</td>
<td style="color: #500101;font-weight: bold;">{{record.amount|number_format}}</td>
<td>{{record.created_at|date('d.m.Y')}}</td>
<td>{{record.stock.name}}</td>
<td style="color: {% if record.status_director == 'accept' %}darkgreen {% else %}darkred {% endif %};">{% if record.status_director == 'accept' %} + {% else %} Tassyklanmadyk {% endif %}</td>
<td style="color: {% if record.status_accountant == 'accept' %}darkgreen {% else %}darkred {% endif %};">{% if record.status_accountant == 'accept' %} + {% else %} Tassyklanmadyk {% endif %}</td>
<td>{{record.note}}</td>
<td>
<div style="display: flex;justify-content: center;">
{% if record.user_id != user.id %}
<div style="margin-right: 10px;">
<a type="button"
class="btn btn-warning waves-effect waves-light"
style="padding-top: 5px;padding-bottom: 5px;">
<i class="ri-user-line align-middle me-2"></i> Size degişli däl
</a>
</div>
{% else %}
<div style="margin-right: 10px;">
<a onClick="getData({{record.id}});" type="button"
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;">
<i class="ri-pencil-line align-middle me-2"></i> Täzele
</a>
</div>
<div>
<a type="button" data-request-confirm="Вы уверены? Удалить этот продукт"
data-request-data="id:{{record.id}}" data-request="onDeleteAction"
class="btn btn-danger waves-effect waves-light"
style="padding-top: 5px;padding-bottom: 5px;">
<i class="ri-close-line align-middle me-2"></i> Poz
</a>
</div>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Görnüşi</th>
<th>Mukdary (sany)</th>
<th>Senesi</th>
<th>Sklad</th>
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
</tr>
</tfoot>
</table>
</div>
<div class="offcanvas offcanvas-top" id="offcanvasBottom" aria-labelledby="offcanvasBottomLabel"
style="height: 40%;">
<div class="offcanvas-header">
<h5 id="offcanvasBottomLabel">Täze Hereket</h5>
<button onClick="createData();" type="button" class="btn-close text-reset"
data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<form class="needs-validation" novalidate data-request="onCreateAction" id="prodForm">
<div class="row">
<!-- <div class="col-md-4">
<div class="mb-3">
<label for="validationCustom02" class="form-label">Mukdary</label>
<input type="number" class="form-control" id="validationCustom02"
placeholder="Mukdary" name="quantity" required>
<div class="valid-feedback">
dogry
</div>
</div>
</div>
<div class="col-md-4">
<label for="validationCustom03" class="form-label">Sklad</label>
<select class="form-control select2" name="stock_id" id="stockId">
<option value="0">Saýla</option>
{% for record in stocksq %}
<option value="{{record.id}}" style="text-transform: capitalize;">{{record.name}}
</option>
{% endfor %}
</select>
</div> -->
<div class="col-md-4">
<div class="mb-3">
<label for="validationCustom02" class="form-label">Bellik</label>
<input type="text" class="form-control" id="validationCustom02" placeholder="Bellik"
name="note">
</div>
</div>
</div>
<input name="id" type="hidden" value="">
<div>
<button class="btn btn-primary" type="submit" id="formBtn">Goş</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% put scripts %}
<script>
function createData() {
$('#prodForm').attr('data-request', 'onCreateAction');
$('#formBtn').html('Goş');
$('input[name=id]').val('');
$("#productId").select2().val(0).trigger("change");
$('input[name=quantity]').val('');
$('input[name=note]').val('');
$("#stockId").select2().val(0).trigger("change");
}
function getData(id) {
$(this).request('onGetAction', {
data: { id: id },
success: function (data) {
$('#prodForm').attr('data-request', 'onUpdateAction');
$('#formBtn').html('Täzele');
$('input[name=id]').val(data.id);
$("#productId").select2().val(data.product_id).trigger("change");
$('input[name=quantity]').val(data.amount);
$('input[name=note]').val(data.note);
$("#stockId").select2().val(data.stock_id).trigger("change");
}
});
};
</script>
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,245 @@
title = "actions/rulon"
url = "/actions/rulon/:type?"
layout = "platform_main"
is_hidden = 0
[rulonAction]
==
<?php
function onStart(){
$type = $this->param("type");
$this["type"] = $this->param("type");
//$this["products"] = '';
//dump($catId);
$this["stocksq"] = Romanah\Gokbakja\Models\Stock::orderBy("id", "desc")->where("type", 'rulon')->get();
if($type){
$this["actions"] = Romanah\Gokbakja\Models\RulonAction::orderBy("id", "desc")
->with(['stock', 'product'])
->where("type", $type)
->get();
}else{
$this["actions"] = Romanah\Gokbakja\Models\RulonAction::orderBy("id", "desc")
->with(['stock', 'product'])
->get();
}
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
{% endput %}
{% set products = builderList.records %}
{% set stocks = builderList2.records %}
<div class="row">
<div class="col-12">
<div class="alert alert-info" role="alert">
Direktor bilen Bugalter tassyklamadyk bolsa sklat-da hasaba goşulmaz.
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Rulon Sklad Hereketleri</h3>
<p class="card-title-desc" style="color: #6c6ff5;">{{type}}</p>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Haryt</th>
<th>Görnüşi</th>
<th>Mukdary (KG)</th>
<th>Senesi</th>
<th>Sklad</th>
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
</tr>
</thead>
<tbody>
{% for key, record in actions %}
<tr>
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
<td><a href="/machine" style="font-weight: bold;color: #0005c5;">#Rulon{{record.product_id}}</a></td>
<td style="text-align: center;">
<span
class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}"
style="font-size: 14px;">{% if record.type == 'inbox' %} GIRIŞ {% else %} ÇYKYŞ {% endif %}</span>
</td>
<td style="color: #500101;font-weight: bold;">{{record.amount|number_format(2)}} kg</td>
<td>{{record.created_at|date('d.m.Y')}}</td>
<td>{{record.stock.name}}</td>
<td style="color: {% if record.status_director == 'accept' %}darkgreen {% else %}darkred {% endif %};">{% if record.status_director == 'accept' %} + {% else %} Tassyklanmadyk {% endif %}</td>
<td style="color: {% if record.status_accountant == 'accept' %}darkgreen {% else %}darkred {% endif %};">{% if record.status_accountant == 'accept' %} + {% else %} Tassyklanmadyk {% endif %}</td>
<td>{{record.note}}</td>
<td>
<div style="display: flex;justify-content: center;">
{% if record.user_id != user.id %}
<div style="margin-right: 10px;">
<a type="button"
class="btn btn-warning waves-effect waves-light"
style="padding-top: 5px;padding-bottom: 5px;">
<i class="ri-user-line align-middle me-2"></i> Size degişli däl
</a>
</div>
{% else %}
<div style="margin-right: 10px;">
<a onClick="getData({{record.id}});" type="button"
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;">
<i class="ri-pencil-line align-middle me-2"></i> Täzele
</a>
</div>
<div>
<a type="button" data-request-confirm="Вы уверены? Удалить этот продукт"
data-request-data="id:{{record.id}}" data-request="onDeleteAction"
class="btn btn-danger waves-effect waves-light"
style="padding-top: 5px;padding-bottom: 5px;">
<i class="ri-close-line align-middle me-2"></i> Poz
</a>
</div>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Haryt</th>
<th>Görnüşi</th>
<th>Mukdary (KG)</th>
<th>Senesi</th>
<th>Sklad</th>
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
</tr>
</tfoot>
</table>
</div>
<div class="offcanvas offcanvas-top" id="offcanvasBottom" aria-labelledby="offcanvasBottomLabel"
style="height: 40%;">
<div class="offcanvas-header">
<h5 id="offcanvasBottomLabel">Täze Hereket</h5>
<button onClick="createData();" type="button" class="btn-close text-reset"
data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<form class="needs-validation" novalidate data-request="onCreateAction" id="prodForm">
<div class="row">
<!-- <div class="col-md-4">
<div class="mb-3">
<label for="validationCustom02" class="form-label">Mukdary</label>
<input type="number" class="form-control" id="validationCustom02"
placeholder="Mukdary" name="quantity" required>
<div class="valid-feedback">
dogry
</div>
</div>
</div>
<div class="col-md-4">
<label for="validationCustom03" class="form-label">Sklad</label>
<select class="form-control select2" name="stock_id" id="stockId">
<option value="0">Saýla</option>
{% for record in stocksq %}
<option value="{{record.id}}" style="text-transform: capitalize;">{{record.name}}
</option>
{% endfor %}
</select>
</div> -->
<div class="col-md-4">
<div class="mb-3">
<label for="validationCustom02" class="form-label">Bellik</label>
<input type="text" class="form-control" id="validationCustom02" placeholder="Bellik"
name="note">
</div>
</div>
</div>
<input name="id" type="hidden" value="">
<div>
<button class="btn btn-primary" type="submit" id="formBtn">Goş</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% put scripts %}
<script>
function createData() {
$('#prodForm').attr('data-request', 'onCreateAction');
$('#formBtn').html('Goş');
$('input[name=id]').val('');
$("#productId").select2().val(0).trigger("change");
$('input[name=quantity]').val('');
$('input[name=note]').val('');
$("#stockId").select2().val(0).trigger("change");
}
function getData(id) {
$(this).request('onGetAction', {
data: { id: id },
success: function (data) {
$('#prodForm').attr('data-request', 'onUpdateAction');
$('#formBtn').html('Täzele');
$('input[name=id]').val(data.id);
$("#productId").select2().val(data.product_id).trigger("change");
$('input[name=quantity]').val(data.amount);
$('input[name=note]').val(data.note);
$("#stockId").select2().val(data.stock_id).trigger("change");
}
});
};
</script>
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -54,6 +54,8 @@ noRecordsMessage = "No records found"
detailsPage = "-"
detailsUrlParameter = "id"
pageNumber = "{{ :page }}"
[rulonAction]
==
{% set records = builderList.records %}
{% set displayColumn = builderList.displayColumn %}
@ -237,4 +239,4 @@ pageNumber = "{{ :page }}"
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,111 @@
title = "produced/bag/stock"
url = "/produced/bag/stock/:stockId"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$stockId = $this->param("stockId");
$this["actions"] = Romanah\Gokbakja\Models\BagAction::select('romanah_gokbakja_bag_actions.*')
->with(['product'])
->where("stock_id", $stockId)
->where("status_accountant", "accept")
->where("status_director", "accept")
->addSelect(DB::raw("SUM(amount) as quantity"))
->groupBy('romanah_gokbakja_bag_actions.product_id')
->get();
// dd($this["actions"]);
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;text-transform: capitalize;">
Dikilen Haltalar</h3>
<p class="card-title-desc" style="color: #6c6ff5;">sklad</p>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Dikiş Kody</th>
<th>Hereket</th>
<th>Mukdary (sany)</th>
<th>Sene</th>
<th>Sklad</th>
</tr>
</thead>
<tbody>
{% for key, record in actions %}
<tr>
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
<td><a href="/sewer/new">#Dikiş{{record.product_id}}</a></td>
<td style="text-align: center;">
<span class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}" style="font-size: 14px;">{{record.type}}</span></td>
<td style="color: #500101;font-weight: bold;">{{record.quantity|number_format}} sany</td>
<td>{{record.created_at|date('d.m.Y')}}</td>
<td>{{record.stock.name}}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Haryt Kody</th>
<th>Hereket</th>
<th>Mukdary (sany)</th>
<th>Sene</th>
<th>Sklad</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
{% put scripts %}
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -0,0 +1,116 @@
title = "produced/rulon/stock"
url = "/produced/rulon/stock/:stockId"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$stockId = $this->param("stockId");
$this["actions"] = Romanah\Gokbakja\Models\RulonAction::select('romanah_gokbakja_rulon_action.*')
->with(['product' => function($q){
$q->with(['bag_type', 'bag_size', 'color']);
}])
->where("stock_id", $stockId)
->where("status_accountant", "accept")
->where("status_director", "accept")
->addSelect(DB::raw("SUM(amount) as quantity"))
->groupBy('romanah_gokbakja_rulon_action.product_id')
->get();
// dd($this["actions"]);
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet" type="text/css" />
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css'|theme}}" rel="stylesheet">
<link href="{{'assets/libs/spectrum-colorpicker2/spectrum.min.css'|theme}}" rel="stylesheet" type="text/css">
<link href="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css'|theme}}" rel="stylesheet">
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;text-transform: capitalize;">
Öndürlen Rulonlar</h3>
<p class="card-title-desc" style="color: #6c6ff5;">sklad</p>
</div>
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Haryt Kody</th>
<th>Haryt</th>
<th>Hereket</th>
<th>Mukdary (KG)</th>
<th>Sene</th>
<th>Sklad</th>
</tr>
</thead>
<tbody>
{% for key, record in actions %}
<tr>
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
<td><a href="/machine">#Rulon{{record.product_id}}</a></td>
<td><a style="font-weight: bold;color: #0005c5;">{{record.product.bag_type.name}}, {{record.product.bag_size.name}}, {{record.product.color.name}}</a></td>
<td style="text-align: center;">
<span class="badge badge-soft-{% if record.type == 'inbox' %}success {% else %}danger {% endif %}" style="font-size: 14px;">{{record.type}}</span></td>
<td style="color: #500101;font-weight: bold;">{{record.quantity|number_format(2)}} kg</td>
<td>{{record.created_at|date('d.m.Y')}}</td>
<td>{{record.stock.name}}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Haryt Kody</th>
<th>Haryt</th>
<th>Hereket</th>
<th>Mukdary (KG)</th>
<th>Sene</th>
<th>Sklad</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
{% put scripts %}
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
<script src="{{'assets/libs/spectrum-colorpicker2/spectrum.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js'|theme}}"></script>
<script src="{{'assets/libs/admin-resources/bootstrap-filestyle/bootstrap-filestyle.min.js'|theme}}"></script>
<script src="{{'assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js'|theme}}"></script>
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -36,6 +36,7 @@ function onStart(){
//$this["products"] = '';
//dump($catId);
$this["stocksq"] = Romanah\Gokbakja\Models\Stock::orderBy("id", "desc")->where("type", 'raw')->get();
if($type){
$this["actions"] = Romanah\Gokbakja\Models\Action::orderBy("id", "desc")
@ -218,7 +219,7 @@ function onStart(){
<select class="form-control select2" name="stock_id" id="stockId">
<option value="0">Saýla</option>
{% for record in stocks %}
{% for record in stocksq %}
<option value="{{record.id}}" style="text-transform: capitalize;">{{record.name}}
</option>
{% endfor %}
@ -307,3 +308,4 @@ function onStart(){
{% endput %}
{% partial 'dataTableJs' %}

View File

@ -9,25 +9,22 @@ is_hidden = 0
function onStart(){
$this["employees"] = Romanah\Gokbakja\Models\Employee::where("status", 1)->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);
$stock = Romanah\Gokbakja\Models\Stock::where("type", 'rulon')->first();
$stockId = $stock->id;
$this["rulonsInStock"] = Romanah\Gokbakja\Models\RulonAction::select('romanah_gokbakja_rulon_action.*')
->with(['product' => function($q){
$q->with(['bag_type', 'bag_size', 'color']);
}])
->where("stock_id", $stockId)
->where("status_accountant", "accept")
->where("status_director", "accept")
->addSelect(DB::raw("SUM(amount) as quantity"))
->groupBy('romanah_gokbakja_rulon_action.product_id')
->get();
$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();
}
?>
==
@ -74,21 +71,19 @@ function onStart(){
</div>
<div class="col-3">
<label class="form-label">Rulon Saýlaň</label>
<select class="form-control select2" name="machine_production_id">
<select class="form-control select2" name="rulon_action_id">
<option value="0">Saýla</option>
{% for machineProduction in machineProductions %}
{% for machineProduction in rulonsInStock %}
{% if machineProduction.quantity > 0 %}
<option value="{{machineProduction.id}}">
#{{machineProduction.id}}-
{{machineProduction.bag_size.width}} x
{{machineProduction.bag_size.height}} m2,
{{machineProduction.bag_type.name}}, {{machineProduction.color.name}}
#Rulon{{machineProduction.product_id}}-
{{machineProduction.product.bag_size.width}} x
{{machineProduction.product.bag_size.height}} m2,
{{machineProduction.product.bag_type.name}}, {{machineProduction.product.color.name}}
{% if machineProduction.leftSum != 0 %}
({{machineProduction.leftSum|number_format(2)}} kg galyndy)
{% else %}
({{machineProduction.produced_weight|number_format(2)}} kg)
{% endif %}
--({{machineProduction.quantity}} kg)
</option>
{% endif %}
{% endfor %}
</select>
</div>

View File

@ -0,0 +1,170 @@
title = "stock/production"
url = "/stock/production"
layout = "platform_main"
is_hidden = 0
==
<?php
function onStart(){
$this["stocksq"] = Romanah\Gokbakja\Models\Stock::orderBy("id", "desc")->where("type", "!=", "raw")->get();
}
?>
==
{% put styles %}
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet"
type="text/css" />
{% endput %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Skladlar</h3>
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
</div>
<!-- <div class="col-md-6" style="text-align: right;">
<button type="button" class="btn btn-primary waves-effect waves-light"
data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom"
aria-controls="offcanvasBottom">
<i class="ri-add-line align-middle ms-2" style="font-size: 17px;"></i> Добавить
</button>
</div> -->
</div>
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Ady</th>
<th>Bellik</th>
<!-- <th>Настройки</th> -->
</tr>
</thead>
<tbody>
{% for key, record in stocksq %}
<tr>
<td style="font-weight: bold;">{{key + 1}}</td>
<td>
{% if record.type == 'rulon' %}
<a href="/produced/rulon/stock/{{record.id}}" style="font-weight: bold;">{{record.name}}</a>
{% else %}
<a href="/produced/bag/stock/{{record.id}}" style="font-weight: bold;">{{record.name}}</a>
{% endif %}
</td>
<td>{{record.note}}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Ady</th>
<th>Bellik</th>
<!-- <th>Настройки</th> -->
</tr>
</tfoot>
</table>
</div>
<!-- <div class="offcanvas offcanvas-top" tabindex="-1" id="offcanvasBottom"
aria-labelledby="offcanvasBottomLabel">
<div class="offcanvas-header">
<h5 id="offcanvasBottomLabel">Обновить Склады</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"
aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<form class="needs-validation" novalidate action="/stocks/update" method="POST">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="validationCustom01" class="form-label">Имя Склад</label>
<input type="text" class="form-control" id="validationCustom01"
placeholder="Имя Склад" name="name" value=""
required>
<div class="valid-feedback">
Правильно
</div>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="validationCustom02" class="form-label">Описание</label>
<input type="text" class="form-control" name="desc"
id="validationCustom02" placeholder="Описание"
value="" required>
<div class="valid-feedback">
Правильно
</div>
</div>
</div>
<input type="hidden" value="" name="id">
</div>
<div>
<button class="btn btn-primary" type="submit">Обновить</button>
</div>
</form>
</div>
</div> -->
<div class="offcanvas offcanvas-top" tabindex="-1" id="offcanvasBottom"
aria-labelledby="offcanvasBottomLabel">
<div class="offcanvas-header">
<h5 id="offcanvasBottomLabel">Добавить Склад</h5>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"
aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<form class="needs-validation" novalidate action="/stocks/create" method="POST">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="validationCustom01" class="form-label">Имя Склад</label>
<input type="text" class="form-control" id="validationCustom01"
placeholder="Имя Склад" name="name" required>
<div class="valid-feedback">
Правильно
</div>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="validationCustom02" class="form-label">Описание</label>
<input type="text" class="form-control" name="desc" id="validationCustom02"
placeholder="Описание" required>
<div class="valid-feedback">
Правильно
</div>
</div>
</div>
</div>
<div>
<button class="btn btn-primary" type="submit">Добавить</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
{% partial 'dataTableJs' %}

View File

@ -15,6 +15,14 @@ pageNumber = "{{ :page }}"
sortColumn = "id"
sortDirection = "desc"
==
<?php
function onStart(){
$this["stocksq"] = Romanah\Gokbakja\Models\Stock::orderBy("id", "desc")->where("type", 'raw')->get();
}
?>
==
{% set records = builderList.records %}
{% set displayColumn = builderList.displayColumn %}
{% set noRecordsMessage = builderList.noRecordsMessage %}
@ -63,7 +71,7 @@ sortDirection = "desc"
</thead>
<tbody>
{% for key, record in records %}
{% for key, record in stocksq %}
<tr>
<td style="font-weight: bold;">{{key + 1}}</td>
<td><a href="{{'product/stock'|page({stockId:record.id})}}"
@ -174,4 +182,4 @@ sortDirection = "desc"
</div>
{% partial 'dataTableJs' %}
{% partial 'dataTableJs' %}