Fixes for invoicing projects where multiple new lines were injected inappropriately

This commit is contained in:
David Bomba 2025-04-08 14:11:42 +10:00
parent 157e27848d
commit a3e27e8550
1 changed files with 5 additions and 4 deletions

View File

@ -373,9 +373,6 @@ class Task extends BaseModel
$hours = ctrans('texts.hours');
$parts = [];
// $parts[] = '<div class="task-time-details">';
$date_time = [];
if ($this->company->invoice_task_datelog) {
@ -409,10 +406,14 @@ class Task extends BaseModel
$parts[] = $interval_description;
}
// $parts[] = '</div>';
//need to return early if there is nothing, otherwise we end up injecting a blank new line.
if(count($parts) == 1 && empty($parts[0])) {
return '';
}
return implode(PHP_EOL, $parts);
})
->filter()//filters any empty strings.
->implode(PHP_EOL);
$body = '';