If you find this project useful, you can show your appreciation and support by giving it a ⭐. Your support motivates us to work harder and make even better and more useful tools!
This package provides an expressive, fluent interface to ΑΑΔΕ myDATA invoicing REST API. It handles almost all the boilerplate code for sending, cancelling and requesting invoices.
All documentation is available 👉 on our documentation site
If you are upgrading from a previous version, please see upgrade guide.
Ο Πάροχος ηλεκτρονικής τιμολόγησης και τα ERP διαβιβάζουν υποχρεωτικά μόνο τη σύνοψη γραμμών και χαρακτηρισμών των παραστατικών και όχι αναλυτικά τις γραμμές.
$invoice->squashInvoiceRows()
See Invoice Row Squashing for more details.
$invoice->validate()
$invoice->toXml()
See Classification Combinations for more details.
use Firebed\AadeMyData\Enums\InvoiceType;
use Firebed\AadeMyData\Services\Classifications;
dump(Classifications::incomeClassifications(InvoiceType::TYPE_1_1));
use Firebed\AadeMyData\Enums\InvoiceType;
use Firebed\AadeMyData\Services\Classifications;
dump(Classifications::incomeClassifications(InvoiceType::TYPE_1_1)->toKeyLabel());
dump(Classifications::incomeClassifications(InvoiceType::TYPE_1_1)->toKeyLabels())
dump(Classifications::incomeClassifications(InvoiceType::TYPE_1_1, IncomeClassificationCategory::CATEGORY_1_1)->toKeyLabel())
use Firebed\AadeMyData\Enums\InvoiceType;
use Firebed\AadeMyData\Enums\IncomeClassificationCategory;
use Firebed\AadeMyData\Enums\IncomeClassificationType;
use Firebed\AadeMyData\Services\Classifications;
Classifications::incomeClassificationExists('1.1', 'category1_1', 'E3_561_001');
// or
Classifications::incomeClassificationExists(InvoiceType::TYPE_1_1, IncomeClassificationCategory::CATEGORY_1_1, IncomeClassificationType::E3_561_001);
// Outputs: true
// Same for expense classifications
Classifications::expenseClassificationExists('1.1', 'category2_1', 'E3_102_001');
use Firebed\AadeMyData\Enums\InvoiceType;
use Firebed\AadeMyData\Enums\PaymentMethod;
use Firebed\AadeMyData\Enums\VatCategory;
use Firebed\AadeMyData\Enums\CountryCode;
echo InvoiceType::TYPE_1_1->label();
// Outputs: Τιμολόγιο Πώλησης
echo InvoiceType::TYPE_1_2->label();
// Outputs: Τιμολόγιο Πώλησης / Ενδοκοινοτικές Παραδόσεις
echo PaymentMethod::METHOD_5->label();
// Outputs: Επί Πιστώσει
echo VatCategory::VAT_1->label();
// Outputs: ΦΠΑ συντελεστής 24%
echo CountryCode::BE->label();
// Outputs: Βέλγιο
use Firebed\AadeMyData\Enums\InvoiceType;
use Firebed\AadeMyData\Enums\CountryCode;
use Firebed\AadeMyData\Enums\ExpenseClassificationType;
$invoiceType = InvoiceType::TYPE_1_1;
$invoiceType->supportsFuelInvoice();
$invoiceType->hasCounterpart();
$invoiceType->supportsDeliveryNote();
$invoiceType->supportsSelfPricing();
$invoiceType->supportsTaxFree();
var_dump(CountryCode::europeanUnionCountries());
// Outputs: All countries in the European Union
echo CountryCode::BE->isInEuropeanUnion()
// Outputs: true
echo CountryCode::US->isInEuropeanUnion()
// Outputs: false
$type = ExpenseClassificationType::VAT_361;
echo $type->isVatClassification(); // true
var_dump(ExpenseClassificationType::vatClassifications()); // Array of all vat classifications
- CountryCode
- CurrencyCode
use Firebed\AadeMyData\Models\InvoiceDetails;
use Firebed\AadeMyData\Enums\RecType;
use Firebed\AadeMyData\Enums\IncomeClassificationType;
use Firebed\AadeMyData\Enums\IncomeClassificationCategory;
new InvoiceDetails([
'lineNumber' => 1,
'netValue' => 5,
'recType' => RecType::TYPE_2,
'incomeClassification' => [
[
'classificationType' => IncomeClassificationType::E3_561_001,
'classificationCategory' => IncomeClassificationCategory::CATEGORY_1_1,
'amount' => '5'
]
]
])
$invoice->setIssuer(...)->setCounterpart(...)
- Invoice::setTaxesTotals
- Invoice::setOtherTransportDetails
$row->addNetValue(5);
$row->addVatAmount(1.2);
Version | PHP | myDATA | Support |
---|---|---|---|
^v5.x | 8.1 | v1.0.9 | Active |
^v4.x | 8.1 | v1.0.8 | Ended |
^v3.x | 8.1 | v1.0.7 | Ended |
^v2.x | 8.1 | v1.0.5 | Ended |
^v1.x | 8.0 | v1.0.3 | Ended |
- guzzlehttp/guzzle >= 7.0
To install through Composer, run the following command:
composer require firebed/aade-mydata
Official myDATA webpage: AADE myDATA
Official myDATA documentation: AADE myDATA REST API v1.0.9
In order to use this package, you will need first a user id and a subscription key. You can get these credentials by signing up to mydata rest api.
Development: Sign up to mydata development api
Production: Sign up to mydata production api
Once you have the user id and the subscription key use the following code to set the environment and the credentials:
$env = "dev"; // For production use "prod"
$user_id = "your-user-id";
$subscription_key = "your-subscription-key";
MyDataRequest::setEnvironment($env);
MyDataRequest::setCredentials($user_id, $subscription_key);
For development, you may need to disable client verification if you are not using https:
MyDataRequest::verifyClient(false);
Method | Availability |
---|---|
Validate VAT Number | ✅ |
SendInvoices | ✅ |
CancelInvoice | ✅ |
RequestDocs | ✅ |
RequestTransmittedDocs | ✅ |
RequestMyIncome | ✅ |
RequestMyExpenses | ✅ |
RequestVatInfo | ✅ |
SendPaymentsMethod | ✅ |
SendIncomeClassification | Soon |
SendExpensesClassification | Soon |
composer test
Please see CONTRIBUTING for details.
AADE myDATA is licenced under the MIT License.
Copyright 2022 © Okan Giritli