mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-24 06:54:26 +00:00
customer report
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Reports;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use App\Classes\ValueObjects\Response\ApiResponseObject;
|
||||
use App\Models\Company;
|
||||
use App\Models\Container;
|
||||
use App\Models\Order;
|
||||
use Carbon\Carbon;
|
||||
@@ -52,6 +53,7 @@ class MonthlyReportController
|
||||
'containers' => count($containers),
|
||||
'activated_orders' => $activeOrders,
|
||||
'active_customers' => count($customers),
|
||||
'new_customers' => Company::whereMonth('created_at', $month->format('m'))->count(),
|
||||
'total_cbm' => $customers->sum(function($customer){
|
||||
return $customer['cbm'];
|
||||
}),
|
||||
|
||||
@@ -81,13 +81,15 @@
|
||||
<div class="col-xs-height col-top">
|
||||
<div class="p-l-20 p-t-50 p-b-40 p-r-20">
|
||||
<h3 class="no-margin p-b-5">{{report.active_customers}}</h3>
|
||||
<span class="small hint-text pull-left">{{ Math.ceil((((report.new_customers / report.active_customers) * 100) * 100) / 100).toFixed(2)}}%</span>
|
||||
<span class="pull-right small text-primary">New Customers: {{report.new_customers}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-xs-height">
|
||||
<div class="col-xs-height col-bottom">
|
||||
<div class="progress progress-small m-b-0">
|
||||
<div class="progress-bar progress-bar-primary" style="width: 0"></div>
|
||||
<div class="progress-bar progress-bar-primary" :style="{'width': Math.ceil((((report.new_customers / report.active_customers) * 100) * 100) / 100).toFixed(2)+'%'}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user