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

Martin Renvoize (ashimema) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #187164|0                           |1
        is obsolete|                            |

--- Comment #8 from Martin Renvoize (ashimema) 
<[email protected]> ---
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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to