From d6262c0f302fb6140a3d0c311305502d667f2022 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 --- .../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 84cd8d56e1..8e8bd5c52d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -102,9 +102,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 %]" } @@ -125,6 +136,7 @@ [% END %] [% END %] + [% END %] [% ELSE %] [% FOREACH debit IN accountline.debit_offsets %] [% IF debit.credit %] @@ -349,6 +361,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 $('') @@ -356,6 +369,7 @@ .append( ''+details.description+'' ) .append( ''+details.amount+'' ) .append( ''); + } }, endRender: null, }, -- 2.39.5