Day 027 / Frappe / Inventory Planning

Stock Reorder Calculator

View source ↗Scroll to explore ↓
Stock Reorder Calculator project cover
/ Overview

A dependency-free Python CLI that turns sanitized stock-policy inputs into reviewable reorder suggestions without connecting to ERPNext or changing inventory.

NameStock Reorder Calculator

ClientIndependent daily build

IndustriesDeveloper and operations tooling

DateDay 027 · September 26, 2026

/ Challenge

A low on-hand quantity does not tell the whole replenishment story. A useful review also needs expected usage during lead time, safety stock, quantities already on order, minimum-order rules and complete pack sizes.

/ Provided services

Clear thinking.
Practical delivery.

01

Reorder calculation

Combines average daily usage, lead time and safety stock into a clear reorder point for each supplied item.

02

Practical quantity rules

Subtracts current and on-order supply, honors a minimum order and rounds upward to a complete pack.

03

Review-only reporting

Generates deterministic text or JSON recommendations while leaving inventory, suppliers and purchase documents untouched.

Stock Reorder Calculator feature visual
/ Solution

Stock Reorder Calculator validates a sanitized JSON item list, calculates each reorder point and available supply, identifies shortages, then rounds a suggested quantity to the configured minimum and pack size. It produces text or JSON without connecting to ERPNext, reading suppliers, changing stock or creating purchase orders.

/ Impact

Usage-and-lead-time reorder points

On-order quantity included

Minimum order and pack rounding

Bounded sanitized JSON input

No ERP or purchasing mutation

Eleven passing standard-library tests

/ Tech stack

Python standard library

Argparse, dataclasses, pathlib, math and JSON provide the complete dependency-free command-line workflow.

Inventory planning

Uses a documented reorder-point formula with explicit supply, safety-stock, minimum-order and pack-size inputs.

Unittest

Eleven tests cover calculations, rounding, on-order stock, validation, duplicate items, output ordering and the non-mutating notice.

Next project

Naming Series Tester

View case study ↗