Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc
Nick Clemens b29a7148a9 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>
2021-10-21 10:09:50 +02:00

58 lines
2.4 KiB
PHP

[%- BLOCK account_type_description -%]
<span>
[%- IF account.credit_type_code -%]
[%- PROCESS credit_type_description credit_type_code = account.credit_type_code -%]
[%- ELSIF account.debit_type_code -%]
[%- PROCESS debit_type_description debit_type_code = account.debit_type_code -%]
[%- END -%]
[%- PROCESS account_status_description account=account -%]
</span>
[%- END -%]
[%- BLOCK debit_type_description -%]
[%- SWITCH debit_type_code -%]
[%- CASE 'ACCOUNT' -%]Account creation fee
[%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee
[%- CASE 'LOST' -%]Lost item
[%- CASE 'MANUAL' -%]Manual fee
[%- CASE 'NEW_CARD' -%]New card
[%- CASE 'OVERDUE' -%]Fine
[%- CASE 'PROCESSING' -%]Lost item processing fee
[%- CASE 'RENT' -%]Rental fee
[%- CASE 'RENT_DAILY' -%]Daily rental fee
[%- CASE 'RENT_RENEW' -%]Renewal of rental item
[%- CASE 'RENT_DAILY_RENEW' -%]Renewal of daily rental item
[%- CASE 'RESERVE' -%]Hold fee
[%- CASE 'RESERVE_EXPIRED' -%]Hold waiting too long
[%- CASE 'Payout' -%]Payout
[%- CASE -%][% debit_type.description | html %]
[%- END -%]
[%- END -%]
[%- BLOCK credit_type_description -%]
[%- SWITCH credit_type_code -%]
[%- CASE 'PAYMENT' -%]Payment
[%- CASE 'WRITEOFF' -%]Writeoff
[%- CASE 'FORGIVEN' -%]Forgiven
[%- CASE 'CREDIT' -%]Credit
[%- CASE 'LOST_FOUND' -%]Lost item fee refund
[%- CASE 'OVERPAYMENT' -%]Overpayment refund
[%- CASE 'REFUND' -%]Refund
[%- CASE 'CANCELLATION' -%]Cancelled charge
[%- CASE -%][% credit_type.description | html %]
[%- END -%]
[%- END -%]
[%- BLOCK account_status_description -%]
[%- SWITCH account.status -%]
[%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
[%- CASE 'RETURNED' -%]<span> (Returned)</span>
[%- CASE 'REPLACED' -%]<span> (Replaced)</span>
[%- CASE 'REFUNDED' -%]<span> (Refunded)</span>
[%- CASE 'FORGIVEN' -%]<span> (Forgiven)</span>
[%- CASE 'VOID' -%]<span> (Voided)</span>
[%- CASE 'LOST' -%]<span> (Lost)</span>
[%- CASE 'CANCELLED' -%]<span> (Cancelled)</span>
[%- CASE -%]
[%- END -%]
[%- END -%]