From 036165611c898322df6c0388a8ba9dfdb13b5151 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. Signed-off-by: Sally Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit a5d1614da6931eca76d511f1f2f989bba31faccc) Signed-off-by: Fridolin Somers --- .../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 51f3b90b84..32a08a3d19 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -100,9 +100,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 %] @@ -179,7 +179,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 %]" } [%- PROCESS account_type_description account=credit.debit -%] @@ -189,8 +189,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 %] @@ -201,11 +203,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.39.5