PHPackages                             mak8tech/zra-smart-invoice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mak8tech/zra-smart-invoice

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mak8tech/zra-smart-invoice
==========================

Zambia Revenue Authority Smart Invoice Integration for Laravel 12 POS Systems

0.0.1(1y ago)242MITPHPPHP ^8.2CI failing

Since Mar 22Pushed 1y agoCompare

[ Source](https://github.com/Mak8Tech/zra-smart-invoice)[ Packagist](https://packagist.org/packages/mak8tech/zra-smart-invoice)[ RSS](/packages/mak8tech-zra-smart-invoice/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Mak8Tech ZRA Smart Invoice Integration
======================================

[](#mak8tech-zra-smart-invoice-integration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/81c90b3d5bc66d895f369dfbbb29e4beb5098e7f2b893ba0f0565d350aebc999/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616b38746563682f7a72612d736d6172742d696e766f6963652e7376673f7374796c653d666c61742d737175617265266c6162656c3d4c617465737425323056657273696f6e)](https://packagist.org/packages/mak8tech/zra-smart-invoice)[![Build Status](https://github.com/mak8tech/zra-smart-invoice/workflows/PHP%20Tests/badge.svg?branch=main)](https://github.com/mak8tech/zra-smart-invoice/actions?query=workflow%3A%22PHP+Tests%22+branch%3Amain)[![PHP Version](https://camo.githubusercontent.com/8c32682ae90a5572e9197155d70259dafa8239f353150d19f9214037ad67f32d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Laravel Version](https://camo.githubusercontent.com/d8d29f69648081c8c840617e46785e65ca54784d2c6301918a377f75ce2297c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25334525334425323031322e302d4646324432302e7376673f7374796c653d666c61742d737175617265)](https://laravel.com/)[![Total Downloads](https://camo.githubusercontent.com/ced2eb13bf384381842782ed7081236fe077e615e407de472c6dab0143aa275d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616b38746563682f7a72612d736d6172742d696e766f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mak8tech/zra-smart-invoice)[![License](https://camo.githubusercontent.com/bfb91dd666e98087022e8f571ee54cf1228220eb5d4f1e41feca938da52e33b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d616b38746563682f7a72612d736d6172742d696e766f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mak8tech/zra-smart-invoice)

A Laravel 12 package for integrating with the Zambia Revenue Authority (ZRA) Smart Invoice system for POS applications.

Features
--------

[](#features)

- Easy integration with Laravel 12 applications
- Seamless Inertia.js React/TypeScript components
- Device initialization with ZRA API
- Sales, purchase, and stock data submission
- Transaction logging and monitoring
- Configuration management
- Status indicators and analytics
- Support for various invoice types (NORMAL, COPY, TRAINING, PROFORMA) and transaction types
- Comprehensive tax handling with support for multiple tax categories
- Report generation (X and Z Reports)
- Inventory management with stock tracking and validation

What's New in 1.0.1
-------------------

[](#whats-new-in-101)

- **Support for Various Invoice Types**: Added configuration options for different invoice and transaction types
- **Comprehensive Tax Handling**: Support for multiple tax categories, zero-rated and exempt transactions
- **Report Generation**: X and Z reports for auditing and compliance purposes
- **Inventory Management**: Complete inventory tracking system with stock validation during sales

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mak8tech/zra-smart-invoice
```

Publishing Assets
-----------------

[](#publishing-assets)

Publish the package configuration and migrations:

```
php artisan vendor:publish --provider="Mak8Tech\ZraSmartInvoice\ZraServiceProvider"
```

Configuration
-------------

[](#configuration)

After publishing the package assets, you can configure the ZRA integration in the `config/zra.php` file.

You can also set these in your `.env` file:

```
ZRA_BASE_URL=https://api-sandbox.zra.org.zm/vsdc-api/v1
ZRA_TPIN=
ZRA_BRANCH_ID=
ZRA_DEVICE_SERIAL=
ZRA_DEBUG=false

```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

Initialize your device with ZRA:

```
use Mak8Tech\ZraSmartInvoice\Facades\Zra;

// Initialize device
$result = Zra::initializeDevice('1234567890', '001', 'DEVICE123456');
```

### Sending Sales Data

[](#sending-sales-data)

```
use Mak8Tech\ZraSmartInvoice\Facades\Zra;

// Prepare sales data
$salesData = [
    'invoiceNumber' => 'INV-1234',
    'timestamp' => now()->format('Y-m-d H:i:s'),
    'invoiceType' => 'NORMAL', // Can also be COPY, TRAINING, PROFORMA
    'transactionType' => 'SALE', // Can also be CREDIT_NOTE, DEBIT_NOTE, ADJUSTMENT, REFUND
    'items' => [
        [
            'name' => 'Product 1',
            'quantity' => 2,
            'unitPrice' => 100.00,
            'totalAmount' => 200.00,
            'taxRate' => 16,
            'taxAmount' => 32.00,
            'taxCategory' => 'VAT', // Can also be TOURISM_LEVY, EXCISE_DUTY, etc.
        ],
    ],
    'totalAmount' => 200.00,
    'totalTax' => 32.00,
    'paymentType' => 'CASH',
    'customerTpin' => '',  // Optional for customer without TPIN
];

// Send to ZRA
$result = Zra::sendSalesData($salesData);
```

### Generating Reports

[](#generating-reports)

```
use Mak8Tech\ZraSmartInvoice\Facades\Zra;

// Generate X report (interim report)
$xReport = Zra::generateXReport();

// Generate Z report (end of day report)
$zReport = Zra::generateZReport();

// Get daily summary report
$dailyReport = Zra::getDailyReport('2025-04-11');
```

### Managing Inventory

[](#managing-inventory)

```
use Mak8Tech\ZraSmartInvoice\Facades\Zra;

// Add new product to inventory
$product = Zra::addInventoryProduct([
    'code' => 'PROD001',
    'name' => 'Product Name',
    'description' => 'Product Description',
    'unitPrice' => 100.00,
    'taxRate' => 16,
    'taxCategory' => 'VAT',
    'initialStock' => 50
]);

// Update stock quantity
Zra::updateStockQuantity('PROD001', 60, 'STOCK_ADJUSTMENT', 'Inventory count adjustment');

// Check if product has sufficient stock
$hasStock = Zra::checkProductStock('PROD001', 5); // Returns true if at least 5 units available
```

Web Interface
-------------

[](#web-interface)

The package includes a web interface accessible at `/zra` (configurable) where you can:

- Initialize your device
- View device status
- Test connectivity
- View transaction logs
- Generate X and Z reports
- Manage inventory and stock levels

Testing
-------

[](#testing)

```
composer test
```

Deployment to Packagist
-----------------------

[](#deployment-to-packagist)

For full instructions on deploying this package to Packagist.org, please see the [Deployment Guide](DEPLOYMENT.md).

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance47

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/116803ec73acffc494c4cc854e7bc914891224a72eef6960ce360cd46b234470?d=identicon)[makusa-the](/maintainers/makusa-the)

---

Top Contributors

[![makusa-the](https://avatars.githubusercontent.com/u/24973307?v=4)](https://github.com/makusa-the "makusa-the (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mak8tech-zra-smart-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/mak8tech-zra-smart-invoice/health.svg)](https://phpackages.com/packages/mak8tech-zra-smart-invoice)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

202832.4k6](/packages/backpack-basset)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
