production calculate table

This commit is contained in:
Shohrat 2023-10-19 02:12:32 +05:00
parent 26325f3dff
commit 49931ad779
39 changed files with 869 additions and 219 deletions

View File

@ -34,17 +34,19 @@ class MachineProduction extends ComponentBase
$currentDateFormat = Carbon::now()->format('Y-m-d');
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->orderBy('id', 'DESC')->whereDate('created_at', date($currentDateFormat))->get();
$machineProductions = ProductionMachineModel::with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic', 'color'])->orderBy('id', 'DESC')->get();
$html_data = '';
for ($x = 0; $x < count($machineProductions); $x++) {
// dd($machineProductions[0]->bag_size);
$html_data .= '<tr>
<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>' . $machineProductions[$x]->machine->name . '</td>
<td>' . $machineProductions[$x]->bag_size->name . '</td>
<td>' . $machineProductions[$x]->bag_type->name . '</td>
<td>' . ($machineProductions[$x]->color->name ?? "") . '</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
</td>
@ -66,10 +68,10 @@ class MachineProduction extends ComponentBase
$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');
$end = Carbon::parse($data["end"])->format('Y-m-d');;
$end = Carbon::parse($data["end"])->format('Y-m-d');
$machine = $data["machine_id"];
$mechanic = $data["mechanic_id"];
$size = $data["size_id"];
@ -93,7 +95,7 @@ class MachineProduction extends ComponentBase
}
if ($start != $currentDateFormat){
$machineProductions->whereBetween('created_at', [$start, $end]);
$machineProductions->whereBetween('date', [$start, $end]);
}
$machineProductionsFiltered = $machineProductions->get();
@ -152,8 +154,10 @@ class MachineProduction extends ComponentBase
$createProductionMachine->type_id = $data["type_id"];
$createProductionMachine->size_id = $data["size_id"];
$createProductionMachine->machine_id = $data["machine_id"];
$createProductionMachine->color_id = $data["color_id"];
$createProductionMachine->produced_weight = $data["produced_weight"];
$createProductionMachine->note = $data["note"];
$createProductionMachine->date = Carbon::parse($data["date"])->format('Y-m-d');
$createProductionMachine->user_id = $user->id;
$createProductionMachine->save();
@ -172,17 +176,19 @@ class MachineProduction extends ComponentBase
$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 = '';
for ($x = 0; $x < count($machineProductions); $x++) {
$html_data .= '<tr>
<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>' . $machineProductions[$x]->machine->name . '</td>
<td>' . $machineProductions[$x]->bag_size->name . '</td>
<td>' . $machineProductions[$x]->bag_type->name . '</td>
<td>' . ($machineProductions[$x]->color->name ?? "") . '</td>
<td><span class="badge badge-soft-success"
style="font-size: 14px;">' . number_format($machineProductions[$x]->produced_weight) . ' kg</span>
</td>

View File

@ -294,7 +294,7 @@ class Order extends ComponentBase
$html_data .= '<tr>
<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]->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><a href="#" data-request="onModalSetPayment"
data-request-data="paymentId: ' . $paymentDatas[$x]->id . '"
@ -387,6 +387,7 @@ class Order extends ComponentBase
$createPayment = new PaymentModel();
$createPayment->date = Carbon::parse($data["date"])->format('Y-m-d');
$createPayment->amount = $data["amount"];
$createPayment->note = $data["note"];
$createPayment->order_id = $orderId;
@ -401,7 +402,7 @@ class Order extends ComponentBase
$html_data .= '<tr>
<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]->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><a href="#" data-request="onModalSetPayment"
data-request-data="paymentId: ' . $paymentDatas[$x]->id . '"

View File

