定制 elmogy/fatoora-zatca 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

elmogy/fatoora-zatca

最新稳定版本:v1.1

Composer 安装命令:

composer require elmogy/fatoora-zatca

包简介

this package handle the stage 2 of zatca for integration the tax and simpilified tax invoices.

README 文档

README

ZATCA Logo

Fatoora Zatca

This package handle the phase 2 of the zakat and income authority in the saudi arabia, addition to it's based on native php so it can work on any system based on php or any framework like: (Laravel - Symfony - CodeIgniter - Yii - Zend Framework - CakePHP)

The package handle 3 environments:

  • test.
  • simulation.
  • production.

Requirements

  • phpseclib/phpseclib:~3.0
  • simplesoftwareio/simple-qrcode

Installation

composer require elmogy/fatoora-zatca

Configuration:

 # Must add the service provider to config/app.php
 'providers' => [
    /*
    * Package Service Providers...
    */
    Bl\FatooraZatca\FatooraZatcaServiceProvider::class,
 ]

Then publish the config file 👏

php artisan vendor:publish --tag=fatoora-zatca

Assign the config from your.env

 ZATCA_ENVIRONMENT=local   # local|simulation|production

Setting

First you must generate credentials to use in zatca authentication 
and here is the steps :  
1- fill all parameters in Setting object.
 $settings = new \Bl\FatooraZatca\Objects\Setting();
 2 - pass $settings to the static method ( generateZatcaSetting ) 
$result = \Bl\FatooraZatca\Zatca::generateZatcaSetting($settings);
 3 - save all $result object to database to use when sending xml invoices.
 Prepare
 $seller       
instance of \Bl\FatooraZatca\Objects\Seller::class
 $invoice    instance of \Bl\FatooraZatca\Objects\Invoice::class
 $client       
instance of \Bl\FatooraZatca\Objects\Client::class
 \Bl\FatooraZatca\Classes\InvoiceType 
(TAX_INVOICE|REFUND_INVOICE|CREDIT_NOTE)
 \Bl\FatooraZatca\Classes\PaymentType (CASH|CREDIT|BANK_ACCOUNT|
 BANK_CARD|MULTIPLE)
 B2B Invoice Tax
 $invoice = \Bl\FatooraZatca\Invoices\B2B::make($seller, $invoice, $client)->report();
 B2C Invoice Tax
 $invoice = \Bl\FatooraZatca\Invoices\B2C::make($seller, $invoice)->report();
 OR
 $invoice = \Bl\FatooraZatca\Invoices\B2C::make($seller, $invoice)->calculate();

Access Response

 $invoice->getQr();                            # qr text in base64 format
 $invoice->getQrImage();                       # qr image in base64 format
 $invoice->getInvoiceHash();                   # the hash of the invoice
 $invoice->getClearedInvoice();                # the invoice in base64 format
 $invoice->getXmlInvoice();                    # the invoice in xml format
 $invoice->getReportingStatus();               # Status of clearance and reporting   
 $invoice->getValidationResultStatus();        # validation status of sent data
 $invoice->getValidationResults();             # all messages (info - warning - error)
 $invoice->getInfoMessages();                  # all info messages
 $invoice->getWarningMessages();               # all warning messages
 $invoice->getErrorMessages();                 # all error messages
 $invoice->getResult();                        # access all the previous data
       

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-05-09