The Business Ledger module provides comprehensive invoicing, client management, and tax compliance tools for entrepreneurs and small businesses. It is particularly tailored for Serbian tax system requirements but can be used internationally.
The primary use cases for this module are:
- Managing client information with tax IDs and registration numbers
- Creating and tracking invoices with multi-currency support
- Automated exchange rate conversion (Serbian National Bank integration)
- KPO Book (KPO knjiga) for tax inspection compliance
- Monitoring Serbian tax obligations (Test Samostalnosti, Pausal limit, VAT threshold)
- Sending invoices to clients via email
- Generating printable invoices and tax reports
- Complete client information storage (name, contact details, address)
- Tax ID (PIB) and Company ID (MB) tracking
- Separate invoicing email address with fallback to main email
- Bank account information
- Support for both individual and business clients
- Country selection with phone prefix integration
- Full CRUD operations with permissions
- Create, edit, and track invoices
- Multi-currency support (RSD, EUR, USD)
- Automatic exchange rate conversion via Serbian National Bank (NBS) API
- Line items with automatic calculations
- Service period tracking (from-to dates)
- Multiple invoice statuses (draft, sent, paid, overdue, cancelled)
- Payment tracking (payment date, payment method)
- VAT support
- Beautiful, printable invoice layout
- Send invoices to clients directly from the system
- Automatic status update to "sent" after successful email delivery
- Uses client's invoicing email or falls back to main email
- Customizable email templates
- KPO knjiga (Book of Issued Invoices) for Serbian tax compliance
- Year-based filtering
- Shows all invoices issued in calendar year regardless of payment status
- 5-column format: No., Date/Invoice#, Products, Services, Total
- Printable layout for tax inspection
- Automatic RSD conversion for all currencies
- Test Samostalnosti (Independence Test): Tracks if more than 70% of annual income comes from a single client
- Pausal Taxing Limit: Monitors if annual income stays below 6,000,000 RSD for pausal tax system
- VAT Threshold: Tracks when annual income exceeds 8,000,000 RSD, requiring VAT registration
- Dashboard displays compliance status in real-time
- Comprehensive dashboard with financial overview
- Stats cards: Total Paid, Total Pending, Total Overdue, Total Expected
- Currency breakdown for multi-currency invoices (RSD total + breakdown)
- Date range filtering (current month, quarter, year, all time, custom range)
- Compliance section showing tax obligations
- Beautiful, modern UI with gradient styling
- Sticky navigation bar for easy access across all pages
- Modern, responsive design with professional styling
- Mobile-friendly layouts
- Print support for invoices and KPO book
- Consistent theming across all pages
This module requires the following:
- Drupal 11.x
- PHP 8.1 or higher
- Internet connection for exchange rate API (optional, uses 1.0 rate if unavailable)
-
Install as you would normally install a contributed Drupal module. See: https://www.drupal.org/node/895232 for further information.
-
Enable the module at Admin > Extend
-
Run database updates:
drush updb -y drush cr
-
Navigate to /admin/business-ledger to access the dashboard
Navigate to Admin > People > Permissions to configure the following:
Client Permissions:
- Administer clients: Full administrative access to client settings
- Add clients: Permission to create new clients
- Edit clients: Permission to modify existing clients
- Delete clients: Permission to remove clients
- View published clients: Permission to view active clients
Invoice Permissions:
- Administer invoices: Full administrative access to invoice settings
- Add invoices: Permission to create new invoices
- Edit invoices: Permission to modify existing invoices (also allows sending emails)
- Delete invoices: Permission to remove invoices
- View published invoices: Permission to view active invoices
General Permissions:
- Access Business Ledger: Permission to access dashboard and KPO book
The module automatically fetches exchange rates from the Serbian National Bank (NBS) via the Kurs API:
- API Endpoint:
https://kurs.resenje.org/api/v1/currencies/{currency}/day-average?date={date} - Rates are cached for 24 hours per date
- Uses middle rate (Srednji kurs) for conversions
- Falls back to 1.0 rate if API is unavailable
No configuration is required - the module handles this automatically.
- Navigate to /admin/business-ledger and click "Clients" tab or "New Client" button
- Click "Add Client" to create a new client
- Fill in the required information:
- Name (required)
- Email and Invoicing Email
- Phone (country prefix auto-added based on country)
- Address, City, Postal Code, Country
- Tax ID (PIB) and Company ID (MB)
- Bank account
- Internal notes
- Navigate to /admin/business-ledger and click "Invoices" tab or "New Invoice" button
- Fill in invoice details:
- Client selection (required)
- Invoice number, date, due date
- Currency (RSD, EUR, USD)
- Service period (from-to dates)
- Payment information
- Notes/terms
- Add line items with description, quantity, and unit price
- Invoice total is calculated automatically
- For non-RSD currencies, exchange rate is fetched and RSD equivalent is calculated automatically
- Open an invoice detail page
- Click "Send to Client" button
- Invoice is sent to client's invoicing email (or main email if not set)
- Invoice status automatically updates to "sent"
- Client receives email with invoice details and link
- Navigate to /admin/business-ledger and click "KPO Book" tab
- Select year from dropdown
- View all invoices issued in that calendar year
- Click "Print" for printer-friendly format
- Use for tax inspection purposes
- Navigate to /admin/business-ledger
- View financial overview with:
- Total Paid (completed invoices)
- Total Pending (unpaid invoices not yet overdue)
- Total Overdue (past due date invoices)
- Total Expected (all unpaid invoices)
- Select date range: Current Month, Quarter, Year, All Time, or Custom
- Review compliance section for Serbian tax obligations:
- Test Samostalnosti (Independence Test)
- Pausal Taxing Limit
- VAT Threshold
- All amounts show RSD total with currency breakdown
- Open an invoice detail page
- Click "Print" button or use browser's print function (Ctrl+P)
- Professional print layout is automatically applied
- Navigation and action buttons are hidden when printing
Client Entity (bl_client):
- id, uuid, name, email, invoicing_email
- address, city, postal_code, country, phone
- tax_id, registration_number, bank_account
- notes, status, created, changed, user_id
Invoice Entity (bl_invoice):
- id, uuid, invoice_number
- client_id (reference)
- invoice_date, due_date, payment_date
- period_start, period_end
- status, currency, payment_method, place_of_issue
- exchange_rate, rsd_equivalent
- apply_vat, notes
- created, changed, user_id
Line Item Entity (bl_line_item):
- id, uuid, invoice_id (reference)
- description, quantity, unit_price
- created, changed, user_id
The module integrates with the Kurs API (Serbian National Bank exchange rates):
- Real-time exchange rate fetching
- 24-hour caching per date
- Automatic fallback if API unavailable
- Supports EUR, USD, and other major currencies
The module includes several database update hooks:
- 9001: Install Invoice and LineItem schemas
- 9003: Add exchange rate fields
- 9004: Populate RSD equivalents
- 9005: Update with new API
- 9006: Add service period fields
- 9007: Add invoicing email field
Always run drush updb -y after updating the module.
- Exchange rates are cached for 24 hours
- Clear cache:
drush cr - Check internet connection
- Verify API is accessible: https://kurs.resenje.org
- Check that invoice_date is set correctly
- Verify date range filter in dashboard
- Ensure invoices have RSD equivalent calculated
- Check that client has email or invoicing_email set
- Verify Drupal mail system is configured
- Check permissions (user needs 'edit invoices' permission)
- Review site email configuration at /admin/config/system/site-information
- Clear cache:
drush cr - Verify invoice statuses are set correctly
- Check that RSD equivalents are calculated (re-save invoices if needed)
For developers working on this module:
- Read
/web/modules/custom/business_ledger/Claude.mdfor detailed technical documentation - Date fields are stored as VARCHAR in Y-m-d format, not timestamps
- Dashboard stats return both
rsd_totalandbreakdownarrays - Always run
drush crafter making changes to routes, libraries, or themes - Use update hooks for schema changes
Future planned features:
- PDF invoice generation with custom templates
- Bulk invoice operations
- Advanced reporting and analytics
- Client portal for viewing invoices
- Payment gateway integration
- Recurring invoices
- Invoice templates with custom branding
- Export to accounting software
- E-invoice integration (SEF system for Serbia)
For bug reports and feature requests:
- GitHub: https://github.com/418-HTTP (if public repository exists)
- Email: Contact module maintainer
Current maintainers:
- Slobodan Prodanović (HTTP 418) - https://www.drupal.org/u/slobaprodanovic
This project is sponsored by:
- HTTP 418 - https://www.slobaprodanovic.in.rs
This module is licensed under the GNU General Public License v2.0 or later.