[viewBag] == param("year"); $prodId = $this->prodId; $currentDate = Carbon\Carbon::now(); $allAmount = $this->all_amount; if($year){ $amountCalc = Romanah\Gokbakja\Models\ProductionCalculate::where('product_id', $prodId) ->whereMonth('date', $this["month"]) ->whereYear('date', $year) ->sum("amount_calc"); if ($amountCalc != null){ $this["pivot_calc"] = (float) ($amountCalc); }else{ $this["pivot_calc"] = 0; } }else{ $amountCalc = Romanah\Gokbakja\Models\ProductionCalculate::where('product_id', $prodId) ->whereMonth('date', $this["month"]) ->whereYear('date', $currentDate->year) ->sum("amount_calc"); if ($amountCalc != null){ $this["pivot_calc"] = (float) ($amountCalc); }else{ $this["pivot_calc"] = 0; } } } ?> ==
{{product_code}}: {{pivot_calc|number_format}} kg