production calculate table
This commit is contained in:
parent
26325f3dff
commit
49931ad779
|
|
@ -34,17 +34,19 @@ class MachineProduction extends ComponentBase
|
||||||
|
|
||||||
$currentDateFormat = Carbon::now()->format('Y-m-d');
|
$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 = '';
|
$html_data = '';
|
||||||
for ($x = 0; $x < count($machineProductions); $x++) {
|
for ($x = 0; $x < count($machineProductions); $x++) {
|
||||||
// dd($machineProductions[0]->bag_size);
|
// dd($machineProductions[0]->bag_size);
|
||||||
$html_data .= '<tr>
|
$html_data .= '<tr>
|
||||||
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
||||||
|
<td><a href="#">' . ($machineProductions[$x]->date == null ? "" : Carbon::parse($machineProductions[$x]->date)->format('d.m.Y')) . '</a></td>
|
||||||
<td><a href="#" style="font-weight: bold;">' . $machineProductions[$x]->building_name . '</a></td>
|
<td><a href="#" style="font-weight: bold;">' . $machineProductions[$x]->building_name . '</a></td>
|
||||||
<td>' . $machineProductions[$x]->machine->name . '</td>
|
<td>' . $machineProductions[$x]->machine->name . '</td>
|
||||||
<td>' . $machineProductions[$x]->bag_size->name . '</td>
|
<td>' . $machineProductions[$x]->bag_size->name . '</td>
|
||||||
<td>' . $machineProductions[$x]->bag_type->name . '</td>
|
<td>' . $machineProductions[$x]->bag_type->name . '</td>
|
||||||
|
<td>' . ($machineProductions[$x]->color->name ?? "") . '</td>
|
||||||
<td><span class="badge badge-soft-success"
|
<td><span class="badge badge-soft-success"
|
||||||
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
|
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -66,10 +68,10 @@ class MachineProduction extends ComponentBase
|
||||||
$data = post();
|
$data = post();
|
||||||
|
|
||||||
|
|
||||||
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->orderBy('id', 'DESC');
|
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])->orderBy('id', 'DESC');
|
||||||
|
|
||||||
$start = Carbon::parse($data["start"])->format('Y-m-d');
|
$start = Carbon::parse($data["start"])->format('Y-m-d');
|
||||||
$end = Carbon::parse($data["end"])->format('Y-m-d');;
|
$end = Carbon::parse($data["end"])->format('Y-m-d');
|
||||||
$machine = $data["machine_id"];
|
$machine = $data["machine_id"];
|
||||||
$mechanic = $data["mechanic_id"];
|
$mechanic = $data["mechanic_id"];
|
||||||
$size = $data["size_id"];
|
$size = $data["size_id"];
|
||||||
|
|
@ -93,7 +95,7 @@ class MachineProduction extends ComponentBase
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($start != $currentDateFormat){
|
if ($start != $currentDateFormat){
|
||||||
$machineProductions->whereBetween('created_at', [$start, $end]);
|
$machineProductions->whereBetween('date', [$start, $end]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$machineProductionsFiltered = $machineProductions->get();
|
$machineProductionsFiltered = $machineProductions->get();
|
||||||
|
|
@ -152,8 +154,10 @@ class MachineProduction extends ComponentBase
|
||||||
$createProductionMachine->type_id = $data["type_id"];
|
$createProductionMachine->type_id = $data["type_id"];
|
||||||
$createProductionMachine->size_id = $data["size_id"];
|
$createProductionMachine->size_id = $data["size_id"];
|
||||||
$createProductionMachine->machine_id = $data["machine_id"];
|
$createProductionMachine->machine_id = $data["machine_id"];
|
||||||
|
$createProductionMachine->color_id = $data["color_id"];
|
||||||
$createProductionMachine->produced_weight = $data["produced_weight"];
|
$createProductionMachine->produced_weight = $data["produced_weight"];
|
||||||
$createProductionMachine->note = $data["note"];
|
$createProductionMachine->note = $data["note"];
|
||||||
|
$createProductionMachine->date = Carbon::parse($data["date"])->format('Y-m-d');
|
||||||
$createProductionMachine->user_id = $user->id;
|
$createProductionMachine->user_id = $user->id;
|
||||||
$createProductionMachine->save();
|
$createProductionMachine->save();
|
||||||
|
|
||||||
|
|
@ -172,17 +176,19 @@ class MachineProduction extends ComponentBase
|
||||||
|
|
||||||
$currentDateFormat = Carbon::now()->format('Y-m-d');
|
$currentDateFormat = Carbon::now()->format('Y-m-d');
|
||||||
|
|
||||||
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->whereDate('created_at', date($currentDateFormat))->orderBy('id', 'DESC')->get();
|
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])->orderBy('id', 'DESC')->get();
|
||||||
|
|
||||||
$html_data = '';
|
$html_data = '';
|
||||||
|
|
||||||
for ($x = 0; $x < count($machineProductions); $x++) {
|
for ($x = 0; $x < count($machineProductions); $x++) {
|
||||||
$html_data .= '<tr>
|
$html_data .= '<tr>
|
||||||
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
||||||
|
<td><a href="#">' . ($machineProductions[$x]->date == null ? "" : Carbon::parse($machineProductions[$x]->date)->format('d.m.Y')) . '</a></td>
|
||||||
<td><a href="#" style="font-weight: bold;">' . $machineProductions[$x]->building_name . '</a></td>
|
<td><a href="#" style="font-weight: bold;">' . $machineProductions[$x]->building_name . '</a></td>
|
||||||
<td>' . $machineProductions[$x]->machine->name . '</td>
|
<td>' . $machineProductions[$x]->machine->name . '</td>
|
||||||
<td>' . $machineProductions[$x]->bag_size->name . '</td>
|
<td>' . $machineProductions[$x]->bag_size->name . '</td>
|
||||||
<td>' . $machineProductions[$x]->bag_type->name . '</td>
|
<td>' . $machineProductions[$x]->bag_type->name . '</td>
|
||||||
|
<td>' . ($machineProductions[$x]->color->name ?? "") . '</td>
|
||||||
<td><span class="badge badge-soft-success"
|
<td><span class="badge badge-soft-success"
|
||||||
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
|
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -292,14 +292,14 @@ class Order extends ComponentBase
|
||||||
for ($x = 0; $x < count($paymentDatas); $x++) {
|
for ($x = 0; $x < count($paymentDatas); $x++) {
|
||||||
// dd($orderDatas[$x]->shipping->status);
|
// dd($orderDatas[$x]->shipping->status);
|
||||||
$html_data .= '<tr>
|
$html_data .= '<tr>
|
||||||
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
||||||
<td><a href="#" style="font-weight: bold;">' . $paymentDatas[$x]->amount . ' $</a></td>
|
<td><a href="#" style="font-weight: bold;">' . $paymentDatas[$x]->amount . ' $</a></td>
|
||||||
<td><a href="#" style="font-weight: bold;">' . $paymentDatas[$x]->created_at->format('d.m.Y') . '</a></td>
|
<td><a href="#" style="font-weight: bold;">' . ($paymentDatas[$x]->date == null ? "" : Carbon::parse($paymentDatas[$x]->date)->format('d.m.Y')) . '</a></td>
|
||||||
<td>' . $paymentDatas[$x]->note . '</td>
|
<td>' . $paymentDatas[$x]->note . '</td>
|
||||||
<td><a href="#" data-request="onModalSetPayment"
|
<td><a href="#" data-request="onModalSetPayment"
|
||||||
data-request-data="paymentId: ' . $paymentDatas[$x]->id . '"
|
data-request-data="paymentId: ' . $paymentDatas[$x]->id . '"
|
||||||
data-bs-toggle="modal" data-bs-target=".bs-example-modal-sm-1" style="color: orange;"> Täzele </a></td>
|
data-bs-toggle="modal" data-bs-target=".bs-example-modal-sm-1" style="color: orange;"> Täzele </a></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = OrderModel::where("id", $orderId)->with(["client", "shipping"])
|
$order = OrderModel::where("id", $orderId)->with(["client", "shipping"])
|
||||||
|
|
@ -387,6 +387,7 @@ class Order extends ComponentBase
|
||||||
|
|
||||||
|
|
||||||
$createPayment = new PaymentModel();
|
$createPayment = new PaymentModel();
|
||||||
|
$createPayment->date = Carbon::parse($data["date"])->format('Y-m-d');
|
||||||
$createPayment->amount = $data["amount"];
|
$createPayment->amount = $data["amount"];
|
||||||
$createPayment->note = $data["note"];
|
$createPayment->note = $data["note"];
|
||||||
$createPayment->order_id = $orderId;
|
$createPayment->order_id = $orderId;
|
||||||
|
|
@ -401,7 +402,7 @@ class Order extends ComponentBase
|
||||||
$html_data .= '<tr>
|
$html_data .= '<tr>
|
||||||
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
<td style="font-weight: bold;">' . ($x + 1) . '</td>
|
||||||
<td><a href="#" style="font-weight: bold;">' . $paymentDatas[$x]->amount . ' $</a></td>
|
<td><a href="#" style="font-weight: bold;">' . $paymentDatas[$x]->amount . ' $</a></td>
|
||||||
<td><a href="#" style="font-weight: bold;">' . $paymentDatas[$x]->created_at->format('d.m.Y') . '</a></td>
|
<td><a href="#" style="font-weight: bold;">' . ($paymentDatas[$x]->date == null ? "" : Carbon::parse($paymentDatas[$x]->date)->format('d.m.Y')) . '</a></td>
|
||||||
<td>' . $paymentDatas[$x]->note . '</td>
|
<td>' . $paymentDatas[$x]->note . '</td>
|
||||||
<td><a href="#" data-request="onModalSetPayment"
|
<td><a href="#" data-request="onModalSetPayment"
|
||||||
data-request-data="paymentId: ' . $paymentDatas[$x]->id . '"
|
data-request-data="paymentId: ' . $paymentDatas[$x]->id . '"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ namespace Romanah\Gokbakja\Components;
|
||||||
use Cms\Classes\ComponentBase;
|
use Cms\Classes\ComponentBase;
|
||||||
use Romanah\Gokbakja\Models\Product as ProductModel;
|
use Romanah\Gokbakja\Models\Product as ProductModel;
|
||||||
use Romanah\Gokbakja\Models\Production as ProductionModel;
|
use Romanah\Gokbakja\Models\Production as ProductionModel;
|
||||||
|
use Romanah\Gokbakja\Models\ProductionCalculate as ProductionCalculateModel;
|
||||||
use Romanah\Gokbakja\Models\Excruiter as ExcruiterModel;
|
use Romanah\Gokbakja\Models\Excruiter as ExcruiterModel;
|
||||||
|
use Romanah\Gokbakja\Models\Shift as ShiftModel;
|
||||||
use Romanah\Gokbakja\Models\ProductionMachine as ProductionMachineModel;
|
use Romanah\Gokbakja\Models\ProductionMachine as ProductionMachineModel;
|
||||||
use Romanah\Gokbakja\Models\PivotProduction as PivotProductionModel;
|
use Romanah\Gokbakja\Models\PivotProduction as PivotProductionModel;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
|
|
@ -13,6 +15,7 @@ use Carbon\Carbon;
|
||||||
use Flash;
|
use Flash;
|
||||||
use DB;
|
use DB;
|
||||||
use October\Rain\Support\Facades\Flash as FacadesFlash;
|
use October\Rain\Support\Facades\Flash as FacadesFlash;
|
||||||
|
use Romanah\Gokbakja\Controllers\Excruiter;
|
||||||
|
|
||||||
class Production extends ComponentBase
|
class Production extends ComponentBase
|
||||||
{
|
{
|
||||||
|
|
@ -148,213 +151,158 @@ class Production extends ComponentBase
|
||||||
|
|
||||||
$excruiter = $this->param("excruiter");
|
$excruiter = $this->param("excruiter");
|
||||||
|
|
||||||
|
$currentExcrutier = ExcruiterModel::where("id", $excruiter)->first();
|
||||||
$currentDateLast = ProductionModel::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->with("excruiter")->orderBy('id', 'DESC')->first();
|
|
||||||
$currentDateFirst = ProductionModel::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->orderBy('id', 'ASC')->first();
|
|
||||||
|
|
||||||
$productionsCalc = ProductionModel::orderBy('id', 'DESC');
|
$productionsCalc = ProductionModel::orderBy('id', 'DESC');
|
||||||
|
|
||||||
$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'))
|
$calc = $productionsCalc->select(DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time'))
|
||||||
->whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->first();
|
->whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiter)->first();
|
||||||
|
|
||||||
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
||||||
|
|
||||||
// $calcTimeDiff = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
|
$timeCalc = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
|
||||||
|
|
||||||
|
$countDailyChanges = ProductionModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiter)->get();
|
||||||
|
|
||||||
// $diffMinutes = Carbon::parse($currentDateLast->time)->diffInMinutes($currentDateFirst->time);
|
$products = ProductModel::where('report', 'simple')->get();
|
||||||
|
|
||||||
$currentDateProductionAll = ProductionModel::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->avg('all_amount');
|
|
||||||
|
|
||||||
|
|
||||||
// $testq = PivotProductionModel::whereDate('created_at', date($currentDateFormat))
|
|
||||||
// ->where('excruiter_id', $excruiter)
|
|
||||||
// ->select('id', 'product_name', 'excruiter_id',DB::raw('round(AVG(amount),0) as average'), DB::raw('round(AVG(amount_percentage),0) as average_percentage'))
|
|
||||||
// ->groupBy('product_id')
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
$pivotFirsts = PivotProductionModel::where('production_id', $currentDateFirst->id)->get();
|
|
||||||
$pivotLasts = PivotProductionModel::where('production_id', $currentDateLast->id)->get();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$allData = array(
|
|
||||||
"all" => array(
|
|
||||||
"hours" => floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut',
|
|
||||||
"avg_all_amount" => number_format($currentDateProductionAll, 2),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$producedAll = $calc->amount_subtraction;
|
|
||||||
|
|
||||||
$countDailyChanges = ProductionModel::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->get();
|
|
||||||
|
|
||||||
// dd(count($countDailyChanges));
|
// dd(count($countDailyChanges));
|
||||||
|
|
||||||
if (count($countDailyChanges) > 1) {
|
if (count($countDailyChanges) > 1) {
|
||||||
|
|
||||||
|
$dailyCalculated = ProductionCalculateModel::whereDate("date", date($currentDateFormat))->where("excruiter_id", $excruiter)->sum("amount_calc");
|
||||||
|
|
||||||
|
//sagatda ortacaha hasaplama
|
||||||
|
$html_data2 ='';
|
||||||
|
|
||||||
// gunluk hasabat
|
// gunluk hasabat
|
||||||
$html_data = '<div class="row">';
|
$html_data = '<div class="row">';
|
||||||
$html_data .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">JEMI IŞLENEN ÇIG MAL (ekskruiter: ' . $currentDateLast->excruiter->name . ')</h4>';
|
$html_data .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">JEMI IŞLENEN ÇIG MAL (ekskruiter: ' . $currentExcrutier->name . ')</h4>';
|
||||||
|
|
||||||
$html_data .= '<div class="col-lg">
|
$html_data .= '<div class="col-lg">
|
||||||
<a class="card bg-success text-white-50">
|
<a class="card bg-success text-white-50">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="mb-4 text-white"><i
|
<h5 class="mb-4 text-white"><i
|
||||||
class="mdi mdi-bullseye-arrow me-3"></i>' . $allData["all"]["hours"] . '</h5>
|
class="mdi mdi-bullseye-arrow me-3"></i>' . $timeCalc. '</h5>
|
||||||
<hr>
|
<hr>
|
||||||
<p class="card-text" style="font-size: 15px;color: white;">JEMI IŞLENEN: ' . $producedAll . ' kg</p>
|
<p class="card-text" style="font-size: 15px;color: white;">JEMI IŞLENEN: ' . $dailyCalculated . ' kg</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
for ($x = 0; $x < count($pivotLasts); $x++) {
|
|
||||||
// $diff = $pivotLasts[$x]->amount - $pivotFirsts[$x]->amount;
|
|
||||||
// $diffPerc = ($diff * 100) / $producedAll;
|
|
||||||
$calculatedPercentage = (float) ($pivotLasts[$x]->amount_percentage / 100) * (float) $producedAll;
|
|
||||||
|
|
||||||
$html_data .= '<div class="col-lg">
|
//sagatda ortacaha hasaplama
|
||||||
<a class="card bg-info text-white-50">
|
$html_data2 .= '<div class="row">';
|
||||||
<div class="card-body">
|
$html_data2 .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">SAGATDA ORTAÇA (ekskruiter: ' . $currentExcrutier->name . ')</h4>';
|
||||||
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . ($calculatedPercentage) . ' kg</h5>
|
|
||||||
<hr>
|
|
||||||
<p class="card-text" style="font-size: 15px;color: white;">' . $pivotLasts[$x]->product_name . ' : ' . ($pivotLasts[$x]->amount_percentage) . ' %</p>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$html_data .= '</div>';
|
|
||||||
|
|
||||||
$hourCount = floor($diffMinutes / 60) . '.' . ($diffMinutes - floor($diffMinutes / 60) * 60);
|
|
||||||
$avgProducedHour = $producedAll / $hourCount;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sagatda ortacha hasbat
|
|
||||||
$html_data2 = '<div class="row">';
|
|
||||||
$html_data2 .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">SAGATDA ORTAÇA SARP EDIŞ HASABATY (ekskruiter: ' . $currentDateLast->excruiter->name . ')</h4>';
|
|
||||||
|
|
||||||
$html_data2 .= '<div class="col-lg">
|
$html_data2 .= '<div class="col-lg">
|
||||||
<a class="card bg-success text-white-50">
|
<a class="card bg-success text-white-50">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="mb-4 text-white"><i
|
<h5 class="mb-4 text-white"><i
|
||||||
class="mdi mdi-bullseye-arrow me-3"></i>' . $allData["all"]["hours"] . '</h5>
|
class="mdi mdi-bullseye-arrow me-3"></i>' . $timeCalc. '</h5>
|
||||||
<hr>
|
<hr>
|
||||||
<p class="card-text" style="font-size: 15px;color: white;">Sagatda Ortaça: ' . (number_format($avgProducedHour, 2)) . ' kg</p>
|
<p class="card-text" style="font-size: 15px;color: white;">SAGATDA ORTAÇA: ' . number_format($dailyCalculated / floor($diffMinutes / 60), 2) . ' kg</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
for ($x = 0; $x < count($pivotLasts); $x++) {
|
|
||||||
|
for ($x = 0; $x < count($products); $x++) {
|
||||||
|
|
||||||
|
$productCalc = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiter)->where("product_id", $products[$x]->id)->sum('amount_calc');
|
||||||
|
|
||||||
|
$productCalcPercentage = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiter)->where("product_id", $products[$x]->id)->orderBy('id', 'DESC')->first();
|
||||||
// $diff = $pivotLasts[$x]->amount - $pivotFirsts[$x]->amount;
|
// $diff = $pivotLasts[$x]->amount - $pivotFirsts[$x]->amount;
|
||||||
// $diffPerc = ($diff * 100) / $producedAll;
|
// $diffPerc = ($diff * 100) / $producedAll;
|
||||||
$calculatedPercentage = (float) ($pivotLasts[$x]->amount_percentage / 100) * (float) $producedAll;
|
|
||||||
$calculatePercentageHour = (float) (($calculatedPercentage / $hourCount) * 100) / (float) $producedAll;
|
|
||||||
|
|
||||||
$html_data2 .= '<div class="col-lg">
|
$html_data .= '<div class="col-lg">
|
||||||
<a class="card bg-info text-white-50">
|
<a class="card bg-info text-white-50">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i> Sagatda: ' . (number_format(($calculatedPercentage / $hourCount), 2)) . ' kg</h5>
|
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . ($productCalc) . ' kg</h5>
|
||||||
<hr>
|
<hr>
|
||||||
<p class="card-text" style="font-size: 15px;color: white;">' . $pivotLasts[$x]->product_name . ' : ' . (number_format($calculatePercentageHour, 2)) . ' %</p>
|
<p class="card-text" style="font-size: 15px;color: white;">' . $products[$x]->name . ' : ' . ($productCalcPercentage->amount_percentage) . ' %</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
|
$html_data2 .= '<div class="col-lg">
|
||||||
|
<a class="card bg-info text-white-50">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . number_format($productCalc / floor($diffMinutes / 60), 2) . ' kg</h5>
|
||||||
|
<hr>
|
||||||
|
<p class="card-text" style="font-size: 15px;color: white;">' . $products[$x]->name . ' : ' . ($productCalcPercentage->amount_percentage) . ' %</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$html_data .= '</div>';
|
||||||
$html_data2 .= '</div>';
|
$html_data2 .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
$html_data3 = '';
|
//ekstrudorlar b-ca
|
||||||
|
$excruiters = ExcruiterModel::get();
|
||||||
|
|
||||||
$currentDateExcruiters = ProductionModel::whereDate('created_at', date($currentDateFormat))->groupBy("excruiter_id")->orderBy('id', 'DESC')->with("excruiter")->get();
|
$html_data3 = '<div class="row">';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ($i = 0; $i < count($currentDateExcruiters); $i++) {
|
|
||||||
|
|
||||||
$currentDateLastExc = ProductionModel::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $currentDateExcruiters[$i]->excruiter_id)->orderBy('id', 'DESC')->first();
|
|
||||||
|
|
||||||
// $currentDateFirstExc = ProductionModel::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $currentDateExcruiters[$i]->excruiter_id)->orderBy('id', 'ASC')->first();
|
|
||||||
|
|
||||||
/////////////
|
|
||||||
|
|
||||||
|
for ($x = 0; $x < count($excruiters); $x++) {
|
||||||
|
|
||||||
$productionsCalc = ProductionModel::orderBy('id', 'DESC');
|
$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('excruiter_id', $excruiters[$x]->id)->first();
|
||||||
|
|
||||||
$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'))
|
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
||||||
->whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $currentDateExcruiters[$i]->excruiter_id)->first();
|
|
||||||
|
|
||||||
$diffMinutesExc = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
$timeCalc = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
|
||||||
|
|
||||||
|
|
||||||
/////////////
|
$productCalc = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiters[$x]->id)->sum('amount_calc');
|
||||||
|
|
||||||
// $diffMinutesExc = Carbon::parse($currentDateLastExc->time)->diffInMinutes($currentDateFirstExc->time);
|
|
||||||
|
|
||||||
$hourCountExc = floor($diffMinutesExc / 60) . ' sagat ' . ($diffMinutesExc - floor($diffMinutesExc / 60) * 60) . ' minut';
|
|
||||||
|
|
||||||
$allAmountExc = $calc->amount_subtraction;
|
|
||||||
|
|
||||||
// dd($currentDateFirstExc);
|
|
||||||
$html_data3 .= '<div class="row">';
|
|
||||||
$html_data3 .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">' . $currentDateExcruiters[$i]->excruiter->name . ' - işlenen çig mallar boýunça.</h4>';
|
|
||||||
|
|
||||||
|
$html_data3 .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">JEMI IŞLENEN ÇIG MAL (ekskruiter: ' . $excruiters[$x]->name . ')</h4>';
|
||||||
|
|
||||||
$html_data3 .= '<div class="col-lg">
|
$html_data3 .= '<div class="col-lg">
|
||||||
<a class="card bg-success text-white-50">
|
<a class="card bg-success text-white-50">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="mb-4 text-white"><i
|
<h5 class="mb-4 text-white"><i
|
||||||
class="mdi mdi-bullseye-arrow me-3"></i>' . $hourCountExc . '</h5>
|
class="mdi mdi-bullseye-arrow me-3"></i>' . $timeCalc. '</h5>
|
||||||
<hr>
|
<hr>
|
||||||
<p class="card-text" style="font-size: 15px;color: white;">Jemi Işlenen: ' . (number_format($allAmountExc)) . ' kg</p>
|
<p class="card-text" style="font-size: 15px;color: white;">JEMI IŞLENEN: ' . $dailyCalculated . ' kg</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
$excruiterDatas = PivotProductionModel::where('production_id', $currentDateLastExc->id)->get();
|
for ($i = 0; $i < count($products); $i++) {
|
||||||
// $pivotLasts = PivotProductionModel::where('production_id', $currentDateLast->id)->get();
|
|
||||||
|
|
||||||
// \Log::info($excruiterDatas);
|
$productCalc = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiters[$x]->id)->where("product_id", $products[$i]->id)->sum('amount_calc');
|
||||||
for ($ii = 0; $ii < count($excruiterDatas); $ii++) {
|
|
||||||
// $diff = $pivotLasts[$x]->amount - $pivotFirsts[$x]->amount;
|
$productCalcPercentage = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiters[$x]->id)->where("product_id", $products[$i]->id)->orderBy('id', 'DESC')->first();
|
||||||
// $diffPerc = ($diff * 100) / $producedAll;
|
|
||||||
$calculatedPercentage = (float) ($excruiterDatas[$ii]->amount_percentage / 100) * (float) $allAmountExc;
|
|
||||||
|
|
||||||
$html_data3 .= '<div class="col-lg">
|
$html_data3 .= '<div class="col-lg">
|
||||||
<a class="card bg-info text-white-50">
|
<a class="card bg-info text-white-50">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . ($calculatedPercentage) . ' kg</h5>
|
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . ($productCalc) . ' kg</h5>
|
||||||
<hr>
|
<hr>
|
||||||
<p class="card-text" style="font-size: 15px;color: white;">' . $excruiterDatas[$ii]->product_name . ' : ' . ($excruiterDatas[$ii]->amount_percentage) . ' %</p>
|
<p class="card-text" style="font-size: 15px;color: white;">' . $products[$i]->name . ' : ' . ($productCalcPercentage->amount_percentage ?? 0) . ' %</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$html_data3 .= '</div><hr>';
|
|
||||||
}
|
}
|
||||||
|
$html_data3 .= '</div>';
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
//smenlar boyuncha
|
||||||
|
$shifts = ShiftModel::get();
|
||||||
|
|
||||||
|
|
||||||
$currentDateShifts = ProductionModel::whereDate('created_at', date($currentDateFormat))
|
|
||||||
// ->where("excruiter_id", $excruiter)
|
|
||||||
->with(["shift", "excruiter", "pivot_production"])
|
|
||||||
->groupBy("shift_id", "excruiter_id")
|
|
||||||
// ->max("id")
|
|
||||||
->orderBy('excruiter_id', 'DESC')
|
|
||||||
// ->distinct()
|
|
||||||
->get();
|
|
||||||
|
|
||||||
// dd($currentDateShifts);
|
|
||||||
// $products = ProductModel::where("report", "simple")->get();
|
|
||||||
|
|
||||||
|
|
||||||
$html_data4 = '<h4 style="margin-top: 20px;margin-bottom: 20px;">SMENLAR BOÝUNÇA</h4>';
|
$html_data4 = '<h4 style="margin-top: 20px;margin-bottom: 20px;">SMENLAR BOÝUNÇA</h4>';
|
||||||
|
|
||||||
$html_data4 .= '<div class="container-fluid"><div class="row"><div class="col-md-12">';
|
$html_data4 .= '<div class="container-fluid"><div class="row"><div class="col-md-12">';
|
||||||
|
|
||||||
$html_data4 .= '<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
|
$html_data4 .= '<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
|
||||||
|
|
@ -364,55 +312,52 @@ class Production extends ComponentBase
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Smen</th>
|
<th>Smen</th>
|
||||||
<th>Ekskruiter</th>
|
|
||||||
<th>Wagty</th>
|
<th>Wagty</th>
|
||||||
<th>Jemi</th>
|
<th>Jemi</th>';
|
||||||
';
|
|
||||||
// for ($ii = 0; $ii < count($currentDateShifts[0]->pivot_production); $ii++) {
|
|
||||||
// $html_data4 .= '<th>' . $currentDateShifts[0]->pivot_production[$ii]->product_name . '</th>';
|
|
||||||
// }
|
|
||||||
$html_data4 .= '</tr>
|
$html_data4 .= '</tr>
|
||||||
</thead><tbody>';
|
</thead><tbody>';
|
||||||
|
|
||||||
|
$sumTimeDiffs = 0;
|
||||||
|
$productAllCalc = 0;
|
||||||
|
|
||||||
|
for ($i = 0; $i < count($shifts); $i++) {
|
||||||
|
|
||||||
for ($i = 0; $i < count($currentDateShifts); $i++) {
|
$productionsCalc = ProductionModel::orderBy('id', 'DESC');
|
||||||
|
$calc = $productionsCalc->select(DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time'))
|
||||||
$productionsCalc = ProductionModel::orderBy('id', 'DESC')->whereDate('created_at', date($currentDateFormat));
|
->whereDate('date', date($currentDateFormat))->where('shift_id', $shifts[$i]->id)->first();
|
||||||
|
|
||||||
$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();
|
|
||||||
|
|
||||||
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
$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 .= '<tr>
|
$html_data4 .= '<tr>
|
||||||
<th scope="row">' . ($i + 1) . '</th>
|
<th scope="row">' . ($i + 1) . '</th>
|
||||||
<td style="font-weight: bold;color: #0005c5;">' . $currentDateShifts[$i]->shift->desc . '(' . $currentDateShifts[$i]->shift->start . ' - ' . $currentDateShifts[$i]->shift->end . ')</td>
|
<td style="font-weight: bold;color: #0005c5;">' . $shifts[$i]->desc . '(' . $shifts[$i]->start . ' - ' . $shifts[$i]->end . ')</td>
|
||||||
<td><span class="badge badge-soft-info"
|
<td>'.$timeCalc.'</td>
|
||||||
style="font-size: 14px;">' . $currentDateShifts[$i]->excruiter->name . '</span></td>
|
|
||||||
<td>' . $hourCountShift . '</td>
|
|
||||||
<td>' . $calc->amount_subtraction . ' kg</td>';
|
|
||||||
|
|
||||||
|
|
||||||
// for ($x = 0; $x < count($pivotShiftLasts); $x++) {
|
|
||||||
|
|
||||||
// $calculatedPercentageShift = (float) ($pivotShiftLasts[$x]->amount_percentage / 100) * (float) $allAmountShift;
|
|
||||||
|
|
||||||
// $html_data4 .= '<td>' . ($calculatedPercentageShift) . ' kg </td>';
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
<td>' . $productCalc . ' kg</td>';
|
||||||
$html_data4 .= '</tr>';
|
$html_data4 .= '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html_data4 .= ' <tr>
|
$timeAllCalc = floor($sumTimeDiffs / 60) . ' sagat ' . ($sumTimeDiffs - floor($sumTimeDiffs / 60) * 60) . ' minut';
|
||||||
|
|
||||||
</tr>';
|
$html_data4 .= '<tr>
|
||||||
|
<th scope="row" colspan="2">JEMI</th>
|
||||||
|
<td>'.$timeAllCalc.'</td>
|
||||||
|
|
||||||
|
<td>' . $productAllCalc . ' kg</td>';
|
||||||
|
$html_data4 .= '</tr>';
|
||||||
$html_data4 .= ' </tbody>
|
$html_data4 .= ' </tbody>
|
||||||
</table></div></div></div>';
|
</table></div></div></div>';
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'#calculation_of_day' => $html_data,
|
'#calculation_of_day' => $html_data,
|
||||||
'#avg_of_day' => $html_data2,
|
'#avg_of_day' => $html_data2,
|
||||||
|
|
@ -431,6 +376,8 @@ class Production extends ComponentBase
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function onCalculateAvg()
|
function onCalculateAvg()
|
||||||
{
|
{
|
||||||
$currentDate = Carbon::now()->timezone('UTC +05:00');
|
$currentDate = Carbon::now()->timezone('UTC +05:00');
|
||||||
|
|
@ -520,7 +467,7 @@ class Production extends ComponentBase
|
||||||
$excruiter = $this->param("excruiter");
|
$excruiter = $this->param("excruiter");
|
||||||
|
|
||||||
if ($excruiter == 0) {
|
if ($excruiter == 0) {
|
||||||
Flash::error("Ekskruiter Saýla!");
|
Flash::error("Ekstrudor Saýla!");
|
||||||
return Redirect::refresh();
|
return Redirect::refresh();
|
||||||
} else {
|
} else {
|
||||||
$createProduction = new ProductionModel();
|
$createProduction = new ProductionModel();
|
||||||
|
|
@ -528,8 +475,8 @@ class Production extends ComponentBase
|
||||||
$createProduction->all_amount = $data["all_amount"];
|
$createProduction->all_amount = $data["all_amount"];
|
||||||
$createProduction->note = $data["note"];
|
$createProduction->note = $data["note"];
|
||||||
$createProduction->user_id = $user->id;
|
$createProduction->user_id = $user->id;
|
||||||
$createProduction->date = $currentDate->format('Y-m-d');
|
$createProduction->date = Carbon::parse($data["date"])->format('Y-m-d');
|
||||||
$createProduction->time = $currentDate->format('H:i:s');
|
$createProduction->time = Carbon::parse($data["time"])->format('H:i:s');
|
||||||
$createProduction->excruiter_id = $excruiter;
|
$createProduction->excruiter_id = $excruiter;
|
||||||
$createProduction->shift_id = $data["shift_id"];
|
$createProduction->shift_id = $data["shift_id"];
|
||||||
$createProduction->save();
|
$createProduction->save();
|
||||||
|
|
@ -548,15 +495,46 @@ class Production extends ComponentBase
|
||||||
$createProduction->excruiter_id = $excruiter;
|
$createProduction->excruiter_id = $excruiter;
|
||||||
$createPivotProduction->amount = (float)(((float) $data[$fieldName] ?? 0) / 100) * ((float) $createProduction->all_amount);
|
$createPivotProduction->amount = (float)(((float) $data[$fieldName] ?? 0) / 100) * ((float) $createProduction->all_amount);
|
||||||
|
|
||||||
$createPivotProduction->date = $currentDate->format('Y-m-d');
|
$createPivotProduction->date = Carbon::parse($data["date"])->format('Y-m-d');
|
||||||
$createPivotProduction->time = $currentDate->format('H:i:s');
|
$createPivotProduction->time = Carbon::parse($data["time"])->format('H:i:s');
|
||||||
$createPivotProduction->save();
|
$createPivotProduction->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$todayProductionsCount = ProductionModel::whereDate('date', date($createProduction->date))->where("excruiter_id", $excruiter)->count();
|
||||||
|
|
||||||
|
if($todayProductionsCount > 1){
|
||||||
|
$todayProductionsGet = ProductionModel::whereDate('date', date($createProduction->date))->where("excruiter_id", $excruiter)->orderBy("id", "DESC")->skip(1)->first();
|
||||||
|
|
||||||
|
$productionPivots = PivotProductionModel::where('production_id', $todayProductionsGet->id)->get();
|
||||||
|
|
||||||
|
$diffAllAmount = ($createProduction->all_amount - $todayProductionsGet->all_amount);
|
||||||
|
|
||||||
|
for ($x = 0; $x < count($productionPivots); $x++) {
|
||||||
|
|
||||||
|
|
||||||
|
$createCalculate = new ProductionCalculateModel();
|
||||||
|
$createCalculate->production_id = $todayProductionsGet->id;
|
||||||
|
$createCalculate->product_id = $productionPivots[$x]->product_id;
|
||||||
|
$createCalculate->amount_calc = (float)(((float) $productionPivots[$x]->amount_percentage ?? 0) / 100) * ((float) $diffAllAmount);
|
||||||
|
$createCalculate->excruiter_id = $todayProductionsGet->excruiter_id;
|
||||||
|
$createCalculate->shift_id = $todayProductionsGet->shift_id;
|
||||||
|
$createCalculate->amount_percentage = $productionPivots[$x]->amount_percentage;
|
||||||
|
|
||||||
|
$createCalculate->date = $productionPivots[$x]->date;
|
||||||
|
$createCalculate->time = $productionPivots[$x]->time;
|
||||||
|
|
||||||
|
$createCalculate->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($createProduction && $createPivotProduction) {
|
if ($createProduction && $createPivotProduction) {
|
||||||
Flash::success("Hasabat Ustunlikli Goşuldy");
|
Flash::success("Hasabat Ustunlikli Goşuldy");
|
||||||
return Redirect::refresh();
|
return Redirect::refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -605,4 +583,5 @@ class Production extends ComponentBase
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Controllers;
|
||||||
|
|
||||||
|
use Backend\Classes\Controller;
|
||||||
|
use BackendMenu;
|
||||||
|
|
||||||
|
class BagColor extends Controller
|
||||||
|
{
|
||||||
|
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
|
||||||
|
|
||||||
|
public $listConfig = 'config_list.yaml';
|
||||||
|
public $formConfig = 'config_form.yaml';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
BackendMenu::setContext('Romanah.Gokbakja', 'main-menu-item5', 'side-menu-item');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div data-control="toolbar">
|
||||||
|
<a href="<?= Backend::url('romanah/gokbakja/bagcolor/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
|
||||||
|
<button
|
||||||
|
class="btn btn-default oc-icon-trash-o"
|
||||||
|
disabled="disabled"
|
||||||
|
onclick="$(this).data('request-data', {
|
||||||
|
checked: $('.control-list').listWidget('getChecked')
|
||||||
|
})"
|
||||||
|
data-request="onDelete"
|
||||||
|
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
|
||||||
|
data-trigger-action="enable"
|
||||||
|
data-trigger=".control-list input[type=checkbox]"
|
||||||
|
data-trigger-condition="checked"
|
||||||
|
data-request-success="$(this).prop('disabled', true)"
|
||||||
|
data-stripe-load-indicator>
|
||||||
|
<?= e(trans('backend::lang.list.delete_selected')) ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
name: BagColor
|
||||||
|
form: $/romanah/gokbakja/models/bagcolor/fields.yaml
|
||||||
|
modelClass: Romanah\Gokbakja\Models\BagColor
|
||||||
|
defaultRedirect: romanah/gokbakja/bagcolor
|
||||||
|
create:
|
||||||
|
redirect: 'romanah/gokbakja/bagcolor/update/:id'
|
||||||
|
redirectClose: romanah/gokbakja/bagcolor
|
||||||
|
update:
|
||||||
|
redirect: romanah/gokbakja/bagcolor
|
||||||
|
redirectClose: romanah/gokbakja/bagcolor
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
list: $/romanah/gokbakja/models/bagcolor/columns.yaml
|
||||||
|
modelClass: Romanah\Gokbakja\Models\BagColor
|
||||||
|
title: BagColor
|
||||||
|
noRecordsMessage: 'backend::lang.list.no_records'
|
||||||
|
showSetup: true
|
||||||
|
showCheckboxes: true
|
||||||
|
recordsPerPage: 20
|
||||||
|
toolbar:
|
||||||
|
buttons: list_toolbar
|
||||||
|
search:
|
||||||
|
prompt: 'backend::lang.list.search_prompt'
|
||||||
|
recordUrl: 'romanah/gokbakja/bagcolor/update/:id'
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php Block::put('breadcrumb') ?>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>">BagColor</a></li>
|
||||||
|
<li><?= e($this->pageTitle) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?php Block::endPut() ?>
|
||||||
|
|
||||||
|
<?php if (!$this->fatalError): ?>
|
||||||
|
|
||||||
|
<?= Form::open(['class' => 'layout']) ?>
|
||||||
|
|
||||||
|
<div class="layout-row">
|
||||||
|
<?= $this->formRender() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-buttons">
|
||||||
|
<div class="loading-indicator-container">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
data-request="onSave"
|
||||||
|
data-hotkey="ctrl+s, cmd+s"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-primary">
|
||||||
|
<?= e(trans('backend::lang.form.create')) ?>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
data-request="onSave"
|
||||||
|
data-request-data="close:1"
|
||||||
|
data-hotkey="ctrl+enter, cmd+enter"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-default">
|
||||||
|
<?= e(trans('backend::lang.form.create_and_close')) ?>
|
||||||
|
</button>
|
||||||
|
<span class="btn-text">
|
||||||
|
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?= Form::close() ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||||
|
<p><a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||||
|
<?php endif ?>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?= $this->listRender() ?>
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php Block::put('breadcrumb') ?>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>">BagColor</a></li>
|
||||||
|
<li><?= e($this->pageTitle) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?php Block::endPut() ?>
|
||||||
|
|
||||||
|
<?php if (!$this->fatalError): ?>
|
||||||
|
|
||||||
|
<div class="form-preview">
|
||||||
|
<?= $this->formRenderPreview() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||||
|
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php Block::put('breadcrumb') ?>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>">BagColor</a></li>
|
||||||
|
<li><?= e($this->pageTitle) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?php Block::endPut() ?>
|
||||||
|
|
||||||
|
<?php if (!$this->fatalError): ?>
|
||||||
|
|
||||||
|
<?= Form::open(['class' => 'layout']) ?>
|
||||||
|
|
||||||
|
<div class="layout-row">
|
||||||
|
<?= $this->formRender() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-buttons">
|
||||||
|
<div class="loading-indicator-container">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
data-request="onSave"
|
||||||
|
data-request-data="redirect:0"
|
||||||
|
data-hotkey="ctrl+s, cmd+s"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-primary">
|
||||||
|
<?= e(trans('backend::lang.form.save')) ?>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
data-request="onSave"
|
||||||
|
data-request-data="close:1"
|
||||||
|
data-hotkey="ctrl+enter, cmd+enter"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-default">
|
||||||
|
<?= e(trans('backend::lang.form.save_and_close')) ?>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="oc-icon-trash-o btn-icon danger pull-right"
|
||||||
|
data-request="onDelete"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
|
||||||
|
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<span class="btn-text">
|
||||||
|
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= Form::close() ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||||
|
<p><a href="<?= Backend::url('romanah/gokbakja/bagcolor') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||||
|
<?php endif ?>
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Models;
|
||||||
|
|
||||||
|
use Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model
|
||||||
|
*/
|
||||||
|
class BagColor extends Model
|
||||||
|
{
|
||||||
|
use \October\Rain\Database\Traits\Validation;
|
||||||
|
|
||||||
|
use \October\Rain\Database\Traits\SoftDelete;
|
||||||
|
|
||||||
|
protected $dates = ['deleted_at'];
|
||||||
|
|
||||||
|
|
||||||
|
public $hasMany = [
|
||||||
|
'machine_production' => [
|
||||||
|
'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 = [
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Models;
|
||||||
|
|
||||||
|
use Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model
|
||||||
|
*/
|
||||||
|
class ProductionCalculate extends Model
|
||||||
|
{
|
||||||
|
use \October\Rain\Database\Traits\Validation;
|
||||||
|
|
||||||
|
use \October\Rain\Database\Traits\SoftDelete;
|
||||||
|
|
||||||
|
protected $dates = ['deleted_at'];
|
||||||
|
|
||||||
|
public $belongsTo = [
|
||||||
|
'production' => [
|
||||||
|
'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 = [
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -11,7 +11,7 @@ class ProductionMachine extends Model
|
||||||
|
|
||||||
use \October\Rain\Database\Traits\SoftDelete;
|
use \October\Rain\Database\Traits\SoftDelete;
|
||||||
|
|
||||||
protected $dates = ['deleted_at'];
|
protected $dates = ['deleted_at', 'date'];
|
||||||
|
|
||||||
public $belongsTo = [
|
public $belongsTo = [
|
||||||
'bag_type' => [
|
'bag_type' => [
|
||||||
|
|
@ -34,6 +34,10 @@ class ProductionMachine extends Model
|
||||||
'Romanah\Gokbakja\Models\Employee',
|
'Romanah\Gokbakja\Models\Employee',
|
||||||
'key' => 'mechanic_id'
|
'key' => 'mechanic_id'
|
||||||
],
|
],
|
||||||
|
'color' => [
|
||||||
|
'Romanah\Gokbakja\Models\BagColor',
|
||||||
|
'key' => 'color_id'
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
fields:
|
||||||
|
name:
|
||||||
|
label: 'Rulon Renk Ady'
|
||||||
|
span: auto
|
||||||
|
type: text
|
||||||
|
note:
|
||||||
|
label: Bellik
|
||||||
|
span: auto
|
||||||
|
size: ''
|
||||||
|
type: textarea
|
||||||
|
|
@ -3,10 +3,10 @@ columns:
|
||||||
label: id
|
label: id
|
||||||
type: number
|
type: number
|
||||||
width:
|
width:
|
||||||
label: width
|
label: 'Rulon Ini'
|
||||||
type: text
|
type: text
|
||||||
height:
|
height:
|
||||||
label: height
|
label: 'Rulon Uzynlygy'
|
||||||
type: text
|
type: text
|
||||||
name:
|
name:
|
||||||
label: name
|
label: name
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,12 @@
|
||||||
fields:
|
fields:
|
||||||
width:
|
width:
|
||||||
label: 'Halta Ini'
|
label: 'Rulon Ini'
|
||||||
span: auto
|
span: auto
|
||||||
type: number
|
type: number
|
||||||
height:
|
height:
|
||||||
label: 'Halta uzynlygy'
|
label: 'Rulon uzynlygy m2'
|
||||||
span: auto
|
span: auto
|
||||||
type: number
|
type: number
|
||||||
name:
|
|
||||||
label: Ady
|
|
||||||
span: auto
|
|
||||||
type: text
|
|
||||||
note:
|
note:
|
||||||
label: Bellik
|
label: Bellik
|
||||||
span: auto
|
span: auto
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
fields:
|
fields:
|
||||||
name:
|
name:
|
||||||
label: 'Halta Görnüşiniň Ady'
|
label: 'Rulon Görnüşiniň Ady'
|
||||||
span: auto
|
span: auto
|
||||||
type: text
|
type: text
|
||||||
note:
|
note:
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,6 @@ columns:
|
||||||
note:
|
note:
|
||||||
label: note
|
label: note
|
||||||
type: text
|
type: text
|
||||||
|
date:
|
||||||
|
label: Sene
|
||||||
|
type: datetime
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,8 @@ fields:
|
||||||
label: Note
|
label: Note
|
||||||
span: auto
|
span: auto
|
||||||
type: textarea
|
type: textarea
|
||||||
|
date:
|
||||||
|
label: Sene
|
||||||
|
span: auto
|
||||||
|
mode: date
|
||||||
|
type: datepicker
|
||||||
|
|
|
||||||
|
|
@ -45,3 +45,8 @@ fields:
|
||||||
label: 'Mechanic name'
|
label: 'Mechanic name'
|
||||||
span: auto
|
span: auto
|
||||||
type: text
|
type: text
|
||||||
|
date:
|
||||||
|
label: Sene
|
||||||
|
span: auto
|
||||||
|
mode: datetime
|
||||||
|
type: datepicker
|
||||||
|
|
|
||||||
|
|
@ -56,22 +56,18 @@ navigation:
|
||||||
url: romanah/gokbakja/production
|
url: romanah/gokbakja/production
|
||||||
icon: icon-bookmark
|
icon: icon-bookmark
|
||||||
sideMenu:
|
sideMenu:
|
||||||
side-menu-item:
|
|
||||||
label: report
|
|
||||||
url: romanah/gokbakja/pivotproduction
|
|
||||||
icon: icon-sitemap
|
|
||||||
side-menu-item2:
|
side-menu-item2:
|
||||||
label: 'Halta Görnüşleri'
|
label: 'Rulon Görnüşleri'
|
||||||
url: romanah/gokbakja/bagtype
|
url: romanah/gokbakja/bagtype
|
||||||
icon: icon-bars
|
icon: icon-bars
|
||||||
side-menu-item3:
|
side-menu-item3:
|
||||||
label: 'Halta ölçegleri'
|
label: 'Rulon ölçegleri'
|
||||||
url: romanah/gokbakja/bagsize
|
url: romanah/gokbakja/bagsize
|
||||||
icon: icon-simplybuilt
|
icon: icon-simplybuilt
|
||||||
side-menu-item4:
|
side-menu-item:
|
||||||
label: 'Production Machine'
|
label: 'Reňk Gornushleri'
|
||||||
url: romanah/gokbakja/prodctionmachine
|
url: romanah/gokbakja/bagcolor
|
||||||
icon: icon-sliders
|
icon: icon-sitemap
|
||||||
side-menu-item5:
|
side-menu-item5:
|
||||||
label: Tikinçiler
|
label: Tikinçiler
|
||||||
url: romanah/gokbakja/sewerproduction
|
url: romanah/gokbakja/sewerproduction
|
||||||
|
|
@ -86,6 +82,6 @@ navigation:
|
||||||
url: romanah/gokbakja/machine
|
url: romanah/gokbakja/machine
|
||||||
icon: icon-codepen
|
icon: icon-codepen
|
||||||
side-menu-item2:
|
side-menu-item2:
|
||||||
label: Eksruiterler
|
label: Ekstrudorlar
|
||||||
url: romanah/gokbakja/excruiter
|
url: romanah/gokbakja/excruiter
|
||||||
icon: icon-steam
|
icon: icon-steam
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableCreateRomanahGokbakjaBagColor extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('romanah_gokbakja_bag_color', 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('name');
|
||||||
|
$table->text('note')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('romanah_gokbakja_bag_color');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableCreateRomanahGokbakjaProductionCalculate extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('romanah_gokbakja_production_calculate', 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->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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaMachine3 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->date('date')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('date');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaMachine4 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('date');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->date('date')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaPayment extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_payment', function($table)
|
||||||
|
{
|
||||||
|
$table->date('date')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_payment', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('date');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionCalculate extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->integer('shift_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('shift_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionCalculate2 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('hour_calc');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->double('hour_calc', 10, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionCalculate3 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->double('amount_percentage', 10, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('amount_percentage');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionCalculate4 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->double('hour_calc', 10, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('hour_calc');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionCalculate5 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('hour_calc');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_calculate', function($table)
|
||||||
|
{
|
||||||
|
$table->double('hour_calc', 10, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionMachine5 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->date('date')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('date');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php namespace Romanah\Gokbakja\Updates;
|
||||||
|
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
class BuilderTableUpdateRomanahGokbakjaProductionMachine6 extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->integer('color_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('romanah_gokbakja_production_machine', function($table)
|
||||||
|
{
|
||||||
|
$table->dropColumn('color_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -201,3 +201,39 @@
|
||||||
1.0.68:
|
1.0.68:
|
||||||
- 'Updated table romanah_gokbakja_order'
|
- 'Updated table romanah_gokbakja_order'
|
||||||
- builder_table_update_romanah_gokbakja_order_6.php
|
- 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
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,17 @@ detailsUrlParameter = "id"
|
||||||
pageNumber = "{{ :page }}"
|
pageNumber = "{{ :page }}"
|
||||||
|
|
||||||
[machineProduction]
|
[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 records = builderList.records %}
|
||||||
{% set displayColumn = builderList.displayColumn %}
|
{% set displayColumn = builderList.displayColumn %}
|
||||||
{% set noRecordsMessage = builderList.noRecordsMessage %}
|
{% set noRecordsMessage = builderList.noRecordsMessage %}
|
||||||
|
|
@ -56,6 +65,7 @@ pageNumber = "{{ :page }}"
|
||||||
{% set machines = builderList2.records %}
|
{% set machines = builderList2.records %}
|
||||||
{% set types = builderList4.records %}
|
{% set types = builderList4.records %}
|
||||||
{% set sizes = builderList3.records %}
|
{% set sizes = builderList3.records %}
|
||||||
|
{% set colors = builderList5.records %}
|
||||||
|
|
||||||
{% put styles %}
|
{% put styles %}
|
||||||
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
||||||
|
|
@ -78,6 +88,7 @@ pageNumber = "{{ :page }}"
|
||||||
|
|
||||||
<form data-request="onCreateMachineProduction" data-request-flash>
|
<form data-request="onCreateMachineProduction" data-request-flash>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<select class="form-control select2" name="machine_id">
|
<select class="form-control select2" name="machine_id">
|
||||||
<option value="0">Enjam Saýla</option>
|
<option value="0">Enjam Saýla</option>
|
||||||
|
|
@ -86,6 +97,16 @@ pageNumber = "{{ :page }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<!-- <input type="date" name="date" class="form-control" placeholder="Sene"> -->
|
||||||
|
<div class="input-group" id="datepicker2">
|
||||||
|
<input type="text" class="form-control" name="date" placeholder="Sene"
|
||||||
|
data-date-format="d.m.yyyy" data-date-container='#datepicker2' data-provide="datepicker"
|
||||||
|
data-date-autoclose="true">
|
||||||
|
|
||||||
|
<span class="input-group-text"><i class="mdi mdi-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<select class="form-control select2" name="size_id">
|
<select class="form-control select2" name="size_id">
|
||||||
<option value="0">Ölçeg Saýla</option>
|
<option value="0">Ölçeg Saýla</option>
|
||||||
|
|
@ -102,6 +123,14 @@ pageNumber = "{{ :page }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<select class="form-control select2" name="color_id">
|
||||||
|
<option value="0">Reňk Saýla</option>
|
||||||
|
{% for color in colors %}
|
||||||
|
<option value="{{color.id}}">{{color.name}}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type="number" name="produced_weight" class="form-control"
|
<input type="number" name="produced_weight" class="form-control"
|
||||||
placeholder="Mukdar (kg)">
|
placeholder="Mukdar (kg)">
|
||||||
|
|
@ -124,7 +153,7 @@ pageNumber = "{{ :page }}"
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Enjamlar boýunça
|
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Enjamlar boýunça
|
||||||
({{currentDate|date('d.m.Y | H:i')}}) <font id="validationq" style="color: darkred;font-size: 17px;"></font></h3>
|
(Şu günki sene: {{currentDate|date('d.m.Y | H:i')}}) <font id="validationq" style="color: darkred;font-size: 17px;"></font></h3>
|
||||||
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
|
<p class="card-title-desc" style="color: #6c6ff5;">Hasabat</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -144,10 +173,12 @@ pageNumber = "{{ :page }}"
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
|
<th>Öndürlen Sene</th>
|
||||||
<th>Bina No</th>
|
<th>Bina No</th>
|
||||||
<th>Enjam No</th>
|
<th>Enjam No</th>
|
||||||
<th>Ölçegi</th>
|
<th>Rulon Ölçegi</th>
|
||||||
<th>Görnüşi</th>
|
<th>Rulon Görnüşi</th>
|
||||||
|
<th>Rulon Reňki</th>
|
||||||
<th>Önen Önüm (kg)</th>
|
<th>Önen Önüm (kg)</th>
|
||||||
<th>Ady Familiýasy</th>
|
<th>Ady Familiýasy</th>
|
||||||
<th>Mehanik</th>
|
<th>Mehanik</th>
|
||||||
|
|
@ -161,10 +192,12 @@ pageNumber = "{{ :page }}"
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
|
<th>Öndürlen Sene</th>
|
||||||
<th>Bina No</th>
|
<th>Bina No</th>
|
||||||
<th>Enjam No</th>
|
<th>Enjam No</th>
|
||||||
<th>Ölçegi</th>
|
<th>Rulon Ölçegi</th>
|
||||||
<th>Görnüşi</th>
|
<th>Rulon Görnüşi</th>
|
||||||
|
<th>Rulon Reňki</th>
|
||||||
<th>Önen Önüm (kg)</th>
|
<th>Önen Önüm (kg)</th>
|
||||||
<th>Ady Familiýasy</th>
|
<th>Ady Familiýasy</th>
|
||||||
<th>Mehanik</th>
|
<th>Mehanik</th>
|
||||||
|
|
@ -183,6 +216,7 @@ pageNumber = "{{ :page }}"
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% put scripts %}
|
{% put scripts %}
|
||||||
|
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
|
||||||
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
||||||
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
||||||
{% endput %}
|
{% endput %}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,16 @@ function onStart(){
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
<label class="form-label">Sene</label>
|
||||||
|
<div class="input-group" id="datepicker2">
|
||||||
|
<input type="text" class="form-control" name="date" placeholder="Sene"
|
||||||
|
data-date-format="d.m.yyyy" data-date-container='#datepicker2' data-provide="datepicker"
|
||||||
|
data-date-autoclose="true">
|
||||||
|
|
||||||
|
<span class="input-group-text"><i class="mdi mdi-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div>
|
<div>
|
||||||
<label class="form-label">Tölenen Mukdar ($)</label>
|
<label class="form-label">Tölenen Mukdar ($)</label>
|
||||||
|
|
@ -144,7 +154,7 @@ function onStart(){
|
||||||
<tr>
|
<tr>
|
||||||
<td style="font-weight: bold;">{{(key+1)}}</td>
|
<td style="font-weight: bold;">{{(key+1)}}</td>
|
||||||
<td><a href="#" style="font-weight: bold;">{{payment.amount}} $</a></td>
|
<td><a href="#" style="font-weight: bold;">{{payment.amount}} $</a></td>
|
||||||
<td><a href="#" style="font-weight: bold;">{{payment.created_at|date('d.m.Y')}}</a></td>
|
<td><a href="#" style="font-weight: bold;">{{payment.date != null ? payment.date|date('d.m.Y') : ""}}</a></td>
|
||||||
<td>{{payment.note}}</td>
|
<td>{{payment.note}}</td>
|
||||||
<td><a href="#" data-request="onModalSetPayment"
|
<td><a href="#" data-request="onModalSetPayment"
|
||||||
data-request-data="paymentId: {{payment.id}}"
|
data-request-data="paymentId: {{payment.id}}"
|
||||||
|
|
@ -186,7 +196,7 @@ function onStart(){
|
||||||
|
|
||||||
|
|
||||||
{% put scripts %}
|
{% put scripts %}
|
||||||
|
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
|
||||||
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
||||||
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ function onStart(){
|
||||||
|
|
||||||
$excruiter = $this->param("excruiter");
|
$excruiter = $this->param("excruiter");
|
||||||
|
|
||||||
$this["productions"] = Romanah\Gokbakja\Models\Production::whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->with(['pivot_production', 'excruiter', 'shift'])->orderBy('id', 'DESC')->get();
|
$this["productions"] = Romanah\Gokbakja\Models\Production::where('excruiter_id', $excruiter)->with(['pivot_production', 'excruiter', 'shift'])->orderBy('id', 'DESC')->get();
|
||||||
|
|
||||||
$this["productCounts"] = Romanah\Gokbakja\Models\Product::where('report', 'simple')->count();
|
$this["productCounts"] = Romanah\Gokbakja\Models\Product::where('report', 'simple')->count();
|
||||||
|
|
||||||
$this["shifts"] = Romanah\Gokbakja\Models\Shift::get();
|
$this["shifts"] = Romanah\Gokbakja\Models\Shift::get();
|
||||||
|
|
||||||
$this["calcAll"] = Romanah\Gokbakja\Models\Production::whereDate('created_at', date($currentDateFormat))->sum('time');
|
$this["calcAll"] = Romanah\Gokbakja\Models\Production::sum('time');
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
@ -88,8 +88,7 @@ function onStart(){
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Çig Mallar Boýunça
|
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Çig Mallar Boýunça</h3>
|
||||||
({{currentDate|date('d.m.Y | H:i')}})</h3>
|
|
||||||
<div id="back_btn">
|
<div id="back_btn">
|
||||||
<a href="#">HASABAT</a>
|
<a href="#">HASABAT</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -119,6 +118,13 @@ function onStart(){
|
||||||
<form data-request="onCreateProduction">
|
<form data-request="onCreateProduction">
|
||||||
<tr id="step1">
|
<tr id="step1">
|
||||||
<th style="background: #daddff;">Saýla</th>
|
<th style="background: #daddff;">Saýla</th>
|
||||||
|
<th style="background: #daddff;">
|
||||||
|
<input type="date" name="date" class="form-control" placeholder="Sene">
|
||||||
|
</th>
|
||||||
|
<th style="background: #daddff;">
|
||||||
|
<input type="time" name="time" class="form-control" placeholder="Wagty">
|
||||||
|
</th>
|
||||||
|
|
||||||
<th style="background: #daddff;">
|
<th style="background: #daddff;">
|
||||||
<select class="form-control" name="shift_id" id="shift_id">
|
<select class="form-control" name="shift_id" id="shift_id">
|
||||||
<option value="0">Smen</option>
|
<option value="0">Smen</option>
|
||||||
|
|
@ -187,8 +193,7 @@ function onStart(){
|
||||||
{% for key, report in productions %}
|
{% for key, report in productions %}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
|
<td style="font-weight: bold;width: 5%;">{{key + 1}}</td>
|
||||||
<td><a href="#" style="font-weight: bold;color: #0005c5;">{{report.created_at|date('d.m.Y |
|
<td><a href="#" style="font-weight: bold;color: #0005c5;">{{report.date|date('d.m.Y')}} | {{report.time|date('H:i')}}</a></td>
|
||||||
H:i')}}</a></td>
|
|
||||||
<td><a href="#" style="font-weight: bold;color: #1e2038;">{{report.shift.desc}}</a></td>
|
<td><a href="#" style="font-weight: bold;color: #1e2038;">{{report.shift.desc}}</a></td>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
<span class="badge badge-soft-info"
|
<span class="badge badge-soft-info"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue