mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 22:34:37 -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']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost']];
|
||||||
} else if ($cell == '$task.hours') {
|
} else if ($cell == '$task.hours') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity']];
|
||||||
} else if ($cell == '$task.notes') {
|
} else if ($cell == '$task.description') {
|
||||||
$_element = ['element' => 'td', 'content' => '', 'elements' => [
|
$_element = ['element' => 'td', 'content' => '', 'elements' => [
|
||||||
['element' => 'span', 'content' => $row[$cell]],
|
['element' => 'span', 'content' => $row[$cell]],
|
||||||
]];
|
]];
|
||||||
|
@ -236,9 +236,19 @@ trait DesignHelpers
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (json_decode($task['time_log']) as $log) {
|
$logs = [];
|
||||||
info($log);
|
$_logs = json_decode($task->time_log);
|
||||||
$logs[] = sprintf('%s - %s', \Carbon\Carbon::createFromTimestamp($log[0])->toDateTimeString(), \Carbon\Carbon::createFromTimestamp($log[1])->toDateTimeString());
|
|
||||||
|
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;
|
return $logs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user