=== RamCode Fast Orders for WooCommerce ===
Contributors: ramindoroozeh
Tags: woocommerce, orders, performance, admin
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 3.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight active-orders workspace and management command center for WooCommerce.

== Features ==

* Loads only active orders from the last 30 days.
* Supports standard WooCommerce active statuses and optional custom reservation statuses.
* Avoids loading the full historical order archive.
* Fetches only 21 records per request and displays 20.
* Lazy-loads line items only when the quick-detail dialog is opened.
* Exact search by order ID, phone number or email.
* Works with legacy order storage and HPOS.
* Modern responsive RTL interface with no JavaScript framework.
* Stage-aware card accents for faster visual scanning.
* Bulk status updates and reservation shipping.
* Quick private notes and print shortcuts.
* Aging alerts and optional new-order sound.
* Mobile-first warehouse, accounting and support modes.
* Full-screen mobile order sheet with a sticky action dock.
* Order and print links always open in a new tab.
* Native Windows/Chrome/Edge notifications for new orders while the page is open or in the background.
* Duplicate-notification protection shared across tabs.
* Auto-refreshes every 60 seconds while the page is visible.
* A separate lightweight 30-day management command center.
* Action queue with a suggested owner for accounting, support and warehouse.
* Daily trends, operational health and payment-gateway failure analysis.
* Full-screen monitor mode with five-minute refresh.
* Selectable 30, 60 or 90-day reporting window.
* Selected-period sales, current-month sales and a seven-day sales chart.
* Fast SQL aggregation for accurate high-volume 30/60/90-day comparisons.
* Sales comparison against the immediately preceding period.
* Two-minute report cache, automatically cleared after order changes.
* Coupon usage report with per-code totals and direct order links.
* Product 360 report with sales, refunds, current stock and stock-recharge history.
* Payment-gateway summary export compatible with Excel.
* A support CRM queue for pending, cancelled and failed payments.
* Per-order assignee, priority, next follow-up, internal notes and activity history.

== Installation ==

Upload the ZIP from Plugins > Add New > Upload Plugin, then activate it.
Open WooCommerce > سفارش‌های سریع for operations, or WooCommerce > مرکز فرمان RamCode for BI.

The plugin does not replace or modify WooCommerce's original Orders screen.

== Developer filters ==

`ramcfaor_cutoff_days` may reduce the window from 30 days. Values are always clamped between 1 and 30 days.

`ramcfaor_active_statuses` changes the statuses included in the active view.

`ramcfaor_print_urls` receives the generated print URLs and the order object. Return an empty array to hide all print actions, or replace individual URLs to integrate another print plugin.

== Changelog ==

= 3.1.1 =

* Default the customer call list to cancelled and failed orders only.
* Put customer name, mobile number, gateway and order status first in the Excel export.
* Keep pending-payment orders available as an explicit optional filter.

= 3.1.0 =

* Add a lightweight support CRM for pending, failed and cancelled orders.
* Add gateway, date, order-status, CRM-status and assignee filters.
* Add task assignment, priority, follow-up date, internal notes and activity history.
* Add Excel-compatible CSV export for the filtered payment follow-up queue.
* Store CRM data in dedicated indexed tables and preserve HPOS compatibility.

= 3.0.0 =

* Add a separate 360-degree product report with search and Excel-compatible CSV export.
* Show order count, units sold, gross sales, average price, discounts, refunds, current stock and recent activity per product or variation.
* Record every stock increase from this version onward, including the event count, units added and last recharge time.

= 2.9.0 =

* Add custom date, order-status and coupon-code filters to the coupon report.
* Add UTF-8 CSV export compatible with Excel.
* Add order-source reporting for website, admin, reserve, Digikala and TorobPay orders.

= 2.8.0 =

* Add coupon usage totals for the selected 30/60/90-day report window.
* Show each coupon's discount amount and link every use to its WooCommerce order.
* Exclude cancelled, failed and refunded orders from coupon usage metrics.

= 2.3.0 =

* Show an explicit data-quality warning when the Orders API fallback reaches its 5,000-order safety limit.
* Hide reservation shipping controls from users who cannot manage WooCommerce and enforce the same capability on the REST route.
* Make print URLs filterable and hide unavailable print actions in the interface.
* Remove store-specific legacy branding from the workspace and browser notifications.
* Harden the command center against optional or missing report fields.

= 2.2.0 =

* Replace short internal prefixes with the unique RAMCFAOR/ramcfaor prefix throughout declarations, globals, hooks, stored data, script handles and public JavaScript configuration.
* Rename the command-center admin slug and internal handles to use the plugin prefix.

= 2.1.5 =

* Add uncapped aggregate 30/60/90-day reporting for legacy WooCommerce order storage.
* Calculate real selected-period and previous-period sales from legacy order data.
* Add shipping-method trends for stores that use the WordPress posts order tables.

= 2.1.4 =

* Add accurate uncapped 30/60/90-day aggregate reporting for HPOS stores.
* Keep the operational Fast Orders workspace limited to the latest 30 days.
* Add shipping-method distribution and share trends for the selected report period.
* Add real previous-period sales comparisons.
* Prevent stale report responses when users switch date ranges quickly.
* Avoid instantiating thousands of WooCommerce order objects for HPOS reports.

= 2.1.3 =

* Fall back to the WooCommerce Orders API when the Analytics lookup table has no report data.
* Fix payment-gateway action calculations in fallback reports.
* Invalidate stale zero-result report caches after upgrading.


= 2.5.0 =
* BI Sprint 1: Venous Club, Order Reserve and Buy With Digikala read-only integrations.
* Customer intelligence and order integration tags added to REST order payload.
* Command Center now shows integration health and operational metrics.

= 2.6.0 =
* BI Sprint 2: Product BI, Customer/Club BI, Geographic BI and smarter Attention Center.
* Preserves read-only integrations with Venous Club, Order Reserve and Buy With Digikala.

= 2.6.1 =
* Fixed Command Center BI layout density and readability.
* Product BI and Geographic BI are now full-width readable cards.
* Customer BI changed to executive KPI presentation with club AOV.
* Footer/version display synced to RAMCFAOR_VERSION.

= 2.6.2 =
* Fixed Command Center HTML grid nesting that compressed Product/Customer/Geographic BI cards.
* BI section is now a full-width independent layout before Actions/Trend.
* Added visible plugin build badge in Command Center header.

= 2.7.0 =
* Operational Sprint: customer intelligence badges, reserve/Digikala tags, order exceptions and richer print actions in Fast Orders.
* Added Reserve Conversion BI for second/third purchase effectiveness.
* Added payment/shipping/postcode context to order list payload.

= 2.7.1 =
* Added read-only TorobPay integration for Command Center and Fast Orders.
* Added TorobPay transaction/verification/settlement/action-required context.
* Added TorobPay mismatch exception badge and health metrics.
