delete invoices (#1652)
* include all meta fields as template variables * support invoice preview via command * support deletion of generated invoices
This commit is contained in:
@@ -84,6 +84,7 @@ class DebugRendererTest extends TestCase
|
||||
'invoice.currency_symbol',
|
||||
'invoice.vat',
|
||||
'invoice.tax',
|
||||
'invoice.language',
|
||||
'invoice.tax_nc',
|
||||
'invoice.tax_plain',
|
||||
'invoice.total_time',
|
||||
@@ -109,6 +110,14 @@ class DebugRendererTest extends TestCase
|
||||
'query.month',
|
||||
'query.month_number',
|
||||
'query.year',
|
||||
'query.begin_day',
|
||||
'query.begin_month',
|
||||
'query.begin_month_number',
|
||||
'query.begin_year',
|
||||
'query.end_day',
|
||||
'query.end_month',
|
||||
'query.end_month_number',
|
||||
'query.end_year',
|
||||
'customer.id',
|
||||
'customer.address',
|
||||
'customer.name',
|
||||
|
||||
@@ -115,6 +115,7 @@ trait RendererTestTrait
|
||||
$template = new InvoiceTemplate();
|
||||
$template->setTitle('a very *long* test invoice / template title with [special] character');
|
||||
$template->setVat(19);
|
||||
$template->setLanguage('en');
|
||||
|
||||
$project = new Project();
|
||||
$project->setName('project name');
|
||||
|
||||
@@ -69,9 +69,19 @@ class TextRendererTest extends KernelTestCase
|
||||
|
||||
foreach ($model->toArray() as $key => $value) {
|
||||
if (null === $value || '' === $value) {
|
||||
self::assertStringContainsString(sprintf("%s:\n\n", $key), $content);
|
||||
self::assertStringContainsString(sprintf("%s\n", $key), $content);
|
||||
} else {
|
||||
self::assertStringContainsString(sprintf("%s:\n %s", $key, explode("\n", $value)[0]), $content);
|
||||
self::assertStringContainsString(sprintf("%s\n %s", $key, explode("\n", $value)[0]), $content);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($model->getCalculator()->getEntries() as $entry) {
|
||||
foreach ($model->itemToArray($entry) as $key => $value) {
|
||||
if (null === $value || '' === $value) {
|
||||
self::assertStringContainsString(sprintf("%s\n", $key), $content);
|
||||
} else {
|
||||
self::assertStringContainsString(sprintf("%s\n %s", $key, explode("\n", $value)[0]), $content);
|
||||
}
|
||||
}
|
||||
}
|
||||
self::assertEquals(\count($model->getCalculator()->getEntries()), substr_count($content, PHP_EOL . '---' . PHP_EOL));
|
||||
|
||||
Reference in New Issue
Block a user