firebed/aade-mydata 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

firebed/aade-mydata

Composer 安装命令:

composer require firebed/aade-mydata

包简介

Implementation of requests for AADE myDATA.

README 文档

README

Latest Version on Packagist Total Downloads GitHub Workflow Status PHP Version Require License

Upcoming Changes

  • Separate documentation to a dedicated repository
  • Integration with Invoice Service Providers (OxygenSuite / Cloud Services IKE) as for Greek e-invoicing regulations
  • v6.x release with an improved architecture and new features

Support This Project

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!

Introduction

This package provides an expressive, fluent interface to ΑΑΔΕ myDATA invoicing REST API. It handles all the boilerplate code for sending, cancelling and requesting invoices.

Documentation

Requirements

To use this package, you will need first a aade id and a Subscription key. You can get these credentials by signing up to mydata rest api.

Version PHP myDATA Support
^v5.x 8.1 v2.0.1 Active
^v5.x 8.1 v1.0.12 Ended
^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

Installation

To install through Composer, run the following command:

composer require firebed/aade-mydata

Setup

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);

Send invoice example

use Firebed\AadeMyData\Http\SendInvoices;
use Firebed\AadeMyData\Models\Invoice;
use Firebed\AadeMyData\Exceptions\MyDataException;

// Prepare your invoices, for simplicity we will use an array of empty
// Invoice objects. You should populate these objects with your own data.
$invoices = [new Invoice(), new Invoice()];
$sender = new SendInvoices();

try {
    $responses = $sender->handle($invoices);
    
    $errors = [];
    foreach ($responses as $response) {
        if ($response->isSuccessful()) { 
            // This invoice was successfully sent to myDATA.     
            // Each response has an index value which corresponds
            // to the index (-1) of the $invoices array.
            
            $index = $response->getIndex();
            $uid = $response->getInvoiceUid();
            $mark = $response->getInvoiceMark();
            $cancelledByMark = $response->getCancellationMark();
            $qrUrl = $response->getQrUrl();
    
            // If you need to relate the response to your local invoice
            // $invoice = $invoices[$index - 1];    
    
            print_r(compact('index', 'uid', 'mark', 'cancelledByMark', 'qrUrl'));
        } else {
            // There were some errors for a specific invoice. See errors for details.
            foreach ($response->getErrors() as $error) {
                $errors[$response->getIndex() - 1][] = $error->getCode() . ': ' . $error->getMessage();
            }
        }
    }
} catch (MyDataException $e) {
    // There was a communication error. None of the invoices were sent.
    echo "Σφάλμα επικοινωνίας: " . $e->getMessage();
}

Available methods

Method Availability
Validate VAT Number
SendInvoices
CancelInvoice
RequestDocs
RequestTransmittedDocs
RequestMyIncome
RequestMyExpenses
RequestVatInfo
RequestE3Info
SendPaymentsMethod
SendIncomeClassification
SendExpensesClassification
CancelDeliveryNote (Για παρόχους)

Digital Goods Movement (Ψηφιακή Διακίνηση Αγαθών)

Digital Goods Movement methods allow real-time tracking and management of goods in transit. These methods are available only for the ERP channel and are not supported by invoice service providers.

Method Description
RegisterTransfer Register a transfer
ConfirmDeliveryOutcome Confirm delivery outcome
RejectDeliveryNote Reject a delivery note
RequestDeliveryNoteStatus Request delivery note status
GenerateGroupQrCode Generate group QR code
RequestGroupQrDetails Request group QR details

Quick example

use Firebed\AadeMyData\Http\DigitalGoodsMovement\RegisterTransfer;
use Firebed\AadeMyData\Models\DigitalGoodsMovement\Transport;
use Firebed\AadeMyData\Models\DigitalGoodsMovement\TransportDetails;
use Firebed\AadeMyData\Models\DigitalGoodsMovement\Location;
use Firebed\AadeMyData\Enums\DigitalGoodsMovement\TransportType;

$details = new TransportDetails();
$details->setVehicleNumber('AHN0011');
$details->setTransportType(TransportType::PRIVATE_USE_TRUCK);
$details->setCarrierVatNumber('777777777');
$details->setLocation(new Location(41.303921, -81.901693));

$transport = new Transport();
$transport->setMark(900001234567890);
$transport->setTransportDetails($details);

$request = new RegisterTransfer();
$response = $request->handle($transport);

For detailed documentation and examples of all methods, see the Digital Goods Movement documentation.

Digital Client (Car rental, parking/wash, workshops)

The Digital Client API is specifically designed to serve businesses in industries such as car rentals, parking services, vehicle washing and workshops.

Please refer to the ΑΑΔΕ Digital Client, developed by Oxygen Invoicing Provider. It provides a robust, seamless and complete solution for managing customer and vehicle data while enabling smooth and uninterrupted data exchange between ERP systems and Greece's Independent Authority for Public Revenue (Ανεξάρτητη Αρχή Δημοσίων Εσόδων, ΑΑΔΕ).

Upgrade Guide

If you are upgrading from a previous version, please see upgrade guide

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Licence

AADE myDATA is licenced under the MIT License.

Copyright 2022 © Okan Giritli

firebed/aade-mydata 适用场景与选型建议

firebed/aade-mydata 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.25k 次下载、GitHub Stars 达 147, 最近一次更新时间为 2022 年 01 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「aade」 「myDATA」 「ΑΑΔΕ」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 firebed/aade-mydata 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 firebed/aade-mydata 我们能提供哪些服务?
定制开发 / 二次开发

基于 firebed/aade-mydata 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 16.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 147
  • 点击次数: 26
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 147
  • Watchers: 22
  • Forks: 36
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-27