customer report

This commit is contained in:
omair saleh
2021-10-01 21:25:02 +08:00
parent feb04e8498
commit 019073afc5
2 changed files with 4 additions and 5 deletions
@@ -123,7 +123,7 @@ class FetchLoadedContainersFromVTPortalProcessor
*/
public function execute(?Carbon $start = null, ?Carbon $end = null){
// DB::beginTransaction();
DB::beginTransaction();
try {
$start = $start ? $start : Carbon::now()->subDays(5);
@@ -216,7 +216,6 @@ class FetchLoadedContainersFromVTPortalProcessor
}
}
dd('inserted');
}
} catch (\Exception $exception){
@@ -224,7 +223,7 @@ class FetchLoadedContainersFromVTPortalProcessor
}
// DB::commit();
DB::commit();
return [];
}
+2 -2
View File
@@ -130,7 +130,7 @@ Route::group(['prefix' => 'template', 'as' => 'template.'], function () {
});
Route::get('/report', function(){
$containers = Container::whereMonth('loading_date', '=', '09')->whereYear('loading_date', '=', '2021')->get();
$containers = Container::whereMonth('loading_date', '=', '09')->whereYear('loading_date', '=', '2021')->orderBy('loading_date')->get();
$total = 0;
$customers = collect();
@@ -140,7 +140,7 @@ Route::get('/report', function(){
return $packingList->packages->sum(function ($package){
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity;
});
}).'CBM <br><br>';
}).'CBM ('. $container->loading_date->format('d-m-Y') .')<br><br>';
foreach($container->packingLists as $packingList){
$cbm = $packingList->packages->sum(function ($package){
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity;