Masaley Logo
DashboardLotsBatchesOrdersSalesStockBillsReportsSettingsDocs

Documentation

Complete guide to using Masaley Inventory Manager

Overview
Ingredients
Lots
Batches
Sales
Finished Stock
Bill Parsing
Dashboard
Reports
Calculations & Formulas

Overview

Masaley Inventory Manager is a comprehensive inventory and costing system designed for businesses that manufacture finished products from raw materials. The system tracks ingredients, lots, batches, finished stock, and sales while automatically calculating costs, margins, and inventory values.

Key Features

  • Raw Material Management - Track ingredients and purchase lots
  • Batch Production - Record production batches with automatic cost calculation
  • Inventory Tracking - Monitor finished stock with expiry dates
  • Sales Management - Record sales with FIFO allocation
  • Analytics Dashboard - Real-time KPIs and financial insights
  • AI-Powered Bill Parsing - Automatically extract data from supplier bills
  • Advanced Reporting - Comprehensive analytics and insights

Ingredients

Ingredients are the raw materials used in production. Each ingredient has a name, unit of measurement, and category.

Creating Ingredients

To create an ingredient, click the "Add Ingredient" button and fill in:

  • Name - The name of the ingredient (e.g., "Turmeric Powder")
  • Unit - Unit of measurement (e.g., "kg", "g", "L")
  • Category - Category for organization (optional)

Usage

Ingredients are used when creating lots (purchase entries). You cannot delete an ingredient if it has associated lots.

Lots

Lots represent individual purchases of ingredients. Each lot tracks quantity purchased, rate, supplier, and current balance.

Creating Lots

When creating a lot, you need to provide:

  • Ingredient - Select the ingredient being purchased
  • Quantity - Amount purchased
  • Rate - Cost per unit
  • Supplier - Supplier name
  • Lot Number - Unique identifier for this purchase
  • Purchase Date - Date of purchase

Balance Tracking

The lot balance automatically decreases when the ingredient is used in batches. You can view the current balance on the Lots page.

CSV Import

You can import multiple lots at once using CSV. Click "Import CSV" and upload a file with columns: ingredient, quantity, rate, supplier, lotNumber, purchaseDate.

Batches

Batches represent production runs where finished products are created from raw materials. The system automatically calculates costs and creates finished stock.

Creating Batches

To create a batch:

  • Select the SKU (finished product)
  • Choose multiple ingredients and select lots for each
  • Enter the quantity used from each lot
  • Add packaging costs and variable costs
  • Enter packs produced and yield

Automatic Calculations

When you create a batch, the system automatically:

  • Calculates weighted average cost per ingredient
  • Computes total batch cost
  • Calculates COGS per pack
  • Deducts used quantities from lot balances
  • Creates finished stock entries

CSV Export

You can export batch data to CSV for external analysis using the "Export CSV" button.

Sales

Sales records track customer orders and automatically manage inventory using FIFO (First-In-First-Out) allocation.

Recording Sales

When recording a sale:

  • Order ID - Unique identifier for the order
  • Date - Sale date
  • Channel - Sales channel (e.g., "Online", "Retail")
  • SKU - Product being sold
  • Quantity - Number of packs sold
  • Price - Selling price per pack
  • Fees % - Channel fees as percentage (optional)

FIFO Allocation

The system automatically selects the oldest batches first when allocating sales. This ensures proper inventory rotation and cost tracking.

Stock Depletion

When a sale is recorded, finished stock balances are automatically reduced. If you delete a sale, the stock balance is restored.

CSV Import

Import multiple sales records at once using CSV format with columns: orderId, date, channel, sku, qty, price, feesPct.

Finished Stock

Finished stock shows all inventory of completed products, organized by SKU and batch.

Viewing Stock

The Finished Stock page displays:

  • SKU name
  • Batch ID
  • Manufacturing date
  • Expiry date
  • Packs produced
  • Packs sold
  • Current balance

Expiry Alerts

Items expiring within 30 days are highlighted in the dashboard. You can view expiry dates on the Finished Stock page.

CSV Export

Export finished stock data to CSV for inventory analysis.

Bill Parsing

The Bill Parsing feature uses AI to automatically extract purchase information from supplier bill images.

How It Works

Step 1: Upload a bill image (JPEG or PNG format)

Step 2: The AI analyzes the image and extracts:

  • Ingredient names
  • Quantities
  • Rates/prices
  • Supplier information
  • Lot numbers
  • Purchase dates

Step 3: Review and confirm the parsed data

Step 4: Map ingredients if needed and create lots automatically

Supported Formats

Currently supports JPEG (.jpg, .jpeg) and PNG (.png) image formats.

Dashboard

The Dashboard provides real-time KPIs and insights into your inventory and sales.

KPI Cards

Each KPI card shows:

  • Current Value - The metric value for the selected period
  • Description - Brief explanation of what the metric represents
  • Sparkline Chart - Visual trend over time (when data available)
  • Formula Tooltip - Hover over the "?" icon to see calculation formula

Period Selection

Use the period selector to view data for different time ranges:

  • 1d - Last 24 hours
  • 1w - Last 7 days
  • 1m - Last 30 days
  • 6m - Last 6 months
  • 1y - Last 1 year
  • 5y - Last 5 years

Sparkline Charts

Small trend charts appear below KPI values showing how the metric changed over the selected period. These provide quick visual insights into trends.

Advanced Reports

The Reports page provides detailed analytics and insights across different dimensions.

Report Types

Revenue Trends: View revenue over time with day/week/month grouping

Profitability by SKU: Compare profit margins and profitability across products

