title = "produced/rulon/stock" url = "/produced/rulon/stock/:stockId" layout = "platform_main" is_hidden = 0 == param("stockId"); $this["actions"] = Romanah\Gokbakja\Models\RulonAction::select('romanah_gokbakja_rulon_action.*') ->with(['product' => function($q){ $q->with(['bag_type', 'bag_size', 'color']); }]) ->where("stock_id", $stockId) ->where("status_accountant", "accept") ->where("status_director", "accept") ->addSelect(DB::raw("SUM(amount) as quantity")) ->groupBy('romanah_gokbakja_rulon_action.product_id') ->orderBy('id', 'DESC') ->get(); $this["actionsSumWeight"] = Romanah\Gokbakja\Models\RulonAction::select('romanah_gokbakja_rulon_action.*') ->where("stock_id", $stockId) ->where("status_accountant", "accept") ->where("status_director", "accept") ->sum('amount'); $this["actionsSumCount"] = count($this["actions"]); // dd($this["actions"]); } ?> == {% put styles %} {% endput %}

Öndürlen Rulonlar

sklad

Rulon Sany: {{actionsSumCount}}
Umumy agramy: {{actionsSumWeight}} kg
{% for key, record in actions %} {% endfor %}
Haryt Kody Haryt Hereket Mukdary (KG) Sene Sklad
{{key + 1}} #Rulon{{record.product_id}} {{record.product.bag_type.name}}, {{record.product.bag_size.name}}, {{record.product.color.name}} {{record.type}} {{record.quantity|number_format(2)}} kg {{record.created_at|date('d.m.Y')}} {{record.stock.name}}
Haryt Kody Haryt Hereket Mukdary (KG) Sene Sklad
{% put scripts %} {% endput %} {% partial 'dataTableJs' %}