Contents
Invoices - Plugixa Car Parking
Invoices PRO turns a booking’s invoice into a PDF: a Download PDF button on the booking summary, and the same file attached to the emails the customer receives.
The invoice itself is not a Pro feature. Every edition shows it on the booking summary page, where the customer can print it. This page describes both, and says which is which.
| Free | Pro | |
|---|---|---|
| Invoice shown on the booking summary page | yes | yes |
| Print button | yes | yes |
| Download PDF button | - | yes |
| PDF attached to customer emails | - | yes |
| Tax line on the invoice | - | yes, with Tax rates |
There is nothing to switch on and no invoice settings screen. Nor is there an invoice screen in the admin: the invoice is a customer-facing document.
The invoice on the summary page
Place the [plugixa_car_parking_summary] shortcode on a page and choose that
page in Car Parking -> Settings -> Bookings -> Pages -> Booking summary
page. Customer emails then carry a private link to it. See
Shortcodes and
Emails.
The link opens the booking’s invoice, headed Parking booking invoice.
What is printed
| Part | Content |
|---|---|
| Header | The Business name from Settings -> General, the booking reference, the date the booking was made, and a payment badge: Paid (green), Unpaid (red) or Part paid (amber) |
| Customer | Name, email, phone, the licence plate when there is one, and the customer’s answers to the custom fields of your booking form |
| Booking | Location and space type, Entry, Exit and Quantity |
| Lines | Item, Qty, Unit and Total for each line of the booking. An adjustment to a line’s price is listed under it. |
| Totals | Subtotal, Discount when there is one, Tax PRO when there is any, and Total. Once something has been paid: Paid and Balance due. |
Dates and times use the Date format and Time format from Settings -> General, and amounts are written with the site’s currency symbol and separators, the same way the booking form writes them.
There is no separate invoice number. The invoice is identified by the booking
reference, for example PKG-... with the default prefix.
Under the invoice
- Print opens the browser’s print dialog. The buttons and the payment box are left out of the printout.
- Pay now appears while the booking still owes money, with one button per available way to pay. See Payments.
Who can open it
No login is needed, because a customer who booked as a guest has no account. The link carries two things: the booking reference and a token made from that reference and a secret key that only your site holds. Knowing a reference is not enough.
| Situation | What is shown |
|---|---|
| Token missing or wrong | “This summary link is invalid or has expired.” |
| Token right, booking gone | “Booking not found.” |
The token does not expire by time. It stops working only if the site’s
authentication salts in wp-config.php are changed, which invalidates every
summary and PDF link already sent.
If no Booking summary page is chosen, no link is added to emails and customers have no way to reach the invoice.
The PDF PRO
With Pro installed, two things are added. Both use the same document as the summary page, so the PDF and the page always agree.
Download PDF
A Download PDF button appears beside Print on the booking summary. It
opens the invoice as an A4 PDF in a new tab, named invoice- followed by the
booking reference.
The link has this form and can be opened without a login:
https://example.com/wp-json/plugixacarparking/v1/invoice?ref=<reference>&token=<token>
It carries the same token as the summary link. The same route also answers
under the plugin’s current namespace, /plugixa-car-parking/v1/invoice.
| Answer | Message | Cause |
|---|---|---|
| 403 | “Invalid or expired invoice link.” | The token does not match the reference |
| 404 | “Booking not found.” | The booking no longer exists |
| 429 | “Too many requests. Please wait a little while and try again.” | More than 30 downloads in 10 minutes from one IP address |
| 501 | “PDF generation is unavailable on this server.” | The PDF library is missing from the Pro build’s pro/vendor folder |
Attached to emails
The PDF is attached to every email the plugin sends to the customer about a booking, including Booking received and Payment received. The notice sent to your own address has no attachment.
The file is written to the server’s temporary folder, attached, and deleted once the mail has been handed over. If the PDF cannot be produced, the email is sent without it.
Because the invoice reflects the booking at the moment it is made, the PDF on a Booking received email usually shows Unpaid, and the one on Payment received shows Paid with the amount paid and a zero balance.
How the PDF is made
The PDF is rendered on your own server by the Dompdf library, which ships inside the Pro build. Nothing is sent to an outside service. Loading of remote files is switched off, and the document uses the DejaVu Sans font, which covers accented and non-Latin characters.
The tax line PRO
With Tax rates in use, a booking that carries tax shows a Tax row between the discount and the total, on the page and in the PDF. A booking with no tax has no such row.
For developers
| Hook | Type | Purpose |
|---|---|---|
plugixa_carparking_invoice_total_rows |
filter | Add rows between the discount and the total. Each row is a label and an amount. |
plugixa_carparking_summary_actions |
filter | Add links beside the Print button. Each is a url and a label. |
plugixa_carparking_email_attachments |
filter | Attach files to the customer’s email |
The Pro features above are ordinary listeners on these three filters. See Hooks reference.
If Pro is removed
The invoice on the summary page and the Print button stay. The Download PDF button and the email attachment go, and PDF links in emails already sent answer 404. See Free vs Pro.