=== Purchase Orders & Net Terms by Random Lantern ===
Contributors: 121andrewb3
Tags: purchase order, invoice, net terms, b2b, wholesale
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Let approved WooCommerce buyers order with a PO number and pay later on Net 30 or other invoice terms. Track due dates and overdue orders.

== Description ==

Wholesale buyers often can't pay by card. They send a purchase order and expect an invoice with terms like Net 30. This plugin adds that option to your WooCommerce checkout.

Buyers choose "Purchase order", enter their PO number and see their payment terms. The order goes On hold, and you invoice them the way you already do. No money is taken at checkout.

**Choose who can use it**

* Only customers you approve, any signed-in customer, or everyone (guests included).
* Optional minimum and maximum order totals.
* Make the PO number required or optional.

On a new installation, the payment method is enabled for approved customers only. Nobody is approved automatically. Existing settings are kept when you update or reactivate the plugin.

**Payment terms and due dates**

* Due on receipt, or Net 7, 15, 30, 45, 60 or 90.
* Set a store default, and give individual customers their own terms.
* Buyers see their payment terms at checkout. Net terms count from the order date; the due date appears in order emails and their account. For due on receipt, enter the agreed date after sending your invoice.
* A Payment due column in your Orders list marks unpaid orders as Overdue. You can change any due date in the order editor.

**PO numbers**

* The PO number is saved on the order and shown in order emails.
* Search your orders by PO number.
* The same customer can't reuse a PO number by mistake. Spaces, dashes and capital letters are ignored when checking, so "PO-1042" and "po 1042" count as the same.
* Add or correct a PO number on orders you enter yourself.

**Works with**

* Classic checkout and the WooCommerce Checkout block.
* Both WooCommerce order storage types (HPOS and the older posts storage).

**Free, with nothing hidden**

No license key, trial, usage limit or account. The plugin never contacts our servers and adds no promotional links to your storefront. Links to our other tools appear only on the plugin's own settings page, its row on your Plugins screen and this page.

= More tools from Random Lantern =

Getting POs as email attachments? [PO Inbox](https://randomlantern.io/products#po-inbox) reads PDFs, scans and photos and drafts the order for you to check. [Quick Order Pad and Line Sheets](https://randomlantern.io/products) let buyers order by item code and share your catalog. They are separate paid plugins. This free plugin doesn't need them.

== Installation ==

1. Make sure WooCommerce is installed and active.
2. For a ZIP download, go to Plugins → Add New Plugin → Upload Plugin, select the ZIP, then install and activate. Once the WordPress.org listing is available, you can also search for "Purchase Orders & Net Terms by Random Lantern" on that screen.
3. After activation, the plugin opens WooCommerce → Settings → Payments → Purchase orders. If WordPress activates it without leaving the installer, the settings open on your next normal admin page visit. You can also use the plugin's Settings link.
4. Review who can use it, your payment terms and your payment instructions. New installations are enabled for approved customers only; updates keep your saved settings.
5. If you chose approved customers only, open each customer's WordPress user profile and tick Purchase order checkout. You can set their own payment terms there too.
6. Place a test order on a staging copy of your store first. PO orders go On hold, so WooCommerce may reduce stock and send its usual emails. Only mark an order paid once the money arrives.

== Frequently Asked Questions ==

= Does it send invoices or collect payment? =
No. It records the PO and puts the order on hold. Send invoices and collect payment with whatever you use today. Your payment instructions are saved with each order.

= Does it send payment reminders? =
No. It flags unpaid orders as Overdue in your Orders list so you can follow up. An order stops showing as overdue once you mark it Processing or Completed.

= Can different customers have different terms? =
Yes. Set the store default in the payment settings, then pick other terms on any customer's user profile.

= When does Net 30 start counting? =
From the order date, in your store's time zone. "Due on receipt" means when the customer receives your invoice, which the plugin can't know, so it doesn't guess a date. Enter the due date in the order editor after you send the invoice.

= Does approving a customer guarantee they'll pay? =
No. You decide who can order before paying, and agree terms with them yourself.

= Will it stop working or start charging? =
No. Every feature stays free and keeps working.

= Does it send any data to Random Lantern? =
No. There's no tracking, license check or outside service. Clicking a link to our website just opens it in your browser.

= Can it read a PO from a PDF or scan? =
No. This plugin stores PO numbers. Reading PO documents automatically is what our separate PO Inbox plugin does.

= Does it work with subscriptions? =
It works with normal WooCommerce orders. It doesn't take automatic recurring payments.

= Will it work on my hosting? =
It works on standard WordPress hosting with a MySQL or MariaDB database. If two checkouts try to use the same PO number at the same moment, it handles them one at a time. If it can't do that safely, it asks the buyer to try again rather than risk a duplicate.

= What happens if I deactivate or delete it? =
The payment option disappears from checkout. Your orders, PO numbers, due dates and customer settings stay. Nothing is deleted.

== Changelog ==

= 1.2.0 =
* Enable purchase order checkout for approved customers on new installations, without approving anyone automatically.
* Open payment settings after activation, without interrupting bulk activation, background requests or admin saves.
* Preserve saved payment settings when updating or reactivating.

= 1.1.3 =
* Clearer plugin description and setup steps, with Random Lantern in the display name. No checkout behavior changes.

= 1.1.2 =
* Clear an earlier PO number when a failed order is retried without one (optional PO mode).

= 1.1.1 =
* Renamed to Purchase Orders & Net Terms. Random Lantern remains the author.
* "Due on receipt" orders are no longer marked overdue before you enter a due date.
* Protect simultaneous retries even when the PO number is optional and blank.
* If a PO number or due date edit is invalid, neither is saved, so they can't get out of step.

= 1.1.0 =
* Payment terms (due on receipt, or Net 7 to 90) with per-customer terms.
* Payment terms shown at checkout; due dates in emails and the customer's account.
* Payment due column with Overdue flags, and an editable due date in the order editor.
* PO number can be optional.

= 1.0.1 =
* Directory preparation and clearer settings-page link.

= 1.0.0 =
* First release: PO checkout, customer approval, order limits, PO search and duplicate checks.

== Upgrade Notice ==

= 1.2.0 =
New installations start enabled for approved customers only. Existing payment settings and customer approvals are preserved.

= 1.1.3 =
Description and setup steps only. No code changes.

= 1.1.0 =
Adds Net 30-style payment terms, due dates and overdue flags. Existing orders and settings are unchanged. New orders default to Net 30.
