View | Details | Raw Unified | Return to bug 19191
Collapse All | Expand All

(-)a/Koha/Account.pm (-2 / +2 lines)
Lines 270-283 sub pay { Link Here
270
                module                 => 'circulation',
270
                module                 => 'circulation',
271
                letter_code            => uc("ACCOUNT_$type"),
271
                letter_code            => uc("ACCOUNT_$type"),
272
                message_transport_type => 'email',
272
                message_transport_type => 'email',
273
                lang    => Koha::Patrons->find( $self->{patron_id} )->lang,
273
                lang    => $patron->lang,
274
                tables => {
274
                tables => {
275
                    borrowers       => $self->{patron_id},
275
                    borrowers       => $self->{patron_id},
276
                    branches        => $self->{library_id},
276
                    branches        => $self->{library_id},
277
                },
277
                },
278
                substitute => {
278
                substitute => {
279
                    credit => $payment,
279
                    credit => $payment,
280
                    offsets => scalar Koha::Account::Offsets->search( { id => { -in => [ map { $_->id } @account_offsets ] } } ),
280
                    offsets => \@account_offsets,
281
                },
281
                },
282
              )
282
              )
283
          )
283
          )
(-)a/installer/data/mysql/atomicupdate/bug_19191.sql (-1 / +1 lines)
Lines 1-7 Link Here
1
INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`)
1
INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`)
2
    VALUES
2
    VALUES
3
        ('circulation', 'ACCOUNT_PAYMENT', '', 'Account payment', 0, 'Account payment', '[%- USE Price -%]\r\nA payment of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis payment affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'),
3
        ('circulation', 'ACCOUNT_PAYMENT', '', 'Account payment', 0, 'Account payment', '[%- USE Price -%]\r\nA payment of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis payment affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'),
4
            ('circulation', 'ACCOUNT_WRITEOFF', '', 'Account Writeoff', 0, 'Account Writeoff', '[%- USE Price -%]\r\nAn account writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis writeoff affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default');
4
            ('circulation', 'ACCOUNT_WRITEOFF', '', 'Account writeoff', 0, 'Account writeoff', '[%- USE Price -%]\r\nAn account writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis writeoff affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default');
5
5
6
$dbh->do(q{
6
$dbh->do(q{
7
    INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`)
7
    INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`)
(-)a/t/db_dependent/Accounts.t (-2 / +1 lines)
Lines 1004-1010 subtest "Payment notice tests" => sub { Link Here
1004
1004
1005
    $id = $account->pay( { amount => 13, type => 'writeoff' } );
1005
    $id = $account->pay( { amount => 13, type => 'writeoff' } );
1006
    $notice = Koha::Notice::Messages->search()->next();
1006
    $notice = Koha::Notice::Messages->search()->next();
1007
    is( $notice->subject, 'Account Writeoff', 'Notice subject is correct for payment' );
1007
    is( $notice->subject, 'Account writeoff', 'Notice subject is correct for payment' );
1008
    is( $notice->letter_code, 'ACCOUNT_WRITEOFF', 'Notice letter code is correct for writeoff' );
1008
    is( $notice->letter_code, 'ACCOUNT_WRITEOFF', 'Notice letter code is correct for writeoff' );
1009
    is( $notice->content, 'A writeoff of 13.00 has been applied to your account.', 'Notice content is correct for writeoff' );
1009
    is( $notice->content, 'A writeoff of 13.00 has been applied to your account.', 'Notice content is correct for writeoff' );
1010
};
1010
};
1011
- 

Return to bug 19191