Changeset 3365371
- Timestamp:
- 09/21/2025 05:53:25 PM (6 months ago)
- Location:
- orderstock/trunk
- Files:
-
- 2 edited
-
includes/order-page.php (modified) (5 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
orderstock/trunk/includes/order-page.php
r3295841 r3365371 127 127 $suppliers = get_posts(['post_type' => 'tulipwork_supplier', 'posts_per_page' => -1]); 128 128 $selected_supplier = isset($_GET['supplier_filter']) ? sanitize_text_field(wp_unslash($_GET['supplier_filter'])) : ''; 129 $transient_key = 'tulipwork_orders_' . get_current_user_id() ;129 $transient_key = 'tulipwork_orders_' . get_current_user_id() . '_' . $selected_store; 130 130 $manual_orders = isset($_POST['order']) ? array_map('floatval', wp_unslash($_POST['order'])) : (get_transient($transient_key) ?: []); 131 131 $trend_score = isset($_POST['trend_score']) ? floatval($_POST['trend_score']) : 1; … … 184 184 $quantity_to_order_raw = (($replenishment_period * $daily_sales) * $trend_score) - $stock; 185 185 } else { 186 $quantity_to_order_raw = ($stock < $critical_threshold) ? ($target_stock * $trend_score) - $stock : 0;186 $quantity_to_order_raw = ($stock <= $critical_threshold) ? ($target_stock * $trend_score) - $stock : 0; 187 187 } 188 188 $measured_units = ['kg', 'l']; … … 586 586 'file' => $pdf_file, 587 587 'filename' => $pdf_filename, 588 'expires' => time() + 259200588 'expires' => time() + (7 * DAY_IN_SECONDS) 589 589 ]; 590 590 update_option('tulipwork_orderstock_pdf_tokens', $pdf_tokens); … … 780 780 $quantity_to_order_raw = (($replenishment_period * $daily_sales) * $trend_score) - $stock; 781 781 } else { 782 $quantity_to_order_raw = ($stock < $critical_threshold) ? ($target_stock * $trend_score) - $stock : 0;782 $quantity_to_order_raw = ($stock <= $critical_threshold) ? ($target_stock * $trend_score) - $stock : 0; 783 783 } 784 784 if ($quantity_to_order_raw < 0) $quantity_to_order_raw = 0; … … 817 817 <div class="quantity-container"> 818 818 <input type="number" name="order[<?php echo esc_attr($product->ID); ?>]" value="<?php echo esc_attr($display_manual_quantity); ?>" step="any" min="0" class="order-quantity" 819 data-calc="<?php echo esc_attr($effective_mode === 'forecast' ? "(($replenishment_period * $daily_sales) * $trend_score) - $stock" : "($stock < $critical_threshold ? ($target_stock * $trend_score) - $stock : 0)"); ?>"819 data-calc="<?php echo esc_attr($effective_mode === 'forecast' ? "(($replenishment_period * $daily_sales) * $trend_score) - $stock" : "($stock <= $critical_threshold ? ($target_stock * $trend_score) - $stock : 0)"); ?>" 820 820 data-packaging="<?php echo esc_attr($packaging_quantity); ?>" 821 821 data-max="<?php echo esc_attr($max_quantity); ?>" /> -
orderstock/trunk/readme.txt
r3296880 r3365371 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 Stable tag: 1. 77 Stable tag: 1.8 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 23 23 24 24 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. 25 26 ### Watch the quick video introduction 📺 27 [youtube https://www.youtube.com/watch?v=Zys3ucOLULM] 25 28 26 29 ### Pro Features – Level Up Your Workflow! ✨ … … 101 104 102 105 == Changelog == 106 = 1.8 = 107 * Fixed: Trend Score values no longer carry over when switching between stores in multistore mode. 108 * Improved: System now automatically triggers orders when stock equals the critical threshold. 109 103 110 = 1.7 = 104 111 * Improved: Removed unnecessary minimum order threshold warning after order confirmation for a smoother user experience. … … 141 148 142 149 == Upgrade Notice == 150 = 1.8 = 151 Minor optimizations and improvements for a better user experience. Update to benefit from these enhancements. 152 143 153 = 1.7 = 144 154 Minor optimizations and improvements for a better user experience. Update to benefit from these enhancements.
Note: See TracChangeset
for help on using the changeset viewer.