g_sto/themes/gokbakja/partials/report/month-row.htm

21 lines
654 B
HTML

[viewBag]
==
<?php
function onStart (){
$no = $this->no;
$year = $this->year;
$prodId = $this->prodId;
$this["amount"] = Romanah\Gokbakja\Models\PivotProduction::where('product_id', $prodId)
->whereMonth('created_at', $no)
->whereYear('created_at', $year)
->where('deleted_at', null)
->avg('amount');
}
?>
==
<td style="text-align: center;">
{{amount|number_format}} kg
</td>