3.0.0 • Published 3 years ago

harvest-overtime v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

harvest-overtime ⏰

npm version Build Status

Command-line interface to calculate employee's overtime with Harvest's CSV reports. Harvest is a service that provides time tracking and online invoicing tools for freelancers and small businesses.

Built with TypeScript and Node.js. Star me on GitHub — thanks! ⭐

✨ Features and Limitations

  • Supports Harvest's CSV reports.
  • Calculates overtime of employees: generates a report or prints to the command line. See an example.
  • Supports standard full-time work (40 hours per week: 8 hours per day). You can change this value. See an example.
  • Supports any reporting period. It can be a week or several months.
  • Includes total time per day. See an example.
  • Includes both weekdays and weekends. See an example.
  • It doesn't support national holidays.
  • Specific headers are required. See the next section.
  • Requires Node.js v12+.

📌 CSV Requirements

CSV reports should include at least the following data:

  • "Employee?": whether they are employees or not.
  • "First Name": the employees' first names.
  • "Last Name": the employees' last names.
  • "Date": the employees' date entries from Harvest.
  • "Hours": the employees' hours entries from Harvest.

Please make sure your CSV is using these headers. See an example.

🚀 How to Install

In order for you and your team to use this tool, you'll need to install Node.js. This tool requires Node.js v12+.

# Global so it can be called from anywhere
npm install -g harvest-overtime

You can also use npx to avoid pollution.

🏗 Usage

harvest-overtime -i [input-file] -o [output-file] -h [working-day-hours] -p

Where input-file and output-file are the path and file for the input and output. If these file paths are not provided, it will use the following:

  • input: harvest.csv
  • output: report.csv

The -h option sets the working-day-hours. This value defines the regular working day hours in order to calculate the overtime. If the value is not provided, it will use 8 hours per day.

This tool generates a report file, but you can add -p to print the report to the command line.

🔨 Command Line Interface

Usage: harvest-overtime [options]

Options:
  -V, --version           output the version number
  -i, --input [input]     Path and name of the incoming CSV file. If not provided, will be 'harvest.csv'
  -o, --output [output]   Path and name of the resulting CSV file. If not provided, will be 'report.csv'
  -h, --dayhours [output] Regular working day hours. If not provided, will be '8 hours'
  -p, --print             Print report to the standard output. If not set, it won't print the report
  -h, --help              output usage information

📚 Examples

The Harvest report includes the following data entries. Please note that this is an extract from the CSV file.

Employee?First NameLast NameDateHours
YesJaneAusten2018-08-064
YesJaneAusten2018-08-064.5
YesJaneAusten2018-08-072.5
YesJaneAusten2018-08-073.5
YesJaneAusten2018-08-073
YesJaneAusten2018-08-070.5
YesEmilyBronte2018-08-061
YesEmilyBronte2018-08-064
YesEmilyBronte2018-08-062
YesEmilyBronte2018-08-078
YesEmilyBronte2018-08-072
YesEmilyBronte2018-08-111

Using the Standard Regular Working Day Hours

If -h is no included, the overtime report will use the standard regular working day (8 hours per day):

harvest-overtime -i harvest_time_report_from2018-08-06to2018-08-12.csv -o report.csv

CSV report:

EmployeeWeekdaysWeekends2018-08-062018-08-072018-08-11
Jane Austen208.59.5
Emily Bronte117101

Changing the Regular Working Day Hours

Add -h in order to change the regular working hours. For instance, if the regular working day has 6 hours:

harvest-overtime -i harvest_time_report_from2018-08-06to2018-08-12.csv -o report.csv -h 6

CSV report:

EmployeeWeekdaysWeekends2018-08-062018-08-072018-08-11
Jane Austen608.59.5
Emily Bronte517101

Printing the Report to the Command Line

Add -p in order to print the report. You can also check a detailed report (includes total time per day) in the provided output file.

harvest-overtime -i harvest_time_report_from2018-08-06to2018-08-12.csv -o report.csv -p

Printed report:

harvest-overtime ⏰

Regular day hours: 8
Input file: harvest_time_report_from2018-08-06to2018-08-12.csv
Output file: report.csv

┌──────────────┬──────────┬──────────┐
│ Employee     │ Weekdays │ Weekends │
├──────────────┼──────────┼──────────┤
│ Jane Austen  │ 2        │ 0        │
├──────────────┼──────────┼──────────┤
│ Emily Bronte │ 1        │ 1        │
└──────────────┴──────────┴──────────┘┘

CSV report:

EmployeeWeekdaysWeekends2018-08-062018-08-072018-08-11
Jane Austen208.59.5
Emily Bronte117101

🙋 Help and Support

📣 Feedback

If you have any suggestions or want to let me know what you think of this tool, feel free to open an issue.

License

MIT