PDF: Seitenzahlen auf allen Seiten, Lieferschein-Beschriftung
- page_script in invoice, delivery, credit und cancellation ans Ende des body verschoben (wirkte nur auf Seite 1), Beschriftung uebersetzt - Gutschriften rendern mit enable_php wie Rechnungen - Lieferschein: Schluessel pdf.delivery_note_no ohne ueberzaehligen Punkt - Tests: Position des Skripts, alle pdf.*-Schluessel in allen Sprachen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4274bff9e2
commit
0a3eb791d4
11 changed files with 84 additions and 57 deletions
|
|
@ -51,6 +51,22 @@ test('embedded php runs on every page of an invoice pdf', function () {
|
|||
->and($GLOBALS['pdfProbePages'])->toBe(['1/2', '2/2']);
|
||||
});
|
||||
|
||||
test('page numbers are added at the end of the template so they reach every page', function (string $template) {
|
||||
$view = file_get_contents(resource_path("views/pdf/{$template}.blade.php"));
|
||||
|
||||
expect(substr_count($view, 'type="text/php"'))->toBe(1)
|
||||
->and($view)->toMatch('#</script>\s*</body>#');
|
||||
})->with(['invoice', 'delivery', 'credit', 'cancellation', 'credit_details', 'credit_details_long']);
|
||||
|
||||
test('every pdf translation key used in the templates exists', function (string $locale) {
|
||||
$keys = collect(File::files(resource_path('views/pdf')))
|
||||
->flatMap(fn ($file) => preg_match_all("/__\\('(pdf\\.[^']+)'/", $file->getContents(), $matches) ? $matches[1] : [])
|
||||
->unique();
|
||||
|
||||
expect($keys)->not->toBeEmpty()
|
||||
->and($keys->reject(fn ($key) => trans()->hasForLocale($key, $locale))->values()->all())->toBe([]);
|
||||
})->with(['de', 'en', 'es', 'fr']);
|
||||
|
||||
test('the rendered pdf can be laid onto the letterhead template', function () {
|
||||
$file = (new InvoicePDF('pdf-probe'))->create([], 'probe.pdf', 'save', $this->pdfDir);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue