Changelog
All notable changes are documented here. The format follows Keep a Changelog. Semantic Versioning applies.
[1.1.0] โ 2025-06-01
Added
Seller override per rule
Individual invoice rules can now override the seller name, NIP, address, and bank account on a per-rule basis. Previously the seller block was a single global setting. This is particularly useful for WooCommerce Multisite installations with separate trading names, VAT registrations, or bank accounts per site. For single-site stores with multiple product lines invoiced under different entities, this also enables clean separation without multiple plugin installations.
To configure: open any invoice rule, scroll to "Seller Override", enable the toggle, and fill in the fields you want to override. Blank fields inherit the global setting.
WP-CLI wp fakturownia audit command
A new compliance audit command scans historical orders and reports potential invoicing issues. It checks for:
- Orders in a configured "should have invoice" status range with no invoice generated
- Invoices with missing NIP on orders where a NIP was present in the order meta
- Invoices with missing GTU codes for product types that have GTU codes configured
- Orders meeting the MPP threshold (PLN 15,000) that lack the Split Payment annotation
- OSS-eligible orders (destination country outside Poland) with incorrect VAT annotation
Run the audit with:
wp fakturownia audit --date-from="2025-01-01" --date-to="2025-03-31"Output is a table showing order IDs, issue types, and recommended actions. Use --format=csv for a spreadsheet-compatible export.
fakturownia_pro_document_type filter
A new WordPress filter hook allows code-level override of the document type per order, without modifying rule configuration. Example usage:
add_filter( 'fakturownia_pro_document_type', function( $type, $order ) {
// Use "paragon" for COD orders under 450 PLN
if ( $order->get_payment_method() === 'cod' && $order->get_total() < 450 ) {
return 'paragon';
}
return $type;
}, 10, 2 );This filter is evaluated after rule matching and before API submission. It is the recommended way to handle edge cases that rule conditions cannot express cleanly.
Action Scheduler integration
Bulk invoice generation now uses WooCommerce Action Scheduler for background processing instead of direct WP-Cron scheduling. This change improves reliability on high-traffic stores โ WP-Cron's single-threaded execution caused bulk jobs to queue behind each other and sometimes time out on large batches. Action Scheduler uses a persistent queue with parallel runners and retry logic.
After upgrading, you can monitor bulk generation progress in WooCommerce โ Action Scheduler (filter by group fakturownia_pro).
FAKTUROWNIA_BULK_BATCH_SIZE constant
Defines the number of orders processed per Action Scheduler batch. Default: 25. Increase on servers with 512MB+ PHP memory limit; decrease on constrained environments. Add to wp-config.php:
define( 'FAKTUROWNIA_BULK_BATCH_SIZE', 10 );Improved
- Debug log now includes the full Fakturownia API response body on error, not just the HTTP status code. Previously
HTTP 422in the log required a support ticket to determine the actual error; now the error body (e.g.,{"error":"buyer_nip_invalid"}) is logged directly. - Retry queue now shows estimated retry time in the order meta box. Previously the meta box showed "Retry scheduled" with no indication of when. The next scheduled retry time is now displayed.
- "Regenerate Invoice" button in the order meta box is now available even when no previous invoice exists. Previously the button only appeared after a successful generation. It now appears for all orders in a triggerable status, functioning as "Generate Invoice" for orders with no invoice.
Fixed
- Partial refund credit notes incorrectly included the full shipping cost when the refund excluded shipping. The refund object from WooCommerce was being read for line items but the shipping line was always pulled from the original order total rather than the refund. Fixed.
- NIP field at checkout was not visible on checkout pages using the Blocks-based WooCommerce checkout (WooCommerce Blocks v12+). The field was registered via the legacy
woocommerce_review_order_before_paymenthook, which is not called in the Blocks checkout. Fixed by registering an additional endpoint viawoocommerce_blocks_checkout_order_processed. - Memory leak in bulk generation when processing orders with 100 or more line items. The order objects were not released from memory between iterations. Fixed with explicit
unset()calls per order iteration.
After Upgrading to 1.1.0
Bulk generation now uses Action Scheduler. If you have pending bulk jobs that were created with the old WP-Cron mechanism and have not yet run, they will not migrate automatically โ they will either run on the next WP-Cron execution or can be cleared and re-triggered from the bulk action in the WooCommerce orders list.
No database migrations required. Existing invoices and rule configurations are unaffected.
[1.0.0] โ 2024-03-01
Initial release of Fakturownia Pro for WooCommerce.
Added
- API integration โ Full REST API connection to Fakturownia.pl with token-based authentication and live connection test
- Per-status invoice rules โ Configurable rules for all standard WooCommerce statuses and custom statuses registered by third-party plugins
- Document types โ VAT invoices (Faktura VAT), receipts (Paragon), pro forma invoices, credit notes (Korekta), and bills (Rachunek)
- Rule conditions โ Filter rules by payment method, customer type (B2B/B2C), and order total range
- HPOS compatibility โ Full WooCommerce High-Performance Order Storage support with automatic detection and compatibility mode handling
- Payment gateway mapping โ Default mappings for Stripe, PayPal, Przelewy24, Dotpay, BACS, COD, BLIK, TPay; custom gateway support
- PDF email attachment โ Per-email-type attachment for Order Processing, Order Complete, and custom status emails
- My Account invoices tab โ Customer-facing invoice history with on-demand PDF download in the WooCommerce My Account area
- NIP field at checkout โ Optional B2B NIP field with format validation (checksum algorithm), optional VIES cross-check, and customer account pre-fill
- Split Payment (MPP) โ Automatic annotation for invoices above PLN 15,000 with multi-currency PLN conversion
- GTU codes โ Per-product GTU code assignment (product meta box) with per-line-item inclusion on invoice payloads
- EU OSS support โ Invoice annotation for stores registered under EU OSS; reads destination country VAT rate from WooCommerce Tax output
- Reverse Charge โ Automatic RC annotation for intra-EU B2B orders with VIES-validated VAT numbers
- Retry queue โ Failed API calls automatically retried via WP-Cron (3 retries, 5-minute intervals); admin notification on permanent failure
- Bulk generation โ Bulk action on WooCommerce orders list and WP-CLI
wp fakturownia generatecommand - WP-CLI commands โ
wp fakturownia generate,wp fakturownia process-queue,wp fakturownia reindex - Order meta box โ Invoice number, type, generation timestamp, view/download link, and regenerate button on every order detail page
- Orders list column โ Invoice status column showing generated invoice number or pending/failed badge
- Debug logging โ API request/response logging to WooCommerce log system under
fakturownia-prohandle - WP Settings API โ All settings stored via WordPress Settings API under
fakturownia_pro_settings; export/import via WP-CLI - Developer hooks โ
fakturownia_pro_should_generate,fakturownia_pro_buyer_data,fakturownia_pro_document_typefilters;fakturownia_pro_generate_documentaction
Compatibility
- WordPress: 6.3 โ 6.5
- WooCommerce: 8.0 โ 9.x
- PHP: 8.1 โ 8.2
- Tested with HPOS enabled and disabled
- Tested with Stripe, PayPal, Przelewy24, Dotpay, COD, and BACS gateways
- Tested with WooCommerce Subscriptions, WooCommerce Blocks checkout, and WooCommerce Multisite