mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
add company type to customer excel list
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Classes\ValueObjects\Constants\CompanyType;
|
||||
use App\Models\Company;
|
||||
use Carbon\Carbon;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
@@ -19,6 +20,7 @@ class ExportsCustomers implements FromQuery, WithHeadingRow, WithMapping
|
||||
return [
|
||||
'Marking',
|
||||
'Name',
|
||||
'Business type',
|
||||
'Number of bookings',
|
||||
'Bookings total',
|
||||
'Registration Date',
|
||||
@@ -43,6 +45,7 @@ class ExportsCustomers implements FromQuery, WithHeadingRow, WithMapping
|
||||
return [
|
||||
$company->reference,
|
||||
$company->name,
|
||||
$company->type === CompanyType::COMPANY_BUSINESS ? 'Company' : 'individual',
|
||||
count($company->bookings),
|
||||
$company->bookings()->sum('fix_amount'),
|
||||
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($company->created_at)
|
||||
|
||||
Reference in New Issue
Block a user