https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31448
--- Comment #11 from Katrin Fischer <[email protected]> --- Hm, actually I only point I wanted to talk about was number 3, the code duplication. For the other 2 I already noted that I would be ok with keeping things as they are. And only talking about this piece of code here: my $receipt_sent = 0; +if ( $action eq 'send_receipt' ) { + my $credit_id = scalar $input->param('accountlines_id'); + my $credit = Koha::Account::Lines->find($credit_id); + my @credit_offsets = + $credit->credit_offsets( { type => 'APPLY' } )->as_list; + if ( + my $letter = C4::Letters::GetPreparedLetter( + module => 'circulation', + letter_code => uc( "ACCOUNT_" . $credit->credit_type_code ), + message_transport_type => 'email', + lang => $patron->lang, + tables => { + borrowers => $patron->borrowernumber, + branches => C4::Context::mybranch, + }, + substitute => { + credit => $credit, + offsets => \@credit_offsets, + }, + ) + ) + { + my $message_id = C4::Letters::EnqueueLetter( + { + letter => $letter, + borrowernumber => $patron->borrowernumber, + message_transport_type => 'email', + } + ); + C4::Letters::SendQueuedMessages( { message_id => $message_id } ); + $receipt_sent = 1; + } + else { + $receipt_sent = -1; + } +} Compared to here: https://git.koha-community.org/Koha-community/Koha/src/branch/master/Koha/Account.pm#L113 Maybe it's not worth moving it into a separate thing, not sure. Maybe I missed some major differences? But now also a little confused about the lot of other clean-up you were talking about? -- 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/