Inventory Turnover: Analyze how quickly inventory is being sold

Cost Analysis: Review cost variance and trends across batches

Date Range Selection

Use preset periods or select a custom date range to analyze specific timeframes.

Export Reports

Export any report as JSON for further analysis or archival purposes.

Calculations & Formulas

This section explains all the formulas used throughout the system for calculations.

Weighted Average Cost

Used when multiple lots of the same ingredient are used in a batch.

Formula:
Weighted Avg Cost = Σ(Quantity × Rate) ÷ Σ(Quantity) Example: Lot 1: 10 kg × ₹100/kg = ₹1,000 Lot 2: 5 kg × ₹120/kg = ₹600 Total: 15 kg Weighted Avg = (1,000 + 600) ÷ 15 = ₹106.67/kg

Batch Total Cost

Total cost of producing a batch, including raw materials and overhead.

Formula:
Batch Total Cost = Σ(Ingredient Cost) + Packaging Cost + (Variable Cost × Packs Produced) Where: Ingredient Cost = Quantity Used × Rate (from weighted average) Example: Raw Materials: ₹5,000 Packaging: ₹500 Variable Cost: ₹10/pack Packs Produced: 100 Total = 5,000 + 500 + (10 × 100) = ₹6,500

COGS Per Pack

Cost of Goods Sold per pack - the cost to produce one finished pack.

Formula:
COGS per Pack = Batch Total Cost ÷ Packs Produced Example: Batch Total Cost: ₹6,500 Packs Produced: 100 COGS per Pack = 6,500 ÷ 100 = ₹65/pack

Revenue

Total sales revenue for a period.

Formula:
Revenue = Σ(Sale Price × Quantity) Sum of all sales transactions within the selected period. Example: Sale 1: ₹240 × 2 packs = ₹480 Sale 2: ₹250 × 1 pack = ₹250 Total Revenue = ₹730

Average Selling Price

Weighted average selling price across all sales.

Formula:
Avg Sell Price = Total Revenue ÷ Total Packs Sold Example: Total Revenue: ₹730 Total Packs Sold: 3 Avg Sell Price = 730 ÷ 3 = ₹243.33/pack

Average COGS

Weighted average cost of goods sold per pack.

Formula:
Avg COGS = Σ(COGS per Pack × Packs Made) ÷ Total Packs Made Example: Batch 1: ₹65/pack × 100 packs = ₹6,500 Batch 2: ₹70/pack × 50 packs = ₹3,500 Total Packs Made: 150 Avg COGS = (6,500 + 3,500) ÷ 150 = ₹66.67/pack

Gross Margin

Profit per pack after deducting COGS.

Formula:
Gross Margin = Avg Sell Price - Avg COGS (or Contribution per Pack) Example: Avg Sell Price: ₹243.33 Avg COGS: ₹66.67 Gross Margin = ₹243.33 - ₹66.67 = ₹176.66/pack

Gross Margin Percentage

Profit margin expressed as a percentage of selling price.

Formula:
Gross Margin % = ((Avg Sell Price - Avg COGS) ÷ Avg Sell Price) × 100 Example: Avg Sell Price: ₹243.33 Avg COGS: ₹66.67 Gross Margin % = ((243.33 - 66.67) ÷ 243.33) × 100 = 72.6% ⚠️ Red Flag: Margin < 35% indicates low profitability

Inventory Value

Total value of finished stock currently on hand.

Formula:
Inventory Value = Σ(Balance × COGS per Pack) Sum of all finished stock entries, valued at COGS. Example: Batch 1: 50 packs × ₹65/pack = ₹3,250 Batch 2: 30 packs × ₹70/pack = ₹2,100 Total Inventory Value = ₹5,350

Raw Material Value

Total value of unused raw material lots.

Formula:
Raw Material Value = Σ(Lot Balance × Rate) Sum of all lot balances valued at purchase rate. Example: Lot 1: 50 kg × ₹100/kg = ₹5,000 Lot 2: 20 kg × ₹120/kg = ₹2,400 Total Raw Material Value = ₹7,400

Inventory Turnover Ratio

Measures how quickly inventory is sold.

Formula:
Turnover Ratio = Total COGS Sold ÷ Average Inventory Value Example: Total COGS Sold: ₹10,000 Avg Inventory Value: ₹5,000 Turnover Ratio = 10,000 ÷ 5,000 = 2x Higher ratio = faster inventory movement

Days to Sell Inventory

Average number of days to sell current inventory.

Formula:
Days to Sell = Average Inventory Value ÷ Average Daily COGS Where: Average Daily COGS = Total COGS ÷ Number of Days in Period Example: Avg Inventory Value: ₹5,000 Total COGS: ₹10,000 Days in Period: 30 Avg Daily COGS = 10,000 ÷ 30 = ₹333.33/day Days to Sell = 5,000 ÷ 333.33 = 15 days

FIFO Allocation

First-In-First-Out method for allocating sales to batches.

How It Works:
When a sale is recorded: 1. System identifies oldest batches first 2. Allocates quantity from oldest batch 3. If more quantity needed, uses next oldest batch 4. Continues until sale quantity is fulfilled Example: Sale: 10 packs Batch 1 (oldest): 5 packs available → allocate 5 Batch 2: 8 packs available → allocate 5 Total: 10 packs allocated

Sparkline Charts

Small trend charts showing how metrics change over time.

Calculation:
1. Group data by day 2. Calculate daily totals/averages 3. Scale values to chart height (0-100%) 4. Map to SVG coordinates 5. Draw line connecting points The chart auto-scales to min/max values in the dataset, providing visual trend representation without exact values.