Navgold Forecast Report
The master replenishment worksheet: for every FBA Proxy SKU it fuses Amazon report files (FBA inventory, sales, Keepa, pricing) with live ERPNext stock, supplier and PO data to recommend how much to send to Amazon, and lets you raise the Material Request and Purchase Orders straight from the grid.
Purpose
- Demand planners / stock managers use it to decide replenishment quantities per Amazon SKU.
- It blends external Amazon exports (FBA inventory, units-ordered, Keepa, your-price) with internal ERPNext stock, supplier rank and open-PO data into one screen.
- It computes a sales velocity (highest weekly rate) and a forecast / program forecast with a plain-English reason per SKU.
- From the grid you can edit the per-SKU "Quantity to Transfer" and create a Material Request, Purchase Orders, or both in one action.
How to Access
Desk > Reports > Navgold Forecast Report, or /app/query-report/Navgold Forecast Report.
Report type: Script Report. Reference DocType: Proxy SKU.
Roles: System Manager, Stock Manager, Stock User, Purchase Manager, Sales Manager.
Data Inputs (Navgold Forecast Asset)
All external data is read from the single Navgold Forecast Asset doctype (a singleton holding file attachments). Each forecast run re-parses these files fresh:
| Asset field | Format | Parsed into | Key columns read |
|---|---|---|---|
fba_inventory_csv |
CSV | FBA available stock, FNSKU, receiving | sku, available, fnsku, inbound-working + inbound-shipped + inbound-received (summed → receiving) |
sales_3d_csv |
CSV | 3-day units | SKU, Units ordered |
sales_7d_csv |
CSV | 7-day units | SKU, Units ordered |
sales_14d_csv |
CSV | 14-day units | SKU, Units ordered |
sales_30d_csv |
CSV | 30-day units and 30-day revenue | SKU, Units ordered, Ordered Product Sales |
keepa_xlsx |
XLSX | Buy Box (current), Sales Rank (current) per ASIN | ASIN, any "buy box ... current" col, any "sales rank ... current" col |
your_price_xlsx |
XLSX | Your current Amazon price | seller-sku/sku, price/your-price |
previous_report_xlsx |
XLSX | Previous run's highest weekly rate (for sales-drop check) | sku, any "highest ... weekly ... rate" col |
The SKU universe is driven by the FBA inventory CSV — only SKUs present there are matched to Proxy SKUs via get_proxy_sku_map(). If no Proxy SKUs match, the report returns empty.
Filters
| Filter | Type | Required | Description |
|---|---|---|---|
| Brand | Link (Brand) | No | Show only rows whose Item brand matches |
| Strategy | Select (FBA / SFP) | No | Filter by the computed strategy column |
| Comment | Select (Active / No Sales / Not Listed) | No | Filter by the computed comment column |
(Filters are applied in-memory after all rows are built.)
Columns
| Column | Type | Description |
|---|---|---|
| SKU | Link (Proxy SKU) | The Amazon Proxy SKU |
| FNSKU | Data | Amazon FNSKU from FBA inventory file |
| Brand | Link (Brand) | Item brand |
| Title | Data | Item name |
| Variant Multiplier | Float | UOM conversion factor (item+uom) → singles per SKU unit; defaults 1 |
| ASIN | Data | Amazon ASIN from Proxy SKU |
| Sales Rank Current | Int | Current sales rank from Keepa (by ASIN) |
| FBA Fulfillable Stock | Float | available from FBA inventory file |
| eBay Sales | Float | Always 0 (placeholder, not yet sourced) |
| FBA Sales | Float | 30-day qty on submitted Sales Orders, channel AFN |
| SFP Sales | Float | 30-day qty on submitted Sales Orders, channel MFN |
| Total Sales | Float | FBA Sales + SFP Sales |
| Sales 3D / 7D / 14D / 30D | Float | Units ordered from the matching sales CSVs |
| Free Stock | Float | Free (available) qty in ERPNext from get_free_qty_map |
| Instocks | Float | Outstanding qty on open Purchase Orders (qty − received_qty) |
| Receiving | Float | Inbound qty in transit to FBA (sum of inbound-* columns) |
| Current | Float | Qty on open/partly-delivered Pick Lists (Material Transfer) |
| Highest Weekly Rate | Float | Velocity = max(week1, week2, weeks3_4) (see formula) |
| Previous Highest Weekly Rate | Float | Highest weekly rate from previous report XLSX |
| 3 Week Lead Time Stock | Float | FBA buffer beyond 3 weeks of demand = max(0, fba − rate×3) |
| 30D Revenue | Currency | Ordered Product Sales from 30-day CSV |
| Buy Box Current | Currency | Current Buy Box price from Keepa |
| Fulfilment Cost Type | Data | Reserved (always blank) |
| Fulfilment Cost | Currency | Reserved (always 0) |
| Your Price | Currency | Current Amazon price from your-price XLSX |
| Min Price | Currency | current_min_price of the active Amazon Product Pricing strategy |
| Min Margin | Percent | min_margin of the active strategy |
| Strategy | Data | FBA if FBA stock > 0 else SFP |
| Top Supplier | Link (Supplier) | Supplier with rank = 1 for the item |
| Top Supplier Cost | Currency | That supplier's price |
| Current Month Offer | Data | Top supplier's 1st Supplier Offer row (idx 1) |
| Next Month Offer | Data | Top supplier's 2nd Supplier Offer row (idx 2) |
| 4 Week Forecast | Float | highest_weekly_rate × 4 |
| Forecast | Float | hwr×3 − instocks − current − receiving − three_week_lt |
| Ranking | Data | High if sales rank > 50000, No Rank if 0, else blank |
| Sales Dropped | Data | YES if last-7d sales fell ≥35% vs baseline velocity (and FBA stock > 0) |
| Program Forecast | Data | Recommended send qty (or Margins) from the program decision tree |
| Program Reason | Data | Plain-English reason for the program forecast |
| Total Forecast | Float | highest_weekly_rate + forecast |
| PO Count | Int | Number of open POs containing the item |
| Total Qty on Order | Float | Sum of qty on open POs |
| Comment | Data | Not Listed (no ASIN), Active (any sales), else No Sales |
| Quantity to Transfer | Float | Editable in grid (default 0); drives MR/PO creation |
How It Works
flowchart TD
subgraph Files[Navgold Forecast Asset files]
FBA[FBA inventory CSV]
S3[sales 3/7/14/30 CSV]
KP[Keepa XLSX]
YP[Your Price XLSX]
PR[Previous Report XLSX]
end
FBA -->|SKU list| PS[get_proxy_sku_map]
PS --> ERP
subgraph ERP[ERPNext lookups by item_code]
IT[Item brand/name]
SUP[Supplier Item Price rank=1 + Offers]
PRC[Amazon Product Pricing active strategy]
PO[Open Purchase Orders]
SO[30d Sales Orders by channel]
PK[Open Pick Lists]
FQ[Free Qty map]
end
S3 --> CALC
KP --> CALC
YP --> CALC
PR --> CALC
ERP --> CALC[Per-SKU calc:\nhighest weekly rate\nforecast / program forecast\nstrategy / comment / ranking]
CALC --> ROWS[Report rows]
ROWS -->|edit Qty to Transfer + select| ACT[Create MR / PO / both]
ACT --> MR[Material Request - Transfer]
ACT --> POs[Purchase Orders per top supplier]
Key formulas (from the code):
- Highest Weekly Rate =
max(week1, week2, weeks3_4)whereweek1 = sales_7d,week2 = max(0, sales_14d − sales_7d),weeks3_4 = max(0, sales_30d − sales_14d) / 2. This picks the busiest recent week as the demand signal. - 3 Week Lead Time Stock =
max(0, fba_stock − rate×3)— FBA cover beyond three weeks. - Forecast =
rate×3 − instocks − current − receiving − three_week_lt— three weeks of demand minus everything already inbound/on-hand. - Sales Dropped =
YESwhen(sales_7d / max(hwr, prev_hwr)) − 1 ≤ −0.35and FBA stock > 0 (a ≥35% week-over-week velocity drop on a stocked SKU).
Program Forecast decision tree (compute_program_forecast, evaluated top-down; first match wins):
- No Buy Box price → blank, "No Buy Box price".
- FBA stock ≈
sales_7d × 4→0, "Enough FBA stock (≈7dX4)". - Zero 3d & 7d sales but
min_margin > 0.05and forecast > 0 → ifthree_week_lt ≥ hwr×4send0(hold, high lead-time), else sendforecast + hwr. - Forecast < 0, or zero recent sales, or
min_margin ≤ 0.05→ if low margin returnMargins/ "Low margin", else0/ "hold". - FBA stock ≥
sales_7d×4→0, "AFN alone covers 4 weeks; hold". - Total buffer (fba+instocks+current+receiving) ≥
sales_7d×4→ sendforecast + hwrif lead OK, else hold. - Otherwise →
forecast + hwr, "Insufficient buffer; send".
The 0.05 margin floor and the sales_7d × 4 (four-week) coverage target are the core thresholds.
Creating MR / POs from the grid — three whitelisted actions back the inner buttons:
- Create Material Request →
create_material_requests_from_forecast_report: one submitted Material Request (type Material Transfer) into the AFN warehouse (from Amazon SP API Settings) for every selected SKU with Qty to Transfer > 0. - Create PO + Material Request →
create_purchase_orders_and_material_request_from_forecast_report: builds the transfer MR, then groups selected SKUs by top supplier and raises one submitted Purchase Order per supplier (qty converted into the supplier's UOM, rounded up viaceil), and back-links each MR item to its PO viacustom_purchase_order. - A PO-only action (
create_purchase_orders_from_forecast_report) also exists. POs use the company + warehouse from Amazon SP API Settings.
Notes
- The whole report re-parses the attached files on every run — keep Navgold Forecast Asset current. Amazon report exports are GZIP/cp1252; the asset stores the decoded CSV/XLSX attachments.
eBay Sales,Fulfilment Cost TypeandFulfilment Costare placeholders (0/blank) — not yet wired to a source.- Qty edits live only in the browser session (
forecast_report_state) until you trigger a create action; refreshing the report clears them. - Strategy here is the simple
FBA vs SFPstock check — the full FBA/SFP/Backorder/Default selection lives in the pricing subsystem, not this report. - Related: To Purchase consumes the Material Requests this report creates and drives the supplier-ranked PO run.