π¬π§ English | π«π· FranΓ§ais
β οΈ This repository presents the project and its technical documentation.
The production version is not publicly distributed.
Installation is performed directly on the client's hosting infrastructure.
If you are interested in using this system, please contact Palks Studio.
Complete, autonomous and bilingual (FR/EN) billing system deployable on any PHP/Apache hosting. No database. No SaaS dependency. Self-hosted with full ownership of your data.
Billing System is a suite of three interconnected billing tools accessible from a unified interface. It covers the full lifecycle of a service engagement: from quote generation to invoice settlement, including electronic signature and structured archiving.
The system is designed to be deployed directly on the client's server, on a standard Apache hosting environment with PHP 8.x and Composer. It requires no database, no third-party service, and no subscription.
- Interface de crΓ©ation de devis et factures avec gΓ©nΓ©ration PDF cΓ΄tΓ© serveur via mPDF
- Automatic pre-generation of the paid invoice at billing time
- Electronic quote signing by the client (touch/mouse canvas)
- Client auto-fill from archives (SIREN, SIRET, VAT, email, name)
- Structured archiving by client and period
- Secure sequential numbering (file lock)
- Monthly export of invoices (ZIP)
- Monthly export of revenue records (CSV)
- Yearly export of the revenue journal (CSV)
- Automatic email notifications at each stage (quote, invoice, settlement)
- Cross-module navigation bar
- Bilingual FR/EN interface with real-time language switch
- Dark mode / light mode with persistence
- No database
- No SaaS dependency
- Basic security: secure sessions, tokens, brute-force protection
billing-system/
β
βββ public/
β β βββ assets/
β β βββ logo* β Company logo if provided
β β βββ signature.png β User signature used on quotes and invoices (PNG format)
β β βββ favicon* β Optional favicon displayed in the browser tab
β β
β βββ Endpoint a β Quote generation endpoint
β βββ Endpoint b β Invoice generation endpoint
β βββ Endpoint c β Direct invoice generation endpoint
β βββ Endpoint d β Paid invoice generation endpoint
β β
β βββ Interface a β Quote generation interface
β βββ Interface b β Direct invoice generation interface
β βββ Interface c β Payment tracking interface
β βββ sign.php β Signature interface
β βββ export a β Archived invoices ZIP export
β βββ export b β Revenue journal CSV export
β β
β βββ search.php β Client search and auto-fill
β βββ serve.php β Secure PDF access via token
β βββ save.php β Quote save and archiving
β
βββ vendor/ β Libraries used by the document generation engine
βββ templates/ β HTML templates used for document rendering
β
βββ app.php β Central configuration for issuer and bank details
βββ mailer.php β Internal email sending script with attachments
βββ core.php β Main engine: generation logic, calculations and archiving
βββ LICENSE.md β Project license
β
βββ contracts/ β Signed and unsigned quote archiving
βββ counters/ β Numbering counters (quotes and invoices)
βββ logs/ β System logs (optional)
βββ data/ β Operational data
β
βββ docs/
βββ USER_GUIDE.md β User guide
βββ OVERVIEW.md β Project overview and general system description
βββ README.md β Installation and usage documentation (client version)
How it works:
- The user fills in the form: issuer details, client details, service lines, bank details, and settings (currency, PDF language).
- A live preview of totals (excl. VAT / VAT / incl. VAT) is calculated in real time.
- On submission, a confirmation dialog appears before generation.
- The PDF is generated locally and downloaded. At the same time, the quote is archived server-side with a signature token valid for 30 days.
- An email is sent to the client with a link to review and sign the quote online.
Technical details:
- Automatic numbering based on the clientβs existing records
- Client auto-fill using SIREN, SIRET, VAT number, email, or name
- Client-side validation of SIREN/SIRET (Luhn algorithm)
- Automatic SIREN extraction from SIRET
- Real-time language switch (FR/EN) without page reload
- Currency selector: EUR, USD, GBP, CHF, CAD
- Conditional display of bank details (IBAN/BIC) in the PDF
- βApproved and agreedβ section with configurable signature image
- Conditional VAT footer (e.g. VAT exemption under art. 293B CGI when VAT = 0)
- Automatic PDF pagination
Server-side invoice generation interface. For each operation, two PDFs are produced: the standard invoice and a pre-generated βpaidβ version (pending payment validation).
How it works:
- The user fills in the form: issuer details, client details, service lines, bank details, and settings (currency, PDF language).
- A live preview of totals (excl. VAT / VAT / incl. VAT) is calculated in real time.
- On submission, a confirmation dialog appears before generation.
- The invoice PDF is generated and downloaded. At the same time, the documents are archived server-side for tracking and payment validation.
- An email is sent to the client with the invoice attached.
Technical details:
- Annual invoice numbering with collision protection
- Protection against duplicate invoicing from the same quote reference
- Full input validation with bilingual error handling (FR/EN)
- Accurate financial calculations with float precision handling
- VAT aggregation per rate
- Automatic logo processing for PDF compatibility
- Automatic retrieval of issuer information from existing metadata
- PDF traceability via cryptographic hash (SHA-256)
- Email delivery with PDF attachment, without external dependencies
Interface for tracking outstanding invoices and validating payments. Allows users to identify unpaid invoices, mark them as paid, and monitor revenue.
How it works:
- The module automatically detects invoices awaiting payment.
- The user selects a payment date and clicks βMark as paidβ.
- The system archives the invoice as paid, updates the metadata, records the transaction in the revenue log, and sends the invoice to the client by email.
- A table displaying the latest revenue entries of the year is shown at the bottom of the page.
Technical details:
- Automatic detection of invoices to process
- Filtering of invoices already marked as paid
- Prevention of duplicate entries in the revenue log
- Safe write operations with file locking
- Protection against form resubmission
- Pending invoices counter indicator
- Annual CSV export of revenue
Public page accessible via a secure tokenized link. Allows the client to view the quote and provide an electronic signature.
- Multi-page PDF preview in the browser
- Signature capture (touch and mouse compatible)
- Input validation (format and minimum size)
- Signature image storage
- Metadata update with signature timestamp and traceability
- Confirmation emails sent to both client and issuer (FR/EN)
- Protection against duplicate signing
- Link expiration after 30 days
JSON endpoint used during form input. Searches existing records based on SIREN, SIRET, VAT number, email, name, or quote number.
- Returns full client details, language, currency, and related records
- Allows automatic pre-fill of invoice data from previous quotes
- Input normalization for consistent matching
Token-based access layer for serving PDF files without exposing their physical location.
Email sending module with attachment support, used across all features. No external SMTP service required.
- Secure session management (protected cookies, access isolation)
- Protection against brute-force attempts
- Session identifier regeneration after authentication
- Use of secure tokens for accessing sensitive resources
- Strict validation of inputs and identifiers
- Action traceability via cryptographic hashing
- Endpoint protection through access control mechanisms
- HTTP response security policies (content type, caching, indexing)
- Internal interfaces are not indexed and not publicly exposed
- No external dependencies: all data remains under full control
| Event | Recipient(s) | Content |
|---|---|---|
| Quote generation | Client | Signature link + PDF download link |
| Quote signed | Client + Issuer | Signature confirmation + PDF link |
| Invoice generation | Client | Invoice as attachment |
| Settlement | Client | Paid invoice as attachment |
All emails are bilingual FR/EN based on the document language.
- PHP 8.1 or higher
- Compatible web server (Apache recommended)
- URL rewriting support
- GD extension (image processing)
- Email sending capability enabled on the server
- Write permissions on storage and archive directories
All data is stored using flat files. No database is required.
| Type | Description | Format |
|---|---|---|
| Quotes | Archived with associated metadata | PDF + metadata |
| Signatures | Stored as image files | PNG |
| Invoices | Archived with associated metadata | PDF + metadata |
| Pending paid invoices | Pre-generated and awaiting validation | |
| Validated paid invoices | Archived after payment confirmation | |
| Revenue records | Structured export of transactions | CSV |
| Counters | Sequential numbering tracking | Integer |
| Logs | System activity tracking | Timestamped text |
Β© Palks Studio β see LICENSE.md
