{"id":18445664,"url":"https://github.com/voronenko/toggl_invoice","last_synced_at":"2025-04-08T00:31:39.574Z","repository":{"id":42246436,"uuid":"127662262","full_name":"Voronenko/toggl_invoice","owner":"Voronenko","description":"Helper script to generate invoice extract from toggl into Google Sheet","archived":false,"fork":false,"pushed_at":"2023-01-06T14:11:02.000Z","size":300,"stargazers_count":7,"open_issues_count":22,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T03:07:15.131Z","etag":null,"topics":["google-sheets","invoice","reporting","sheet","toggl"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Voronenko.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-01T18:57:11.000Z","updated_at":"2023-04-07T08:56:23.000Z","dependencies_parsed_at":"2023-02-06T05:02:18.601Z","dependency_job_id":null,"html_url":"https://github.com/Voronenko/toggl_invoice","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ftoggl_invoice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ftoggl_invoice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ftoggl_invoice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ftoggl_invoice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voronenko","download_url":"https://codeload.github.com/Voronenko/toggl_invoice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755341,"owners_count":20990616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-sheets","invoice","reporting","sheet","toggl"],"created_at":"2024-11-06T07:06:44.510Z","updated_at":"2025-04-08T00:31:39.127Z","avatar_url":"https://github.com/Voronenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Personal Toggl invoice generator\n\n, basing on ideas found in https://github.com/thinkinglabs/toggl-google-sheet/\n\nThis Google Apps script imports time entries from Toggl.com into a Google Sheet using their [Detailed Report API](https://github.com/toggl/toggl_api_docs/blob/master/reports/detailed.md).\n\nReport can be filtered by project, and drop ignored tags (like pomidoro-break, or nonbillable)\n\n## Installation\n\n### Simple\n\nOpen [this Google Sheet](https://docs.google.com/spreadsheets/d/1GJsVM1V2z1pkzYRfk3gCkXXvPJzq18zOXVVBo22CLPg/edit?usp=sharing) and make a copy in your Google Drive account.\n\nhttps://docs.google.com/spreadsheets/d/1GJsVM1V2z1pkzYRfk3gCkXXvPJzq18zOXVVBo22CLPg/edit?usp=sharing\n\n\nSpecify your toggl workspaceId and apiToken in a Config sheet.\n\nTo figure out your *workspace_id*: go to Team in toggl.com. The number at the end of the URL is the workspace id.\n\nTo figure out your *api_token*: go to your Profile in toggl.com, your API token is at the bottom of the page.\n\nAfter that click \"Load projects data\" to load information about projects in workplace.\n\nModify invoice template, if needed.   Use sheet.\n\nHistory:\n\n[Toggl Invoice'2020.09](https://docs.google.com/spreadsheets/d/1GJsVM1V2z1pkzYRfk3gCkXXvPJzq18zOXVVBo22CLPg/edit#gid=0)\n\n[Toggl Invoice'2019.02](https://docs.google.com/spreadsheets/d/19yda-N69KBc4EvxGnFQItDg0Y_cS7ZDg4Iq0WPfw4g8/edit?usp=sharing )\n\n[Toggl Invoice'2018.05](https://docs.google.com/spreadsheets/d/1lSqnC6dxMgknevUSmaINxam6LgNHvpkVPkXs8PBalQk/edit?usp=sharing )\n\n## Usage\nAfter a reopen of your Google Sheet you will have a new menu open called \"*Toggl*\" with a sub-menu \n\n\"*Get Invoice for Month*\".\n\nFill an any date of the month you want to import in cell B1. So if you want your timesheet for December 2019, fill the date 01/12/2019 and click *Toggl \u003e Get Invoice for Month*.\n\n\"*Get Invoice for Range*\".\n\nFill a start and end date of the period you want to import in cell B1 and C1. So if you want your timesheet for Q4 2019, fill the date 01/10/2019 - 31/12/2019  and\nclick *Toggl \u003e Get Invoice for Range*.\n\nAll reports support filtering by project - click  *Toggl \u003e Load Projects Data* to load list of the projects for your account\n\n\n## Deep troubleshouting with vscode\n\nGoogle Apps Script built-in online editor. It provides error handling, some debugging, making it ideal to hash out a small automation project pretty quickly. However, one of its major limitations is that after 1,000 or so lines of code and multiple files, it can start to get a little annoying.  It also makes things a bit difficult when you want to use your own debugging or testing software.\n\nFortunately, Google developed a tool that enables us to develop Google Apps Script code from the command line, clasp.\nhttps://developers.google.com/apps-script/guides/clasp\n\n\nThe steps to setting up Visual Studio for Google Apps Script production are as follows:\n\nInstall clasp via npm.\nGive permission to run the Apps Script API.\nGet text completion for Apps Script\n\nclasp is run in node.js via npm. You will need to install a recent version of Node.js that is 6.0.0 or later.\n\n```sh\nnpm i @google/clasp -g\n```\n\nTo test to see if clasp is working, you can now type clasp into the command line. You should see a list of command option if all is working\nNext, login.\n\n```sh\nclasp login\n```\n\nassuming you are working individually, grant all the required permissions.\nOne final little job you will need to do is to go into your Google Apps Script Settings and toggle the API to, on.\nDo it under link https://script.google.com/home/usersettings\n\nCreate your new sheet which will be managed by clasp, choose sheet project.\n\n```sh\nclasp create\n```\n\nSee docs below for a more detailed manual readme on installing clasp.\n\nhttps://yagisanatode.com/2019/04/01/working-with-google-apps-script-in-visual-studio-code-using-clasp/\n\nAll most used actions are in Makefile:\n\n```Makefile\n\n# install deps\ninit:\n\tnpm install\n\n# login(once)\nlogin:\n\tnode_modules/.bin/clasp login\n\n# create your sheet(once)\ncreate_sheet:\n\tnode_modules/.bin/clasp create\n\n# pack application\nwebpack:\n\tnpm run build:webpack\n\n# deploy application to your sheet.\ndeploy:\n\tcd dist \u0026\u0026 ../node_modules/.bin/clasp push\n```\n\nlogin action will create credentials.json file, which will represent identity of your sheet.\nFor development (tests, debugging) - additionally, you will need to get oauth2 token, via\n\n```sh\ncd src \u0026\u0026 node z_regenerate_token.js\n```\n\nCreated project can be deleted from  https://console.cloud.google.com/cloud-resource-manager\n\n## Tests\n\nProject is covered with tests, however those are related to my own test sheet and my test toggl account.\nYou will need to adjust them to your scenario.\n\nyou can limit to specific test\n\n```sh\n./node_modules/jest/bin/jest --runInBand App.ReportMethods.test.js --testNamePattern getSheetName\n```\n\nor run all pack via\n\n```sh\nnpm test\n```\n\n## Perks\n\nIf you would tag your log entries with Jira tickets in form [ZZZ-123], where ZZZ your project code and 123 ticket number, you can\n\nFilter any log entries related to ZZZ tickets\n\n```\n=sum(filter(C2:C30, regexmatch(B2:B30, \"\\[PULS-[0-9]+\\]\")))\n```\n\nFilter any log entries related to concrete ZZZ-897 ticket\n\n```\n=sum(filter(C2:C30, regexmatch(B2:B30, \"\\[PULS-897\\]\")))\n```\n\nand, thus, records without [ZZZ-xxx] prefix are supposed to be uncategorized, but billed activities\n\n```\n=sum(filter(C2:C30, NOT(regexmatch(B2:B30, \"\\[ZZZ-[0-9]+\\]\"))))\n```\n\n## Acknowledgment\nCredits go to [thinkinglabs](https://github.com/thinkinglabs/toggl-google-sheet/) which provided an example on how to use the Toggl API with Google Sheet.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronenko%2Ftoggl_invoice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoronenko%2Ftoggl_invoice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronenko%2Ftoggl_invoice/lists"}