Import Hours Work Flow 0 0

Last updated on Nov 29, 2024 06:16 in Hours Flow
Posted Bykirt


Import hours button flow of the process:



How the "Import Hours" Feature Works

The "Import Hours" feature helps you easily upload and manage employee hours by using a CSV file. Here's how it works in simple steps:

  1. Click the 'Import Hours' Button: When you click the "Import Hours" button, a window will pop up to guide you through the process of uploading your file.

  2. Fill in Required Information: Before uploading your file, the system will make sure you’ve filled in important details like the template ID (which helps match the data format) and the pay period. If anything is missing, you’ll get an error message telling you what needs to be filled in.

  3. Retrieve File Template: The system will provide you with instructions on how the CSV file should be set up, so the import process can go smoothly.

  4. Check for Uploaded File: The system will make sure that you've uploaded the file in the correct format (CSV). If the file is not in the right format, it will show an error message.

  5. Process the CSV File: Once the file is uploaded, the system will review each row of the file:

  • It checks if each employee listed in the file exists in the system.

  • It makes sure all required information (like employee ID, type of hours worked, and total hours) is included.

  • If anything is missing or incorrect, an error message will show you what needs fixing.


    Validate Hours Type and Values: The system will double-check that the hours type (like regular hours or overtime) is valid, and that the number of hours worked is accurate.


    Insert or Update Data:

    • If everything looks good, the system will either add new records if the employee doesn’t have any hours logged yet for that period, or update existing records if the employee has hours already logged.


    Final Response:

    • If the import is successful, you’ll receive a message confirming that your data was imported successfully.

    • If there are any issues, the system will provide details on what went wrong, so you can make corrections.

    This feature is designed to make importing hours quick and easy while making sure everything is accurate and up to date.



    Manage Template Flow : 

    When you click the “ Manage Template “ button, a modal window will redirect manage template page 






    How the "Manage Template" Feature Works

    1. Manage Templates:
      You can add, edit, or delete templates in this section to manage how data is imported.

    2. Upload a File:

      First, you’ll need to upload a file (CSV format). If no file is uploaded, an error message will appear saying "No file uploaded."


    File Validation:

    • The system will check if the file is in the correct CSV format. If it's not a CSV file, you’ll be asked to select a proper CSV file.


    File Handling:

    • Once the file is uploaded, it will be saved to a specific folder on the server, and a unique name will be assigned to avoid any file name conflicts.

    • A URL (link) will be created for the file so it can be accessed later.


    Parse the CSV Data:

    • The system reads the content of the CSV file and looks at the first row (header row) to identify the column names (e.g., Employee Name, Hours Worked, etc.).

    • These column names are saved so the data can be correctly matched with the right fields.

      Prepare the Response:

      • The system prepares a response that includes:

        • The URL link to the uploaded file.

        • The column names (headers) from the CSV file.

        • Labels for the data (like the number of hours worked and the type of hours).

        Display the Data:

        • The headers and labels are sorted alphabetically, making it easier to review.

        • The system will show you a webpage with a preview of the uploaded file and the parsed data.


          Return the Page:

          • Finally, the page will load with all the information about your uploaded file, allowing you to review its contents.



          ** The time is base on UTC timezone