Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abraflexi-export-tools

A set of tools for exporting data and documents from AbraFlexi (FlexiBee) accounting system, including invoices and their attachments.

Features

  • Export all received invoices (faktura-prijata) as PDF
  • Download and process all attachments for each invoice
  • Extract and merge PDFs from ISDOCX attachments
  • Skip ISDOC (XML) attachments automatically
  • Merge all PDFs (invoices and attachments) into a single PDF file
  • Configurable via .env file or command-line options
  • Supports filtering by year, date, or custom FlexiBee filter using EXPORT_SCOPE

Requirements

  • PHP 8.0+
  • Composer dependencies (see composer.json)
  • pdfunite utility (from poppler-utils) for PDF merging
  • qpdf utility for encrypted PDF detection

Usage

  1. Configure environment:

    • Copy example.env to .env and fill in your AbraFlexi credentials and company code.
    • Optionally set EXPORT_SCOPE to restrict export by year (e.g. 2024), date (e.g. 2025-06-12), or a custom filter (e.g. datVyst >= '2025-01-01' AND datVyst <= '2025-06-12').
  2. Install dependencies:

    composer install
  3. Run the export script:

    cd src
    php export_faktura_prijata_with_attachments.php
    • Use -o <output.json> to specify a report file.
    • Use -e <envfile> to specify a custom environment file.
  4. Result:

    • The merged PDF will be saved as all-invoices-and-attachments.pdf in the project root.
    • A JSON report will be saved to the specified output or to stdout.

How it works

  • The script fetches all received invoices from AbraFlexi using the API.
  • Each invoice is downloaded as a PDF.
  • All attachments are downloaded. If an attachment is an ISDOCX file, the script extracts any PDF inside and includes it in the merge. ISDOC files are skipped.
  • Encrypted PDFs are detected and skipped using qpdf.
  • All unencrypted PDFs are merged into a single file using pdfunite.

License

See LICENSE.

Author

Vitex Software info@vitexsoftware.cz

Thanks to Our Sponsor

Special thanks to our sponsor, Utopia, for their support and contributions to this project.

Project Logo

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages