=== VeloX โ€“ PDF Invoices, Credit Notes and Packing Slips for WooCommerce === Contributors: vishwasr Tags: woocommerce, pdf, invoice, billing, packing slip Requires at least: 6.0 Tested up to: 7.1 Stable tag: 2.5.0 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Professional PDF Invoices, Packing Slips, Delivery Notes & Proformas for WooCommerce. Free, HPOS-ready, email attachments, and bulk ZIP export. == Description == **VeloX โ€“ PDF Invoices, Credit Notes and Packing Slips for WooCommerce** (formerly **PDF InvoiceX**) is a free WooCommerce PDF invoice plugin that automates your entire billing workflow. Generate, send, and manage PDF invoices, credit notes, packing slips, proforma invoices, and delivery notes โ€” all from within WooCommerce, with no monthly fees. Whether you run a small shop or a high-volume store, VeloX Invoices handles invoice numbering, VAT/GST compliance, bulk exports, and customer-facing downloads out of the box. --- ### ๐Ÿ“„ PDF Invoices & Orders Screen UI - **Modern SaaS Orders UI**: Sleek invoice column displaying the assigned invoice number badge, quick ๐Ÿ‘๏ธ View and โฌ‡๏ธ Download buttons, and an on-the-fly **[ โž• Generate ]** button for paid orders that updates live without page reloads. - **In-Page PDF Preview Modal**: View invoices and fulfillment documents inside a clean modal overlay with instant ๐Ÿ–จ๏ธ **Print** (`iframe` print window) and **Download** controls. - **Auto-generate** invoices when orders reach any configured status (e.g. Processing, Completed). - **Sequential invoice numbering** with prefix, suffix, and optional yearly counter reset (e.g. 2026-000001). - **Download or view** invoices from the WooCommerce admin, My Account page, and the Thank You / order-received page. - **Regenerate** any invoice on demand, bypassing the cache. - **Send Invoice to Customer** directly from the order edit screen โ€” no duplicate email sends. ### ๐Ÿ“‹ Credit Notes - Auto-generated when an order is refunded (configurable in Advanced settings). - Per-refund breakdown: items refunded, quantities, refund reasons, and totals. - Available for download from the order edit screen. ### ๐Ÿ“ฆ Packing Slips - Pricing-free shipping document for warehouse use โ€” shows product name, SKU, variant options, and quantity. - Ship-from and ship-to address blocks included. - Enable via Advanced settings; appears on order edit screen and customer My Account. ### ๐Ÿ“‘ Proforma Invoices - Issue preliminary quotes or pre-payment invoices for pending, on-hold, or processing orders. - Clearly displays proforma numbering, estimation notes, and payment instructions. - Enable via Advanced settings; downloadable from admin order details and customer account. ### ๐Ÿšš Delivery Notes - Warehouse dispatch and fulfillment proof document with recipient address, shipping method, and items checklist. - Includes a dedicated Proof of Delivery (POD) signature and receiver acknowledgment block. - Enable via Advanced settings; downloadable from admin order details. ### โšก Multi-Document Bulk Generation - Bulk actions dropdown on the WooCommerce Orders table: - `Generate PDF Invoices` - `Generate Packing Slips` - `Generate Delivery Notes` - `Generate Proforma Invoices` - **Background processing via Action Scheduler** โ€” generates individual PDFs and bundles them into a downloadable ZIP without PHP timeouts. - Synchronous fallback for sites without Action Scheduler. ### ๐Ÿ“ Configurable Instructions & Sticky Footer - **Instructions Block**: Document body instructions with customizable heading (e.g. Instructions, Payment Instructions, Bank Details) and formatted text. - **Sticky Bottom Footer**: Cleanly anchored to the bottom of the page across all 8 PDF templates, supporting dynamic `{year}` placeholder. - **Subtle Branding**: Permanent `Built using VeloX` credit at reduced 5.5pt font size linked to veloxsoft.net. ### ๐Ÿ’ง Custom Watermarks - Subtle diagonal watermark text across PDF documents (e.g. PAID, DRAFT, CONFIDENTIAL). - Customizable text and optional filter to only apply watermarks on confirmed paid orders. ### ๐ŸŽจ Invoice Templates - **4 built-in templates**: Default, Modern, Classic, Colorful. - **Live preview** in the settings panel before applying. - **Override-safe**: template variables are injected at render time โ€” no class coupling, easy to extend with custom templates via the `pdfinvx_templates` filter. ### ๐Ÿ“ง Email Attachments - Attach PDF invoices to any WooCommerce transactional email โ€” fully configurable per email type. - Dedicated **Send Invoice to Customer** button on the order edit screen. ### ๐Ÿงพ VAT / GST & Compliance - Display your **store VAT or GST registration number** on every invoice. - Optional **customer VAT / GST field** at checkout, stored to order meta and printed on the invoice. - **Paper size** selector: A4, Letter, or Legal. - **WooCommerce HPOS** (High-Performance Order Storage) compatible with dual nonce verification. - **Fully translatable** โ€” includes a complete `.pot` file with 100+ strings. --- ### Why VeloX Invoices? Most WooCommerce invoice plugins charge $49โ€“$99/year for features like credit notes, packing slips, VAT fields, or bulk exports. VeloX Invoices provides all of these for free, with clean code that follows WordPress and WooCommerce coding standards. - โœ… No subscription or licence fee - โœ… HPOS compatible - โœ… Works with WooCommerce Subscriptions - โœ… Action Scheduler integration for large stores - โœ… Plugin Check (PCP) compliant --- == Installation == 1. Upload the plugin ZIP via **Plugins > Add New > Upload Plugin**. 2. Click **Activate Plugin**. 3. Navigate to **WooCommerce > VeloX Invoices** to configure General, Template, Email, and Advanced settings. 4. Ensure `wp-content/uploads/pdf-invoicex/` is writable by the web server. **Requires**: WooCommerce 6.0+, PHP 7.4+. == Frequently Asked Questions == = What happened to PDF InvoiceX? = PDF InvoiceX has been rebranded as **VeloX Invoices** as part of the VeloX e-commerce ecosystem. All existing settings, numbering sequences, templates, and configurations continue to work seamlessly without interruption. = Why am I seeing "Failed to generate PDF"? = Check the following: - The `wp-content/uploads/pdf-invoicex/` directory must be writable by the web server. - PHP memory limit should be at least 128 MB (mPDF recommendation). - Enable `WP_DEBUG` and check `wp-content/debug.log` for a detailed error message. = How do I create a custom invoice template? = Copy any built-in template from the plugin's `templates/` folder to your theme folder, then register it: ```php add_filter( 'pdfinvx_templates', function( $templates ) { $templates['my-template'] = array( 'name' => __( 'My Template', 'pdf-invoicex' ), 'image' => get_theme_file_uri( 'pdf-invoicex/my-template.jpg' ), 'description' => __( 'Custom invoice template.', 'pdf-invoicex' ), ); return $templates; } ); ``` Then select it under **WooCommerce > VeloX Invoices > Template**. = Can I attach invoices to specific WooCommerce emails? = Yes. Go to **WooCommerce > VeloX Invoices > Emails** and tick the emails you want the PDF attached to (e.g. Completed Order, Processing Order). = Does it support HPOS (High-Performance Order Storage)? = Yes. The plugin is fully compatible with WooCommerce HPOS (custom order tables). = Does it work with WooCommerce Subscriptions? = Yes. Invoices are automatically generated for subscription renewal orders. = How do I generate documents in bulk? = In **WooCommerce > Orders**, select the desired orders, choose **Generate PDF Invoices**, **Generate Packing Slips**, **Generate Delivery Notes**, or **Generate Proforma Invoices** from the Bulk Actions dropdown, and click Apply. A ZIP file containing the individually generated PDF files will be downloaded (or processed in the background via Action Scheduler for large batches). = Can I preview PDFs without leaving the orders page? = Yes. Click the ๐Ÿ‘๏ธ **View** icon or the invoice number link in the Orders list (or the view icon in the single order metabox) to open the PDF preview modal overlay. Inside the modal, you can review the document, print it with 1-click via the Print button, or download it. = How do I reset the invoice counter? = Go to **WooCommerce > VeloX Invoices > Advanced**, scroll to **Invoice Numbering**, enter the value in **Reset Counter To**, and click **Apply Reset**. == Screenshots == 1. **General Settings** โ€” Upload your logo, set store address, invoice numbering prefix/suffix, instructions heading & text, and sticky footer. 2. **Template Selection** โ€” Choose from four built-in templates with a live preview modal. 3. **Email Settings** โ€” Select which WooCommerce emails should include the PDF invoice attachment. 4. **Advanced Settings** โ€” Configure VAT/GST, paper size, automation triggers, credit notes, packing slips, delivery notes, and proformas. 5. **Order Edit Screen** โ€” Download, view in modal, send, or regenerate the invoice; download packing slips, delivery notes, and proformas. 6. **Orders List** โ€” Invoice status column with number badge, quick view/download buttons, 1-click generate button, and bulk actions. 7. **My Account** โ€” Customers can download or view their invoice, packing slip, and proforma. 8. **Thank You Page** โ€” Download or view invoice immediately after checkout. == Changelog == = 2.5.0 = * New: Rebranding to VeloX โ€“ PDF Invoices, Credit Notes and Packing Slips for WooCommerce. * New: Modern Orders List UI โ€” status column with formatted invoice number badge, quick ๐Ÿ‘๏ธ View & โฌ‡๏ธ Download buttons, and a 1-click on-the-fly [ โž• Generate ] button with live cell updates. * New: In-Page PDF Preview Modal โ€” full-page document overlay with direct ๐Ÿ–จ๏ธ Print (`iframe` window print) and Download controls. * New: Proforma Invoices โ€” quotation and pre-payment documents for pending, on-hold, or draft orders. * New: Delivery Notes โ€” fulfillment proof documents with shipping details, item checklist, and receiver signature acknowledgment. * New: Expanded Multi-Document Bulk Actions โ€” bulk generate Invoices, Packing Slips, Delivery Notes, and Proforma Invoices with Action Scheduler asynchronous ZIP download. * New: Instructions & Sticky Footer Separation โ€” separate settings for document body Instructions (with configurable heading) and page-bottom sticky Footer with `{year}` dynamic placeholder. * New: Custom Watermark support โ€” configurable watermark text (e.g. PAID, DRAFT, CONFIDENTIAL) with opacity and paid-order filtering. * New: Permanent Subtle Credit โ€” linked `Built using VeloX` credit at reduced 5.5pt font size across all templates. * Tweak: Security Hardening โ€” dual nonce verification supporting both AJAX actions and direct streaming URL links. * Tweak: Compatibility โ€” declared official compatibility with WooCommerce High-Performance Order Storage (HPOS) and Cart & Checkout Blocks. = 2.1.1 = * Fix: Refund Email Attachments โ€” attach credit note PDF instead of original invoice on customer refund emails (customer_refunded_order and customer_partially_refunded_order). * New: Attachment Routing Filters โ€” added pdfinvx_credit_note_email_ids and pdfinvx_email_attachment_doc_type filters for custom email attachment routing. * Tweak: WordPress Compatibility โ€” tested and verified up to WordPress 7.1. = 2.1.0 = * Fix: Support custom template overrides in theme and child theme directories via locate_template(). * Fix: Enable mPDF cURL insecure SSL requests to resolve local/staging logo display issues. * Fix: Remove missing default-logo.png fallback; gracefully display store name when no logo is set. * Fix: Preserve logo natural aspect ratios across all templates to prevent squashed logos. * Fix: Enable invoice, credit note, and packing slip access for refunded orders. * New: Add pdfinvx_eligible_order_statuses filter to allow custom order statuses for document generation. = 2.0.0 = * New: Credit note document type โ€” auto-generated on refund, with per-refund item breakdown. * New: Packing slip document type โ€” warehouse-friendly, no pricing, with ship-from/to address blocks. * New: Advanced settings tab โ€” VAT/GST number, paper size (A4/Letter/Legal), document type toggles, automation triggers, and yearly counter reset. * New: Store VAT / GST registration number displayed on all invoices. * New: Optional customer VAT / GST field at WooCommerce checkout. * New: Automatic invoice generation on configurable order status change. * New: "Send Invoice to Customer" button on order edit screen (prevents duplicate sends). * New: "Regenerate Invoice" button on order edit screen (bypasses cache). * New: Invoice status column on orders list โ€” shows invoice number or a generate shortcut (classic WP_Query + HPOS). * New: Inline PDF viewer โ€” "View Invoice" opens in a new tab from admin, My Account, and Thank You page. * New: Thank You / order-received page shows Download and View Invoice buttons. * New: Packing slip and credit note download buttons on My Account order detail. * New: Background bulk generation via Action Scheduler โ€” no PHP timeouts on large stores. * New: Synchronous ZIP fallback when Action Scheduler is unavailable. * New: File-based PDF cache in `uploads/pdf-invoicex/` with cache invalidation on order update. * New: WooCommerce Subscriptions support โ€” invoice generated for renewal orders. * New: Yearly invoice counter reset with year-prefixed numbering (e.g. 2025-000001). * New: One-time next-invoice-number override (clears after first use). * New: Complete `.pot` translation catalog (100+ strings). * Fix: Double email attachment caused by duplicate hook registration. * Fix: Multi-item orders clipped at page break โ€” mPDF autoPageBreak now enabled. * Fix: Templates coupled to class via `$this->` โ€” now use injected variables, safe to override. * Fix: Temporary PDF files leaked after email attachment. * Fix: `getimagesize()` fatal on remote logo URLs โ€” replaced with HTML onerror fallback. * Fix: Invoice date used current time instead of actual payment/completion date. * Fix: Generic `order_id` query variable conflicted with other plugins โ€” renamed to `pdfinvx_order_id`. = 1.0.0 = * Initial release: PDF invoice generation, admin and frontend downloads, email attachments, bulk ZIP, and template settings. == License == This plugin is licensed under the GPLv2 or later. See the `LICENSE` file for details.