-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HorstOeko
committed
Apr 8, 2024
1 parent
47730d3
commit 5b25a3d
Showing
3 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use horstoeko\zugferd\ZugferdDocumentPdfReader; | ||
use horstoeko\zugferd\ZugferdKositValidator; | ||
|
||
require dirname(__FILE__) . "/../vendor/autoload.php"; | ||
|
||
function showValidationResult($kositValidator) | ||
{ | ||
if ($kositValidator->validationFailed()) { | ||
echo "\033[01;31mValidation failed\e[0m\n"; | ||
foreach ($kositValidator->validationErrors() as $validationError) { | ||
echo $validationError . PHP_EOL; | ||
} | ||
} else { | ||
echo "\033[01;32mValidation passed\e[0m\n"; | ||
} | ||
} | ||
|
||
$document = ZugferdDocumentPdfReader::readAndGuessFromFile(dirname(__FILE__) . "/invoice_1.pdf"); | ||
|
||
$kositValidator = new ZugferdKositValidator($document); | ||
$kositValidator->validate(); | ||
|
||
showValidationResult($kositValidator); |
Oops, something went wrong.