Download the PHP package icomefromthenet/vouchernum without Composer
On this page you can find all versions of the php package icomefromthenet/vouchernum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download icomefromthenet/vouchernum
More information about icomefromthenet/vouchernum
Files in icomefromthenet/vouchernum
Package vouchernum
Short Description Helper to generate unique voucher numbers
License MIT
Informations about the package vouchernum
Voucher Number
While creating another library General Ledger I found that I needed a feature that would generate a reference number for paperwork with this number needing
- Need to be unique.
- Need to have a custom prefix and or suffix.
- Need configured by end user.
As my primary database is MySql I needed this library to both convert a number into voucher (add prefix,suffix and padding) but also must provide a sequence emulator.
Generating a voucher number entails.
- Fetch next value in the sequence.
- Run through a formatter to add suffix prefix or padding.
- Run through a validation step ensure that reference number matches a specification.
- Do a unique check.
Installing
Step 1. You can install this library using composer.
Step 2. Create a new database called 'general_ledger' and run the database build script under database/database.sql
I use my own database migration tool called Migrations but I have included a sql file for convenience.
Example
Following taken from example/example.php.
All versions of vouchernum with dependencies
ext-mbstring Version *
icomefromthenet/dbal-gateway Version ^1.1.0
pimple/pimple Version 3.0.*
psr/log Version 1.0.*
vlucas/valitron Version ^1.2
bezdomni/tactician-pimple Version ^1.0
league/tactician-command-events Version ^0.6.0
zendframework/zend-text Version ^2.6
doctrine/collections Version ^1.5