Skip to content
kamila-dudzinskaPublic

Repository files navigation

⚙️ Invio – automation of the Price Mismatch process in the AP department


Author: Kamila Dudzińska

Project: Invio – automated Price Mismatch follow-ups Area: Procurement / Accounts Payable (AP)

Source: procurement_mock_dataset_inv.xlsx

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).

🎯 Goal

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.

Result on test data

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

Technologies

  • Python
  • pandas, openpyxl, reportlab, win32com, requests
  • Frankfurter API (ECB currency rates)
  • Excel, Outlook

How the program works

  1. Invio merges the purchase order table (Ariba) with the invoice table by PO number.

  2. It looks for POs with the status "received" in Ariba and the status "hold" in the invoice table.

  3. All amounts are converted to EUR with current ECB rates from the Frankfurter API. Without internet, fixed rates are used.

  4. For these POs it calculates the net amount difference, in EUR and in % of the PO amount.

  5. 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 %).

  6. The administrator gets a visual PDF report with statistics.

  7. Safe test mode: DRY_RUN = True opens only 1 email preview, nothing is sent.

🧩 Report contains:

  • 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

Project advantages

  • 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.


✨ What's new (28.11.2026) ?

  • 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.

✨ What's new (29.10.2026) ?

  • 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.

Project structure

  • invio_g.py — main program: analysis, emails and PDF report
  • dataset_mock_invio.py — test data generator (creates the Excel file)
  • procurement_mock_functions_g.py — module with functions for the generator
  • output/Statistics.pdf — sample report

Installation & Launch

Requirements Python 3.10+

Installed Outlook (for email sending).

Installation

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python dataset_mock_invio.py
python invio_g.py

Table with purchase orders (Ariba): zamowienia

Table with invoices: faktury

Code snippet: function generating the invoice number functions

Code snippet: Data Load & Merge & Clean main

Code snippet: Statistics main_stat

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

Email to administrator: admin email

Report - visual metrics: report


Contact:

Kamila Dudzińska Email LinkedIn



------------------------------------------------ POLISH VERSION -----------------------------------------------------

⚙️ Invio – automatyzacja procesu Price Mismatch w dziale AP


Autor: Kamila Dudzińska

Projekt: Invio – automatyczne follow-upy w sprawie różnic cenowych Obszar: Procurement / Accounts Payable (AP)

Źródło: procurement_mock_dataset_inv.xlsx

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).

🎯 Cel

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.

Wynik na danych testowych

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

Technologie

  • Python
  • pandas, openpyxl, reportlab, win32com, requests
  • API Frankfurter (kursy walut EBC)
  • Excel, Outlook

🧩 Jak działa program

  1. Invio łączy tabelę zamówień (Ariba) z tabelą faktur po numerze PO.

  2. Szuka zamówień ze statusem „received” (przyjęte) w Aribie oraz ze statusem „hold” (wstrzymana) w tabeli faktur.

  3. Wszystkie kwoty przelicza na EUR po aktualnych kursach EBC z API Frankfurter. Bez internetu używa kursów stałych.

  4. Dla tych PO liczy różnicę kwot netto: w EUR i jako % kwoty zamówienia.

  5. 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 %).

  6. Administrator dostaje raport PDF ze statystykami.

  7. Bezpieczny tryb testowy: DRY_RUN = True otwiera tylko 1 podgląd maila, nic nie zostaje wysłane.

Raport zawiera:

  • 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

Zalety projektu:

  • 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.


✨ Nowości (28.11.2026)

  • 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.

✨ Nowości (29.10.2026)

  • 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.

Struktura projektu

  • invio_g.py — główny program: analiza, maile i raport PDF
  • dataset_mock_invio.py — generator danych testowych (tworzy plik Excel)
  • procurement_mock_functions_g.py — moduł z funkcjami dla generatora
  • output/Statistics.pdf — przykładowy raport

Instalacja i uruchomienie

Wymagania

  • Python 3.10+
  • Zainstalowany Outlook (dla wysyłki maili)

Instalacja

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

Tabela z zamówieniami (Ariba):

zamowienia

Tabela z fakturami:

faktury

Fragment kodu: funkcja generująca numer faktury

functions

Fragment kodu: ładowanie, łączenie i czyszczenie danych

main

Fragment kodu: statystyki

main_stat

Mail do kupca (requestora) – wszystkie PO w jednym mailu, w tabelce:

buyer email

Mail do administratora:

admin email

Raport - wizualizacja:

report


Kontakt:

Kamila Dudzińska Email LinkedIn

Releases

Packages

Contributors

Languages