Skip to content

anilveersingh1308/orm_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ORM_SYSTEM (Office Record Management System)

A comprehensive web-based Office Record Management System built with Django to manage company finances, vendor relationships, expenses, and billing records. The system provides an intuitive dashboard for tracking receivables, payables, cash flow, and generating financial insights.

πŸ“‹ Table of Contents

🎯 Overview

ORM_SYSTEM is an enterprise-grade record management solution designed for apparel manufacturing and trading companies. It centralizes vendor management, expense tracking, billing, and financial reporting in one unified platform. The system supports GST (Goods and Services Tax) compliance, payment tracking, and comprehensive financial analytics.

Key Capabilities:

  • Complete vendor lifecycle management with contact details, bank information, and GST registration
  • Expense tracking with multi-account categorization and tax handling
  • Bill creation and management with line-item details
  • Real-time financial dashboard with receivables, payables, and cash flow visibility
  • Receipt file uploads and expense documentation
  • Advanced search and filtering across all records
  • Responsive Bootstrap 5 UI with intuitive navigation

✨ Features

Vendor Management

  • Create and maintain comprehensive vendor profiles
  • Store billing and shipping addresses separately
  • Track bank account details (Account Number, IFSC, Bank Name)
  • Record GST registration numbers and tax treatment classification
  • Monitor vendor payables in real-time
  • View vendor payment history and transaction details
  • Search and filter vendors by name, company, state, or payables amount

Expense Tracking

  • Log employee expenses with detailed categorization
  • Support multiple expense accounts (COGS, Utilities, Rent, etc.)
  • Attach receipt documentation (file upload)
  • Track payment methods (Cash, Cheque, Card, Transfer)
  • GST compliance with tax treatment and SAC codes
  • Reverse charge mechanism support
  • Source and destination of supply tracking
  • Expense status monitoring
  • Real-time expense calculations and reporting

Bill Management

  • Create and manage purchase bills from vendors
  • Line-item tracking with quantity, rate, and tax calculations
  • Multiple tax treatment options
  • Payment terms and due date tracking
  • Automatic tax amount calculations
  • Adjustment and discount support
  • Bill status monitoring
  • Comprehensive bill display with invoice formatting
  • Edit and update bills before finalization

Financial Dashboard

  • Real-time receivables and payables overview
  • Cash flow analysis
  • Card payment tracking
  • Income vs. Expense comparison charts
  • Top expenses breakdown
  • Monthly trend analysis
  • Transaction summary
  • Quick access to key metrics

User Interface

  • Responsive Bootstrap 5 design
  • Fixed sidebar navigation with submenu support
  • Clean, modern dashboard layout
  • Mobile-friendly interface
  • Interactive data tables with sorting and filtering
  • Form validation and error handling
  • Dynamic form interactions with JavaScript

πŸ›  Tech Stack

Backend:

  • Django 4.2.19 - Web framework
  • SQLite3 - Database (default, can be upgraded to PostgreSQL/MySQL)
  • Python 3.x

Frontend:

  • HTML5, CSS3, JavaScript (ES6)
  • Bootstrap 5 - UI Framework
  • Font Awesome 6.4.0 - Icons
  • jQuery 3.6.0 - DOM manipulation
  • Chart.js - Data visualization

Architecture:

  • MTV (Model-Template-View) pattern
  • RESTful URL routing
  • Django ORM for database interactions
  • Static file management with Django

πŸ“ Project Structure

orm_system/
β”œβ”€β”€ manage.py                          # Django management script
β”œβ”€β”€ db.sqlite3                         # SQLite database
β”œβ”€β”€ README.md                          # This file
β”‚
β”œβ”€β”€ orm_system/                        # Project configuration
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ settings.py                   # Django settings
β”‚   β”œβ”€β”€ urls.py                       # URL routing
β”‚   β”œβ”€β”€ asgi.py                       # ASGI configuration
β”‚   └── wsgi.py                       # WSGI configuration
β”‚
└── dashboard/                         # Main application
    β”œβ”€β”€ migrations/                   # Database migrations
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ 0001_initial.py          # Initial schema
    β”‚   β”œβ”€β”€ 0002_alter_expense_vendor.py
    β”‚   β”œβ”€β”€ 0003_alter_bill_vendor.py
    β”‚   β”œβ”€β”€ 0004_alter_bill_bill_due_date_alter_bill_bill_reference_and_more.py
    β”‚   β”œβ”€β”€ 0005_remove_bill_bill_amount_bill_adjustment_and_more.py
    β”‚   β”œβ”€β”€ 0006_vendor_address_vendor_bank_account_number_and_more.py
    β”‚   └── 0007_expense_amount_is_expense_destination_of_supply_and_more.py
    β”‚
    β”œβ”€β”€ templates/dashboard/         # Django templates
    β”‚   β”œβ”€β”€ base.html                # Base template with sidebar
    β”‚   β”œβ”€β”€ home.html                # Dashboard home page
    β”‚   β”œβ”€β”€ vendors.html             # Vendors list view
    β”‚   β”œβ”€β”€ vendor_detail.html       # Individual vendor details
    β”‚   β”œβ”€β”€ new_vendor.html          # Vendor creation form
    β”‚   β”œβ”€β”€ bills.html               # Bills list view
    β”‚   β”œβ”€β”€ bill_display.html        # Bill invoice display
    β”‚   β”œβ”€β”€ bill_edit.html           # Bill editing form
    β”‚   β”œβ”€β”€ new_bill.html            # Bill creation form
    β”‚   β”œβ”€β”€ expenses.html            # Expenses list view
    β”‚   └── new_expense.html         # Expense creation form
    β”‚
    β”œβ”€β”€ static/                      # Static files
    β”‚   β”œβ”€β”€ css/
    β”‚   β”‚   └── style.css           # Application styles
    β”‚   └── js/
    β”‚       β”œβ”€β”€ main.js             # Sidebar navigation logic
    β”‚       └── support.js          # Form handling and calculations
    β”‚
    β”œβ”€β”€ models.py                    # Database models
    β”œβ”€β”€ views.py                     # View logic
    β”œβ”€β”€ urls.py                      # App-specific URL routing
    β”œβ”€β”€ admin.py                     # Django admin configuration
    β”œβ”€β”€ apps.py                      # App configuration
    β”œβ”€β”€ tests.py                     # Unit tests
    β”œβ”€β”€ DataArray.py                 # Configuration choices and lists
    β”œβ”€β”€ data_array.py                # Sample vendor data
    └── __init__.py

