[viewBag]
==
<?php
function onStart (){
    $year = $this->param("year");
    $prodId = $this->prodId;
    $currentDate = Carbon\Carbon::now()->timezone('UTC +05:00');

    if($year){

        $this["amount"] = Romanah\Gokbakja\Models\PivotProduction::where('product_id', $prodId)
                            ->whereMonth('created_at', $this["month"])
                            ->whereYear('created_at', $year)
                            ->where('deleted_at', null)
                            ->avg('amount');
    }else{

        $this["amount"] = Romanah\Gokbakja\Models\PivotProduction::where('product_id', $prodId)
                            ->whereMonth('created_at', $this["month"])
                            ->whereYear('created_at', $currentDate->year)
                            ->where('deleted_at', null)
                            ->avg('amount');

    }

}
?>
==
<td style="text-align: center;">
    <span class="badge badge-soft-info"
        style="font-size: 14px;">{{amount|number_format}} kg</span>
</td>
