Download the PHP package kamaro/sdc without Composer
On this page you can find all versions of the php package kamaro/sdc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package sdc
Short Description A package to interact with Sales Data Controllers (SDC) for Rwanda Revenue Authority
License MIT
Homepage https://github.com/kamaroly/sdc
Informations about the package sdc
RRA(Rwanda Revenue Authority) SDC(Sales Data Controller) for PHP
Sales Data Controller is the a device that is enforced by law to monitor all sales that takes place within a shop that pays VAT. This package controls SDC devices.
Structure
Installation
- Installation
- Server Requirements
- Installing KAMARO SDC
Installation
Server Requirements
KAMARO SDC has a few system requirements. Of course, most of these requirements are satisfied by the Laragon, so it's highly recommended that you use Laragon as your local Laravel development environment.
However, if you are not using Laragon, you will need to make sure your server meets the following requirements:
- PHP >= 7.1.0
- OpenSSL PHP Extension
- Mbstring PHP Extension
- Windows 10
- Php Serial extension for windows
Installing KAMARO SDC
KAMARO utilizes Composer to manage its dependencies. So, before using this package, make sure you have Composer installed on your machine.
Via Composer Create-Project
Alternatively, you may also install Laravel by issuing the Composer create-project
command in your terminal:
Install in existing project
Usage
Register php serial extension.
Each time you are opening the port, You are required to register it with your license from the vendor or the Serial Port.
Get SDC id
Get SDC status
Results
Send Receipt Data
This is is when you want to send tax information to the SDC, you will need to follow below format other wise The package will throw an exception.
Types of Invoice
RECEIPT TYPE | TRANSACTION TYPE | RECEIPT LABEL |
---|---|---|
NORMAL | SALES | NS |
NORMAL | REFUND | NR |
COPY | SALES | CS |
COPY | REFUND | CR |
TRAINING | SALES | TS |
TRAINING | REFUND | TR |
PRO FORMA | SALES | PS |
Format
Example
Get Signature
After sending receipt data to the device, You will need to send another request to get Internal Data and signature to Be put on the Invoice. You have to pass invoice Number as parameter
Results
Send Electronic Journal
Now at this stage you have all information required to build a certified invoice, You will add Internal Data and signature you got from getSignature method to your invoice then build your invoice and send it line by line.
B mark for begin of the receipt or the first line of the receipt N mark for line into the body of receipt E mark for end of receipt or the last line of the receipt Read the file and display it line by line.
Assume our final receipt looks like below
Assume you are reading a file that has a receipt called receipt.txt You would do it like below.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Using composer and PHPUNIT
If you have phpunit installed globally then go to the project directory and run
Using traditional way.
Go to your the index.php
from root directory of this package and update the port of the SDC then visit it from your browser.
You should see a page like below
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Credits
- KAMARO Lambert
- [All Contributors][link-contributors]
License
The MIT License (MIT). Please see License File for more information.