A robust PHP application for importing ABO (Czech bank statement format) files into Pohoda accounting software using the mServer API. Features comprehensive error handling, duplicate detection, and MultiFlexi-compatible reporting.
- Complete ABO Parsing: Supports both basic and extended ABO formats
- Automatic Detection: Automatically detects ABO format version
- Czech Banking Standard: Full compliance with Czech ABO format specification
- Multiple File Support: Process single files or batch operations
- mServer API: Direct integration with Pohoda via mServer
- Bank Movements: Creates proper bank movement records
- Automatic Classification: Receipt/expense classification based on amount
- Symbol Mapping: Variable, constant, and specific symbol support
- Duplicate Detection: Prevents reimporting the same transactions
- Transaction Tracking: Unique ID generation for each transaction
- Safe Re-imports: Run the same import multiple times safely
- Data Validation: Comprehensive validation before import
- MultiFlexi Compatible: Reports conform to MultiFlexi schema
- Detailed Metrics: Import statistics and processing times
- Comprehensive Artifacts: Lists of imported, failed, and skipped transactions
- JSON/Human Readable: Machine and human-readable output formats
- CLI Interface: Command-line tools for automation
- Environment Configuration: Flexible configuration via environment variables
- Extensive Logging: Debug and audit trails
- Error Recovery: Graceful handling of connection issues
- PHP 8.4 or later
- Composer
- Pohoda mServer running and accessible
- Access to ABO format bank statement files
composer install
apt install pohoda-abo-importer
- Copy the example configuration:
cp example.env .env
- Edit
.env
with your settings:
# Pohoda mServer Configuration
POHODA_URL=http://127.0.0.1:50000
POHODA_USERNAME=api
POHODA_PASSWORD=your_password
POHODA_ICO=12345678
POHODA_TIMEOUT=60
POHODA_DEBUG=false
# Bank Account Mapping
POHODA_BANK_IDS=KB
# Logging
EASE_LOGGER=console|syslog
# Report Output (optional)
RESULT_FILE=import_report.json
POHODA_URL
: mServer endpoint URLPOHODA_USERNAME
: mServer authentication usernamePOHODA_PASSWORD
: mServer authentication passwordPOHODA_ICO
: Company identification number
# Import a specific ABO file
php src/importer.php path/to/bank_statement.abo-standard
# Import default file (vystup.abo)
php src/importer.php
# Using the CLI tool
bin/pohoda-abo-importer path/to/bank_statement.abo-standard
# Save report to file
php src/importer.php statement.abo-standard -o import_report.json
# Output report to stdout
php src/importer.php statement.abo-standard -o php://stdout
# Use environment variable
RESULT_FILE=report.json php src/importer.php statement.abo-standard
# Use different environment file
php src/importer.php statement.abo-standard -e production.env
# Combine options
php src/importer.php statement.abo-standard -e prod.env -o prod_report.json
The importer generates comprehensive reports in MultiFlexi-compatible JSON format:
{
"status": "success|warning|error",
"timestamp": "2025-09-07T23:57:41+00:00",
"message": "Import successful: 5 imported, 2 skipped",
"artifacts": {
"imported_transactions": [
"Transaction 123456: 1000.50 on 2025-09-07",
"Transaction 123457: -500.25 on 2025-09-07"
],
"failed_transactions": [
"Failed 123458: Connection timeout to mServer"
],
"skipped_transactions": [
"Skipped 123459: 750.00 on 2025-09-07 - Duplicate transaction already exists in Pohoda"
]
},
"metrics": {
"total_transactions": 7,
"imported_count": 5,
"error_count": 1,
"skipped_count": 2,
"processing_time_seconds": 12
}
}
- status: Overall import result (
success
,warning
,error
) - timestamp: ISO8601 completion timestamp
- message: Human-readable summary
- artifacts: Detailed lists of processed transactions
- metrics: Import statistics and performance data
# Install dependencies
make vendor
# Run static analysis
make static-code-analysis
# Fix coding standards
make cs
# Run tests
make tests
make help # Show all available targets
- ABO Parser:
spojenet/abo-parser
- Parses Czech ABO format files - Pohoda Connector:
vitexsoftware/pohoda-connector
- mServer API client - Custom Bank Class: Enhanced bank client with idempotency support
- Report Generator: MultiFlexi-compatible report generation
- Parse: ABO file → Structured transaction data
- Validate: Check for duplicates and data integrity
- Transform: Map ABO fields to Pohoda bank movement fields
- Import: Send to Pohoda via mServer API
- Report: Generate comprehensive import report
- Unique IDs: Format
ABO_{document_number}_{account_number}
- Duplicate Check: Search existing records by transaction ID
- Safe Storage: Transaction IDs stored in internal note field
- Pattern:
#ABO_123456_789012345#
for easy identification
This application is fully compatible with MultiFlexi application management:
{
"name": "Pohoda ABO Importer",
"description": "Import ABO bank statement files into Pohoda using mServer",
"executable": "pohoda-abo-importer",
"requirements": ["mServer", "Pohoda"],
"topics": ["Bank", "ABO", "Import", "Pohoda", "Statements"]
}
# Check mServer status
curl http://127.0.0.1:50000/status
# Enable debug mode
POHODA_DEBUG=true php src/importer.php file.abo-standard
# Check detailed logs
EASE_LOGGER=console php src/importer.php file.abo-standard
# Validate ABO file format
php -r "require 'vendor/autoload.php'; \$p = new \SpojeNet\AboParser\AboParser(); var_dump(\$p->parseFile('file.abo-standard'));"
# Ensure proper file permissions
chmod +x bin/pohoda-abo-importer
# Check file access
ls -la path/to/abo/file
- XML request/response files saved in
/tmp/
- Enable
POHODA_DEBUG=true
for detailed XML validation - Use
EASE_LOGGER=console
for verbose logging
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- PHP 8.4+ with strict types
- PSR-12 coding standard
- English comments and messages
- Comprehensive docblocks
- PHPUnit tests for new features
- Static analysis with PHPStan
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: Project Wiki
- Community: Discussions
- pohoda-raiffeisenbank - Raiffeisenbank API integration
- php-abo-parser - ABO format parser library
- PHP-Pohoda-Connector - Pohoda mServer client
- MultiFlexi - Application management platform
Made with ❤️ by Spoje.Net IT