Feature #5554
openAdd Purchase Stock by Scanning Invoice
0%
Description
As a Store/Inventory Manager
I want to upload a purchase invoice (PDF/Image) and automatically extract product details
So that I can quickly review, edit, and add purchased stock with correct quantities, taxes, and prices without manual data entry.
Acceptance Criteria
AC1 — Upload Invoice (PDF / Image)
User can upload:
PDF invoice
Image invoice (JPG/PNG/HEIC/etc.)
File size limit: 10–20 MB
Show loader while processing
On upload success → go to auto-filled “Purchase Entry Page”
On failure → show error toaster (“Unable to read invoice. Please try manual entry.”)
AC2 — Auto Extract Invoice Data (OCR + AI Extraction)
System must extract:
Product Name, Quantity, Unit Price, Tax (%), Subtotal, Invoice Date, Due Date, Vendor Name (optional), Invoice Number (optional),
Total Amount
OCR must map extracted items to:[
{ product_name, qty, price, tax, subtotal }
]
AC3 — Show Extracted Data in Purchase Entry Page
Display all auto-extracted rows in a table:
Product Name (editable)
Quantity (editable)
Unit Price (editable)
Tax (editable)
Subtotal (auto-recalculated)
Header section must show:
Invoice Date
Due Date
Vendor
Total Amount
Allow user to edit any values.
AC4 — Add/Remove Products
User can:
Add a new product row manually
Remove auto-filled rows
Search dropdown for existing products
Or create a new product (optional popup)
AC5 — Save Stock & Update Product Purchase Details
On saving:
Increase product stock by given quantity
Update purchase price in Product table
Create purchase history entry:
invoice date
vendor
qty
purchase price
tax
total
reference invoice file
AC6 — Validation Rules
Product Name required
Quantity > 0
Price > 0
Tax >= 0
Invoice Date required
File must be PDF or Image
Total Amount must match sum of line items (optional warning)
AC7 — Action History
Store the full history:
Invoice upload
Auto-extraction
Manual edits
Stock update
Linked purchase record
Related issues