From e9a13ed3f80f31efff8398f491216553462da363 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 --- .../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 f19fe43682..6ef77dd410 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 %] @@ -346,6 +358,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 $('') @@ -353,6 +366,7 @@ .append( ''+details.description+'' ) .append( ''+details.amount+'' ) .append( ''); + } }, endRender: null, }, -- 2.20.1