Skip to content

CiprianPesu/Debt-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debt Management System

A comprehensive Flask-based web application for managing and tracking debts, debtors, and recovery procedures. Built with Python, this system provides tools for documenting debts, generating reports, and tracking collection efforts.

Overview

Debitori is designed to help organizations manage debtor information, track debts, and generate professional reports in PDF, DOCX, and Excel formats. The application provides a complete CRUD interface for managing debtors, addresses, services, and debt recovery processes.

Features

  • Debtor Management: Add, edit, and delete debtor information including names, ID numbers, and email addresses
  • Address Management: Maintain multiple addresses per debtor with detailed location information
  • Service/Prestations: Manage service types and cost categories
  • Debt Tracking: Record and monitor debts with current and historical amounts
  • Recovery Methods: Track different debt recovery approaches and methods
  • Motives: Categorize debts by reason or type
  • Settings Management: Configure organizational details, official signatories, and regional information
  • Report Generation: Generate comprehensive reports in PDF, DOCX, and Excel formats
  • Balance Sheets: Create detailed balance sheets and ledgers for audit purposes

Requirements

  • Python 3.x
  • MySQL 5.7 or higher
  • Flask web framework
  • MySQL Connector for Python

Installation

1. Clone the Repository

git clone https://github.com/CiprianPesu/Debitori-Python-Flusk.git
cd Debitori-Python-Flusk

2. Install Python Dependencies

pip install flask
pip install fpdf
pip install pdf2docx
pip install xlsxwriter
pip install mysql-connector-python

3. Database Setup

Create a MySQL database named debitori:

CREATE DATABASE debitori;

Import the required database schema (ensure you have the SQL migration files in your project).

4. Configure Database Connection

Edit main.py and update the MySQL connection parameters:

cnx = mysql.connector.connect(
    user='your_username',
    password='your_password',
    host='127.0.0.1',
    port=3306,
    database='debitori',
    auth_plugin='mysql_native_password'
)

5. Run the Application

python main.py

The application will be accessible at http://localhost:5000

Project Structure

Debitori-Python-Flusk/
├── main.py                          # Flask application entry point
├── Rute/
│   ├── Persoane.py                 # Debtor management routes
│   ├── Adrese.py                   # Address management routes
│   ├── Prestatii.py                # Services/Prestations routes
│   ├── Motive.py                   # Debt motives management
│   ├── Recuperari.py               # Recovery methods management
│   ├── Setari.py                   # Application settings
│   ├── Rapoarte.py                 # Report generation
│   └── Debite/
│       └── Debite.py               # Debt management and tracking
└── templates/                       # HTML templates for web interface
    ├── index.html
    ├── persoane.html
    ├── adrese.html
    ├── prestatii.html
    ├── motive.html
    ├── recuperari.html
    ├── setari.html
    ├── rapoarte.html
    └── Debite/
        ├── debite.html
        └── adaugare_debit_page.html

Usage

Managing Debtors

  1. Navigate to the Persoane (Debtors) section
  2. Add new debtors with their personal information
  3. Edit or delete debtor records as needed

Managing Addresses

  1. Select a debtor and access their addresses
  2. Add multiple addresses per debtor
  3. Update or remove addresses

Recording Debts

  1. Go to Debite (Debts) section
  2. Create new debt entries with:
    • Associated debtor
    • Service type
    • Debt amount (current year and prior years)
    • Registration dates and decision dates
    • Debt motive/reason

Generating Reports

  1. Navigate to Rapoarte (Reports)
  2. Select date ranges and service types
  3. Export balance sheets as:
    • Excel (.xlsx) for spreadsheet analysis
    • PDF for formal documentation
    • DOCX for document editing

Configuration

  1. Access Setări (Settings)
  2. Configure organizational information:
    • Fiscal code
    • Director details
    • Service head information
    • Legal representative details
    • Regional selection (county/district)

API Routes

Debtors

  • GET /persoane - Display all debtors
  • POST /persoane/adaugare_persoana - Add new debtor
  • POST /persoane/editare_persoana/<id> - Update debtor
  • DELETE /persoane/sterge_persoana/<id> - Delete debtor

Addresses

  • GET /adrese/<id> - Get addresses for a debtor
  • POST /adrese/adaugare_adresa - Add address
  • POST /adrese/editare_adresa/<id> - Update address
  • DELETE /adrese/sterge_adresa/<id> - Delete address

Services

  • GET /prestatii - List all services
  • POST /prestatii/adaugare_prestatie - Add service
  • POST /prestatii/editare_prestatie/<id> - Update service
  • DELETE /prestatii/sterge_prestatie/<id> - Delete service

Debts

  • GET /debite - Display all debts
  • GET /debite/adaugare_debit_page - Debt entry form

Reports

  • GET /rapoarte - Report generation interface
  • GET /rapoarte/listeazaBalantaXLS/<luna>&<prestatieSelectata> - Generate Excel balance sheet

Technologies Used

  • Backend: Flask (Python web framework)
  • Database: MySQL
  • Report Generation:
    • FPDF (PDF generation)
    • pdf2docx (PDF to Word conversion)
    • xlsxwriter (Excel report creation)
  • Frontend: HTML/JavaScript

Requirements File

A requirements.txt file can be generated with:

pip freeze > requirements.txt

Database Tables Overview

The system uses the following main tables:

  • persoane - Debtor information
  • adrese - Debtor addresses
  • prestatii - Service types
  • motive - Debt reasons/categories
  • debite - Debt records
  • modificare_debit - Debt modifications/payments
  • recuperari - Recovery methods
  • setari - System configuration

Notes

  • The application assumes MySQL is running on localhost (127.0.0.1) on default port 3306
  • Ensure proper database user permissions for create/read/update/delete operations
  • Reports can be generated in multiple formats for flexibility in documentation

Author

Created by Ciprian Pesu

Support

For issues, questions, or contributions, please refer to the GitHub repository.

About

designed to help organizations manage debtor information, track debts, and generate professional reports in PDF, DOCX, and Excel formats. The application provides a complete CRUD interface for managing debtors, addresses, services, and debt recovery processes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors