A comprehensive, enterprise-grade PDF invoice template for WHMCS v6/7/8 with advanced features, professional styling, and extensive customization options.
- β WHMCS 6/7/8 Compatibility - Works across all supported WHMCS versions
- β Proforma Invoice Support - Automatic detection and styling for proforma invoices
- β Status-Aware Rendering - Different layouts for Paid, Unpaid, Overdue, Refunded invoices
- β Multi-Currency Support - Full support for all WHMCS currencies with proper formatting
- β Dynamic Content - Intelligent content adaptation based on invoice status and data
- β Enterprise Styling - Modern, professional design with status-based color schemes
- β Digital Verification Badge - IT Act 2000 compliant verification system for paid invoices
- β Status Ribbons - Visual status indicators with appropriate color coding
- β Proforma Watermarks - Diagonal watermarks for proforma invoices
- β Signature & Stamp Support - Professional signature and stamp placement
- β Smart Item Parsing - Intelligent service description parsing with domain and date extraction
- β Late Fee Handling - Automatic detection and highlighting of late fee items
- β Renewal Tracking - Upcoming renewal dates with urgency indicators
- β Payment Transactions - Detailed transaction history on separate page
- β QR Code Generation - UPI payment QR codes with invoice-specific data
- β Indian Tax Compliance - GST/CGST/SGST support with proper labeling
- β TDS Compliance - Section 194J compliance information
- β MSME Registration - UDYAM number display
- β Legal Terms - Comprehensive payment terms and legal disclaimers
- β Configurable Debug Mode - Multiple debug levels for development and troubleshooting
- β Performance Monitoring - Built-in performance metrics (development mode)
- β Variable Inspection - Complete WHMCS variable inspection and display
-
Upload
invoicepdf.tplto your WHMCS template directory:/templates/twenty-one/invoicepdf.tpl -
Ensure required image assets are in place:
/assets/img/logo.png (or .jpg) /assets/img/sign.png (signature image) /assets/img/stamp.png (stamp image) -
Configure template settings in the
$ENHarray (see Configuration section)
templates/twenty-one/
βββ invoicepdf.tpl # Main template file
βββ assets/img/
βββ logo.png # Company logo
βββ sign.png # Signature image
βββ stamp.png # Stamp image
Edit the $ENH array in the template to customize features:
$ENH = array(
// Core Status Features
'show_status_ribbon' => true,
'show_auth_seal' => true,
'show_verification_badge' => true,
// Proforma & Invoice Management
'proforma_enabled' => true,
'show_original_proforma' => true,
// Payment & Transactions
'show_transactions' => true,
'show_payment_ui' => true,
// Compliance & Legal
'official_auth_seal' => true,
'show_tax_details' => true,
'show_client_tax_id' => true,
'show_company_tax_id' => true,
// Debug & Development
'show_debug_section' => false,
'debug_level' => 'full',
'debug_include_sensitive' => false,
'debug_show_calculations' => true,
'debug_show_variables' => true,
'debug_show_performance' => false
);- minimal: Basic invoice information only
- standard: Basic + Financial + Payment information
- full: Standard + Client + Credit information
- development: All information + Development metrics
The template automatically applies different styling based on invoice status:
- Paid: Green accent colors with verification badge
- Unpaid: Orange accent colors with payment UI
- Overdue: Red accent colors with late fee highlighting
- Refunded: Blue accent colors with refund information
- Proforma: Special proforma styling with watermarks
Modify the color constants at the top of the template:
define('COLOR_DARK_GREY', array(64, 64, 64));
define('COLOR_LIGHT_GREY', array(245, 245, 245));
define('COLOR_PURPLE', array(75, 0, 130));
define('COLOR_WHITE', array(255, 255, 255));
define('COLOR_BLACK', array(0, 0, 0));Update company details in the template:
// Company Details Section
$seller_name = isset($companyname) && !empty($companyname) ? $companyname : 'Your Company Name';
$company_address = 'Your Company Address';
$pan_number = 'YOUR_PAN_NUMBER';
$email = 'your-email@company.com';
$phone = '+91 00000 00000';
$msme_number = 'UDYAM-XX-XX-XXXXXXX';Configure bank information for payment processing:
$bank_details = array(
'Account Name' => 'Your Company Name',
'Account Number' => '1234567890',
'IFSC' => 'BANK0001234',
'Account Type' => 'Current',
'Bank' => 'Your Bank Name'
);The template includes a sophisticated digital verification system for paid invoices:
- Multi-layered Hash Generation: SHA-256 + SHA-512 for enhanced security
- Comprehensive Input Data: Invoice, client, company, and temporal data
- Salt-based Security: Prevents rainbow table attacks
- IT Act 2000 Compliance: Legal validity for digital signatures
Intelligent parsing of service descriptions:
// Pattern 1: "Service Name - domain.com (date - date)"
// Pattern 2: "Service Name - domain.com - duration"
// Pattern 3: "Service Name (date - date)"
// Pattern 4: "Service Name only"Automatic renewal date calculation and tracking:
- Date Extraction: From service descriptions and duration information
- Urgency Levels: Overdue, Urgent (β€30 days), Upcoming (β€90 days)
- Visual Indicators: Color-coded urgency levels
- Renewal Alerts: Prominent display of upcoming renewals
Dynamic UPI QR code generation:
- Paid Invoices: Generic QR code without amount
- Unpaid Invoices: Specific QR code with balance amount
- Invoice Reference: Automatic invoice number inclusion
- Payment Tracking: Transaction description with invoice details
Set debug configuration in the $ENH array:
$ENH = array(
'show_debug_section' => true,
'debug_level' => 'full',
'debug_include_sensitive' => false,
'debug_show_calculations' => true,
'debug_show_variables' => true,
'debug_show_performance' => false
);- Basic Invoice Information: Status, ID, number, proforma detection
- Financial Information: Totals, balance, taxes, credits, discounts
- Currency & Payment: Currency settings, payment methods, dates
- Client Credit: Available credit, applied credit
- Performance Metrics: Generation time, memory usage (development mode)
- Check file permissions (644 for template file)
- Verify WHMCS template directory path
- Ensure PHP syntax is correct
- Verify image file paths in
/assets/img/ - Check file permissions (644 for image files)
- Ensure image formats are supported (PNG, JPG)
- Set
'show_debug_section' => true - Choose appropriate debug level
- Check WHMCS error logs
- Hash Generation: SHA-256 + SHA-512 with salt
- Input Validation: Comprehensive data validation
- Timestamp Inclusion: Temporal verification
- Legal Compliance: IT Act 2000 compliance
- Sensitive Data: Configurable sensitive data display
- Debug Controls: Separate debug mode for development
- Access Control: Template-level access controls
- Dynamic Width Calculation: Intelligent column width distribution
- Conditional Rendering: Only render necessary sections
- Memory Management: Efficient memory usage
- Page Overflow Protection: Automatic page breaks
- Generation Time: Track template rendering time
- Memory Usage: Monitor memory consumption
- Page Count: Track multi-page generation
- Debug Metrics: Detailed performance analysis
Template Sections:
βββ Page Setup & Initialization
βββ Header Section (Logo & Title)
βββ Status Ribbon & Verification Badge
βββ Invoice Details Section
βββ Billed To/By Sections
βββ Itemized Table
βββ Totals Section
βββ Signature & Stamp Section
βββ Bottom Sections (Terms, Bank, UPI)
βββ Compliance & Legal Section
βββ Last Page (Renewals, Transactions, Debug)
- New Status Types: Add to
$status_colorsarray - Custom Fields: Extend client details section
- Additional Totals: Add to totals calculation section
- New Debug Info: Extend debug information display
- Status Testing: Test all invoice statuses
- Currency Testing: Test with different currencies
- Debug Testing: Verify debug information accuracy
- Performance Testing: Monitor generation time and memory usage
- β Complete rewrite with enterprise-grade features
- β Digital verification system implementation
- β Smart item parsing and renewal tracking
- β Status-aware rendering and styling
- β Comprehensive debug system
- β Indian tax compliance features
- β UPI QR code generation
- β Professional signature and stamp support
- β Basic WHMCS invoice template
- β Standard invoice layout
- β Basic customization options
- Template Comments: Extensive inline documentation
- Configuration Guide: Detailed configuration options
- Debug Guide: Comprehensive debugging information
- Customization Examples: Code examples for common modifications
- Check Debug Mode: Enable debug mode for detailed information
- Verify Configuration: Ensure all settings are correct
- Check WHMCS Logs: Review WHMCS error logs
- Test with Sample Data: Use test invoices for debugging
- Template Not Loading: Check file permissions and syntax
- Images Missing: Verify image file paths and permissions
- Debug Not Working: Ensure debug mode is enabled
- Styling Issues: Check color constants and configuration
This template is provided as-is for WHMCS installations. Please ensure compliance with your WHMCS license and local regulations.
- WHMCS Template System: WHMCS Documentation
- TCPDF Library: TCPDF Documentation
- Indian Tax Compliance: GST Guidelines
Template Version: 2.0.0
WHMCS Compatibility: 6.0+ (Tested on 6.3, 7.10, 8.13)
PHP Compatibility: 5.6+ (Tested on 5.6, 7.0, 7.4, 8.0, 8.1, 8.2)
Last Updated: 2025-01-28