Download the PHP package crmleaf/invoice-generator without Composer

On this page you can find all versions of the php package crmleaf/invoice-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package invoice-generator

Invoice Generator

GST-compliant invoices with HSN/SAC codes and tax breakdowns.

Produces a GST-compliant tax invoice: HSN or SAC per line, taxable value, the correct tax heads for the place of supply, and the invoice total in both figures and words.

One of the CRMLeaf payroll tools. The arithmetic and the dated statutory rate tables live in crmleaf/payroll-core; this package is the thin skin that makes one calculator installable, mountable and embeddable on its own.

[!NOTE] A wrong figure or an out-of-date rate is almost always a payroll-core matter, since that is where the tables live. Anything about this tool's routes, views or browser asset belongs here.

Install

Composer - Laravel auto-discovers the service provider, so this is the whole setup:

npm - the same calculation, re-exported from @crmleaf/payroll-js so you can install this one tool and nothing else:

[!NOTE] Not on npm yet. The script-tag route below needs no registry and works today. Installing this package straight from git will not resolve @crmleaf/payroll-js, which is not published yet either.

A plain script tag - no build step, no bundler, no server. Build the browser bundle once and serve the file yourself:

payroll.min.js is the single-file browser build. Get it by running npm run build in @crmleaf/payroll-js and copying dist/payroll.min.js into whatever your site serves as static assets.

A hosted CDN build is coming soon, which will reduce this to a single URL. Serving the file yourself works today and keeps working afterwards - it is the only option that needs no third-party request, so plenty of projects will want to stay on it.

See it working first

demo/index.html in this repository is a working copy of Invoice Generator in one file: the form, the calculation and the working, with no build step and no server. Drop payroll.min.js beside it and open it from disk.

Nothing on that page reaches the network, which is the point: it is a calculator people paste salary figures into.

Use it

Plain PHP, no framework and no container:

Laravel - resolve it from the container, or type-hint it anywhere:

Blade - one component, no controller:

HTTP - off by default. Publish the config and turn the route on:

The JSON response carries the figures, the working and the statutory citations:

JavaScript:

Documents render inside your application

This tool writes a PDF file, which means it needs a server. Rendering happens in your application, against your published config, and the bytes never leave your infrastructure - there is no hosted document service and therefore no credential for a browser to carry.

Add format=pdf to the HTTP request and the route returns the file directly.

Inputs

Field Type Required Default Notes
invoice_number string Yes "INV-2025-0001" Rule 46(b) caps this at sixteen characters and requires it to be unique within the financial year.
invoice_date date (YYYY-MM-DD) Yes "2025-08-01"
seller_state string Yes "Karnataka"
buyer_state string Yes "Maharashtra" Different from the seller state means IGST; the same state means CGST plus SGST.
buyer_gstin string No "27AAACT2727Q1ZW"
items array or JSON Yes [{"description":"Payroll processing services","sac":"998221","quantity":1,"rate":50000,"gstRate":18}] One object per line: description, hsn or sac, quantity, rate and gstRate.
reverse_charge boolean No false
as_of date (YYYY-MM-DD) No -

Optional fields you leave out are omitted from the call entirely, so the calculator's own documented defaults apply.

Every figure here rests on a statutory rate, so the call takes as_of. Set it and the calculation runs on the rates in force on that date, which is what makes a prior year recomputable rather than merely rememberable.

Statutory basis

CGST Rules 2017, rules 46 and 47 - the particulars a tax invoice must carry - with the IGST versus CGST/SGST split decided by the place of supply under sections 10 and 12 of the IGST Act 2017.

Rates are data, not code: they live in dated tables with a cited source in crmleaf/payroll-core, so a rate change is a new dated entry rather than an edit to a constant.

[!IMPORTANT] This package implements our reading of the applicable statutes and is provided without warranty. It is a calculation library, not tax advice. Verify against your own compliance obligations before relying on the output for statutory filing.

Publishing

Tag Publishes
invoice-generator-config config/invoice-generator.php
invoice-generator-views resources/views/vendor/invoice-generator
invoice-generator-assets public/vendor/invoice-generator

Licence

MIT © CRMLeaf. Use it commercially, embed it, fork it.


All versions of invoice-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
crmleaf/payroll-core Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package crmleaf/invoice-generator contains the following files

Loading the files please wait ...