mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Merge pull request #4318 from beganovich/v5-fix-time-log-issue
(v5) Fix issues with rendering task.hours
This commit is contained in:
commit
6f4261683b
@ -367,7 +367,7 @@ class Design extends BaseDesign
|
||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost']];
|
||||
} else if ($cell == '$task.hours') {
|
||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity']];
|
||||
} else if ($cell == '$task.notes') {
|
||||
} else if ($cell == '$task.description') {
|
||||
$_element = ['element' => 'td', 'content' => '', 'elements' => [
|
||||
['element' => 'span', 'content' => $row[$cell]],
|
||||
]];
|
||||
|
@ -236,9 +236,19 @@ trait DesignHelpers
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach (json_decode($task['time_log']) as $log) {
|
||||
info($log);
|
||||
$logs[] = sprintf('%s - %s', \Carbon\Carbon::createFromTimestamp($log[0])->toDateTimeString(), \Carbon\Carbon::createFromTimestamp($log[1])->toDateTimeString());
|
||||
$logs = [];
|
||||
$_logs = json_decode($task->time_log);
|
||||
|
||||
if (!$_logs) {
|
||||
$_logs = [];
|
||||
}
|
||||
|
||||
foreach ($_logs as $log) {
|
||||
$logs[] = sprintf(
|
||||
'%s - %s',
|
||||
\Carbon\Carbon::createFromTimestamp($log[0])->format($task->client->date_format() . ' h:i:s'),
|
||||
\Carbon\Carbon::createFromTimestamp($log[1])->format($task->client->date_format() . ' h:i:s')
|
||||
);
|
||||
}
|
||||
|
||||
return $logs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user