Project: Invio – automated Price Mismatch follow-ups Area: Procurement / Accounts Payable (AP)
An Excel file with data from two systems, already consolidated: sheet Ariba (2,500 purchase orders) and sheet Invoices (2,500 invoices).
The file is created with my own script dataset_mock_invio.py, which mirrors the SAP Ariba logic (PO numbers, statuses, currencies, payment terms).
Invio automates the analysis of procurement data and the sending of emails about net amount differences (Price Mismatch) between a Purchase Order (PO) and an invoice in CORA/Ariba. The tool removes the need to check hundreds of entries by hand and to send follow-ups to buyers, which saves a significant number of FTEs and speeds up the clarification of discrepancies.
2,500 POs from Ariba matched with 2,500 invoices → 223 received POs with an invoice on hold → 172 price mismatches above tolerance → 20 emails, one per requestor, prepared automatically. Sample report: output/Statistics.pdf
- Python
- pandas, openpyxl, reportlab, win32com, requests
- Frankfurter API (ECB currency rates)
- Excel, Outlook
-
Invio merges the purchase order table (Ariba) with the invoice table by PO number.
-
It looks for POs with the status "received" in Ariba and the status "hold" in the invoice table.
-
All amounts are converted to EUR with current ECB rates from the Frankfurter API. Without internet, fixed rates are used.
-
For these POs it calculates the net amount difference, in EUR and in % of the PO amount.
-
If the difference is greater than 200 EUR or 5% of the PO value, the PO goes to the requestor's list. Each requestor gets ONE email with a table of all their POs (PO number, both amounts, difference in EUR and in %).
-
The administrator gets a visual PDF report with statistics.
-
Safe test mode: DRY_RUN = True opens only 1 email preview, nothing is sent.
-
KPI: POs with invoice, received POs with invoice on hold, POs out of tolerance, emails created
-
Invoice status – all statuses
-
Price mismatch – direction (invoice above / below PO) and size of the difference (%)
-
Net difference to clarify – per currency (in EUR)
-
requestors_with_max_mismatches – top 5 requestors with the highest number of price mismatches
-
Addresses a real problem in many operational processes where checking and repetitive sending of reminders/follow-ups is required.
-
Reduces issues with explaining price mismatches and helps decrease invoice overdue cases, minimizing the risk of supplier issues or reputational damage.
-
The program administrator receives statistics, making it easier to control the Price Mismatch process.
-
Automates work within the procurement/AP department.
-
Designed for a typical corporate environment with a logged-in Outlook.
-
Dedicated to SAP Ariba, but easily adaptable to other systems — simply analyze the reports generated by any other platform.
-
One email per requestor: all POs to clarify in one HTML table (172 emails → 20), the same as in my Mobi project.
-
Live currency rates from the Frankfurter API (ECB), with fallback to fixed rates when offline.
-
Absolute tolerance in EUR: a difference above 200 EUR (or 5% of the PO value) needs clarification, whatever the PO currency.
-
The PDF report uses the Calibri font (Arial as a backup), so Polish characters (ł, ń, ś...) are displayed correctly, the same look as in my Mobi project.
-
Test data uses @example.com email addresses (a domain reserved for testing), so no real person can receive an email.
invio_g.py— main program: analysis, emails and PDF reportdataset_mock_invio.py— test data generator (creates the Excel file)procurement_mock_functions_g.py— module with functions for the generatoroutput/Statistics.pdf— sample report
Requirements Python 3.10+
Installed Outlook (for email sending).
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python dataset_mock_invio.py
python invio_g.pyTable with purchase orders (Ariba):

Code snippet: function generating the invoice number

Code snippet: Data Load & Merge & Clean

Email to buyer – all POs in one email, in a table:

