production settings
This commit is contained in:
parent
76670cb664
commit
8a04165387
|
|
@ -88,13 +88,12 @@ class Production extends ComponentBase
|
||||||
if ($start != $currentDateFormat) {
|
if ($start != $currentDateFormat) {
|
||||||
$productions->whereBetween('date', [$start, $end]);
|
$productions->whereBetween('date', [$start, $end]);
|
||||||
|
|
||||||
$calc = $productionsCalc->select(DB::raw('MAX(time) AS max_time'), DB::raw('MIN(time) AS min_time'))
|
|
||||||
->whereBetween('date', [$start, $end])->first();
|
|
||||||
|
|
||||||
$diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
|
||||||
$calcTimeDiff = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
|
|
||||||
|
|
||||||
$calcq = $this->calculateHoursAndMinutes($calc->date, $calc->time);
|
// $diffMinutes = Carbon::parse($calc->max_time)->diffInMinutes($calc->min_time);
|
||||||
|
// $calcTimeDiff = floor($diffMinutes / 60) . ' sagat ' . ($diffMinutes - floor($diffMinutes / 60) * 60) . ' minut';
|
||||||
|
|
||||||
|
// $calcq = $this->calculateHoursAndMinutes($calc->date, $calc->time);
|
||||||
|
|
||||||
// dd($calcq);
|
// dd($calcq);
|
||||||
|
|
||||||
|
|
@ -114,9 +113,26 @@ class Production extends ComponentBase
|
||||||
|
|
||||||
$pivotIds = PivotProductionModel::whereIn('production_id', $calculationAmountqq)->get()->pluck('id')->toArray();
|
$pivotIds = PivotProductionModel::whereIn('production_id', $calculationAmountqq)->get()->pluck('id')->toArray();
|
||||||
|
|
||||||
$calculationAmount = ProductionCalculateModel::whereIn('production_id', $calculationAmountqq)->sum("amount_calc");
|
$calculationAmount = ProductionCalculateModel::whereIn('prev_pivot_id', $pivotIds)->sum("amount_calc");
|
||||||
|
|
||||||
|
|
||||||
|
$calcHours = $productionsCalcPivot->orderBy('date', 'DESC')->orderBy('time', 'DESC')->get();
|
||||||
|
|
||||||
|
$calcHourCount = (count($calcHours) - 1);
|
||||||
|
|
||||||
|
$dateStart = $calcHours[0]->date.' '.$calcHours[0]->time;
|
||||||
|
$dateEnd = $calcHours[$calcHourCount]->date.' '.$calcHours[$calcHourCount]->time;
|
||||||
|
|
||||||
|
$carbonInstanceStart = Carbon::parse($dateStart);
|
||||||
|
$carbonInstanceEnd = Carbon::parse($dateEnd);
|
||||||
|
|
||||||
|
$calcHourq = $carbonInstanceEnd->diffInHours($carbonInstanceStart);
|
||||||
|
|
||||||
|
$hours = floor($calcHourq); // Get the whole hours
|
||||||
|
$minutes = ($calcHourq - $hours) * 60;
|
||||||
|
|
||||||
|
$calcTimeDiff = $hours.' sagat ';
|
||||||
|
|
||||||
//dd($pivotIds);
|
//dd($pivotIds);
|
||||||
|
|
||||||
$html_data = '';
|
$html_data = '';
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@ function onStart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($year){
|
if($year){
|
||||||
$this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->with(['pivot_production'])->get();
|
$this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('date', $this["month"])->whereYear('date', $year)->with(['pivot_production'])->get();
|
||||||
|
|
||||||
|
|
||||||
$this["month_all_amount_calcq"] = Romanah\Gokbakja\Models\ProductionCalculate::whereMonth('date', $this["month"])->whereYear('date', $year)->sum("amount_calc");
|
$this["month_all_amount_calcq"] = Romanah\Gokbakja\Models\ProductionCalculate::whereMonth('date', $this["month"])->whereYear('date', $year)->sum("amount_calc");
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->with(['pivot_production'])->get();
|
$this["productions"] = Romanah\Gokbakja\Models\Production::whereMonth('date', $this["month"])->whereYear('date', $currentDate->year)->with(['pivot_production'])->get();
|
||||||
|
|
||||||
|
|
||||||
$this["month_all_amount_calcq"] = Romanah\Gokbakja\Models\ProductionCalculate::whereMonth('date', $this["month"])->whereYear('date', $currentDate->year)->sum("amount_calc");
|
$this["month_all_amount_calcq"] = Romanah\Gokbakja\Models\ProductionCalculate::whereMonth('date', $this["month"])->whereYear('date', $currentDate->year)->sum("amount_calc");
|
||||||
|
|
@ -109,9 +109,7 @@ function onStart() {
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
<th>Senesi</th>
|
<th>Senesi</th>
|
||||||
<th>Hemmesi</th>
|
<th>Hemmesi</th>
|
||||||
{% for key, record in reportProducts %}
|
<th>Harytlar</th>
|
||||||
<th>{{record.code}}</th>
|
|
||||||
{% endfor %}
|
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
<!-- <th>Настройки</th> -->
|
<!-- <th>Настройки</th> -->
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -122,16 +120,22 @@ function onStart() {
|
||||||
<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="/get-production/{{report.id}}"
|
<td><a href="/get-production/{{report.id}}"
|
||||||
style="font-weight: bold;color: #0005c5;">{{report.created_at|date('d.m.Y |
|
style="font-weight: bold;color: #0005c5;">{{report.date|date('d.m.Y |
|
||||||
H:i')}}</a></td>
|
H:i')}}</a></td>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
<span class="badge badge-soft-success"
|
<span class="badge badge-soft-success"
|
||||||
style="font-size: 14px;">{{report.all_amount|number_format}} kg</span>
|
style="font-size: 14px;">{{report.all_amount|number_format}} kg</span>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
{% for product in report.pivot_production %}
|
<div class="row">
|
||||||
<td>{{product.amount_percentage}} %</td>
|
{% for product in report.pivot_production %}
|
||||||
{% endfor %}
|
<div class="col">
|
||||||
|
<font style="font-weight: bold;"> {{product.product_code}}: </font>
|
||||||
|
{{product.amount_percentage}} %
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td style="font-weight: bold;color: #0005c5;">{{report.note}}</td>
|
<td style="font-weight: bold;color: #0005c5;">{{report.note}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
@ -145,10 +149,14 @@ function onStart() {
|
||||||
<span class="badge badge-soft-info"
|
<span class="badge badge-soft-info"
|
||||||
style="font-size: 14px;">{{month_all_amount_calcq|number_format}} kg</span>
|
style="font-size: 14px;">{{month_all_amount_calcq|number_format}} kg</span>
|
||||||
</td>
|
</td>
|
||||||
|
<td style="text-align: center;">
|
||||||
{% for key, product in reportProducts %}
|
<div class="row">
|
||||||
{% partial 'report/product-month-row' prodId=product.id all_amount=month_all_amount_calc.amount_subtraction %}
|
{% for key, product in reportProducts %}
|
||||||
{% endfor %}
|
{% partial 'report/product-month-row' product_code=product.code
|
||||||
|
prodId=product.id all_amount=month_all_amount_calc.amount_subtraction %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td style="font-weight: bold;color: #0005c5;"></td>
|
<td style="font-weight: bold;color: #0005c5;"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
@ -158,9 +166,7 @@ function onStart() {
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
<th>Senesi</th>
|
<th>Senesi</th>
|
||||||
<th>Hemmesi</th>
|
<th>Hemmesi</th>
|
||||||
{% for key, record in reportProducts %}
|
<th>Harytlar</th>
|
||||||
<th>{{record.code}}</th>
|
|
||||||
{% endfor %}
|
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|
@ -178,4 +184,4 @@ function onStart() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% partial 'dataTableJs' %}
|
{% partial 'dataTableJs' %}
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,9 @@ function onStart(){
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
<th>Aýlar</th>
|
<th>Aýlar</th>
|
||||||
<th>Işlenen çig mal</th>
|
<th>Işlenen çig mal</th>
|
||||||
{% for key, record in reportProducts %}
|
|
||||||
<th>{{record.code}}</th>
|
<th>Harytlar</th>
|
||||||
{% endfor %}
|
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
<!-- <th>Настройки</th> -->
|
<!-- <th>Настройки</th> -->
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -85,9 +85,7 @@ function onStart(){
|
||||||
<th style="width: 5%;">№</th>
|
<th style="width: 5%;">№</th>
|
||||||
<th>Aýlar</th>
|
<th>Aýlar</th>
|
||||||
<th>Işlenen çig mal</th>
|
<th>Işlenen çig mal</th>
|
||||||
{% for key, record in reportProducts %}
|
<th>Harytlar</th>
|
||||||
<th>{{record.code}}</th>
|
|
||||||
{% endfor %}
|
|
||||||
<th>Bellik</th>
|
<th>Bellik</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|
@ -102,4 +100,4 @@ function onStart(){
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% partial 'dataTableJs' %}
|
{% partial 'dataTableJs' %}
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,8 @@ function onStart (){
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
==
|
==
|
||||||
<td style="text-align: center;">
|
|
||||||
{% if pivot_calc > 0 %}
|
|
||||||
{{pivot_calc|number_format}} kg <br>
|
|
||||||
|
|
||||||
|
{% if pivot_calc > 0 %}
|
||||||
|
<font style="font-weight: bold;"> {{product_code}}:</font> {{pivot_calc|number_format}} kg <br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ function onStart (){
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$amountCalc = Romanah\Gokbakja\Models\ProductionCalculate::where('product_id', $prodId)
|
$amountCalc = Romanah\Gokbakja\Models\ProductionCalculate::where('product_id', $prodId)
|
||||||
->whereMonth('created_at', $this["month"])
|
->whereMonth('date', $this["month"])
|
||||||
->whereYear('created_at', $currentDate->year)
|
->whereYear('date', $currentDate->year)
|
||||||
->sum("amount_calc");
|
->sum("amount_calc");
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -43,7 +43,11 @@ function onStart (){
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
==
|
==
|
||||||
<td style="text-align: center;">
|
<div class="col">
|
||||||
<span class="badge badge-soft-info"
|
<span class="badge badge-soft-info" style="font-size: 14px;">
|
||||||
style="font-size: 14px;">{{pivot_calc|number_format}} kg</span>
|
|
||||||
</td>
|
{{product_code}}: {{pivot_calc|number_format}} kg
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,14 @@ function onStart (){
|
||||||
<td style="font-weight: bold;width: 5%;">{{no}}</td>
|
<td style="font-weight: bold;width: 5%;">{{no}}</td>
|
||||||
<td><a href="/all-production-month/{{no}}" style="font-weight: bold;color: #0005c5;"> {{title}} </a></td>
|
<td><a href="/all-production-month/{{no}}" style="font-weight: bold;color: #0005c5;"> {{title}} </a></td>
|
||||||
<td><a href="/all-production-month/{{no}}" style="font-weight: bold;"> {{all_amount_calc|number_format}} kg</a></td>
|
<td><a href="/all-production-month/{{no}}" style="font-weight: bold;"> {{all_amount_calc|number_format}} kg</a></td>
|
||||||
{% for key, record in products %}
|
<td style="text-align: center;">
|
||||||
{% partial "report/month-row" prodId=record.id all_amount=all_amount_calc %}
|
<div class="row">
|
||||||
{% endfor %}
|
{% for key, record in products %}
|
||||||
|
<div class="col">
|
||||||
|
{% partial "report/month-row" product_code=record.code prodId=record.id all_amount=all_amount_calc %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td style="font-weight: bold;color: #0005c5;">{{hours}}</td>
|
<td style="font-weight: bold;color: #0005c5;">{{hours}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue