mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Enhancements for reports
This commit is contained in:
parent
b66272c974
commit
57e7b4f879
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user