Browse Source

Bug 28368: Add fallback language for anonymous payment receipts

This adds a fallback for when a payment is made anonymously to allow
printing a receipt in the staff members current session language.

Test plan
1. Set `EnablePointOfSale` and `UseCashRegisters`
2. Add new cash register`
3. New debit type that 'can be sold'
4. Make a sale (via Point of Sale) using the above debit type.
5. Attempt to 'print receipt' from the subsequent prompt
6. Not the ISE: Can't call method "lang"
7. Apply patch
8. Attempt to 'print receipt' again, this time it should work.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
tags/v21.05.00
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      pos/printreceipt.pl

+ 2
- 1
pos/printreceipt.pl View File

@@ -51,8 +51,9 @@ output_and_exit_if_error(
}
) if $patron; # Payment could have been anonymous

my $lang = $patron ? $patron->lang : $template->lang;
my $letter = C4::Letters::getletter( 'pos', 'RECEIPT',
C4::Context::mybranch, 'print', $patron->lang );
C4::Context::mybranch, 'print', $lang );

$template->param(
letter => $letter,


Loading…
Cancel
Save