invoice: money fields without currency, title cleanup (#1254)

This commit is contained in:
Kevin Papst
2019-11-15 18:54:08 +01:00
committed by GitHub
parent 94c28ebbc5
commit 2287c9951c
5 changed files with 29 additions and 10 deletions

View File

@@ -46,7 +46,13 @@ abstract class AbstractSpreadsheetRenderer extends AbstractRenderer
$this->addTemplateRows($worksheet, $invoiceItemCount);
}
$worksheet->setTitle($model->getTemplate()->getTitle());
// cleanup the title, PHP Office doesn't allow arbitrary strings
$title = substr($model->getTemplate()->getTitle(), 0, 31);
foreach (Worksheet::getInvalidCharacters() as $char) {
$title = str_replace($char, ' ', $title);
}
$worksheet->setTitle($title);
$entryRow = 0;