Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A user-friendly desktop application to track daily work times, calculate deduction points based on lateness and undertime, and maintain a history of records for easy management.

License

Notifications You must be signed in to change notification settings

KCprsnlcc/DTR-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

55 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Daily Time Record (DTR) Calculator

A user-friendly desktop application to track daily work times, calculate deduction points based on lateness and undertime, and maintain a history of records for easy management.

πŸ› οΈ Features

  • πŸ—“οΈ Date Selection

    • Easily select a date using dropdown menus for year, month, and day.
    • Automatically displays the selected day of the week.
  • ⏰ Time Entry

    • Record Morning and Afternoon in/out times with AM/PM selection.
    • Utilize a built-in time picker for accurate time selection.
    • Validate time inputs with real-time feedback.
  • 🎯 Accurate Calculations

    • Detect lateness and undertime based on predefined schedules.
    • Calculate deduction points and display work durations.
    • Support for half-day absences.
    • Flexi Time Out logic to adjust supposed time out based on actual time in.
  • πŸ’Ύ Save Records

    • Store daily deductions in a structured JSON format.
    • Prevent duplicate records for the same date with user confirmation.
  • πŸ“œ History Management

    • View all saved records in a detailed and sortable table.
    • Multi-selection for batch deletion.
    • Single-record editing with automatic recalculations.
    • Search records within a specified date range.
  • πŸ“‚ Export to CSV

    • Export history for external analysis or backups.
  • πŸŒ— Theme Switching

    • Choose between Light Mode and Dark Mode for better accessibility.
    • Automatic adjustment of text and background colors based on the selected theme.
  • πŸ–₯️ Full-Screen Mode

    • Work in a distraction-free, full-screen environment.
  • πŸ“– Help & Documentation

    • Access detailed instructions on using the application via a built-in Help menu.
  • πŸ”’ Data Integrity

    • Robust error handling and input validation to ensure data accuracy.
    • Logging of application activities for troubleshooting and audit purposes.

πŸš€ Installation

  1. Clone the Repository

    git clone https://github.com/KCprsnlcc/DTR-Calculator.git
  2. Navigate to the Project Directory

    cd DTR-Calculator
  3. Set Up a Python Virtual Environment (Optional but Recommended)

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  4. Install Dependencies

    pip install -r requirements.txt
  5. Run the Application

    python main.py

πŸ“ Usage

1. Launch the Application

Run the application using the command:

python main.py

The application window will open and center itself on your screen.

2. Select Date

  • Use the dropdown menus at the top to select the Year, Month, and Day.
  • The selected day of the week will be displayed automatically.

3. Enter Times

  • Morning Section:

    • Check "Include Morning" if you worked in the morning.
    • Enter Actual Time In using the fields or the "Select Time" button.
  • Afternoon Section:

    • Check "Include Afternoon" if you worked in the afternoon.
    • Enter Actual Time Out using the fields or the "Select Time" button.

4. Calculate Deductions

Click "Calculate Deductions" to:

  • View lateness, undertime, and work durations.
  • See total deduction points for the day.

5. Save Records

Click "Save Record" to store the calculated deductions. Records are saved in a JSON file (dtr_records.json) for later access.

6. View History

  • Review past records in the Deduction History table.
  • Edit Record: Right-click on a record and select "Edit Record" to modify actual times. The application will automatically recalculate deductions.
  • Delete Record(s): Select one or multiple records and press the "Delete" key or right-click and choose "Delete Record".

7. Export History

Export all records to a CSV file using the "Export History" button for external analysis or backups.

8. Customize Themes

  • Switch between Light Mode and Dark Mode using the respective buttons at the top.
  • The application will adjust colors for optimal readability based on the selected theme.

9. Use Full-Screen Mode

Click "Full Screen" to expand the application to full screen for a distraction-free workspace. Click again to toggle back to windowed mode.

10. Access Help

Navigate to the Help menu to access:

  • How to Use: Detailed instructions on using the application.
  • About: Information about the application, contributors, and contact details.

πŸ“‚ Folder Structure

DTR-Calculator/
β”‚
β”œβ”€β”€ build/                  # Build outputs
β”‚   └── DTR Calculator      # Application build folder
β”‚
β”œβ”€β”€ dist/                   # Distribution folder
β”‚   └── DTR Calculator      # Application distribution folder
β”‚
β”œβ”€β”€ .gitignore              # Git ignore file
β”œβ”€β”€ DTR Calculator.spec     # PyInstaller spec file
β”œβ”€β”€ README.md               # Documentation
β”œβ”€β”€ dtr_app.log             # Application log
β”œβ”€β”€ dtr_records.json        # Saved records
β”œβ”€β”€ icon.ico                # Application icon
β”œβ”€β”€ main.py                 # Main application file
└── requirements.txt        # Python dependencies

πŸ“¦ Dependencies

This project requires the following Python packages:

  • ttkbootstrap: For modern GUI design.
  • tkinter: Python's standard GUI toolkit (usually included with Python).
  • pandas: For CSV export functionality.
  • json: For saving records.
  • datetime: For handling date and time operations.
  • logging: For application logging.
  • calendar: For date-related functionalities.

Install all dependencies with:

pip install -r requirements.txt

requirements.txt

ttkbootstrap
pandas

Note: tkinter, json, datetime, logging, and calendar are part of Python's standard library and do not need to be installed separately.

🀝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the Repository Click the "Fork" button on the top-right corner of this page.

  2. Clone Your Fork

    git clone https://github.com/KCprsnlcc/DTR-Calculator.git
  3. Create a Branch

    git checkout -b feature/YourFeatureName
  4. Make Changes Improve the application or fix bugs.

  5. Test Your Changes Ensure everything works as expected.

  6. Commit Your Changes

    git commit -m "Add your commit message here"
  7. Push Your Branch

    git push origin feature/YourFeatureName
  8. Open a Pull Request Navigate to the original repository and submit your pull request.

πŸ“ License

This project is licensed under the License. See the LICENSE file for details.

πŸŽ‰ Acknowledgements

  • Python Community for the amazing resources and support.
  • ttkbootstrap contributors for enhancing Tkinter's aesthetics.
  • Contributors for their efforts in improving the application.

πŸ“ž Contact

For any questions or support, please contact:

Khadaffe Abubakar Sulaiman
Email: [email protected]
GitHub: KCprsnlcc


πŸ”§ Troubleshooting

  • Application Fails to Launch

    • Ensure all dependencies are installed correctly.
    • Check if Python is added to your system's PATH.
  • Cannot Save Records

    • Verify that the application has write permissions to the directory.
    • Ensure that dtr_records.json is not open in another program.
  • Theme Not Changing

    • Restart the application to apply theme changes.
    • Ensure that the selected theme is supported.

For further assistance, please open an issue on the GitHub repository.


Thank you for using the Daily Time Record (DTR) Calculator! We hope it helps you manage your time.

About

A user-friendly desktop application to track daily work times, calculate deduction points based on lateness and undertime, and maintain a history of records for easy management.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •