Bugzilla – Attachment 186568 Details for
Bug 35612
Record branch context in accountlines.branchcode for OVERDUE, LOST, and PROCESSING fees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35612: Added branch code logic
Bug-35612-Added-branch-code-logic.patch (text/plain), 2.44 KB, created by
Laura Escamilla
on 2025-09-18 17:20:09 UTC
(
hide
)
Description:
Bug 35612: Added branch code logic
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-09-18 17:20:09 UTC
Size:
2.44 KB
patch
obsolete
>From e9ea9d2d558fee9894d3579a2c9a460bb7615235 Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Thu, 18 Sep 2025 16:22:59 +0000 >Subject: [PATCH] Bug 35612: Added branch code logic > >--- > Koha/Account.pm | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 0491325f5a..f8552cf2c2 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -28,6 +28,7 @@ use C4::Log qw( logaction ); > use C4::Stats qw( UpdateStats ); > use C4::Overdues qw(GetFine); > use C4::Context; >+use C4::Circulation; > > use Koha::Patrons; > use Koha::Account::Credits; >@@ -509,6 +510,30 @@ sub add_debit { > $schema->txn_do( > sub { > >+ my $branch_source = C4::Context->preference('AccountLinesBranchSource'); >+ my $branchcode; >+ >+ if ( $branch_source eq 'patronhomebranch' ) { >+ my $patron = Koha::Patrons->find( $self->{patron_id} ); >+ $branchcode = $patron ? $patron->branchcode : undef; >+ >+ } elsif ( $branch_source eq 'itemhomebranch' && $item_id ) { >+ my $item = Koha::Items->find($item_id); >+ $branchcode = $item ? $item->homebranch : undef; >+ >+ } elsif ( $branch_source eq 'checkoutbranch' && $issue_id ) { >+ my $issue = Koha::Checkouts->find($issue_id); >+ $branchcode = $issue ? $issue->branchcode : undef; >+ >+ } elsif ( $branch_source eq 'circcontrolbranch' && $item_id ) { >+ my $item = Koha::Items->find($item_id); >+ my $patron = Koha::Patrons->find( $self->{patron_id} ); >+ $branchcode = >+ ( $item && $patron ) >+ ? C4::Circulation::_GetCircControlBranch( $item, $patron ) >+ : undef; >+ } >+ > # Insert the account line > $line = Koha::Account::Line->new( > { >@@ -533,7 +558,7 @@ sub add_debit { > ? ( old_issue_id => $old_issue_id ) > : () > ), >- branchcode => $library_id, >+ branchcode => $branchcode, > register_id => $cash_register, > ( > $debit_type eq 'OVERDUE' >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35612
:
186567
| 186568 |
186569
|
186570
|
186571