mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-25 07:24:21 +00:00
customer report
This commit is contained in:
+5
-1
@@ -151,6 +151,7 @@ Route::get('/report', function(){
|
||||
if(!$customers->has($marking)){
|
||||
$customers->put($marking, collect([
|
||||
'cbm' => $cbm,
|
||||
'orders' => 1,
|
||||
'packages' => $packingList->packages->sum('quantity')
|
||||
]));
|
||||
|
||||
@@ -158,6 +159,7 @@ Route::get('/report', function(){
|
||||
}
|
||||
|
||||
$customers[$marking]['cbm'] += $cbm;
|
||||
$customers[$marking]['orders'] += 1;
|
||||
$customers[$marking]['packages'] += $packingList->packages->sum('quantity');
|
||||
}
|
||||
}
|
||||
@@ -165,10 +167,12 @@ Route::get('/report', function(){
|
||||
echo '<h1><b>total cbm:</b> '. $total . '</h1>';
|
||||
echo '<h1><b>active customers:</b> '. count($customers) . '</h1><br><br>';
|
||||
|
||||
$i = 1;
|
||||
foreach ($customers->sortByDesc(function($customer){
|
||||
return $customer['cbm'];
|
||||
}) as $marking => $customer) {
|
||||
echo '<b>'.$marking.': </b>'.$customer['cbm'].' CBM ( '.$customer['packages'].' ) CTNS <br><br>';
|
||||
echo '<b>'.$i.'. '.$marking.': </b>'.$customer['cbm'].' CBM ('. $customer['orders'] .' - '.$customer['packages'].' ) CTNS <br><br>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user