@ -5,7 +5,9 @@ namespace Romanah\Gokbakja\Components;
use Cms\Classes\ComponentBase;
use Romanah\Gokbakja\Models\Product as ProductModel;
use Romanah\Gokbakja\Models\Production as ProductionModel;
use Romanah\Gokbakja\Models\ProductionCalculate as ProductionCalculateModel;
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\PivotProduction as PivotProductionModel;
use Redirect;
@ -13,6 +15,7 @@ use Carbon\Carbon;
use Flash;
use DB;
use October\Rain\Support\Facades\Flash as FacadesFlash;
use Romanah\Gokbakja\Controllers\Excruiter;
class Production extends ComponentBase
{
@ -148,213 +151,158 @@ class Production extends ComponentBase
$excruiter = $this->param("excruiter");
$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();
$currentExcrutier = ExcruiterModel::where("id", $excruiter)->first();
$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'))
->whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $excruiter)->first();
$calc = $productionsCalc->select(DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time'))
->whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiter)->first();
$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);
$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();
$products = ProductModel::where('report', 'simple')->get();
// dd(count($countDailyChanges));
if (count($countDailyChanges) > 1) {
$dailyCalculated = ProductionCalculateModel::whereDate("date", date($currentDateFormat))->where("excruiter_id", $excruiter)->sum("amount_calc");
//sagatda ortacaha hasaplama
$html_data2 ='';
// gunluk hasabat
$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">
<a class="card bg-success text-white-50">
<div class="card-body">
<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>
<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>
</a>
</div>';
for ($x = 0; $x < count($pivotLasts); $x++) {
//sagatda ortacaha hasaplama
$html_data2 .= '<div class="row">';
$html_data2 .= '<h4 style="margin-top: 20px;margin-bottom: 20px;">SAGATDA ORTAÇA (ekskruiter: ' . $currentExcrutier->name . ')</h4>';
$html_data2 .= '<div class="col-lg">
<a class="card bg-success text-white-50">
<div class="card-body">
<h5 class="mb-4 text-white"><i
class="mdi mdi-bullseye-arrow me-3"></i>' . $timeCalc. '</h5>
<hr>
<p class="card-text" style="font-size: 15px;color: white;">SAGATDA ORTAÇA: ' . number_format($dailyCalculated / floor($diffMinutes / 60), 2) . ' kg</p>
</div>
</a>
</div>';
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;
// $diffPerc = ($diff * 100) / $producedAll;
$calculatedPercentage = (float) ($pivotLasts[$x]->amount_percentage / 100) * (float) $producedAll;
$html_data .= '<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>' . ($calculatedPercentage) . ' kg</h5>
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . ($productCalc) . ' kg</h5>
<hr>
<p class="card-text" style="font-size: 15px;color: white;">' . $pivotLasts[$x]->product_name . ' : ' . ($pivotLasts[$x]->amount_percentage) . ' %</p>
<p class="card-text" style="font-size: 15px;color: white;">' . $products[$x]->name . ' : ' . ($productCalcPercentage->amount_percentage) . ' %</p>
</div>
</a>
</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>';
$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">
<a class="card bg-success text-white-50">
<div class="card-body">
<h5 class="mb-4 text-white"><i
class="mdi mdi-bullseye-arrow me-3"></i>' . $allData["all"]["hours"] . '</h5>
<hr>
<p class="card-text" style="font-size: 15px;color: white;">Sagatda Ortaça: ' . (number_format($avgProducedHour, 2)) . ' kg</p>
</div>
</a>
</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;
$calculatePercentageHour = (float) (($calculatedPercentage / $hourCount) * 100) / (float) $producedAll;
$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> Sagatda: ' . (number_format(($calculatedPercentage / $hourCount), 2)) . ' kg</h5>
<hr>
<p class="card-text" style="font-size: 15px;color: white;">' . $pivotLasts[$x]->product_name . ' : ' . (number_format($calculatePercentageHour, 2)) . ' %</p>
</div>
</a>
</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();
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();
/////////////
$html_data3 = '<div class="row">';
for ($x = 0; $x < count($excruiters); $x++) {
$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'))
->whereDate('created_at', date($currentDateFormat))->where('excruiter_id', $currentDateExcruiters[$i]->excruiter_id)->first();
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
$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">
<a class="card bg-success text-white-50">
<div class="card-body">
<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>
<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>
</a>
</div>';
$excruiterDatas = PivotProductionModel::where('production_id', $currentDateLastExc->id)->get();
// $pivotLasts = PivotProductionModel::where('production_id', $currentDateLast->id)->get();
for ($i = 0; $i < count($products); $i++) {
// \Log::info($excruiterDatas);
for ($ii = 0; $ii < count($excruiterDatas); $ii++) {
// $diff = $pivotLasts[$x]->amount - $pivotFirsts[$x]->amount;
// $diffPerc = ($diff * 100) / $producedAll;
$calculatedPercentage = (float) ($excruiterDatas[$ii]->amount_percentage / 100) * (float) $allAmountExc;
$productCalc = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiters[$x]->id)->where("product_id", $products[$i]->id)->sum('amount_calc');
$productCalcPercentage = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('excruiter_id', $excruiters[$x]->id)->where("product_id", $products[$i]->id)->orderBy('id', 'DESC')->first();
$html_data3 .= '<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>' . ($calculatedPercentage) . ' kg</h5>
<h5 class="mb-4 text-white"><i class="mdi mdi-bullseye-arrow me-3"></i>' . ($productCalc) . ' kg</h5>
<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>
</a>
</div>';
}
$html_data3 .= '</div><hr>';
}
// }
}
$html_data3 .= '</div>';
$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();
//smenlar boyuncha
$shifts = ShiftModel::get();
$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 .= '<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
@ -364,55 +312,52 @@ class Production extends ComponentBase
<tr>
<th>#</th>
<th>Smen</th>
<th>Ekskruiter</th>
<th>Wagty</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>';
// }
<th>Jemi</th>';
$html_data4 .= '</tr>
</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')->whereDate('created_at', date($currentDateFormat));
$calc = $productionsCalc->select(DB::raw('MAX(all_amount) - MIN(all_amount) AS amount_subtraction'), DB::raw('MAX(all_amount) AS max_amount'), DB::raw('MIN(all_amount) AS min_amount'), DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time'))
->where('shift_id', $currentDateShifts[$i]->shift_id)->where('excruiter_id', $currentDateShifts[$i]->excruiter_id)->first();
$productionsCalc = ProductionModel::orderBy('id', 'DESC');
$calc = $productionsCalc->select(DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time'))
->whereDate('date', date($currentDateFormat))->where('shift_id', $shifts[$i]->id)->first();
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
$hourCountShift = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
$sumTimeDiffs += $diffMinutes;
$timeCalc = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
$productCalc = ProductionCalculateModel::whereDate('date', date($currentDateFormat))->where('shift_id', $shifts[$i]->id)->sum('amount_calc');
$productAllCalc += $productCalc;
$html_data4 .= '<tr>
<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><span class="badge badge-soft-info"
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 style="font-weight: bold;color: #0005c5;">' . $shifts[$i]->desc . '(' . $shifts[$i]->start . ' - ' . $shifts[$i]->end . ')</td>
<td>'.$timeCalc.'</td>
<td>' . $productCalc . ' kg</td>';
$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>
</table></div></div></div>';
return [
'#calculation_of_day' => $html_data,
'#avg_of_day' => $html_data2,
@ -431,6 +376,8 @@ class Production extends ComponentBase
function onCalculateAvg()
{
$currentDate = Carbon::now()->timezone('UTC +05:00');
@ -520,7 +467,7 @@ class Production extends ComponentBase
$excruiter = $this->param("excruiter");
if ($excruiter == 0) {
Flash::error("Ekskruiter Saýla!");
Flash::error("Ekstrudor Saýla!");
return Redirect::refresh();
} else {
$createProduction = new ProductionModel();
@ -528,8 +475,8 @@ class Production extends ComponentBase
$createProduction->all_amount = $data["all_amount"];
$createProduction->note = $data["note"];
$createProduction->user_id = $user->id;
$createProduction->date = $currentDate->format('Y-m-d');
$createProduction->time = $currentDate->format('H:i:s');
$createProduction->date = Carbon::parse($data["date"])->format('Y-m-d');
$createProduction->time = Carbon::parse($data["time"])->format('H:i:s');
$createProduction->excruiter_id = $excruiter;
$createProduction->shift_id = $data["shift_id"];
$createProduction->save();
@ -548,15 +495,46 @@ class Production extends ComponentBase
$createProduction->excruiter_id = $excruiter;
$createPivotProduction->amount = (float)(((float) $data[$fieldName] ?? 0) / 100) * ((float) $createProduction->all_amount);
$createPivotProduction->date = $currentDate->format('Y-m-d');
$createPivotProduction->time = $currentDate->format('H:i:s');
$createPivotProduction->date = Carbon::parse($data["date"])->format('Y-m-d');
$createPivotProduction->time = Carbon::parse($data["time"])->format('H:i:s');
$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) {
Flash::success("Hasabat Ustunlikli Goşuldy");
return Redirect::refresh();
}
}
}
@ -605,4 +583,5 @@ class Production extends ComponentBase
// }
}

View File

@ -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');
}
}

