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.
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.
- 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
- Python 3.x
- MySQL 5.7 or higher
- Flask web framework
- MySQL Connector for Python
git clone https://github.com/CiprianPesu/Debitori-Python-Flusk.git
cd Debitori-Python-Fluskpip install flask
pip install fpdf
pip install pdf2docx
pip install xlsxwriter
pip install mysql-connector-pythonCreate a MySQL database named debitori:
CREATE DATABASE debitori;Import the required database schema (ensure you have the SQL migration files in your project).
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'
)python main.pyThe application will be accessible at http://localhost:5000
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
- Navigate to the Persoane (Debtors) section
- Add new debtors with their personal information
- Edit or delete debtor records as needed
- Select a debtor and access their addresses
- Add multiple addresses per debtor
- Update or remove addresses
- Go to Debite (Debts) section
- Create new debt entries with:
- Associated debtor
- Service type
- Debt amount (current year and prior years)
- Registration dates and decision dates
- Debt motive/reason
- Navigate to Rapoarte (Reports)
- Select date ranges and service types
- Export balance sheets as:
- Excel (.xlsx) for spreadsheet analysis
- PDF for formal documentation
- DOCX for document editing
- Access Setări (Settings)
- Configure organizational information:
- Fiscal code
- Director details
- Service head information
- Legal representative details
- Regional selection (county/district)
GET /persoane- Display all debtorsPOST /persoane/adaugare_persoana- Add new debtorPOST /persoane/editare_persoana/<id>- Update debtorDELETE /persoane/sterge_persoana/<id>- Delete debtor
GET /adrese/<id>- Get addresses for a debtorPOST /adrese/adaugare_adresa- Add addressPOST /adrese/editare_adresa/<id>- Update addressDELETE /adrese/sterge_adresa/<id>- Delete address
GET /prestatii- List all servicesPOST /prestatii/adaugare_prestatie- Add servicePOST /prestatii/editare_prestatie/<id>- Update serviceDELETE /prestatii/sterge_prestatie/<id>- Delete service
GET /debite- Display all debtsGET /debite/adaugare_debit_page- Debt entry form
GET /rapoarte- Report generation interfaceGET /rapoarte/listeazaBalantaXLS/<luna>&<prestatieSelectata>- Generate Excel balance sheet
- Backend: Flask (Python web framework)
- Database: MySQL
- Report Generation:
- FPDF (PDF generation)
- pdf2docx (PDF to Word conversion)
- xlsxwriter (Excel report creation)
- Frontend: HTML/JavaScript
A requirements.txt file can be generated with:
pip freeze > requirements.txtThe system uses the following main tables:
persoane- Debtor informationadrese- Debtor addressesprestatii- Service typesmotive- Debt reasons/categoriesdebite- Debt recordsmodificare_debit- Debt modifications/paymentsrecuperari- Recovery methodssetari- System configuration
- 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
Created by Ciprian Pesu
For issues, questions, or contributions, please refer to the GitHub repository.