1
0
Fork 0
mirror of https://github.com/coko7/expense-report.git synced 2026-09-17 13:55:37 +00:00
🧾 Generate Excel reports from PDF invoices
  • Shell 88.1%
  • Python 11.9%
Find a file
2026-08-30 22:12:07 +02:00
templates feat(invoice2json): add currency conversion and visual feedback 2026-08-30 22:08:17 +02:00
.env feat: add all scripts 2025-12-14 14:11:42 +01:00
.gitignore feat: add all scripts 2025-12-14 14:11:42 +01:00
create-pdf-summary.sh feat(invoice2json): add currency conversion and visual feedback 2026-08-30 22:08:17 +02:00
create_xlsx.py chore: fix setup.sh + incorrect comments in python script 2025-12-14 14:26:45 +01:00
generate-report.sh fix: exit generate-report when jq fails 2026-01-31 13:52:42 +01:00
hook-xp-files.sh feat(scripts): add PDF summary and invoice import utilities 2026-06-27 10:38:13 +02:00
invoice2json.sh feat(invoice2json): add currency conversion and visual feedback 2026-08-30 22:08:17 +02:00
LICENSE Initial commit 2025-12-14 13:05:14 +00:00
README.md docs: update README 2026-08-30 22:12:07 +02:00
setup.sh chore(setup): add dateparser dependency 2026-08-30 22:10:43 +02:00

🧾 expense-report

Generate Excel reports from PDF invoices.

Requirements

  • python/pip (pyenv, 3.11.8)
  • fd, jq, gum
  • poppler-utils (pdftotext, pdfseparate, pdfunite, pdfinfo)
  • invoice2data, dateparser, openpyxl (installed into the venv by setup.sh)

Requires a .env file with EMP_NAME and EMP_NUM variables.

Usage

$ ./setup.sh            # setup the python venv
$ ./invoice2json.sh     # use invoice2data to extract data from PDFs into data/parsed_data.json
$ ./generate-report.sh  # convert generated JSON into csv and insert it in the XLSX template

Invoice folders

Put PDFs under data/invoices/:

  • mine/ → personal expense, reimbursed (cost_num = employee number)
  • company/ → direct company expense (cost_num = 0)
  • anywhere else → cost_num = -1

create-pdf-summary.sh

Merges one page from every invoice PDF into a single attachment PDF.

$ ./create-pdf-summary.sh <date> <employee_id> [first|last]
  • date, employee_id — used in the output filename target/pdf-extracts/all-invoices_<employee_id>_<date>.pdf
  • first|last — which page to pull from each PDF (default first)

hook-xp-files.sh

Moves files prefixed sigxp from ~/Downloads into data/invoices/mine/ — used when batch-downloading invoices from the employer's expense portal.