| Lines 1173-1179
          subtest "Payment notice tests" => sub {
      
      
        Link Here | 
        
          | 1173 |     )->store(); | 1173 |     )->store(); | 
        
          | 1174 |  | 1174 |  | 
        
          | 1175 |     my $letter = Koha::Notice::Templates->find( { code => 'ACCOUNT_PAYMENT' } ); | 1175 |     my $letter = Koha::Notice::Templates->find( { code => 'ACCOUNT_PAYMENT' } ); | 
          
            
              | 1176 |     $letter->content('[%- USE Price -%]A payment of [% credit.amount * -1 | $Price %] has been applied to your account.'); | 1176 |     $letter->content('[%- USE Price -%]A payment of [% credit.amount * -1 | $Price %] has been applied to your account. Your [% branch.branchcode %]'); | 
        
          | 1177 |     $letter->store(); | 1177 |     $letter->store(); | 
        
          | 1178 |  | 1178 |  | 
        
          | 1179 |     t::lib::Mocks::mock_preference('UseEmailReceipts', '0'); | 1179 |     t::lib::Mocks::mock_preference('UseEmailReceipts', '0'); | 
  
    | Lines 1185-1206
          subtest "Payment notice tests" => sub {
      
      
        Link Here | 
        
          | 1185 |  | 1185 |  | 
        
          | 1186 |     t::lib::Mocks::mock_preference('UseEmailReceipts', '1'); | 1186 |     t::lib::Mocks::mock_preference('UseEmailReceipts', '1'); | 
        
          | 1187 |  | 1187 |  | 
          
            
              | 1188 |     $id = $account->pay( { amount => 12 } ); | 1188 |     $id = $account->pay( { amount => 12, library_id => $branchcode } ); | 
        
          | 1189 |     my $notice = Koha::Notice::Messages->search()->next(); | 1189 |     my $notice = Koha::Notice::Messages->search()->next(); | 
        
          | 1190 |     is( $notice->subject, 'Account payment', 'Notice subject is correct for payment' ); | 1190 |     is( $notice->subject, 'Account payment', 'Notice subject is correct for payment' ); | 
        
          | 1191 |     is( $notice->letter_code, 'ACCOUNT_PAYMENT', 'Notice letter code is correct for payment' ); | 1191 |     is( $notice->letter_code, 'ACCOUNT_PAYMENT', 'Notice letter code is correct for payment' ); | 
          
            
              | 1192 |     is( $notice->content, 'A payment of 12.00 has been applied to your account.', 'Notice content is correct for payment' ); | 1192 |     is( $notice->content, "A payment of 12.00 has been applied to your account. Your $branchcode", 'Notice content is correct for payment' ); | 
        
          | 1193 |     $notice->delete(); | 1193 |     $notice->delete(); | 
        
          | 1194 |  | 1194 |  | 
        
          | 1195 |     $letter = Koha::Notice::Templates->find( { code => 'ACCOUNT_WRITEOFF' } ); | 1195 |     $letter = Koha::Notice::Templates->find( { code => 'ACCOUNT_WRITEOFF' } ); | 
          
            
              | 1196 |     $letter->content('[%- USE Price -%]A writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.'); | 1196 |     $letter->content('[%- USE Price -%]A writeoff of [% credit.amount * -1 | $Price %] has been applied to your account. Your [% branch.branchcode %]'); | 
        
          | 1197 |     $letter->store(); | 1197 |     $letter->store(); | 
        
          | 1198 |  | 1198 |  | 
          
            
              | 1199 |     $id = $account->pay( { amount => 13, type => 'WRITEOFF' } ); | 1199 |     $id = $account->pay( { amount => 13, type => 'WRITEOFF', library_id => $branchcode  } ); | 
        
          | 1200 |     $notice = Koha::Notice::Messages->search()->next(); | 1200 |     $notice = Koha::Notice::Messages->search()->next(); | 
        
          | 1201 |     is( $notice->subject, 'Account writeoff', 'Notice subject is correct for payment' ); | 1201 |     is( $notice->subject, 'Account writeoff', 'Notice subject is correct for payment' ); | 
        
          | 1202 |     is( $notice->letter_code, 'ACCOUNT_WRITEOFF', 'Notice letter code is correct for writeoff' ); | 1202 |     is( $notice->letter_code, 'ACCOUNT_WRITEOFF', 'Notice letter code is correct for writeoff' ); | 
          
            
              | 1203 |     is( $notice->content, 'A writeoff of 13.00 has been applied to your account.', 'Notice content is correct for writeoff' ); | 1203 |     is( $notice->content, "A writeoff of 13.00 has been applied to your account. Your $branchcode", 'Notice content is correct for writeoff' ); | 
        
          | 1204 | }; | 1204 | }; | 
        
          | 1205 |  | 1205 |  | 
        
          | 1206 | 1; | 1206 | 1; | 
            
              | 1207 | -  |  |  |