[Bug 38195] New: Koha::EDI should use Koha::Acquisition::Order instead of plain DBIC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Bug ID: 38195 Summary: Koha::EDI should use Koha::Acquisition::Order instead of plain DBIC Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |38489 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38489 [Bug 38489] EDI should be updated to use the new FTP/SFTP Servers management page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187161 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187161&action=edit Bug 38195: Add Koha::EDI::Account and Koha::EDI::Accounts object classes This patch introduces Koha::Object-based classes for managing vendor EDI accounts, replacing direct DBIx::Class result access with proper Koha object wrappers. New classes: - Koha::EDI::Account: Object class representing a single EDI account - Koha::EDI::Accounts: Objects class for collections of EDI accounts The Koha::EDI::Account class provides accessor methods for all related objects following modern Koha naming conventions: - vendor() - Returns the associated Koha::Acquisition::Bookseller - file_transport() - Returns the associated Koha::File::Transport - shipment_fund() - Returns the Koha::Acquisition::Fund for shipment fund - files() - Returns Koha::Edifact::Files (EDIFACT interchange files) The Schema Result class has been updated with koha_object_class() and koha_objects_class() helper methods to enable automatic object inflation. This modernization enables cleaner code in controllers and provides a consistent API for working with EDI accounts throughout the codebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187162 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187162&action=edit Bug 38195: Convert admin/edi_accounts.pl to use Koha::EDI::Account(s) This patch modernizes the EDI accounts administration controller to use the new Koha::EDI::Account(s) object classes instead of raw DBIx::Class result access. Changes to admin/edi_accounts.pl: - Replaced Aqbookseller searches with Koha::Acquisition::Booksellers - Replaced FileTransport searches with Koha::File::Transports - Updated account save operations to use Koha::EDI::Account->new/set/store - Updated account delete to use Koha::EDI::Accounts->find->delete - Simplified display logic using to_api with embed parameter for automatic relationship inflation and JSON status decoding - Leverages Koha::File::Transport->to_api which handles JSON decoding of the status field automatically Benefits: - Much cleaner, more maintainable code following modern Koha patterns - Automatic relationship inflation via to_api embed parameter - Status decoding handled automatically by Koha::File::Transport->to_api - Single line conversion using map and to_api - Consistent API representation across the codebase - No manual JSON decoding or data transformation in controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187163 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187163&action=edit Bug 38195: Modernise Koha::Edifact::Transport to use Koha::Objects This patch updates Koha::Edifact::Transport to use the new Koha::EDI::Accounts and Koha::Edifact::Files object classes instead of raw DBIx::Class objects. Changes: - Replaced $schema->resultset('VendorEdiAccount')->find() with Koha::EDI::Accounts->find() - Replaced resultset('EdifactMessage')->find( { filename => $f, } ); with Koha::Edifact::Files->search( { filename => $f }); - Simplified file_transport retrieval by using the relationship method from Koha::EDI::Account->file_transport() - Removed conditional logic as the relationship method handles undef cases automatically Benefits: - Cleaner code using Koha object patterns - Automatic relationship handling via accessor methods - More maintainable and consistent with rest of codebase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187164 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187164&action=edit Bug 38195: Convert Koha::EDI to use Koha object classes This patch updates Koha::EDI to use modern Koha object classes instead of raw DBIx::Class access. Changes to vendor_edi_accounts access: - Added use Koha::EDI::Accounts; - Replaced three instances of $schema->resultset('VendorEdiAccount') with Koha::EDI::Accounts in: 1. create_edi_order() - Finding vendor account by vendor_id 2. process_invoice() - Finding vendor account by SAN 3. process_quote() - Finding vendor account for auto_orders check Changes to aqorders access: - Added use Koha::Acquisition::Orders; - Converted five instances from raw DBIx::Class to Koha::Objects: 1. create_edi_order() - Changed from ->all array to resultset with ->count, ->next, ->reset, and ->_resultset->all for iteration 2. process_invoice() - Changed ->find to use Koha::Acquisition::Orders 3-4. process_quote() - Changed two ->create calls to use Koha::Acquisition::Order->new()->store pattern 5. process_quote() - Changed ->find to use Koha::Acquisition::Orders Additional improvements: - Used idiomatic Koha::Objects patterns (->count, ->next, ->reset) - Maintained backward compatibility with existing code expectations - Cleaner variable naming (e.g., $vendor -> $edi_account) Benefits: - Consistent use of Koha object patterns throughout EDI code - Enables use of relationship methods from Koha objects - More maintainable and testable code - Better integration with Koha's ORM layer -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Koha::EDI should use |EDI/Edifact classes should |Koha::Acquisition::Order |use Koha::Objects instead |instead of plain DBIC |of plain DBIC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |40587 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40587 [Bug 40587] Prevent selection of different EAN's on EDI ORDER when the Basket is generated from a QUOTE message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187161|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187178 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187178&action=edit Bug 38195: Add Koha::EDI::Account and Koha::EDI::Accounts object classes This patch introduces Koha::Object-based classes for managing vendor EDI accounts, replacing direct DBIx::Class result access with proper Koha object wrappers. New classes: - Koha::EDI::Account: Object class representing a single EDI account - Koha::EDI::Accounts: Objects class for collections of EDI accounts The Koha::EDI::Account class provides accessor methods for all related objects following modern Koha naming conventions: - vendor() - Returns the associated Koha::Acquisition::Bookseller - file_transport() - Returns the associated Koha::File::Transport - shipment_fund() - Returns the Koha::Acquisition::Fund for shipment fund - files() - Returns Koha::Edifact::Files (EDIFACT interchange files) The Schema Result class has been updated with koha_object_class() and koha_objects_class() helper methods to enable automatic object inflation. This modernization enables cleaner code in controllers and provides a consistent API for working with EDI accounts throughout the codebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187162|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187179 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187179&action=edit Bug 38195: Convert admin/edi_accounts.pl to use Koha::EDI::Account(s) This patch modernizes the EDI accounts administration controller to use the new Koha::EDI::Account(s) object classes instead of raw DBIx::Class result access. Changes to admin/edi_accounts.pl: - Replaced Aqbookseller searches with Koha::Acquisition::Booksellers - Replaced FileTransport searches with Koha::File::Transports - Updated account save operations to use Koha::EDI::Account->new/set/store - Updated account delete to use Koha::EDI::Accounts->find->delete - Simplified display logic using to_api with embed parameter for automatic relationship inflation and JSON status decoding - Leverages Koha::File::Transport->to_api which handles JSON decoding of the status field automatically Benefits: - Much cleaner, more maintainable code following modern Koha patterns - Automatic relationship inflation via to_api embed parameter - Status decoding handled automatically by Koha::File::Transport->to_api - Single line conversion using map and to_api - Consistent API representation across the codebase - No manual JSON decoding or data transformation in controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187163|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187180 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187180&action=edit Bug 38195: Modernise Koha::Edifact::Transport to use Koha::Objects This patch updates Koha::Edifact::Transport to use the new Koha::EDI::Accounts and Koha::Edifact::Files object classes instead of raw DBIx::Class objects. Changes: - Replaced $schema->resultset('VendorEdiAccount')->find() with Koha::EDI::Accounts->find() - Replaced resultset('EdifactMessage')->find( { filename => $f, } ); with Koha::Edifact::Files->search( { filename => $f }); - Simplified file_transport retrieval by using the relationship method from Koha::EDI::Account->file_transport() - Removed conditional logic as the relationship method handles undef cases automatically Benefits: - Cleaner code using Koha object patterns - Automatic relationship handling via accessor methods - More maintainable and consistent with rest of codebase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187164|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 187181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187181&action=edit Bug 38195: Convert Koha::EDI to use Koha object classes This patch updates Koha::EDI to use modern Koha object classes instead of raw DBIx::Class access. Changes to vendor_edi_accounts access: - Added use Koha::EDI::Accounts; - Replaced three instances of $schema->resultset('VendorEdiAccount') with Koha::EDI::Accounts in: 1. create_edi_order() - Finding vendor account by vendor_id 2. process_invoice() - Finding vendor account by SAN 3. process_quote() - Finding vendor account for auto_orders check Changes to aqorders access: - Added use Koha::Acquisition::Orders; - Converted five instances from raw DBIx::Class to Koha::Objects: 1. create_edi_order() - Changed from ->all array to resultset with ->count, ->next, ->reset, and ->_resultset->all for iteration 2. process_invoice() - Changed ->find to use Koha::Acquisition::Orders 3-4. process_quote() - Changed two ->create calls to use Koha::Acquisition::Order->new()->store pattern 5. process_quote() - Changed ->find to use Koha::Acquisition::Orders Additional improvements: - Used idiomatic Koha::Objects patterns (->count, ->next, ->reset) - Maintained backward compatibility with existing code expectations - Cleaner variable naming (e.g., $vendor -> $edi_account) Benefits: - Consistent use of Koha object patterns throughout EDI code - Enables use of relationship methods from Koha objects - More maintainable and testable code - Better integration with Koha's ORM layer -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|40587 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40587 [Bug 40587] Prevent selection of different EAN's on EDI ORDER when the Basket is generated from a QUOTE message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41297 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41297 [Bug 41297] Add duplicate invoice number detection on EDI invoice import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41852 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41852 [Bug 41852] Modernize EDI support in Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30144 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30144 [Bug 30144] Add support for EDI GIR:LVT and/or GIR:LVC, Servicing instructions, segment -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|38489 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38489 [Bug 38489] EDI should be updated to use the new FTP/SFTP Servers management page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42001 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42001 [Bug 42001] Add duplicate purchase order number detection on EDI quote import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38195 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42010 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42010 [Bug 42010] Include escaping when using PO numbers in EDI acqusitions -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org