PHP package for Croatian fiscalization. Provides basic service for fiscalizing the invoices with Croatian tax PDV (25%).
composer require tonikresic/croatian-fiscalization
You need to have a demo certificate with its password, the company UID and the user UID in order for fiscalization to work.
$userUID = 'USER_UID';
$companyUID = 'COMPANY_UID';
$certificatePath = 'CERTIFICATE_PATH';
$certificatePassword = 'CERTIFICATE_PASSWORD';
$cf = new tonikresic\CroatianFiscalization\CroatianFiscalization();
$certificate = new tonikresic\CroatianFiscalization\Company\Certificate($certificatePath, $certificatePassword);
$company = new tonikresic\CroatianFiscalization\Company\Company($companyUID, $certificate, true, true);
$cf->configure($company);
$invoiceObject = (object) [
'userUID' => $userUID,
'fiscal_abbreviation' => 'G',
'company' => $company,
'gross' => 12.5,
'net' => 10,
'number' => 1,
'business_place_label' => 1,
'cash_register_label' => 1,
'fiscal_data' => (object) [
'zki' => NULL,
'jir' => NULL
],
'created_at' => date('Y-m-d H:i:s'),
'fiscal_at' => NULL,
];
$response = $cf->fiscalize($invoiceObject);
php vendor/phpunit/phpunit/phpunit