πŸš€ Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Git

Step 1: Clone the Repository

git clone https://github.com/anilveersingh1308/orm_system.git
cd orm_system

Step 2: Create Virtual Environment

# Windows
python -m venv venv
venv\Scripts\activate

# macOS/Linux
python3 -m venv venv
source venv/bin/activate

Step 3: Install Dependencies

pip install django==4.2.19

Step 4: Apply Database Migrations

python manage.py migrate

Step 5: Create Superuser (Optional)

python manage.py createsuperuser

Follow the prompts to create an admin account for accessing Django admin.

Step 6: Collect Static Files

python manage.py collectstatic --noinput

βš™οΈ Configuration

Settings Configuration

Edit orm_system/settings.py to customize:

# Security Settings
SECRET_KEY = 'your-secret-key-here'  # Change in production
DEBUG = False  # Set to False in production
ALLOWED_HOSTS = ['yourdomain.com']   # Add your domain

# Database
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}

# Static Files
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'staticfiles'

Database Options

SQLite (Default - Development):

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}

PostgreSQL (Production):

pip install psycopg2-binary
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'orm_system',
        'USER': 'your_user',
        'PASSWORD': 'your_password',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

πŸ“– Usage

Running the Development Server

python manage.py runserver

Access the application at: http://localhost:8000/

Admin Panel

Access Django admin at: http://localhost:8000/admin/

Use your superuser credentials to manage data directly.

Main Pages

Page URL Description
Home Dashboard / Overview of key metrics
Vendors /vendors/ List all vendors
New Vendor /vendors/new-vendor/ Add new vendor
Vendor Detail /vendors/<id>/ View vendor details
Expenses /expenses/ List all expenses
New Expense /expenses/new-expense/ Add new expense
Bills /bills/ List all bills
New Bill /bills/new-bill/ Create new bill
Bill Display /bills/<id>/ View bill invoice
Bill Edit /bills/<id>/edit/ Edit bill details

πŸ—„οΈ Database Models

Vendor Model

class Vendor(models.Model):
    name                    # Vendor name (required)
    company_name            # Company name (required)
    email                   # Email address
    phone                   # Phone number
    state                   # State (required)
    payables                # Amount payable (required)
    address                 # Primary address
    primary_contact         # Contact person name
    gstin                   # GST Registration Number
    billing_address         # Billing address details
    billing_city            # Billing city
    billing_state           # Billing state
    billing_zip             # Billing ZIP/Postal code
    shipping_address        # Shipping address details
    shipping_city           # Shipping city
    shipping_state          # Shipping state
    shipping_zip            # Shipping ZIP/Postal code
    bank_account_number     # Bank account number
    bank_ifsc               # Bank IFSC code
    bank_name               # Bank name

Expense Model

class Expense(models.Model):
    exp_date                # Expense date (required)
    employee                # Employee name
    account                 # Account category (required)
    exp_amount              # Amount (required)
    paid_through            # Payment method
    expense_type            # Type of expense
    sac                     # SAC code
    vendor                  # Related vendor (FK)
    gst_treatment           # GST treatment type
    source_of_supply        # Supply source state
    destination_of_supply   # Supply destination state
    reverse_charge          # Reverse charge applicable
    tax                     # Tax classification
    amount_is               # Amount specification
    invoice_no              # Invoice number
    notes                   # Additional notes
    customer                # Customer reference
    reporting_tags          # Tags for reporting
    receipt                 # Receipt file upload
    exp_reference           # Expense reference number
    status                  # Expense status

Bill Model