------------------------------------------------ POLISH VERSION -----------------------------------------------------
Projekt: Invio – automatyczne follow-upy w sprawie różnic cenowych Obszar: Procurement / Accounts Payable (AP)
Plik Excel z danymi z dwóch systemów, już skonsolidowanymi: arkusz Ariba (2 500 zamówień) i arkusz Invoices (2 500 faktur).
Plik tworzy mój własny skrypt dataset_mock_invio.py, który odzwierciedla logikę SAP Ariba (numery PO, statusy, waluty, terminy płatności).
Program Invio automatyzuje analizę danych zakupowych oraz wysyłkę maili dotyczących różnic kwot netto (Price Mismatch) pomiędzy zamówieniem (PO) a fakturą w systemie CORA/Ariba. Narzędzie eliminuje konieczność ręcznego sprawdzania setek pozycji i wysyłania follow-upów do kupców, co pozwala zaoszczędzić znaczną liczbę FTE oraz przyspiesza wyjaśnianie niezgodności.
2 500 zamówień z Ariby połączonych z 2 500 fakturami → 223 przyjęte PO z fakturą wstrzymaną (hold) → 172 różnice cenowe powyżej tolerancji → 20 maili, po jednym na requestora, przygotowanych automatycznie. Przykładowy raport: output/Statistics.pdf
- Python
- pandas, openpyxl, reportlab, win32com, requests
- API Frankfurter (kursy walut EBC)
- Excel, Outlook
-
Invio łączy tabelę zamówień (Ariba) z tabelą faktur po numerze PO.
-
Szuka zamówień ze statusem „received” (przyjęte) w Aribie oraz ze statusem „hold” (wstrzymana) w tabeli faktur.
-
Wszystkie kwoty przelicza na EUR po aktualnych kursach EBC z API Frankfurter. Bez internetu używa kursów stałych.
-
Dla tych PO liczy różnicę kwot netto: w EUR i jako % kwoty zamówienia.
-
Jeżeli różnica jest większa niż 200 EUR lub 5% wartości zamówienia, PO trafia na listę requestora. Każdy requestor dostaje JEDEN mail z tabelką wszystkich swoich PO (numer PO, obie kwoty, różnica w EUR i w %).
-
Administrator dostaje raport PDF ze statystykami.
-
Bezpieczny tryb testowy: DRY_RUN = True otwiera tylko 1 podgląd maila, nic nie zostaje wysłane.
-
KPI: PO z fakturą, przyjęte PO z fakturą wstrzymaną, PO poza tolerancją, utworzone maile
-
Status faktur – wszystkie statusy
-
Price mismatch – kierunek (faktura powyżej / poniżej PO) i wielkość różnicy (%)
-
Różnica netto do wyjaśnienia – w podziale na waluty (w EUR)
-
requestors_with_max_mismatches – 5 requestorów z największą liczbą różnic cenowych
-
Odpowiada na realny problem w wielu procesach operacyjnych, gdzie trzeba ciągle sprawdzać pozycje i wysyłać przypominajki/follow-upy.
-
Zmniejsza problem z wyjaśnianiem price mismatch (różnic cenowych) i pomaga ograniczyć zaległe faktury (invoice overdue), a co za tym idzie – ryzyko kłopotów z dostawcami i utraty wizerunku.
-
Administrator dostaje statystyki, dzięki czemu łatwiej kontroluje proces Price Mismatch.
-
Automatyzuje pracę w dziale zakupów/AP.
-
Napisany pod typowe środowisko korporacyjne z zalogowanym Outlookiem.
-
Dedykowany SAP Ariba, ale łatwo go dopasować do innych systemów – wystarczy przeanalizować raporty z dowolnej innej platformy.
-
Jeden mail na requestora: wszystkie PO do wyjaśnienia w jednej tabelce HTML (172 maile → 20), tak samo jak w projekcie Mobi.
-
Aktualne kursy walut z API Frankfurter (EBC), a bez internetu kursy stałe.
-
Granica absolutna w EUR: różnica powyżej 200 EUR (lub 5% wartości PO) wymaga wyjaśnienia, niezależnie od waluty zamówienia.
-
Raport PDF korzysta z czcionki Calibri (zapasowo Arial), dzięki czemu polskie znaki (ł, ń, ś...) wyświetlają się poprawnie, tak samo jak w projekcie Mobi.
-
Dane testowe mają adresy @example.com (domena zarezerwowana do testów), więc żaden mail nie trafi do prawdziwej osoby.
invio_g.py— główny program: analiza, maile i raport PDFdataset_mock_invio.py— generator danych testowych (tworzy plik Excel)procurement_mock_functions_g.py— moduł z funkcjami dla generatoraoutput/Statistics.pdf— przykładowy raport
- Python 3.10+
- Zainstalowany Outlook (dla wysyłki maili)
W katalogu projektu uruchom:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python dataset_mock_invio.py
python invio_g.py



