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.
- Overview
- Features
- Tech Stack
- Project Structure
- Installation
- Configuration
- Usage
- Database Models
- API Routes
- Frontend
- File Management
- Development
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
- 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
- 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
- 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
- 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
- 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
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
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
- Python 3.8 or higher
- pip (Python package manager)
- Git
git clone https://github.com/anilveersingh1308/orm_system.git
cd orm_system# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install django==4.2.19python manage.py migratepython manage.py createsuperuserFollow the prompts to create an admin account for accessing Django admin.
python manage.py collectstatic --noinputEdit 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'SQLite (Default - Development):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}PostgreSQL (Production):
pip install psycopg2-binaryDATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'orm_system',
'USER': 'your_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}python manage.py runserverAccess the application at: http://localhost:8000/
Access Django admin at: http://localhost:8000/admin/
Use your superuser credentials to manage data directly.
| 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 |
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 nameclass 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 statusclass 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 # Notesclass 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 amountclass Payments(models.Model):
pay_date # Payment date (required)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')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
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
style.css:
- Custom color scheme
- Responsive grid layout
- Button styles
- Form styling
- Table formatting
- Sidebar navigation styles
Receipt files are uploaded to: receipts/
Configure upload location in settings:
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'- Images (JPG, PNG, GIF)
- Documents (DOC, DOCX)
python manage.py test dashboardAfter modifying models:
python manage.py makemigrations
python manage.py migrateAccess the Django shell for debugging:
python manage.py shell# 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 checkThe 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
# Reset migrations if corrupted
python manage.py migrate dashboard zero
python manage.py migrate dashboardpython manage.py collectstaticVerify TEMPLATES['DIRS'] in settings.py includes dashboard template path
Ensure virtual environment is activated and all packages installed:
pip install -r requirements.txt- 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)
- 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
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)