mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
100 lines
2.4 KiB
PHP
100 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Exports\Services;
|
|
|
|
use App\Classes\ValueObjects\Constants\BusinessType;
|
|
use App\Classes\ValueObjects\Constants\CompanyType;
|
|
use App\Models\Company;
|
|
use Maatwebsite\Excel\Concerns\Exportable;
|
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
|
use Maatwebsite\Excel\Concerns\WithMapping;
|
|
|
|
class ExportsNullDebtors implements FromQuery, WithHeadingRow, WithMapping
|
|
{
|
|
|
|
use Exportable;
|
|
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'Code',
|
|
'CompanyName',
|
|
'Desc2',
|
|
'AreaCode',
|
|
'SalesAgent',
|
|
'DebtorType',
|
|
'DisplayTerm',
|
|
'AgingOn',
|
|
'StatementType',
|
|
'CurrencyCode',
|
|
'RegisterNo',
|
|
'Address1',
|
|
'Address2',
|
|
'Address3',
|
|
'Address4',
|
|
'PostCode',
|
|
'DeliverAddr1',
|
|
'DeliverAddr2',
|
|
'DeliverAddr3',
|
|
'DeliverAddr4',
|
|
'DeliverPostCode',
|
|
'Attention',
|
|
'Phone1',
|
|
'Phone2',
|
|
'Fax1',
|
|
'Fax2',
|
|
'ExemptNo',
|
|
'ExpiryDate',
|
|
'PriceCategory',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Support\Collection|mixed
|
|
*/
|
|
public function query()
|
|
{
|
|
return Company::where('debtor', '=', null);
|
|
}
|
|
|
|
/**
|
|
* @param Company $company
|
|
*
|
|
* @return array
|
|
*/
|
|
public function map($company): array
|
|
{
|
|
return [
|
|
$company->reference, //Code
|
|
$company->name, //CompanyName
|
|
'', //Desc2
|
|
'', //AreaCode
|
|
'', //SalesAgent
|
|
'', //DebtorType
|
|
'', //DisplayTerm
|
|
'', //AgingOn
|
|
'', //StatementType
|
|
'MYR', //CurrencyCode
|
|
$company->reference, //RegisterNo
|
|
'', //Address1
|
|
'', //Address2
|
|
'', //Address3
|
|
'', //Address4
|
|
'', //PostCode
|
|
'', //DeliverAddr1
|
|
'', //DeliverAddr2
|
|
'', //DeliverAddr3
|
|
'', //DeliverAddr4
|
|
'', //DeliverPostCode
|
|
'', //Attention
|
|
'', //Phone1
|
|
'', //Phone2
|
|
'', //Fax1
|
|
'', //Fax2
|
|
'', //ExemptNo
|
|
'', //ExpiryDate
|
|
'', //PriceCategory
|
|
];
|
|
}
|
|
} |