From 8009a5f0d9b07ed1938da5ba47172ec75e8665be Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Aug 2022 11:06:57 +0100 Subject: [PATCH] Bug 29987: Display credit without offsets in transactions This patch adds a row to the transactions table for credits without corresponding offsets Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit d6262c0f302fb6140a3d0c311305502d667f2022) Signed-off-by: Lucas Gass (cherry picked from commit 702b10bb6b681f324b14357fe9fb5d03256c91d1) Signed-off-by: Arthur Suzuki --- .../prog/en/modules/pos/register.tt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 88892c7e01..02d5219738 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -99,9 +99,20 @@ [% FOREACH accountline IN accountlines %] [% IF accountline.is_credit %] + [% IF accountline.credit_offsets.count == 1 %] + + + {} + [% accountline.timestamp | $KohaDates with_hours => 1 %] ([% IF accountline.credit_number %][%- accountline.credit_number | html -%][% ELSE %][% accountline.accountlines_id | html %][% END %]) + [%- PROCESS account_type_description account=accountline -%] ([% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', accountline.payment_type ) | html %]) + + [% accountline.amount * -1 | $Price %] + + + [% ELSE %] [% FOREACH credit IN accountline.credit_offsets %] [% IF credit.debit %] - + [% accountline.accountlines_id | html %] { "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 %]", "timestamp": "[% accountline.timestamp | $KohaDates with_hours => 1 %]" } @@ -122,6 +133,7 @@ [% END %] [% END %] + [% END %] [% ELSE %] [% FOREACH debit IN accountline.debit_offsets %] [% IF debit.credit %] @@ -347,6 +359,7 @@ rowGroup: { dataSrc: 0, startRender: function ( rows, group ) { + if ( group ) { var details = JSON.parse(rows.data().pluck(1).pop()); var identifier = details.identifier || group; return $('') @@ -354,6 +367,7 @@ .append( ''+details.description+'' ) .append( ''+details.amount+'' ) .append( ''); + } }, endRender: null, }, -- 2.39.5