class Bill(models.Model):
    bill_no                 # Bill number (required)
    bill_reference          # Reference number
    vendor                  # Vendor (FK)
    bill_status             # Status (required)
    bill_date               # Bill date (required)
    bill_due_date           # Due date
    payment_terms           # Payment terms
    discount                # Discount amount
    total_tax_amount        # Total tax
    adjustment              # Adjustment amount
    total_amount            # Total bill amount
    notes                   # Notes

BillItem Model

class BillItem(models.Model):
    bill                    # Bill reference (FK)
    item_details            # Item description
    account                 # Account/GL code
    quantity                # Quantity (required)
    rate                    # Unit rate (required)
    tax                     # Tax code
    customer                # Customer reference
    tax_amount              # Calculated tax
    amount                  # Line total amount

Payments Model

class Payments(models.Model):
    pay_date                # Payment date (required)

πŸ”Œ API Routes

All routes are defined in dashboard/urls.py:

path('', views.home, name='home')
path('vendors/', views.vendors, name='vendors')
path('vendors/new-vendor/', views.newVendor, name='new_vendor')
path('vendors/<int:vendor_id>/', views.vendor_detail, name='vendor_detail')
path('expenses/', views.expenses, name='expenses')
path('expenses/new-expense/', views.newExpense, name='new_expense')
path('bills/', views.bills, name='bills')
path('bills/new-bill/', views.newBill, name='new_bill')
path('bills/<int:bill_id>/', views.bill_display, name='bill_display')
path('bills/<int:bill_id>/edit/', views.bill_edit, name='bill_edit')

🎨 Frontend

Templates

base.html - Master template with:

  • Responsive sidebar navigation
  • Dynamic menu system with submenus
  • Font Awesome icons
  • Bootstrap 5 integration
  • jQuery support

Responsive Design:

  • Desktop-optimized layout
  • Tablet-friendly interface
  • Mobile-responsive sidebar
  • Touch-friendly forms

JavaScript Features

main.js:

  • Active page highlighting in sidebar
  • Submenu toggle functionality
  • Chevron rotation animations
  • Vendor select dropdown enhancement

support.js:

  • Dynamic form row creation for bill items
  • Autocomplete for item selection
  • Real-time calculation of amounts and taxes
  • Form validation
  • Total amount calculation logic

CSS Styling

style.css:

  • Custom color scheme
  • Responsive grid layout
  • Button styles
  • Form styling
  • Table formatting
  • Sidebar navigation styles

πŸ“€ File Management

Upload Paths

Receipt files are uploaded to: receipts/

Configure upload location in settings:

MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'

Supported File Types

  • PDF
  • Images (JPG, PNG, GIF)
  • Documents (DOC, DOCX)

πŸ”¨ Development

Running Tests

python manage.py test dashboard

Making Database Migrations

After modifying models:

python manage.py makemigrations
python manage.py migrate

Django Shell

Access the Django shell for debugging:

python manage.py shell

Helpful Django Commands

# Reset database
python manage.py flush

# Create backup
python manage.py dumpdata > backup.json

# Load backup
python manage.py loaddata backup.json

# Check system
python manage.py check

πŸ“‹ Configuration Choices

The system supports various predefined choices for flexibility:

Expense Account Choices:

  • Cost of Goods Sold
  • Consumable
  • Electricity, Water, Rent
  • Repair and Maintenance
  • Fuel Expense
  • Courier, Conveyance
  • Meals and Entertainments
  • Embroidery

GST Treatment:

  • Registered Business (Regular/Composition)
  • Unregistered Business
  • Consumer
  • Overseas
  • Non-GST Supply
  • Out of Scope

Indian States: All 28 states + 8 union territories

Payment Methods:

  • Cash
  • Cheque
  • Card
  • Bank Transfer
  • Other

πŸ› Troubleshooting

Database Errors

# Reset migrations if corrupted
python manage.py migrate dashboard zero
python manage.py migrate dashboard

Missing Static Files

python manage.py collectstatic

Template Not Found

Verify TEMPLATES['DIRS'] in settings.py includes dashboard template path

Import Errors

Ensure virtual environment is activated and all packages installed:

pip install -r requirements.txt

πŸ“ Notes

  • Default database is SQLite3, suitable for development and small deployments
  • For production, migrate to PostgreSQL with proper backup strategy
  • All expenses and bills maintain historical data
  • File uploads are stored in media directory
  • No user authentication required by default (can be added via Django's auth)

πŸ” Security Considerations

  • Change SECRET_KEY in production
  • Set DEBUG=False in production
  • Use environment variables for sensitive data
  • Implement proper user authentication
  • Add HTTPS/SSL in production
  • Regularly backup database

πŸ“ž Support & Contribution

For issues, questions, or contributions, please visit the repository or contact the development team.


Last Updated: December 2024
Version: 1.0.0
License: MIT (or specify your license)

About

A comprehensive web-based Office Record Management System built with Django to manage company finances, vendor relationships, expenses, and billing records. The system provides an intuitive dashboard for tracking receivables, payables, cash flow, and generating financial insights.

Topics

Resources

Stars

Watchers

Forks

Contributors