https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41087

--- Comment #8 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 208012
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208012&action=edit
Bug 41087: Add Koha::Edifact::File->rollback core

Add Koha::Edifact::File->rollback_check and ->rollback.

rollback_check is a read-only pre-flight returning whether the message
can be rolled back, the reasons if not, and a summary of the impact.
Only QUOTE and INVOICE messages in status 'received' or 'error' can be
rolled back.

rollback re-runs the check inside a transaction with the message row
locked, so two staff members cannot undo the same message twice. It
then marks the message's open errors resolved (they are kept, not
deleted), sets the status to 'rolledback' and writes EDI_ROLLBACK to
the acquisitions log. If the check refuses it throws
Koha::Exceptions::EDI::RollbackNotPossible with the reasons and
changes nothing.

Undoing what an invoice or a quote created is added by the next two
patches.

Test plan:
1. Apply the patch
2. prove t/db_dependent/Koha/Edifact/File/Rollback.t

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to