diff --git a/app/DataMapper/Tax/US/Rule.php b/app/DataMapper/Tax/US/Rule.php index 600dcf2b0fc8..eb1b55b86c80 100644 --- a/app/DataMapper/Tax/US/Rule.php +++ b/app/DataMapper/Tax/US/Rule.php @@ -129,11 +129,13 @@ class Rule extends BaseRule implements RuleInterface */ public function taxShipping($item): self { - if($this->tax_data?->txbFreight == 'Y') { - $this->default($item); + return $this->default($item); } + $this->tax_rate1 = 0; + $this->tax_name1 = ''; + return $this; } diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index 65b3bd50b363..f2a4e1001d84 100644 --- a/app/Export/CSV/BaseExport.php +++ b/app/Export/CSV/BaseExport.php @@ -33,6 +33,8 @@ class BaseExport public string $client_description = 'All Clients'; + public array $forced_keys = []; + protected function filterByClients($query) { if (isset($this->input['client_id']) && $this->input['client_id'] != 'all') { @@ -170,7 +172,7 @@ class BaseExport { $header = []; - foreach ($this->input['report_keys'] as $value) { + foreach (array_merge($this->input['report_keys'], $this->forced_keys) as $value) { $key = array_search($value, $this->entity_keys); $key = str_replace('item.', '', $key); diff --git a/app/Export/CSV/ClientExport.php b/app/Export/CSV/ClientExport.php index 43cfa9ab7b2c..7d539795a9d5 100644 --- a/app/Export/CSV/ClientExport.php +++ b/app/Export/CSV/ClientExport.php @@ -81,6 +81,10 @@ class ClientExport extends BaseExport 'client.industry', ]; + public array $forced_keys = [ + 'status', + ]; + public function __construct(Company $company, array $input) { $this->company = $company; @@ -103,7 +107,7 @@ class ClientExport extends BaseExport if (count($this->input['report_keys']) == 0) { $this->input['report_keys'] = array_values($this->entity_keys); } - + //insert the header $this->csv->insertOne($this->buildHeader());