Fixed Asset Management System
AI & Audit

Fixed Asset Management System

Author : CA. JITENDRA VARMA

Watch on Youtube

1. Purpose of the application

FAMS-CA is a web application for maintaining a Fixed Asset Register (FAR), recording additions and disposals, handling inter-unit transfers within the same company, importing bulk data from Excel, and computing depreciation under two frameworks: Companies Act 2013 (Schedule II, SLM-style with pro-rata rules) and Income Tax Act 1961 (block-of-assets WDV method). It supports master data (companies, factory/office units, categories), user authentication, dashboards, and Excel/PDF reporting. Also to verify fised asset at different location using QR code and updating verification information in data base

2. Technology stack

  1. Language: Python 3
  2. Web framework: Flask 3 (application factory pattern, blueprints)
  3. ORM / database: Flask-SQLAlchemy / SQLAlchemy
  4. Default database: SQLite (fams.db); overridable via DATABASE_URL / .env
  5. Authentication: Flask-Login; forms: Flask-WTF
  6. QR codes: qrcode + Pillow

3. High-level architecture

The system follows a classic three-tier, server-rendered monolith:

  1. Presentation: Browser → Flask routes render Jinja2 templates; static JS/CSS in app/static/
  2. Application: route handlers in app/routes/ orchestrate requests, flash messages, redirects
  3. Domain logic: app/engines/ (import_engine, dep_engine, reports, qr_engine) — heavy rules
  4. Persistence: app/models/ mapped to relational tables via SQLAlchemy

4. Architecture diagram (conceptual)

Browser (HTML/CSS/JS)

       |

       v

Flask app (create_app) — URL routing via Blueprints

       |

       +-- Routes (app/routes/*) — request/response, forms, flashes, redirects

       |

       +-- Engines (app/engines/*) — business rules: import, depreciation, reports, QR

       |

       +-- Models (app/models/*) — SQLAlchemy ORM → SQLite (or DATABASE_URL)

       |

       +-- Templates (app/templates) + Static (app/static)

5. Application entry & configuration

  1. run.py — starts Flask dev server or Waitress; parses prod argument
  2. config.py / ProductionConfig — database URI, uploads, QR folder, Asset Type.xlsx path
  3. requirements.txt — Python dependencies (Flask, SQLAlchemy, pandas, openpyxl, reportlab, qrcode, waitress, python-docx, …)
  4. app/engines/qr_engine.py — QR code file generation
  5. app/engines/verification_engine.py — verification workflows

6. Data model — core entities & relationships

Organizational hierarchy: Company (1) has many FactoryUnit (factory/office). Each Asset belongs to a Company and a FactoryUnit (and Category). Categories store Companies Act useful life and IT Act WDV rate hints.

  1. Company — legal entity; linked to many FactoryUnits and Assets
  2. FactoryUnit — plant/office under one company; foreign key company_id
  3. Category — asset class; links to Schedule II life and IT block rate
  4. Asset — central FAR row: identifiers, dates, cost, quantity, WDV fields, disposal flags, import_template (INITIAL_SETUP, SUBSEQUENT_ADDITION, DISPOSAL, TRANSFER), import_fy; optional transfer_in_date and inter_unit_transfer_source_id for receiver-side pro-rata
  5. PhysicalAsset — row-level physical sub-units when quantity > 1; tracks disposal per physical tag
  6. DepreciationLedger — posted depreciation per asset, per financial year, framework CO_ACT or IT path
  7. ITBlockBalance — opening WDV per company, factory unit, category, financial year (IT Act blocks)
  8. AssetTransfer — audit trail for inter-unit transfers (as implemented in models)
  9. User — credentials for Flask-Login

7. Depreciation engine — logic (dep_engine.py)

Two parallel frameworks; selection is by route/UI (Companies Act run vs IT Act run/report).

  1. Companies Act: primarily SLM-style depreciation from depreciable amount and useful life; pro-rata by days in FY vs ready-to-use date; small-asset rule (e.g. unit cost ≤ ₹5,000) can force 100% in year of addition unless flagged ineligible
  2. Special asset numbering patterns (_is_qty_split_portion_asset): rows from partial sales/splits use pro-rata opening WDV on the Asset row rather than recomputing from stale ledgers
  3. Inter-unit transfers: transfer_in_date on receiver asset drives pro-rata in the receiving unit
  4. Income Tax Act: block-wise WDV using ITBlockBalance and category rates; separate from per-asset CO ledger (exact formulas in dep_engine)

8. Routes & features (assets blueprint — summary)

  1. Dashboard / asset index with company–unit filters (sanitized server-side for reports)
  2. Asset Import UI: tabs for Opening FAR, Additions, IT Block, Disposal, Transfers; Excel upload + optional manual forms
  3. Data management: filter, edit (FY-guarded), delete imported rows
  4. Depreciation: POST to run CO Act or IT Act for selected FY / company / unit
  5. Reports: FAR Excel, depreciation register, IT dep report, disposal register, profit/loss on sold assets, PDF depreciation schedule
  6. Disposal on single asset from detail; QR generation endpoint

9. Security, configuration, and operations

  1. SECRET_KEY and DATABASE_URL should be set for production (.env)
  2. Login required on business routes via @login_required
  3. Upload size limit and secure filenames for imports
  4. Logging: rotating file handler for troubleshooting
  5. Dev: python run.py (port 5001 by convention); Prod: python run.py prod (Waitress, e.g. 8080)

10. Integration points & file formats

  1. Input: .xlsx templates for FAR, disposal, transfer, IT block
  2. Reference: Asset Type.xlsx for category codes / mapping
  3. Output: .xlsx reports, .pdf schedules; QR image files under configured folder