Skip to content
 
 

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Monitor - Automated Invoice Processing

Automated PDF invoice processor that extracts data, maps to SAP format, posts to SAP, and logs the DocEntry to Excel.

🎯 Quick Answer to Your Questions

Do I need to change the config before or after creating the .exe?

No changes needed! Your code is already perfect for .exe distribution. Here's why:

First Run: GUI dialogs automatically prompt users to select folders
Auto-Save: Configuration is saved to monitor_config.json
Future Runs: Uses saved config automatically

You can distribute just the .exe file, and each user configures it for their own system on first run!

🏗️ Creating the Windows .exe

Current Status

  • ✅ Code is ready
  • ✅ Build scripts created
  • ✅ Config system perfect (GUI-based)
  • ⏳ Need to build on Windows machine

Build Steps

On Windows:

# Install dependencies
pip install -r requirements.txt pyinstaller

# Build the .exe
build_exe.bat

Output: dist\PDF_Monitor.exe (distribute this file!)

Alternative: Without Windows

Use GitHub Actions to build automatically in the cloud (see WINDOWS_BUILD_GUIDE.md)

📦 Distribution

What to distribute:

📦 PDF_Monitor.exe  (that's it!)

What happens when users run it:

  1. Double-click PDF_Monitor.exe
  2. GUI dialogs appear asking for:
    • PDF monitoring folder
    • Excel output folder
    • Log file location
  3. User selections are saved to monitor_config.json
  4. Monitoring starts automatically
  5. Next time they run it, config is loaded automatically

🔧 How It Works

PDF File Detected
    ↓
Document Extract API (OCR)
    ↓
Mapping API (Map to SAP format)
    ↓
SAP Purchase Invoice API (Post invoice)
    ↓
Capture DocEntry from response
    ↓
Append to Excel with DocEntry

📄 Files Created

Build Scripts

  • build_exe.bat - Windows build script
  • build_exe.sh - Linux build script (creates Linux executable)
  • build_windows_exe.py - Python-based build script

Documentation

  • COMPLETE_GUIDE.md - START HERE - Answers all questions
  • QUICK_START.md - Fast reference guide
  • BUILD_WINDOWS_EXE.md - Detailed build instructions
  • WINDOWS_BUILD_GUIDE.md - Platform-specific info

Configuration

  • monitor_config.json - Auto-created on first run
  • monitor_config.template.json - Optional template for pre-configuration

🧪 Testing

  1. Build the .exe on Windows
  2. Run PDF_Monitor.exe
  3. Select folders via GUI dialogs
  4. Place a test PDF in the monitoring folder
  5. Check that:
    • PDF is processed
    • Invoice is posted to SAP
    • Excel file is created with DocEntry

📋 Requirements

  • Python 3.8+ (for building only, not for running the .exe)
  • Dependencies in requirements.txt:
    • watchdog
    • requests
    • pandas
    • openpyxl

Users don't need Python! The .exe is standalone.

🎨 Features

  • ✅ Automatic PDF monitoring
  • ✅ OCR extraction
  • ✅ SAP format mapping
  • ✅ Automatic SAP posting
  • ✅ DocEntry capture and logging
  • ✅ Excel output with full invoice data
  • ✅ GUI configuration on first run
  • ✅ Persistent configuration
  • ✅ Daily folder organization
  • ✅ Comprehensive logging

🔍 What Gets Saved to Excel

  • All invoice data fields
  • Document lines (item details)
  • SAP DocEntry (from posting response)
  • Timestamp and file information

📝 Configuration File Format

The app automatically creates monitor_config.json:

{
    "pdf_folder": "C:\\Users\\John\\Desktop\\PDF_Input",
    "base_output_folder": "C:\\Users\\John\\Desktop\\Excel_Output",
    "log_file": "C:\\Users\\John\\Desktop\\monitor.log"
}

You don't create this manually - the GUI dialogs create it!

🤔 FAQ

Q: Do I need to pre-configure paths before building the .exe?
A: No! The .exe will prompt users to select folders on first run.

Q: Can users change the configuration later?
A: Yes! Delete monitor_config.json and run the .exe again.

Q: Why is the .exe large (40-50 MB)?
A: It includes Python and all libraries for standalone operation.

Q: I built on Linux - why didn't I get a .exe?
A: PyInstaller creates executables for the OS you build on. Build on Windows for .exe.

Q: Do I need to include Python with the .exe?
A: No! The .exe is completely standalone.

Q: Will the SAP DocEntry be added to Excel?
A: Yes! The latest code captures DocEntry from the SAP response and adds it as SAP_DocEntry column.

🚀 Deployment

  1. Build PDF_Monitor.exe on Windows
  2. Test it on Windows
  3. Distribute just the .exe file
  4. Users run it and configure via GUI
  5. Done!

📞 Support

Users can reconfigure by:

  1. Deleting monitor_config.json
  2. Running the .exe again
  3. Selecting new folders in the GUI dialogs

Ready to build? See COMPLETE_GUIDE.md for step-by-step instructions!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages