=== Jeet Sanwal Daily Production Sheet ===
Contributors: jeetsanwal
Tags: woocommerce, production, preparation, bakery, csv
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A small WooCommerce preparation list: net quantities per product/model, optional production dates, print and spreadsheet-safe CSV.

== Description ==

For a bakery, tiffin kitchen or small made-to-order store, the first useful question is often: how many of each item do we need to prepare? This plugin adds WooCommerce → Production sheet, with a focused quantity list instead of customer addresses or revenue charts.

* Filter a maximum 31-day inclusive date range, in the WordPress site timezone.
* Explicitly choose order creation date or a saved production date. They are different; no automatic fulfillment-date inference is made.
* Add an optional preparation day in the Production date box on the standard WooCommerce order edit screen. Both HPOS and legacy order storage use WooCommerce CRUD.
* Include Processing and On hold by default; optionally include Completed. Cancelled, Refunded, Failed, Pending payment and draft orders are excluded.
* Group product/model quantities and show saved order names, available variation attributes, current SKUs and contributing-order counts.
* Subtract recorded line-item quantity refunds, never below zero. Money-only refunds do not alter quantities, and are flagged for review.
* Print a clean preparation sheet, with warnings preserved on paper.
* Download CSV with formula-triggering text escaped for spreadsheet use. CSV includes the date basis, statuses, scope, generation time and warnings.
* Requires manage_woocommerce; report rows and order-date edits also require permission to edit each order. Report requests, export and date saves are nonce-protected.
* With optional installation reports off, no public endpoints, frontend assets, ads, signup, subscriptions, tracking or external calls.

**Bounded batches, honest subtotals:** each scan checks at most 500 store-order candidates (50 per query), newest order ID first, across all registered statuses and creation dates, and at most 5,000 included line items. When more candidate batches exist, the report and CSV prominently say BATCH SUBTOTAL. Change Scan batch to 2, 3, etc. to review remaining batches. These are separate subtotals, not one complete plan. If the line-item cap is reached, the next entire order and subsequent orders are omitted and an INCOMPLETE warning appears. Narrow the creation-date range or inspect the omitted orders directly; selecting the next batch alone does not recover omitted orders inside the previous batch.

Candidate pages are independent of selected status/date, so restricted order fields cannot influence filter results or pagination. Before reading an order's status, dates, metadata or line items, the plugin checks edit_shop_order for that order. Visible counts cover only editable candidates in the current batch. Selected statuses and the chosen creation/production date are then applied. Orders without a valid saved production date are excluded and counted only after permission and status checks. No scheduled date is guessed from a delivery extension or customer note.

**Practical limits:** this counts order line quantities in their existing units. It does not calculate ingredients, recipes, production capacity, stock reservations, bundle components or custom add-ons. Personalized line metadata is not included. Same product/variation with a different saved name or known attribute value is kept separate. Attribute names come from the current variation definition; deleted/changed products can lose attribute/SKU detail. Current SKU is not a historical order snapshot. Mixed product units should not be treated as one meaningful overall unit.

Reports are live, not saved snapshots. Orders can change during or between requests; CSV regenerates the report rather than exporting a frozen copy of a previous screen. If you review several batches, reconcile changes before treating the combined sheets as a final plan. The plugin does not mark orders fulfilled or change stock/order statuses.

== Installation ==

1. Install and activate WooCommerce. Use WordPress and PHP versions supported by your WooCommerce version; this plugin's lower minimum does not override WooCommerce's requirements.
2. Install this ZIP in Plugins → Add New → Upload Plugin, then activate it.
3. Open WooCommerce → Production sheet. Choose the date basis, range and statuses; click Generate sheet.
4. For a preparation-day workflow, edit each order, set Production date → Preparation day and update the order. Then choose Saved production date on the report.
5. Read all warnings before preparing quantities. Download CSV or print the current sheet.

== Frequently Asked Questions ==

= Is this a delivery-date plugin? =

No. The optional date is this plugin's manual preparation-day field. It does not modify shipping dates, checkout or delivery-extension data. One order has one production date, applying to all its line items.

= Does a refund reduce the preparation quantity? =

Only an actual refunded line quantity. For example, quantity 10 with quantity refund 2 contributes 8. A money-only refund keeps 10, with a review warning when the order has no refunded line quantities. Fully Refunded-status orders are always excluded. If a single order mixes quantity refunds with separate money-only refunds, quantities are reduced only by the recorded quantity refunds; inspect the original order for any other adjustments.

= Will the sheet contain customer information? =

The plugin does not read customer addresses, emails, phone numbers, order notes or arbitrary item metadata. It displays the saved item name, known variation attributes, current SKU, product/variation IDs, quantities and aggregated counts. Product names or attribute values can themselves contain personal data entered elsewhere; handle exported sheets appropriately.

