g_sto/themes/gokbakja/partials/sewer/row.htm

38 lines
1.7 KiB
HTML

[viewBag]
==
<?php
function onStart (){
$no = $this->no;
$year = $this->year;
$sewerIds = Romanah\Gokbakja\Models\SewerProduction::whereMonth('date', $no)->whereYear('date', $year)->get()->pluck("id")->toArray();
$this["all_amount"] = Romanah\Gokbakja\Models\PivotSewer::whereIn("sewer_production_id", $sewerIds)->sum("spent_amount");
$this["all_bag_qty"] = Romanah\Gokbakja\Models\SewerProduction::whereMonth('date', $no)
->whereYear('date', $year)
->sum('produced_bag_qty');
$this["all_defective_bag_qty"] = Romanah\Gokbakja\Models\SewerProduction::whereMonth('date', $no)
->whereYear('date', $year)
->sum('defective_bag_qty');
$this["all_defective_bag_qty_repair"] = Romanah\Gokbakja\Models\SewerProduction::whereMonth('date', $no)
->whereYear('date', $year)
->sum('defective_repair_qty');
}
?>
==
<tr>
<td style="font-weight: bold;width: 5%;">{{no}}</td>
<td><a href="#" style="font-weight: bold;color: #0005c5;"> {{title}} </a></td>
<td><a href="#" style="font-weight: bold;"> {{all_amount|number_format}} kg</a></td>
<td><a href="#" style="font-weight: bold;"> {{all_bag_qty|number_format}} sany</a></td>
<td><a href="#" style="font-weight: bold;"> {{all_defective_bag_qty|number_format}} sany</a></td>
<td><a href="#" style="font-weight: bold;"> {{all_defective_bag_qty_repair|number_format}} sany</a></td>
</tr>