Bug 29271: Fix cash register report results
authorNick Clemens <nick@bywatersolutions.com>
Tue, 19 Oct 2021 13:03:07 +0000 (13:03 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Oct 2021 08:09:50 +0000 (10:09 +0200)
commitb29a7148a9123fec08277d91ba7c2d4a75c34db6
treee4f3c1e6a6c82e4f9c708c45e27dde2527b6482c
parent515a596fb95751d8cb1fb890b45e5112487e0dd4
Bug 29271: Fix cash register report results

This patch changes accounts.inc to use the credit/debit type codes directly
rather than needlessly fetching the credit_type/debit_type object jsut to get
the code. This allows the BLOCK to work on non-object lines

We also only pass a debit or credit type to csv (accountline cannot be both)

empty-line.inc is also removed in favor of correcting the markup

one more column added to total line

To test:
1 - Add some debits and credits to accounts
2 - Browse to Reports->Cash register
3 - Select transaction type 'All transactions'
4 - Output to screen
5 - Run report
6 - Note transaction types column is empty
7 - Output to a file
8 - Run report
9 - Open file and note:
      amount column is out of place
      extra line before total
10 - Apply patch
11 - Repeat and note display and export are correct

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt
koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc
reports/cash_register_stats.pl