diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index efac973651df..605abff1e234 100644 --- a/app/Export/CSV/BaseExport.php +++ b/app/Export/CSV/BaseExport.php @@ -450,6 +450,7 @@ class BaseExport 'status' => 'task.status_id', 'project' => 'task.project_id', 'billable' => 'task.billable', + 'item_notes' => 'task.item_notes', ]; protected array $forced_client_fields = [ diff --git a/app/Export/CSV/TaskExport.php b/app/Export/CSV/TaskExport.php index 2acd8faa64cc..bc357d61a96f 100644 --- a/app/Export/CSV/TaskExport.php +++ b/app/Export/CSV/TaskExport.php @@ -156,7 +156,7 @@ class TaskExport extends BaseExport $entity[$key] = $transformed_entity[$parts[1]]; } elseif (array_key_exists($key, $transformed_entity)) { $entity[$key] = $transformed_entity[$key]; - } elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration'])) { + } elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration', 'task.billable', 'task.item_notes'])) { $entity[$key] = ''; } else { $entity[$key] = $this->decorator->transform($key, $task); @@ -175,7 +175,7 @@ class TaskExport extends BaseExport private function iterateLogs(Task $task, array $entity) { $timezone = Timezone::find($task->company->settings->timezone_id); - $timezone_name = 'US/Eastern'; + $timezone_name = 'America/New_York'; if ($timezone) { $timezone_name = $timezone->name; @@ -209,6 +209,14 @@ class TaskExport extends BaseExport $entity['task.duration_words'] = $seconds > 86400 ? CarbonInterval::seconds($seconds)->locale($this->company->locale())->cascade()->forHumans() : now()->startOfDay()->addSeconds($seconds)->format('H:i:s'); } + if (in_array('task.billable', $this->input['report_keys']) || in_array('billable', $this->input['report_keys'])) { + $entity['task.billable'] = isset($item[3]) && $item[3] == 'true' ? ctrans('texts.yes') : ctrans('texts.no'); + } + + if (in_array('task.item_notes', $this->input['report_keys']) || in_array('item_notes', $this->input['report_keys'])) { + $entity['task.item_notes'] = isset($item[2]) ? (string)$item[2] : ''; + } + $entity = $this->decorateAdvancedFields($task, $entity); $this->storage_array[] = $entity; @@ -219,6 +227,8 @@ class TaskExport extends BaseExport $entity['task.end_time'] = ''; $entity['task.duration'] = ''; $entity['task.duration_words'] = ''; + $entity['task.billable'] = ''; + $entity['task.item_notes'] = ''; } diff --git a/app/Export/Decorators/TaskDecorator.php b/app/Export/Decorators/TaskDecorator.php index 05f7c2e69690..d8d908a34c00 100644 --- a/app/Export/Decorators/TaskDecorator.php +++ b/app/Export/Decorators/TaskDecorator.php @@ -18,6 +18,7 @@ use Carbon\Carbon; class TaskDecorator extends Decorator implements DecoratorInterface { + //@todo - we do not handle iterating through the timelog here. public function transform(string $key, mixed $entity): mixed { $task = false; @@ -42,7 +43,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface { $timezone = Timezone::find($task->company->settings->timezone_id); - $timezone_name = 'US/Eastern'; + $timezone_name = 'America/New_York'; if ($timezone) { $timezone_name = $timezone->name; @@ -71,7 +72,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface { $timezone = Timezone::find($task->company->settings->timezone_id); - $timezone_name = 'US/Eastern'; + $timezone_name = 'America/New_York'; if ($timezone) { $timezone_name = $timezone->name; @@ -95,6 +96,26 @@ class TaskDecorator extends Decorator implements DecoratorInterface return ''; } + + /** + * billable + * + * @todo + */ + public function billable(Task $task) + { + return ''; + } + + /** + * items_notes + * @todo + */ + public function items_notes(Task $task) + { + return ''; + } + public function duration(Task $task) { return $task->calcDuration(); diff --git a/app/Helpers/Bank/Nordigen/Transformer/TransactionTransformer.php b/app/Helpers/Bank/Nordigen/Transformer/TransactionTransformer.php index 1cf71f50c506..7d3d604a6897 100644 --- a/app/Helpers/Bank/Nordigen/Transformer/TransactionTransformer.php +++ b/app/Helpers/Bank/Nordigen/Transformer/TransactionTransformer.php @@ -171,7 +171,7 @@ class TransactionTransformer implements BankRevenueInterface private function formatDate(string $input) { $timezone = Timezone::find($this->company->settings->timezone_id); - $timezone_name = 'US/Eastern'; + $timezone_name = 'America/New_York'; if ($timezone) { $timezone_name = $timezone->name;