Skip to content

calKU0/HydraAcceptKSeFInvoice

Repository files navigation

HydraAcceptKSeFInvoice

Project Purpose

HydraAcceptKSeFInvoice is a Hydra callback extension that handles KSeF document acceptance during document editing (KSFEdycja).

The extension:

  • adds a button to the document window,
  • shows acceptance status via an icon (green/yellow/red),
  • opens a dedicated acceptance window,
  • saves user decisions and updates data in the database.

How It Works (Flow)

  1. The callback initializes repositories and event subscriptions.
  2. When the document window opens, an acceptance button is added.
  3. The button icon is determined by acceptance status (Accepted, PartiallyAccepted, NotAccepted).
  4. Clicking the button opens MainWindow with document data and the acceptance list.
  5. The user can:
    • save with acceptance,
    • save without acceptance,
    • reject the document.
  6. The result is returned to the callback, which:
    • updates Hydra form fields (qualification, rejected, description),
    • saves acceptance updates to dbo.KSeFAkceptacje,
    • refreshes the window.

Project Structure

  • HydraCallback.cs – callback entry point and Hydra UI integration.
  • Views/MainWindow.xaml + Views/MainWindow.xaml.cs – WPF window and acceptance presentation logic.
  • Repositories/KSeFRepository.cs – read/write operations for KSeF acceptance data.
  • Repositories/OperatorRepository.cs – operator-to-worker mapping.
  • Models/Acceptation.cs – acceptance row data model.
  • Data/AcceptationResult.cs – result model returned from the acceptance window.
  • Data/Enums/* – enum types (Qualification, AcceptationStatus).
  • Data/EnumExtensions.cs – helper extension for enum descriptions.

Business Rules Implemented

  • Description is required for Dokument_VAT qualification.
  • The acceptance screen limits approval to authorized rows (CanAccept).
  • For “save without acceptance”, acceptance updates are cleared.
  • Rejecting a document sets rejected state and unchecks editable acceptance rows.

Data Layer

Repositories use System.Data.SqlClient and operate on datebase tables:

Operations include:

  • calculating document acceptance status,
  • loading the full acceptance list,
  • updating acceptance info (flag, accepting worker, date).

Technology

  • .NET Framework 4.8
  • WPF
  • Hydra Callback API
  • SQL Server (SqlClient)

License

This project is proprietary and confidential.

It was developed for a client and is not permitted to be shared, redistributed, or used without explicit written permission from the owner.

See LICENSE for details.


© 2025-present calKU0

About

Hydra callback extension for KSeF invoice acceptance in Comarch ERP, with multi-step approval UI (WPF) and SQL Server persistence.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages