From f0f58d7f16fda6d42660dfab7e3183fe121b4b72 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 13 May 2021 11:25:36 +0100 Subject: [PATCH] Bug 28344: Restore ability to issue refund against older payments When implimenting the refund features into the point of sale system, it appears that at some point we lost the ability to apply refunds against accountlines in the historic transactions table. This patch restores that ability. Test plan: 1/ Add some transations via the point of sale system 2/ Navigate to the 'register details' page and note that you have the option to refund some of the lines. 3/ Use the Cashup option to make the transactions historic 4/ Refresh the page and then select a past date to see the historic transactions in the second datatable 5/ Note that the option to refund has not dissapeared from all lines 6/ Apply patch 7/ Refresh and note the refund option now appears as expected. --- .../prog/en/modules/pos/register.tt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt index 64a997685e..e9f79e17a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -113,9 +113,9 @@ [% credit.debit.amount | $Price %] - [% IF CAN_user_cash_management_anonymous_refund && !(credit.debit.status == 'REFUNDED' ) %] - - [% ELSIF CAN_user_updatecharges_refund && !(credit.debit.status == 'REFUNDED') && credit.debit.borrowernumber %] + [% IF CAN_user_cash_management_anonymous_refund && !(credit.debit.status == 'REFUNDED') && !(credit.debit.debit_type_code == 'PAYOUT') %] + + [% ELSIF CAN_user_updatecharges_refund && !(credit.debit.status == 'REFUNDED') && credit.debit.borrowernumber && !(credit.debit.debit_type_code == 'PAYOUT') %] [% END %] @@ -192,7 +192,7 @@ [% IF credit.debit %] [% accountline.accountlines_id | html %] - { "type": "credit", "identifier": "[%- accountline.credit_number | html -%]", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } + { "type": "credit", "identifier": "[%- accountline.credit_number | html -%]", "description": "[%- PROCESS account_type_description account=accountline -%] ([% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } [% IF accountline.timestamp %][% accountline.timestamp | $KohaDates with_hours => 1 %][% END %] [%- PROCESS account_type_description account=credit.debit -%] @@ -202,8 +202,10 @@ [% credit.debit.amount | $Price %] - [% IF CAN_user_cash_management_refund_cash_registers && !(credit.debit.status == 'REFUNDED') && !(credit.debit.debit_type_code == 'PAYOUT') %] + [% IF CAN_user_cash_management_anonymous_refund && !(credit.debit.status == 'REFUNDED') && !(credit.debit.debit_type_code == 'PAYOUT') %] + [% ELSIF CAN_user_updatecharges_refund && !(credit.debit.status == 'REFUNDED') && credit.debit.borrowernumber && !(credit.debit.debit_type_code == 'PAYOUT') %] + [% END %] @@ -214,11 +216,13 @@ [% IF debit.credit %] [% accountline.accountlines_id | html %] - { "type": "debit", "identifier": "[%- accountline.credit_number | html -%]", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } + { "type": "debit", "identifier": "[%- accountline.credit_number | html -%]", "description": "[%- PROCESS account_type_description account=accountline -%] ([% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } [%- PROCESS account_type_description account=debit.credit -%] - [%- IF debit.credit.description %][% debit.credit.description | html %][% END %] -  [% IF ( debit.credit.itemnumber ) %][% debit.credit.item.biblio.title | html %][% END %] + + [%- IF debit.credit.description %][% debit.credit.description | html %][%- END -%] + [%- IF ( debit.credit.itemnumber ) -%] ([% debit.credit.item.biblio.title | html %])[%- END -%] + [% debit.credit.amount | $Price %] -- 2.20.1