loaded cbm monthly report

This commit is contained in:
omair saleh
2021-10-01 18:02:09 +08:00
parent 26a0bc186e
commit c76271d8ab
+3 -2
View File
@@ -130,8 +130,9 @@ Route::group(['prefix' => 'template', 'as' => 'template.'], function () {
});
Route::get('/report', function(){
$totalCbm = Container::whereMonth('loading_date', '=', '09')->whereYear('loading_date', '=', '2021')->get()->sum(function($container){
$container->packingLists->sum(function($packing_list){
$containers = Container::whereMonth('loading_date', '=', '09')->whereYear('loading_date', '=', '2021')->get();
$totalCbm = $containers->sum(function($container){
return $container->packingLists->sum(function($packing_list){
return $packing_list->packages->sum(function ($package){
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100));
});