customer report

This commit is contained in:
omair saleh
2021-10-01 19:43:50 +08:00
parent 626ba6bbf4
commit 87e9dbe3ec
+4 -3
View File
@@ -143,8 +143,9 @@ Route::get('/report', function(){
$total += $cbm;
$marking = $packingList->owner->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
if(!$customers->has($marking)){
if(!$customers->has($packingList->owner->id)){
$customers->put($marking, collect([
'marking' => $marking,
'cbm' => $cbm,
'packages' => $packingList->packages->sum('quantity')
]));
@@ -152,8 +153,8 @@ Route::get('/report', function(){
continue;
}
$customers[$packingList->owner->id]['cbm'] += $cbm;
$customers[$packingList->owner->id]['packages'] += $packingList->packages->sum('quantity');
$customers[$marking]['cbm'] += $cbm;
$customers[$marking]['packages'] += $packingList->packages->sum('quantity');
}
}