= Is HPOS supported? =

Yes. Reports use wc_get_orders and order/item APIs, and the preparation date uses WooCommerce metadata CRUD. There are no direct order-table queries or post-meta order writes. The order-date box is registered for both standard WooCommerce order editor screens. Third-party replacement editors may need the standard meta-box area.

= Why does a production-date scan show more orders in scope than included? =

The portable scan checks store-order candidates across all statuses and creation dates in batches of 500. After your editing permission is checked, the chosen status and production date are applied. Missing dates, other statuses and dates outside the selected preparation range do not contribute. Change Scan batch to inspect older order candidates. Counts refer only to editable candidates in the current batch.

= Is there a paid tier, branding in the sheet or automatic updater? =

No paid tier, ads or frontend credit. This self-hosted package uses its own Update URI to avoid unrelated directory replacements. No custom automatic updater is included; install new ZIP versions manually from jeetsanwal.in.

= What remains after uninstalling? =

Only optional production dates stored on orders remain, so reinstalling preserves them. The plugin creates no tables, cached reports or settings. Clear a Production date field and update that order to remove that order's saved date before uninstalling. Exported CSV/printed sheets remain wherever you saved them. No orders, products or uploads are deleted.

== Privacy ==

With optional installation reports off, all processing happens inside your WordPress installation. There are no external requests, analytics, remote fonts or services. Reports are not saved by the plugin. Production dates are ordinary order metadata and may be included in backups or exports by other tools. Store downloaded CSVs and printed sheets according to your own data-handling policy.

== Updating an existing installation ==

Download this plugin's individual ZIP from https://jeetsanwal.in/tools/jeet-daily-production-sheet . Make a normal site backup and try the update on staging first. In WordPress, use Plugins > Add New > Upload Plugin and choose Replace current with uploaded when WordPress detects the existing installation. Keep the same plugin folder; do not uninstall/delete the plugin as an update step. Confirm the displayed version is 1.0.5, then reopen the plugin's normal screen and check one representative workflow described above. Clear relevant page caches if public output remains stale.

Updates are installed manually; a matching Update URI prevents unrelated directory plugins from replacing this package, but does not provide an update service. If replacement fails, check hosting upload limits and write permissions before retrying. To roll back, replace the plugin files with your saved previous ZIP; file replacement alone does not restore database records or deleted files. Use your site backup when data restoration is needed. Read this plugin's retention notes before deliberately uninstalling it.

Author and support: Jeet Sanwal — https://jeetsanwal.in/contact

== Optional installation reports ==

Installation reports are optional and OFF by default. Installing, activating, or using this product does not submit a report. Administrators can choose consent separately for each product under Settings > Jeet Sanwal Reports. All product features remain available with reporting off.

After explicit consent, the client sends the website URL, a random installation ID, product/WordPress/PHP versions, reported state, and an observed activation timestamp when available to https://jeetsanwal.in/api/v1/plugin-reports. While that product is active and consent remains enabled, a daily WordPress cron check-in can update its last-known status. WP-Cron depends on site traffic and hosting; it is not a continuous monitor.

Pause stops future reports without deleting records already shared. Forget requests deletion of the remote installation entry and history, retrying deletion if delivery fails. Records automatically expire after 90 days without a check-in. The plugin does not send page content, files, database exports, administrator email addresses, or raw IP addresses. Server rate limiting keeps a keyed IP hash for up to 24 hours; ordinary hosting access logs are governed separately by the privacy policy.

Review the fields and consent before enabling reporting. Read https://jeetsanwal.in/privacy for the reporting endpoint, retention, and deletion details. Reporting does not authorize remote control, automatic updates, or access to the website.

== Changelog ==

= 1.0.5 =
* Updated the product display name to Jeet Sanwal Daily Production Sheet and retained the Jeet Sanwal author website.
* Added voluntary installation/status reports with per-product consent OFF by default, pause/forget controls, and documented fields and retention.
* Preserved existing identifiers, stored data, permissions, and earlier release history.


= 1.0.4 =
* Protected CSV cells against formula prefixes hidden behind Unicode spacing, invisible characters or invalid UTF-8.

= 1.0.3 =
* Added a complete US English installation and update guide; kept documented permissions, limits and manual rollback steps.


= 1.0.2 =
* Clarified the manual replacement, verification and rollback workflow, with direct author support details.
* Rechecked package metadata, source/archive consistency and existing isolated regressions.


= 1.0.1 =
* Check per-order editing permission before reading status, dates or line items; apply filters only after that check.
* Keep candidate batches independent of selected status/date and show only editable current-batch counts with explicit scope warnings.

= 1.0.0 =
* Initial self-hosted release: net preparation quantities, manual production dates, bounded reports, print and protected CSV export.
