A comprehensive PHP-based invoicing and quotation management system with tax handling, client management, and professional invoice generation.
- Invoice Management: Create, edit, view, and delete invoices with tax calculations
- Quotation Management: Generate quotations that can be converted to invoices
- Tax Handling:
- Configurable tax rates per document
- Tax-exempt item support for individual line items
- Proper tax calculation on taxable items only
- Client Management: Maintain client information and contact details
- Professional Printing: Generate print-ready invoices and quotations
- Dashboard Overview: Quick access to key metrics and recent documents
- Settings Management: Configure company information and default tax rates
- Backend: PHP 8.2.12
- Database: MySQL/MariaDB
- Frontend: Bootstrap 5.1.3, jQuery 3.6.0, DataTables 1.11.5
- Server: Apache 2.4.58
- Version Control: Git
- PHP 8.0+
- MySQL 5.7+
- Apache with .htaccess support
- Composer 2.0+
git clone https://github.com/Varence-kiiru/Invoicing-system.git
cd Invoicing-systemcomposer installCopy the example environment file and update with your database credentials:
cp .env.example .envEdit .env with your configuration:
APP_ENV=development
DB_HOST=localhost
DB_NAME=olivian_invoice
DB_USER=root
DB_PASS=your_passwordmysql -u root -p < database/olivian_invoice.sqlReplace root with your MySQL username and enter your password when prompted.
For Apache/XAMPP, ensure the project is in htdocs:
C:\xampp\htdocs\Invoicing-systemOr configure your virtual host to point to the project directory.
Open your browser and navigate to:
http://localhost/Invoicing-system
- settings - Company configuration (name, address, tax rate, logo, etc.)
- clients - Client information (name, email, phone, address)
- invoices - Invoice records with totals and payment status
- invoice_items - Line items for invoices with tax-exempt flags
- quotations - Quotation records with validity dates
- quotation_items - Line items for quotations with tax-exempt flags
- Foreign key relationships with CASCADE delete
- Tax rate stored per invoice/quotation (preserves historical accuracy)
- Tax-exempt flag per item (allows mixed taxable/non-taxable items)
- Timestamp tracking on client creation
- Navigate to Invoices menu
- Click New Invoice button
- Select client and add items
- Mark items as tax-exempt if needed
- Adjust tax rate if different from default
- Click Save Invoice
- Navigate to Quotations menu
- Click New Quotation button
- Add quotation items
- Review calculated totals
- Save and share with client
- View the quotation
- Click Convert to Invoice
- Quotation becomes an invoice with same details
- Taxable Subtotal: Sum of all non-exempt items
- Non-Taxable Subtotal: Sum of items marked as tax-exempt
- Tax Amount: Taxable subtotal × (tax rate / 100)
- Final Total: Subtotal + Tax Amount
├── ajax/ # AJAX endpoints for dynamic operations
│ ├── save_invoice.php
│ ├── get_invoice.php
│ ├── delete_invoice.php
│ ├── save_quotation.php
│ ├── get_quotation.php
│ ├── delete_quotation.php
│ └── ... (other endpoints)
├── assets/
│ └── js/ # JavaScript functionality
│ ├── invoices.js
│ └── quotation.js
├── config/
│ └── config.php # Database configuration (uses .env)
├── database/
│ └── olivian_invoice.sql # Database schema
├── includes/ # Shared PHP templates
│ ├── navbar.php
│ └── footer.php
├── templates/ # Modal and form templates
│ ├── invoice_modal.php
│ └── quotation_modal.php
├── vendor/ # Composer dependencies (not committed)
├── .env # Environment variables (not committed)
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── clients.php # Client management page
├── invoices.php # Invoice list page
├── quotations.php # Quotation list page
├── settings.php # Application settings
├── index.php # Dashboard
└── README.md # This file
All endpoints return JSON responses.
GET ajax/get_invoice.php?id=<id>- Fetch invoice with itemsPOST ajax/save_invoice.php- Create/update invoicePOST ajax/delete_invoice.php- Delete invoicePOST ajax/mark_paid.php- Mark invoice as paidPOST ajax/get_next_invoice_number.php- Generate next invoice number
GET ajax/get_quotation.php?id=<id>- Fetch quotation with itemsPOST ajax/save_quotation.php- Create/update quotationPOST ajax/delete_quotation.php- Delete quotationPOST ajax/get_next_quotation_number.php- Generate next quotation number
- Database credentials are stored in
.envand excluded from version control - All database queries use prepared statements to prevent SQL injection
.envfile contains sensitive data and must never be committed- Example
.env.exampleis provided for configuration reference
- Ensure XAMPP or similar is running
- Start MySQL service
- Place project in
htdocsdirectory - Access via
http://localhost/Invoicing-system
Key files modified in this session:
config/config.php- Updated to use environment variables.env- Created with database configuration.gitignore- Added to exclude sensitive filescomposer.json- Added vlucas/phpdotenv dependency- Database schema - Added
tax_ratecolumn to invoices and quotations - JavaScript files - Enhanced to handle tax calculations and storage
- Create a feature branch
- Make changes
- Commit with clear messages
- Push to GitHub
- Create pull request
- User authentication and authorization
- Email invoice delivery
- Payment gateway integration
- Recurring invoices
- Multi-currency support
- Advanced reporting
- Mobile app
For issues and questions, please open an issue on GitHub: https://github.com/Varence-kiiru/Invoicing-system/issues
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 Varence Kiiru, Olivian Group
Varence Kiiru - Initial development and maintenance
Last Updated: March 2, 2026
For the latest version, visit: https://github.com/Varence-kiiru/Invoicing-system