{"id":333214,"date":"2026-07-04T02:41:10","date_gmt":"2026-07-04T02:41:10","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/australcode-bsale-for-woocommerce\/"},"modified":"2026-07-04T02:40:36","modified_gmt":"2026-07-04T02:40:36","slug":"australcode-dte-stock-sync-bsale","status":"publish","type":"plugin","link":"https:\/\/cn.wordpress.org\/plugins\/australcode-dte-stock-sync-bsale\/","author":23459699,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"3.7.3","stable_tag":"3.7.3","tested":"7.0","requires":"6.0","requires_php":"7.4","requires_plugins":null,"header_name":"Australcode DTE & Stock Sync for Bsale","header_author":"Australcode","header_description":"Integraci\u00f3n entre WooCommerce y Bsale para Chile. Sincroniza productos, stock y precios, y emite documentos tributarios electr\u00f3nicos (boleta, factura, NC, gu\u00eda).","assets_banners_color":"0f1110","last_updated":"2026-07-04 02:40:36","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/bsale.australcode.io","header_author_uri":"https:\/\/australcode.io","rating":0,"author_block_rating":0,"active_installs":0,"downloads":36,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"3.7.3":{"tag":"3.7.3","author":"australcode","date":"2026-07-04 02:40:36"}},"upgrade_notice":{"3.7.3":"<p>Security hardening: late output escaping in admin UI components and a defensive callback guard. No functional change. Safe update for all sites.<\/p>","3.5.0":"<p>New: the Traceability screen opens with an at-a-glance stock-health verdict and a 24-hour reliability sparkline. Backward-compatible, no data changes. Safe update for all sites.<\/p>","3.4.4":"<p>Compatibility fix: resolves a potential PHP 7.4 fatal in webhook handling (str_starts_with is PHP 8.0+). Recommended for any site on PHP 7.4.<\/p>","3.4.3":"<p>Reliability fix: WP-CLI command registration is now null-safe against an unloaded licensing SDK. No functional changes. Safe update for all sites.<\/p>","3.4.2":"<p>Spanish (Chile) polish in the Upgrade panel and status labels, mobile-friendly configuration tables, consistent brand color and motion, plus packaging hygiene. Presentation-only, no functional changes. Safe update for all sites.<\/p>","3.4.1":"<p>Internal cleanup: transactional email styles are now centralized (no functional change; notification emails look the same, with one alert box tweaked to a consistent green). Safe update for all sites.<\/p>","3.4.0":"<p>Fixes a data-loss edge case: saving Settings on a Free\/lapsed license no longer clears saved Pro configuration. Also refreshes the Pro upsell on gated multi-control blocks. Recommended for all sites.<\/p>","3.3.2":"<p>Visual consistency polish: residual admin styles now match the Admin Kit&#039;s neutrals, radii and motion. Presentation-only, no functional changes. Safe update for all sites.<\/p>","3.3.1":"<p>Minor polish: Settings mapping tables are now mobile-friendly and transactional emails match the Australcode green branding. No functional changes. Safe update for all sites.<\/p>","3.3.0":"<p>Admin UI refresh: all screens now share one consistent Australcode design system. No functional changes \u2014 same data, same actions, cleaner and more coherent look. Recommended for all sites.<\/p>","3.2.0":"<p>Pro licensing moved to Freemius (Merchant of Record). Your active Pro license stays valid and all Free\/Pro features are unchanged \u2014 activation, renewals and account management now use the native Freemius experience. No action required for existing customers.<\/p>","3.1.4":"<p>Reliability release: the Repair-mappings tool preserves 1:N mappings, the Logs screen groups repeated events with a connection shortcut, stock audits resume after interruption, and API pagination gains a runaway safety cap. Recommended for all sites.<\/p>","3.1.3":"<p>Compliance and admin UI polish: clears the WP 6.7 translation-timing notice and a checkout escaping warning, refreshes the admin design (unified headers, redesigned Stock Traceability) and removes decorative emoji. Recommended for all sites.<\/p>","3.1.2":"<p>Product audit now badges private-status products in the unmapped list so they no longer read as problems. Presentation-only, audit coverage unchanged. Safe update for all sites.<\/p>","3.1.1":"<p>Critical follow-up to 3.1.0: product sync no longer creates a spurious mapping to the wrong Bsale variant for simple products mapped to multi-variant items. Recommended for all sites on 3.1.0.<\/p>","3.1.0":"<p>Critical sync fix: simple products mapped to multi-variant Bsale items no longer get the wrong variant stock or price. Also fixes Block-checkout RUT validation, silent transfer-guide failures, duplicate webhook mappings, and partial credit-note matching.<\/p>","3.0.8":"<p>WP.org Plugin Check pass: release ZIP now ships clean (dev artifacts excluded), nonce annotations tightened on WooCommerce checkout reads, Upgrade Notices trimmed to fit display limit. No functional change.<\/p>","3.0.7":"<p>Simplification: the 3.0.6 <code>sku_locked<\/code> flag is removed. WooCommerce SKU is permanently the matching key and is never overwritten by Bsale. Column dropped automatically. SKU-primary lookup and 1:N propagation preserved.<\/p>","3.0.6":"<p><strong>Behavior change<\/strong>: WooCommerce SKUs are no longer overwritten by Bsale during sync. Manual and scheduled product syncs now propagate to ALL WooCommerce products sharing a Bsale variant SKU (1:N), matching stock\/price webhook behavior.<\/p>","3.0.5":"<p>Polish release: dashboard activity table collapses to cards on mobile, completes brand-override cleanup, &quot;Limpiar hu\u00e9rfanos&quot; marked danger-outline, &quot;\u00daltima auditor\u00eda&quot; stat in monospace, ~40 inline styles extracted. No functional changes.<\/p>","3.0.4":"<p>Polish release: WP.org Plugin Check now reports 0 errors, regenerated .pot, single primary CTA on Products, brand-colored buttons on Traceability, fixed mobile mid-word truncation, and one Spanish string moved to neutral conjugation. No functional changes, no manual steps.<\/p>","3.0.3":"<p>Fixes the rebrand migration so a stored Pro license (and traceability history) is reconnected after upgrading; some sites reverted to free in 3.0.0\u20133.0.2. Idempotent, automatic, no manual steps.<\/p>","3.0.2":"<p>Ensures the Bsale token and webhook secret are encrypted at rest even on a clean activation (in 3.0.1 this only happened on a version upgrade). Idempotent, no functional changes, no manual steps.<\/p>","3.0.1":"<p>Security + robustness hardening (anti-SSRF on webhook fetch, encrypted Bsale credentials at rest, validated webhook bootstrap, no duplicate documents on retry, API circuit breaker, webhook de-duplication). No functional changes. Recommended before going live.<\/p>","3.0.0":"<p>Rebrand to Australcode Bsale. Existing data migrates automatically and in place on upgrade; the Bsale webhook URL is unchanged, so stock sync keeps working. No manual steps required.<\/p>","2.53.0":"<p>Fixes an emission lock collision so two orders emitting the same document type at the same time no longer block each other. Recommended for high-volume stores.<\/p>","2.52.0":"<p>Introduces Free \/ Pro split. Free keeps all essentials; Pro adds auto-emission, multi-office and B2B features. If you used Pro-only features before, activate a license to keep them. Your configuration is preserved.<\/p>","2.51.16":"<p>This is a stability and traceability improvement release. Recommended for all users.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3595667,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3595667,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3595667,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3595667,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["3.7.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3595667,"resolution":"1","location":"assets","locale":"","width":2560,"height":1908},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3595667,"resolution":"2","location":"assets","locale":"","width":2560,"height":1908},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3595667,"resolution":"3","location":"assets","locale":"","width":2560,"height":1154},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3595667,"resolution":"4","location":"assets","locale":"","width":2560,"height":957},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3595667,"resolution":"5","location":"assets","locale":"","width":2560,"height":557}},"screenshots":{"1":"Plugin dashboard with sync status, stock health, and recent activity.","2":"Configuration page with Bsale API connection, default office, and document type preferences.","3":"Order metabox with Bsale document status, PDF link, and re-emit controls.","4":"Stock audit interface showing discrepancies between WooCommerce and Bsale.","5":"Upgrade page showing the Pro features (Australcode Bsale &rarr; Upgrade)."}},"plugin_section":[],"plugin_tags":[199368,259495,212280,265688,286],"plugin_category":[45],"plugin_contributors":[265691],"plugin_business_model":[],"class_list":["post-333214","plugin","type-plugin","status-publish","hentry","plugin_tags-boleta","plugin_tags-bsale","plugin_tags-facturacion-electronica","plugin_tags-sii","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-australcode","plugin_committers-australcode"],"banners":{"banner":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/banner-772x250.png?rev=3595667","banner_2x":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/banner-1544x500.png?rev=3595667","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/icon-128x128.png?rev=3595667","icon_2x":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/icon-256x256.png?rev=3595667","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/screenshot-1.png?rev=3595667","caption":"Plugin dashboard with sync status, stock health, and recent activity."},{"src":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/screenshot-2.png?rev=3595667","caption":"Configuration page with Bsale API connection, default office, and document type preferences."},{"src":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/screenshot-3.png?rev=3595667","caption":"Order metabox with Bsale document status, PDF link, and re-emit controls."},{"src":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/screenshot-4.png?rev=3595667","caption":"Stock audit interface showing discrepancies between WooCommerce and Bsale."},{"src":"https:\/\/ps.w.org\/australcode-dte-stock-sync-bsale\/assets\/screenshot-5.png?rev=3595667","caption":"Upgrade page showing the Pro features (Australcode Bsale &rarr; Upgrade)."}],"raw_content":"<!--section=description-->\n<p><strong>Australcode DTE &amp; Stock Sync<\/strong> makes SII-compliant tax document emission (boletas, facturas, credit notes, dispatch guides) automatic for any WooCommerce store in Chile. Real-time sync of products, stock and prices from Bsale to WooCommerce. The Free version already includes real-time webhook stock updates, credit notes, and on-demand stock audit \u2014 with no per-document or per-boleta fees. Mature plugin in production since 2023, now part of the Australcode family.<\/p>\n\n<p>It covers the full lifecycle of a Chilean e-commerce transaction: from product catalog sync to manual or automatic emission of the SII-compliant tax document required for each WooCommerce order.<\/p>\n\n<p><em>Australcode is an independent developer. This plugin is a third-party integration for Bsale and WooCommerce; it is not affiliated with, endorsed by, or sponsored by Bsale, Defontana SpA, or the WooCommerce\/Automattic trademark holders.<\/em><\/p>\n\n<h4>Free version<\/h4>\n\n<p>Everything you need to run a typical Chilean e-commerce store with WooCommerce + Bsale:<\/p>\n\n<ul>\n<li><strong>Product sync<\/strong> \u2014 One-way synchronization from Bsale to WooCommerce. Imports product catalog including variants, SKUs, prices, and stock levels.<\/li>\n<li><strong>Single-office stock<\/strong> \u2014 Stock from one configured Bsale office, with optional reserve buffer for in-person sales.<\/li>\n<li><strong>Real-time stock updates via webhooks<\/strong> \u2014 Bsale stock changes propagate to WooCommerce in seconds.<\/li>\n<li><strong>Manual emission of boleta and factura<\/strong> \u2014 Issue documents from the order admin screen. Document type auto-detected from customer billing data (RUT empresa \u2192 factura, otherwise boleta).<\/li>\n<li><strong>Credit notes (notas de cr\u00e9dito)<\/strong> \u2014 Manual emission for refunds.<\/li>\n<li><strong>Chilean checkout fields<\/strong> \u2014 Adds RUT field with module-11 validation. Compatible with both Block-based Checkout and Classic Checkout.<\/li>\n<li><strong>Order metabox<\/strong> \u2014 Per-order Bsale status, PDF link, document type, and re-emit controls.<\/li>\n<li><strong>Email PDF to customer<\/strong> \u2014 Automatic dispatch of the emitted document to the customer's email.<\/li>\n<li><strong>Stock audit (on-demand)<\/strong> \u2014 Run-when-needed audit comparing WooCommerce and Bsale stock. Discrepancy detection and traceability.<\/li>\n<li><strong>Diagnostics<\/strong> \u2014 Dashboard with API\/webhook status, logs viewer with filters and retention policy, traceability ledger (read-only).<\/li>\n<li><strong>HPOS compatible<\/strong> \u2014 Declares compatibility with WooCommerce High-Performance Order Storage and Cart\/Checkout Blocks.<\/li>\n<\/ul>\n\n<h4>Pro version<\/h4>\n\n<p>Adds workflow automation, multi-warehouse support, and advanced B2B features:<\/p>\n\n<ul>\n<li><strong>Auto-emission post-payment<\/strong> \u2014 Documents emitted automatically when WooCommerce orders reach configurable statuses (processing, completed, etc.). The killer time-saver.<\/li>\n<li><strong>Multi-office stock aggregation<\/strong> \u2014 Sum stock across multiple Bsale offices.<\/li>\n<li><strong>Stock transfer modes<\/strong> \u2014 Auto-move stock to main office via internal transfer or dispatch guide (gu\u00eda de despacho) when an order requires stock from a secondary office.<\/li>\n<li><strong>Sales notes (nota de venta) + automatic credit notes from refunds<\/strong> \u2014 Full B2B workflow automation.<\/li>\n<li><strong>Dispatch guides (gu\u00edas de despacho)<\/strong> \u2014 Inter-office stock transfers with electronic dispatch document.<\/li>\n<li><strong>Dynamic document attributes<\/strong> \u2014 Custom attributes (e.g. WooCommerce order number) injected into each emitted document.<\/li>\n<li><strong>Scheduled audits<\/strong> \u2014 Up to 3 daily automatic audit runs comparing WooCommerce \u2194 Bsale stock, with optional auto-correction and email notifications.<\/li>\n<li><strong>Custom field mapping<\/strong> \u2014 Map WooCommerce custom checkout fields (from third-party plugins) to Bsale invoice fields (rut_empresa, raz\u00f3n social, giro, direcci\u00f3n, comuna, ciudad).<\/li>\n<li><strong>Stock-per-office display on frontend<\/strong> \u2014 Optional product page widget showing available stock per office.<\/li>\n<li><strong>Per-shipping-method office routing<\/strong> \u2014 Emit documents from a specific Bsale office based on the WooCommerce shipping method (multi-warehouse).<\/li>\n<li><strong>Daily auto-link by SKU<\/strong> \u2014 Cron job that auto-links unlinked WooCommerce products to Bsale variants by SKU match.<\/li>\n<\/ul>\n\n<h4>Pricing<\/h4>\n\n<p>Pro is sold as an annual subscription with 1 site activation per license. Multi-site licenses available.<\/p>\n\n<p>Learn more and purchase at https:\/\/bsale.australcode.io<\/p>\n\n<h4>Requirements<\/h4>\n\n<ul>\n<li>WooCommerce 7.0 or later<\/li>\n<li>A Bsale account with API access<\/li>\n<li>WordPress 6.0 or later, PHP 7.4 or later<\/li>\n<\/ul>\n\n<h4>Bsale<\/h4>\n\n<p>Bsale is a Chilean SaaS platform for POS, inventory, and electronic tax document emission compliant with SII (Servicio de Impuestos Internos, the Chilean tax authority). It is the de-facto choice for many Chilean small and medium e-commerce businesses to handle their day-to-day operations and tax compliance.<\/p>\n\n<p>This plugin is an unaffiliated third-party integration. \"Bsale\" is a trademark of its respective owner.<\/p>\n\n<h3>External services<\/h3>\n\n<p>This plugin connects to two third-party services. Both are used only for the features described, and only as a result of an action you take (entering your Bsale API token, or activating a Pro license). No data is sent on a fresh install before you configure these features.<\/p>\n\n<h4>Bsale API (bsale.io \/ bsale.cl)<\/h4>\n\n<p>What it is: Bsale is the Chilean POS and electronic invoicing platform this plugin integrates with. The plugin is an unaffiliated third-party integration.<\/p>\n\n<p>Data sent and when:<\/p>\n\n<ul>\n<li>Your Bsale API access token is sent with every request, to authenticate.<\/li>\n<li>Product, variant, SKU, price and stock queries are sent when you sync your catalog or when Bsale stock webhooks arrive.<\/li>\n<li>When a tax document is emitted (boleta, factura, credit note, dispatch guide), the order data required by the SII (customer RUT, raz\u00f3n social, line items, amounts) is sent to Bsale so it can issue the legal document.<\/li>\n<\/ul>\n\n<p>This happens because the plugin's purpose is to mirror your Bsale catalog into WooCommerce and to emit SII-compliant documents through Bsale. The connection is configured by you: you enter your own Bsale API token under \"Australcode Bsale \u2192 Configuraci\u00f3n\".<\/p>\n\n<ul>\n<li>Terms of Service: https:\/\/www.bsale.cl\/sheet\/condiciones-uso<\/li>\n<li>Privacy Policy: https:\/\/www.bsale.cl\/sheet\/politica-privacidad<\/li>\n<\/ul>\n\n<h4>Freemius (freemius.com)<\/h4>\n\n<p>What it is: Freemius is the Merchant of Record and licensing provider used to manage the optional Pro license (checkout, activation, account, and updates).<\/p>\n\n<p>Data sent and when:<\/p>\n\n<ul>\n<li>When you opt in (optional \u2014 you can skip it), your admin email and site URL are sent to Freemius so it can manage your account and license. The plugin is fully functional without opting in.<\/li>\n<li>Your license key and site URL are sent to Freemius when you activate, validate, or deactivate a Pro license through the native Freemius account screens, and periodically while a Pro license is active to re-check its status and deliver updates.<\/li>\n<li><p>The free version does not require an account and works without contacting Freemius.<\/p><\/li>\n<li><p>Terms of Service: https:\/\/freemius.com\/terms\/<\/p><\/li>\n<li>Privacy Policy: https:\/\/freemius.com\/privacy\/<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin folder to <code>\/wp-content\/plugins\/australcode-bsale<\/code>.<\/li>\n<li>Activate the plugin from the WordPress admin \"Plugins\" menu.<\/li>\n<li>Navigate to <strong>Australcode Bsale \u2192 Configuration<\/strong>.<\/li>\n<li>Enter your Bsale API access token (available in your Bsale account).<\/li>\n<li>Select your default office (sucursal) and configure document type preferences.<\/li>\n<li>Configure the Bsale webhook URL in your Bsale account to enable real-time stock updates.<\/li>\n<\/ol>\n\n<p>To unlock Pro features, go to <strong>Australcode Bsale \u2192 Upgrade<\/strong> and complete checkout through Freemius. Your Pro license activates automatically after purchase.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"do%20i%20need%20a%20bsale%20account%3F\"><h3>Do I need a Bsale account?<\/h3><\/dt>\n<dd><p>Yes, you need an active Bsale account with API access. The plugin connects to your existing Bsale account via API token.<\/p><\/dd>\n<dt id=\"what%27s%20the%20difference%20between%20free%20and%20pro%3F\"><h3>What's the difference between Free and Pro?<\/h3><\/dt>\n<dd><p>Free covers everything a typical Chilean e-commerce store needs: product\/stock sync, manual emission of boletas and facturas, RUT validation, single-office stock, on-demand audit, real-time webhook updates. Pro adds workflow automation (auto-emission post-payment, scheduled audits, daily SKU auto-link), multi-warehouse support (multi-office stock aggregation, stock transfer between offices, per-shipping-method routing), and advanced B2B features (custom field mapping, dynamic document attributes, sales notes, automatic credit notes from refunds). The Pro features are distributed as a separate plugin (from australcode.io) and are not included in this free version.<\/p>\n\n<p>See the <a href=\"https:\/\/bsale.australcode.io\">Pro page<\/a> for the full comparison.<\/p><\/dd>\n<dt id=\"can%20i%20move%20from%20free%20to%20pro%20without%20losing%20my%20configuration%3F\"><h3>Can I move from Free to Pro without losing my configuration?<\/h3><\/dt>\n<dd><p>Yes. Your Bsale account connection and general settings (API connection, document types, tax options) are stored independently of the Pro features, so when you move to the Pro version your existing configuration carries over \u2014 no re-entry needed.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20i%20stop%20using%20pro%3F\"><h3>What happens if I stop using Pro?<\/h3><\/dt>\n<dd><p>The free version is fully functional on its own \u2014 it keeps handling product\/stock sync and manual emission of boletas and facturas. The Pro features are provided by the separate Pro version and are not part of this free plugin.<\/p><\/dd>\n<dt id=\"is%20it%20compatible%20with%20the%20woocommerce%20block-based%20checkout%3F\"><h3>Is it compatible with the WooCommerce Block-based Checkout?<\/h3><\/dt>\n<dd><p>Yes, the plugin is compatible with both the Block-based Checkout (WooCommerce 8.0+) and the Classic Checkout. Chilean tax fields (RUT, raz\u00f3n social, giro) are added to both.<\/p><\/dd>\n<dt id=\"can%20i%20emit%20boleta%20or%20factura%20selectively%20per%20order%3F\"><h3>Can I emit boleta or factura selectively per order?<\/h3><\/dt>\n<dd><p>Yes. The order metabox allows manual override of the document type per order, useful for B2B orders where the customer requests a factura instead of a boleta. This works in both Free and Pro.<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20support%20multiple%20bsale%20offices%20%28sucursales%29%3F\"><h3>Does the plugin support multiple Bsale offices (sucursales)?<\/h3><\/dt>\n<dd><p>Yes \u2014 in Pro. Free supports a single configured office. Pro adds multi-office stock aggregation (sum of available units across selected offices) plus stock transfer modes for inter-office logistics.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20a%20tax%20document%20emission%20fails%3F\"><h3>What happens if a tax document emission fails?<\/h3><\/dt>\n<dd><p>Failed emissions are logged with the error reason. The order metabox includes a \"Re-emit\" button to retry manually. The plugin also has an automatic retry mechanism (Pro feature, configurable, opt-in) for transient failures.<\/p><\/dd>\n<dt id=\"is%20the%20plugin%20hpos%20compatible%3F\"><h3>Is the plugin HPOS compatible?<\/h3><\/dt>\n<dd><p>Yes, the plugin declares compatibility with HPOS (High-Performance Order Storage) and uses the WooCommerce data abstraction layer for all order operations.<\/p><\/dd>\n<dt id=\"does%20the%20plugin%20work%20without%20bsale%20%28offline%20mode%29%3F\"><h3>Does the plugin work without Bsale (offline mode)?<\/h3><\/dt>\n<dd><p>No. The plugin is a Bsale integration \u2014 it requires an active Bsale account and API access to function. The plugin's value is precisely the bidirectional sync between WooCommerce and Bsale.<\/p><\/dd>\n<dt id=\"how%20does%20pro%20licensing%20work%3F\"><h3>How does Pro licensing work?<\/h3><\/dt>\n<dd><p>Pro is sold as an annual subscription through Freemius (Merchant of Record). After checkout your Pro license activates automatically; you can manage, sync or deactivate it from the native Freemius account screen. Freemius re-validates the license periodically while it is active. If Freemius is temporarily unreachable, your Pro features keep working \u2014 only an explicit change (refund, revocation, expiration) deactivates them.<\/p><\/dd>\n<dt id=\"where%20can%20i%20find%20the%20plugin%27s%20documentation%3F\"><h3>Where can I find the plugin's documentation?<\/h3><\/dt>\n<dd><p>Visit https:\/\/bsale.australcode.io for plugin documentation, support, and source code.<\/p><\/dd>\n<dt id=\"how%20does%20this%20plugin%20differ%20from%20other%20plugins%20that%20emit%20chilean%20tax%20documents%3F\"><h3>How does this plugin differ from other plugins that emit Chilean tax documents?<\/h3><\/dt>\n<dd><p>Several plugins issue Chilean boletas or facturas from WooCommerce. Australcode Bsale differs on three concrete points:<\/p>\n\n<ul>\n<li><strong>Open-source under GPLv2<\/strong> \u2014 the full source is on WordPress.org. You can audit, modify or fork it freely. No black box, no proprietary backend.<\/li>\n<li><strong>Pro tier sold as an annual subscription via Freemius (Merchant of Record)<\/strong> \u2014 no pay-per-document and no per-boleta fees. Predictable cost at any volume.<\/li>\n<li><strong>Full bidirectional sync with Bsale<\/strong> \u2014 not just emission: also syncs product catalog, multi-office stock, prices, stock audit ledger and movement traceability. Mature plugin in production since 2023.<\/li>\n<\/ul><\/dd>\n<dt id=\"how%20much%20does%20pro%20cost%3F\"><h3>How much does Pro cost?<\/h3><\/dt>\n<dd><p>Pro is sold as an annual subscription with one site activation per license. Multi-site licenses (3, 10, 25 sites) are also available. Current pricing is on <a href=\"https:\/\/bsale.australcode.io\">bsale.australcode.io<\/a>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>3.7.3<\/h4>\n\n<ul>\n<li><strong>Security:<\/strong> late-escape hardening. Action HTML in the admin page-header component and the 24-hour reliability sparkline on the Traceability screen are now filtered through <code>wp_kses()<\/code> with an explicit allowlist at output time (escaping late). Added an <code>is_callable()<\/code> guard before invoking an internal progress callback in the stock sync. No functional or visual change.<\/li>\n<\/ul>\n\n<h4>3.7.2<\/h4>\n\n<ul>\n<li><strong>WordPress.org compliance:<\/strong> the free version no longer includes any Pro feature code or license-based gating. The Pro features (auto-emission, multi-office, stock transfer, scheduled audits, custom field mapping, dynamic attributes, sales notes, dispatch guides, daily SKU auto-link) are fully separated into the Pro version. The free plugin is completely standalone and fully functional on its own.<\/li>\n<\/ul>\n\n<h4>3.6.1<\/h4>\n\n<ul>\n<li><strong>Name:<\/strong> the plugin name and slug no longer include \"WooCommerce\", per WordPress.org's restricted-term policy. The plugin still integrates with and requires WooCommerce (declared via the Requires Plugins header). No functional change.<\/li>\n<\/ul>\n\n<h4>3.6.0<\/h4>\n\n<ul>\n<li><strong>Renamed<\/strong> to \"Australcode DTE &amp; Stock Sync for Bsale\" for a clearer, distinctive name. Same plugin and data \u2014 no action required.<\/li>\n<li><strong>Free \/ Pro packaging:<\/strong> the optional Pro features (workflow automation and multi-warehouse) are not part of this free package and are distributed separately. The free version is fully functional on its own: manual boletas, facturas and credit notes, single-office stock, real-time webhook stock sync, and on-demand stock audit.<\/li>\n<li><strong>Compatibility:<\/strong> declares WooCommerce as a required plugin.<\/li>\n<li><strong>Security:<\/strong> hardened output escaping in a shared admin UI header component.<\/li>\n<\/ul>\n\n<h4>3.5.0<\/h4>\n\n<ul>\n<li><strong>Stock traceability, reimagined:<\/strong> the Traceability screen now opens with an at-a-glance health verdict \u2014 \"Is your stock healthy?\" \u2014 showing a large reliability score, a plain-language status (healthy \/ needs attention \/ has issues), and a 24-hour reliability sparkline. You can read the state of your Bsale \u21c4 WooCommerce stock sync in seconds instead of scanning raw numbers; the detailed per-event tables are unchanged.<\/li>\n<\/ul>\n\n<h4>3.4.4<\/h4>\n\n<ul>\n<li><strong>Compatibility:<\/strong> fixed a potential fatal error on PHP 7.4 \u2014 <code>str_starts_with()<\/code> (PHP 8.0+) was called without a polyfill in the webhook URL builder, which could fatal when processing a webhook resource path on the plugin's declared minimum (PHP 7.4). Replaced with a 7.4-safe equivalent. Recommended update for any site running PHP 7.4. (No functional changes for PHP 8+ sites.)<\/li>\n<\/ul>\n\n<h4>3.4.3<\/h4>\n\n<ul>\n<li><strong>Reliability:<\/strong> the WP-CLI command registration is now null-safe against an unloaded licensing SDK, preventing a potential fatal on every <code>wp<\/code> command in environments where the SDK fails to load. No functional changes.<\/li>\n<\/ul>\n\n<h4>3.4.2<\/h4>\n\n<ul>\n<li><strong>Spanish (Chile) polish:<\/strong> the Upgrade panel and the document\/traceability status labels (expired, failed, processing, provisional, severities) now render fully in Spanish instead of leaking English terms.<\/li>\n<li><strong>Admin UI:<\/strong> the residual blue accent on nested settings sub-fields now matches the plugin's green brand color; configuration data tables (dashboard activity, audit history, stock-source events, document config) collapse cleanly into cards on mobile instead of clipping.<\/li>\n<li><strong>Motion:<\/strong> admin transitions now use the design system's motion tokens for a consistent feel.<\/li>\n<li><strong>Internal:<\/strong> license declared as SPDX <code>GPL-2.0-or-later<\/code>; menu icon style registration no longer triggers a Plugin Check \"missing version\" warning; minor packaging metadata hygiene.<\/li>\n<\/ul>\n\n<h4>3.4.1<\/h4>\n\n<ul>\n<li><strong>Internal:<\/strong> transactional email styling (stock-movement, SKU-not-found and stock-audit notifications) is now centralized in a single email-component helper instead of ~135 duplicated inline styles. Same emails, one source of truth. The \"shipping guide\" notice box now uses the same green accent palette as the other notices (was a slightly different green). Covered by golden-snapshot tests.<\/li>\n<\/ul>\n\n<h4>3.4.0<\/h4>\n\n<ul>\n<li><strong>Fix (data loss):<\/strong> saving Settings on a Free (or lapsed-Pro) license no longer wipes previously saved Pro configuration (additional offices, scheduled audits, SKU auto-linking, etc.) from storage. Your Pro setup is preserved and reactivates automatically when the license is active again.<\/li>\n<li><strong>Admin UI:<\/strong> Pro-only blocks (additional offices, SKU auto-linking, scheduled audits) are presented with a clear, unobtrusive pointer to the separate Pro version. (Superseded in 3.6.0, which removes the Pro feature code from the free package entirely.)<\/li>\n<\/ul>\n\n<h4>3.3.2<\/h4>\n\n<ul>\n<li><strong>Admin UI:<\/strong> the residual admin styles (form controls, checklists, sub-tabs, mapping tables) now inherit the Admin Kit's neutral palette, corner radii and motion timing, so every screen shares one consistent visual system. Presentation-only; no markup or functional changes.<\/li>\n<\/ul>\n\n<h4>3.3.1<\/h4>\n\n<ul>\n<li><strong>Admin UI:<\/strong> the payment- and shipping-mapping tables in Settings now collapse into readable cards on small screens, matching the rest of the admin. Dynamically added shipping rows collapse too.<\/li>\n<li><strong>Branding:<\/strong> transactional emails (document and stock-audit notifications) now use the Australcode green accent instead of the legacy orange, centralized via a single brand-color constant. No functional changes.<\/li>\n<\/ul>\n\n<h4>3.3.0<\/h4>\n\n<ul>\n<li><strong>Admin UI:<\/strong> every screen now uses the unified Australcode admin design system (Green Austral) \u2014 dashboard, products, documents, logs, order metabox, audit and traceability share one consistent look (headers, tables, badges, filters, KPIs, segmented tabs). No functional changes; same data, same actions.<\/li>\n<\/ul>\n\n<h4>3.2.0<\/h4>\n\n<ul>\n<li><strong>Billing:<\/strong> licensing moved from Lemon Squeezy to Freemius (Merchant of Record). Pro activation, account management and upgrades now use the native Freemius experience. Existing Pro features and the free\/Pro boundary are unchanged.<\/li>\n<\/ul>\n\n<h4>3.1.5 \u2014 2026-06-13<\/h4>\n\n<ul>\n<li><strong>Fix (admin UI):<\/strong> WordPress admin notices no longer overlap the plugin header \u2014 every screen now closes its header with the standard marker so notices render below it, full-width.<\/li>\n<li><strong>Enhancement (dashboard):<\/strong> the pre-setup hero is context-aware \u2014 once Bsale is connected and only a final step remains (e.g. choosing a price list) it reads \"Almost ready\" with the exact remaining step, instead of \"Connect Bsale to get started\".<\/li>\n<li><strong>Enhancement (settings):<\/strong> under the Pro \"Additional offices\" gate, the free plugin now shows a short office preview with a \"+N more with Pro\" hint instead of the full disabled list.<\/li>\n<li><strong>Polish (admin UI):<\/strong> flattened danger buttons and metric cards (no hover lift or glow) for a calmer, more consistent surface, and gave the menu icon an explicit color so it stays legible.<\/li>\n<li><strong>Enhancement (license):<\/strong> an expired or disabled Pro license now shows a dedicated state (with the expiry date) instead of the generic activation screen, so existing customers know to renew.<\/li>\n<\/ul>\n\n<h4>3.1.4 \u2014 2026-06-05<\/h4>\n\n<ul>\n<li><strong>Fix (sync):<\/strong> the \"Repair mappings\" tool now deduplicates by the full (Bsale variant, WooCommerce product, variation) key instead of by Bsale variant alone, so it no longer collapses legitimate 1:N mappings (the same Bsale variant linked to several WooCommerce products) on multi-publication catalogs.<\/li>\n<li><strong>Enhancement (admin UI):<\/strong> the system Logs screen is now a grouped activity stream \u2014 repeated events collapse into summary rows with an occurrence count and last-seen time, expandable to the latest detail, with a \"Review connection\" shortcut to Settings on Bsale API errors.<\/li>\n<li><strong>Robustness (audit):<\/strong> the stock audit's Bsale fetch is now resumable \u2014 if a background run is interrupted it checkpoints its cursor and continues instead of restarting from zero. No partial writes: the audit table is only replaced after a complete fetch.<\/li>\n<li><strong>Hardening (API):<\/strong> automatic pagination (<code>get_all<\/code>) gained a configurable safety cap that logs and stops runaway pagination instead of hanging the request; removed dead code.<\/li>\n<\/ul>\n\n<h4>3.1.3 \u2014 2026-06-04<\/h4>\n\n<ul>\n<li><strong>Fix (i18n):<\/strong> resolved the <code>_load_textdomain_just_in_time<\/code> notice (WP 6.7+). Block checkout field registration is now deferred to <code>woocommerce_init<\/code> (WooCommerce's canonical hook for additional checkout fields) and the cron-schedule filter no longer translates labels before <code>init<\/code>. No translation now loads before <code>init<\/code>.<\/li>\n<li><strong>Fix (checkout):<\/strong> the \"factura incompleta\" validation message is escaped at the throw site, clearing a Plugin Check <code>ExceptionNotEscaped<\/code> error.<\/li>\n<li><strong>Enhancement (admin UI):<\/strong> refreshed admin design for a more consistent, premium look \u2014 a unified page header with version badge, lede and breadcrumb across all screens; flat primary buttons; a focused pre-setup dashboard with a single call to action; and a redesigned Stock Traceability screen (tokenized metrics cards, cleaner tables, collapsible recent-events list).<\/li>\n<li><strong>Housekeeping:<\/strong> removed decorative emoji from admin and order-note strings, trimmed an over-limit upgrade notice, and regenerated the translation template (POT).<\/li>\n<\/ul>\n\n<h4>3.1.2 \u2014 2026-06-01<\/h4>\n\n<ul>\n<li><strong>Enhancement (audit):<\/strong> the product audit now badges WooCommerce products with <code>private<\/code> post status in the \"WC products without Bsale mapping\" section, so intentionally-private items (e.g. discontinued products) are visually distinguishable and no longer read as problems. Presentation-only \u2014 audit coverage is unchanged.<\/li>\n<\/ul>\n\n<h4>3.1.1 \u2014 2026-05-31<\/h4>\n\n<ul>\n<li><strong>Fix (sync, critical follow-up to 3.1.0):<\/strong> product sync no longer persists a spurious product mapping to the first Bsale variant. 3.1.0 fixed the stock\/price path but the mapping-persistence path (<code>save_mapping<\/code>) still used the first variant, recreating a wrong-variant mapping row on every sync of a simple product mapped to a multi-variant Bsale item. The correct variant is now resolved by SKU (or the existing mapping) in both paths. Surfaced by live re-validation against a Bsale DEMO account.<\/li>\n<\/ul>\n\n<h4>3.1.0 \u2014 2026-05-31<\/h4>\n\n<p>Live-QA remediation against a Bsale DEMO account surfaced pre-existing bugs; this release fixes the critical and high-severity ones.<\/p>\n\n<ul>\n<li><strong>Fix (sync, critical):<\/strong> product sync on a simple WooCommerce product mapped to a multi-variant Bsale parent no longer applies the wrong variant's stock\/price. The correct variant is now resolved by mapping\/variant id or SKU instead of always taking the first variant.<\/li>\n<li><strong>Fix (sync):<\/strong> product sync no longer overwrites the local WooCommerce product name with the Bsale parent name (same principle already applied to SKU \u2014 the local value wins).<\/li>\n<li><strong>Fix (documents):<\/strong> when a stock-transfer dispatch guide fails, emission now aborts with an actionable \"Retry\" error instead of silently emitting the receipt without stock or guide (prevented a silent negative-stock risk).<\/li>\n<li><strong>Fix (webhooks):<\/strong> successful <code>product.create\/update<\/code> webhooks are now marked completed in one pass. They were missing a normalized return flag, which routed successes to the retry path and duplicated product mappings before failing.<\/li>\n<li><strong>Fix (checkout):<\/strong> Chilean RUT (mod-11) validation now runs on the Block checkout. WooCommerce graduated the additional-field validation hook in 8.7.0; the plugin now hooks the current name so invalid RUTs are blocked.<\/li>\n<li><strong>Fix (documents, A4.C10):<\/strong> partial credit notes now match refunded lines by SKU\/variant id (not by position) and credit the shipping line correctly.<\/li>\n<li><strong>Perf\/robustness:<\/strong> skip price-list lookups when no list is configured (removes noisy 404s); resolve office names from a single preloaded catalog instead of one API call per stock line; use the WooCommerce setter for billing company; return HTTP 400 (not 500) on incomplete invoice fields.<\/li>\n<li><strong>Compliance:<\/strong> removed the unsupported <code>placeholder<\/code> attribute from Block additional checkout fields (WooCommerce 8.6+ notice).<\/li>\n<\/ul>\n\n<h4>3.0.8 \u2014 2026-05-26<\/h4>\n\n<ul>\n<li><strong>WP.org Plugin Check pass.<\/strong> The release ZIP now ships clean: dev-only artifacts (<code>phpcs.xml*<\/code>, <code>tests\/<\/code>, <code>scripts\/<\/code>, <code>composer.{json,lock}<\/code>, <code>phpunit.xml*<\/code>, <code>.phpunit.result.cache<\/code>, <code>vendor\/<\/code>) are excluded from the build, closing the two <code>application_detected<\/code> errors that Plugin Check reported on 3.0.7.<\/li>\n<li><strong>Security hardening.<\/strong> Tighter <code>phpcs:ignore<\/code> scoping on the WooCommerce-checkout <code>$_POST<\/code> reads (<code>validate_classic_checkout<\/code>, <code>save_classic_order_meta<\/code>) \u2014 WooCommerce verifies its own checkout nonce upstream; the annotations now document that explicitly. Same for the license form controller, where the nonce is verified through the <code>guard()<\/code> helper.<\/li>\n<li><strong>readme polish.<\/strong> Upgrade Notice entries for 3.0.5, 3.0.6 and 3.0.7 trimmed to fit the WP.org 300-character display limit.<\/li>\n<li><strong>DX: codebase-wide <code>phpcs:disable<\/code> headers<\/strong> added to the 18 files that own custom plugin tables (<code>wp_acbsl_*<\/code>) and to the 9 admin view templates, documenting that the SQL \"InterpolatedNotPrepared \/ DirectQuery \/ NoCaching\" reports and the \"NonPrefixedVariableFound\" reports are false positives in this codebase: table names are class-controlled constants, values pass through <code>$wpdb-&gt;prepare()<\/code>, and view-scope locals are not WordPress globals.<\/li>\n<li>No functional change in product sync, stock sync, document emission, license activation, traceability or admin UI. Pure compliance + dev-tooling release.<\/li>\n<\/ul>\n\n<h4>3.0.7 \u2014 2026-05-26<\/h4>\n\n<ul>\n<li><strong>Simplification: removed the <code>sku_locked<\/code> mapping flag introduced in 3.0.6.<\/strong> It was over-engineering: the intended behavior is that the SKU of a WooCommerce product is <em>the<\/em> matching key and must never be overwritten by Bsale during sync, without opt-in\/opt-out. There is no \"Bsale as authority over SKU\" mode. If a Bsale variant code diverges from the WC SKU, the existing Auditor\u00eda module reports the orphan for manual resolution.<\/li>\n<li><strong>DB cleanup<\/strong>: the <code>sku_locked<\/code> column on <code>wp_acbsl_products<\/code> is dropped automatically (idempotent migration <code>acbsl_migration_sku_lock_removed<\/code>). The 3.0.6 migration flag <code>acbsl_migration_sku_lock_added<\/code> is cleared.<\/li>\n<li><code>apply_variant_to_product()<\/code> simplified: never calls <code>set_sku()<\/code>. If WC SKU and Bsale variant code differ, logs an info entry \"SKU divergente entre WC y Bsale; el SKU local se preserva\" for diagnostics.<\/li>\n<li>The SKU-primary lookup and 1:N propagation in <code>sync_product()<\/code> introduced in 3.0.6 remain (those were correct). <code>get_mappings_by_sku()<\/code> and <code>get_mappings_by_bsale_id()<\/code> plural stay.<\/li>\n<li>No functional change for stock \/ price webhooks, license, or document emission.<\/li>\n<\/ul>\n\n<h4>3.0.6 \u2014 2026-05-26<\/h4>\n\n<ul>\n<li><strong>Fix: WooCommerce product SKU is no longer overwritten during Bsale syncs.<\/strong> Previously, every product sync (manual, scheduled, or webhook-driven for product data) replaced the local WC SKU with the Bsale variant <code>code<\/code>, silently overwriting SKUs that stores intentionally diverged. This was a regression from the original \"match by SKU\" design. From now on, the SKU is preserved by default. When the Bsale <code>code<\/code> differs from the WC SKU, the sync logs an info entry (\"SKU local conservado (lock activo)\") for diagnostics. To restore the legacy behavior (Bsale as authority on SKU), set <code>sku_locked = 0<\/code> on the mapping row in <code>wp_acbsl_products<\/code>.<\/li>\n<li><strong>Fix: manual \/ scheduled product syncs now propagate to ALL mapped WooCommerce products<\/strong> that share a Bsale variant SKU (1:N), not just the first one. Stock and price webhook flows already supported this pattern (since 2.50.0); now <code>sync_product()<\/code> does too. The lookup is primary by SKU with fallback by <code>bsale_product_id<\/code> for legacy mappings.<\/li>\n<li><strong>New schema column<\/strong> <code>sku_locked TINYINT(1) DEFAULT 1<\/code> in <code>wp_acbsl_products<\/code>. Migration is automatic and idempotent \u2014 both existing and new mappings start locked (safe default). A future minor release will add a UI toggle to override per product.<\/li>\n<li>No functional change in stock \/ price webhook flows, license activation, or document emission.<\/li>\n<\/ul>\n\n<h4>3.0.5 \u2014 2026-05-26<\/h4>\n\n<ul>\n<li><strong>Polish: admin UI mobile.<\/strong> The dashboard activity table now collapses to a stacked card layout on narrow screens (\u2264600px) instead of scrolling horizontally. Long messages remain fully readable without truncation. Closes the partial fix shipped in 3.0.4.<\/li>\n<li><strong>Polish: design-system consistency.<\/strong> Two remaining WordPress-default buttons in Settings (\"Agregar m\u00e9todo manual\" and \"Agregar tipo\") migrated to the brand button styles, completing the brand-override cleanup. \"Limpiar hu\u00e9rfanos\" on Products now uses a red outline (<code>danger-outline<\/code>) to communicate it is a destructive action. The \"\u00daltima auditor\u00eda\" stat value on the Audit screen now uses the monospace family, matching the other numeric KPIs.<\/li>\n<li><strong>Polish: maintainability.<\/strong> Around 40 inline <code>style=\"\u2026\"<\/code> attributes in Traceability and Audit replaced by utility classes in the design system (<code>acbsl-kpi-label<\/code>, <code>acbsl-kpi-value<\/code>, <code>acbsl-card-legacy<\/code>, <code>acbsl-text-center<\/code>, <code>acbsl-mt-xl<\/code>, <code>acbsl-mb-lg<\/code>, etc.). Visual rendering unchanged.<\/li>\n<li>No functional changes \u2014 pure polish release.<\/li>\n<\/ul>\n\n<h4>3.0.4 \u2014 2026-05-25<\/h4>\n\n<ul>\n<li><strong>Polish + WordPress.org submission readiness.<\/strong> WP.org Plugin Check now reports 0 errors. Translation template (.pot) regenerated to match the rebranded codebase. Multiple defensive <code>phpcs:ignore<\/code> comments added on canonical <code>$wpdb-&gt;prepare()<\/code> patterns (array-variadic IN clauses, gated <code>set_time_limit()<\/code>, <code>debug_backtrace<\/code> runtime heuristic in the stock tracer, gated <code>error_log<\/code> for tracer\/reconciler internals) so that defensible style-warnings stop being reported as actionable.<\/li>\n<li><strong>Polish: admin UI.<\/strong> Single primary CTA on the Products screen (the empty-state action is now secondary, matching the screen's primary header button). Brand-colored Filter\/Clear\/\"Mark resolved\" buttons on Traceability (no more default-blue colliding with the Bsale orange brand override). Activity log on mobile no longer truncates messages mid-word.<\/li>\n<li><strong>i18n: neutral Spanish.<\/strong> One reconciler-alert string in Traceability moved from rioplatense Spanish (\"Revis\u00e1, ejecut\u00e1\") to neutral Spanish (\"Revisa, ejecuta\"). Internal change for translators; user-facing copy reads the same.<\/li>\n<li>No functional changes \u2014 pure polish, compliance and translation-template release.<\/li>\n<\/ul>\n\n<h4>3.0.3 \u2014 2026-05-22<\/h4>\n\n<ul>\n<li><strong>Fix: the license and stock-traceability data now migrate correctly during the rebrand.<\/strong> The 3.0.0 rename map missed a few options that used the short legacy prefix (the stored license and the traceability history), so on some sites the plugin reverted to the free tier after upgrading even though a valid Pro license was present. The license was never lost \u2014 only disconnected \u2014 and is now reconnected automatically (idempotent, runs once). No action required.<\/li>\n<\/ul>\n\n<h4>3.0.2 \u2014 2026-05-22<\/h4>\n\n<ul>\n<li><strong>Fix: at-rest encryption of the Bsale token now applies on first activation too.<\/strong> In 3.0.1 the one-time migration that encrypts the stored Bsale API token and webhook secret only ran on a version upgrade; on a clean activation that jumped straight to the current version it was skipped, leaving the token in clear text. The migration now also runs on activation and defensively on every load (idempotent, flag-gated), so the credentials are always encrypted at rest. No action required.<\/li>\n<\/ul>\n\n<h4>3.0.1 \u2014 2026-05-22<\/h4>\n\n<ul>\n<li><strong>Security hardening (pre-release).<\/strong> Webhook resource fetches are restricted to Bsale hosts (prevents SSRF \/ token exfiltration); the Bsale API token and webhook secret are encrypted at rest with AES-256-GCM (same as license keys); the webhook bootstrap validates the Bsale company id (<code>cpnId<\/code>) against the connected account before trusting it; and non-idempotent API writes (document\/stock emission) are no longer auto-retried on timeout\/5xx, to avoid duplicate documents or stock movements.<\/li>\n<li><strong>Robustness.<\/strong> Circuit breaker on the Bsale API client (fails fast during outages instead of hammering), idempotent webhook de-duplication (<code>dedup_hash<\/code>), safer legacy-cron cleanup (fixed hook list), a guarded table-rename migration (logs and retries on partial failure), and complete uninstall cleanup.<\/li>\n<li>No functional changes for the store operator.<\/li>\n<\/ul>\n\n<h4>3.0.0 \u2014 2026-05-22<\/h4>\n\n<ul>\n<li><strong>Rebrand to Australcode Bsale for WooCommerce.<\/strong> The plugin is now part of the Australcode family. This is a major release because internal identifiers were renamed (PHP classes, functions, hooks, nonces, options, database tables, and order meta keys moved from the legacy <code>cb<\/code>\/<code>CBSALE<\/code>\/<code>conecta_bsale<\/code> prefixes to <code>acbsl<\/code>\/<code>Australcode<\/code>).<\/li>\n<li><strong>Automatic, in-place data migration on upgrade.<\/strong> Existing settings, product mappings, stock ledger, emitted documents, and order meta are migrated to the new names automatically \u2014 no manual action required. The migration is idempotent and runs once.<\/li>\n<li><strong>Bsale webhook URL is unchanged.<\/strong> The REST endpoint stays at <code>\/wp-json\/conecta-bsale\/v1\/webhook<\/code>, so stock sync keeps working without reconfiguring anything on the Bsale side.<\/li>\n<li>No functional changes: every feature behaves exactly as in 2.53.0.<\/li>\n<\/ul>\n\n<h4>2.53.0 \u2014 2026-05-21<\/h4>\n\n<ul>\n<li>Fix: emission lock no longer collides across orders. The placeholder row that serializes concurrent emissions now uses a NULL sentinel instead of <code>0<\/code>, so two different orders emitting the same document type in the same burst no longer block each other.<\/li>\n<\/ul>\n\n<h4>2.52.0 \u2014 2026-05-19<\/h4>\n\n<ul>\n<li><strong>New: Free \/ Pro split<\/strong> for commercial distribution. The Pro features (auto-emission post-payment, multi-office aggregation, stock transfer, scheduled audits, custom field mapping, dynamic document attributes, sales notes, dispatch guides, per-shipping-method routing, daily SKU auto-link) are offered in a separate Pro version. The free version retains all essentials for a typical Chilean e-commerce store.<\/li>\n<li><strong>New: License management page<\/strong> (<strong>Australcode Bsale \u2192 License<\/strong>) with activate\/validate\/deactivate flows. License keys validated with the Lemon Squeezy licensing service.<\/li>\n<li><strong>New: Daily license revalidation cron<\/strong> with graceful degradation.<\/li>\n<li><strong>Security: Webhook origin validation (cpnId).<\/strong> The webhook endpoint authenticates each request by matching its Bsale company id (<code>cpnId<\/code>) against the connected account, rejecting foreign-origin payloads with HTTP 403. The expected <code>cpnId<\/code> auto-detects from the first webhook. An optional shared token (<code>?acbsl_token=<\/code> URL param or <code>X-CB-Token<\/code> header, paired with the <code>webhook_secret<\/code> setting) adds defense-in-depth. Note: Bsale does not sign its webhooks, so HMAC signature verification is not applicable.<\/li>\n<li><strong>Security: Webhook rate limiting<\/strong> (60 req\/min per IP) + payload size limit (1 MB), both filterable.<\/li>\n<li><strong>Security: License key leakage prevention<\/strong> \u2014 error messages scrub keys before persisting\/displaying.<\/li>\n<li><strong>Security: Variant validation hardened<\/strong> \u2014 activations validated against known store_id + variant_id.<\/li>\n<li><strong>Security: Deleted operational repair script<\/strong> (<code>repair-incomplete-documents.php<\/code>) that was web-accessible without auth.<\/li>\n<li><strong>Security: Exception messages escaped<\/strong> \u2014 all thrown exception messages wrapped with <code>esc_html()<\/code> \/ <code>esc_html__()<\/code> (Plugin Check compliance: 0 errors).<\/li>\n<li><strong>Fix: Document emission TIMEZONE bug<\/strong> \u2014 recovery flow uses Chile TZ (was server UTC). Previously caused duplicate documents in Bsale for orders emitted 21:00\u201323:59 Chile (SII compliance).<\/li>\n<li><strong>Fix: <code>unlimitedStock<\/code> variants handled correctly<\/strong> \u2014 services\/digitals no longer falsely rejected as \"no stock\" during emission or sync.<\/li>\n<li><strong>Fix: Stock transfer compensation<\/strong> \u2014 if reception fails, plugin rolls back inventory automatically.<\/li>\n<li><strong>Fix: Email send verification<\/strong> \u2014 stock-move and SKU-not-found emails check <code>wp_mail()<\/code> return + add order note on failure.<\/li>\n<li><strong>Fix: Document UNIQUE constraint<\/strong> \u2014 <code>(bsale_document_id, document_type)<\/code> prevents duplicate rows from concurrent flows.<\/li>\n<li><strong>Fix: License activation orphan slot prevention<\/strong> \u2014 Activator compensates LS activation when local persist fails.<\/li>\n<li><strong>Fix: Pro licenses activate out-of-the-box<\/strong> \u2014 known variant\/store IDs embedded as class defaults; activation no longer requires a per-site <code>CB_LICENSE_VARIANT_IDS<\/code> in wp-config (previously the strict-mode default rejected every license without it). Still override-able via constant\/filter.<\/li>\n<li><strong>Fix: License decrypt failure visibility<\/strong> \u2014 surfaces \"License unreadable \u2014 re-activate\" instead of silent downgrade.<\/li>\n<li><strong>Fix: Retry button clears permanent flag<\/strong> \u2014 manual retry starts with clean slate.<\/li>\n<li><strong>Fix: Provisional NV locking<\/strong> \u2014 blocks duplicate NV emissions in Bsale.<\/li>\n<li><strong>Fix: Bsale outage tolerance<\/strong> \u2014 <code>has_pending_transfer_guide<\/code> fails-open during API outages.<\/li>\n<li><strong>Fix: <code>document.failed<\/code> webhook handler<\/strong> \u2014 properly records rejected documents with admin notification.<\/li>\n<li><strong>Fix: Bulk handlers PHP 7+ Error catch<\/strong> \u2014 webhooks no longer stuck on <code>TypeError<\/code>.<\/li>\n<li><strong>Fix: Settings option autoload disabled<\/strong> \u2014 API token + webhook secret not loaded on every request.<\/li>\n<li><strong>Fix: Uninstall cleanup completeness<\/strong> \u2014 uninstall drops all 11 plugin tables + options + post meta + transients, leaving zero residue (verified on a clean WordPress + WooCommerce sandbox).<\/li>\n<li><strong>Fix: Price sync honors the \"Sync prices\" toggle in the bulk path<\/strong> \u2014 high-volume price webhook bursts (&gt;50) no longer overwrite WooCommerce prices when price sync is disabled. The bulk path now (a) respects <code>sync_prices=false<\/code> like the individual path, (b) only updates the variants that actually triggered webhooks instead of the whole mapped catalog, and (c) the settings sanitizer clears the sale-price sub-flag when price sync is turned off.<\/li>\n<li>Internal: Helpers <code>CB_Pro_UI<\/code>, <code>cb_is_pro()<\/code>, <code>cb_is_unlimited_stock_variant()<\/code>, <code>CB_License_Activator::scrub_license_key()<\/code>.<\/li>\n<\/ul>\n\n<h4>2.51.16 \u2014 2026-05-18<\/h4>\n\n<ul>\n<li>New: <code>detail_ids<\/code> field now populated for all emitted document types (boleta, factura, credit note), not just nota de venta. Improves stock event correlation in the audit system.<\/li>\n<\/ul>\n\n<h4>2.51.15 \u2014 2026-05-18<\/h4>\n\n<ul>\n<li>Fix: severity classifier for unmapped Bsale variants now correctly distinguishes physical products from services, based on the <code>unlimitedStock<\/code> field returned by the Bsale API.<\/li>\n<\/ul>\n\n<h4>2.51.14 \u2014 2026-05-16<\/h4>\n\n<ul>\n<li>Fix: stock webhook events from Bsale now correctly populate the <code>bsale_variant_id<\/code> field in the audit ledger, enabling per-variant correlation in the reconciler. Resolves the gap where 100% of stock webhook events were stored with NULL variant ID.<\/li>\n<\/ul>\n\n<h4>2.51.13 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>Refactor: migrated all on-scale spacing values in <code>admin.css<\/code> (216 lines, both px and rem) to the <code>--cb-sp-*<\/code> token system. Visual output unchanged.<\/li>\n<\/ul>\n\n<h4>2.51.12 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>New: stock health mini-panel in the Audit \u2192 Stock tab. Shows synced products count, last audit timestamp, and active discrepancies count when no pending discrepancies exist.<\/li>\n<\/ul>\n\n<h4>2.51.11 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>UX: Inventory settings now organized in sub-tabs (Stock, Documents, Sync, Reservations, Audit, Advanced). Improves discoverability of configuration options.<\/li>\n<\/ul>\n\n<h4>2.51.10 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>Design system: documented the plugin's custom <code>--cb-*<\/code> token system and <code>cb-*<\/code> class prefix as a deliberate choice independent from the hub design system canon.<\/li>\n<\/ul>\n\n<h4>2.51.9 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>Fix: when a Bsale document webhook arrives, the plugin now removes any previously recorded <code>plugin_emit<\/code> ledger entry for the same document. Closes the race condition between the reconciler and the webhook processor.<\/li>\n<\/ul>\n\n<h4>2.51.8 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>UX: data tables in the admin UI are now responsive on mobile viewports via horizontal scroll. Affects audit, documents, and logs tables.<\/li>\n<\/ul>\n\n<h4>2.51.7 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>UX: tablet viewports now use a 2-column grid for cards in the dashboard. Traceability table column widths adjusted to fit common Chilean SKU formats.<\/li>\n<\/ul>\n\n<h4>2.51.6 \u2014 2026-05-14<\/h4>\n\n<ul>\n<li>UX: improved logs UI with severity vs context columns. Human-readable labels for internal states (e.g. <code>nv_provisional_stale<\/code> \u2192 \"Pending NV expired\"). Cleaner empty states across the admin UI. Sub-fields use design system tokens for the left border instead of hardcoded color values.<\/li>\n<\/ul>\n\n<h4>2.51.0 \u2014 2026-05-13<\/h4>\n\n<ul>\n<li>New: unified BEM-canonical status badge system across all admin views (9 canonical states with semantic colors).<\/li>\n<li>New: monospace font token <code>--cb-font-mono<\/code> applied to technical data (folios, SKUs, RUTs, timestamps, prices, Bsale IDs) for tabular alignment.<\/li>\n<\/ul>\n\n<h4>2.50.4 \u2014 2026-05-13<\/h4>\n\n<ul>\n<li>New: auto-resolver for stale stock discrepancies. Reconciler now closes discrepancies that have been resolved by the deferred sync pipeline but were not yet acknowledged. Three phases: SQL bulk (no API), API-limited (50 per run), and force-sync (20 per run).<\/li>\n<\/ul>\n\n<h4>2.50.3 \u2014 2026-05-12<\/h4>\n\n<ul>\n<li>New: <code>compute_delta_sign<\/code> heuristic for Bsale document webhooks. Correctly determines the sign of stock movement based on <code>codeSii<\/code>, document type, event type, and document state. Closes the gap where <code>bsale_document<\/code> events stored NULL <code>delta_expected<\/code>.<\/li>\n<\/ul>\n\n<h4>2.50.2 \u2014 2026-05-11<\/h4>\n\n<ul>\n<li>New: <code>bsale_variant_id<\/code> now resolved for events written from the webhook processor (previously only set for events from the reconciler).<\/li>\n<\/ul>\n\n<h4>2.50.1 \u2014 2026-05-10<\/h4>\n\n<ul>\n<li>Fix: tracer idempotency. Order status changes no longer record duplicate ledger events when the order transitions through custom intermediate statuses.<\/li>\n<\/ul>\n\n<h4>2.50.0 \u2014 2026-05-09<\/h4>\n\n<ul>\n<li>New: 1:N product mapping (one Bsale product can map to multiple WooCommerce products) with a daily cron job to keep SKU links consistent.<\/li>\n<\/ul>\n\n<h4>2.49.0 \u2014 2026-05-08<\/h4>\n\n<ul>\n<li>New: enriched traceability admin view with product names and SKUs alongside Bsale variant IDs. Pagination, filters, and per-cron health alerts added.<\/li>\n<\/ul>\n\n<h4>2.48.1 \u2014 2026-05-07<\/h4>\n\n<ul>\n<li>New: deduplication for <code>stock_mismatch<\/code> and <code>bsale_silent_movement<\/code> discrepancies. Index added on <code>created_at<\/code> of the audit ledger for query performance. UI button to acknowledge discrepancies. Dynamic severity for unmapped variants.<\/li>\n<\/ul>\n\n<h4>2.48.0 \u2014 2026-04-29<\/h4>\n\n<ul>\n<li>Baseline release of the deduplication and audit-ledger features.<\/li>\n<\/ul>","raw_excerpt":"Issue SII boletas, facturas and credit notes from WooCommerce via Bsale \u2014 real-time webhook stock sync and credit notes free, no per-document fees.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/333214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=333214"}],"author":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/australcode"}],"wp:attachment":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=333214"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=333214"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=333214"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=333214"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=333214"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=333214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}