For each module you get: purpose, key fields, validation rules, calculation logic with formulas, a complete worked example, and edge cases. All formulas are presented exactly as the engine applies them, so a consultant can reproduce any number on screen.
Where: iVendNext → Foresight → Inventory Forecast
Predicts how many units of one item will be consumed from one warehouse over the forecast period, computes the reorder point, suggests a purchase quantity, and (optionally) drafts a Purchase Order.
Items and warehouses are mandatory.
Company is derived from the warehouse; a mismatch is rejected.
Current stock is read from the live balance and cannot be typed manually.
The preferred supplier is set automatically when one can be determined.
The engine uses a trend-fit when there is enough movement history (at least ten consumption events in the recent window), otherwise a moving average.
Trend-fit path:
daily_avg = average daily consumption from the fitted trend
confidence = how well the trend fits, scaled to 50–95 %
movement type:
daily_avg > 2 → Fast Moving
daily_avg > 0.5 → Slow Moving
else → Non Moving
safety_factor = 1.5 if Fast Moving else 1.2
reorder_level = daily_avg × lead_time × safety_factor
suggested_qty = daily_avg × (forecast_period + lead_time) (minimum 1)
reorder_alert = current_stock ≤ reorder_level
Moving-average path:
daily_consumption = total consumption (last 90 days) / max(30, days with consumption)
predicted_consumption = daily_consumption × forecast_period
movement type:
daily > 5 OR active days > 15 → Fast Moving (confidence 85)
daily > 1 OR active days > 5 → Slow Moving (confidence 70)
daily > 0.1 → Non Moving (confidence 50)
else → Critical (confidence 40)
reorder_level = daily_consumption × lead_time × safety_factor
suggested_qty = Fast → daily × 45 (1.5 months)
Slow → daily × 60 (2 months)
else → daily × 30 (1 month)
If anything prevents a forecast (for example, no history at all), the item is marked Critical with a conservative reorder level and an alert is raised, so it is never silently ignored.
Observed over the last 90 days:
Total consumption: 600 units · Days with sales: 45 · Lead time: 14 days · Current stock: 80 units · Forecast period: 30 days
Step 1: daily consumption
daily = 600 / max(30, 45) = 600 / 45 = 13.33 units/day
Step 2: movement type (moving-average path)
daily 13.33 > 5 AND active days 45 > 15 → Fast Moving (confidence 85 %)
Step 3: predicted consumption
predicted = 13.33 × 30 = 400 units
Step 4: reorder level
safety_factor = 1.5 (Fast Moving)
reorder_level = 13.33 × 14 × 1.5 = 280 units
Step 5: suggested quantity
suggested_qty = 13.33 × 45 = 600 units
Step 6: reorder alert
current_stock 80 ≤ reorder_level 280 → alert ON
Result on screen: Fast Moving · 400 predicted · reorder at 280 · suggest 600 · Alert ON. With auto-PO enabled and a preferred supplier set, a draft Purchase Order for 600 units is created, scheduled 14 days out, for the buyer to review.
This is triggered when all of these are true: reorder alert, auto-create PO, and a preferred supplier. The system then:
Skips if the suggested quantity is zero or less.
Skips if a purchase order for this item was already raised in the last 7 days (this prevents duplicates).
Chooses the best supplier (by price and delivery performance where available, otherwise the most recent supplier used).
Creates a draft Purchase Order, scheduled by the item's lead time, for the suggested quantity.
Leaves the order as a draft for the buyer to review and submit. The human stays in control.
Never promise customers fully automatic, unattended PO submission. By design, Foresight drafts the order and the buyer approves it.
Where: iVendNext → Foresight → Sales Forecast
Predicts how many units of an item a specific customer will buy in the forecast period, plus revenue potential, churn risk, cross-sell score, and seasonality. Drives the Sales Dashboard and, optionally, auto-Sales-Order creation.
Item · Customer · Territory · Company · Forecast period (default 30) · Forecast date · Predicted quantity · Sales trend (Increasing / Decreasing / Stable / Volatile) · Movement type · Confidence score · Actual quantity · Accuracy score · Sales alert · Demand pattern · Customer score · Market potential · Seasonality index · Revenue potential · Cross-sell score · Churn risk (Low / Medium / High / Unknown) · Sales velocity · Auto-create Sales Order · Delivery days (default 7).
Negative predicted quantity is corrected to zero.
On save, the sales trend and movement type are set from the predicted quantity:
sales_velocity = predicted_qty / forecast_period.
Consultant note. Because movement type is derived from predicted quantity on every save, customer-specific movement thresholds are not configurable today. Flag this in the blueprint if a customer needs custom thresholds.
Uses a pattern-learning approach per item when there is enough history (at least ten data points), trained on calendar signals, recent averages, lags, the rate, customer segment, and churn probability.
When history is sparse, it falls back to a recency-weighted simple forecast:
base_qty = average quantity over the last 90 days
recency_factor = higher weight for recent activity
weekend_factor = 0.7 on weekends, 1.0 on weekdays
seasonal_factor= ±10 % by month
trend_factor = small daily trend adjustment
predicted_day = base_qty × weekend × seasonal × trend × recency
confidence = 60 + transaction-volume bonus + recency bonus + stability bonus (capped 50–95)
Confidence (pattern-learning path):
data_points = sales transactions for this item × customer over 90 days
confidence = min(70 + data_points × 2, 95)
reduced by 20 (floor 50) if predicted quantity ≤ 0
Observed: 12 invoices over 90 days · total 84 units · average rate ₹450 · last order 4 days ago · rising trend.
predicted_qty = 18 units (next 30 days)
data_points = 12
confidence = min(70 + 12×2, 95) = 94 %
movement (qty>10) = Increasing / Fast Moving
sales_velocity = 18 / 30 = 0.6
customer_score = 30 + min(12×5,40) + min(84×450/10000×30,30) = 30 + 40 + 11 = 81
market_potential = 75 × 0.94 × (0.5 + min(18/100,1)×0.5) = 41.6 %
seasonality_index = 1.2 (rising)
revenue_potential = 18 × 450 = ₹ 8 100
churn_risk = Low (rising)
demand_pattern = "Growth"
How to read it: "ACME will buy about 18 units next month, worth ₹8 100. They are a high-value customer (score 81), with low churn risk and strong cross-sell potential."
When enabled, Foresight selects forecasts due in the next 7 days with confidence above the threshold (default 85 %) and a positive quantity, skips any customer/date that already has a sales order, and prepares the order. Recommendation: keep auto-SO off until at least 30 days of accuracy tracking shows the forecasts are trustworthy, then pilot on one customer or item group. Always pair it with credit-limit checks.
Where: iVendNext → Foresight → Financial Forecast
The master finance forecast. Cashflow, Revenue, and Expense forecasts all roll up here, and accuracy and alerts hang off it.
Company · Account · Account type · Forecast type (Cash Flow / Revenue / Expense / Balance Sheet / P&L) · Start/End date · Period (days) · Prediction model · Predicted amount · Upper/Lower bound · Confidence score · Confidence threshold · Forecast accuracy · Volatility score · Data quality score · Risk category (Low / Medium / High / Critical) · Trend direction · Current balance · Auto-sync · Sync frequency · Sync status · Forecast alert.
Forecast type must be one of the five allowed values.
End date must be after the start date (otherwise it is derived from the period).
Confidence score between 0 and 100.
Upper bound must be greater than lower bound (a built-in correction can swap them if reversed).
Negative predicted amount is allowed only for Expense and Cash Flow.
Account-type vs forecast-type compatibility:
volatility_score = (upper_bound − lower_bound) / |predicted_amount| × 100 (0–100)
forecast_accuracy = ≥ 80 High | ≥ 60 Medium | else Low
risk_category = confidence ≥ 75 AND volatility ≤ 30 → Low
| confidence ≥ 60 AND volatility ≤ 50 → Medium
| confidence ≥ 40 → High
| else → Critical
trend_direction = change vs last forecast:
> +5 % Increasing | < −5 % Decreasing | |change| > 2 % Volatile | else Stable
forecast_alert = confidence < threshold
OR risk ∈ {High, Critical}
OR volatility > 75
Inputs: predicted ₹ 12 50 000 · upper ₹ 14 00 000 · lower ₹ 11 00 000 · confidence 78 · current balance ₹ 11 80 000 · prior forecast ₹ 11 80 000.
volatility = (14 00 000 − 11 00 000) / 12 50 000 × 100 = 24 %
accuracy band= 78 → Medium
risk = confidence 78 ≥ 75 AND volatility 24 ≤ 30 → Low
trend = +5.9 % vs prior → Increasing
alert = confidence ≥ threshold, risk Low, volatility ≤ 75 → no alert
balance check= 11 80 000 above all thresholds, prediction within 6 % → healthy
This is a healthy forecast, and the system queues the Cashflow detail automatically.
It does not run a model itself. It records the chosen model and scores the prediction's risk, volatility, and quality. The forecasting itself happens in the engines and in the detail modules below.
A line-itemised cash inflow / outflow projection per company per month.
Inflows: receivables collection, sales forecast amount, other income, investment returns, loan proceeds. Outflows: payables payment, inventory purchases, operating expenses, capital expenditure, loan payments.
predicted_inflows = Σ inflow components
predicted_outflows = Σ outflow components
net_cash_flow = inflows − outflows
closing_balance = opening_balance + net_cash_flow
surplus_deficit = closing_balance − minimum_cash_required
liquidity_ratio = inflows / outflows × 100 (100 if no outflows)
data_completeness = filled(receivables, payables, opex) / 3 × 100
ratio_health = liquidity ≥ 120 → 90 | ≥ 110 → 80 | ≥ 100 → 70 | ≥ 90 → 60 | else 40
confidence = (data_completeness + ratio_health) / 2
risk_score = liquidity < 100 → 90 | < 110 → 70 | < 130 → 40 | else 20
seasonal_factor = Oct–Dec 1.2 | Jan–Feb 0.8 | Jun–Aug 0.9 | else 1.0
alert_status = surplus_deficit < 0 → Critical | liquidity < 110 → Warning | else Normal
When inflow/outflow fields are left blank, Foresight populates them automatically from the company's cash and bank account movement for the month.
Inputs: receivables ₹ 18 00 000 · payables ₹ 9 50 000 · inventory purchases ₹ 4 00 000 · opex ₹ 3 50 000 · opening ₹ 5 00 000 · minimum cash ₹ 2 00 000.
inflows = 18 00 000
outflows = 17 00 000
net_cash_flow = 1 00 000
closing_balance= 6 00 000
surplus_deficit= 4 00 000
liquidity_ratio= 105.9 %
confidence = (100 + 70)/2 = 85
risk_score = 70 (liquidity < 110)
alert_status = Warning (surplus positive but liquidity below 110)
Reading: This is a healthy month with a ₹4 lakh surplus, but liquidity is just below the comfort line. Accelerate collections or defer one large payment.
Revenue projection by category (product, service, recurring, one-time, commission, other) with growth, seasonality, market, and risk factors.
total_predicted_revenue = Σ revenue categories
growth_rate = (current − previous) / previous × 100
confidence_score = min(95, max(50, 80 + growth_rate × 0.3))
seasonal_factor: Nov–Dec 1.3 | Jan–Feb 0.7 | Jun–Aug 0.9 | Sep–Oct 1.1 | else 1.0
market_factor: growth > 10 → 1.2 | growth < −5 → 0.8 | else 1.0
risk_adjustment: +10 if |growth| > 20, +15 if confidence < 70, +10 if any category > 80 % of total
trend_direction: growth > 5 Increasing | < −5 Decreasing | else Stable
When a revenue figure is needed, Foresight can populate it automatically from the company's confirmed sales for the period.
Inputs: product ₹ 32 00 000 · service ₹ 4 00 000 · recurring ₹ 3 00 000 · prior period ₹ 30 00 000.
total = 39 00 000
growth_rate = (39 − 30)/30 × 100 = 30 %
confidence = min(95, 80 + 30×0.3) = 89 %
seasonal_factor = 1.3 (November)
market_factor = 1.2 (growth > 10)
risk_adjustment = 10 % (growth > 20)
trend = Increasing
Reading: "A strong month, up 30 % on the prior period, with November seasonality reinforcing it. A conservative risk-adjusted view is about ₹35 lakh."
Expense projection with category breakdown, variance against actuals, and optimisation suggestions.
Categories: fixed, variable, semi-variable, inventory-related, operational, administrative. Inventory-linked costs: storage, handling, purchase-related, reorder, carrying, stockout.
total_predicted_expense = Σ categories + Σ inventory-linked costs
variance_percentage = (actual − forecast) / forecast × 100
confidence_score = clamp(85 − |variance%| × 0.3, 50, 95)
risk factors: variance risk, category-concentration risk, trend risk → weighted overall risk
alert_status: risk ≥ 70 Critical | ≥ 40 Warning | else Normal
optimisation: actual > forecast × 1.10 → high-priority suggestion
actual < forecast × 0.90 → underutilisation note
Inputs: fixed ₹ 2 50 000 · variable ₹ 1 80 000 · inventory-related ₹ 60 000 · operational ₹ 1 20 000 · admin ₹ 40 000 · carrying ₹ 30 000 · last-month actual ₹ 7 00 000.
total_predicted = 6 80 000
variance% = (7 00 000 − 6 80 000)/6 80 000 × 100 = 2.94 %
confidence = 85 − 2.94 × 0.3 ≈ 84 %
overall_risk = low (~1.2)
alert_status = Normal
Reading: "The forecast holds. Actuals came in within 3 % of forecast, so the expense profile is healthy."