diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index 7fecb1cd2cfc..ebde41731350 100644 --- a/app/Export/CSV/BaseExport.php +++ b/app/Export/CSV/BaseExport.php @@ -83,6 +83,7 @@ class BaseExport 'contact_custom_value4' => 'vendor_contact.custom_value4', 'email' => 'vendor_contact.email', 'status' => 'vendor.status', + 'classification' => 'vendor.classification', ]; protected array $client_report_keys = [ @@ -127,6 +128,7 @@ class BaseExport "contact_custom_value4" => "contact.custom_value4", 'payment_balance' => 'client.payment_balance', 'credit_balance' => 'client.credit_balance', + 'classification' => 'client.classification', ]; protected array $invoice_report_keys = [ diff --git a/app/Export/CSV/ClientExport.php b/app/Export/CSV/ClientExport.php index 3d5e128379d3..981f051f94fb 100644 --- a/app/Export/CSV/ClientExport.php +++ b/app/Export/CSV/ClientExport.php @@ -74,6 +74,8 @@ class ClientExport extends BaseExport 'status' => 'status', 'payment_balance' => 'client.payment_balance', 'credit_balance' => 'client.credit_balance', + 'classification' => 'client.classification', + ]; public function __construct(Company $company, array $input) @@ -225,6 +227,10 @@ class ClientExport extends BaseExport $entity['industry_id'] = $client->industry ? ctrans("texts.industry_{$client->industry->name}") : ''; } + if (in_array('client.classification', $this->input['report_keys']) && isset($client->classification)) { + $entity['client.classification'] = ctrans("texts.{$client->classification}") ?? ''; + } + return $entity; } diff --git a/app/Export/CSV/VendorExport.php b/app/Export/CSV/VendorExport.php index 74e9785b2f40..81c70a21d024 100644 --- a/app/Export/CSV/VendorExport.php +++ b/app/Export/CSV/VendorExport.php @@ -139,6 +139,10 @@ class VendorExport extends BaseExport $entity['currency'] = $vendor->currency() ? $vendor->currency()->code : $vendor->company->currency()->code; } + if (in_array('vendor.classification', $this->input['report_keys']) && isset($vendor->classification)) { + $entity['vendor.classification'] = ctrans("texts.{$vendor->classification}") ?? ''; + } + $entity['status'] = $this->calculateStatus($vendor); return $entity;