=== OrderStock by TulipWork ===
Contributors: tulipwork
Donate link: https://paypal.me/ziyadbachalany
Tags: stock, inventory, order management, supplier, restaurant
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 1.9
Requires PHP: 7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Easy stock and order management for merchants, restaurants and organizations.

== Description ==
OrderStock offers a clear, easy way to handle your stock and orders smoothly. Perfect for a busy restaurant, a shop, or any business wanting dependable stock management, this plugin helps you stay on top and saves you time. 🌈

### Free Features – Get Started Today! 🎉
- **Effortless Stock Updates**: Adjust stock levels on the fly with a sleek, mobile-ready interface—perfect for busy days.
- **Smart Order Suggestions**: Let OrderStock crunch the numbers! Choose between **Forecast Mode** (daily sales × replenishment period) or **Threshold Mode** (critical threshold & target stock) to get tailored order quantities with a Trend Score twist, capped by maximum limits.
- **One-Click Orders**: Generate professional PDF order forms and email suppliers directly from your WordPress dashboard. 📧
- **Supplier Simplicity**: Link products to suppliers and filter them effortlessly for quick management.
- **WhatsApp Ordering**: Send orders directly to suppliers via WhatsApp with a single click. 📲

Ideal for restaurants, retailers, caterers—or anyone who craves simplicity with power. Crafted by **[Tulipe Media](https://tulipemedia.com/en/product/orderstock-pro/)** to fuel your success.

### Watch the quick video introduction 📺
[youtube https://www.youtube.com/watch?v=Zys3ucOLULM]

### Pro Features – Level Up Your Workflow! ✨
Supercharge your business with a premium license from **[tulipemedia.com](https://tulipemedia.com/en/product/orderstock-pro/)**:
- **Import/Export Made Easy**: Seamlessly transfer product data with CSV files—perfect for bulk updates.
- **Order History & Reception**: Track every order, update received quantities, log actual costs, and tweak statuses with ease.
- **Bulk Editing Power**: Save hours by assigning multiple suppliers, tax rates, or stores to products in one go.
- **Multiple Suppliers**: Flexibility at its finest—assign several suppliers per product for smarter sourcing.
- **Multi-Store Mastery**: Run multiple locations? Manage them all from one dashboard with centralized stock tracking.
- **Central Kitchen Magic**: Streamline orders to a main warehouse or kitchen for efficient production.
- **Order Consolidation**: Combine orders into a single prep list—ideal for kitchens or warehouses.
- **Team Permissions**: Add users with custom roles (stock editors, order managers, etc.) to delegate tasks securely.
- **Inventory Snapshots**: Capture stock at any moment for accounting or audits with detailed PDF/CSV exports.
- **Insightful Reports**: Dive into advanced analytics and real-time cost tracking to optimize your operations.

**[Explore Pro Features & Docs](https://tulipemedia.com/en/product/orderstock-pro/)** – Transform how you manage stock!

### Why Choose OrderStock? 🌟
- **Lightweight & Fast**: No bloat—just the tools you need, running smoothly on any device.
- **User-Friendly**: Designed with real merchants in mind—no tech degree required!
- **Community-Driven**: Join users worldwide who trust OrderStock to keep their businesses humming.

== Contribute ==
- 🌐 **Translate**: Help make the plugin accessible worldwide! Contribute translations at [WordPress Translate](https://translate.wordpress.org/projects/wp-plugins/orderstock/). Every word counts!
- **Donate**: Support ongoing development with a coffee! ☕ [Donate now](https://paypal.me/ziyadbachalany).
- **Rate Me**: Love the plugin? Share a 5-star review on [WordPress.org](https://wordpress.org/support/plugin/orderstock/reviews/#new-post) to help others discover it.

### Stay Connected! 📱
Keep in touch with me:
- [Instagram](https://instagram.com/ziyadbachalany/)
- [LinkedIn](https://www.linkedin.com/in/ziyadbachalany/)
- [X](https://x.com/ziyadbachalany)
- [Facebook](https://www.facebook.com/ziyadbachalany)
- [Tulipemedia](https://tulipemedia.com/en/product/orderstock-pro/)

== Translations ==
OrderStock includes built-in translations for: English, French, Japanese, Simplified Chinese, Polish, Russian, Dutch, Portuguese (Brazil), Portuguese (Portugal), German, Italian, and Spanish.

== Installation ==
1. Upload the `orderstock` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to the 'OrderStock' menu in your admin dashboard to get started.
4. Add suppliers (`Suppliers` post type) and products (`Products` post type) to begin managing your stock.

== Frequently Asked Questions ==
= How does OrderStock calculate order suggestions? =
Choose your style:
- **Forecast Mode**: Multiplies daily sales by replenishment periods, adjusts with a Trend Score, and respects max quantities.
- **Threshold Mode**: Suggests orders when stock dips below a critical threshold, aiming for a target level—Trend Score adjustable.
Both modes make ordering a breeze! 🌬️

= Can I manage stock from my phone? =
Absolutely! OrderStock’s responsive design shines on mobile, letting you update stock or place orders anywhere, anytime.

= Can I customize quantity precision? =
Yes! In both Free and Pro, set decimal precision (0-3) for each product to match your stock needs—great for items sold by weight or volume. 🎯

= What happens if I disable or uninstall OrderStock? =
No worries! Disabling OrderStock just pauses it—your products, suppliers, and orders stay safe in WordPress, ready when you are. Uninstalling removes the plugin, but your data hangs on unless you turn on the “Delete Data on Uninstall” option in settings (available in both Free and Pro). You’re always in charge! 😊

= How does multi-store work in Pro? =
OrderStock Pro lets you assign products to specific stores, track stock per location, and filter orders or inventories by store. It’s your control hub for multiple outlets! 🏪

= Can I generate reports without Pro? =
Free gives you basic stock tracking, but Pro unlocks powerful reports with insights by period, supplier, store, and category—plus real-time cost tracking. 📊

= How can I manage a team with OrderStock? =
With Pro, add users with custom roles (e.g., stock editors, order managers) to delegate tasks securely while you stay in charge. Teamwork made simple! 🤝

== Screenshots ==
1. **Mobile View**: Manage your stock and orders seamlessly on the go with a fully responsive, user-friendly design.
2. **Stock Management**: Update stock levels with a clear, category-filtered view—all in one place.
3. **Place an Order**: Preview and send orders with supplier-specific totals and PDFs.
4. **Order Warnings**: Preview critical alerts before ordering, like "Do not include prices in the generated order," "Force order despite Threshold," or "The following suppliers have no email address."
5. **Product Editing**: Fine-tune product details with precision—set stock levels, supplier info, pricing, tax rates, and packaging, all from a single, intuitive interface.
6. **Settings Page**: Configure your stock and order preferences—set admin emails, tax rates, order modes, and more from a simple interface.
7. **Generated Order PDF**: View the professional PDF order form received via email, complete with supplier details and totals.

== Changelog ==
= 1.9 =
* Added: Dynamic version detection using for better maintainability and update reliability.

= 1.8 =
* Fixed: Trend Score values no longer carry over when switching between stores in multistore mode.
* Improved: System now automatically triggers orders when stock equals the critical threshold.

= 1.7 =
* Improved: Removed unnecessary minimum order threshold warning after order confirmation for a smoother user experience.
* Optimized: Minor performance and usability enhancements for better reliability.

= 1.6 =
* Added: minimum order threshold warning.
* Added: Detailed error messaging and logging for minimum order threshold validation.
* Improved: Quantity calculations for measured units (kg, L) ensuring accurate totals in PDF outputs.
* Fixed: Trend Score application failing for products with packaging_quantity > 1.

= 1.5 =
* Added support for multiple comma-separated email addresses for suppliers in the Supplier Details metabox.
* Improved email validation and display in order PDFs for both free and Pro versions.

= 1.4 =
* Fixed incorrect rounding of quantities for measured units.
* Updated "Quantity to Order" field to display adjusted quantity after preview for consistency.
* Added alphabetical sorting by category (using the first assigned category) and product name in the 'Place an Order' product table, ensuring consistent ordering in the initial list, preview, and PDF.

= 1.3 =
* Added: New button to send supplier orders directly via WhatsApp for quick communication.
* Added: Option to download supplier orders as PDF for easy sharing and record-keeping.
* Improved: Enhanced "Delete Data on Uninstall" feature for better clarity and reliability.
* Added: New "Delete All Data Immediately" option for instant data removal when needed.
* Fixed: Resolved supplier-related bug to ensure accurate order processing.

= 1.2 =
* Added compatibility with WordPress 6.8.
* Added a support tab for easier user assistance.
* Improved uninstall process by cleaning up roles.

= 1.1 =
* Added: Ability to assign multiple suppliers to a single product.
* Added: New calculation mode based on critical threshold and target order quantity.
* Fixed: Minor bug fixes and performance optimizations.

= 1.0 =
* Initial release: Simple, powerful stock and order management with pagination in Order History.

== Upgrade Notice ==
= 1.9 =
Uses dynamic version detection for better reliability. Safe to update.

= 1.8 =
Minor optimizations and improvements for a better user experience. Update to benefit from these enhancements.

= 1.7 =
Minor optimizations and improvements for a better user experience. Update to benefit from these enhancements.

= 1.6 =
Upgrade for a new minimum order threshold warning, improved error messaging, accurate quantity calculations for measured units, and a fixed Trend Score for packaged products.

= 1.5 =
Version 1.5 introduces support for multiple email addresses for suppliers. Ensure to test email sending and PDF generation after updating to verify compatibility with your setup.

= 1.4 =
This update fixes quantity rounding issues for measured units, ensures the "Quantity to Order" field reflects adjusted values, and improves notifications for discrete units to clearly display package counts. Upgrade to enhance ordering accuracy and user experience.

= 1.3 =
Upgrade to OrderStock 1.3 to enjoy new WhatsApp order sharing, PDF downloads, and improved data deletion options. This update also fixes a supplier bug for smoother operations. Back up your data before upgrading.

= 1.2 =
This update ensures compatibility with WordPress 6.8, adds a support tab, and improves the uninstall process by cleaning up roles.

= 1.1 =
* Added: Ability to assign multiple suppliers to a single product.
* Added: New calculation mode based on critical threshold and target order quantity.
* Fixed: Minor bug fixes and performance optimizations.

= 1.0 =
First version—no upgrades needed yet! Stay tuned for premium features.

== License ==
OrderStock is free software released under GPLv2 or later. Enjoy and share!