title = "Get all machine production by month" url = "/get-all-machine-production-month/:month/:year?" layout = "platform_main" is_hidden = 0 == param("month"); $year = $this->param("year"); if($year){ $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $year)->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->get(); $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) ->whereYear('created_at', $year) ->sum('produced_weight'); }else{ $this["machineProductions"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"])->whereYear('created_at', $currentDate->year)->with(['bag_type', 'bag_size', 'machine.building', 'employee', 'mechanic'])->get(); $this["month_all_amount"] = Romanah\Gokbakja\Models\ProductionMachine::whereMonth('created_at', $this["month"]) ->whereYear('created_at', $currentDate->year) ->sum('produced_weight'); } } ?> == {% put styles %} {% endput %}

Enjamlar boýunça ({{production.created_at|date('d.m.Y')}})

Hasabat

{% for key, machine in machineProductions %} {% endfor %}
Bina No Enjam No Ölçegi Görnüşi Önen Önüm (kg) Ady Familiýasy Mehanik Bellik
{{key + 1}} {{machine.building_name}} {{machine.machine.name}} {{machine.bag_size.name}} {{machine.bag_type.name}} {{machine.produced_weight|number_format}} kg {{machine.employee_name}} {{machine.mechanic_name}} {{machine.note}}
# JEMI {{month_all_amount|number_format}} kg
Bina No Enjam No Ölçegi Görnüşi Önen Önüm (kg) Ady Familiýasy Mehanik Bellik
{% partial 'dataTableJs' %}