|
Lines 30-35
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_htt
Link Here
|
| 30 |
use CGI qw ( -utf8 ); |
30 |
use CGI qw ( -utf8 ); |
| 31 |
use C4::Members; |
31 |
use C4::Members; |
| 32 |
use C4::Accounts; |
32 |
use C4::Accounts; |
|
|
33 |
use C4::Letters; |
| 33 |
use Koha::Cash::Registers; |
34 |
use Koha::Cash::Registers; |
| 34 |
use Koha::Patrons; |
35 |
use Koha::Patrons; |
| 35 |
use Koha::Patron::Categories; |
36 |
use Koha::Patron::Categories; |
|
Lines 171-176
if ( $action eq 'discount' ) {
Link Here
|
| 171 |
); |
172 |
); |
| 172 |
} |
173 |
} |
| 173 |
|
174 |
|
|
|
175 |
my $receipt_sent = 0; |
| 176 |
if ( $action eq 'send_receipt' ) { |
| 177 |
my $credit_id = scalar $input->param('accountlines_id'); |
| 178 |
my $credit = Koha::Account::Lines->find($credit_id); |
| 179 |
my @credit_offsets = |
| 180 |
$credit->credit_offsets( { type => 'APPLY' } )->as_list; |
| 181 |
if ( |
| 182 |
my $letter = C4::Letters::GetPreparedLetter( |
| 183 |
module => 'circulation', |
| 184 |
letter_code => uc( "ACCOUNT_" . $credit->credit_type_code ), |
| 185 |
message_transport_type => 'email', |
| 186 |
lang => $patron->lang, |
| 187 |
tables => { |
| 188 |
borrowers => $patron->borrowernumber, |
| 189 |
branches => C4::Context::mybranch, |
| 190 |
}, |
| 191 |
substitute => { |
| 192 |
credit => $credit, |
| 193 |
offsets => \@credit_offsets, |
| 194 |
}, |
| 195 |
) |
| 196 |
) |
| 197 |
{ |
| 198 |
my $message_id = C4::Letters::EnqueueLetter( |
| 199 |
{ |
| 200 |
letter => $letter, |
| 201 |
borrowernumber => $patron->borrowernumber, |
| 202 |
message_transport_type => 'email', |
| 203 |
} |
| 204 |
); |
| 205 |
C4::Letters::SendQueuedMessages( { message_id => $message_id } ); |
| 206 |
$receipt_sent = 1; |
| 207 |
} |
| 208 |
else { |
| 209 |
$receipt_sent = -1; |
| 210 |
} |
| 211 |
} |
| 212 |
|
| 174 |
#get account details |
213 |
#get account details |
| 175 |
my $total = $patron->account->balance; |
214 |
my $total = $patron->account->balance; |
| 176 |
|
215 |
|
|
Lines 213-218
$template->param(
Link Here
|
| 213 |
payment_id => $payment_id, |
252 |
payment_id => $payment_id, |
| 214 |
change_given => $change_given, |
253 |
change_given => $change_given, |
| 215 |
renew_results => $renew_results_display, |
254 |
renew_results => $renew_results_display, |
|
|
255 |
receipt_sent => $receipt_sent, |
| 216 |
csrf_token => $csrf_token, |
256 |
csrf_token => $csrf_token, |
| 217 |
); |
257 |
); |
| 218 |
|
258 |
|
| 219 |
- |
|
|