diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 08271e0e7531..8c98ff1316d2 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -394,16 +394,6 @@ class Design extends BaseDesign $element['elements'][] = ['element' => 'td', 'content' => $row['$product.quantity'], 'properties' => ['data-ref' => 'product_table-product.quantity-td', 'style' => 'display: none;']]; } elseif ($cell == '$task.hours') { $element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']]; - } elseif ($cell == '$task.description') { - $_element = ['element' => 'td', 'content' => '', 'elements' => [ - ['element' => 'span', 'content' => $row[$cell], 'properties' => ['data-ref' => 'task_table-task.description-td']], - ]]; - - foreach ($this->getTaskTimeLogs($row) as $log) { - $_element['elements'][] = ['element' => 'span', 'content' => $log, 'properties' => ['class' => 'task-duration', 'data-ref' => 'task_table-task.duration']]; - } - - $element['elements'][] = $_element; } else { $element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => "{$_type}_table-" . substr($cell, 1) . '-td']]; } diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index a731e4cfdd3a..29729019b229 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -230,43 +230,6 @@ trait DesignHelpers return $html; } - public function getTaskTimeLogs(array $row) - { - if (!array_key_exists('task_id', $row)) { - return []; - } - - $task = Task::find($this->decodePrimaryKey($row['task_id'])); - - if (!$task) { - return []; - } - - $logs = []; - $_logs = json_decode($task->time_log); - - if (!$_logs) { - $_logs = []; - } - - foreach ($_logs as $log) { - $start = Carbon::createFromTimestamp($log[0]); - $finish = Carbon::createFromTimestamp($log[1]); - - if ($start->isSameDay($finish)) { - $logs[] = sprintf('%s: %s - %s', $start->format($this->entity->client->date_format()), $start->format('h:i:s'), $finish->format('h:i:s')); - } else { - $logs[] = sprintf( - '%s - %s', - $start->format($this->entity->client->date_format() . ' h:i:s'), - $finish->format($this->entity->client->date_format() . ' h:i:s') - ); - } - } - - return $logs; - } - public function processCustomColumns(string $type): void { $custom_columns = [];