View File

@ -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>

View File

@ -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

View File

@ -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'

View File

@ -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 ?>

View File

@ -0,0 +1 @@
<?= $this->listRender() ?>

View File

@ -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>

View File

@ -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 ?>

View File

@ -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 = [
];
}

View File

@ -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 = [
];
}

View File

@ -11,7 +11,7 @@ class ProductionMachine extends Model
use \October\Rain\Database\Traits\SoftDelete;
protected $dates = ['deleted_at'];
protected $dates = ['deleted_at', 'date'];
public $belongsTo = [
'bag_type' => [
@ -34,6 +34,10 @@ class ProductionMachine extends Model
'Romanah\Gokbakja\Models\Employee',
'key' => 'mechanic_id'
],
'color' => [
'Romanah\Gokbakja\Models\BagColor',
'key' => 'color_id'
],
];
/**

View File

@ -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

View File

@ -0,0 +1,10 @@
fields:
name:
label: 'Rulon Renk Ady'
span: auto
type: text
note:
label: Bellik
span: auto
size: ''
type: textarea

View File

@ -3,10 +3,10 @@ columns:
label: id
type: number
width:
label: width
label: 'Rulon Ini'
type: text
height:
label: height
label: 'Rulon Uzynlygy'
type: text
name:
label: name

View File

@ -1,16 +1,12 @@
fields:
width:
label: 'Halta Ini'
label: 'Rulon Ini'
span: auto
type: number
height:
label: 'Halta uzynlygy'
label: 'Rulon uzynlygy m2'
span: auto
type: number
name:
label: Ady
span: auto
type: text
note:
label: Bellik
span: auto

View File

@ -1,6 +1,6 @@
fields:
name:
label: 'Halta Görnüşiniň Ady'
label: 'Rulon Görnüşiniň Ady'
span: auto
type: text
note:

View File

@ -11,3 +11,6 @@ columns:
note:
label: note
type: text
date:
label: Sene
type: datetime

View File

@ -13,3 +13,8 @@ fields:
label: Note
span: auto
type: textarea
date:
label: Sene
span: auto
mode: date
type: datepicker

View File

@ -45,3 +45,8 @@ fields:
label: 'Mechanic name'
span: auto
type: text
date:
label: Sene
span: auto
mode: datetime
type: datepicker

View File

@ -56,22 +56,18 @@ navigation:
url: romanah/gokbakja/production
icon: icon-bookmark
sideMenu:
side-menu-item:
label: report
url: romanah/gokbakja/pivotproduction
icon: icon-sitemap
side-menu-item2:
label: 'Halta Görnüşleri'
label: 'Rulon Görnüşleri'
url: romanah/gokbakja/bagtype
icon: icon-bars
side-menu-item3:
label: 'Halta ölçegleri'
label: 'Rulon ölçegleri'
url: romanah/gokbakja/bagsize
icon: icon-simplybuilt
side-menu-item4:
label: 'Production Machine'
url: romanah/gokbakja/prodctionmachine
icon: icon-sliders
side-menu-item:
label: 'Reňk Gornushleri'
url: romanah/gokbakja/bagcolor
icon: icon-sitemap
side-menu-item5:
label: Tikinçiler
url: romanah/gokbakja/sewerproduction
@ -86,6 +82,6 @@ navigation:
url: romanah/gokbakja/machine
icon: icon-codepen
side-menu-item2:
label: Eksruiterler
label: Ekstrudorlar
url: romanah/gokbakja/excruiter
icon: icon-steam

View File

@ -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');
}
}

View File

@ -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');
}
}

View File

@ -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');
});
}
}

View File

@ -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();
});
}
}

View File

@ -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');
});
}
}

View File

@ -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');
});
}
}

View File

@ -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);
});
}
}

View File

@ -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');
});
}
}

View File

@ -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');
});
}
}

View File

@ -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);
});
}
}

View File

@ -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');
});
}
}

View File

@ -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');
});
}
}

View File

@ -201,3 +201,39 @@
1.0.68:
- 'Updated table romanah_gokbakja_order'
- builder_table_update_romanah_gokbakja_order_6.php
1.0.69:
- 'Updated table romanah_gokbakja_machine'
- builder_table_update_romanah_gokbakja_machine_3.php
1.0.70:
- 'Updated table romanah_gokbakja_machine'
- builder_table_update_romanah_gokbakja_machine_4.php
1.0.71:
- 'Updated table romanah_gokbakja_production_machine'
- builder_table_update_romanah_gokbakja_production_machine_5.php
1.0.72:
- 'Created table romanah_gokbakja_bag_color'
- builder_table_create_romanah_gokbakja_bag_color.php
1.0.73:
- 'Updated table romanah_gokbakja_production_machine'
- builder_table_update_romanah_gokbakja_production_machine_6.php
1.0.74:
- 'Updated table romanah_gokbakja_payment'
- builder_table_update_romanah_gokbakja_payment.php
1.0.75:
- 'Created table romanah_gokbakja_production_calculate'
- builder_table_create_romanah_gokbakja_production_calculate.php
1.0.76:
- 'Updated table romanah_gokbakja_production_calculate'
- builder_table_update_romanah_gokbakja_production_calculate.php
1.0.77:
- 'Updated table romanah_gokbakja_production_calculate'
- builder_table_update_romanah_gokbakja_production_calculate_2.php
1.0.78:
- 'Updated table romanah_gokbakja_production_calculate'
- builder_table_update_romanah_gokbakja_production_calculate_3.php
1.0.79:
- 'Updated table romanah_gokbakja_production_calculate'
- builder_table_update_romanah_gokbakja_production_calculate_4.php
1.0.80:
- 'Updated table romanah_gokbakja_production_calculate'
- builder_table_update_romanah_gokbakja_production_calculate_5.php

View File

@ -44,8 +44,17 @@ detailsUrlParameter = "id"
pageNumber = "{{ :page }}"
[machineProduction]
==
[builderList builderList5]
modelClass = "Romanah\Gokbakja\Models\BagColor"
scope = "-"
scopeValue = "{{ :scope }}"
displayColumn = "id"
noRecordsMessage = "No records found"
detailsPage = "-"
detailsUrlParameter = "id"
pageNumber = "{{ :page }}"
==
{% set records = builderList.records %}
{% set displayColumn = builderList.displayColumn %}
{% set noRecordsMessage = builderList.noRecordsMessage %}
@ -56,6 +65,7 @@ pageNumber = "{{ :page }}"
{% set machines = builderList2.records %}
{% set types = builderList4.records %}
{% set sizes = builderList3.records %}
{% set colors = builderList5.records %}
{% put styles %}
<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>
<div class="row">
<div class="col">
<select class="form-control select2" name="machine_id">
<option value="0">Enjam Saýla</option>
@ -86,6 +97,16 @@ pageNumber = "{{ :page }}"
{% endfor %}
</select>
</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">
<select class="form-control select2" name="size_id">
<option value="0">Ölçeg Saýla</option>
@ -102,6 +123,14 @@ pageNumber = "{{ :page }}"
{% endfor %}
</select>
</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">
<input type="number" name="produced_weight" class="form-control"
placeholder="Mukdar (kg)">
@ -124,7 +153,7 @@ pageNumber = "{{ :page }}"
<div class="row">
<div class="col-md-6">
<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>
</div>
@ -144,10 +173,12 @@ pageNumber = "{{ :page }}"
<thead>
<tr>
<th style="width: 5%;"></th>
<th>Öndürlen Sene</th>
<th>Bina No</th>
<th>Enjam No</th>
<th>Ölçegi</th>
<th>Görnüşi</th>
<th>Rulon Ölçegi</th>
<th>Rulon Görnüşi</th>
<th>Rulon Reňki</th>
<th>Önen Önüm (kg)</th>
<th>Ady Familiýasy</th>
<th>Mehanik</th>
@ -161,10 +192,12 @@ pageNumber = "{{ :page }}"
<tfoot>
<tr>
<th style="width: 5%;"></th>
<th>Öndürlen Sene</th>
<th>Bina No</th>
<th>Enjam No</th>
<th>Ölçegi</th>
<th>Görnüşi</th>
<th>Rulon Ölçegi</th>
<th>Rulon Görnüşi</th>
<th>Rulon Reňki</th>
<th>Önen Önüm (kg)</th>
<th>Ady Familiýasy</th>
<th>Mehanik</th>
@ -183,6 +216,7 @@ pageNumber = "{{ :page }}"
</div>
{% 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/js/pages/form-advanced.init.js'|theme}}"></script>
{% endput %}

View File

@ -75,6 +75,16 @@ function onStart(){
<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>
<label class="form-label">Tölenen Mukdar ($)</label>
@ -144,7 +154,7 @@ function onStart(){
<tr>
<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.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><a href="#" data-request="onModalSetPayment"
data-request-data="paymentId: {{payment.id}}"
@ -186,7 +196,7 @@ function onStart(){
{% 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/js/pages/form-advanced.init.js'|theme}}"></script>

View File

@ -28,13 +28,13 @@ function onStart(){
$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["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="row">
<div class="col-md-6">
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Çig Mallar Boýunça
({{currentDate|date('d.m.Y | H:i')}})</h3>
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Çig Mallar Boýunça</h3>
<div id="back_btn">
<a href="#">HASABAT</a>
</div>
@ -119,6 +118,13 @@ function onStart(){
<form data-request="onCreateProduction">
<tr id="step1">
<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;">
<select class="form-control" name="shift_id" id="shift_id">
<option value="0">Smen</option>
@ -187,8 +193,7 @@ function onStart(){
{% for key, report in productions %}
<tr>
<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 |
H:i')}}</a></td>
<td><a href="#" style="font-weight: bold;color: #0005c5;">{{report.date|date('d.m.Y')}} | {{report.time|date('H:i')}}</a></td>
<td><a href="#" style="font-weight: bold;color: #1e2038;">{{report.shift.desc}}</a></td>
<td style="text-align: center;">
<span class="badge badge-soft-info"