invoice: do not use activity name as fallback for description (#4884)
* added replacement field description_safe
This commit is contained in:
@@ -88,10 +88,6 @@ abstract class AbstractMergedCalculator extends AbstractCalculator
|
||||
$invoiceItem->setProject($entry->getProject());
|
||||
}
|
||||
|
||||
if (empty($invoiceItem->getDescription()) && null !== $entry->getActivity()) {
|
||||
$invoiceItem->setDescription($entry->getActivity()->getName());
|
||||
}
|
||||
|
||||
if ($entry instanceof Timesheet) {
|
||||
foreach ($entry->getTagsAsArray() as $tag) {
|
||||
$invoiceItem->addTag($tag);
|
||||
|
||||
@@ -47,10 +47,6 @@ final class InvoiceItemDefaultHydrator implements InvoiceItemHydrator
|
||||
$begin = $item->getBegin();
|
||||
$end = $item->getEnd();
|
||||
|
||||
if (empty($description) && null !== $activity) {
|
||||
$description = $activity->getName();
|
||||
}
|
||||
|
||||
// this should never happen!
|
||||
if (empty($appliedRate)) {
|
||||
$appliedRate = 0;
|
||||
@@ -59,6 +55,7 @@ final class InvoiceItemDefaultHydrator implements InvoiceItemHydrator
|
||||
$values = [
|
||||
'entry.row' => '',
|
||||
'entry.description' => $description ?? '',
|
||||
'entry.description_safe' => ($description === null || $description === '' ? ($activity?->getName() ?? $project?->getName() ?? '') : $description),
|
||||
'entry.amount' => $amount,
|
||||
'entry.type' => $item->getType(),
|
||||
'entry.tags' => implode(', ', $item->getTags()),
|
||||
|
||||
Reference in New Issue
Block a user