From 1bfe4f50aab4f86e5dc39ebe43105f426e345ed7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 6 Aug 2020 12:28:48 +0100 Subject: [PATCH] Bug 19036: (QA follow-up) Add credit_number handling to POS This patch adds the display of 'credit_number' as a replacement for the internal 'accountlines_id' as the transaction identifier on the register summary page when using cash registers. Test plan 1/ Enable 'UseCashRegisters' 2/ Enable 'EnablePointOfSale' 3/ Enable at least one 'Debit type' to allow 'sale' 4/ Add at least one 'Cash register' 5/ Enable 'AutoCreditNumber' 6/ 'Enable automatic generation of credit number' for the 'Purchase' credit type 7/ Pay for an item via the Point of Sale page 8/ Navigate to the 'register' page to display the purchase details 9/ Confirm that the 'Transaction' is listed with a number of the form specified in the 'AutoCreditNumber' preference 10/ Refund an item from this screen 11/ Note that the 'accountlines_id' is used for this refund as we did not specify the 'Refund' credit type to use the 'AutoCreditNumber' system 12/ Signoff Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/pos/register.tt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 c566c57b83..f995580f33 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -77,7 +77,7 @@ [% IF credit.debit %] [% accountline.accountlines_id | html %] - { "type": "credit", "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 -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } [%- PROCESS account_type_description account=credit.debit -%] @@ -101,7 +101,7 @@ [% IF debit.credit %] [% accountline.accountlines_id | html %] - { "type": "debit", "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 -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } [%- PROCESS account_type_description account=debit.credit -%] @@ -166,7 +166,7 @@ [% IF credit.debit %] [% accountline.accountlines_id | html %] - { "type": "credit", "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 -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" } [%- PROCESS account_type_description account=credit.debit -%] @@ -188,7 +188,7 @@ [% IF debit.credit %] [% accountline.accountlines_id | html %] - { "type": "debit", "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 -%] ([% 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 %] @@ -306,8 +306,9 @@ dataSrc: 0, startRender: function ( rows, group ) { var details = JSON.parse(rows.data().pluck(1).pop()); + var identifier = details.identifier || group; return $('') - .append( ''+group+'' ) + .append( ''+identifier+'' ) .append( ''+details.description+'' ) .append( ''+details.amount+'' ) .append( ''); @@ -326,8 +327,9 @@ dataSrc: 0, startRender: function ( rows, group ) { var details = JSON.parse(rows.data().pluck(1).pop()); + var identifier = details.identifier || group; return $('') - .append( ''+group+'' ) + .append( ''+identifier+'' ) .append( ''+details.description+'' ) .append( ''+details.amount+'' ) .append( ''); -- 2.39.5