Business Intelligence Module

Report Management

Report Management provides operational, financial, and audit reporting for inventory decisions. It combines stock, sales, purchase, due, return, profit, transfer, accounting, and audit data in filterable report screens.

Part A: Non-Technical User Guide

1. Report Menu Coverage

ReportWhat It Gives You
Stock SummaryHigh-level current stock value and quantity view.
Daily / Monthly SalesSales trend by day or month with invoice count and totals.
Daily / Monthly PurchasePurchase trend by day or month with quantity and totals.
Supplier ReportSupplier-wise purchase volume, paid/due, and invoice patterns.
Stock By CategoryCategory-wise in-stock quantity, purchase value, selling value.
Sale By CategoryCategory-wise sales contribution and quantity sold.
Due PaymentsPending customer/supplier dues by filter and period.
Product LedgerProduct-level movement history and transaction trace.
Timesheet & Cash HandoverShift/cash handover report by cashier and date.
Product Return VerificationValidate returned item records with invoice and user trace.
Profit Margin ReportProfit analytics by category/product and cost basis.
Stock Transfer ReportWarehouse transfer totals and itemized transfer history.
Sell Return LogHistorical sales return activities and return approvals.
Expire Product ReportExpired/expiring stock with days-left visibility.
Accounting ReportCash in/out ledger, method breakdown, aging, balances.
Audit LogsSystem activity trace for accountability and security review.

2. How To Use Reports Effectively

  1. Select report by business question (stock, sales, due, profit, audit).
  2. Apply filters: date range, warehouse, category, user/cashier, status.
  3. Validate totals with summary cards/rows.
  4. Export/copy/print for meetings and accounting handover.
  5. Use weekly trend comparison to detect anomalies early.

3. Recommended Weekly Report Routine

  • Start with Stock Summary + Stock By Category.
  • Review Daily/Monthly Sales vs Purchase trend gap.
  • Check Due Payments and collect risk invoices.
  • Review Profit Margin (category and product mode).
  • Check Expire Product and Sell Return Log for leakage control.
  • Finalize with Accounting Report and Audit Logs.

Part B: Technical Reference (CodeCanyon Ready)

1. Frontend Report Pages

  • frontend-source/src/pages/reports/StockSummaryReport.jsx
  • frontend-source/src/pages/reports/DailyMonthlySales.jsx
  • frontend-source/src/pages/reports/DailyMonthlyPurchase.jsx
  • frontend-source/src/pages/reports/SupplierReport.jsx
  • frontend-source/src/pages/reports/CategorywiseStock.jsx
  • frontend-source/src/pages/reports/CategorywiseSales.jsx
  • frontend-source/src/pages/reports/payments-reports/DueInvoiceReport.jsx
  • frontend-source/src/pages/reports/products/ProductLadger.jsx
  • frontend-source/src/pages/reports/shifting/TimesheetReport.jsx
  • frontend-source/src/pages/reports/ProductReturnVerification.jsx
  • frontend-source/src/pages/reports/ProfitMarginReport.jsx
  • frontend-source/src/pages/reports/StockTransferReport.jsx
  • frontend-source/src/pages/reports/SellReturnLog.jsx
  • frontend-source/src/pages/reports/ExpireProductReport.jsx
  • frontend-source/src/pages/reports/AccountingReport.jsx

2. Backend Controllers and Services

  • app/Http/Controllers/Api/ReportController.php + app/Services/Api/ReportControllerService.php
  • app/Http/Controllers/Api/StockTransferController.php + app/Services/Api/StockTransferService.php (transfer report)
  • app/Http/Controllers/Api/AuditLogController.php + AuditLogService

3. Report API Endpoints Map

EndpointUse
GET /api/v1/daily/monthly/sale/reportDaily/monthly sales aggregate
GET /api/v1/daily/monthly/purchase/reportDaily/monthly purchase aggregate
GET /api/v1/supplier/purchase/reportSupplier purchase analytics
GET /api/v1/categorywise/stock/reportCategory stock analytics
GET /api/v1/categorywise/sale/reportCategory sales analytics
GET /api/v1/due/paymentsDue payments report
GET /api/v1/product-ledgerProduct ledger report
GET /api/v1/timesheet/reportTimesheet/cash handover report
POST /api/v1/verify-product-returnReturn verification data
GET /api/v1/profit/margin/reportProfit margin by category/product
GET /api/v1/report/stock-transferWarehouse stock transfer report
GET /api/v1/reports/sales-returns/logsSell return logs
GET /api/v1/expire/product/reportExpiry tracking report
GET /api/v1/accounting/reportAdvanced accounting report
GET /api/v1/audit-logsAudit trail list

4. Data and Aggregation Design Notes

  • Sales and Purchase trend reports aggregate from invoices table grouped by day/month.
  • Category stock uses inventory_items + product-category relations and optional child-category traversal.
  • Supplier report groups purchase invoices by supplier with paid/due/status breakdown.
  • Profit margin report supports groupBy=category|product and fallback purchase-cost resolution logic.
  • Accounting report builds ledger from transactions joined with invoice/customer/supplier/warehouse.
  • Expire product report classifies rows into expired, expiring, valid by days-left.

5. Common Filters Across Reports

  • date_from, date_to
  • warehouse / warehouse_id
  • category (+ include child categories)
  • search
  • page, perPage, sortField, sortOrder

6. Feature/Permission Dependencies

  • Sell Return reports depend on sell-return feature enablement.
  • Timesheet report depends on shift/cash-handover feature and cashier data.
  • Stock transfer report depends on warehouse transfer feature.
  • Audit logs require appropriate backend access rights.

7. Technical Caveats for Integrators

  • Some APIs normalize legacy parameter names (example: warehouse to warehouse_id).
  • Accounting report uses payment-type inference expressions and schedule-payment table detection.
  • Large period reports should use pagination and controlled export to avoid browser memory spikes.
  • Profit calculations rely on available inventory cost data; if missing, fallback logic applies.

8. Troubleshooting Matrix

IssueLikely CauseResolution
Report shows empty rowsDate/warehouse/category filter too restrictiveReset filters and rerun with broader range.
Profit seems inaccurateMissing/zero purchase cost on some linesAudit inventory item purchase_price and rerun.
Sell return report unavailableFeature flag disabledEnable sell return feature preference.
Accounting totals mismatchMixed payment methods or schedule-state edge casesCross-check transaction-level ledger rows.
Audit logs not visiblePermission or tenant scope issueCheck user rights and company scope.