customer report

This commit is contained in:
omair saleh
2021-10-02 15:22:28 +08:00
parent 93c9412298
commit 33f152ae9c
2 changed files with 5 additions and 1 deletions
@@ -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>